From a5fc25f3ab3444670af3f91a75a532c64c53510a Mon Sep 17 00:00:00 2001 From: liuxiaoyu <45345701+MisterRaindrop@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:12:58 +0800 Subject: [PATCH 001/151] feat: add s3 file io integration (#548) --- .github/workflows/test.yml | 36 ++++ CMakeLists.txt | 7 + ci/scripts/build_iceberg.sh | 1 + ci/scripts/start_minio.sh | 153 +++++++++++++++ .../IcebergThirdpartyToolchain.cmake | 8 + src/iceberg/CMakeLists.txt | 15 ++ src/iceberg/arrow/CMakeLists.txt | 2 + src/iceberg/arrow/arrow_file_io.h | 20 ++ src/iceberg/arrow/arrow_fs_file_io.cc | 22 ++- src/iceberg/arrow/arrow_fs_file_io_internal.h | 3 + src/iceberg/arrow/file_io_register.cc | 61 ++++++ src/iceberg/arrow/file_io_register.h | 34 ++++ src/iceberg/arrow/s3/CMakeLists.txt | 18 ++ src/iceberg/arrow/s3/arrow_s3_file_io.cc | 184 ++++++++++++++++++ src/iceberg/arrow/s3/s3_properties.h | 54 +++++ src/iceberg/catalog/rest/CMakeLists.txt | 1 + src/iceberg/catalog/rest/catalog_properties.h | 2 + src/iceberg/catalog/rest/meson.build | 2 + src/iceberg/catalog/rest/rest_catalog.cc | 10 +- src/iceberg/catalog/rest/rest_catalog.h | 9 +- src/iceberg/catalog/rest/rest_file_io.cc | 95 +++++++++ src/iceberg/catalog/rest/rest_file_io.h | 47 +++++ src/iceberg/file_io_registry.cc | 61 ++++++ src/iceberg/file_io_registry.h | 64 ++++++ src/iceberg/meson.build | 6 +- src/iceberg/test/CMakeLists.txt | 5 + src/iceberg/test/arrow_s3_file_io_test.cc | 184 ++++++++++++++++++ src/iceberg/test/meson.build | 1 + .../test/rest_catalog_integration_test.cc | 12 +- src/iceberg/test/rest_file_io_test.cc | 144 ++++++++++++++ 30 files changed, 1244 insertions(+), 17 deletions(-) create mode 100644 ci/scripts/start_minio.sh create mode 100644 src/iceberg/arrow/file_io_register.cc create mode 100644 src/iceberg/arrow/file_io_register.h create mode 100644 src/iceberg/arrow/s3/CMakeLists.txt create mode 100644 src/iceberg/arrow/s3/arrow_s3_file_io.cc create mode 100644 src/iceberg/arrow/s3/s3_properties.h create mode 100644 src/iceberg/catalog/rest/rest_file_io.cc create mode 100644 src/iceberg/catalog/rest/rest_file_io.h create mode 100644 src/iceberg/file_io_registry.cc create mode 100644 src/iceberg/file_io_registry.h create mode 100644 src/iceberg/test/arrow_s3_file_io_test.cc create mode 100644 src/iceberg/test/rest_file_io_test.cc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5eb26e06b..c60f42b1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,12 +41,24 @@ jobs: name: AMD64 Ubuntu 24.04 runs-on: ubuntu-24.04 timeout-minutes: 30 + strategy: + fail-fast: false + env: + ICEBERG_TEST_S3_URI: s3://iceberg-test + AWS_ACCESS_KEY_ID: minio + AWS_SECRET_ACCESS_KEY: minio123 + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: http://127.0.0.1:9000 + AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@v6 - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Start MinIO + shell: bash + run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: bash env: @@ -63,9 +75,21 @@ jobs: name: AArch64 macOS 26 runs-on: macos-26 timeout-minutes: 30 + strategy: + fail-fast: false + env: + ICEBERG_TEST_S3_URI: s3://iceberg-test + AWS_ACCESS_KEY_ID: minio + AWS_SECRET_ACCESS_KEY: minio123 + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: http://127.0.0.1:9000 + AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@v6 + - name: Start MinIO + shell: bash + run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: bash run: ci/scripts/build_iceberg.sh $(pwd) @@ -76,6 +100,15 @@ jobs: name: AMD64 Windows 2025 runs-on: windows-2025 timeout-minutes: 60 + strategy: + fail-fast: false + env: + ICEBERG_TEST_S3_URI: s3://iceberg-test + AWS_ACCESS_KEY_ID: minio + AWS_SECRET_ACCESS_KEY: minio123 + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: http://127.0.0.1:9000 + AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@v6 @@ -85,6 +118,9 @@ jobs: vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows - name: Setup sccache uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + - name: Start MinIO + shell: bash + run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: cmd env: diff --git a/CMakeLists.txt b/CMakeLists.txt index e7281fb11..c0f2eb73f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ option(ICEBERG_BUILD_TESTS "Build tests" ON) option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON) option(ICEBERG_BUILD_REST "Build rest catalog client" ON) option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF) +option(ICEBERG_S3 "Build with S3 support" OFF) option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) @@ -68,6 +69,12 @@ if(ICEBERG_BUILD_REST_INTEGRATION_TESTS AND WIN32) message(WARNING "Cannot build rest integration test on Windows, turning it off.") endif() +# ICEBERG_S3 requires ICEBERG_BUILD_BUNDLE +if(NOT ICEBERG_BUILD_BUNDLE AND ICEBERG_S3) + set(ICEBERG_S3 OFF) + message(STATUS "ICEBERG_S3 is disabled because ICEBERG_BUILD_BUNDLE is OFF") +endif() + include(CMakeParseArguments) include(IcebergBuildUtils) include(IcebergSanitizer) diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 102c8ec11..cf332c21c 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -36,6 +36,7 @@ CMAKE_ARGS=( "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}" "-DICEBERG_BUILD_STATIC=ON" "-DICEBERG_BUILD_SHARED=ON" + "-DICEBERG_S3=ON" "-DICEBERG_BUILD_REST_INTEGRATION_TESTS=${build_rest_integration_test}" ) diff --git a/ci/scripts/start_minio.sh b/ci/scripts/start_minio.sh new file mode 100644 index 000000000..026be670c --- /dev/null +++ b/ci/scripts/start_minio.sh @@ -0,0 +1,153 @@ +#!/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 -eux + +MINIO_ROOT_USER="${MINIO_ROOT_USER:-minio}" +MINIO_ROOT_PASSWORD="${MINIO_ROOT_PASSWORD:-minio123}" +MINIO_IMAGE="${MINIO_IMAGE:-minio/minio:latest}" +MINIO_CONTAINER_NAME="${MINIO_CONTAINER_NAME:-iceberg-minio}" +MINIO_PORT="${MINIO_PORT:-9000}" +MINIO_CONSOLE_PORT="${MINIO_CONSOLE_PORT:-9001}" +MINIO_BUCKET="${MINIO_BUCKET:-iceberg-test}" +MINIO_ENDPOINT="${MINIO_ENDPOINT:-http://127.0.0.1:${MINIO_PORT}}" + +wait_for_minio() { + for i in {1..30}; do + if curl -fsS "${MINIO_ENDPOINT}/minio/health/ready" >/dev/null; then + return 0 + fi + sleep 1 + done + echo "MinIO did not become ready after 30 seconds." >&2 + echo "Endpoint: ${MINIO_ENDPOINT}" >&2 + if command -v docker >/dev/null 2>&1; then + docker logs "${MINIO_CONTAINER_NAME}" 2>&1 || true + fi + return 1 +} + +start_minio_docker() { + if ! command -v docker >/dev/null 2>&1; then + return 1 + fi + + if docker ps -a --format '{{.Names}}' | grep -q "^${MINIO_CONTAINER_NAME}\$"; then + docker rm -f "${MINIO_CONTAINER_NAME}" + fi + + docker run -d --name "${MINIO_CONTAINER_NAME}" \ + -p "${MINIO_PORT}:9000" -p "${MINIO_CONSOLE_PORT}:9001" \ + -e "MINIO_ROOT_USER=${MINIO_ROOT_USER}" \ + -e "MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}" \ + "${MINIO_IMAGE}" \ + server /data --console-address ":${MINIO_CONSOLE_PORT}" + + wait_for_minio +} + +start_minio_macos() { + if ! command -v brew >/dev/null 2>&1; then + echo "brew is required to start MinIO on macOS without Docker" >&2 + return 1 + fi + + brew install minio + MINIO_ROOT_USER="${MINIO_ROOT_USER}" MINIO_ROOT_PASSWORD="${MINIO_ROOT_PASSWORD}" \ + minio server /tmp/minio --console-address ":${MINIO_CONSOLE_PORT}" & + wait_for_minio +} + +download_mc() { + local uname_out + uname_out="$(uname -s)" + + local mc_dir + mc_dir="${RUNNER_TEMP:-/tmp}" + mkdir -p "${mc_dir}" + + case "${uname_out}" in + Linux*) + MC_BIN="${mc_dir}/mc" + curl -sSL "https://dl.min.io/client/mc/release/linux-amd64/mc" -o "${MC_BIN}" + chmod +x "${MC_BIN}" + ;; + Darwin*) + MC_BIN="${mc_dir}/mc" + local arch + arch="$(uname -m)" + if [ "${arch}" = "arm64" ]; then + curl -sSL "https://dl.min.io/client/mc/release/darwin-arm64/mc" -o "${MC_BIN}" + else + curl -sSL "https://dl.min.io/client/mc/release/darwin-amd64/mc" -o "${MC_BIN}" + fi + chmod +x "${MC_BIN}" + ;; + MINGW*|MSYS*|CYGWIN*) + MC_BIN="${mc_dir}/mc.exe" + curl -sSL "https://dl.min.io/client/mc/release/windows-amd64/mc.exe" -o "${MC_BIN}" + ;; + *) + echo "Unsupported OS for mc: ${uname_out}" >&2 + return 1 + ;; + esac +} + +create_bucket() { + download_mc + for i in {1..30}; do + if "${MC_BIN}" alias set local "${MINIO_ENDPOINT}" "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"; then + break + fi + sleep 1 + done + "${MC_BIN}" mb --ignore-existing "local/${MINIO_BUCKET}" +} + +start_minio_windows() { + local minio_dir="${RUNNER_TEMP:-/tmp}" + local minio_bin="${minio_dir}/minio.exe" + curl -sSL "https://dl.min.io/server/minio/release/windows-amd64/minio.exe" -o "${minio_bin}" + MINIO_ROOT_USER="${MINIO_ROOT_USER}" MINIO_ROOT_PASSWORD="${MINIO_ROOT_PASSWORD}" \ + "${minio_bin}" server "${minio_dir}/minio-data" --console-address ":${MINIO_CONSOLE_PORT}" & + wait_for_minio +} + +case "$(uname -s)" in + Darwin*) + if ! start_minio_docker; then + start_minio_macos + fi + ;; + MINGW*|MSYS*|CYGWIN*) + if ! start_minio_docker; then + start_minio_windows + fi + ;; + Linux*) + start_minio_docker + ;; + *) + echo "Unsupported OS: $(uname -s)" >&2 + exit 1 + ;; +esac + +create_bucket diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 8b32eb749..d4f837d67 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -102,6 +102,7 @@ function(resolve_arrow_dependency) # Work around undefined symbol: arrow::ipc::ReadSchema(arrow::io::InputStream*, arrow::ipc::DictionaryMemo*) set(ARROW_IPC ON) set(ARROW_FILESYSTEM ON) + set(ARROW_S3 ${ICEBERG_S3}) set(ARROW_JSON ON) set(ARROW_PARQUET ON) set(ARROW_SIMD_LEVEL "NONE") @@ -164,6 +165,13 @@ function(resolve_arrow_dependency) install(FILES ${arrow_bundled_dependencies_location} DESTINATION ${ICEBERG_INSTALL_LIBDIR}) endif() + + # Arrow's exported static target interface may reference system libraries + # (e.g. OpenSSL, CURL, ZLIB) that consumers need to find. + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB) + if(ARROW_S3) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES OpenSSL CURL) + endif() else() set(ARROW_VENDORED FALSE) find_package(Arrow CONFIG REQUIRED) diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 4cd5e92c5..1c6a13cb9 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -43,6 +43,7 @@ set(ICEBERG_SOURCES expression/rewrite_not.cc expression/strict_metrics_evaluator.cc expression/term.cc + file_io_registry.cc file_reader.cc file_writer.cc inheritable_metadata.cc @@ -181,6 +182,8 @@ add_subdirectory(util) if(ICEBERG_BUILD_BUNDLE) set(ICEBERG_BUNDLE_SOURCES arrow/arrow_fs_file_io.cc + arrow/s3/arrow_s3_file_io.cc + arrow/file_io_register.cc arrow/metadata_column_util.cc avro/avro_data_util.cc avro/avro_direct_decoder.cc @@ -247,6 +250,18 @@ if(ICEBERG_BUILD_BUNDLE) OUTPUTS ICEBERG_BUNDLE_LIBRARIES) + foreach(target iceberg_bundle_static iceberg_bundle_shared) + if(TARGET ${target}) + if(ICEBERG_S3) + target_compile_definitions(${target} + PUBLIC "$") + else() + target_compile_definitions(${target} + PUBLIC "$") + endif() + endif() + endforeach() + add_subdirectory(arrow) add_subdirectory(avro) add_subdirectory(parquet) diff --git a/src/iceberg/arrow/CMakeLists.txt b/src/iceberg/arrow/CMakeLists.txt index 3416d5e95..71c161f02 100644 --- a/src/iceberg/arrow/CMakeLists.txt +++ b/src/iceberg/arrow/CMakeLists.txt @@ -16,3 +16,5 @@ # under the License. iceberg_install_all_headers(iceberg/arrow) + +add_subdirectory(s3) diff --git a/src/iceberg/arrow/arrow_file_io.h b/src/iceberg/arrow/arrow_file_io.h index 12a9b2303..e33826dc6 100644 --- a/src/iceberg/arrow/arrow_file_io.h +++ b/src/iceberg/arrow/arrow_file_io.h @@ -20,9 +20,12 @@ #pragma once #include +#include +#include #include "iceberg/file_io.h" #include "iceberg/iceberg_bundle_export.h" +#include "iceberg/result.h" namespace iceberg::arrow { @@ -30,4 +33,21 @@ ICEBERG_BUNDLE_EXPORT std::unique_ptr MakeMockFileIO(); ICEBERG_BUNDLE_EXPORT std::unique_ptr MakeLocalFileIO(); +/// \brief Create an S3 FileIO backed by Arrow's S3FileSystem. +/// +/// This function initializes the S3 subsystem if not already initialized (thread-safe). +/// The S3 initialization is cached once per process. +/// +/// \param properties Configuration properties for S3 access. See S3Properties +/// for available keys (credentials, region, endpoint, timeouts, etc.). +/// \return A FileIO instance for S3 operations, or an error if S3 is not supported. +ICEBERG_BUNDLE_EXPORT Result> MakeS3FileIO( + const std::unordered_map& properties = {}); + +/// \brief Finalize (clean up) the Arrow S3 subsystem. +/// +/// Must be called before process exit if S3 was initialized, otherwise Arrow's +/// static destructors may cause a non-zero exit. +ICEBERG_BUNDLE_EXPORT Status FinalizeS3(); + } // namespace iceberg::arrow diff --git a/src/iceberg/arrow/arrow_fs_file_io.cc b/src/iceberg/arrow/arrow_fs_file_io.cc index be62b79af..769fcfb13 100644 --- a/src/iceberg/arrow/arrow_fs_file_io.cc +++ b/src/iceberg/arrow/arrow_fs_file_io.cc @@ -25,13 +25,23 @@ #include "iceberg/arrow/arrow_file_io.h" #include "iceberg/arrow/arrow_fs_file_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/util/macros.h" namespace iceberg::arrow { +Result ArrowFileSystemFileIO::ResolvePath(const std::string& file_location) { + if (file_location.find("://") != std::string::npos) { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto path, arrow_fs_->PathFromUri(file_location)); + return path; + } + return file_location; +} + /// \brief Read the content of the file at the given location. Result ArrowFileSystemFileIO::ReadFile(const std::string& file_location, std::optional length) { - ::arrow::fs::FileInfo file_info(file_location); + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + ::arrow::fs::FileInfo file_info(path); if (length.has_value()) { file_info.set_size(length.value()); } @@ -47,6 +57,10 @@ Result ArrowFileSystemFileIO::ReadFile(const std::string& file_loca ICEBERG_ARROW_ASSIGN_OR_RETURN( auto read_bytes, file->Read(read_length, reinterpret_cast(&content[offset]))); + if (read_bytes == 0) { + return IOError("Unexpected EOF reading {}: got {} of {} bytes", file_location, + offset, file_size); + } remain -= read_bytes; offset += read_bytes; } @@ -57,7 +71,8 @@ Result ArrowFileSystemFileIO::ReadFile(const std::string& file_loca /// \brief Write the given content to the file at the given location. Status ArrowFileSystemFileIO::WriteFile(const std::string& file_location, std::string_view content) { - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file, arrow_fs_->OpenOutputStream(file_location)); + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file, arrow_fs_->OpenOutputStream(path)); ICEBERG_ARROW_RETURN_NOT_OK(file->Write(content.data(), content.size())); ICEBERG_ARROW_RETURN_NOT_OK(file->Flush()); ICEBERG_ARROW_RETURN_NOT_OK(file->Close()); @@ -66,7 +81,8 @@ Status ArrowFileSystemFileIO::WriteFile(const std::string& file_location, /// \brief Delete a file at the given location. Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) { - ICEBERG_ARROW_RETURN_NOT_OK(arrow_fs_->DeleteFile(file_location)); + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + ICEBERG_ARROW_RETURN_NOT_OK(arrow_fs_->DeleteFile(path)); return {}; } diff --git a/src/iceberg/arrow/arrow_fs_file_io_internal.h b/src/iceberg/arrow/arrow_fs_file_io_internal.h index f151c7a5b..92a991501 100644 --- a/src/iceberg/arrow/arrow_fs_file_io_internal.h +++ b/src/iceberg/arrow/arrow_fs_file_io_internal.h @@ -56,6 +56,9 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO { const std::shared_ptr<::arrow::fs::FileSystem>& fs() const { return arrow_fs_; } private: + /// \brief Resolve a file location to a filesystem path. + Result ResolvePath(const std::string& file_location); + std::shared_ptr<::arrow::fs::FileSystem> arrow_fs_; }; diff --git a/src/iceberg/arrow/file_io_register.cc b/src/iceberg/arrow/file_io_register.cc new file mode 100644 index 000000000..1140e49b8 --- /dev/null +++ b/src/iceberg/arrow/file_io_register.cc @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "iceberg/arrow/file_io_register.h" + +#include +#include + +#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/file_io_registry.h" + +namespace iceberg::arrow { + +namespace { + +void RegisterLocalFileIO() { + FileIORegistry::Register( + std::string(FileIORegistry::kArrowLocalFileIO), + [](const std::unordered_map& /*properties*/) + -> Result> { return MakeLocalFileIO(); }); +} + +void RegisterS3FileIO() { +#if ICEBERG_S3_ENABLED + FileIORegistry::Register( + std::string(FileIORegistry::kArrowS3FileIO), + [](const std::unordered_map& properties) + -> Result> { return MakeS3FileIO(properties); }); +#endif +} + +} // namespace + +void EnsureArrowFileIOsRegistered() { + static std::once_flag flag; + std::call_once(flag, []() { + RegisterLocalFileIO(); + RegisterS3FileIO(); + }); +} + +[[maybe_unused]] const bool kArrowFileIOsRegistered = []() { + EnsureArrowFileIOsRegistered(); + return true; +}(); + +} // namespace iceberg::arrow diff --git a/src/iceberg/arrow/file_io_register.h b/src/iceberg/arrow/file_io_register.h new file mode 100644 index 000000000..1b4622bd7 --- /dev/null +++ b/src/iceberg/arrow/file_io_register.h @@ -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. + */ + +#pragma once + +/// \file iceberg/arrow/file_io_register.h +/// \brief Provide functions to register Arrow FileIO implementations. + +#include "iceberg/iceberg_bundle_export.h" + +namespace iceberg::arrow { + +/// \brief Register built-in Arrow FileIO implementations into the FileIORegistry. +/// +/// This operation is idempotent and safe to call multiple times. +ICEBERG_BUNDLE_EXPORT void EnsureArrowFileIOsRegistered(); + +} // namespace iceberg::arrow diff --git a/src/iceberg/arrow/s3/CMakeLists.txt b/src/iceberg/arrow/s3/CMakeLists.txt new file mode 100644 index 000000000..27eda89ed --- /dev/null +++ b/src/iceberg/arrow/s3/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +iceberg_install_all_headers(iceberg/arrow/s3) diff --git a/src/iceberg/arrow/s3/arrow_s3_file_io.cc b/src/iceberg/arrow/s3/arrow_s3_file_io.cc new file mode 100644 index 000000000..808415d0a --- /dev/null +++ b/src/iceberg/arrow/s3/arrow_s3_file_io.cc @@ -0,0 +1,184 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include + +#include +#if ICEBERG_S3_ENABLED +# include +#endif + +#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/arrow/s3/s3_properties.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/string_util.h" + +namespace iceberg::arrow { + +namespace { + +#if ICEBERG_S3_ENABLED +const std::string* FindProperty( + const std::unordered_map& properties, + std::string_view key) { + auto it = properties.find(std::string(key)); + return it == properties.end() ? nullptr : &it->second; +} + +Result> ParseOptionalBool( + const std::unordered_map& properties, + std::string_view key) { + const auto* value = FindProperty(properties, key); + if (value == nullptr) { + return std::nullopt; + } + if (*value == "true") { + return true; + } + if (*value == "false") { + return false; + } + return InvalidArgument(R"("{}" must be "true" or "false")", key); +} + +Status EnsureS3Initialized() { + static const ::arrow::Status init_status = []() { + auto options = ::arrow::fs::S3GlobalOptions::Defaults(); + return ::arrow::fs::InitializeS3(options); + }(); + if (!init_status.ok()) { + return std::unexpected(Error{.kind = ::iceberg::arrow::ToErrorKind(init_status), + .message = init_status.ToString()}); + } + return {}; +} + +/// \brief Configure S3Options from a properties map. +/// +/// \param properties The configuration properties map. +/// \return Configured S3Options. +Result<::arrow::fs::S3Options> ConfigureS3Options( + const std::unordered_map& properties) { + auto options = ::arrow::fs::S3Options::Defaults(); + + // Configure credentials + const auto* access_key = FindProperty(properties, S3Properties::kAccessKeyId); + const auto* secret_key = FindProperty(properties, S3Properties::kSecretAccessKey); + const auto* session_token = FindProperty(properties, S3Properties::kSessionToken); + + if ((access_key == nullptr) != (secret_key == nullptr)) { + return InvalidArgument( + "S3 client access key ID and secret access key must be set at the same time"); + } + if (access_key != nullptr) { + if (session_token != nullptr) { + options.ConfigureAccessKey(*access_key, *secret_key, *session_token); + } else { + options.ConfigureAccessKey(*access_key, *secret_key); + } + } + + // Configure region + if (const auto* region = FindProperty(properties, S3Properties::kRegion); + region != nullptr) { + options.region = *region; + } + + // Configure endpoint (for MinIO, LocalStack, etc.) + if (const auto* endpoint = FindProperty(properties, S3Properties::kEndpoint); + endpoint != nullptr) { + options.endpoint_override = *endpoint; + } else { + // Fall back to AWS standard environment variables for endpoint override + const char* s3_endpoint_env = std::getenv("AWS_ENDPOINT_URL_S3"); + if (s3_endpoint_env != nullptr) { + options.endpoint_override = s3_endpoint_env; + } else { + const char* endpoint_env = std::getenv("AWS_ENDPOINT_URL"); + if (endpoint_env != nullptr) { + options.endpoint_override = endpoint_env; + } + } + } + + ICEBERG_ASSIGN_OR_RAISE(const auto path_style_access, + ParseOptionalBool(properties, S3Properties::kPathStyleAccess)); + if (path_style_access.has_value()) { + options.force_virtual_addressing = !*path_style_access; + } + + // Configure SSL + ICEBERG_ASSIGN_OR_RAISE(const auto ssl_enabled, + ParseOptionalBool(properties, S3Properties::kSslEnabled)); + if (ssl_enabled.has_value() && !*ssl_enabled) { + options.scheme = "http"; + } + + // Configure timeouts + auto connect_timeout_it = properties.find(std::string(S3Properties::kConnectTimeoutMs)); + if (connect_timeout_it != properties.end()) { + ICEBERG_ASSIGN_OR_RAISE(auto timeout_ms, + StringUtils::ParseNumber(connect_timeout_it->second)); + options.connect_timeout = timeout_ms / 1000.0; + } + + auto socket_timeout_it = properties.find(std::string(S3Properties::kSocketTimeoutMs)); + if (socket_timeout_it != properties.end()) { + ICEBERG_ASSIGN_OR_RAISE(auto timeout_ms, + StringUtils::ParseNumber(socket_timeout_it->second)); + options.request_timeout = timeout_ms / 1000.0; + } + + return options; +} +#endif + +} // namespace + +Result> MakeS3FileIO( + const std::unordered_map& properties) { +#if ICEBERG_S3_ENABLED + ICEBERG_RETURN_UNEXPECTED(EnsureS3Initialized()); + + // Configure S3 options from properties (uses default credentials if empty) + ICEBERG_ASSIGN_OR_RAISE(auto options, ConfigureS3Options(properties)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto fs, ::arrow::fs::S3FileSystem::Make(options)); + + return std::make_unique(std::move(fs)); +#else + return NotSupported("Arrow S3 support is not enabled"); +#endif +} + +Status FinalizeS3() { +#if ICEBERG_S3_ENABLED + auto status = ::arrow::fs::FinalizeS3(); + ICEBERG_ARROW_RETURN_NOT_OK(status); + return {}; +#else + return NotSupported("Arrow S3 support is not enabled"); +#endif +} + +} // namespace iceberg::arrow diff --git a/src/iceberg/arrow/s3/s3_properties.h b/src/iceberg/arrow/s3/s3_properties.h new file mode 100644 index 000000000..53657743d --- /dev/null +++ b/src/iceberg/arrow/s3/s3_properties.h @@ -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. + */ + +#pragma once + +#include + +namespace iceberg::arrow { + +/// \brief S3 configuration property keys for ArrowS3FileIO. +/// +/// These constants define the property keys used to configure S3 access +/// via the Arrow filesystem integration, following the Iceberg spec for +/// S3 configuration properties. +struct S3Properties { + /// S3 URI scheme + static constexpr std::string_view kS3Schema = "s3"; + /// AWS access key ID + static constexpr std::string_view kAccessKeyId = "s3.access-key-id"; + /// AWS secret access key + static constexpr std::string_view kSecretAccessKey = "s3.secret-access-key"; + /// AWS session token (for temporary credentials) + static constexpr std::string_view kSessionToken = "s3.session-token"; + /// AWS region + static constexpr std::string_view kRegion = "s3.region"; + /// Custom endpoint override (for MinIO, LocalStack, etc.) + static constexpr std::string_view kEndpoint = "s3.endpoint"; + /// Whether to use path-style access (needed for MinIO) + static constexpr std::string_view kPathStyleAccess = "s3.path-style-access"; + /// Whether SSL is enabled + static constexpr std::string_view kSslEnabled = "s3.ssl.enabled"; + /// Connection timeout in milliseconds + static constexpr std::string_view kConnectTimeoutMs = "s3.connect-timeout-ms"; + /// Socket timeout in milliseconds + static constexpr std::string_view kSocketTimeoutMs = "s3.socket-timeout-ms"; +}; + +} // namespace iceberg::arrow diff --git a/src/iceberg/catalog/rest/CMakeLists.txt b/src/iceberg/catalog/rest/CMakeLists.txt index e91b12962..b862bc869 100644 --- a/src/iceberg/catalog/rest/CMakeLists.txt +++ b/src/iceberg/catalog/rest/CMakeLists.txt @@ -30,6 +30,7 @@ set(ICEBERG_REST_SOURCES json_serde.cc resource_paths.cc rest_catalog.cc + rest_file_io.cc rest_util.cc types.cc) diff --git a/src/iceberg/catalog/rest/catalog_properties.h b/src/iceberg/catalog/rest/catalog_properties.h index 41d7da796..0515926c7 100644 --- a/src/iceberg/catalog/rest/catalog_properties.h +++ b/src/iceberg/catalog/rest/catalog_properties.h @@ -47,6 +47,8 @@ class ICEBERG_REST_EXPORT RestCatalogProperties inline static Entry kName{"name", ""}; /// \brief The warehouse path. inline static Entry kWarehouse{"warehouse", ""}; + /// \brief The FileIO implementation name. + inline static Entry kIOImpl{"io-impl", ""}; /// \brief The optional prefix for REST API paths. inline static Entry kPrefix{"prefix", ""}; /// \brief The encoded separator used to join namespace levels in REST paths. diff --git a/src/iceberg/catalog/rest/meson.build b/src/iceberg/catalog/rest/meson.build index ef2500456..a1f8ce973 100644 --- a/src/iceberg/catalog/rest/meson.build +++ b/src/iceberg/catalog/rest/meson.build @@ -28,6 +28,7 @@ iceberg_rest_sources = files( 'json_serde.cc', 'resource_paths.cc', 'rest_catalog.cc', + 'rest_file_io.cc', 'rest_util.cc', 'types.cc', ) @@ -71,6 +72,7 @@ install_headers( 'iceberg_rest_export.h', 'resource_paths.h', 'rest_catalog.h', + 'rest_file_io.h', 'rest_util.h', 'type_fwd.h', 'types.h', diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index ebb03bf84..a0267adcb 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -34,6 +34,7 @@ #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/resource_paths.h" +#include "iceberg/catalog/rest/rest_file_io.h" #include "iceberg/catalog/rest/rest_util.h" #include "iceberg/catalog/rest/types.h" #include "iceberg/json_serde_internal.h" @@ -121,11 +122,8 @@ Result CaptureNoSuchNamespace(const auto& status) { RestCatalog::~RestCatalog() = default; Result> RestCatalog::Make( - const RestCatalogProperties& config, std::shared_ptr file_io) { + const RestCatalogProperties& config) { ICEBERG_ASSIGN_OR_RAISE(auto uri, config.Uri()); - if (!file_io) { - return InvalidArgument("FileIO is required to create RestCatalog"); - } std::string catalog_name = config.Get(RestCatalogProperties::kName); ICEBERG_ASSIGN_OR_RAISE(auto auth_manager, @@ -172,6 +170,9 @@ Result> RestCatalog::Make( ICEBERG_ASSIGN_OR_RAISE(auto catalog_session, auth_manager->CatalogSession(*client, final_config.configs())); + // Create FileIO with the final configuration + ICEBERG_ASSIGN_OR_RAISE(auto file_io, MakeCatalogFileIO(final_config)); + return std::shared_ptr( new RestCatalog(std::move(final_config), std::move(file_io), std::move(client), std::move(paths), std::move(endpoints), std::move(auth_manager), @@ -473,6 +474,7 @@ Result> RestCatalog::LoadTable(const TableIdentifier& ide ICEBERG_ASSIGN_OR_RAISE(const auto body, LoadTableInternal(identifier)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(body)); ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); + /// FIXME: support per-table FileIO creation return Table::Make(identifier, std::move(load_result.metadata), std::move(load_result.metadata_location), file_io_, shared_from_this()); diff --git a/src/iceberg/catalog/rest/rest_catalog.h b/src/iceberg/catalog/rest/rest_catalog.h index 38230a5e2..4fd4db5b8 100644 --- a/src/iceberg/catalog/rest/rest_catalog.h +++ b/src/iceberg/catalog/rest/rest_catalog.h @@ -46,13 +46,8 @@ class ICEBERG_REST_EXPORT RestCatalog : public Catalog, RestCatalog(RestCatalog&&) = delete; RestCatalog& operator=(RestCatalog&&) = delete; - /// \brief Create a RestCatalog instance - /// - /// \param config the configuration for the RestCatalog - /// \param file_io the FileIO instance to use for table operations - /// \return a shared_ptr to RestCatalog instance - static Result> Make(const RestCatalogProperties& config, - std::shared_ptr file_io); + /// \brief Create a RestCatalog instance. + static Result> Make(const RestCatalogProperties& config); std::string_view name() const override; diff --git a/src/iceberg/catalog/rest/rest_file_io.cc b/src/iceberg/catalog/rest/rest_file_io.cc new file mode 100644 index 000000000..f08a03353 --- /dev/null +++ b/src/iceberg/catalog/rest/rest_file_io.cc @@ -0,0 +1,95 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/catalog/rest/rest_file_io.h" + +#include + +#include "iceberg/file_io_registry.h" +#include "iceberg/util/macros.h" + +namespace iceberg::rest { + +namespace { + +bool IsBuiltinImpl(std::string_view io_impl) { + return io_impl == FileIORegistry::kArrowLocalFileIO || + io_impl == FileIORegistry::kArrowS3FileIO; +} + +} // namespace + +Result DetectBuiltinFileIO(std::string_view location) { + const auto pos = location.find("://"); + if (pos == std::string_view::npos) { + return BuiltinFileIOKind::kArrowLocal; + } + + const auto scheme = location.substr(0, pos); + if (scheme == "file") { + return BuiltinFileIOKind::kArrowLocal; + } + if (scheme == "s3") { + return BuiltinFileIOKind::kArrowS3; + } + + return NotSupported("URI scheme '{}' is not supported for automatic FileIO resolution", + scheme); +} + +std::string_view BuiltinFileIOName(BuiltinFileIOKind kind) { + switch (kind) { + case BuiltinFileIOKind::kArrowLocal: + return FileIORegistry::kArrowLocalFileIO; + case BuiltinFileIOKind::kArrowS3: + return FileIORegistry::kArrowS3FileIO; + } + std::unreachable(); +} + +Result> MakeCatalogFileIO(const RestCatalogProperties& config) { + std::string io_impl = config.Get(RestCatalogProperties::kIOImpl); + std::string warehouse = config.Get(RestCatalogProperties::kWarehouse); + + if (io_impl.empty()) { + if (warehouse.empty()) { + return InvalidArgument(R"("{}" or "{}" property is required to create FileIO)", + RestCatalogProperties::kIOImpl.key(), + RestCatalogProperties::kWarehouse.key()); + } + ICEBERG_ASSIGN_OR_RAISE(const auto detected_kind, DetectBuiltinFileIO(warehouse)); + io_impl = std::string(BuiltinFileIOName(detected_kind)); + } + + if (!warehouse.empty() && IsBuiltinImpl(io_impl)) { + ICEBERG_ASSIGN_OR_RAISE(const auto detected_kind, DetectBuiltinFileIO(warehouse)); + const auto detected_name = BuiltinFileIOName(detected_kind); + if (io_impl != detected_name) { + return InvalidArgument( + R"("io-impl" value '{}' is incompatible with warehouse '{}')", io_impl, + warehouse); + } + } + + // TODO(gangwu): Support Java-style customized FileIO creation flows instead of + // resolving a single catalog-scoped FileIO instance only from properties. + return FileIORegistry::Load(io_impl, config.configs()); +} + +} // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/rest_file_io.h b/src/iceberg/catalog/rest/rest_file_io.h new file mode 100644 index 000000000..68482521a --- /dev/null +++ b/src/iceberg/catalog/rest/rest_file_io.h @@ -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. + */ + +#pragma once + +#include +#include +#include + +#include "iceberg/catalog/rest/catalog_properties.h" +#include "iceberg/catalog/rest/iceberg_rest_export.h" +#include "iceberg/file_io.h" +#include "iceberg/file_io_registry.h" +#include "iceberg/result.h" + +namespace iceberg::rest { + +enum class BuiltinFileIOKind : uint8_t { + kArrowLocal, + kArrowS3, +}; + +ICEBERG_REST_EXPORT Result DetectBuiltinFileIO( + std::string_view location); + +ICEBERG_REST_EXPORT std::string_view BuiltinFileIOName(BuiltinFileIOKind kind); + +ICEBERG_REST_EXPORT Result> MakeCatalogFileIO( + const RestCatalogProperties& config); + +} // namespace iceberg::rest diff --git a/src/iceberg/file_io_registry.cc b/src/iceberg/file_io_registry.cc new file mode 100644 index 000000000..ffba8677a --- /dev/null +++ b/src/iceberg/file_io_registry.cc @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "iceberg/file_io_registry.h" + +#include +#include + +namespace iceberg { + +namespace { + +struct RegistryState { + std::mutex mutex; + std::unordered_map registry; +}; + +RegistryState& State() { + static RegistryState state; + return state; +} + +} // namespace + +void FileIORegistry::Register(const std::string& name, Factory factory) { + auto& state = State(); + std::lock_guard lock(state.mutex); + state.registry[name] = std::move(factory); +} + +Result> FileIORegistry::Load( + const std::string& name, + const std::unordered_map& properties) { + Factory factory; + { + auto& state = State(); + std::lock_guard lock(state.mutex); + auto it = state.registry.find(name); + if (it == state.registry.end()) { + return NotFound("FileIO implementation not found: {}", name); + } + factory = it->second; + } + return factory(properties); +} + +} // namespace iceberg diff --git a/src/iceberg/file_io_registry.h b/src/iceberg/file_io_registry.h new file mode 100644 index 000000000..a0be1b563 --- /dev/null +++ b/src/iceberg/file_io_registry.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/file_io.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief Registry for FileIO implementations. +/// +/// Provides a mechanism to register and load FileIO implementations by name. +/// This allows the REST catalog (and others) to resolve FileIO implementations +/// at runtime based on configuration properties like "io-impl". +class ICEBERG_EXPORT FileIORegistry { + public: + static constexpr std::string_view kArrowLocalFileIO = "arrow-fs-local"; + static constexpr std::string_view kArrowS3FileIO = "arrow-fs-s3"; + + /// Factory function type for creating FileIO instances. + using Factory = std::function>( + const std::unordered_map& properties)>; + + /// \brief Register a FileIO factory under the given name. + /// + /// \param name The implementation name (e.g., "local", "s3") + /// \param factory The factory function that creates the FileIO instance. + static void Register(const std::string& name, Factory factory); + + /// \brief Load a FileIO implementation by name. + /// + /// \param name The implementation name to look up. + /// \param properties Configuration properties to pass to the factory. + /// \return A unique_ptr to the FileIO instance, or an error if not found. + static Result> Load( + const std::string& name, + const std::unordered_map& properties); +}; + +} // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 99ac01f6d..1e6953c80 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -65,6 +65,7 @@ iceberg_sources = files( 'expression/rewrite_not.cc', 'expression/strict_metrics_evaluator.cc', 'expression/term.cc', + 'file_io_registry.cc', 'file_reader.cc', 'file_writer.cc', 'inheritable_metadata.cc', @@ -148,8 +149,8 @@ iceberg_sources = files( # CRoaring does not export symbols, so on Windows it must # be used as a static lib croaring_needs_static = ( - get_option('default_library') == 'static' or - host_machine.system() == 'windows' + get_option('default_library') == 'static' + or host_machine.system() == 'windows' ) croaring_dep = dependency('croaring', static: croaring_needs_static) nanoarrow_dep = dependency('nanoarrow') @@ -193,6 +194,7 @@ install_headers( 'exception.h', 'file_format.h', 'file_io.h', + 'file_io_registry.h', 'file_reader.h', 'file_writer.h', 'iceberg_export.h', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 2dc90da64..58edcf7e0 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -145,6 +145,10 @@ if(ICEBERG_BUILD_BUNDLE) metadata_io_test.cc struct_like_test.cc) + if(ICEBERG_S3) + add_iceberg_test(file_io_test USE_BUNDLE SOURCES arrow_s3_file_io_test.cc) + endif() + add_iceberg_test(catalog_test USE_BUNDLE SOURCES in_memory_catalog_test.cc) add_iceberg_test(eval_expr_test @@ -227,6 +231,7 @@ if(ICEBERG_BUILD_REST) SOURCES auth_manager_test.cc endpoint_test.cc + rest_file_io_test.cc rest_json_serde_test.cc rest_util_test.cc) diff --git a/src/iceberg/test/arrow_s3_file_io_test.cc b/src/iceberg/test/arrow_s3_file_io_test.cc new file mode 100644 index 000000000..d890ad10e --- /dev/null +++ b/src/iceberg/test/arrow_s3_file_io_test.cc @@ -0,0 +1,184 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/s3/s3_properties.h" +#include "iceberg/test/matchers.h" + +namespace { + +std::optional GetEnvIfSet(const char* key) { + const char* value = std::getenv(key); + if (value == nullptr || std::string_view(value).empty()) { + return std::nullopt; + } + return std::string(value); +} + +std::string MakeObjectUri(std::string_view base_uri, std::string_view object_name) { + std::string object_uri(base_uri); + if (!object_uri.ends_with('/')) { + object_uri += '/'; + } + object_uri += object_name; + return object_uri; +} + +std::unordered_map PropertiesFromEnv() { + std::unordered_map properties; + + if (const auto access_key = GetEnvIfSet("AWS_ACCESS_KEY_ID")) { + properties[std::string(iceberg::arrow::S3Properties::kAccessKeyId)] = *access_key; + } + if (const auto secret_key = GetEnvIfSet("AWS_SECRET_ACCESS_KEY")) { + properties[std::string(iceberg::arrow::S3Properties::kSecretAccessKey)] = *secret_key; + } + if (const auto endpoint = GetEnvIfSet("ICEBERG_TEST_S3_ENDPOINT")) { + properties[std::string(iceberg::arrow::S3Properties::kEndpoint)] = *endpoint; + } + if (const auto region = GetEnvIfSet("AWS_REGION")) { + properties[std::string(iceberg::arrow::S3Properties::kRegion)] = *region; + } + + return properties; +} + +} // namespace + +namespace iceberg::arrow { + +namespace { + +class ArrowS3FileIOTest : public ::testing::Test { + protected: + static void TearDownTestSuite() { + auto status = FinalizeS3(); + if (!status.has_value()) { + std::cerr << "Warning: FinalizeS3 failed: " << status.error().message << std::endl; + } + } + + void SetUp() override { base_uri_ = GetEnvIfSet("ICEBERG_TEST_S3_URI"); } + + std::string ObjectUri(std::string_view object_name) const { + return MakeObjectUri(*base_uri_, object_name); + } + + void RequireIntegrationEnv() const { + if (!base_uri_.has_value()) { + GTEST_SKIP() << "Set ICEBERG_TEST_S3_URI to enable S3 IO test"; + } + } + + private: + std::optional base_uri_; +}; + +} // namespace + +TEST_F(ArrowS3FileIOTest, CreateWithDefaultProperties) { + auto result = MakeS3FileIO({}); + ASSERT_THAT(result, IsOk()); + EXPECT_NE(result.value(), nullptr); +} + +TEST_F(ArrowS3FileIOTest, RequiresS3SupportAtBuildTime) { + auto result = MakeS3FileIO(); + ASSERT_THAT(result, IsOk()); +} + +TEST_F(ArrowS3FileIOTest, RejectsIncompleteStaticCredentials) { + auto result = + MakeS3FileIO({{std::string(S3Properties::kAccessKeyId), "access-key-only"}}); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage( + "S3 client access key ID and secret access key must be set")); +} + +TEST_F(ArrowS3FileIOTest, RejectsInvalidBooleanProperties) { + auto result = + MakeS3FileIO({{std::string(S3Properties::kPathStyleAccess), "not-a-bool"}}); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(ArrowS3FileIOTest, ReadWriteFile) { + RequireIntegrationEnv(); + auto io_res = MakeS3FileIO(); + ASSERT_THAT(io_res, IsOk()); + auto io = std::move(io_res).value(); + + auto object_uri = ObjectUri("iceberg_s3_io_test.txt"); + auto write_res = io->WriteFile(object_uri, "hello s3"); + ASSERT_THAT(write_res, IsOk()); + + auto read_res = io->ReadFile(object_uri, std::nullopt); + ASSERT_THAT(read_res, IsOk()); + EXPECT_THAT(read_res, HasValue(::testing::Eq("hello s3"))); + + auto del_res = io->DeleteFile(object_uri); + EXPECT_THAT(del_res, IsOk()); +} + +TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithProperties) { + RequireIntegrationEnv(); + auto io_res = MakeS3FileIO(PropertiesFromEnv()); + ASSERT_THAT(io_res, IsOk()); + auto io = std::move(io_res).value(); + + auto object_uri = ObjectUri("iceberg_s3_io_props_test.txt"); + auto write_res = io->WriteFile(object_uri, "hello s3 with properties"); + ASSERT_THAT(write_res, IsOk()); + + auto read_res = io->ReadFile(object_uri, std::nullopt); + ASSERT_THAT(read_res, IsOk()); + EXPECT_THAT(read_res, HasValue(::testing::Eq("hello s3 with properties"))); + + auto del_res = io->DeleteFile(object_uri); + EXPECT_THAT(del_res, IsOk()); +} + +TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithSslDisabled) { + RequireIntegrationEnv(); + std::unordered_map properties; + properties[std::string(S3Properties::kSslEnabled)] = "false"; + + auto io_res = MakeS3FileIO(properties); + ASSERT_THAT(io_res, IsOk()); +} + +TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithTimeouts) { + RequireIntegrationEnv(); + std::unordered_map properties; + properties[std::string(S3Properties::kConnectTimeoutMs)] = "5000"; + properties[std::string(S3Properties::kSocketTimeoutMs)] = "10000"; + + auto io_res = MakeS3FileIO(properties); + ASSERT_THAT(io_res, IsOk()); +} + +} // namespace iceberg::arrow diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 9a8da9dd5..9e6b16809 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -110,6 +110,7 @@ if get_option('rest').enabled() 'sources': files( 'auth_manager_test.cc', 'endpoint_test.cc', + 'rest_file_io_test.cc', 'rest_json_serde_test.cc', 'rest_util_test.cc', ), diff --git a/src/iceberg/test/rest_catalog_integration_test.cc b/src/iceberg/test/rest_catalog_integration_test.cc index b364ffd36..3de7e722a 100644 --- a/src/iceberg/test/rest_catalog_integration_test.cc +++ b/src/iceberg/test/rest_catalog_integration_test.cc @@ -39,6 +39,7 @@ #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/rest_catalog.h" +#include "iceberg/file_io_registry.h" #include "iceberg/partition_spec.h" #include "iceberg/result.h" #include "iceberg/schema.h" @@ -65,6 +66,7 @@ constexpr std::string_view kDockerProjectName = "iceberg-rest-catalog-service"; constexpr std::string_view kCatalogName = "test_catalog"; constexpr std::string_view kWarehouseName = "default"; constexpr std::string_view kLocalhostUri = "http://localhost"; +constexpr std::string_view kStdFileIOImpl = "test.StdFileIO"; /// \brief Check if a localhost port is ready to accept connections. bool CheckServiceReady(uint16_t port) { @@ -96,6 +98,12 @@ std::string CatalogUri() { return std::format("{}:{}", kLocalhostUri, kRestCatal class RestCatalogIntegrationTest : public ::testing::Test { protected: static void SetUpTestSuite() { + FileIORegistry::Register( + std::string(kStdFileIOImpl), + [](const std::unordered_map& /*properties*/) + -> Result> { + return std::make_unique(); + }); docker_compose_ = std::make_unique( std::string{kDockerProjectName}, GetResourcePath("iceberg-rest-fixture")); docker_compose_->Up(); @@ -126,10 +134,12 @@ class RestCatalogIntegrationTest : public ::testing::Test { config.Set(RestCatalogProperties::kUri, CatalogUri()) .Set(RestCatalogProperties::kName, std::string(kCatalogName)) .Set(RestCatalogProperties::kWarehouse, std::string(kWarehouseName)); + config.mutable_configs()[std::string(RestCatalogProperties::kIOImpl.key())] = + std::string(kStdFileIOImpl); for (const auto& [k, v] : extra) { config.mutable_configs()[k] = v; } - return RestCatalog::Make(config, std::make_shared()); + return RestCatalog::Make(config); } /// Create a catalog configured with a specific snapshot loading mode. diff --git a/src/iceberg/test/rest_file_io_test.cc b/src/iceberg/test/rest_file_io_test.cc new file mode 100644 index 000000000..e9131da3f --- /dev/null +++ b/src/iceberg/test/rest_file_io_test.cc @@ -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. + +#include "iceberg/catalog/rest/rest_file_io.h" + +#include +#include + +#include "iceberg/file_io_registry.h" +#include "iceberg/test/matchers.h" + +namespace iceberg::rest { + +namespace { + +class MockFileIO : public FileIO { + public: + Result ReadFile(const std::string& /*file_location*/, + std::optional /*length*/) override { + return std::string("mock"); + } + + Status WriteFile(const std::string& /*file_location*/, + std::string_view /*content*/) override { + return {}; + } + + Status DeleteFile(const std::string& /*file_location*/) override { return {}; } +}; + +} // namespace + +TEST(RestFileIOTest, DetectBuiltinKindFromScheme) { + EXPECT_THAT(DetectBuiltinFileIO("s3://bucket/path"), + HasValue(::testing::Eq(BuiltinFileIOKind::kArrowS3))); + EXPECT_THAT(DetectBuiltinFileIO("/tmp/warehouse"), + HasValue(::testing::Eq(BuiltinFileIOKind::kArrowLocal))); + EXPECT_THAT(DetectBuiltinFileIO("file:///tmp/warehouse"), + HasValue(::testing::Eq(BuiltinFileIOKind::kArrowLocal))); +} + +TEST(RestFileIOTest, DetectBuiltinKindRejectsUnsupportedScheme) { + auto result = DetectBuiltinFileIO("gs://bucket/warehouse"); + EXPECT_THAT(result, IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(result, HasErrorMessage("not supported for automatic FileIO resolution")); +} + +TEST(RestFileIOTest, MakeCatalogFileIOMissingImplAndWarehouse) { + auto result = MakeCatalogFileIO(RestCatalogProperties::default_properties()); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); +} + +TEST(RestFileIOTest, MakeCatalogFileIORejectsIncompatibleWarehouse) { + FileIORegistry::Register( + std::string(FileIORegistry::kArrowS3FileIO), + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto config = RestCatalogProperties::FromMap( + {{"io-impl", std::string(FileIORegistry::kArrowS3FileIO)}, + {"warehouse", "/tmp/warehouse"}}); + auto result = MakeCatalogFileIO(config); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("incompatible")); +} + +TEST(RestFileIOTest, MakeCatalogFileIOAutoDetectsFromWarehouse) { + FileIORegistry::Register( + std::string(FileIORegistry::kArrowLocalFileIO), + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto config = RestCatalogProperties::FromMap({{"warehouse", "/tmp/warehouse"}}); + auto result = MakeCatalogFileIO(config); + ASSERT_THAT(result, IsOk()); +} + +TEST(RestFileIOTest, MakeCatalogFileIORejectsUnsupportedWarehouseScheme) { + auto config = RestCatalogProperties::FromMap({{"warehouse", "gs://bucket/warehouse"}}); + auto result = MakeCatalogFileIO(config); + EXPECT_THAT(result, IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(result, HasErrorMessage("not supported for automatic FileIO resolution")); +} + +TEST(RestFileIOTest, MakeCatalogFileIOAllowsCompatibleWarehouse) { + FileIORegistry::Register( + std::string(FileIORegistry::kArrowS3FileIO), + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto config = RestCatalogProperties::FromMap( + {{"io-impl", std::string(FileIORegistry::kArrowS3FileIO)}, + {"warehouse", "s3://my-bucket/warehouse"}}); + auto result = MakeCatalogFileIO(config); + ASSERT_THAT(result, IsOk()); +} + +TEST(RestFileIOTest, MakeCatalogFileIOPassesThroughCustomImpl) { + const std::string custom_impl = "com.mycompany.CustomFileIO"; + FileIORegistry::Register( + custom_impl, + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto config = RestCatalogProperties::FromMap( + {{"io-impl", custom_impl}, {"warehouse", "/tmp/warehouse"}}); + auto result = MakeCatalogFileIO(config); + ASSERT_THAT(result, IsOk()); +} + +TEST(RestFileIOTest, MakeCatalogFileIOUnregisteredCustomImplReturnsNotFound) { + auto config = RestCatalogProperties::FromMap( + {{"io-impl", "com.nonexistent.FileIO"}, {"warehouse", "/tmp/warehouse"}}); + auto result = MakeCatalogFileIO(config); + EXPECT_THAT(result, IsError(ErrorKind::kNotFound)); +} + +TEST(RestFileIOTest, MakeCatalogFileIOSkipsCheckWhenWarehouseAbsent) { + FileIORegistry::Register( + std::string(FileIORegistry::kArrowLocalFileIO), + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto config = RestCatalogProperties::FromMap( + {{"io-impl", std::string(FileIORegistry::kArrowLocalFileIO)}}); + auto result = MakeCatalogFileIO(config); + ASSERT_THAT(result, IsOk()); +} + +} // namespace iceberg::rest From c38b392e8b87d2f07eea426643a60e00adf4dcca Mon Sep 17 00:00:00 2001 From: ZhaoXuan <425932451@qq.com> Date: Thu, 16 Apr 2026 23:28:03 +0800 Subject: [PATCH 002/151] feat(puffin): add format constants, utilities, and JSON serde (#603) --- src/iceberg/CMakeLists.txt | 2 + .../deletes/roaring_position_bitmap.cc | 30 +-- src/iceberg/meson.build | 2 + src/iceberg/puffin/json_serde.cc | 127 +++++++++++ src/iceberg/puffin/json_serde_internal.h | 56 +++++ src/iceberg/puffin/meson.build | 5 +- src/iceberg/puffin/puffin_format.cc | 78 +++++++ src/iceberg/puffin/puffin_format.h | 69 ++++++ src/iceberg/puffin/type_fwd.h | 30 +++ src/iceberg/test/CMakeLists.txt | 2 + src/iceberg/test/endian_test.cc | 12 ++ src/iceberg/test/meson.build | 3 + src/iceberg/test/puffin_format_test.cc | 37 ++++ src/iceberg/test/puffin_json_test.cc | 201 ++++++++++++++++++ src/iceberg/util/endian.h | 18 ++ 15 files changed, 645 insertions(+), 27 deletions(-) create mode 100644 src/iceberg/puffin/json_serde.cc create mode 100644 src/iceberg/puffin/json_serde_internal.h create mode 100644 src/iceberg/puffin/puffin_format.cc create mode 100644 src/iceberg/puffin/puffin_format.h create mode 100644 src/iceberg/puffin/type_fwd.h create mode 100644 src/iceberg/test/puffin_format_test.cc create mode 100644 src/iceberg/test/puffin_json_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 1c6a13cb9..603c35343 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -67,6 +67,8 @@ set(ICEBERG_SOURCES partition_spec.cc partition_summary.cc puffin/file_metadata.cc + puffin/puffin_format.cc + puffin/json_serde.cc row/arrow_array_wrapper.cc row/manifest_wrapper.cc row/partition_values.cc diff --git a/src/iceberg/deletes/roaring_position_bitmap.cc b/src/iceberg/deletes/roaring_position_bitmap.cc index 49cf9d909..2bf749589 100644 --- a/src/iceberg/deletes/roaring_position_bitmap.cc +++ b/src/iceberg/deletes/roaring_position_bitmap.cc @@ -49,28 +49,6 @@ int64_t ToPosition(int32_t key, uint32_t pos32) { return (int64_t{key} << 32) | int64_t{pos32}; } -void WriteLE64(char* buf, int64_t value) { - auto le = ToLittleEndian(static_cast(value)); - std::memcpy(buf, &le, sizeof(le)); -} - -void WriteLE32(char* buf, int32_t value) { - auto le = ToLittleEndian(static_cast(value)); - std::memcpy(buf, &le, sizeof(le)); -} - -int64_t ReadLE64(const char* buf) { - uint64_t v; - std::memcpy(&v, buf, sizeof(v)); - return static_cast(FromLittleEndian(v)); -} - -int32_t ReadLE32(const char* buf) { - uint32_t v; - std::memcpy(&v, buf, sizeof(v)); - return static_cast(FromLittleEndian(v)); -} - Status ValidatePosition(int64_t pos) { if (pos < 0 || pos > RoaringPositionBitmap::kMaxPosition) { return InvalidArgument("Bitmap supports positions that are >= 0 and <= {}: {}", @@ -205,12 +183,12 @@ Result RoaringPositionBitmap::Serialize() const { char* buf = result.data(); // Write bitmap count (array length including empties) - WriteLE64(buf, static_cast(impl_->bitmaps.size())); + WriteLittleEndian(static_cast(impl_->bitmaps.size()), buf); buf += kBitmapCountSizeBytes; // Write each bitmap with its key for (int32_t key = 0; std::cmp_less(key, impl_->bitmaps.size()); ++key) { - WriteLE32(buf, key); + WriteLittleEndian(key, buf); buf += kBitmapKeySizeBytes; size_t written = impl_->bitmaps[key].write(buf, /*portable=*/true); buf += written; @@ -226,7 +204,7 @@ Result RoaringPositionBitmap::Deserialize(std::string_vie ICEBERG_PRECHECK(remaining >= kBitmapCountSizeBytes, "Buffer too small for bitmap count: {} bytes", remaining); - int64_t bitmap_count = ReadLE64(buf); + auto bitmap_count = ReadLittleEndian(buf); buf += kBitmapCountSizeBytes; remaining -= kBitmapCountSizeBytes; @@ -242,7 +220,7 @@ Result RoaringPositionBitmap::Deserialize(std::string_vie ICEBERG_PRECHECK(remaining >= kBitmapKeySizeBytes, "Buffer too small for bitmap key: {} bytes", remaining); - int32_t key = ReadLE32(buf); + auto key = ReadLittleEndian(buf); buf += kBitmapKeySizeBytes; remaining -= kBitmapKeySizeBytes; diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 1e6953c80..5e68def98 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -89,6 +89,8 @@ iceberg_sources = files( 'partition_spec.cc', 'partition_summary.cc', 'puffin/file_metadata.cc', + 'puffin/json_serde.cc', + 'puffin/puffin_format.cc', 'row/arrow_array_wrapper.cc', 'row/manifest_wrapper.cc', 'row/partition_values.cc', diff --git a/src/iceberg/puffin/json_serde.cc b/src/iceberg/puffin/json_serde.cc new file mode 100644 index 000000000..53f591e32 --- /dev/null +++ b/src/iceberg/puffin/json_serde.cc @@ -0,0 +1,127 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include + +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/puffin/json_serde_internal.h" +#include "iceberg/util/json_util_internal.h" +#include "iceberg/util/macros.h" + +namespace iceberg::puffin { + +namespace { +constexpr std::string_view kBlobs = "blobs"; +constexpr std::string_view kProperties = "properties"; +constexpr std::string_view kType = "type"; +constexpr std::string_view kFields = "fields"; +constexpr std::string_view kSnapshotId = "snapshot-id"; +constexpr std::string_view kSequenceNumber = "sequence-number"; +constexpr std::string_view kOffset = "offset"; +constexpr std::string_view kLength = "length"; +constexpr std::string_view kCompressionCodec = "compression-codec"; +} // namespace + +nlohmann::json ToJson(const BlobMetadata& blob_metadata) { + nlohmann::json json; + json[kType] = blob_metadata.type; + json[kFields] = blob_metadata.input_fields; + json[kSnapshotId] = blob_metadata.snapshot_id; + json[kSequenceNumber] = blob_metadata.sequence_number; + json[kOffset] = blob_metadata.offset; + json[kLength] = blob_metadata.length; + + SetOptionalStringField(json, kCompressionCodec, blob_metadata.compression_codec); + SetContainerField(json, kProperties, blob_metadata.properties); + + return json; +} + +Result BlobMetadataFromJson(const nlohmann::json& json) { + BlobMetadata blob_metadata; + + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.type, GetJsonValue(json, kType)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.input_fields, + GetJsonValue>(json, kFields)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.snapshot_id, + GetJsonValue(json, kSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.sequence_number, + GetJsonValue(json, kSequenceNumber)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.offset, GetJsonValue(json, kOffset)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.length, GetJsonValue(json, kLength)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.compression_codec, + GetJsonValueOrDefault(json, kCompressionCodec)); + ICEBERG_ASSIGN_OR_RAISE(blob_metadata.properties, + FromJsonMap(json, kProperties)); + + return blob_metadata; +} + +nlohmann::json ToJson(const FileMetadata& file_metadata) { + nlohmann::json json; + + nlohmann::json blobs_json = nlohmann::json::array(); + for (const auto& blob : file_metadata.blobs) { + blobs_json.push_back(ToJson(blob)); + } + json[kBlobs] = std::move(blobs_json); + + SetContainerField(json, kProperties, file_metadata.properties); + + return json; +} + +Result FileMetadataFromJson(const nlohmann::json& json) { + FileMetadata file_metadata; + + ICEBERG_ASSIGN_OR_RAISE(auto blobs_json, GetJsonValue(json, kBlobs)); + if (!blobs_json.is_array()) { + return JsonParseError("Cannot parse blobs from non-array: {}", + SafeDumpJson(blobs_json)); + } + + for (const auto& blob_json : blobs_json) { + ICEBERG_ASSIGN_OR_RAISE(auto blob, BlobMetadataFromJson(blob_json)); + file_metadata.blobs.push_back(std::move(blob)); + } + + ICEBERG_ASSIGN_OR_RAISE(file_metadata.properties, + FromJsonMap(json, kProperties)); + + return file_metadata; +} + +std::string ToJsonString(const FileMetadata& file_metadata, bool pretty) { + auto json = ToJson(file_metadata); + return pretty ? json.dump(2) : json.dump(); +} + +Result FileMetadataFromJsonString(std::string_view json_string) { + if (json_string.empty()) { + return JsonParseError("Cannot parse empty JSON string"); + } + try { + auto json = nlohmann::json::parse(json_string); + return FileMetadataFromJson(json); + } catch (const nlohmann::json::parse_error& e) { + return JsonParseError("Failed to parse JSON: {}", e.what()); + } +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/json_serde_internal.h b/src/iceberg/puffin/json_serde_internal.h new file mode 100644 index 000000000..dbb5fbd09 --- /dev/null +++ b/src/iceberg/puffin/json_serde_internal.h @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/puffin/json_serde_internal.h +/// JSON serialization/deserialization for Puffin file metadata. + +#include +#include + +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/puffin/type_fwd.h" +#include "iceberg/result.h" + +namespace iceberg::puffin { + +/// \brief Serialize a BlobMetadata to JSON. +ICEBERG_EXPORT nlohmann::json ToJson(const BlobMetadata& blob_metadata); + +/// \brief Deserialize a BlobMetadata from JSON. +ICEBERG_EXPORT Result BlobMetadataFromJson(const nlohmann::json& json); + +/// \brief Serialize a FileMetadata to JSON. +ICEBERG_EXPORT nlohmann::json ToJson(const FileMetadata& file_metadata); + +/// \brief Deserialize a FileMetadata from JSON. +ICEBERG_EXPORT Result FileMetadataFromJson(const nlohmann::json& json); + +/// \brief Serialize a FileMetadata to a JSON string. +ICEBERG_EXPORT std::string ToJsonString(const FileMetadata& file_metadata, + bool pretty = false); + +/// \brief Deserialize a FileMetadata from a JSON string. +ICEBERG_EXPORT Result FileMetadataFromJsonString( + std::string_view json_string); + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/meson.build b/src/iceberg/puffin/meson.build index 0655156eb..7869d7b2c 100644 --- a/src/iceberg/puffin/meson.build +++ b/src/iceberg/puffin/meson.build @@ -15,4 +15,7 @@ # specific language governing permissions and limitations # under the License. -install_headers(['file_metadata.h'], subdir: 'iceberg/puffin') +install_headers( + ['file_metadata.h', 'puffin_format.h', 'type_fwd.h'], + subdir: 'iceberg/puffin', +) diff --git a/src/iceberg/puffin/puffin_format.cc b/src/iceberg/puffin/puffin_format.cc new file mode 100644 index 000000000..88807d0ca --- /dev/null +++ b/src/iceberg/puffin/puffin_format.cc @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/puffin/puffin_format.h" + +#include +#include +#include + +namespace iceberg::puffin { + +namespace { + +// Returns (byte_index, bit_index) for a given flag within the 4-byte flags field. +constexpr std::pair GetFlagPosition(PuffinFlag flag) { + switch (flag) { + case PuffinFlag::kFooterPayloadCompressed: + return {0, 0}; + } + std::unreachable(); +} + +// TODO(zhaoxuan1994): Move compression logic to a unified codec interface. +Result> Compress(PuffinCompressionCodec codec, + std::span input) { + switch (codec) { + case PuffinCompressionCodec::kNone: + return std::vector(input.begin(), input.end()); + case PuffinCompressionCodec::kLz4: + return NotSupported("LZ4 compression is not yet supported"); + case PuffinCompressionCodec::kZstd: + return NotSupported("Zstd compression is not yet supported"); + } + std::unreachable(); +} + +Result> Decompress(PuffinCompressionCodec codec, + std::span input) { + switch (codec) { + case PuffinCompressionCodec::kNone: + return std::vector(input.begin(), input.end()); + case PuffinCompressionCodec::kLz4: + return NotSupported("LZ4 decompression is not yet supported"); + case PuffinCompressionCodec::kZstd: + return NotSupported("Zstd decompression is not yet supported"); + } + std::unreachable(); +} + +} // namespace + +bool IsFlagSet(std::span flags, PuffinFlag flag) { + auto [byte_num, bit_num] = GetFlagPosition(flag); + return (flags[byte_num] & (1 << bit_num)) != 0; +} + +void SetFlag(std::span flags, PuffinFlag flag) { + auto [byte_num, bit_num] = GetFlagPosition(flag); + flags[byte_num] |= (1 << bit_num); +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_format.h b/src/iceberg/puffin/puffin_format.h new file mode 100644 index 000000000..857c2ba57 --- /dev/null +++ b/src/iceberg/puffin/puffin_format.h @@ -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. + */ + +#pragma once + +/// \file iceberg/puffin/puffin_format.h +/// Puffin file format constants and utilities. + +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/result.h" + +namespace iceberg::puffin { + +/// \brief Puffin file format constants. +struct ICEBERG_EXPORT PuffinFormat { + /// Magic bytes: "PFA1" (Puffin Fratercula arctica, version 1) + static constexpr std::array kMagicV1 = {0x50, 0x46, 0x41, 0x31}; + + static constexpr int32_t kMagicLength = 4; + static constexpr int32_t kFooterStartMagicOffset = 0; + static constexpr int32_t kFooterStartMagicLength = kMagicLength; + static constexpr int32_t kFooterStructPayloadSizeOffset = 0; + static constexpr int32_t kFooterStructFlagsOffset = kFooterStructPayloadSizeOffset + 4; + static constexpr int32_t kFooterStructFlagsLength = 4; + static constexpr int32_t kFooterStructMagicOffset = + kFooterStructFlagsOffset + kFooterStructFlagsLength; + + /// Total length of the footer struct: payload_size(4) + flags(4) + magic(4) + static constexpr int32_t kFooterStructLength = kFooterStructMagicOffset + kMagicLength; + + /// Default compression codec for footer payload. + static constexpr PuffinCompressionCodec kDefaultFooterCompressionCodec = + PuffinCompressionCodec::kLz4; +}; + +/// \brief Footer flags for Puffin files. +enum class PuffinFlag : uint8_t { + /// Whether the footer payload is compressed. + kFooterPayloadCompressed = 0, +}; + +/// \brief Check if a flag is set in the flags bytes. +ICEBERG_EXPORT bool IsFlagSet(std::span flags, PuffinFlag flag); + +/// \brief Set a flag in the flags bytes. +ICEBERG_EXPORT void SetFlag(std::span flags, PuffinFlag flag); + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/type_fwd.h b/src/iceberg/puffin/type_fwd.h new file mode 100644 index 000000000..04e0b263f --- /dev/null +++ b/src/iceberg/puffin/type_fwd.h @@ -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. + */ + +#pragma once + +/// \file iceberg/puffin/type_fwd.h +/// Forward declarations for Puffin types. + +namespace iceberg::puffin { + +struct BlobMetadata; +struct FileMetadata; + +} // namespace iceberg::puffin diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 58edcf7e0..eb26b2bea 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -127,6 +127,8 @@ add_iceberg_test(util_test add_iceberg_test(roaring_test SOURCES roaring_test.cc) +add_iceberg_test(puffin_test SOURCES puffin_format_test.cc puffin_json_test.cc) + if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(avro_test USE_BUNDLE diff --git a/src/iceberg/test/endian_test.cc b/src/iceberg/test/endian_test.cc index b62644cf4..717baeafe 100644 --- a/src/iceberg/test/endian_test.cc +++ b/src/iceberg/test/endian_test.cc @@ -84,4 +84,16 @@ TEST(EndianTest, ByteWiseValidation) { EXPECT_EQ(big_float_bytes, (std::array{0x40, 0x48, 0xF5, 0xC3})); } +TEST(EndianTest, BufferReadWriteRoundTrip) { + std::array buf{}; + WriteLittleEndian(int32_t{0x12345678}, buf.data()); + EXPECT_EQ(ReadLittleEndian(buf.data()), 0x12345678); + + WriteLittleEndian(int32_t{0}, buf.data()); + EXPECT_EQ(ReadLittleEndian(buf.data()), 0); + + WriteLittleEndian(int32_t{-1}, buf.data()); + EXPECT_EQ(ReadLittleEndian(buf.data()), -1); +} + } // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 9e6b16809..f3eeb7da5 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -102,6 +102,9 @@ iceberg_tests = { ), }, 'roaring_test': {'sources': files('roaring_test.cc')}, + 'puffin_test': { + 'sources': files('puffin_format_test.cc', 'puffin_json_test.cc'), + }, } if get_option('rest').enabled() diff --git a/src/iceberg/test/puffin_format_test.cc b/src/iceberg/test/puffin_format_test.cc new file mode 100644 index 000000000..d4493c6f3 --- /dev/null +++ b/src/iceberg/test/puffin_format_test.cc @@ -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. + */ + +#include "iceberg/puffin/puffin_format.h" + +#include +#include + +#include + +namespace iceberg::puffin { + +TEST(PuffinFormatTest, FlagSetAndCheck) { + std::array flags{}; + EXPECT_FALSE(IsFlagSet(flags, PuffinFlag::kFooterPayloadCompressed)); + + SetFlag(flags, PuffinFlag::kFooterPayloadCompressed); + EXPECT_TRUE(IsFlagSet(flags, PuffinFlag::kFooterPayloadCompressed)); +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/test/puffin_json_test.cc b/src/iceberg/test/puffin_json_test.cc new file mode 100644 index 000000000..f8faf8dd1 --- /dev/null +++ b/src/iceberg/test/puffin_json_test.cc @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include + +#include +#include + +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/puffin/json_serde_internal.h" +#include "iceberg/test/matchers.h" + +namespace iceberg::puffin { + +// ==================== BlobMetadata Parameterized Tests ==================== + +struct BlobMetadataJsonParam { + std::string name; + BlobMetadata blob; + std::string expected_json; +}; + +class BlobMetadataJsonTest : public ::testing::TestWithParam {}; + +TEST_P(BlobMetadataJsonTest, RoundTrip) { + const auto& param = GetParam(); + auto expected = nlohmann::json::parse(param.expected_json); + + EXPECT_EQ(ToJson(param.blob), expected); + + ICEBERG_UNWRAP_OR_FAIL(auto result, BlobMetadataFromJson(expected)); + EXPECT_EQ(result, param.blob); +} + +INSTANTIATE_TEST_SUITE_P(PuffinJson, BlobMetadataJsonTest, + ::testing::Values( + BlobMetadataJsonParam{ + .name = "AllFields", + .blob = {.type = "apache-datasketches-theta-v1", + .input_fields = {1, 2}, + .snapshot_id = 12345, + .sequence_number = 67, + .offset = 100, + .length = 200, + .compression_codec = "zstd", + .properties = {{"key", "value"}}}, + .expected_json = R"({ + "type": "apache-datasketches-theta-v1", + "fields": [1, 2], + "snapshot-id": 12345, + "sequence-number": 67, + "offset": 100, + "length": 200, + "compression-codec": "zstd", + "properties": {"key": "value"} + })"}, + BlobMetadataJsonParam{.name = "MinimalFields", + .blob = {.type = "test-type", + .input_fields = {1}, + .snapshot_id = 100, + .sequence_number = 1, + .offset = 0, + .length = 50}, + .expected_json = R"({ + "type": "test-type", + "fields": [1], + "snapshot-id": 100, + "sequence-number": 1, + "offset": 0, + "length": 50 + })"}), + [](const ::testing::TestParamInfo& info) { + return info.param.name; + }); + +// ==================== BlobMetadata Invalid JSON Tests ==================== + +struct InvalidBlobMetadataJsonParam { + std::string name; + std::string json; +}; + +class InvalidBlobMetadataJsonTest + : public ::testing::TestWithParam {}; + +TEST_P(InvalidBlobMetadataJsonTest, DeserializeFails) { + auto json = nlohmann::json::parse(GetParam().json); + EXPECT_THAT(BlobMetadataFromJson(json), IsError(ErrorKind::kJsonParseError)); +} + +INSTANTIATE_TEST_SUITE_P( + PuffinJson, InvalidBlobMetadataJsonTest, + ::testing::Values( + InvalidBlobMetadataJsonParam{.name = "MissingType", + .json = R"({"fields":[1],"snapshot-id":1, + "sequence-number":1,"offset":0,"length":10})"}, + InvalidBlobMetadataJsonParam{.name = "MissingFields", + .json = R"({"type":"t","snapshot-id":1, + "sequence-number":1,"offset":0,"length":10})"}, + InvalidBlobMetadataJsonParam{.name = "MissingSnapshotId", + .json = R"({"type":"t","fields":[1], + "sequence-number":1,"offset":0,"length":10})"}, + InvalidBlobMetadataJsonParam{.name = "MissingSequenceNumber", + .json = R"({"type":"t","fields":[1], + "snapshot-id":1,"offset":0,"length":10})"}, + InvalidBlobMetadataJsonParam{.name = "MissingOffset", + .json = R"({"type":"t","fields":[1], + "snapshot-id":1,"sequence-number":1,"length":10})"}, + InvalidBlobMetadataJsonParam{.name = "MissingLength", + .json = R"({"type":"t","fields":[1], + "snapshot-id":1,"sequence-number":1,"offset":0})"}), + [](const ::testing::TestParamInfo& info) { + return info.param.name; + }); + +// ==================== FileMetadata Tests ==================== + +TEST(PuffinJsonTest, FileMetadataRoundTrip) { + BlobMetadata blob1{.type = "type-a", + .input_fields = {1}, + .snapshot_id = 100, + .sequence_number = 1, + .offset = 4, + .length = 50, + .compression_codec = "lz4"}; + + BlobMetadata blob2{.type = "type-b", + .input_fields = {2, 3}, + .snapshot_id = 200, + .sequence_number = 2, + .offset = 54, + .length = 100}; + + FileMetadata metadata{.blobs = {blob1, blob2}, + .properties = {{"created-by", "iceberg-cpp-test"}}}; + + nlohmann::json expected_json = R"({ + "blobs": [ + { + "type": "type-a", + "fields": [1], + "snapshot-id": 100, + "sequence-number": 1, + "offset": 4, + "length": 50, + "compression-codec": "lz4" + }, + { + "type": "type-b", + "fields": [2, 3], + "snapshot-id": 200, + "sequence-number": 2, + "offset": 54, + "length": 100 + } + ], + "properties": {"created-by": "iceberg-cpp-test"} + })"_json; + + EXPECT_EQ(ToJson(metadata), expected_json); + + ICEBERG_UNWRAP_OR_FAIL(auto result, FileMetadataFromJson(expected_json)); + EXPECT_EQ(result, metadata); +} + +TEST(PuffinJsonTest, FileMetadataStringRoundTrip) { + FileMetadata metadata{.blobs = {{.type = "test", + .input_fields = {1}, + .snapshot_id = 1, + .sequence_number = 1, + .offset = 0, + .length = 10}}}; + + auto json_str = ToJsonString(metadata); + ICEBERG_UNWRAP_OR_FAIL(auto result, FileMetadataFromJsonString(json_str)); + EXPECT_EQ(result, metadata); +} + +TEST(PuffinJsonTest, FileMetadataFromInvalidString) { + EXPECT_THAT(FileMetadataFromJsonString(""), IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(FileMetadataFromJsonString("{invalid}"), + IsError(ErrorKind::kJsonParseError)); +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/util/endian.h b/src/iceberg/util/endian.h index 52fa93e67..638273a1c 100644 --- a/src/iceberg/util/endian.h +++ b/src/iceberg/util/endian.h @@ -22,6 +22,7 @@ #include #include #include +#include /// \file iceberg/util/endian.h /// \brief Endianness conversion utilities @@ -94,4 +95,21 @@ constexpr T FromBigEndian(T value) { } } +/// \brief Write a value in little-endian format to a buffer. +/// \note Caller must ensure output has at least sizeof(T) bytes available. +template +void WriteLittleEndian(T value, void* output) { + auto le = ToLittleEndian(value); + std::memcpy(output, &le, sizeof(le)); +} + +/// \brief Read a value in little-endian format from a buffer. +/// \note Caller must ensure input has at least sizeof(T) bytes available. +template +T ReadLittleEndian(const void* input) { + T value; + std::memcpy(&value, input, sizeof(value)); + return FromLittleEndian(value); +} + } // namespace iceberg From 633965f7eb94aeb082b211ae6c79c7e2fcbeb184 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Thu, 16 Apr 2026 09:24:18 -0700 Subject: [PATCH 003/151] ci: apply github workflow best practice (zizmor/codeql/asf-allowlist-check) (#618) Adding these 3 checks for all apache/iceberg* repos as part of https://github.com/apache/iceberg/issues/15742 --- .github/dependabot.yml | 28 ++++++++++++++ .github/workflows/asf-allowlist-check.yml | 46 +++++++++++++++++++++++ .github/workflows/codeql.yml | 14 +++---- .github/workflows/cpp-linter.yml | 10 +++-- .github/workflows/docs.yml | 5 ++- .github/workflows/license_check.yml | 6 ++- .github/workflows/pre-commit.yml | 6 ++- .github/workflows/rc.yml | 16 +++++--- .github/workflows/sanitizer_test.yml | 4 +- .github/workflows/test.yml | 36 +++++++++++------- .github/workflows/zizmor.yml | 44 ++++++++++++++++++++++ 11 files changed, 179 insertions(+), 36 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/asf-allowlist-check.yml create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..fc74cd299 --- /dev/null +++ b/.github/dependabot.yml @@ -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. +# + +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + cooldown: + default-days: 7 diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml new file mode 100644 index 000000000..65dbe8bcb --- /dev/null +++ b/.github/workflows/asf-allowlist-check.yml @@ -0,0 +1,46 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# Verifies all GitHub Actions refs are on the ASF allowlist. +# Actions not on the allowlist silently fail with "Startup failure" — no logs, +# no notifications, and PRs may appear green because no checks ran. +# See https://github.com/apache/infrastructure-actions/issues/574 +name: "ASF Allowlist Check" + +on: + pull_request: + paths: + - ".github/**" + push: + branches: + - main + paths: + - ".github/**" + +permissions: + contents: read + +jobs: + asf-allowlist-check: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e71958d97..fe0459aeb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,11 +21,9 @@ name: "CodeQL" on: push: - branches: - - main + branches: [ "main" ] pull_request: - branches: - - main + branches: [ "main" ] schedule: - cron: '16 4 * * 1' @@ -43,14 +41,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: category: "/language:actions" diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 26324479c..51a8f4d63 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -34,7 +34,9 @@ jobs: pull-requests: write steps: - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev @@ -46,7 +48,7 @@ jobs: mkdir build && cd build cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON cmake --build . - - uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8 + - uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8 # v2.15.1 id: linter continue-on-error: true env: @@ -66,5 +68,7 @@ jobs: - name: Fail fast?! if: steps.linter.outputs.checks-failed != 0 run: | - echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" + echo "some linter checks failed. ${STEPS_LINTER_OUTPUTS_CHECKS_FAILED}" exit 1 + env: + STEPS_LINTER_OUTPUTS_CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c6ec84fd9..82d0e5ab6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,11 +37,12 @@ jobs: runs-on: ubuntu-slim steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 1 + persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: '3.x' diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 8bed66aad..17af559d1 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -28,9 +28,11 @@ jobs: runs-on: ubuntu-slim steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Check license header - uses: apache/skywalking-eyes@main + uses: apache/skywalking-eyes@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 67f8ec586..363c234ba 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -31,6 +31,8 @@ jobs: pre-commit: runs-on: ubuntu-slim steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 91ddb0e5a..75c18d3d8 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -34,7 +34,9 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Prepare for tag if: github.ref_type == 'tag' @@ -84,9 +86,11 @@ jobs: CXX: g++-14 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: archive @@ -130,9 +134,11 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: archive diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index cdb3c86bc..422257a12 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -39,7 +39,9 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c60f42b1d..40b429541 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,9 @@ jobs: AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev @@ -86,7 +88,9 @@ jobs: AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh @@ -111,30 +115,32 @@ jobs: AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install dependencies - shell: cmd + shell: pwsh run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 # zizmor: ignore[cache-poisoning] -- only used for build caching, no artifacts published - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh - name: Build Iceberg - shell: cmd + shell: pwsh env: SCCACHE_GHA_ENABLED: "true" run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - bash -c "ci/scripts/build_iceberg.sh $(pwd) OFF ON" - if %errorlevel% neq 0 exit /b %errorlevel% + $ErrorActionPreference = "Stop" + cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_iceberg.sh `$(pwd) OFF ON`"" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } sccache --show-stats - name: Build Example - shell: cmd + shell: pwsh run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - bash -c "ci/scripts/build_example.sh $(pwd)/example" + $ErrorActionPreference = "Stop" + cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_example.sh `$(pwd)/example`"" meson: name: Meson - ${{ matrix.title }} runs-on: ${{ matrix.runs-on }} @@ -155,11 +161,13 @@ jobs: - title: AArch64 macOS 26 runs-on: macos-26 steps: - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install build dependencies run: | python3 -m pip install --upgrade pip diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 000000000..5ac3f30ea --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -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. +# + +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-24.04 + permissions: {} + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 + with: + advanced-security: false From 4876d7c5469628ecea41d4f89776e6ae81521e80 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Fri, 17 Apr 2026 09:44:12 +0800 Subject: [PATCH 004/151] feat: implement incremental changelog scan (#611) --- src/iceberg/table_scan.cc | 160 +++++- src/iceberg/table_scan.h | 116 +++- src/iceberg/test/CMakeLists.txt | 1 + .../test/incremental_changelog_scan_test.cc | 524 ++++++++++++++++++ src/iceberg/test/scan_test_base.h | 81 +++ 5 files changed, 872 insertions(+), 10 deletions(-) create mode 100644 src/iceberg/test/incremental_changelog_scan_test.cc diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index ed2ede707..2195482bb 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -19,11 +19,14 @@ #include "iceberg/table_scan.h" +#include #include #include +#include #include "iceberg/expression/binder.h" #include "iceberg/expression/expression.h" +#include "iceberg/expression/residual_evaluator.h" #include "iceberg/file_reader.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_group.h" @@ -31,6 +34,7 @@ #include "iceberg/schema.h" #include "iceberg/snapshot.h" #include "iceberg/table_metadata.h" +#include "iceberg/util/content_file_util.h" #include "iceberg/util/macros.h" #include "iceberg/util/snapshot_util_internal.h" #include "iceberg/util/timepoint.h" @@ -294,6 +298,26 @@ Result FileScanTask::ToArrow( return MakeArrowArrayStream(std::move(reader)); } +// ChangelogScanTask implementation + +int64_t ChangelogScanTask::size_bytes() const { + int64_t total_size = data_file_->file_size_in_bytes; + for (const auto& delete_file : delete_files_) { + ICEBERG_DCHECK(delete_file->content_size_in_bytes.has_value(), + "Delete file content size must be available"); + total_size += + (delete_file->IsDeletionVector() ? delete_file->content_size_in_bytes.value() + : delete_file->file_size_in_bytes); + } + return total_size; +} + +int32_t ChangelogScanTask::files_count() const { return 1 + delete_files_.size(); } + +int64_t ChangelogScanTask::estimated_row_count() const { + return data_file_->record_count; +} + // Generic template implementation for Make template Result>> TableScanBuilder::Make( @@ -747,11 +771,13 @@ Result>> IncrementalAppendScan::PlanFi // IncrementalChangelogScan implementation Result> IncrementalChangelogScan::Make( - [[maybe_unused]] std::shared_ptr metadata, - [[maybe_unused]] std::shared_ptr schema, - [[maybe_unused]] std::shared_ptr io, - [[maybe_unused]] internal::TableScanContext context) { - return NotImplemented("IncrementalChangelogScan is not implemented"); + std::shared_ptr metadata, std::shared_ptr schema, + std::shared_ptr io, internal::TableScanContext context) { + ICEBERG_PRECHECK(metadata != nullptr, "Table metadata cannot be null"); + ICEBERG_PRECHECK(schema != nullptr, "Schema cannot be null"); + ICEBERG_PRECHECK(io != nullptr, "FileIO cannot be null"); + return std::unique_ptr(new IncrementalChangelogScan( + std::move(metadata), std::move(schema), std::move(io), std::move(context))); } Result>> @@ -762,7 +788,129 @@ IncrementalChangelogScan::PlanFiles() const { Result>> IncrementalChangelogScan::PlanFiles(std::optional from_snapshot_id_exclusive, int64_t to_snapshot_id_inclusive) const { - return NotImplemented("IncrementalChangelogScan::PlanFiles is not implemented"); + ICEBERG_ASSIGN_OR_RAISE( + auto ancestors_snapshots, + SnapshotUtil::AncestorsBetween(*metadata_, to_snapshot_id_inclusive, + from_snapshot_id_exclusive)); + + std::vector, std::unique_ptr>> + changelog_snapshots; + + for (const auto& snapshot : std::ranges::reverse_view(ancestors_snapshots)) { + auto operation = snapshot->Operation(); + if (!operation.has_value() || operation.value() != DataOperation::kReplace) { + auto snapshot_cache = std::make_unique(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto delete_manifests, + snapshot_cache->DeleteManifests(io_)); + if (!delete_manifests.empty()) { + return NotSupported( + "Delete files are currently not supported in changelog scans"); + } + changelog_snapshots.emplace_back(snapshot, std::move(snapshot_cache)); + } + } + if (changelog_snapshots.empty()) { + return std::vector>{}; + } + + std::unordered_set snapshot_ids; + std::unordered_map snapshot_ordinals; + for (const auto& snapshot : changelog_snapshots) { + ICEBERG_PRECHECK( + std::cmp_less_equal(snapshot_ids.size(), std::numeric_limits::max()), + "Number of snapshots in changelog scan exceeds maximum supported"); + snapshot_ids.insert(snapshot.first->snapshot_id); + snapshot_ordinals.try_emplace(snapshot.first->snapshot_id, + static_cast(snapshot_ordinals.size())); + } + + std::vector data_manifests; + std::unordered_set seen_manifest_paths; + for (const auto& snapshot : changelog_snapshots) { + ICEBERG_ASSIGN_OR_RAISE(auto manifests, snapshot.second->DataManifests(io_)); + for (auto& manifest : manifests) { + if (snapshot_ids.contains(manifest.added_snapshot_id) && + seen_manifest_paths.insert(manifest.manifest_path).second) { + data_manifests.push_back(manifest); + } + } + } + if (data_manifests.empty()) { + return std::vector>{}; + } + + TableMetadataCache metadata_cache(metadata_.get()); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); + + ICEBERG_ASSIGN_OR_RAISE( + auto manifest_group, + ManifestGroup::Make(io_, schema_, specs_by_id, std::move(data_manifests), + /*delete_manifests=*/{})); + + manifest_group->CaseSensitive(context_.case_sensitive) + .Select(ScanColumns()) + .FilterData(filter()) + .FilterManifestEntries([&snapshot_ids](const ManifestEntry& entry) { + return entry.snapshot_id.has_value() && + snapshot_ids.contains(entry.snapshot_id.value()); + }) + .IgnoreExisting() + .ColumnsToKeepStats(context_.columns_to_keep_stats); + + if (context_.ignore_residuals) { + manifest_group->IgnoreResiduals(); + } + + auto create_tasks_func = + [&snapshot_ordinals]( + std::vector&& entries, + const TaskContext& ctx) -> Result>> { + std::vector> tasks; + tasks.reserve(entries.size()); + + for (auto& entry : entries) { + ICEBERG_PRECHECK(entry.snapshot_id.has_value() && entry.data_file, + "Invalid manifest entry with missing snapshot id or data file"); + + int64_t commit_snapshot_id = entry.snapshot_id.value(); + auto ordinal_it = snapshot_ordinals.find(commit_snapshot_id); + ICEBERG_PRECHECK(ordinal_it != snapshot_ordinals.end(), + "Invalid manifest entry with missing snapshot ordinal"); + + int32_t change_ordinal = ordinal_it->second; + + if (ctx.drop_stats) { + ContentFileUtil::DropAllStats(*entry.data_file); + } else if (!ctx.columns_to_keep_stats.empty()) { + ContentFileUtil::DropUnselectedStats(*entry.data_file, ctx.columns_to_keep_stats); + } + + ICEBERG_ASSIGN_OR_RAISE(auto residual, + ctx.residuals->ResidualFor(entry.data_file->partition)); + + switch (entry.status) { + case ManifestStatus::kAdded: + tasks.push_back(std::make_shared( + change_ordinal, commit_snapshot_id, std::move(entry.data_file), + std::vector>{}, std::move(residual))); + break; + case ManifestStatus::kDeleted: + tasks.push_back(std::make_shared( + change_ordinal, commit_snapshot_id, std::move(entry.data_file), + std::vector>{}, std::move(residual))); + break; + case ManifestStatus::kExisting: + return InvalidArgument("Unexpected entry status: EXISTING"); + } + } + return tasks; + }; + + ICEBERG_ASSIGN_OR_RAISE(auto tasks, manifest_group->Plan(create_tasks_func)); + return tasks | std::views::transform([](const auto& task) { + return std::static_pointer_cast(task); + }) | + std::ranges::to(); } } // namespace iceberg diff --git a/src/iceberg/table_scan.h b/src/iceberg/table_scan.h index b21adcca6..064825d82 100644 --- a/src/iceberg/table_scan.h +++ b/src/iceberg/table_scan.h @@ -102,14 +102,122 @@ class ICEBERG_EXPORT FileScanTask : public ScanTask { std::shared_ptr residual_filter_; }; +enum class ChangelogOperation : uint8_t { + kInsert, + kDelete, + kUpdateBefore, + kUpdateAfter, +}; + /// \brief A scan task for reading changelog entries between snapshots. class ICEBERG_EXPORT ChangelogScanTask : public ScanTask { public: + /// \brief Construct an AddedRowsScanTask. + /// + /// \param change_ordinal Position in the changelog order (0-based). + /// \param commit_snapshot_id The snapshot ID that committed this change. + /// \param data_file The data file containing the added rows. + /// \param delete_files Delete files that apply to this data file. + /// \param residual_filter Optional residual filter to apply after reading. + ChangelogScanTask(int32_t change_ordinal, int64_t commit_snapshot_id, + std::shared_ptr data_file, + std::vector> delete_files = {}, + std::shared_ptr residual_filter = nullptr) + : change_ordinal_(change_ordinal), + commit_snapshot_id_(commit_snapshot_id), + data_file_(std::move(data_file)), + delete_files_(std::move(delete_files)), + residual_filter_(std::move(residual_filter)) {} + Kind kind() const override { return Kind::kChangelogScanTask; } - // TODO(): Return actual values once member fields are implemented - int64_t size_bytes() const override { return 0; } - int32_t files_count() const override { return 0; } - int64_t estimated_row_count() const override { return 0; } + + int64_t size_bytes() const override; + int32_t files_count() const override; + int64_t estimated_row_count() const override; + + virtual ChangelogOperation operation() const = 0; + + /// \brief The position of this change in the changelog order (0-based). + int32_t change_ordinal() const { return change_ordinal_; } + + /// \brief The snapshot ID that committed this change. + int64_t commit_snapshot_id() const { return commit_snapshot_id_; } + + /// \brief Residual filter to apply after reading. + const std::shared_ptr& residual_filter() const { return residual_filter_; } + + protected: + int32_t change_ordinal_; + int64_t commit_snapshot_id_; + std::shared_ptr data_file_; + std::vector> delete_files_; + std::shared_ptr residual_filter_; +}; + +/// \brief A scan task for inserts generated by adding a data file to the table. +/// +/// This task represents data files that were added to the table, along with any +/// delete files that should be applied when reading the data. +/// +/// Added data files may have matching delete files. This may happen if a +/// matching position delete file is committed in the same snapshot or if changes +/// for multiple snapshots are squashed together. +/// +/// Suppose snapshot S1 adds data files F1, F2, F3 and a position delete file, +/// D1, that marks particular records in F1 as deleted. A scan for changes +/// generated by S1 should include the following tasks: +/// - AddedRowsScanTask(file=F1, deletes=[D1], snapshot=S1) +/// - AddedRowsScanTask(file=F2, deletes=[], snapshot=S1) +/// - AddedRowsScanTask(file=F3, deletes=[], snapshot=S1) +/// +/// Readers consuming these tasks should produce added records with metadata +/// like change ordinal and commit snapshot ID. +class ICEBERG_EXPORT AddedRowsScanTask : public ChangelogScanTask { + public: + using ChangelogScanTask::ChangelogScanTask; + + ChangelogOperation operation() const override { return ChangelogOperation::kInsert; } + + /// \brief The data file containing the added rows. + const std::shared_ptr& data_file() const { return data_file_; } + + /// \brief A list of delete files to apply when reading the data file in this task. + /// + /// @return A list of delete files to apply + const std::vector>& delete_files() const { + return delete_files_; + } +}; + +/// \brief A scan task for deletes generated by removing a data file from the table. +/// +/// All historical delete files added earlier must be applied while reading the data file. +/// This is required to output only those data records that were live when the data file +/// was removed. +/// +/// Suppose snapshot S1 contains data files F1, F2, F3. Then snapshot S2 adds a position +/// delete file, D1, that deletes records from F2 and snapshot S3 removes F2 entirely. A +/// scan for changes generated by S3 should include the following task: +/// - DeletedDataFileScanTask(file=F2, existing-deletes=[D1], snapshot=S3) +/// +/// Readers consuming these tasks should produce deleted records with metadata like +/// change ordinal and commit snapshot ID. +class ICEBERG_EXPORT DeletedDataFileScanTask : public ChangelogScanTask { + public: + using ChangelogScanTask::ChangelogScanTask; + + ChangelogOperation operation() const override { return ChangelogOperation::kDelete; } + + /// \brief The data file that was deleted. + const std::shared_ptr& data_file() const { return data_file_; } + + /// \brief A list of previously added delete files to apply when reading the + /// data file in this task. + /// + /// \return A list of delete files to apply + const std::vector>& existing_deletes() const { + return delete_files_; + } }; namespace internal { diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index eb26b2bea..149abb826 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -182,6 +182,7 @@ if(ICEBERG_BUILD_BUNDLE) SOURCES file_scan_task_test.cc incremental_append_scan_test.cc + incremental_changelog_scan_test.cc table_scan_test.cc) add_iceberg_test(table_update_test diff --git a/src/iceberg/test/incremental_changelog_scan_test.cc b/src/iceberg/test/incremental_changelog_scan_test.cc new file mode 100644 index 000000000..62fed0f25 --- /dev/null +++ b/src/iceberg/test/incremental_changelog_scan_test.cc @@ -0,0 +1,524 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include + +#include +#include + +#include "iceberg/expression/expressions.h" +#include "iceberg/snapshot.h" +#include "iceberg/table_scan.h" +#include "iceberg/test/scan_test_base.h" + +namespace iceberg { + +namespace { + +const std::string& TaskFilePath(const std::shared_ptr& task) { + if (auto added = std::dynamic_pointer_cast(task)) { + return added->data_file()->file_path; + } + if (auto deleted = std::dynamic_pointer_cast(task)) { + return deleted->data_file()->file_path; + } + + static const std::string empty_path; + return empty_path; +} + +/// \brief Sort changelog scan tasks for deterministic ordering. +/// Sorts by change_ordinal, then by operation type name, then by file path. +template +void SortTasks(std::vector>& tasks) { + std::ranges::sort(tasks, [](const auto& t1, const auto& t2) { + if (t1->change_ordinal() != t2->change_ordinal()) { + return t1->change_ordinal() < t2->change_ordinal(); + } + if (t1->operation() != t2->operation()) { + return static_cast(t1->operation()) < + static_cast(t2->operation()); + } + return TaskFilePath(std::static_pointer_cast(t1)) < + TaskFilePath(std::static_pointer_cast(t2)); + }); +} + +} // namespace + +class IncrementalChangelogScanTest : public ScanTestBase {}; + +TEST_P(IncrementalChangelogScanTest, DataFilters) { + auto version = GetParam(); + + // Bucket transform for "data" column: bucket("a", 16) = 8, bucket("k", 16) = 1 + // By filtering on data="k", we should only match files with bucket=1 + + // Create partition value bucket("a") = 8 + auto partition_a = PartitionValues({Literal::Int(8)}); + // Create partition value bucket("k") = 1 + auto partition_b = PartitionValues({Literal::Int(1)}); + + // Create snapshot 1 with file_a + auto snapshot_a = MakeAppendSnapshotWithPartitionValues( + version, 1000L, std::nullopt, 1L, {{"/path/to/file_a.parquet", partition_a}}, + partitioned_spec_); + SnapshotCache cache_a(snapshot_a.get()); + ICEBERG_UNWRAP_OR_FAIL(auto manifests_a, cache_a.DataManifests(file_io_)); + ASSERT_EQ(manifests_a.size(), 1); + const auto& manifest_a = manifests_a[0]; + + // Create snapshot 2 with file_b (separate manifest list, not inheriting from snap1) + auto snapshot_b = MakeAppendSnapshotWithPartitionValues( + version, 2000L, 1000L, 2L, {{"/path/to/file_b.parquet", partition_b}}, + partitioned_spec_); + + // Create metadata with partitioned spec as default + auto partitioned_metadata = MakeTableMetadata( + {snapshot_a, snapshot_b}, 2000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 2000L, .retention = SnapshotRef::Branch{}})}}, + partitioned_spec_); + + // Make the first manifest unavailable. Planning should still succeed because the + // partition filter can skip reading file_a's manifest entirely. + EXPECT_THAT(file_io_->DeleteFile(manifest_a.manifest_path), IsOk()); + + // Filter by data="k" which should match only file_b (bucket("k", 16) = 1) + ICEBERG_UNWRAP_OR_FAIL(auto builder, IncrementalChangelogScanBuilder::Make( + partitioned_metadata, file_io_)); + builder->Filter(Expressions::Equal("data", Literal::String("k"))); + builder->ToSnapshot(2000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 1); + + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 1); + EXPECT_EQ(t1->commit_snapshot_id(), 2000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kInsert); + auto insert_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_b.parquet"); + EXPECT_TRUE(insert_t1->delete_files().empty()); +} + +TEST_P(IncrementalChangelogScanTest, Overwrites) { + auto version = GetParam(); + + // Create initial snapshot with 2 files + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, + {"/path/to/file_a.parquet", "/path/to/file_b.parquet"}); + + // Overwrite: add file_a2, delete file_a + auto snapshot_b = + MakeOverwriteSnapshot(version, 2000L, 1000L, 2L, {"/path/to/file_a2.parquet"}, + {"/path/to/file_a.parquet"}); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b}, 2000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 2000L, .retention = SnapshotRef::Branch{}})}}); + + // from_snapshot_exclusive(snap1).to_snapshot(snap2) should return 2 tasks + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->FromSnapshot(1000L, /*inclusive=*/false).ToSnapshot(2000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 2); + SortTasks(tasks); + + // First task: added file (INSERT operation) + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 0); + EXPECT_EQ(t1->commit_snapshot_id(), 2000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kInsert); + auto insert_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_a2.parquet"); + EXPECT_TRUE(insert_t1->delete_files().empty()); + + // Second task: deleted file (DELETE operation) + auto t2 = tasks[1]; + EXPECT_EQ(t2->change_ordinal(), 0); + EXPECT_EQ(t2->commit_snapshot_id(), 2000L); + EXPECT_EQ(t2->operation(), ChangelogOperation::kDelete); + auto delete_t2 = std::dynamic_pointer_cast(t2); + ASSERT_NE(delete_t2, nullptr); + EXPECT_EQ(delete_t2->data_file()->file_path, "/path/to/file_a.parquet"); + EXPECT_TRUE(delete_t2->existing_deletes().empty()); +} + +TEST_P(IncrementalChangelogScanTest, DuplicatedManifests) { + auto version = GetParam(); + + // Create initial snapshot_a with file_a and extract its manifest + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, {"/path/to/file_a.parquet"}); + SnapshotCache cache_a(snapshot_a.get()); + ICEBERG_UNWRAP_OR_FAIL(auto manifests_a, cache_a.DataManifests(file_io_)); + ASSERT_EQ(manifests_a.size(), 1); + auto manifest_a = manifests_a[0]; + + // Manually construct snapshot_b that includes BOTH a new manifest AND the manifest from + // snapshot_a. This simulates what actually happens in Iceberg when appends reuse older + // manifests. + std::vector entries_b; + auto file_b = MakeDataFile("/path/to/file_b.parquet"); + entries_b.push_back(MakeEntry(ManifestStatus::kAdded, 2000L, 2L, file_b)); + auto manifest_b = WriteDataManifest(version, 2000L, std::move(entries_b)); + + auto manifest_list_b = + WriteManifestList(version, 2000L, 1000L, 2L, {manifest_a, manifest_b}); + TimePointMs timestamp_ms = TimePointMsFromUnixMs(1609459200000L + 2000); + auto snapshot_b = std::make_shared(Snapshot{ + .snapshot_id = 2000L, + .parent_snapshot_id = 1000L, + .sequence_number = 2L, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list_b, + .summary = {{"operation", "append"}}, + .schema_id = schema_->schema_id(), + }); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b}, 2000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 2000L, .retention = SnapshotRef::Branch{}})}}); + + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->ToSnapshot(2000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + + // We expect exactly 2 tasks, one for file_a and one for file_b. + // If deduplication is buggy, we might see 3 tasks (file_a twice). + ASSERT_EQ(tasks.size(), 2); + SortTasks(tasks); + + auto insert_t1 = std::dynamic_pointer_cast(tasks[0]); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_a.parquet"); + EXPECT_EQ(tasks[0]->commit_snapshot_id(), 1000L); + + auto insert_t2 = std::dynamic_pointer_cast(tasks[1]); + ASSERT_NE(insert_t2, nullptr); + EXPECT_EQ(insert_t2->data_file()->file_path, "/path/to/file_b.parquet"); + EXPECT_EQ(tasks[1]->commit_snapshot_id(), 2000L); +} + +TEST_P(IncrementalChangelogScanTest, FileDeletes) { + auto version = GetParam(); + + // Create initial snapshot with 2 files + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, + {"/path/to/file_a.parquet", "/path/to/file_b.parquet"}); + + // Delete file_a + auto snapshot_b = + MakeDeleteSnapshot(version, 2000L, 1000L, 2L, {"/path/to/file_a.parquet"}); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b}, 2000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 2000L, .retention = SnapshotRef::Branch{}})}}); + + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->FromSnapshot(1000L, /*inclusive=*/false).ToSnapshot(2000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 1); + + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 0); + EXPECT_EQ(t1->commit_snapshot_id(), 2000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kDelete); + auto delete_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(delete_t1, nullptr); + EXPECT_EQ(delete_t1->data_file()->file_path, "/path/to/file_a.parquet"); + EXPECT_TRUE(delete_t1->existing_deletes().empty()); +} + +TEST_P(IncrementalChangelogScanTest, ExistingEntriesInNewDataManifestsAreIgnored) { + auto version = GetParam(); + + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, {"/path/to/file_a.parquet"}); + auto snapshot_b = + MakeAppendSnapshot(version, 2000L, 1000L, 2L, {"/path/to/file_b.parquet"}); + + // Create snapshot C with a manifest that contains existing entries from A and B + // plus a new file C. This simulates manifest merging. + std::vector merged_entries; + auto file_a = MakeDataFile("/path/to/file_a.parquet"); + merged_entries.push_back(MakeEntry(ManifestStatus::kExisting, 1000L, 1L, file_a)); + auto file_b = MakeDataFile("/path/to/file_b.parquet"); + merged_entries.push_back(MakeEntry(ManifestStatus::kExisting, 2000L, 2L, file_b)); + auto file_c = MakeDataFile("/path/to/file_c.parquet"); + merged_entries.push_back(MakeEntry(ManifestStatus::kAdded, 3000L, 3L, file_c)); + + auto manifest = WriteDataManifest(version, 3000L, std::move(merged_entries)); + auto manifest_list = WriteManifestList(version, 3000L, 2000L, 3L, {manifest}); + TimePointMs timestamp_ms = TimePointMsFromUnixMs(1609459200000L + 3000); + auto snapshot_c = std::make_shared(Snapshot{ + .snapshot_id = 3000L, + .parent_snapshot_id = 2000L, + .sequence_number = 3L, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list, + .summary = {{"operation", "append"}}, + .schema_id = schema_->schema_id(), + }); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b, snapshot_c}, 3000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 3000L, .retention = SnapshotRef::Branch{}})}}); + + // When scanning from_snapshot_inclusive(C).to_snapshot(C), should only return file_c + // because file_a and file_b are marked as EXISTING entries + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->FromSnapshot(3000L, /*inclusive=*/true).ToSnapshot(3000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 1); + + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 0); + EXPECT_EQ(t1->commit_snapshot_id(), 3000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kInsert); + auto insert_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_c.parquet"); + EXPECT_TRUE(insert_t1->delete_files().empty()); +} + +TEST_P(IncrementalChangelogScanTest, DataFileRewrites) { + auto version = GetParam(); + + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, {"/path/to/file_a.parquet"}); + auto snapshot_b = + MakeAppendSnapshot(version, 2000L, 1000L, 2L, {"/path/to/file_b.parquet"}); + + // Create a rewrite/replace snapshot (simulating file compaction) + // In a replace operation, the old file is deleted and new file is added, + // but this shouldn't appear in the changelog + std::vector entries; + auto file_a2 = MakeDataFile("/path/to/file_a2.parquet"); + entries.push_back(MakeEntry(ManifestStatus::kAdded, 3000L, 3L, file_a2)); + auto file_a = MakeDataFile("/path/to/file_a.parquet"); + entries.push_back(MakeEntry(ManifestStatus::kDeleted, 3000L, 3L, file_a)); + auto manifest = WriteDataManifest(version, 3000L, std::move(entries)); + auto manifest_list = WriteManifestList(version, 3000L, 2000L, 3L, {manifest}); + TimePointMs timestamp_ms = TimePointMsFromUnixMs(1609459200000L + 3000); + auto snapshot_c = std::make_shared(Snapshot{ + .snapshot_id = 3000L, + .parent_snapshot_id = 2000L, + .sequence_number = 3L, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list, + .summary = {{"operation", "replace"}}, // Replace operation + .schema_id = schema_->schema_id(), + }); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b, snapshot_c}, 3000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 3000L, .retention = SnapshotRef::Branch{}})}}); + + // The changelog should only show the original appends (A and B), + // not the replace operation + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->ToSnapshot(3000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 2); + SortTasks(tasks); + + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 0); + EXPECT_EQ(t1->commit_snapshot_id(), 1000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kInsert); + auto insert_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_a.parquet"); + + auto t2 = tasks[1]; + EXPECT_EQ(t2->change_ordinal(), 1); + EXPECT_EQ(t2->commit_snapshot_id(), 2000L); + EXPECT_EQ(t2->operation(), ChangelogOperation::kInsert); + auto insert_t2 = std::dynamic_pointer_cast(t2); + ASSERT_NE(insert_t2, nullptr); + EXPECT_EQ(insert_t2->data_file()->file_path, "/path/to/file_b.parquet"); +} + +TEST_P(IncrementalChangelogScanTest, ManifestRewritesAreIgnored) { + auto version = GetParam(); + + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, {"/path/to/file_a.parquet"}); + auto snapshot_b = + MakeAppendSnapshot(version, 2000L, 1000L, 2L, {"/path/to/file_b.parquet"}); + + // Simulate a manifest rewrite (snapshot 3) - creates a new manifest with EXISTING + // entries This simulates what happens after table.rewriteManifests() + std::vector rewritten_entries; + auto file_a = MakeDataFile("/path/to/file_a.parquet"); + rewritten_entries.push_back(MakeEntry(ManifestStatus::kExisting, 1000L, 1L, file_a)); + auto file_b = MakeDataFile("/path/to/file_b.parquet"); + rewritten_entries.push_back(MakeEntry(ManifestStatus::kExisting, 2000L, 2L, file_b)); + + auto rewritten_manifest = + WriteDataManifest(version, 3000L, std::move(rewritten_entries)); + auto manifest_list_3 = + WriteManifestList(version, 3000L, 2000L, 3L, {rewritten_manifest}); + TimePointMs timestamp_3 = TimePointMsFromUnixMs(1609459200000L + 3000); + auto snapshot_c = std::make_shared(Snapshot{ + .snapshot_id = 3000L, + .parent_snapshot_id = 2000L, + .sequence_number = 3L, + .timestamp_ms = timestamp_3, + .manifest_list = manifest_list_3, + .summary = {{"operation", "replace"}}, // Manifest rewrite uses replace operation + .schema_id = schema_->schema_id(), + }); + + // Add a new append after the rewrite + auto snapshot_d = + MakeAppendSnapshot(version, 4000L, 3000L, 4L, {"/path/to/file_c.parquet"}); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b, snapshot_c, snapshot_d}, 4000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 4000L, .retention = SnapshotRef::Branch{}})}}); + + // The changelog should show all 3 files from the original appends, + // ignoring the manifest rewrite snapshot + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->ToSnapshot(4000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); + ASSERT_EQ(tasks.size(), 3); + SortTasks(tasks); + + auto t1 = tasks[0]; + EXPECT_EQ(t1->change_ordinal(), 0); + EXPECT_EQ(t1->commit_snapshot_id(), 1000L); + EXPECT_EQ(t1->operation(), ChangelogOperation::kInsert); + auto insert_t1 = std::dynamic_pointer_cast(t1); + ASSERT_NE(insert_t1, nullptr); + EXPECT_EQ(insert_t1->data_file()->file_path, "/path/to/file_a.parquet"); + + auto t2 = tasks[1]; + EXPECT_EQ(t2->change_ordinal(), 1); + EXPECT_EQ(t2->commit_snapshot_id(), 2000L); + EXPECT_EQ(t2->operation(), ChangelogOperation::kInsert); + auto insert_t2 = std::dynamic_pointer_cast(t2); + ASSERT_NE(insert_t2, nullptr); + EXPECT_EQ(insert_t2->data_file()->file_path, "/path/to/file_b.parquet"); + + auto t3 = tasks[2]; + EXPECT_EQ(t3->change_ordinal(), 2); + EXPECT_EQ(t3->commit_snapshot_id(), 4000L); + EXPECT_EQ(t3->operation(), ChangelogOperation::kInsert); + auto insert_t3 = std::dynamic_pointer_cast(t3); + ASSERT_NE(insert_t3, nullptr); + EXPECT_EQ(insert_t3->data_file()->file_path, "/path/to/file_c.parquet"); +} + +TEST_P(IncrementalChangelogScanTest, DeleteFilesAreNotSupported) { + auto version = GetParam(); + if (version < 2) { + GTEST_SKIP() << "Delete files only exist in format version 2+"; + } + + auto snapshot_a = + MakeAppendSnapshot(version, 1000L, std::nullopt, 1L, + {"/path/to/file_a.parquet", "/path/to/file_b.parquet"}); + + // Create a snapshot with delete files (positional deletes) + // This simulates table.newRowDelta().addDeletes(FILE_A_DELETES).commit() + std::vector data_entries; + auto file_a = MakeDataFile("/path/to/file_a.parquet"); + data_entries.push_back(MakeEntry(ManifestStatus::kExisting, 1000L, 1L, file_a)); + auto file_b = MakeDataFile("/path/to/file_b.parquet"); + data_entries.push_back(MakeEntry(ManifestStatus::kExisting, 1000L, 1L, file_b)); + auto data_manifest = WriteDataManifest(version, 2000L, std::move(data_entries)); + + // Create a delete file entry + auto delete_file = std::make_shared(DataFile{ + .content = DataFile::Content::kPositionDeletes, + .file_path = "/path/to/file_a_deletes.parquet", + .file_format = FileFormatType::kParquet, + .partition = PartitionValues(std::vector{}), + .record_count = 1, + .file_size_in_bytes = 10, + .sort_order_id = 0, + .partition_spec_id = unpartitioned_spec_->spec_id(), + }); + std::vector delete_entries; + delete_entries.push_back(MakeEntry(ManifestStatus::kAdded, 2000L, 2L, delete_file)); + auto delete_manifest = + WriteDeleteManifest(version, 2000L, std::move(delete_entries), unpartitioned_spec_); + + auto manifest_list = + WriteManifestList(version, 2000L, 1000L, 2L, {data_manifest, delete_manifest}); + TimePointMs timestamp_ms = TimePointMsFromUnixMs(1609459200000L + 2000); + auto snapshot_b = std::make_shared(Snapshot{ + .snapshot_id = 2000L, + .parent_snapshot_id = 1000L, + .sequence_number = 2L, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list, + .summary = {{"operation", "delete"}}, + .schema_id = schema_->schema_id(), + }); + + auto metadata = MakeTableMetadata( + {snapshot_a, snapshot_b}, 2000L, + {{"main", std::make_shared(SnapshotRef{ + .snapshot_id = 2000L, .retention = SnapshotRef::Branch{}})}}); + + ICEBERG_UNWRAP_OR_FAIL(auto builder, + IncrementalChangelogScanBuilder::Make(metadata, file_io_)); + builder->ToSnapshot(2000L); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + EXPECT_THAT(scan->PlanFiles(), + ::testing::AllOf( + IsError(ErrorKind::kNotSupported), + HasErrorMessage( + "Delete files are currently not supported in changelog scans"))); +} + +INSTANTIATE_TEST_SUITE_P(IncrementalChangelogScanVersions, IncrementalChangelogScanTest, + testing::Values(1, 2, 3)); + +} // namespace iceberg diff --git a/src/iceberg/test/scan_test_base.h b/src/iceberg/test/scan_test_base.h index 65a4e0531..1a2f5648d 100644 --- a/src/iceberg/test/scan_test_base.h +++ b/src/iceberg/test/scan_test_base.h @@ -261,6 +261,87 @@ class ScanTestBase : public testing::TestWithParam { }); } + /// \brief Create a delete snapshot with the given files. + std::shared_ptr MakeDeleteSnapshot( + int8_t format_version, int64_t snapshot_id, + std::optional parent_snapshot_id, int64_t sequence_number, + const std::vector& deleted_files) { + std::vector> files_with_partitions; + for (const auto& path : deleted_files) { + files_with_partitions.emplace_back(path, PartitionValues(std::vector{})); + } + return MakeDeleteSnapshot(format_version, snapshot_id, parent_snapshot_id, + sequence_number, files_with_partitions); + } + + /// \brief Create a delete snapshot with partition values for each file. + std::shared_ptr MakeDeleteSnapshot( + int8_t format_version, int64_t snapshot_id, + std::optional parent_snapshot_id, int64_t sequence_number, + const std::vector>& deleted_files) { + std::vector entries; + entries.reserve(deleted_files.size()); + for (const auto& [path, partition] : deleted_files) { + auto file = MakeDataFile(path, partition); + entries.push_back( + MakeEntry(ManifestStatus::kDeleted, snapshot_id, sequence_number, file)); + } + + auto manifest = WriteDataManifest(format_version, snapshot_id, std::move(entries)); + int64_t parent_id = parent_snapshot_id.value_or(0L); + auto manifest_list = WriteManifestList(format_version, snapshot_id, parent_id, + sequence_number, {manifest}); + TimePointMs timestamp_ms = + TimePointMsFromUnixMs(1609459200000L + sequence_number * 1000); + return std::make_shared(Snapshot{ + .snapshot_id = snapshot_id, + .parent_snapshot_id = parent_snapshot_id, + .sequence_number = sequence_number, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list, + .summary = {{"operation", "delete"}}, + .schema_id = schema_->schema_id(), + }); + } + + /// \brief Create an overwrite snapshot with added and deleted files. + std::shared_ptr MakeOverwriteSnapshot( + int8_t format_version, int64_t snapshot_id, + std::optional parent_snapshot_id, int64_t sequence_number, + const std::vector& added_file_paths, + const std::vector& deleted_file_paths) { + std::vector entries; + entries.reserve(added_file_paths.size() + deleted_file_paths.size()); + + for (const auto& path : added_file_paths) { + auto file = MakeDataFile(path); + entries.push_back( + MakeEntry(ManifestStatus::kAdded, snapshot_id, sequence_number, file)); + } + + for (const auto& path : deleted_file_paths) { + auto file = MakeDataFile(path); + entries.push_back( + MakeEntry(ManifestStatus::kDeleted, snapshot_id, sequence_number, file)); + } + + auto manifest = WriteDataManifest(format_version, snapshot_id, std::move(entries)); + int64_t parent_id = parent_snapshot_id.value_or(0L); + auto manifest_list = WriteManifestList(format_version, snapshot_id, parent_id, + sequence_number, {manifest}); + TimePointMs timestamp_ms = + TimePointMsFromUnixMs(1609459200000L + sequence_number * 1000); + return std::make_shared(Snapshot{ + .snapshot_id = snapshot_id, + .parent_snapshot_id = parent_snapshot_id, + .sequence_number = sequence_number, + .timestamp_ms = timestamp_ms, + .manifest_list = manifest_list, + .summary = {{"operation", "overwrite"}}, + .schema_id = schema_->schema_id(), + }); + } + std::shared_ptr file_io_; std::shared_ptr schema_; std::shared_ptr partitioned_spec_; From e7b228bd00a86e5304dcadf3919060f6c1cedba8 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Fri, 17 Apr 2026 11:27:53 +0800 Subject: [PATCH 005/151] chore: add more ai related .gitignore (#621) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f73cd863c..cac035cc0 100644 --- a/.gitignore +++ b/.gitignore @@ -42,8 +42,11 @@ cmake-build-release/ AGENTS.md CLAUDE.md GEMINI.md +.claude/ .cursor/ .gemini/ +.github/prompts/ .kiro/ my-skills/ +openspec/ skills/ From 8adb304350f734c1c5b64a27a386273107972ec6 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Thu, 16 Apr 2026 20:28:24 -0700 Subject: [PATCH 006/151] ci: set zizmor min-severity and min-confidence to medium (#620) Part of https://github.com/apache/iceberg/issues/16000 Gets rid of `zizmor: ignore[cache-poisoning]`, its low confidence. Set `min-severity: medium` and `min-confidence: medium` in `.github/workflows/zizmor.yml` Validated locally: ``` GH_TOKEN=`gh auth token` uvx zizmor --min-severity medium --min-confidence medium .github/ ``` --- .github/workflows/test.yml | 2 +- .github/workflows/zizmor.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40b429541..37f98bd05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -123,7 +123,7 @@ jobs: run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 # zizmor: ignore[cache-poisoning] -- only used for build caching, no artifacts published + uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 5ac3f30ea..eb40be7ed 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -42,3 +42,5 @@ jobs: uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 with: advanced-security: false + min-severity: medium + min-confidence: medium From 65321e32e7f37e6f6cfcc7f6a5ad8fee9c7f5404 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:42:17 +0800 Subject: [PATCH 007/151] chore(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1 (#622) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
Release notes

Sourced from actions/upload-artifact's releases.

v7.0.1

What's Changed

Full Changelog: https://github.com/actions/upload-artifact/compare/v7...v7.0.1

Commits
  • 043fb46 Merge pull request #797 from actions/yacaovsnc/update-dependency
  • 634250c Include changes in typespec/ts-http-runtime 0.3.5
  • e454baa Readme: bump all the example versions to v7 (#796)
  • 74fad66 Update the readme with direct upload details (#795)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=7.0.0&new-version=7.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/rc.yml | 2 +- .github/workflows/sanitizer_test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 75c18d3d8..d302da6c7 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -61,7 +61,7 @@ jobs: run: | dev/release/run_rat.sh "${TAR_GZ}" - - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: archive path: | diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index 422257a12..58cb21f23 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -63,7 +63,7 @@ jobs: ctest --output-on-failure - name: Save the test output if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test-output path: build/test/out.log* From a9114ceafe4c0954ae409210258149e5ec110945 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 22 Apr 2026 13:03:34 +0800 Subject: [PATCH 008/151] chore: bump arrow-cpp to 24.0.0 (#623) --- cmake_modules/IcebergThirdpartyToolchain.cmake | 8 ++++---- src/iceberg/parquet/parquet_reader.cc | 5 +++-- src/iceberg/test/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index d4f837d67..a0d418e05 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -34,13 +34,13 @@ set(ICEBERG_ARROW_INSTALL_INTERFACE_LIBS) # ICEBERG_CPR_URL - cpr tarball URL # # Example usage: -# export ICEBERG_ARROW_URL="https://your-mirror.com/apache-arrow-22.0.0.tar.gz" +# export ICEBERG_ARROW_URL="https://your-mirror.com/apache-arrow-24.0.0.tar.gz" # cmake -S . -B build # -set(ICEBERG_ARROW_BUILD_VERSION "22.0.0") +set(ICEBERG_ARROW_BUILD_VERSION "24.0.0") set(ICEBERG_ARROW_BUILD_SHA256_CHECKSUM - "131250cd24dec0cddde04e2ad8c9e2bc43edc5e84203a81cf71cf1a33a6e7e0f") + "9a8094d24fa33b90c672ab77fdda253f29300c8b0dd3f0b8e55a29dbd98b82c9") if(DEFINED ENV{ICEBERG_ARROW_URL}) set(ARROW_SOURCE_URL "$ENV{ICEBERG_ARROW_URL}") @@ -112,7 +112,7 @@ function(resolve_arrow_dependency) set(ARROW_WITH_ZLIB ON) set(ZLIB_SOURCE "SYSTEM") set(ARROW_VERBOSE_THIRDPARTY_BUILD OFF) - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 20) fetchcontent_declare(VendoredArrow ${FC_DECLARE_COMMON_OPTIONS} diff --git a/src/iceberg/parquet/parquet_reader.cc b/src/iceberg/parquet/parquet_reader.cc index 2fbf8e0a6..0e2808f59 100644 --- a/src/iceberg/parquet/parquet_reader.cc +++ b/src/iceberg/parquet/parquet_reader.cc @@ -131,8 +131,9 @@ class ParquetReader::Impl { ICEBERG_ASSIGN_OR_RAISE(input_stream_, OpenInputStream(options)); auto file_reader = ::parquet::ParquetFileReader::Open(input_stream_, reader_properties); - ICEBERG_ARROW_RETURN_NOT_OK(::parquet::arrow::FileReader::Make( - pool_, std::move(file_reader), arrow_reader_properties, &reader_)); + ICEBERG_ARROW_ASSIGN_OR_RETURN( + reader_, ::parquet::arrow::FileReader::Make(pool_, std::move(file_reader), + arrow_reader_properties)); // Project read schema onto the Parquet file schema ICEBERG_ASSIGN_OR_RAISE(projection_, BuildProjection(reader_.get(), *read_schema_)); diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 149abb826..92fd0c1c2 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -15,6 +15,8 @@ # specific language governing permissions and limitations # under the License. +set(CMAKE_COMPILE_WARNING_AS_ERROR FALSE) + fetchcontent_declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG b514bdc898e2951020cbdca1304b75f5950d1f59 # release-1.15.2 From b94fa7ccc720a1920d5fb010a8c5c223a20fa5a3 Mon Sep 17 00:00:00 2001 From: Xinli Shang Date: Fri, 24 Apr 2026 03:01:17 -0700 Subject: [PATCH 009/151] feat: add ReachableFileCleanup to expire snapshots (#592) --- src/iceberg/table_metadata.cc | 5 +- src/iceberg/test/expire_snapshots_test.cc | 508 ++++++++++++++++++++++ src/iceberg/transaction.cc | 9 +- src/iceberg/update/expire_snapshots.cc | 332 ++++++++++++++ src/iceberg/update/expire_snapshots.h | 18 +- src/iceberg/update/pending_update.cc | 27 +- src/iceberg/update/pending_update.h | 6 +- src/iceberg/update/snapshot_update.cc | 6 +- src/iceberg/update/snapshot_update.h | 2 +- 9 files changed, 889 insertions(+), 24 deletions(-) diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index d3b5629c8..658681573 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -1440,9 +1440,8 @@ Status TableMetadataBuilder::Impl::RemoveSnapshots( if (ids_to_remove.contains(snapshot_id)) { snapshots_by_id_.erase(snapshot_id); snapshot_ids_to_remove.push_back(snapshot_id); - // FIXME: implement statistics removal and uncomment below - // ICEBERG_RETURN_UNEXPECTED(RemoveStatistics(snapshot_id)); - // ICEBERG_RETURN_UNEXPECTED(RemovePartitionStatistics(snapshot_id)); + ICEBERG_RETURN_UNEXPECTED(RemoveStatistics(snapshot_id)); + ICEBERG_RETURN_UNEXPECTED(RemovePartitionStatistics(snapshot_id)); } else { retained_snapshots.push_back(std::move(snapshot)); } diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index dbc577a71..4dcc72d6c 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -19,6 +19,17 @@ #include "iceberg/update/expire_snapshots.h" +#include +#include +#include + +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/statistics_file.h" +#include "iceberg/table_metadata.h" #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" @@ -26,6 +37,173 @@ namespace iceberg { class ExpireSnapshotsTest : public UpdateTestBase {}; +class ExpireSnapshotsCleanupTest : public UpdateTestBase { + protected: + static constexpr int64_t kExpiredSnapshotId = 3051729675574597004; + static constexpr int64_t kCurrentSnapshotId = 3055729675574597004; + static constexpr int64_t kExpiredSequenceNumber = 0; + static constexpr int64_t kCurrentSequenceNumber = 1; + + void SetUp() override { + UpdateTestBase::SetUp(); + avro::RegisterAll(); + } + + ManifestEntry MakeEntry(ManifestStatus status, int64_t snapshot_id, + int64_t sequence_number, std::shared_ptr file) const { + return ManifestEntry{ + .status = status, + .snapshot_id = snapshot_id, + .sequence_number = sequence_number, + .file_sequence_number = sequence_number, + .data_file = std::move(file), + }; + } + + std::shared_ptr MakeDataFile(const std::string& path) const { + return std::make_shared(DataFile{ + .file_path = path, + .file_format = FileFormatType::kParquet, + .partition = PartitionValues({Literal::Long(1)}), + .record_count = 1, + .file_size_in_bytes = 10, + .sort_order_id = 0, + }); + } + + std::shared_ptr MakePositionDeleteFile(const std::string& path) const { + return std::make_shared(DataFile{ + .content = DataFile::Content::kPositionDeletes, + .file_path = path, + .file_format = FileFormatType::kParquet, + .partition = PartitionValues({Literal::Long(1)}), + .record_count = 1, + .file_size_in_bytes = 10, + }); + } + + std::shared_ptr MakeStatisticsFile(int64_t snapshot_id, + const std::string& path) const { + auto statistics_file = std::make_shared(); + statistics_file->snapshot_id = snapshot_id; + statistics_file->path = path; + statistics_file->file_size_in_bytes = 10; + statistics_file->file_footer_size_in_bytes = 2; + return statistics_file; + } + + std::shared_ptr MakePartitionStatisticsFile( + int64_t snapshot_id, const std::string& path) const { + auto statistics_file = std::make_shared(); + statistics_file->snapshot_id = snapshot_id; + statistics_file->path = path; + statistics_file->file_size_in_bytes = 10; + return statistics_file; + } + + std::shared_ptr CurrentSchema() { + auto metadata = ReloadMetadata(); + auto schema_result = metadata->Schema(); + EXPECT_THAT(schema_result, IsOk()); + return schema_result.value(); + } + + std::shared_ptr DefaultSpec() { + auto metadata = ReloadMetadata(); + auto spec_result = metadata->PartitionSpecById(metadata->default_spec_id); + EXPECT_THAT(spec_result, IsOk()); + return spec_result.value(); + } + + int8_t FormatVersion() { return ReloadMetadata()->format_version; } + + ManifestFile WriteDataManifest(const std::string& path, int64_t snapshot_id, + std::vector entries) { + auto writer_result = ManifestWriter::MakeWriter( + FormatVersion(), snapshot_id, path, file_io_, DefaultSpec(), CurrentSchema(), + ManifestContent::kData, /*first_row_id=*/std::nullopt); + EXPECT_THAT(writer_result, IsOk()); + auto writer = std::move(writer_result.value()); + + for (const auto& entry : entries) { + EXPECT_THAT(writer->WriteEntry(entry), IsOk()); + } + + EXPECT_THAT(writer->Close(), IsOk()); + auto manifest_result = writer->ToManifestFile(); + EXPECT_THAT(manifest_result, IsOk()); + return manifest_result.value(); + } + + ManifestFile WriteDeleteManifest(const std::string& path, int64_t snapshot_id, + std::vector entries) { + auto writer_result = ManifestWriter::MakeWriter( + FormatVersion(), snapshot_id, path, file_io_, DefaultSpec(), CurrentSchema(), + ManifestContent::kDeletes, /*first_row_id=*/std::nullopt); + EXPECT_THAT(writer_result, IsOk()); + auto writer = std::move(writer_result.value()); + + for (const auto& entry : entries) { + EXPECT_THAT(writer->WriteEntry(entry), IsOk()); + } + + EXPECT_THAT(writer->Close(), IsOk()); + auto manifest_result = writer->ToManifestFile(); + EXPECT_THAT(manifest_result, IsOk()); + return manifest_result.value(); + } + + std::string WriteManifestList(const std::string& path, int64_t snapshot_id, + int64_t parent_snapshot_id, int64_t sequence_number, + const std::vector& manifests) { + auto writer_result = ManifestListWriter::MakeWriter( + FormatVersion(), snapshot_id, parent_snapshot_id, path, file_io_, + /*sequence_number=*/std::optional(sequence_number), + /*first_row_id=*/std::nullopt); + EXPECT_THAT(writer_result, IsOk()); + auto writer = std::move(writer_result.value()); + EXPECT_THAT(writer->AddAll(manifests), IsOk()); + EXPECT_THAT(writer->Close(), IsOk()); + return path; + } + + void RewriteTableWithManifestLists(const std::string& expired_manifest_list, + const std::string& current_manifest_list) { + auto metadata = ReloadMetadata(); + ASSERT_EQ(metadata->snapshots.size(), 2); + metadata->snapshots.at(0)->manifest_list = expired_manifest_list; + metadata->snapshots.at(1)->manifest_list = current_manifest_list; + + RewriteTable(std::move(metadata)); + } + + void RewriteTable(std::shared_ptr metadata) { + ASSERT_NE(metadata, nullptr); + + const auto metadata_location = + table_location_ + "/metadata/00002-custom.metadata.json"; + ASSERT_THAT(catalog_->DropTable(table_ident_, /*purge=*/false), IsOk()); + ASSERT_THAT(TableMetadataUtil::Write(*file_io_, metadata_location, *metadata), + IsOk()); + ICEBERG_UNWRAP_OR_FAIL(table_, + catalog_->RegisterTable(table_ident_, metadata_location)); + } + + void RewriteTableWithManifestListsAndStatistics( + const std::string& expired_manifest_list, const std::string& current_manifest_list, + std::vector> statistics, + std::vector> partition_statistics) { + auto metadata = ReloadMetadata(); + ASSERT_EQ(metadata->snapshots.size(), 2); + metadata->snapshots.at(0)->manifest_list = expired_manifest_list; + metadata->snapshots.at(1)->manifest_list = current_manifest_list; + metadata->statistics = std::move(statistics); + metadata->partition_statistics = std::move(partition_statistics); + + RewriteTable(std::move(metadata)); + } +}; + TEST_F(ExpireSnapshotsTest, DefaultExpireByAge) { ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); @@ -65,4 +243,334 @@ TEST_F(ExpireSnapshotsTest, ExpireOlderThan) { } } +TEST_F(ExpireSnapshotsTest, FinalizeRequiresCommittedMetadata) { + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + // Apply first so apply_result_ is cached + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_EQ(result.snapshot_ids_to_remove.size(), 1); + + // A successful finalize now requires the committed metadata from the catalog. + auto finalize_status = update->Finalize(static_cast(nullptr)); + EXPECT_THAT(finalize_status, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(finalize_status, + HasErrorMessage("Missing committed table metadata for cleanup")); + EXPECT_TRUE(deleted_files.empty()); +} + +TEST_F(ExpireSnapshotsTest, CleanupNoneSkipsDeletion) { + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->CleanupLevel(CleanupLevel::kNone); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_EQ(result.snapshot_ids_to_remove.size(), 1); + + // With kNone cleanup level, Finalize should skip all file deletion + auto finalize_status = update->Finalize(static_cast(nullptr)); + EXPECT_THAT(finalize_status, IsOk()); + EXPECT_TRUE(deleted_files.empty()); +} + +TEST_F(ExpireSnapshotsTest, FinalizeSkippedOnCommitError) { + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_EQ(result.snapshot_ids_to_remove.size(), 1); + + // Simulate a commit failure - Finalize should not delete any files + auto finalize_status = update->Finalize(Result(std::unexpected( + Error{.kind = ErrorKind::kCommitFailed, .message = "simulated failure"}))); + EXPECT_THAT(finalize_status, IsOk()); + EXPECT_TRUE(deleted_files.empty()); +} + +TEST_F(ExpireSnapshotsTest, FinalizeSkipsWhenNothingExpired) { + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->RetainLast(2); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_TRUE(result.snapshot_ids_to_remove.empty()); + + // No snapshots expired, so Finalize should not delete any files + auto finalize_status = update->Finalize(static_cast(nullptr)); + EXPECT_THAT(finalize_status, IsOk()); + EXPECT_TRUE(deleted_files.empty()); +} + +TEST_F(ExpireSnapshotsTest, CommitWithCleanupNone) { + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->CleanupLevel(CleanupLevel::kNone); + + // Commit should succeed - Finalize is called internally but skips cleanup + EXPECT_THAT(update->Commit(), IsOk()); + + // Verify snapshot was removed from metadata + auto metadata = ReloadMetadata(); + EXPECT_EQ(metadata->snapshots.size(), 1); + EXPECT_EQ(metadata->snapshots.at(0)->snapshot_id, 3055729675574597004); +} + +TEST_F(ExpireSnapshotsCleanupTest, IgnoresExpiredDeleteManifestReadFailures) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_delete_file_path = table_location_ + "/data/expired-delete.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_delete_manifest_path = + table_location_ + "/metadata/expired-delete.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + auto expired_delete_manifest = WriteDeleteManifest( + expired_delete_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakePositionDeleteFile(expired_delete_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest, expired_delete_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, + expired_delete_manifest_path, + expired_manifest_list_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredFiles) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_delete_file_path = table_location_ + "/data/expired-delete.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_delete_manifest_path = + table_location_ + "/metadata/expired-delete.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + auto expired_delete_manifest = WriteDeleteManifest( + expired_delete_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakePositionDeleteFile(expired_delete_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest, expired_delete_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, + expired_delete_manifest_path, + expired_manifest_list_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, MetadataOnlySkipsDataDeletion) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_delete_manifest_path = + table_location_ + "/metadata/expired-delete.avro"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + auto expired_delete_manifest = WriteDeleteManifest( + expired_delete_manifest_path, kExpiredSnapshotId, + {MakeEntry( + ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakePositionDeleteFile(table_location_ + "/data/expired-delete.parquet"))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest, expired_delete_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->CleanupLevel(CleanupLevel::kMetadataOnly); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_manifest_path, + expired_delete_manifest_path, + expired_manifest_list_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, RetainedDeleteManifestSkipsDataDeletion) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto current_delete_file_path = table_location_ + "/data/current-delete.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto current_delete_manifest_path = + table_location_ + "/metadata/current-delete.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + auto current_delete_manifest = WriteDeleteManifest( + current_delete_manifest_path, kCurrentSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kCurrentSnapshotId, kCurrentSequenceNumber, + MakePositionDeleteFile(current_delete_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {current_delete_manifest}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_manifest_path, + expired_manifest_list_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredStats) { + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + const auto expired_statistics_path = table_location_ + "/metadata/stats-expired.puffin"; + + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestListsAndStatistics( + expired_manifest_list_path, current_manifest_list_path, + {MakeStatisticsFile(kExpiredSnapshotId, expired_statistics_path)}, {}); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Contains(expired_statistics_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, KeepsReusedStats) { + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + const auto reused_statistics_path = table_location_ + "/metadata/stats-reused.puffin"; + + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestListsAndStatistics( + expired_manifest_list_path, current_manifest_list_path, + {MakeStatisticsFile(kExpiredSnapshotId, reused_statistics_path), + MakeStatisticsFile(kCurrentSnapshotId, reused_statistics_path)}, + {}); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Not(testing::Contains(reused_statistics_path))); +} + +TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredPartitionStats) { + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + const auto expired_statistics_path = + table_location_ + "/metadata/partition-stats-expired.parquet"; + + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestListsAndStatistics( + expired_manifest_list_path, current_manifest_list_path, {}, + {MakePartitionStatisticsFile(kExpiredSnapshotId, expired_statistics_path)}); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Contains(expired_statistics_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, KeepsReusedPartitionStats) { + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + const auto reused_statistics_path = + table_location_ + "/metadata/partition-stats-reused.parquet"; + + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestListsAndStatistics( + expired_manifest_list_path, current_manifest_list_path, {}, + {MakePartitionStatisticsFile(kExpiredSnapshotId, reused_statistics_path), + MakePartitionStatisticsFile(kCurrentSnapshotId, reused_statistics_path)}); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Not(testing::Contains(reused_statistics_path))); +} + } // namespace iceberg diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index bf4ac426b..c552c8fd9 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -363,10 +363,13 @@ Result> Transaction::Commit() { auto commit_result = ctx_->table->catalog()->UpdateTable(ctx_->table->name(), requirements, updates); + Result finalize_result = + commit_result.has_value() + ? Result(commit_result.value()->metadata().get()) + : std::unexpected(commit_result.error()); + for (const auto& update : pending_updates_) { - std::ignore = update->Finalize(commit_result.has_value() - ? std::nullopt - : std::make_optional(commit_result.error())); + std::ignore = update->Finalize(finalize_result); } ICEBERG_RETURN_UNEXPECTED(commit_result); diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index 722ae7a42..ce65882c9 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -23,11 +23,17 @@ #include #include #include +#include +#include #include #include +#include "iceberg/file_io.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" #include "iceberg/schema.h" #include "iceberg/snapshot.h" +#include "iceberg/statistics_file.h" #include "iceberg/table.h" #include "iceberg/table_metadata.h" #include "iceberg/transaction.h" @@ -37,6 +43,296 @@ namespace iceberg { +namespace { + +Result> MakeManifestReader( + const ManifestFile& manifest, const std::shared_ptr& file_io, + const TableMetadata& metadata) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto spec, + metadata.PartitionSpecById(manifest.partition_spec_id)); + return ManifestReader::Make(manifest, file_io, std::move(schema), std::move(spec)); +} + +/// \brief Abstract strategy for cleaning up files after snapshot expiration. +class FileCleanupStrategy { + public: + FileCleanupStrategy(std::shared_ptr file_io, + std::function delete_func) + : file_io_(std::move(file_io)), delete_func_(std::move(delete_func)) {} + + virtual ~FileCleanupStrategy() = default; + + /// \brief Clean up files that are only reachable by expired snapshots. + /// + /// \param metadata_before_expiration Table metadata before expiration. + /// \param metadata_after_expiration Table metadata after expiration. + /// \param expired_snapshot_ids Snapshot IDs that were expired during this operation. + /// \param level Controls which types of files are eligible for deletion. + virtual Status CleanFiles(const TableMetadata& metadata_before_expiration, + const TableMetadata& metadata_after_expiration, + const std::unordered_set& expired_snapshot_ids, + CleanupLevel level) = 0; + + protected: + /// \brief Delete a single file + void DeleteFile(const std::string& path) { + try { + if (delete_func_) { + delete_func_(path); + } else { + std::ignore = file_io_->DeleteFile(path); + } + } catch (...) { + /// TODO(shangxinli): add retry + } + } + + /// TODO(shangxinli): Add bulk deletion + void DeleteFiles(const std::unordered_set& paths) { + for (const auto& path : paths) { + DeleteFile(path); + } + } + + bool HasAnyStatisticsFiles(const TableMetadata& metadata) const { + return !metadata.statistics.empty() || !metadata.partition_statistics.empty(); + } + + std::unordered_set StatisticsFilesToDelete( + const TableMetadata& metadata_before_expiration, + const TableMetadata& metadata_after_expiration) const { + std::unordered_set stats_files_to_delete; + std::unordered_set live_stats_paths; + + for (const auto& stats_file : metadata_after_expiration.statistics) { + if (stats_file) { + live_stats_paths.insert(stats_file->path); + } + } + + for (const auto& part_stats_file : metadata_after_expiration.partition_statistics) { + if (part_stats_file) { + live_stats_paths.insert(part_stats_file->path); + } + } + + for (const auto& stats_file : metadata_before_expiration.statistics) { + if (stats_file && !live_stats_paths.contains(stats_file->path)) { + stats_files_to_delete.insert(stats_file->path); + } + } + + for (const auto& part_stats_file : metadata_before_expiration.partition_statistics) { + if (part_stats_file && !live_stats_paths.contains(part_stats_file->path)) { + stats_files_to_delete.insert(part_stats_file->path); + } + } + + return stats_files_to_delete; + } + + std::shared_ptr file_io_; + std::function delete_func_; +}; + +/// \brief File cleanup strategy that determines safe deletions via full reachability. +/// +/// Collects manifests from all expired and retained snapshots, prunes candidates +/// still referenced by retained snapshots, then deletes orphaned manifests, data +/// files, and manifest lists. +/// +/// TODO(shangxinli): Add multi-threaded manifest reading and file deletion support. +class ReachableFileCleanup : public FileCleanupStrategy { + public: + using FileCleanupStrategy::FileCleanupStrategy; + + Status CleanFiles(const TableMetadata& metadata_before_expiration, + const TableMetadata& metadata_after_expiration, + const std::unordered_set& expired_snapshot_ids, + CleanupLevel level) override { + std::unordered_set retained_snapshot_ids; + for (const auto& snapshot : metadata_after_expiration.snapshots) { + if (snapshot) { + retained_snapshot_ids.insert(snapshot->snapshot_id); + } + } + + std::unordered_set manifest_lists_to_delete; + for (int64_t snapshot_id : expired_snapshot_ids) { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot, + metadata_before_expiration.SnapshotById(snapshot_id)); + if (snapshot && !snapshot->manifest_list.empty()) { + manifest_lists_to_delete.insert(snapshot->manifest_list); + } + } + + ICEBERG_ASSIGN_OR_RAISE( + auto deletion_candidates, + ReadManifests(metadata_before_expiration, expired_snapshot_ids)); + + if (!deletion_candidates.empty()) { + std::unordered_set current_manifests; + ICEBERG_ASSIGN_OR_RAISE( + auto manifests_to_delete, + PruneReferencedManifests(metadata_after_expiration, retained_snapshot_ids, + std::move(deletion_candidates), current_manifests)); + + if (!manifests_to_delete.empty()) { + if (level == CleanupLevel::kAll) { + // Deleting data files + auto data_files_to_delete = FindDataFilesToDelete( + metadata_after_expiration, manifests_to_delete, current_manifests); + DeleteFiles(data_files_to_delete); + } + + // Deleting manifest files + DeleteFiles(ManifestPaths(manifests_to_delete)); + } + } + + // Deleting manifest-list files + DeleteFiles(manifest_lists_to_delete); + + // Deleting statistics files + if (HasAnyStatisticsFiles(metadata_before_expiration) || + HasAnyStatisticsFiles(metadata_after_expiration)) { + DeleteFiles( + StatisticsFilesToDelete(metadata_before_expiration, metadata_after_expiration)); + } + + return {}; + } + + private: + /// \brief Collect manifests for a snapshot into manifests. + Result> ReadManifestsForSnapshot( + const TableMetadata& metadata, int64_t snapshot_id) { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot, metadata.SnapshotById(snapshot_id)); + + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, snapshot_cache.Manifests(file_io_)); + + std::unordered_set manifests; + for (const auto& manifest : snapshot_manifests) { + manifests.insert(manifest); + } + return manifests; + } + + /// \brief Collect manifests for a set of snapshots. + Result> ReadManifests( + const TableMetadata& metadata, const std::unordered_set& snapshot_ids) { + std::unordered_set manifests; + for (int64_t snapshot_id : snapshot_ids) { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, + ReadManifestsForSnapshot(metadata, snapshot_id)); + manifests.insert(snapshot_manifests.begin(), snapshot_manifests.end()); + } + return manifests; + } + + /// \brief Remove manifests still referenced by retained snapshots. + Result> PruneReferencedManifests( + const TableMetadata& metadata, + const std::unordered_set& retained_snapshot_ids, + std::unordered_set manifests_to_delete, + std::unordered_set& current_manifests) { + for (int64_t snapshot_id : retained_snapshot_ids) { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, + ReadManifestsForSnapshot(metadata, snapshot_id)); + + for (const auto& manifest : snapshot_manifests) { + manifests_to_delete.erase(manifest); + + if (manifests_to_delete.empty()) { + return manifests_to_delete; + } + + current_manifests.insert(manifest); + } + } + + return manifests_to_delete; + } + + Result> ReadLiveDataFilePaths( + const TableMetadata& metadata, const ManifestFile& manifest) { + ICEBERG_PRECHECK(manifest.content == ManifestContent::kData, + "Cannot read data file paths from a delete manifest: {}", + manifest.manifest_path); + + /// TODO(shangxinli): optimize by only reading file paths + ICEBERG_ASSIGN_OR_RAISE(auto reader, + MakeManifestReader(manifest, file_io_, metadata)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); + + std::unordered_set data_file_paths; + for (const auto& entry : entries) { + if (entry.data_file) { + data_file_paths.insert(entry.data_file->file_path); + } + } + + return data_file_paths; + } + + /// \brief Project manifests to manifest paths for deletion. + std::unordered_set ManifestPaths( + const std::unordered_set& manifests) const { + std::unordered_set manifest_paths; + manifest_paths.reserve(manifests.size()); + for (const auto& manifest : manifests) { + manifest_paths.insert(manifest.manifest_path); + } + return manifest_paths; + } + + /// \brief Find data files to delete from manifests being removed. + std::unordered_set FindDataFilesToDelete( + const TableMetadata& metadata, + const std::unordered_set& manifests_to_delete, + const std::unordered_set& current_manifests) { + std::unordered_set data_files_to_delete; + + // Collect live file paths from manifests being deleted. + for (const auto& manifest : manifests_to_delete) { + auto live_data_files = ReadLiveDataFilePaths(metadata, manifest); + // Ignore expired-manifest read failures and keep scanning candidates. + if (!live_data_files.has_value()) { + continue; + } + + data_files_to_delete.insert(live_data_files->begin(), live_data_files->end()); + } + + if (data_files_to_delete.empty()) { + return data_files_to_delete; + } + + // Remove files still referenced by current manifests. + for (const auto& manifest : current_manifests) { + if (data_files_to_delete.empty()) { + return data_files_to_delete; + } + + auto live_data_files = ReadLiveDataFilePaths(metadata, manifest); + // Fail closed if any retained manifest cannot be read safely. + if (!live_data_files.has_value()) { + return std::unordered_set{}; + } + + for (const auto& file_path : live_data_files.value()) { + data_files_to_delete.erase(file_path); + } + } + + return data_files_to_delete; + } +}; + +} // namespace + Result> ExpireSnapshots::Make( std::shared_ptr ctx) { ICEBERG_PRECHECK(ctx != nullptr, "Cannot create ExpireSnapshots without a context"); @@ -241,6 +537,7 @@ Result ExpireSnapshots::Apply() { unreferenced_snapshot_ids.end()); ApplyResult result; + result.metadata_before_expiration = std::make_shared(base); std::ranges::for_each(base.refs, [&retained_refs, &result](const auto& key_to_ref) { if (!retained_refs.contains(key_to_ref.first)) { @@ -285,7 +582,42 @@ Result ExpireSnapshots::Apply() { }); } + // Cache the result for use during Finalize() + apply_result_ = result; + return result; } +Status ExpireSnapshots::Finalize(Result commit_result) { + if (!commit_result.has_value()) { + return {}; + } + + if (cleanup_level_ == CleanupLevel::kNone) { + return {}; + } + + if (!apply_result_.has_value() || apply_result_->snapshot_ids_to_remove.empty()) { + return {}; + } + + ICEBERG_PRECHECK(apply_result_->metadata_before_expiration != nullptr, + "Missing pre-expiration table metadata for cleanup"); + ICEBERG_PRECHECK(commit_result.value() != nullptr, + "Missing committed table metadata for cleanup"); + auto metadata_before_expiration_ptr = apply_result_->metadata_before_expiration; + const TableMetadata& metadata_before_expiration = *metadata_before_expiration_ptr; + const TableMetadata& metadata_after_expiration = *commit_result.value(); + std::unordered_set expired_ids(apply_result_->snapshot_ids_to_remove.begin(), + apply_result_->snapshot_ids_to_remove.end()); + apply_result_.reset(); + + // File cleanup is best-effort: log and continue on individual file deletion failures + ReachableFileCleanup strategy(ctx_->table->io(), delete_func_); + return strategy.CleanFiles(metadata_before_expiration, metadata_after_expiration, + expired_ids, cleanup_level_); +} + +// TODO(shangxinli): add IncrementalFileCleanup strategy for linear ancestry optimization. + } // namespace iceberg diff --git a/src/iceberg/update/expire_snapshots.h b/src/iceberg/update/expire_snapshots.h index bc05d810d..23b8743b9 100644 --- a/src/iceberg/update/expire_snapshots.h +++ b/src/iceberg/update/expire_snapshots.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -73,6 +75,7 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { std::vector snapshot_ids_to_remove; std::vector partition_spec_ids_to_remove; std::unordered_set schema_ids_to_remove; + std::shared_ptr metadata_before_expiration; }; /// \brief Expires a specific Snapshot identified by id. @@ -142,6 +145,17 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { /// \return The results of changes Result Apply(); + /// \brief Finalize the expire snapshots update, cleaning up expired files. + /// + /// After a successful commit, this method deletes manifest files, manifest lists, + /// data files, and statistics files that are no longer referenced by any valid + /// snapshot. The cleanup behavior is controlled by the CleanupLevel setting. + /// + /// \param commit_result The committed table metadata when the commit succeeds, or the + /// commit error when it fails. + /// \return Status indicating success or failure + Status Finalize(Result commit_result) override; + private: explicit ExpireSnapshots(std::shared_ptr ctx); @@ -159,7 +173,6 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { Result> UnreferencedSnapshotIdsToRetain( const SnapshotToRef& refs) const; - private: const TimePointMs current_time_ms_; const int64_t default_max_ref_age_ms_; int32_t default_min_num_snapshots_; @@ -169,6 +182,9 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { enum CleanupLevel cleanup_level_ { CleanupLevel::kAll }; bool clean_expired_metadata_{false}; bool specified_snapshot_id_{false}; + + /// Cached result from Apply(), consumed by Finalize() and cleared after use. + std::optional apply_result_; }; } // namespace iceberg diff --git a/src/iceberg/update/pending_update.cc b/src/iceberg/update/pending_update.cc index 2d5247d29..4b3000652 100644 --- a/src/iceberg/update/pending_update.cc +++ b/src/iceberg/update/pending_update.cc @@ -19,6 +19,8 @@ #include "iceberg/update/pending_update.h" +#include "iceberg/result.h" +#include "iceberg/table.h" #include "iceberg/transaction.h" #include "iceberg/util/macros.h" @@ -33,16 +35,20 @@ Status PendingUpdate::Commit() { if (!ctx_->transaction) { // Table-created path: no transaction exists yet, create a temporary one. ICEBERG_ASSIGN_OR_RAISE(auto txn, Transaction::Make(ctx_)); - Status status = txn->Apply(*this); - if (status.has_value()) { - auto commit_result = txn->Commit(); - if (!commit_result.has_value()) { - status = std::unexpected(commit_result.error()); - } + auto apply_status = txn->Apply(*this); + if (!apply_status.has_value()) { + std::ignore = Finalize(std::unexpected(apply_status.error())); + return apply_status; } - std::ignore = - Finalize(status.has_value() ? std::nullopt : std::make_optional(status.error())); - return status; + + auto commit_result = txn->Commit(); + if (!commit_result.has_value()) { + std::ignore = Finalize(std::unexpected(commit_result.error())); + return std::unexpected(commit_result.error()); + } + + std::ignore = Finalize(commit_result.value()->metadata().get()); + return {}; } auto txn = ctx_->transaction->lock(); if (!txn) { @@ -51,7 +57,8 @@ Status PendingUpdate::Commit() { return txn->Apply(*this); } -Status PendingUpdate::Finalize([[maybe_unused]] std::optional commit_error) { +Status PendingUpdate::Finalize( + [[maybe_unused]] Result commit_result) { return {}; } diff --git a/src/iceberg/update/pending_update.h b/src/iceberg/update/pending_update.h index f67be18cd..ad6b91e2f 100644 --- a/src/iceberg/update/pending_update.h +++ b/src/iceberg/update/pending_update.h @@ -23,7 +23,6 @@ /// API for table changes using builder pattern #include -#include #include "iceberg/iceberg_export.h" #include "iceberg/result.h" @@ -71,9 +70,10 @@ class ICEBERG_EXPORT PendingUpdate : public ErrorCollector { /// This method is called after the update is committed. /// Implementations should override this method to clean up any resources. /// - /// \param commit_error An optional error indicating whether the commit was successful + /// \param commit_result The committed table metadata when the commit succeeds, or the + /// commit error when it fails. /// \return Status indicating success or failure - virtual Status Finalize(std::optional commit_error); + virtual Status Finalize(Result commit_result); // Non-copyable, movable PendingUpdate(const PendingUpdate&) = delete; diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index 3e5792667..fd1c21f55 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -297,9 +297,9 @@ Result SnapshotUpdate::Apply() { .stage_only = stage_only_}; } -Status SnapshotUpdate::Finalize(std::optional commit_error) { - if (commit_error.has_value()) { - if (commit_error->kind == ErrorKind::kCommitStateUnknown) { +Status SnapshotUpdate::Finalize(Result commit_result) { + if (!commit_result.has_value()) { + if (commit_result.error().kind == ErrorKind::kCommitStateUnknown) { return {}; } CleanAll(); diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index 284d1d2db..97ec29b28 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -118,7 +118,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { Result Apply(); /// \brief Finalize the snapshot update, cleaning up any uncommitted files. - Status Finalize(std::optional commit_error) override; + Status Finalize(Result commit_result) override; protected: explicit SnapshotUpdate(std::shared_ptr ctx); From 8809e0f4ae59969e9cbd62ad0f3c4801943ffbe2 Mon Sep 17 00:00:00 2001 From: SkylerLin <44233950+linguoxuan@users.noreply.github.com> Date: Fri, 24 Apr 2026 22:48:51 +0800 Subject: [PATCH 010/151] feat: retry failed transaction commit (#626) This commit implements the retry for transaction commits. It introduces a generic RetryRunner utility with exponential backoff and error-kind filtering, and integrates it into Transaction::Commit() to automatically refresh table metadata and retry on commit conflicts. --- src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/meson.build | 1 + src/iceberg/test/retry_util_test.cc | 304 ++++++++++++++++++ src/iceberg/test/table_test.cc | 3 + src/iceberg/test/transaction_test.cc | 146 +++++++++ src/iceberg/test/update_statistics_test.cc | 63 ++++ src/iceberg/transaction.cc | 71 +++- src/iceberg/transaction.h | 6 + src/iceberg/update/expire_snapshots.h | 1 + src/iceberg/update/pending_update.h | 3 + src/iceberg/update/set_snapshot.h | 1 + src/iceberg/update/snapshot_update.cc | 12 + src/iceberg/update/snapshot_update.h | 1 + src/iceberg/update/update_location.h | 1 + src/iceberg/update/update_partition_spec.h | 7 + .../update/update_partition_statistics.h | 7 + src/iceberg/update/update_properties.h | 1 + src/iceberg/update/update_schema.h | 7 + .../update/update_snapshot_reference.h | 7 + src/iceberg/update/update_sort_order.h | 1 + src/iceberg/update/update_statistics.h | 6 + src/iceberg/util/meson.build | 1 + src/iceberg/util/retry_util.h | 221 +++++++++++++ 23 files changed, 857 insertions(+), 15 deletions(-) create mode 100644 src/iceberg/test/retry_util_test.cc create mode 100644 src/iceberg/util/retry_util.h diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 92fd0c1c2..b0f03b527 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -119,6 +119,7 @@ add_iceberg_test(util_test location_util_test.cc roaring_position_bitmap_test.cc position_delete_index_test.cc + retry_util_test.cc string_util_test.cc struct_like_set_test.cc transform_util_test.cc diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index f3eeb7da5..ed9a5866a 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -91,6 +91,7 @@ iceberg_tests = { 'formatter_test.cc', 'location_util_test.cc', 'position_delete_index_test.cc', + 'retry_util_test.cc', 'roaring_position_bitmap_test.cc', 'string_util_test.cc', 'struct_like_set_test.cc', diff --git a/src/iceberg/test/retry_util_test.cc b/src/iceberg/test/retry_util_test.cc new file mode 100644 index 000000000..05c7cb0e1 --- /dev/null +++ b/src/iceberg/test/retry_util_test.cc @@ -0,0 +1,304 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/util/retry_util.h" + +#include +#include + +#include + +#include "iceberg/result.h" +#include "iceberg/test/matchers.h" + +namespace iceberg { + +TEST(RetryRunnerTest, SuccessOnFirstAttempt) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + return 42; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 42); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, RetryOnceThenSucceed) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("transient failure"); + } + return 42; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 42); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(attempts, 2); +} + +TEST(RetryRunnerTest, MaxAttemptsExhausted) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + return CommitFailed("always fails"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +TEST(RetryRunnerTest, OnlyRetryOnFilter) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + return ValidationFailed("schema conflict"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, OnlyRetryOnMatchingError) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + if (call_count <= 2) { + return CommitFailed("transient"); + } + return 100; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 100); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +TEST(RetryRunnerTest, StopRetryOnMatchingError) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 5, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .StopRetryOn({ErrorKind::kCommitStateUnknown}) + .Run( + [&]() -> Result { + ++call_count; + return CommitStateUnknown("datacenter on fire"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kCommitStateUnknown)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, ZeroRetries) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 0, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + return CommitFailed("fail"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, TotalTimeoutStopsBeforeStartingAnotherAttempt) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 20, + .max_wait_ms = 20, + .total_timeout_ms = 15}) + .Run( + [&]() -> Result { + ++call_count; + // The first failure consumes most of the 15 ms budget, so the + // next 20 ms backoff should prevent another attempt from + // starting. + if (call_count == 1) { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + } + return CommitFailed("retry budget exhausted"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, MakeCommitRetryRunnerConfig) { + int call_count = 0; + int32_t attempts = 0; + + auto result = MakeCommitRetryRunner(2, 1, 10, 5000) + .Run( + [&]() -> Result { + ++call_count; + return ValidationFailed("not retryable"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + +TEST(RetryRunnerTest, MakeCommitRetryRunnerRetriesCommitFailed) { + int call_count = 0; + int32_t attempts = 0; + + auto result = MakeCommitRetryRunner(3, 1, 10, 5000) + .Run( + [&]() -> Result { + ++call_count; + if (call_count <= 2) { + return CommitFailed("transient"); + } + return 99; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 99); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +TEST(RetryRunnerTest, OnlyRetryOnMultipleErrorKinds) { + int call_count = 0; + int32_t attempts = 0; + + auto result = + RetryRunner(RetryConfig{.num_retries = 5, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .OnlyRetryOn({ErrorKind::kCommitFailed, ErrorKind::kServiceUnavailable}) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("conflict"); + } + if (call_count == 2) { + return ServiceUnavailable("server busy"); + } + return 77; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 77); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +TEST(RetryRunnerTest, DefaultRetryAllErrors) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return IOError("disk full"); + } + if (call_count == 2) { + return ValidationFailed("bad schema"); + } + return 55; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 55); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index e445d9011..0ad8e8ced 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -128,6 +128,9 @@ TYPED_TEST(TypedTableTest, Refresh) { .WillOnce(::testing::Return(refreshed)); } EXPECT_THAT(table->Refresh(), IsOk()); + if constexpr (std::is_same_v) { + EXPECT_EQ(table->metadata_file_location(), "s3://bucket/meta2.json"); + } } else { EXPECT_THAT(table->Refresh(), IsError(ErrorKind::kNotSupported)); } diff --git a/src/iceberg/test/transaction_test.cc b/src/iceberg/test/transaction_test.cc index 232febc1f..3a13b7bc5 100644 --- a/src/iceberg/test/transaction_test.cc +++ b/src/iceberg/test/transaction_test.cc @@ -23,9 +23,12 @@ #include "iceberg/expression/term.h" #include "iceberg/sort_order.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/mock_catalog.h" #include "iceberg/test/update_test_base.h" #include "iceberg/transform.h" +#include "iceberg/type.h" #include "iceberg/update/update_properties.h" +#include "iceberg/update/update_schema.h" #include "iceberg/update/update_sort_order.h" namespace iceberg { @@ -94,4 +97,147 @@ TEST_F(TransactionTest, MultipleUpdatesInTransaction) { EXPECT_EQ(*sort_order, *expected_sort_order); } +class TransactionRetryTest : public UpdateTestBase { + protected: + void SetUp() override { + UpdateTestBase::SetUp(); + + // Create a MockCatalog and wire it to the existing table + mock_catalog_ = std::make_shared<::testing::NiceMock>(); + + ON_CALL(*mock_catalog_, LoadTable(::testing::_)) + .WillByDefault([this](const TableIdentifier&) -> Result> { + return Table::Make(table_->name(), table_->metadata(), + std::string(table_->metadata_file_location()), table_->io(), + mock_catalog_); + }); + + // Create a table instance bound to the mock catalog + auto result = Table::Make(table_->name(), table_->metadata(), + std::string(table_->metadata_file_location()), table_->io(), + mock_catalog_); + ASSERT_THAT(result, IsOk()); + mock_table_ = std::move(result.value()); + } + + std::shared_ptr<::testing::NiceMock> mock_catalog_; + std::shared_ptr mock_table_; +}; + +TEST_F(TransactionRetryTest, CommitRetrySucceedsAfterConflict) { + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault([this, &update_call_count]( + const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + if (update_call_count == 1) { + return CommitFailed("conflict on first attempt"); + } + return Table::Make(mock_table_->name(), mock_table_->metadata(), + std::string(mock_table_->metadata_file_location()), + mock_table_->io(), mock_catalog_); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, mock_table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto update, txn->NewUpdateProperties()); + update->Set("retry.test", "value"); + EXPECT_THAT(update->Commit(), IsOk()); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(update_call_count, 2); +} + +TEST_F(TransactionRetryTest, CommitRetryExhausted) { + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [&update_call_count](const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + return CommitFailed("always conflicts"); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, mock_table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto update, txn->NewUpdateProperties()); + update->Set("retry.test", "value"); + EXPECT_THAT(update->Commit(), IsOk()); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(update_call_count, 5); +} + +TEST_F(TransactionRetryTest, CommitNonRetryableErrorStopsImmediately) { + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [&update_call_count](const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + return CommitStateUnknown("unknown state"); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, mock_table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto update, txn->NewUpdateProperties()); + update->Set("retry.test", "value"); + EXPECT_THAT(update->Commit(), IsOk()); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitStateUnknown)); + EXPECT_EQ(update_call_count, 1); // Should not retry +} + +TEST_F(TransactionRetryTest, CreateTransactionDoesNotRetry) { + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [&update_call_count](const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + return CommitFailed("conflict"); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, + Transaction::Make(mock_table_, TransactionKind::kCreate)); + ICEBERG_UNWRAP_OR_FAIL(auto update, txn->NewUpdateProperties()); + update->Set("create.test", "value"); + EXPECT_THAT(update->Commit(), IsOk()); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(update_call_count, 1); // No retry for kCreate +} + +TEST_F(TransactionRetryTest, NonRetryableUpdatePreventsRetry) { + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [&update_call_count](const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + return CommitFailed("conflict"); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, mock_table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto schema_update, txn->NewUpdateSchema()); + schema_update->AddColumn("new_col", int64()); + EXPECT_THAT(schema_update->Commit(), IsOk()); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(update_call_count, 1); +} + } // namespace iceberg diff --git a/src/iceberg/test/update_statistics_test.cc b/src/iceberg/test/update_statistics_test.cc index 7b9d4f582..d6721e5bd 100644 --- a/src/iceberg/test/update_statistics_test.cc +++ b/src/iceberg/test/update_statistics_test.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -28,6 +29,7 @@ #include "iceberg/result.h" #include "iceberg/statistics_file.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/mock_catalog.h" #include "iceberg/test/update_test_base.h" namespace iceberg { @@ -66,6 +68,35 @@ class UpdateStatisticsTest : public UpdateTestBase { } }; +class UpdateStatisticsRetryTest : public UpdateStatisticsTest { + protected: + void SetUp() override { + UpdateStatisticsTest::SetUp(); + + mock_catalog_ = std::make_shared<::testing::NiceMock>(); + + ON_CALL(*mock_catalog_, LoadTable(::testing::_)) + .WillByDefault([this](const TableIdentifier&) -> Result> { + ++load_table_count_; + auto refreshed_metadata = std::make_shared(*table_->metadata()); + auto refreshed_location = table_location_ + "/metadata/reload-" + + std::to_string(load_table_count_) + ".metadata.json"; + return Table::Make(table_->name(), std::move(refreshed_metadata), + std::move(refreshed_location), table_->io(), mock_catalog_); + }); + + auto result = Table::Make(table_->name(), table_->metadata(), + std::string(table_->metadata_file_location()), table_->io(), + mock_catalog_); + ASSERT_THAT(result, IsOk()); + mock_table_ = std::move(result.value()); + } + + int load_table_count_ = 0; + std::shared_ptr<::testing::NiceMock> mock_catalog_; + std::shared_ptr
mock_table_; +}; + TEST_F(UpdateStatisticsTest, EmptyUpdate) { ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewUpdateStatistics()); ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); @@ -218,4 +249,36 @@ TEST_F(UpdateStatisticsTest, CommitSuccess) { EXPECT_EQ(*statistics[0], *stats_file); } +TEST_F(UpdateStatisticsRetryTest, StandaloneCommitRetriesAfterConflict) { + ICEBERG_UNWRAP_OR_FAIL(auto current_snapshot, mock_table_->current_snapshot()); + auto stats_file = MakeStatisticsFile(current_snapshot->snapshot_id, + "/warehouse/test_table/metadata/stats-1.puffin"); + + int update_call_count = 0; + ON_CALL(*mock_catalog_, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault([this, &update_call_count, stats_file]( + const TableIdentifier&, + const std::vector>&, + const std::vector>&) + -> Result> { + ++update_call_count; + if (update_call_count == 1) { + return CommitFailed("conflict on first attempt"); + } + auto committed_metadata = + std::make_shared(*mock_table_->metadata()); + committed_metadata->statistics = {stats_file}; + return Table::Make(mock_table_->name(), std::move(committed_metadata), + table_location_ + "/metadata/committed.metadata.json", + mock_table_->io(), mock_catalog_); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto update, mock_table_->NewUpdateStatistics()); + update->SetStatistics(stats_file); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_EQ(update_call_count, 2); + EXPECT_EQ(load_table_count_, 1); +} + } // namespace iceberg diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index c552c8fd9..049b0f49d 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -50,6 +49,7 @@ #include "iceberg/util/checked_cast.h" #include "iceberg/util/location_util.h" #include "iceberg/util/macros.h" +#include "iceberg/util/retry_util.h" namespace iceberg { @@ -346,22 +346,22 @@ Result> Transaction::Commit() { return ctx_->table; } - std::vector> requirements; - switch (ctx_->kind) { - case TransactionKind::kCreate: { - ICEBERG_ASSIGN_OR_RAISE(requirements, TableRequirements::ForCreateTable(updates)); - } break; - case TransactionKind::kUpdate: { - ICEBERG_ASSIGN_OR_RAISE( - requirements, - TableRequirements::ForUpdateTable(*ctx_->metadata_builder->base(), updates)); + const auto& props = ctx_->table->properties(); + int32_t num_retries = + CanRetry() ? static_cast(props.Get(TableProperties::kCommitNumRetries)) + : 0; + int32_t min_wait_ms = props.Get(TableProperties::kCommitMinRetryWaitMs); + int32_t max_wait_ms = props.Get(TableProperties::kCommitMaxRetryWaitMs); + int32_t total_timeout_ms = props.Get(TableProperties::kCommitTotalRetryTimeMs); - } break; - } - - // XXX: we should handle commit failure and retry here. + bool is_first_attempt = true; auto commit_result = - ctx_->table->catalog()->UpdateTable(ctx_->table->name(), requirements, updates); + MakeCommitRetryRunner(num_retries, min_wait_ms, max_wait_ms, total_timeout_ms) + .Run([this, &is_first_attempt]() -> Result> { + auto result = CommitOnce(is_first_attempt); + is_first_attempt = false; + return result; + }); Result finalize_result = commit_result.has_value() @@ -381,6 +381,47 @@ Result> Transaction::Commit() { return ctx_->table; } +Result> Transaction::CommitOnce(bool is_first_attempt) { + std::vector> requirements; + + switch (ctx_->kind) { + case TransactionKind::kCreate: { + ICEBERG_ASSIGN_OR_RAISE(requirements, TableRequirements::ForCreateTable( + ctx_->metadata_builder->changes())); + } break; + case TransactionKind::kUpdate: { + if (!is_first_attempt) { + ICEBERG_RETURN_UNEXPECTED(ctx_->table->Refresh()); + } + if (ctx_->metadata_builder->base() != ctx_->table->metadata().get()) { + ctx_->metadata_builder = + TableMetadataBuilder::BuildFrom(ctx_->table->metadata().get()); + for (const auto& update : pending_updates_) { + ICEBERG_RETURN_UNEXPECTED(Apply(*update)); + } + } + ICEBERG_ASSIGN_OR_RAISE(requirements, TableRequirements::ForUpdateTable( + *ctx_->metadata_builder->base(), + ctx_->metadata_builder->changes())); + } break; + } + + return ctx_->table->catalog()->UpdateTable(ctx_->table->name(), requirements, + ctx_->metadata_builder->changes()); +} + +bool Transaction::CanRetry() const { + if (ctx_->kind == TransactionKind::kCreate) { + return false; + } + for (const auto& update : pending_updates_) { + if (!update->IsRetryable()) { + return false; + } + } + return true; +} + Result> Transaction::NewUpdatePartitionSpec() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_spec, UpdatePartitionSpec::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index ec8c4db0a..60fe935f3 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -138,6 +138,12 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> CommitOnce(bool is_first_attempt); + + /// \brief Whether this transaction can retry after a commit conflict. + bool CanRetry() const; + private: friend class PendingUpdate; diff --git a/src/iceberg/update/expire_snapshots.h b/src/iceberg/update/expire_snapshots.h index 23b8743b9..7c1588aa5 100644 --- a/src/iceberg/update/expire_snapshots.h +++ b/src/iceberg/update/expire_snapshots.h @@ -140,6 +140,7 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { ExpireSnapshots& CleanExpiredMetadata(bool clean); Kind kind() const final { return Kind::kExpireSnapshots; } + bool IsRetryable() const override { return true; } /// \brief Apply the pending changes and return the results /// \return The results of changes diff --git a/src/iceberg/update/pending_update.h b/src/iceberg/update/pending_update.h index ad6b91e2f..19998ddb3 100644 --- a/src/iceberg/update/pending_update.h +++ b/src/iceberg/update/pending_update.h @@ -57,6 +57,9 @@ class ICEBERG_EXPORT PendingUpdate : public ErrorCollector { /// \brief Return the kind of this pending update. virtual Kind kind() const = 0; + /// \brief Whether this update can be retried after a commit conflict. + virtual bool IsRetryable() const = 0; + /// \brief Apply the pending changes and commit. /// /// \return An OK status if the commit was successful, or an error: diff --git a/src/iceberg/update/set_snapshot.h b/src/iceberg/update/set_snapshot.h index 6aeb92652..431e636b2 100644 --- a/src/iceberg/update/set_snapshot.h +++ b/src/iceberg/update/set_snapshot.h @@ -51,6 +51,7 @@ class ICEBERG_EXPORT SetSnapshot : public PendingUpdate { SetSnapshot& RollbackTo(int64_t snapshot_id); Kind kind() const final { return Kind::kSetSnapshot; } + bool IsRetryable() const override { return true; } /// \brief Apply the pending changes and return the target snapshot ID. Result Apply(); diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index fd1c21f55..a59ebdc72 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -226,6 +226,18 @@ int64_t SnapshotUpdate::SnapshotId() { Result SnapshotUpdate::Apply() { ICEBERG_RETURN_UNEXPECTED(CheckErrors()); + + if (staged_snapshot_ != nullptr) { + for (const auto& manifest_list : manifest_lists_) { + std::ignore = DeleteFile(manifest_list); + } + manifest_lists_.clear(); + CleanUncommitted(std::unordered_set{}); + + staged_snapshot_ = nullptr; + summary_.Clear(); + } + ICEBERG_ASSIGN_OR_RAISE(auto parent_snapshot, SnapshotUtil::OptionalLatestSnapshot(base(), target_branch_)); diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index 97ec29b28..f48e5f44d 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -52,6 +52,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { ~SnapshotUpdate() override; Kind kind() const override { return Kind::kUpdateSnapshot; } + bool IsRetryable() const override { return true; } /// \brief Set a callback to delete files instead of the table's default. /// diff --git a/src/iceberg/update/update_location.h b/src/iceberg/update/update_location.h index 33864380e..48fb84c21 100644 --- a/src/iceberg/update/update_location.h +++ b/src/iceberg/update/update_location.h @@ -45,6 +45,7 @@ class ICEBERG_EXPORT UpdateLocation : public PendingUpdate { UpdateLocation& SetLocation(std::string_view location); Kind kind() const final { return Kind::kUpdateLocation; } + bool IsRetryable() const override { return true; } /// \brief Apply the pending changes and return the new location. Result Apply(); diff --git a/src/iceberg/update/update_partition_spec.h b/src/iceberg/update/update_partition_spec.h index 6b3dd40ee..67dcb1413 100644 --- a/src/iceberg/update/update_partition_spec.h +++ b/src/iceberg/update/update_partition_spec.h @@ -100,6 +100,13 @@ class ICEBERG_EXPORT UpdatePartitionSpec : public PendingUpdate { Kind kind() const final { return Kind::kUpdatePartitionSpec; } + /// \brief Partition spec updates are not retryable. + /// + /// The update caches the current schema/spec state and may allocate or recycle + /// partition field IDs from that base. Replaying after a refresh can change the + /// intended transform bindings or field ID assignment semantics. + bool IsRetryable() const override { return false; } + struct ApplyResult { std::shared_ptr spec; bool set_as_default; diff --git a/src/iceberg/update/update_partition_statistics.h b/src/iceberg/update/update_partition_statistics.h index bdaf5a703..982b1bd39 100644 --- a/src/iceberg/update/update_partition_statistics.h +++ b/src/iceberg/update/update_partition_statistics.h @@ -63,6 +63,13 @@ class ICEBERG_EXPORT UpdatePartitionStatistics : public PendingUpdate { Kind kind() const final { return Kind::kUpdatePartitionStatistics; } + /// \brief Partition statistics updates are intentionally not retried today. + /// + /// This matches the current Java `SetPartitionStatistics` behavior, which commits + /// directly without a retry loop. Keep this conservative until we add explicit replay + /// coverage for this update type. + bool IsRetryable() const override { return false; } + struct ApplyResult { std::vector>> to_set; std::vector to_remove; diff --git a/src/iceberg/update/update_properties.h b/src/iceberg/update/update_properties.h index 491a55678..dee923410 100644 --- a/src/iceberg/update/update_properties.h +++ b/src/iceberg/update/update_properties.h @@ -66,6 +66,7 @@ class ICEBERG_EXPORT UpdateProperties : public PendingUpdate { UpdateProperties& Remove(const std::string& key); Kind kind() const final { return Kind::kUpdateProperties; } + bool IsRetryable() const override { return true; } /// \brief Apply the pending changes and return the updates and removals. Result Apply(); diff --git a/src/iceberg/update/update_schema.h b/src/iceberg/update/update_schema.h index 564a03df1..2be3732a0 100644 --- a/src/iceberg/update/update_schema.h +++ b/src/iceberg/update/update_schema.h @@ -334,6 +334,13 @@ class ICEBERG_EXPORT UpdateSchema : public PendingUpdate { Kind kind() const final { return Kind::kUpdateSchema; } + /// \brief Schema updates are not retryable. + /// + /// The update records field IDs, move targets, and last-column-id-derived state from + /// the schema that was current when the builder was created. Replaying after a refresh + /// can apply a different schema evolution than the caller originally authored. + bool IsRetryable() const override { return false; } + struct ApplyResult { std::shared_ptr schema; int32_t new_last_column_id; diff --git a/src/iceberg/update/update_snapshot_reference.h b/src/iceberg/update/update_snapshot_reference.h index 7d061ea3b..9ff0a5083 100644 --- a/src/iceberg/update/update_snapshot_reference.h +++ b/src/iceberg/update/update_snapshot_reference.h @@ -134,6 +134,13 @@ class ICEBERG_EXPORT UpdateSnapshotReference : public PendingUpdate { Kind kind() const final { return Kind::kUpdateSnapshotReference; } + /// \brief Snapshot reference updates are not retryable. + /// + /// The update snapshots the ref map at construction time and validates rename or + /// fast-forward operations against that captured state. Replaying after a refresh can + /// clobber or reinterpret concurrent ref changes. + bool IsRetryable() const override { return false; } + struct ApplyResult { /// References to set or update (name, ref pairs) std::vector>> to_set; diff --git a/src/iceberg/update/update_sort_order.h b/src/iceberg/update/update_sort_order.h index 53fe927ef..4696ae72d 100644 --- a/src/iceberg/update/update_sort_order.h +++ b/src/iceberg/update/update_sort_order.h @@ -66,6 +66,7 @@ class ICEBERG_EXPORT UpdateSortOrder : public PendingUpdate { UpdateSortOrder& CaseSensitive(bool case_sensitive); Kind kind() const final { return Kind::kUpdateSortOrder; } + bool IsRetryable() const override { return true; } /// \brief Apply the pending changes and return the new SortOrder. Result> Apply(); diff --git a/src/iceberg/update/update_statistics.h b/src/iceberg/update/update_statistics.h index 6441c02a3..4a6c12fc4 100644 --- a/src/iceberg/update/update_statistics.h +++ b/src/iceberg/update/update_statistics.h @@ -62,6 +62,12 @@ class ICEBERG_EXPORT UpdateStatistics : public PendingUpdate { Kind kind() const final { return Kind::kUpdateStatistics; } + /// \brief Statistics updates are retryable. + /// + /// The operation is keyed by snapshot ID and only replaces or removes statistics file + /// references, so replaying it after a refresh preserves the caller's intent. + bool IsRetryable() const override { return true; } + struct ApplyResult { std::vector>> to_set; std::vector to_remove; diff --git a/src/iceberg/util/meson.build b/src/iceberg/util/meson.build index 496a75758..a38dc886c 100644 --- a/src/iceberg/util/meson.build +++ b/src/iceberg/util/meson.build @@ -34,6 +34,7 @@ install_headers( 'macros.h', 'partition_value_util.h', 'property_util.h', + 'retry_util.h', 'string_util.h', 'temporal_util.h', 'timepoint.h', diff --git a/src/iceberg/util/retry_util.h b/src/iceberg/util/retry_util.h new file mode 100644 index 000000000..7041a40ef --- /dev/null +++ b/src/iceberg/util/retry_util.h @@ -0,0 +1,221 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief Configuration for retry behavior +struct ICEBERG_EXPORT RetryConfig { + /// Maximum number of retry attempts (not including the first attempt) + int32_t num_retries = 4; + /// Minimum wait time between retries in milliseconds + int32_t min_wait_ms = 100; + /// Maximum wait time between retries in milliseconds + int32_t max_wait_ms = 60 * 1000; // 1 minute + /// Total wall-clock time budget for retries, including backoff sleeps. + int32_t total_timeout_ms = 30 * 60 * 1000; // 30 minutes + /// Exponential backoff scale factor + double scale_factor = 2.0; +}; + +/// \brief Utility class for running tasks with retry logic +class ICEBERG_EXPORT RetryRunner { + public: + /// \brief Construct a RetryRunner with the given configuration + explicit RetryRunner(RetryConfig config = {}) : config_(std::move(config)) {} + + /// \brief Specify error types that should trigger a retry. + /// + /// When set, only errors matching one of these kinds will be retried. + /// All other errors will stop retries immediately. + /// + /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, + /// StopRetryOn is ignored. + RetryRunner& OnlyRetryOn(std::initializer_list error_kinds) { + only_retry_on_ = std::vector(error_kinds); + return *this; + } + + /// \brief Specify a single error type that should trigger a retry. + /// + /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, + /// StopRetryOn is ignored. + RetryRunner& OnlyRetryOn(ErrorKind error_kind) { + only_retry_on_ = std::vector{error_kind}; + return *this; + } + + /// \brief Specify error types that should stop retries immediately. + /// + /// When set, errors matching one of these kinds will not be retried. + /// All other errors will be retried. + /// + /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, + /// StopRetryOn is ignored. + RetryRunner& StopRetryOn(std::initializer_list error_kinds) { + stop_retry_on_ = std::vector(error_kinds); + return *this; + } + + /// \brief Run a task that returns a Result + /// + /// TODO: Replace attempt_counter with a metrics reporter once it is available. + template ::value_type> + Result Run(F&& task, int32_t* attempt_counter = nullptr) { + if (config_.num_retries < 0) { + return InvalidArgument("num_retries must be non-negative, got {}", + config_.num_retries); + } + + const auto deadline = ComputeDeadline(); + int32_t attempt = 0; + const int32_t max_attempts = config_.num_retries + 1; + + while (true) { + ++attempt; + if (attempt_counter != nullptr) { + *attempt_counter = attempt; + } + + auto result = task(); + if (result.has_value()) { + return result; + } + + if (!CanRetry(result.error().kind, attempt, max_attempts, deadline)) { + return result; + } + + if (!WaitForNextAttempt(attempt, deadline)) { + return result; + } + } + } + + private: + using Clock = std::chrono::steady_clock; + using Duration = std::chrono::milliseconds; + using TimePoint = Clock::time_point; + + std::optional ComputeDeadline() const { + if (config_.total_timeout_ms <= 0) { + return std::nullopt; + } + return Clock::now() + Duration(config_.total_timeout_ms); + } + + bool HasTimedOut(const std::optional& deadline) const { + return deadline.has_value() && Clock::now() >= *deadline; + } + + /// \brief Check if the given error kind should trigger a retry. + bool ShouldRetry(ErrorKind kind) const { + if (!only_retry_on_.empty()) { + return std::ranges::any_of(only_retry_on_, + [kind](ErrorKind k) { return kind == k; }); + } + + if (!stop_retry_on_.empty()) { + return !std::ranges::any_of(stop_retry_on_, + [kind](ErrorKind k) { return kind == k; }); + } + + return true; + } + + bool CanRetry(ErrorKind kind, int32_t attempt, int32_t max_attempts, + const std::optional& deadline) const { + return attempt < max_attempts && !HasTimedOut(deadline) && ShouldRetry(kind); + } + + std::optional RetryDelayWithinBudget( + int32_t attempt, const std::optional& deadline) const { + const auto delay = Duration(CalculateDelay(attempt)); + if (!deadline.has_value()) { + return delay; + } + + const auto now = Clock::now(); + if (now >= *deadline) { + return std::nullopt; + } + + const auto remaining = std::chrono::duration_cast(*deadline - now); + if (remaining <= Duration::zero() || delay >= remaining) { + return std::nullopt; + } + + return delay; + } + + bool WaitForNextAttempt(int32_t attempt, + const std::optional& deadline) const { + const auto delay = RetryDelayWithinBudget(attempt, deadline); + if (!delay.has_value()) { + return false; + } + + std::this_thread::sleep_for(*delay); + return !HasTimedOut(deadline); + } + + /// \brief Calculate delay with exponential backoff and jitter + int32_t CalculateDelay(int32_t attempt) const { + // Calculate base delay with exponential backoff + double base_delay = config_.min_wait_ms * std::pow(config_.scale_factor, attempt - 1); + int32_t delay_ms = static_cast( + std::min(base_delay, static_cast(config_.max_wait_ms))); + + static thread_local std::mt19937 gen(std::random_device{}()); + int32_t jitter_range = std::max(1, delay_ms / 10); + std::uniform_int_distribution<> dis(0, jitter_range - 1); + delay_ms += dis(gen); + return std::max(1, delay_ms); + } + + RetryConfig config_; + std::vector only_retry_on_; + std::vector stop_retry_on_; +}; + +/// \brief Helper function to create a RetryRunner with table commit configuration +ICEBERG_EXPORT inline RetryRunner MakeCommitRetryRunner(int32_t num_retries, + int32_t min_wait_ms, + int32_t max_wait_ms, + int32_t total_timeout_ms) { + return RetryRunner(RetryConfig{.num_retries = num_retries, + .min_wait_ms = min_wait_ms, + .max_wait_ms = max_wait_ms, + .total_timeout_ms = total_timeout_ms}) + .OnlyRetryOn(ErrorKind::kCommitFailed); +} + +} // namespace iceberg From ce794ef45339a765d07c6497cf6248c3679ef8ae Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Fri, 24 Apr 2026 23:47:11 +0800 Subject: [PATCH 011/151] fix(ci): restore auth for docs gh-pages deploy (#625) Co-authored-by: Kevin Liu --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 82d0e5ab6..f27c66061 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -63,9 +63,12 @@ jobs: - name: Deploy to gh-pages if: github.event_name == 'push' && github.ref == 'refs/heads/main' + env: + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.name 'GitHub Actions' git config --global user.email 'actions@github.com' + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" git checkout --orphan gh-pages-tmp git rm --quiet -rf . From 194db0469bd4dff4845638a202f9be24a2293aa5 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 28 Apr 2026 23:57:41 +0800 Subject: [PATCH 012/151] fix: typo in RoaringPositionBitmap deletion vector note (#632) --- src/iceberg/deletes/roaring_position_bitmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iceberg/deletes/roaring_position_bitmap.h b/src/iceberg/deletes/roaring_position_bitmap.h index a6d7742be..73877d397 100644 --- a/src/iceberg/deletes/roaring_position_bitmap.h +++ b/src/iceberg/deletes/roaring_position_bitmap.h @@ -42,9 +42,9 @@ namespace iceberg { /// maintained to store positions for that key. /// -/// \note This class is used to represent deletion vectors. The Puffin puffin -/// reader/write handle adding the additional required framing (length prefix, magic, -/// magic bytes, CRC-32) for `deletion-vector-v1` persistence. +/// \note This class is used to represent deletion vectors. The Puffin reader/writer +/// handle adding the additional required framing (length prefix, magic bytes, CRC-32) +/// for `deletion-vector-v1` persistence. class ICEBERG_EXPORT RoaringPositionBitmap { public: /// \brief Maximum supported position (aligned with the Java implementation). From 65931fe09936da8cb9ce3bfa20ce2352ec545d6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 21:27:37 +0800 Subject: [PATCH 013/151] chore(deps): bump github/codeql-action from 4.35.1 to 4.35.2 (#629) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.1 to 4.35.2.
Release notes

Sourced from github/codeql-action's releases.

v4.35.2

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

No user facing changes.

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

4.35.1 - 27 Mar 2026

4.35.0 - 27 Mar 2026

4.34.1 - 20 Mar 2026

  • Downgrade default CodeQL bundle version to 2.24.3 due to issues with a small percentage of Actions and JavaScript analyses. #3762

4.34.0 - 20 Mar 2026

  • Added an experimental change which disables TRAP caching when improved incremental analysis is enabled, since improved incremental analysis supersedes TRAP caching. This will improve performance and reduce Actions cache usage. We expect to roll this change out to everyone in March. #3569
  • We are rolling out improved incremental analysis to C/C++ analyses that use build mode none. We expect this rollout to be complete by the end of April 2026. #3584
  • Update default CodeQL bundle version to 2.25.0. #3585

4.33.0 - 16 Mar 2026

  • Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. #3562

    To opt out of this change:

    • Repositories owned by an organization: Create a custom repository property with the name github-codeql-file-coverage-on-prs and the type "True/false", then set this property to true in the repository's settings. For more information, see Managing custom properties for repositories in your organization. Alternatively, if you are using an advanced setup workflow, you can set the CODEQL_ACTION_FILE_COVERAGE_ON_PRS environment variable to true in your workflow.
    • User-owned repositories using default setup: Switch to an advanced setup workflow and set the CODEQL_ACTION_FILE_COVERAGE_ON_PRS environment variable to true in your workflow.
    • User-owned repositories using advanced setup: Set the CODEQL_ACTION_FILE_COVERAGE_ON_PRS environment variable to true in your workflow.
  • Fixed a bug which caused the CodeQL Action to fail loading repository properties if a "Multi select" repository property was configured for the repository. #3557

  • The CodeQL Action now loads custom repository properties on GitHub Enterprise Server, enabling the customization of features such as github-codeql-disable-overlay that was previously only available on GitHub.com. #3559

  • Once private package registries can be configured with OIDC-based authentication for organizations, the CodeQL Action will now be able to accept such configurations. #3563

  • Fixed the retry mechanism for database uploads. Previously this would fail with the error "Response body object should not be disturbed or locked". #3564

  • A warning is now emitted if the CodeQL Action detects a repository property whose name suggests that it relates to the CodeQL Action, but which is not one of the properties recognised by the current version of the CodeQL Action. #3570

4.32.6 - 05 Mar 2026

... (truncated)

Commits
  • 95e58e9 Merge pull request #3824 from github/update-v4.35.2-d2e135a73
  • 6f31bfe Update changelog for v4.35.2
  • d2e135a Merge pull request #3823 from github/update-bundle/codeql-bundle-v2.25.2
  • 60abb65 Add changelog note
  • 5a0a562 Update default bundle to codeql-bundle-v2.25.2
  • 6521697 Merge pull request #3820 from github/dependabot/github_actions/dot-github/wor...
  • 3c45af2 Merge pull request #3821 from github/dependabot/npm_and_yarn/npm-minor-345b93...
  • f1c3393 Rebuild
  • 1024fc4 Rebuild
  • 9dd4cfe Bump the npm-minor group across 1 directory with 6 updates
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.35.1&new-version=4.35.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fe0459aeb..7e9c8208c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,11 +46,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 + uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 + uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: category: "/language:actions" From 4c6f46de74c1ff8535c4843e2da5675807e948b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 21:27:57 +0800 Subject: [PATCH 014/151] chore(deps): bump zizmorcore/zizmor-action from 0.5.2 to 0.5.3 (#630) Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.2 to 0.5.3.
Release notes

Sourced from zizmorcore/zizmor-action's releases.

v0.5.3

What's Changed

  • 1.24.0 and 1.24.1 are now available via the action
  • 1.24.1 is now the default version of zizmor used by the action

Full Changelog: https://github.com/zizmorcore/zizmor-action/compare/v0.5.2...v0.5.3

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zizmorcore/zizmor-action&package-manager=github_actions&previous-version=0.5.2&new-version=0.5.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/zizmor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index eb40be7ed..a265483fa 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -39,7 +39,7 @@ jobs: persist-credentials: false - name: Run zizmor 🌈 - uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 + uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 with: advanced-security: false min-severity: medium From f40fe2fb11caa28ba22e4fc939f1e9b28f5b52f1 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Sat, 2 May 2026 22:27:49 +0800 Subject: [PATCH 015/151] fix: concurrent Lazy::Get should get correct result (#634) --- ci/scripts/build_example.sh | 2 +- ci/scripts/build_iceberg.sh | 2 +- src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/lazy_test.cc | 68 +++++++++++++++++++++++++++++++++ src/iceberg/test/meson.build | 1 + src/iceberg/util/lazy.h | 16 +++----- 6 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 src/iceberg/test/lazy_test.cc diff --git a/ci/scripts/build_example.sh b/ci/scripts/build_example.sh index 041e84837..ff98ae6a7 100755 --- a/ci/scripts/build_example.sh +++ b/ci/scripts/build_example.sh @@ -26,7 +26,7 @@ mkdir ${build_dir} pushd ${build_dir} is_windows() { - [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]] + [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" || "${OSTYPE}" == "cygwin" ]] } CMAKE_ARGS=( diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index cf332c21c..5d69dd074 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -28,7 +28,7 @@ mkdir ${build_dir} pushd ${build_dir} is_windows() { - [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" ]] + [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" || "${OSTYPE}" == "cygwin" ]] } CMAKE_ARGS=( diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index b0f03b527..f39b4e4fd 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -116,6 +116,7 @@ add_iceberg_test(util_test decimal_test.cc endian_test.cc formatter_test.cc + lazy_test.cc location_util_test.cc roaring_position_bitmap_test.cc position_delete_index_test.cc diff --git a/src/iceberg/test/lazy_test.cc b/src/iceberg/test/lazy_test.cc new file mode 100644 index 000000000..04eac6807 --- /dev/null +++ b/src/iceberg/test/lazy_test.cc @@ -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. + */ + +#include "iceberg/util/lazy.h" + +#include +#include + +#include "iceberg/result.h" +#include "iceberg/test/matchers.h" + +namespace { + +struct NonDefaultConstructible { + explicit NonDefaultConstructible(int value) : value(value) {} + NonDefaultConstructible() = delete; + + int value; +}; + +iceberg::Result InitNonDefaultConstructible(int value) { + return NonDefaultConstructible(value); +} + +iceberg::Result InitAlwaysFails() { return iceberg::Invalid("init failed"); } + +} // namespace + +TEST(LazyTest, SupportsNonDefaultConstructibleValues) { + const iceberg::Lazy lazy; + + auto first = lazy.Get(42); + ASSERT_THAT(first, iceberg::IsOk()); + EXPECT_EQ(first->get().value, 42); + + auto second = lazy.Get(13); + ASSERT_THAT(second, iceberg::IsOk()); + EXPECT_EQ(second->get().value, 42); + EXPECT_EQ(&first->get(), &second->get()); +} + +TEST(LazyTest, ReusesInitializationError) { + const iceberg::Lazy lazy; + + auto first = lazy.Get(); + EXPECT_THAT(first, iceberg::IsError(iceberg::ErrorKind::kInvalid)); + EXPECT_THAT(first, iceberg::HasErrorMessage("init failed")); + + auto second = lazy.Get(); + EXPECT_THAT(second, iceberg::IsError(iceberg::ErrorKind::kInvalid)); + EXPECT_THAT(second, iceberg::HasErrorMessage("init failed")); +} diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index ed9a5866a..3e88fc7ea 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -89,6 +89,7 @@ iceberg_tests = { 'decimal_test.cc', 'endian_test.cc', 'formatter_test.cc', + 'lazy_test.cc', 'location_util_test.cc', 'position_delete_index_test.cc', 'retry_util_test.cc', diff --git a/src/iceberg/util/lazy.h b/src/iceberg/util/lazy.h index 530fb6cfd..be7bcd41d 100644 --- a/src/iceberg/util/lazy.h +++ b/src/iceberg/util/lazy.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "iceberg/result.h" #include "iceberg/util/macros.h" @@ -48,19 +49,14 @@ class Lazy { requires std::invocable && std::same_as, Result> Result> Get(Args&&... args) const { - Result result; - std::call_once(flag_, [&result, this, &args...]() { - result = InitFunc(std::forward(args)...); - if (result) { - this->value_ = std::move(result.value()); - } - }); - ICEBERG_RETURN_UNEXPECTED(result); - return std::ref(value_); + std::call_once( + flag_, [this, &args...]() { value_ = InitFunc(std::forward(args)...); }); + ICEBERG_RETURN_UNEXPECTED(value_); + return std::ref(*value_); } private: - mutable T value_; + mutable Result value_ = Invalid("Lazy value has not been initialized"); mutable std::once_flag flag_; }; From 0bf52f68e7ec340ad88c2fea60cc4389c5307e27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 May 2026 22:06:41 +0800 Subject: [PATCH 016/151] chore(deps): bump mozilla-actions/sccache-action from 0.0.9 to 0.0.10 (#636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [mozilla-actions/sccache-action](https://github.com/mozilla-actions/sccache-action) from 0.0.9 to 0.0.10.
Release notes

Sourced from mozilla-actions/sccache-action's releases.

v0.0.10

What's Changed

New Contributors

Full Changelog: https://github.com/Mozilla-Actions/sccache-action/compare/v0.0.9...v0.0.10

Commits
  • 9e7fa8a Merge pull request #251 from sylvestre/ver
  • 3ca012d prepare version 0.0.10
  • 7cf1643 Merge pull request #231 from Mozilla-Actions/dependabot/npm_and_yarn/js-yaml-...
  • b2be802 Merge pull request #246 from baseplate-admin/patch-1
  • 84812a5 Merge pull request #250 from Mozilla-Actions/dependabot/npm_and_yarn/handleba...
  • 4e28318 Merge pull request #249 from Mozilla-Actions/dependabot/npm_and_yarn/picomatc...
  • cfa813e Merge pull request #248 from Mozilla-Actions/dependabot/npm_and_yarn/flatted-...
  • ef3762b Merge pull request #245 from cakebaker/bump_to_node24
  • 919bfb6 Bump handlebars from 4.7.8 to 4.7.9
  • 167904b Bump picomatch from 2.3.1 to 2.3.2
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mozilla-actions/sccache-action&package-manager=github_actions&previous-version=0.0.9&new-version=0.0.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37f98bd05..b3a125ccf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -123,7 +123,7 @@ jobs: run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows - name: Setup sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh From d6130f74bc0db00c29b2b4455acf4b2edb3e5631 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sun, 3 May 2026 22:54:45 +0800 Subject: [PATCH 017/151] fix: repair shared package linkage and export scan builder symbols (#635) 1. Update the shared installation interface to depend on the static nanoarrow target, since vendored libraries are built only as static artifacts(see prepare_fetchcontent). 2. Switch the example build to use shared libraries to surface linkage issues. This revealed that `TableScanBuilder` symbols are not exported. Explicitly export the `TableScanBuilder` template instantiations so that shared-library consumers can successfully link against `Build()`. --- example/CMakeLists.txt | 4 ++-- src/iceberg/CMakeLists.txt | 6 +++--- src/iceberg/iceberg_export.h | 2 +- src/iceberg/table_scan.cc | 6 +++--- src/iceberg/table_scan.h | 10 +++++++++- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 837ed7d7c..0e04accec 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -26,5 +26,5 @@ find_package(iceberg CONFIG REQUIRED) add_executable(demo_example demo_example.cc) -target_link_libraries(demo_example PRIVATE iceberg::iceberg_bundle_static - iceberg::iceberg_rest_static) +target_link_libraries(demo_example PRIVATE iceberg::iceberg_bundle_shared + iceberg::iceberg_rest_shared) diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 603c35343..62882d587 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -132,13 +132,13 @@ set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS) list(APPEND ICEBERG_STATIC_BUILD_INTERFACE_LIBS - nanoarrow::nanoarrow_static + "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>" nlohmann_json::nlohmann_json roaring::roaring ZLIB::ZLIB) list(APPEND ICEBERG_SHARED_BUILD_INTERFACE_LIBS - nanoarrow::nanoarrow_shared + "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" nlohmann_json::nlohmann_json roaring::roaring ZLIB::ZLIB) @@ -149,7 +149,7 @@ list(APPEND "$,iceberg::roaring,roaring::roaring>") list(APPEND ICEBERG_SHARED_INSTALL_INTERFACE_LIBS - "$,iceberg::nanoarrow_shared,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" + "$,iceberg::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" "$,iceberg::nlohmann_json,$,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>" "$,iceberg::roaring,roaring::roaring>") diff --git a/src/iceberg/iceberg_export.h b/src/iceberg/iceberg_export.h index 8d7a35f27..2463fbeaf 100644 --- a/src/iceberg/iceberg_export.h +++ b/src/iceberg/iceberg_export.h @@ -53,5 +53,5 @@ # define ICEBERG_TEMPLATE_EXPORT # define ICEBERG_TEMPLATE_CLASS_EXPORT ICEBERG_EXPORT -# define ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT ICEBERG_TEMPLATE_EXPORT +# define ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT ICEBERG_TEMPLATE_CLASS_EXPORT #endif diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index 2195482bb..f61bd3a0c 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -535,9 +535,9 @@ Result> TableScanBuilder::Build() { } // Explicit template instantiations -template class TableScanBuilder; -template class TableScanBuilder; -template class TableScanBuilder; +template class ICEBERG_TEMPLATE_EXPORT TableScanBuilder; +template class ICEBERG_TEMPLATE_EXPORT TableScanBuilder; +template class ICEBERG_TEMPLATE_EXPORT TableScanBuilder; TableScan::TableScan(std::shared_ptr metadata, std::shared_ptr schema, std::shared_ptr file_io, diff --git a/src/iceberg/table_scan.h b/src/iceberg/table_scan.h index 064825d82..307946e6c 100644 --- a/src/iceberg/table_scan.h +++ b/src/iceberg/table_scan.h @@ -28,6 +28,7 @@ #include #include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_export.h" #include "iceberg/result.h" #include "iceberg/table_metadata.h" #include "iceberg/type_fwd.h" @@ -252,7 +253,7 @@ concept IsIncrementalScan = std::is_base_of_v, T> /// \brief Builder class for creating TableScan instances. template -class ICEBERG_EXPORT TableScanBuilder : public ErrorCollector { +class ICEBERG_TEMPLATE_CLASS_EXPORT TableScanBuilder : public ErrorCollector { public: /// \brief Constructs a TableScanBuilder for the given table. /// \param metadata Current table metadata. @@ -524,4 +525,11 @@ class ICEBERG_EXPORT IncrementalChangelogScan using IncrementalScan::IncrementalScan; }; +extern template class ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT + TableScanBuilder; +extern template class ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT + TableScanBuilder; +extern template class ICEBERG_EXTERN_TEMPLATE_CLASS_EXPORT + TableScanBuilder; + } // namespace iceberg From 0db527aef727bf98c699fd8bf930060a6fecf899 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 6 May 2026 00:16:17 +0800 Subject: [PATCH 018/151] feat: add iceberg_data library alongside iceberg (#631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move data writers, deletes/, and puffin/ into a separate `iceberg_data` library that links the existing `iceberg` target. `delete_file_index` stays in `iceberg` because manifest_group embeds DeleteFileIndex::Builder with only core dependencies. * `iceberg` — unchanged target name for metadata/planning, expressions, manifests, catalog (incl. in-memory), utilities, file I/O abstractions, and delete_file_index. * `iceberg_data` — data/, deletes/, puffin/; links `iceberg`. `iceberg_bundle` links `iceberg_data` when the bundle is built. `iceberg_rest` links `iceberg` and cpr only. --- example/CMakeLists.txt | 2 +- src/iceberg/CMakeLists.txt | 70 ++++++++++++++----- src/iceberg/arrow_c_data_guard_internal.h | 9 +-- src/iceberg/data/data_writer.h | 6 +- src/iceberg/data/delete_loader.h | 4 +- src/iceberg/data/equality_delete_writer.h | 6 +- src/iceberg/data/meson.build | 27 +++++++ src/iceberg/data/position_delete_writer.h | 6 +- src/iceberg/data/writer.h | 6 +- src/iceberg/deletes/position_delete_index.h | 4 +- src/iceberg/deletes/roaring_position_bitmap.h | 4 +- src/iceberg/file_writer.h | 2 +- src/iceberg/iceberg-config.cmake.in | 2 + src/iceberg/iceberg_data_export.h | 34 +++++++++ src/iceberg/meson.build | 54 +++++++++++--- src/iceberg/puffin/file_metadata.h | 20 +++--- src/iceberg/puffin/json_serde_internal.h | 16 ++--- src/iceberg/puffin/puffin_format.h | 8 +-- src/iceberg/test/CMakeLists.txt | 15 ++-- src/iceberg/test/meson.build | 15 ++-- src/iceberg/test/roaring_test.cc | 60 ---------------- 21 files changed, 226 insertions(+), 144 deletions(-) create mode 100644 src/iceberg/data/meson.build create mode 100644 src/iceberg/iceberg_data_export.h delete mode 100644 src/iceberg/test/roaring_test.cc diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 0e04accec..f89058ed5 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -22,7 +22,7 @@ project(example) set(CMAKE_CXX_STANDARD 23) -find_package(iceberg CONFIG REQUIRED) +find_package(iceberg CONFIG REQUIRED COMPONENTS bundle rest) add_executable(demo_example demo_example.cc) diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 62882d587..6d190cb60 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -20,14 +20,7 @@ set(ICEBERG_INCLUDES "$" set(ICEBERG_SOURCES arrow_c_data_guard_internal.cc catalog/memory/in_memory_catalog.cc - data/data_writer.cc - data/delete_loader.cc - data/equality_delete_writer.cc - data/position_delete_writer.cc - data/writer.cc delete_file_index.cc - deletes/roaring_position_bitmap.cc - deletes/position_delete_index.cc expression/aggregate.cc expression/binder.cc expression/evaluator.cc @@ -66,9 +59,6 @@ set(ICEBERG_SOURCES partition_field.cc partition_spec.cc partition_summary.cc - puffin/file_metadata.cc - puffin/puffin_format.cc - puffin/json_serde.cc row/arrow_array_wrapper.cc row/manifest_wrapper.cc row/partition_values.cc @@ -134,24 +124,22 @@ list(APPEND ICEBERG_STATIC_BUILD_INTERFACE_LIBS "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>" nlohmann_json::nlohmann_json - roaring::roaring ZLIB::ZLIB) list(APPEND ICEBERG_SHARED_BUILD_INTERFACE_LIBS "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" nlohmann_json::nlohmann_json - roaring::roaring ZLIB::ZLIB) list(APPEND ICEBERG_STATIC_INSTALL_INTERFACE_LIBS "$,iceberg::nanoarrow_static,$,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>" "$,iceberg::nlohmann_json,$,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>" - "$,iceberg::roaring,roaring::roaring>") +) list(APPEND ICEBERG_SHARED_INSTALL_INTERFACE_LIBS "$,iceberg::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" "$,iceberg::nlohmann_json,$,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>" - "$,iceberg::roaring,roaring::roaring>") +) add_iceberg_lib(iceberg SOURCES @@ -169,6 +157,52 @@ add_iceberg_lib(iceberg OUTPUTS ICEBERG_LIBRARIES) +set(ICEBERG_DATA_SOURCES + data/data_writer.cc + data/delete_loader.cc + data/equality_delete_writer.cc + data/position_delete_writer.cc + data/writer.cc + deletes/position_delete_index.cc + deletes/roaring_position_bitmap.cc + puffin/file_metadata.cc + puffin/json_serde.cc + puffin/puffin_format.cc) + +set(ICEBERG_DATA_STATIC_BUILD_INTERFACE_LIBS) +set(ICEBERG_DATA_SHARED_BUILD_INTERFACE_LIBS) +set(ICEBERG_DATA_STATIC_INSTALL_INTERFACE_LIBS) +set(ICEBERG_DATA_SHARED_INSTALL_INTERFACE_LIBS) + +list(APPEND ICEBERG_DATA_STATIC_BUILD_INTERFACE_LIBS + "$,iceberg_static,iceberg_shared>" + roaring::roaring) +list(APPEND ICEBERG_DATA_SHARED_BUILD_INTERFACE_LIBS + "$,iceberg_shared,iceberg_static>" + roaring::roaring) +list(APPEND + ICEBERG_DATA_STATIC_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_static,iceberg::iceberg_shared>" + "$,iceberg::roaring,roaring::roaring>") +list(APPEND + ICEBERG_DATA_SHARED_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_shared,iceberg::iceberg_static>" + "$,iceberg::roaring,roaring::roaring>") + +add_iceberg_lib(iceberg_data + SOURCES + ${ICEBERG_DATA_SOURCES} + EXTRA_INCLUDES + ${ICEBERG_INCLUDES} + SHARED_LINK_LIBS + ${ICEBERG_DATA_SHARED_BUILD_INTERFACE_LIBS} + STATIC_LINK_LIBS + ${ICEBERG_DATA_STATIC_BUILD_INTERFACE_LIBS} + STATIC_INSTALL_INTERFACE_LIBS + ${ICEBERG_DATA_STATIC_INSTALL_INTERFACE_LIBS} + SHARED_INSTALL_INTERFACE_LIBS + ${ICEBERG_DATA_SHARED_INSTALL_INTERFACE_LIBS}) + iceberg_install_all_headers(iceberg) add_subdirectory(catalog) @@ -210,14 +244,14 @@ if(ICEBERG_BUILD_BUNDLE) list(APPEND ICEBERG_BUNDLE_STATIC_BUILD_INTERFACE_LIBS - "$,iceberg_static,iceberg_shared>" + "$,iceberg_data_static,iceberg_data_shared>" "$,Arrow::arrow_static,Arrow::arrow_shared>" "$,Parquet::parquet_static,Parquet::parquet_shared>" "$,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>" ) list(APPEND ICEBERG_BUNDLE_SHARED_BUILD_INTERFACE_LIBS - "$,iceberg_shared,iceberg_static>" + "$,iceberg_data_shared,iceberg_data_static>" "$,Arrow::arrow_shared,Arrow::arrow_static>" "$,Parquet::parquet_shared,Parquet::parquet_static>" "$,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>" @@ -225,14 +259,14 @@ if(ICEBERG_BUILD_BUNDLE) list(APPEND ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS - "$,iceberg::iceberg_static,iceberg::iceberg_shared>" + "$,iceberg::iceberg_data_static,iceberg::iceberg_data_shared>" "$,iceberg::arrow_static,$,Arrow::arrow_static,Arrow::arrow_shared>>" "$,iceberg::parquet_static,$,Parquet::parquet_static,Parquet::parquet_shared>>" "$,iceberg::avrocpp_s,$,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>" ) list(APPEND ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS - "$,iceberg::iceberg_shared,iceberg::iceberg_static>" + "$,iceberg::iceberg_data_shared,iceberg::iceberg_data_static>" "$,iceberg::arrow_static,$,Arrow::arrow_shared,Arrow::arrow_static>>" "$,iceberg::parquet_static,$,Parquet::parquet_shared,Parquet::parquet_static>>" "$,iceberg::avrocpp_s,$,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>" diff --git a/src/iceberg/arrow_c_data_guard_internal.h b/src/iceberg/arrow_c_data_guard_internal.h index 8bce14e57..04603b0fe 100644 --- a/src/iceberg/arrow_c_data_guard_internal.h +++ b/src/iceberg/arrow_c_data_guard_internal.h @@ -22,10 +22,11 @@ #include #include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_export.h" namespace iceberg::internal { -class ArrowArrayGuard { +class ICEBERG_EXPORT ArrowArrayGuard { public: explicit ArrowArrayGuard(ArrowArray* array) : array_(array) {} ~ArrowArrayGuard(); @@ -34,7 +35,7 @@ class ArrowArrayGuard { ArrowArray* array_; }; -class ArrowSchemaGuard { +class ICEBERG_EXPORT ArrowSchemaGuard { public: explicit ArrowSchemaGuard(ArrowSchema* schema) : schema_(schema) {} ~ArrowSchemaGuard(); @@ -43,7 +44,7 @@ class ArrowSchemaGuard { ArrowSchema* schema_; }; -class ArrowArrayViewGuard { +class ICEBERG_EXPORT ArrowArrayViewGuard { public: explicit ArrowArrayViewGuard(ArrowArrayView* view) : view_(view) {} ~ArrowArrayViewGuard(); @@ -52,7 +53,7 @@ class ArrowArrayViewGuard { ArrowArrayView* view_; }; -class ArrowArrayBufferGuard { +class ICEBERG_EXPORT ArrowArrayBufferGuard { public: explicit ArrowArrayBufferGuard(ArrowBuffer* buffer) : buffer_(buffer) {} ~ArrowArrayBufferGuard(); diff --git a/src/iceberg/data/data_writer.h b/src/iceberg/data/data_writer.h index 380c97e2e..9a2002f0d 100644 --- a/src/iceberg/data/data_writer.h +++ b/src/iceberg/data/data_writer.h @@ -31,7 +31,7 @@ #include "iceberg/arrow_c_data.h" #include "iceberg/data/writer.h" #include "iceberg/file_format.h" -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" #include "iceberg/row/partition_values.h" #include "iceberg/type_fwd.h" @@ -39,7 +39,7 @@ namespace iceberg { /// \brief Options for creating a DataWriter. -struct ICEBERG_EXPORT DataWriterOptions { +struct ICEBERG_DATA_EXPORT DataWriterOptions { std::string path; std::shared_ptr schema; std::shared_ptr spec; @@ -51,7 +51,7 @@ struct ICEBERG_EXPORT DataWriterOptions { }; /// \brief Writer for Iceberg data files. -class ICEBERG_EXPORT DataWriter : public FileWriter { +class ICEBERG_DATA_EXPORT DataWriter : public FileWriter { public: ~DataWriter() override; diff --git a/src/iceberg/data/delete_loader.h b/src/iceberg/data/delete_loader.h index 0a1122f95..a422f0683 100644 --- a/src/iceberg/data/delete_loader.h +++ b/src/iceberg/data/delete_loader.h @@ -26,14 +26,14 @@ #include #include -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" namespace iceberg { /// \brief Loads delete files and constructs in-memory delete indexes. -class ICEBERG_EXPORT DeleteLoader { +class ICEBERG_DATA_EXPORT DeleteLoader { public: /// \brief Create a DeleteLoader. /// \param io FileIO instance for reading delete files diff --git a/src/iceberg/data/equality_delete_writer.h b/src/iceberg/data/equality_delete_writer.h index d1728a481..fc0083a81 100644 --- a/src/iceberg/data/equality_delete_writer.h +++ b/src/iceberg/data/equality_delete_writer.h @@ -32,7 +32,7 @@ #include "iceberg/arrow_c_data.h" #include "iceberg/data/writer.h" #include "iceberg/file_format.h" -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" #include "iceberg/row/partition_values.h" #include "iceberg/type_fwd.h" @@ -40,7 +40,7 @@ namespace iceberg { /// \brief Options for creating an EqualityDeleteWriter. -struct ICEBERG_EXPORT EqualityDeleteWriterOptions { +struct ICEBERG_DATA_EXPORT EqualityDeleteWriterOptions { std::string path; std::shared_ptr schema; std::shared_ptr spec; @@ -54,7 +54,7 @@ struct ICEBERG_EXPORT EqualityDeleteWriterOptions { }; /// \brief Writer for Iceberg equality delete files. -class ICEBERG_EXPORT EqualityDeleteWriter : public FileWriter { +class ICEBERG_DATA_EXPORT EqualityDeleteWriter : public FileWriter { public: ~EqualityDeleteWriter() override; diff --git a/src/iceberg/data/meson.build b/src/iceberg/data/meson.build new file mode 100644 index 000000000..0f68deccf --- /dev/null +++ b/src/iceberg/data/meson.build @@ -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. + +install_headers( + [ + 'data_writer.h', + 'delete_loader.h', + 'equality_delete_writer.h', + 'position_delete_writer.h', + 'writer.h', + ], + subdir: 'iceberg/data', +) diff --git a/src/iceberg/data/position_delete_writer.h b/src/iceberg/data/position_delete_writer.h index de7a2c3f3..c76e61720 100644 --- a/src/iceberg/data/position_delete_writer.h +++ b/src/iceberg/data/position_delete_writer.h @@ -31,7 +31,7 @@ #include "iceberg/arrow_c_data.h" #include "iceberg/data/writer.h" #include "iceberg/file_format.h" -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" #include "iceberg/row/partition_values.h" #include "iceberg/type_fwd.h" @@ -39,7 +39,7 @@ namespace iceberg { /// \brief Options for creating a PositionDeleteWriter. -struct ICEBERG_EXPORT PositionDeleteWriterOptions { +struct ICEBERG_DATA_EXPORT PositionDeleteWriterOptions { std::string path; std::shared_ptr schema; std::shared_ptr spec; @@ -51,7 +51,7 @@ struct ICEBERG_EXPORT PositionDeleteWriterOptions { }; /// \brief Writer for Iceberg position delete files. -class ICEBERG_EXPORT PositionDeleteWriter : public FileWriter { +class ICEBERG_DATA_EXPORT PositionDeleteWriter : public FileWriter { public: ~PositionDeleteWriter() override; diff --git a/src/iceberg/data/writer.h b/src/iceberg/data/writer.h index 82c1d0cdc..a6f5f063d 100644 --- a/src/iceberg/data/writer.h +++ b/src/iceberg/data/writer.h @@ -27,14 +27,14 @@ #include #include "iceberg/arrow_c_data.h" -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" namespace iceberg { /// \brief Base interface for data file writers. -class ICEBERG_EXPORT FileWriter { +class ICEBERG_DATA_EXPORT FileWriter { public: virtual ~FileWriter(); @@ -49,7 +49,7 @@ class ICEBERG_EXPORT FileWriter { virtual Status Close() = 0; /// \brief File metadata for all files produced by this writer. - struct ICEBERG_EXPORT WriteResult { + struct ICEBERG_DATA_EXPORT WriteResult { /// Usually a writer produces a single data or delete file. /// Position delete writer may produce multiple file-scoped delete files. /// In the future, multiple files can be produced if file rolling is supported. diff --git a/src/iceberg/deletes/position_delete_index.h b/src/iceberg/deletes/position_delete_index.h index 968d3ebed..5de82a591 100644 --- a/src/iceberg/deletes/position_delete_index.h +++ b/src/iceberg/deletes/position_delete_index.h @@ -26,7 +26,7 @@ #include #include "iceberg/deletes/roaring_position_bitmap.h" -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" namespace iceberg { @@ -35,7 +35,7 @@ namespace iceberg { /// This class provides a domain-specific API for position deletes /// in Iceberg MOR (merge-on-read) tables. Positions are 0-based /// row indices within a data file. -class ICEBERG_EXPORT PositionDeleteIndex { +class ICEBERG_DATA_EXPORT PositionDeleteIndex { public: PositionDeleteIndex() = default; ~PositionDeleteIndex() = default; diff --git a/src/iceberg/deletes/roaring_position_bitmap.h b/src/iceberg/deletes/roaring_position_bitmap.h index 73877d397..8d4b3586d 100644 --- a/src/iceberg/deletes/roaring_position_bitmap.h +++ b/src/iceberg/deletes/roaring_position_bitmap.h @@ -28,7 +28,7 @@ #include #include -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" namespace iceberg { @@ -45,7 +45,7 @@ namespace iceberg { /// \note This class is used to represent deletion vectors. The Puffin reader/writer /// handle adding the additional required framing (length prefix, magic bytes, CRC-32) /// for `deletion-vector-v1` persistence. -class ICEBERG_EXPORT RoaringPositionBitmap { +class ICEBERG_DATA_EXPORT RoaringPositionBitmap { public: /// \brief Maximum supported position (aligned with the Java implementation). static constexpr int64_t kMaxPosition = 0x7FFFFFFE80000000LL; diff --git a/src/iceberg/file_writer.h b/src/iceberg/file_writer.h index 0b1af7f93..f3352d8fd 100644 --- a/src/iceberg/file_writer.h +++ b/src/iceberg/file_writer.h @@ -36,7 +36,7 @@ namespace iceberg { -class WriterProperties : public ConfigBase { +class ICEBERG_EXPORT WriterProperties : public ConfigBase { public: template using Entry = const ConfigBase::Entry; diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 787fadcc6..7a46cdd1d 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -24,6 +24,8 @@ # # iceberg::iceberg_shared # iceberg::iceberg_static +# iceberg::iceberg_data_shared +# iceberg::iceberg_data_static # iceberg::iceberg_bundle_shared # iceberg::iceberg_bundle_static # iceberg::iceberg_rest_shared diff --git a/src/iceberg/iceberg_data_export.h b/src/iceberg/iceberg_data_export.h new file mode 100644 index 000000000..652de97b6 --- /dev/null +++ b/src/iceberg/iceberg_data_export.h @@ -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. + */ + +#pragma once + +#if defined(_WIN32) || defined(__CYGWIN__) +# ifdef ICEBERG_DATA_STATIC +# define ICEBERG_DATA_EXPORT +# elif defined(ICEBERG_DATA_EXPORTING) +# define ICEBERG_DATA_EXPORT __declspec(dllexport) +# else +# define ICEBERG_DATA_EXPORT __declspec(dllimport) +# endif +#else // Not Windows +# ifndef ICEBERG_DATA_EXPORT +# define ICEBERG_DATA_EXPORT __attribute__((visibility("default"))) +# endif +#endif diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 5e68def98..17ed723fc 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -42,14 +42,7 @@ iceberg_include_dir = include_directories('..') iceberg_sources = files( 'arrow_c_data_guard_internal.cc', 'catalog/memory/in_memory_catalog.cc', - 'data/data_writer.cc', - 'data/delete_loader.cc', - 'data/equality_delete_writer.cc', - 'data/position_delete_writer.cc', - 'data/writer.cc', 'delete_file_index.cc', - 'deletes/position_delete_index.cc', - 'deletes/roaring_position_bitmap.cc', 'expression/aggregate.cc', 'expression/binder.cc', 'expression/evaluator.cc', @@ -88,9 +81,6 @@ iceberg_sources = files( 'partition_field.cc', 'partition_spec.cc', 'partition_summary.cc', - 'puffin/file_metadata.cc', - 'puffin/json_serde.cc', - 'puffin/puffin_format.cc', 'row/arrow_array_wrapper.cc', 'row/manifest_wrapper.cc', 'row/partition_values.cc', @@ -148,6 +138,19 @@ iceberg_sources = files( 'util/uuid.cc', ) +iceberg_data_sources = files( + 'data/data_writer.cc', + 'data/delete_loader.cc', + 'data/equality_delete_writer.cc', + 'data/position_delete_writer.cc', + 'data/writer.cc', + 'deletes/position_delete_index.cc', + 'deletes/roaring_position_bitmap.cc', + 'puffin/file_metadata.cc', + 'puffin/json_serde.cc', + 'puffin/puffin_format.cc', +) + # CRoaring does not export symbols, so on Windows it must # be used as a static lib croaring_needs_static = ( @@ -159,7 +162,7 @@ nanoarrow_dep = dependency('nanoarrow') nlohmann_json_dep = dependency('nlohmann_json') zlib_dep = dependency('zlib') -iceberg_deps = [croaring_dep, nanoarrow_dep, nlohmann_json_dep, zlib_dep] +iceberg_deps = [nanoarrow_dep, nlohmann_json_dep, zlib_dep] iceberg_lib = library( 'iceberg', @@ -184,8 +187,35 @@ iceberg_dep = declare_dependency( compile_args: iceberg_interface_args, ) meson.override_dependency('iceberg', iceberg_dep) + +iceberg_data_deps = [iceberg_dep, croaring_dep] +iceberg_data_lib = library( + 'iceberg_data', + sources: iceberg_data_sources, + dependencies: iceberg_data_deps, + include_directories: iceberg_include_dir, + install: true, + gnu_symbol_visibility: 'inlineshidden', + cpp_shared_args: ['-DICEBERG_DATA_EXPORTING'], + cpp_static_args: ['-DICEBERG_DATA_STATIC'], +) + +iceberg_data_interface_args = [] +if get_option('default_library') == 'static' + iceberg_data_interface_args += ['-DICEBERG_DATA_STATIC'] +endif + +iceberg_data_dep = declare_dependency( + link_with: iceberg_data_lib, + dependencies: iceberg_data_deps, + include_directories: iceberg_include_dir, + compile_args: iceberg_data_interface_args, +) +meson.override_dependency('iceberg-data', iceberg_data_dep) + pkg = import('pkgconfig') pkg.generate(iceberg_lib) +pkg.generate(iceberg_data_lib) install_headers( [ @@ -199,6 +229,7 @@ install_headers( 'file_io_registry.h', 'file_reader.h', 'file_writer.h', + 'iceberg_data_export.h', 'iceberg_export.h', 'inheritable_metadata.h', 'location_provider.h', @@ -233,6 +264,7 @@ install_headers( ) subdir('catalog') +subdir('data') subdir('deletes') subdir('expression') subdir('manifest') diff --git a/src/iceberg/puffin/file_metadata.h b/src/iceberg/puffin/file_metadata.h index 17ddad77d..14eaae6c6 100644 --- a/src/iceberg/puffin/file_metadata.h +++ b/src/iceberg/puffin/file_metadata.h @@ -29,7 +29,7 @@ #include #include -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/result.h" namespace iceberg::puffin { @@ -41,12 +41,12 @@ enum class PuffinCompressionCodec { kZstd, }; -ICEBERG_EXPORT std::string_view CodecName(PuffinCompressionCodec codec); +ICEBERG_DATA_EXPORT std::string_view CodecName(PuffinCompressionCodec codec); -ICEBERG_EXPORT Result PuffinCompressionCodecFromName( +ICEBERG_DATA_EXPORT Result PuffinCompressionCodecFromName( std::string_view codec_name); -ICEBERG_EXPORT std::string ToString(PuffinCompressionCodec codec); +ICEBERG_DATA_EXPORT std::string ToString(PuffinCompressionCodec codec); /// \brief Standard blob types defined by the Iceberg specification. struct StandardBlobTypes { @@ -67,7 +67,7 @@ struct StandardPuffinProperties { }; /// \brief A blob in a Puffin file. -struct ICEBERG_EXPORT Blob { +struct ICEBERG_DATA_EXPORT Blob { /// See StandardBlobTypes for known types. std::string type; /// Ordered list of field IDs the blob was computed from. @@ -84,10 +84,10 @@ struct ICEBERG_EXPORT Blob { friend bool operator==(const Blob& lhs, const Blob& rhs) = default; }; -ICEBERG_EXPORT std::string ToString(const Blob& blob); +ICEBERG_DATA_EXPORT std::string ToString(const Blob& blob); /// \brief Metadata about a blob stored in a Puffin file footer. -struct ICEBERG_EXPORT BlobMetadata { +struct ICEBERG_DATA_EXPORT BlobMetadata { /// See StandardBlobTypes for known types. std::string type; /// Ordered list of field IDs the blob was computed from. @@ -105,16 +105,16 @@ struct ICEBERG_EXPORT BlobMetadata { friend bool operator==(const BlobMetadata& lhs, const BlobMetadata& rhs) = default; }; -ICEBERG_EXPORT std::string ToString(const BlobMetadata& blob_metadata); +ICEBERG_DATA_EXPORT std::string ToString(const BlobMetadata& blob_metadata); /// \brief Metadata about a Puffin file. -struct ICEBERG_EXPORT FileMetadata { +struct ICEBERG_DATA_EXPORT FileMetadata { std::vector blobs; std::unordered_map properties; friend bool operator==(const FileMetadata& lhs, const FileMetadata& rhs) = default; }; -ICEBERG_EXPORT std::string ToString(const FileMetadata& file_metadata); +ICEBERG_DATA_EXPORT std::string ToString(const FileMetadata& file_metadata); } // namespace iceberg::puffin diff --git a/src/iceberg/puffin/json_serde_internal.h b/src/iceberg/puffin/json_serde_internal.h index dbb5fbd09..9e003e168 100644 --- a/src/iceberg/puffin/json_serde_internal.h +++ b/src/iceberg/puffin/json_serde_internal.h @@ -27,30 +27,30 @@ #include -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/puffin/type_fwd.h" #include "iceberg/result.h" namespace iceberg::puffin { /// \brief Serialize a BlobMetadata to JSON. -ICEBERG_EXPORT nlohmann::json ToJson(const BlobMetadata& blob_metadata); +ICEBERG_DATA_EXPORT nlohmann::json ToJson(const BlobMetadata& blob_metadata); /// \brief Deserialize a BlobMetadata from JSON. -ICEBERG_EXPORT Result BlobMetadataFromJson(const nlohmann::json& json); +ICEBERG_DATA_EXPORT Result BlobMetadataFromJson(const nlohmann::json& json); /// \brief Serialize a FileMetadata to JSON. -ICEBERG_EXPORT nlohmann::json ToJson(const FileMetadata& file_metadata); +ICEBERG_DATA_EXPORT nlohmann::json ToJson(const FileMetadata& file_metadata); /// \brief Deserialize a FileMetadata from JSON. -ICEBERG_EXPORT Result FileMetadataFromJson(const nlohmann::json& json); +ICEBERG_DATA_EXPORT Result FileMetadataFromJson(const nlohmann::json& json); /// \brief Serialize a FileMetadata to a JSON string. -ICEBERG_EXPORT std::string ToJsonString(const FileMetadata& file_metadata, - bool pretty = false); +ICEBERG_DATA_EXPORT std::string ToJsonString(const FileMetadata& file_metadata, + bool pretty = false); /// \brief Deserialize a FileMetadata from a JSON string. -ICEBERG_EXPORT Result FileMetadataFromJsonString( +ICEBERG_DATA_EXPORT Result FileMetadataFromJsonString( std::string_view json_string); } // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_format.h b/src/iceberg/puffin/puffin_format.h index 857c2ba57..e5ecf9003 100644 --- a/src/iceberg/puffin/puffin_format.h +++ b/src/iceberg/puffin/puffin_format.h @@ -26,14 +26,14 @@ #include #include -#include "iceberg/iceberg_export.h" +#include "iceberg/iceberg_data_export.h" #include "iceberg/puffin/file_metadata.h" #include "iceberg/result.h" namespace iceberg::puffin { /// \brief Puffin file format constants. -struct ICEBERG_EXPORT PuffinFormat { +struct ICEBERG_DATA_EXPORT PuffinFormat { /// Magic bytes: "PFA1" (Puffin Fratercula arctica, version 1) static constexpr std::array kMagicV1 = {0x50, 0x46, 0x41, 0x31}; @@ -61,9 +61,9 @@ enum class PuffinFlag : uint8_t { }; /// \brief Check if a flag is set in the flags bytes. -ICEBERG_EXPORT bool IsFlagSet(std::span flags, PuffinFlag flag); +ICEBERG_DATA_EXPORT bool IsFlagSet(std::span flags, PuffinFlag flag); /// \brief Set a flag in the flags bytes. -ICEBERG_EXPORT void SetFlag(std::span flags, PuffinFlag flag); +ICEBERG_DATA_EXPORT void SetFlag(std::span flags, PuffinFlag flag); } // namespace iceberg::puffin diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index f39b4e4fd..3355dacf7 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -31,7 +31,7 @@ set(ICEBERG_TEST_RESOURCES "${CMAKE_SOURCE_DIR}/src/iceberg/test/resources") configure_file("test_config.h.in" "test_config.h") function(add_iceberg_test test_name) - set(options USE_BUNDLE) + set(options USE_BUNDLE USE_DATA) set(oneValueArgs) set(multiValueArgs SOURCES) cmake_parse_arguments(ARG @@ -47,6 +47,10 @@ function(add_iceberg_test test_name) if(ARG_USE_BUNDLE) target_link_libraries(${test_name} PRIVATE iceberg_bundle_static GTest::gmock_main) + elseif(ARG_USE_DATA) + target_link_libraries(${test_name} + PRIVATE "$,iceberg_data_static,iceberg_data_shared>" + GTest::gmock_main) else() target_link_libraries(${test_name} PRIVATE iceberg_static GTest::gmock_main) endif() @@ -109,6 +113,7 @@ add_iceberg_test(json_serde_test schema_json_test.cc) add_iceberg_test(util_test + USE_DATA SOURCES bucket_util_test.cc config_test.cc @@ -129,9 +134,11 @@ add_iceberg_test(util_test uuid_test.cc visit_type_test.cc) -add_iceberg_test(roaring_test SOURCES roaring_test.cc) - -add_iceberg_test(puffin_test SOURCES puffin_format_test.cc puffin_json_test.cc) +add_iceberg_test(puffin_test + USE_DATA + SOURCES + puffin_format_test.cc + puffin_json_test.cc) if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(avro_test diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 3e88fc7ea..e168d08bf 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -102,10 +102,11 @@ iceberg_tests = { 'uuid_test.cc', 'visit_type_test.cc', ), + 'use_data': true, }, - 'roaring_test': {'sources': files('roaring_test.cc')}, 'puffin_test': { 'sources': files('puffin_format_test.cc', 'puffin_json_test.cc'), + 'use_data': true, }, } @@ -141,13 +142,17 @@ if get_option('rest').enabled() endif foreach test_name, values : iceberg_tests + test_deps = [gmock_main_dep] + values.get('dependencies', []) + if values.get('use_data', false) + test_deps = [iceberg_data_dep] + test_deps + else + test_deps = [iceberg_dep] + test_deps + endif + exc = executable( test_name, sources: values['sources'], - dependencies: [iceberg_dep, gmock_main_dep] + values.get( - 'dependencies', - [], - ), + dependencies: test_deps, ) test(test_name, exc) endforeach diff --git a/src/iceberg/test/roaring_test.cc b/src/iceberg/test/roaring_test.cc deleted file mode 100644 index 3c9e4d7a5..000000000 --- a/src/iceberg/test/roaring_test.cc +++ /dev/null @@ -1,60 +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. - */ -#include "roaring/roaring.hh" - -#include - -#include "roaring/roaring64map.hh" - -namespace iceberg { - -TEST(CRoaringTest, Basic32Bit) { - roaring::Roaring r1; - for (uint32_t i = 100; i < 1000; i++) { - r1.add(i); - } - ASSERT_EQ(r1.cardinality(), 900); - ASSERT_TRUE(r1.contains(500)); - ASSERT_FALSE(r1.contains(50)); - ASSERT_FALSE(r1.isEmpty()); -} - -TEST(CRoaringTest, Basic64Bit) { - roaring::Roaring64Map r2; - for (uint64_t i = 18000000000000000100ull; i < 18000000000000001000ull; i++) { - r2.add(i); - } - ASSERT_EQ(r2.cardinality(), 900); - ASSERT_TRUE(r2.contains(static_cast(18000000000000000500ull))); - ASSERT_FALSE(r2.contains(static_cast(18000000000000000050ull))); - ASSERT_FALSE(r2.isEmpty()); -} - -TEST(CRoaringTest, ConstructorWithInitializerList) { - roaring::Roaring r1 = roaring::Roaring::bitmapOf(5, 1, 2, 3, 5, 6); - ASSERT_EQ(r1.cardinality(), 5); - ASSERT_TRUE(r1.contains(1)); - ASSERT_TRUE(r1.contains(2)); - ASSERT_TRUE(r1.contains(3)); - ASSERT_TRUE(r1.contains(5)); - ASSERT_TRUE(r1.contains(6)); - ASSERT_FALSE(r1.contains(4)); -} - -} // namespace iceberg From 2e87038e181dd8af4fdf6630785391159894a7c6 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 6 May 2026 11:30:12 +0800 Subject: [PATCH 019/151] fix(cmake): use consistent generator expressions to link libraries (#639) --- example/CMakeLists.txt | 6 ++++-- src/iceberg/test/CMakeLists.txt | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index f89058ed5..a9bf73cf0 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -26,5 +26,7 @@ find_package(iceberg CONFIG REQUIRED COMPONENTS bundle rest) add_executable(demo_example demo_example.cc) -target_link_libraries(demo_example PRIVATE iceberg::iceberg_bundle_shared - iceberg::iceberg_rest_shared) +target_link_libraries(demo_example + PRIVATE "$,iceberg::iceberg_bundle_shared,iceberg::iceberg_bundle_static>" + "$,iceberg::iceberg_rest_shared,iceberg::iceberg_rest_static>" +) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 3355dacf7..6b98951ad 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -46,13 +46,17 @@ function(add_iceberg_test test_name) target_sources(${test_name} PRIVATE ${ARG_SOURCES}) if(ARG_USE_BUNDLE) - target_link_libraries(${test_name} PRIVATE iceberg_bundle_static GTest::gmock_main) + target_link_libraries(${test_name} + PRIVATE "$,iceberg_bundle_static,iceberg_bundle_shared>" + GTest::gmock_main) elseif(ARG_USE_DATA) target_link_libraries(${test_name} PRIVATE "$,iceberg_data_static,iceberg_data_shared>" GTest::gmock_main) else() - target_link_libraries(${test_name} PRIVATE iceberg_static GTest::gmock_main) + target_link_libraries(${test_name} + PRIVATE "$,iceberg_static,iceberg_shared>" + GTest::gmock_main) endif() if(MSVC_TOOLCHAIN) From 7e51613666c32eadb5302a8ef950df44093fc7d4 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 6 May 2026 15:11:13 +0800 Subject: [PATCH 020/151] ci: use ilammy/msvc-dev-cmd for Windows MSVC environment (#643) Replace hardcoded vcvarsall.bat path with the Apache-approved ilammy/msvc-dev-cmd action so builds work across VS image layouts. --- .github/workflows/test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3a125ccf..6f6ac1143 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,6 +118,10 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: persist-credentials: false + - name: Set up MSVC Developer Command Prompt + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + arch: x64 - name: Install dependencies shell: pwsh run: | @@ -133,14 +137,14 @@ jobs: SCCACHE_GHA_ENABLED: "true" run: | $ErrorActionPreference = "Stop" - cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_iceberg.sh `$(pwd) OFF ON`"" + bash -lc 'ci/scripts/build_iceberg.sh $(pwd) OFF ON' if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } sccache --show-stats - name: Build Example shell: pwsh run: | $ErrorActionPreference = "Stop" - cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_example.sh `$(pwd)/example`"" + bash -lc 'ci/scripts/build_example.sh $(pwd)/example' meson: name: Meson - ${{ matrix.title }} runs-on: ${{ matrix.runs-on }} From ff4222958eb47ab41dc6603e945318c8f3857316 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 6 May 2026 16:04:16 +0800 Subject: [PATCH 021/151] refactor(util): make retry policy explicit and deterministic (#633) --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/test/retry_util_test.cc | 399 ++++++++++++++++++++++--- src/iceberg/util/retry_util.cc | 186 ++++++++++++ src/iceberg/util/retry_util.h | 164 +++++----- src/iceberg/util/retry_util_internal.h | 61 ++++ 6 files changed, 689 insertions(+), 123 deletions(-) create mode 100644 src/iceberg/util/retry_util.cc create mode 100644 src/iceberg/util/retry_util_internal.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 6d190cb60..02099f6b8 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -104,6 +104,7 @@ set(ICEBERG_SOURCES util/gzip_internal.cc util/murmurhash3_internal.cc util/property_util.cc + util/retry_util.cc util/snapshot_util.cc util/string_util.cc util/struct_like_set.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 17ed723fc..41a5c2dd3 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -126,6 +126,7 @@ iceberg_sources = files( 'util/gzip_internal.cc', 'util/murmurhash3_internal.cc', 'util/property_util.cc', + 'util/retry_util.cc', 'util/snapshot_util.cc', 'util/string_util.cc', 'util/struct_like_set.cc', diff --git a/src/iceberg/test/retry_util_test.cc b/src/iceberg/test/retry_util_test.cc index 05c7cb0e1..ead221910 100644 --- a/src/iceberg/test/retry_util_test.cc +++ b/src/iceberg/test/retry_util_test.cc @@ -19,15 +19,73 @@ #include "iceberg/util/retry_util.h" -#include -#include +#include +#include +#include #include #include "iceberg/result.h" #include "iceberg/test/matchers.h" +#include "iceberg/util/retry_util_internal.h" namespace iceberg { +namespace { + +struct ResultReturningTask { + Result operator()() const { return 1; } +}; + +struct NonResultReturningTask { + int operator()() const { return 1; } +}; + +static_assert(detail::RetryTask); +static_assert(!detail::RetryTask); +static_assert(requires(RetryRunner runner, ResultReturningTask task) { + { runner.Run(task) } -> std::same_as>; +}); + +class FakeRetryEnvironment { + public: + using Duration = RetryTestHooks::Duration; + using TimePoint = RetryTestHooks::TimePoint; + + FakeRetryEnvironment() { + hooks_.now = [this]() { return now_; }; + hooks_.sleep_for = [this](Duration duration) { + sleep_durations_.push_back(duration); + now_ += duration; + }; + hooks_.jitter = [this](int32_t base_delay_ms) { + observed_base_delays_ms_.push_back(base_delay_ms); + return base_delay_ms + jitter_offset_ms_; + }; + } + + void Advance(Duration duration) { now_ += duration; } + + void SetJitterOffsetMs(int32_t jitter_offset_ms) { + jitter_offset_ms_ = jitter_offset_ms; + } + + const RetryTestHooks& hooks() const { return hooks_; } + + const std::vector& sleep_durations() const { return sleep_durations_; } + + const std::vector& observed_base_delays_ms() const { + return observed_base_delays_ms_; + } + + private: + RetryTestHooks hooks_; + TimePoint now_{}; + int32_t jitter_offset_ms_ = 0; + std::vector sleep_durations_; + std::vector observed_base_delays_ms_; +}; + +} // namespace TEST(RetryRunnerTest, SuccessOnFirstAttempt) { int call_count = 0; @@ -37,6 +95,7 @@ TEST(RetryRunnerTest, SuccessOnFirstAttempt) { .min_wait_ms = 1, .max_wait_ms = 10, .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) .Run( [&]() -> Result { ++call_count; @@ -58,6 +117,7 @@ TEST(RetryRunnerTest, RetryOnceThenSucceed) { .min_wait_ms = 1, .max_wait_ms = 10, .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) .Run( [&]() -> Result { ++call_count; @@ -82,6 +142,7 @@ TEST(RetryRunnerTest, MaxAttemptsExhausted) { .min_wait_ms = 1, .max_wait_ms = 10, .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) .Run( [&]() -> Result { ++call_count; @@ -140,6 +201,32 @@ TEST(RetryRunnerTest, OnlyRetryOnMatchingError) { EXPECT_EQ(attempts, 3); } +TEST(RetryRunnerTest, OnlyRetryOnTakesPrecedenceOverStopRetryOn) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .StopRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("transient"); + } + return 100; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 100); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(attempts, 2); +} + TEST(RetryRunnerTest, StopRetryOnMatchingError) { int call_count = 0; int32_t attempts = 0; @@ -148,7 +235,7 @@ TEST(RetryRunnerTest, StopRetryOnMatchingError) { .min_wait_ms = 1, .max_wait_ms = 10, .total_timeout_ms = 5000}) - .StopRetryOn({ErrorKind::kCommitStateUnknown}) + .StopRetryOn(ErrorKind::kCommitStateUnknown) .Run( [&]() -> Result { ++call_count; @@ -161,14 +248,40 @@ TEST(RetryRunnerTest, StopRetryOnMatchingError) { EXPECT_EQ(attempts, 1); } -TEST(RetryRunnerTest, ZeroRetries) { +TEST(RetryRunnerTest, StopRetryOnNonMatchingErrorAllowsRetry) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 0, + auto result = RetryRunner(RetryConfig{.num_retries = 2, .min_wait_ms = 1, .max_wait_ms = 10, .total_timeout_ms = 5000}) + .StopRetryOn({ErrorKind::kCommitStateUnknown}) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("retryable"); + } + return 88; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 88); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(attempts, 2); +} + +TEST(RetryRunnerTest, ZeroRetriesAllowsUnsetPolicyAndSkipsBackoffValidation) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 0, + .min_wait_ms = 0, + .max_wait_ms = 0, + .total_timeout_ms = 5000, + .scale_factor = 0.5}) .Run( [&]() -> Result { ++call_count; @@ -181,7 +294,159 @@ TEST(RetryRunnerTest, ZeroRetries) { EXPECT_EQ(attempts, 1); } +TEST(RetryRunnerTest, NegativeRetriesFailsBeforeTaskRuns) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = -1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + return 1; + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("num_retries must be non-negative")); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(attempts, 0); +} + +TEST(RetryRunnerTest, InvalidBackoffConfigFailsBeforeTaskRuns) { + struct InvalidConfigCase { + RetryConfig config; + const char* expected_message; + }; + + const std::vector test_cases = { + {.config = RetryConfig{.num_retries = std::numeric_limits::max(), + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}, + .expected_message = "num_retries is too large"}, + {.config = RetryConfig{.num_retries = 1, + .min_wait_ms = 0, + .max_wait_ms = 10, + .total_timeout_ms = 5000}, + .expected_message = "min_wait_ms must be positive"}, + {.config = RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 0, + .total_timeout_ms = 5000}, + .expected_message = "max_wait_ms must be positive"}, + {.config = RetryConfig{.num_retries = 1, + .min_wait_ms = 20, + .max_wait_ms = 10, + .total_timeout_ms = 5000}, + .expected_message = "max_wait_ms must be greater than or equal to min_wait_ms"}, + {.config = RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000, + .scale_factor = 0.5}, + .expected_message = "scale_factor must be finite and at least 1.0"}, + {.config = RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000, + .scale_factor = std::numeric_limits::infinity()}, + .expected_message = "scale_factor must be finite and at least 1.0"}, + }; + + for (const auto& test_case : test_cases) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(test_case.config) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + return 1; + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)) + << test_case.expected_message; + EXPECT_THAT(result, HasErrorMessage(test_case.expected_message)); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(attempts, 0); + } +} + +TEST(RetryRunnerTest, UnsetRetryPolicyFailsBeforeTaskRuns) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + return CommitFailed("fail"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Retry policy must be explicitly configured")); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(attempts, 0); +} + +TEST(RetryRunnerTest, EmptyOnlyRetryOnPolicyFailsBeforeTaskRuns) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .OnlyRetryOn(std::initializer_list{}) + .Run( + [&]() -> Result { + ++call_count; + return CommitFailed("fail"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, + HasErrorMessage("Retry policy must include at least one error kind")); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(attempts, 0); +} + +TEST(RetryRunnerTest, EmptyStopRetryOnPolicyFailsBeforeTaskRuns) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .StopRetryOn({}) + .Run( + [&]() -> Result { + ++call_count; + return CommitFailed("fail"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, + HasErrorMessage("Retry policy must include at least one error kind")); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(attempts, 0); +} + TEST(RetryRunnerTest, TotalTimeoutStopsBeforeStartingAnotherAttempt) { + FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks scoped_hooks(fake_retry.hooks()); int call_count = 0; int32_t attempts = 0; @@ -189,14 +454,12 @@ TEST(RetryRunnerTest, TotalTimeoutStopsBeforeStartingAnotherAttempt) { .min_wait_ms = 20, .max_wait_ms = 20, .total_timeout_ms = 15}) + .OnlyRetryOn(ErrorKind::kCommitFailed) .Run( [&]() -> Result { ++call_count; - // The first failure consumes most of the 15 ms budget, so the - // next 20 ms backoff should prevent another attempt from - // starting. if (call_count == 1) { - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + fake_retry.Advance(FakeRetryEnvironment::Duration(10)); } return CommitFailed("retry budget exhausted"); }, @@ -205,6 +468,97 @@ TEST(RetryRunnerTest, TotalTimeoutStopsBeforeStartingAnotherAttempt) { EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); EXPECT_EQ(call_count, 1); EXPECT_EQ(attempts, 1); + EXPECT_TRUE(fake_retry.sleep_durations().empty()); + EXPECT_EQ(fake_retry.observed_base_delays_ms(), std::vector({20})); +} + +TEST(RetryRunnerTest, TotalTimeoutStopsWhenDelayEqualsRemainingBudget) { + FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks scoped_hooks(fake_retry.hooks()); + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 20}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + fake_retry.Advance(FakeRetryEnvironment::Duration(10)); + return CommitFailed("retry budget exhausted"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); + EXPECT_TRUE(fake_retry.sleep_durations().empty()); + EXPECT_EQ(fake_retry.observed_base_delays_ms(), std::vector({10})); +} + +TEST(RetryRunnerTest, NonPositiveTotalTimeoutDisablesDeadline) { + FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks scoped_hooks(fake_retry.hooks()); + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 0}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + fake_retry.Advance(FakeRetryEnvironment::Duration(100)); + if (call_count <= 2) { + return CommitFailed("transient"); + } + return 123; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 123); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); + EXPECT_EQ(fake_retry.sleep_durations(), std::vector( + {FakeRetryEnvironment::Duration(10), + FakeRetryEnvironment::Duration(10)})); + EXPECT_EQ(fake_retry.observed_base_delays_ms(), std::vector({10, 10})); +} + +TEST(RetryRunnerTest, RetryDelayDoesNotExceedMaxWaitAfterJitter) { + FakeRetryEnvironment fake_retry; + fake_retry.SetJitterOffsetMs(100); + ScopedRetryTestHooks scoped_hooks(fake_retry.hooks()); + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 0}) + .OnlyRetryOn(ErrorKind::kCommitFailed) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("transient"); + } + return 321; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 321); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(attempts, 2); + EXPECT_EQ(fake_retry.sleep_durations(), std::vector( + {FakeRetryEnvironment::Duration(10)})); + EXPECT_EQ(fake_retry.observed_base_delays_ms(), std::vector({10})); } TEST(RetryRunnerTest, MakeCommitRetryRunnerConfig) { @@ -274,31 +628,4 @@ TEST(RetryRunnerTest, OnlyRetryOnMultipleErrorKinds) { EXPECT_EQ(attempts, 3); } -TEST(RetryRunnerTest, DefaultRetryAllErrors) { - int call_count = 0; - int32_t attempts = 0; - - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .Run( - [&]() -> Result { - ++call_count; - if (call_count == 1) { - return IOError("disk full"); - } - if (call_count == 2) { - return ValidationFailed("bad schema"); - } - return 55; - }, - &attempts); - - EXPECT_THAT(result, IsOk()); - EXPECT_EQ(*result, 55); - EXPECT_EQ(call_count, 3); - EXPECT_EQ(attempts, 3); -} - } // namespace iceberg diff --git a/src/iceberg/util/retry_util.cc b/src/iceberg/util/retry_util.cc new file mode 100644 index 000000000..d6e0d509e --- /dev/null +++ b/src/iceberg/util/retry_util.cc @@ -0,0 +1,186 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/util/retry_util.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/util/retry_util_internal.h" + +namespace iceberg { +namespace { + +const RetryTestHooks*& ActiveRetryTestHooks() { + // Keep test hooks thread-local so fake retry timing in one test thread does not + // leak into unrelated retry work or require synchronization around a global pointer. + static thread_local const RetryTestHooks* active_retry_test_hooks = nullptr; + return active_retry_test_hooks; +} + +RetryTestHooks::TimePoint RetryNow() { + const auto* hooks = GetActiveRetryTestHooks(); + if (hooks != nullptr && hooks->now) { + return hooks->now(); + } + return RetryTestHooks::Clock::now(); +} + +void RetrySleepFor(RetryTestHooks::Duration duration) { + const auto* hooks = GetActiveRetryTestHooks(); + if (hooks != nullptr && hooks->sleep_for) { + hooks->sleep_for(duration); + return; + } + std::this_thread::sleep_for(duration); +} + +int32_t ApplyRetryJitter(int32_t base_delay_ms) { + const auto* hooks = GetActiveRetryTestHooks(); + if (hooks != nullptr && hooks->jitter) { + return hooks->jitter(base_delay_ms); + } + + static thread_local std::mt19937 gen(std::random_device{}()); + const int32_t jitter_range = std::max(1, base_delay_ms / 10); + std::uniform_int_distribution<> dis(0, jitter_range - 1); + const int64_t jittered_delay_ms = static_cast(base_delay_ms) + dis(gen); + return static_cast( + std::min(jittered_delay_ms, std::numeric_limits::max())); +} + +} // namespace + +const RetryTestHooks* GetActiveRetryTestHooks() { return ActiveRetryTestHooks(); } + +void SetActiveRetryTestHooks(const RetryTestHooks* hooks) { + ActiveRetryTestHooks() = hooks; +} + +Status RetryRunner::ValidateConfig() const { + if (config_.num_retries < 0) { + return InvalidArgument("num_retries must be non-negative, got {}", + config_.num_retries); + } + if (config_.num_retries == 0) { + return {}; + } + if (config_.num_retries == std::numeric_limits::max()) { + return InvalidArgument("num_retries is too large, got {}", config_.num_retries); + } + if (config_.min_wait_ms <= 0) { + return InvalidArgument("min_wait_ms must be positive, got {}", config_.min_wait_ms); + } + if (config_.max_wait_ms <= 0) { + return InvalidArgument("max_wait_ms must be positive, got {}", config_.max_wait_ms); + } + if (config_.max_wait_ms < config_.min_wait_ms) { + return InvalidArgument("max_wait_ms must be greater than or equal to min_wait_ms"); + } + if (!std::isfinite(config_.scale_factor) || config_.scale_factor < 1.0) { + return InvalidArgument("scale_factor must be finite and at least 1.0, got {}", + config_.scale_factor); + } + if (retry_policy_mode_ == RetryPolicyMode::kUnset) { + return InvalidArgument( + "Retry policy must be explicitly configured with OnlyRetryOn(...) or " + "StopRetryOn(...) when num_retries > 0"); + } + if (retry_error_kinds_.empty()) { + return InvalidArgument("Retry policy must include at least one error kind"); + } + + return {}; +} + +std::optional RetryRunner::ComputeDeadline() const { + if (config_.total_timeout_ms <= 0) { + return std::nullopt; + } + return RetryNow() + Duration(config_.total_timeout_ms); +} + +bool RetryRunner::HasTimedOut(const std::optional& deadline) const { + return deadline.has_value() && RetryNow() >= *deadline; +} + +bool RetryRunner::ShouldRetry(ErrorKind kind) const { + const bool policy_contains_kind = std::ranges::contains(retry_error_kinds_, kind); + switch (retry_policy_mode_) { + case RetryPolicyMode::kOnlyRetryOn: + return policy_contains_kind; + case RetryPolicyMode::kStopRetryOn: + return !policy_contains_kind; + case RetryPolicyMode::kUnset: + return false; + } + return false; +} + +bool RetryRunner::CanRetry(ErrorKind kind, int32_t attempt, int32_t max_attempts, + const std::optional& deadline) const { + return attempt < max_attempts && !HasTimedOut(deadline) && ShouldRetry(kind); +} + +std::optional RetryRunner::RetryDelayWithinBudget( + int32_t attempt, const std::optional& deadline) const { + const auto delay = Duration(CalculateDelay(attempt)); + if (!deadline.has_value()) { + return delay; + } + + const auto now = RetryNow(); + if (now >= *deadline) { + return std::nullopt; + } + + const auto remaining = std::chrono::duration_cast(*deadline - now); + if (remaining <= Duration::zero() || delay >= remaining) { + return std::nullopt; + } + + return delay; +} + +bool RetryRunner::WaitForNextAttempt(int32_t attempt, + const std::optional& deadline) const { + const auto delay = RetryDelayWithinBudget(attempt, deadline); + if (!delay.has_value()) { + return false; + } + + RetrySleepFor(*delay); + return !HasTimedOut(deadline); +} + +int32_t RetryRunner::CalculateDelay(int32_t attempt) const { + const double base_delay = + config_.min_wait_ms * std::pow(config_.scale_factor, attempt - 1); + const int32_t delay_ms = static_cast( + std::min(base_delay, static_cast(config_.max_wait_ms))); + return std::clamp(ApplyRetryJitter(delay_ms), 1, config_.max_wait_ms); +} + +} // namespace iceberg diff --git a/src/iceberg/util/retry_util.h b/src/iceberg/util/retry_util.h index 7041a40ef..83e2cd5c8 100644 --- a/src/iceberg/util/retry_util.h +++ b/src/iceberg/util/retry_util.h @@ -19,12 +19,14 @@ #pragma once -#include #include -#include +#include +#include +#include +#include #include -#include -#include +#include +#include #include #include "iceberg/iceberg_export.h" @@ -32,6 +34,27 @@ namespace iceberg { +namespace detail { + +template +struct IsResult : std::false_type {}; + +template +struct IsResult> : std::true_type {}; + +template +concept ResultType = IsResult>::value; + +template +concept RetryTask = requires(F& f) { + { std::invoke(f) } -> ResultType; +}; + +template +using RetryTaskResult = std::remove_cvref_t>; + +} // namespace detail + /// \brief Configuration for retry behavior struct ICEBERG_EXPORT RetryConfig { /// Maximum number of retry attempts (not including the first attempt) @@ -47,6 +70,9 @@ struct ICEBERG_EXPORT RetryConfig { }; /// \brief Utility class for running tasks with retry logic +/// +/// When retries are enabled (`num_retries > 0`), callers must explicitly configure +/// retry policy with `OnlyRetryOn(...)` or `StopRetryOn(...)`. class ICEBERG_EXPORT RetryRunner { public: /// \brief Construct a RetryRunner with the given configuration @@ -60,7 +86,8 @@ class ICEBERG_EXPORT RetryRunner { /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, /// StopRetryOn is ignored. RetryRunner& OnlyRetryOn(std::initializer_list error_kinds) { - only_retry_on_ = std::vector(error_kinds); + retry_policy_mode_ = RetryPolicyMode::kOnlyRetryOn; + retry_error_kinds_ = std::vector(error_kinds); return *this; } @@ -68,10 +95,7 @@ class ICEBERG_EXPORT RetryRunner { /// /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, /// StopRetryOn is ignored. - RetryRunner& OnlyRetryOn(ErrorKind error_kind) { - only_retry_on_ = std::vector{error_kind}; - return *this; - } + RetryRunner& OnlyRetryOn(ErrorKind error_kind) { return OnlyRetryOn({error_kind}); } /// \brief Specify error types that should stop retries immediately. /// @@ -81,18 +105,35 @@ class ICEBERG_EXPORT RetryRunner { /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, /// StopRetryOn is ignored. RetryRunner& StopRetryOn(std::initializer_list error_kinds) { - stop_retry_on_ = std::vector(error_kinds); + if (retry_policy_mode_ == RetryPolicyMode::kOnlyRetryOn) { + return *this; + } + + retry_policy_mode_ = RetryPolicyMode::kStopRetryOn; + retry_error_kinds_ = std::vector(error_kinds); return *this; } + /// \brief Specify a single error type that should stop retries immediately. + /// + /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, + /// StopRetryOn is ignored. + RetryRunner& StopRetryOn(ErrorKind error_kind) { return StopRetryOn({error_kind}); } + /// \brief Run a task that returns a Result /// + /// When `num_retries > 0`, the retry policy must be configured explicitly via + /// `OnlyRetryOn(...)` or `StopRetryOn(...)`. + /// /// TODO: Replace attempt_counter with a metrics reporter once it is available. - template ::value_type> - Result Run(F&& task, int32_t* attempt_counter = nullptr) { - if (config_.num_retries < 0) { - return InvalidArgument("num_retries must be non-negative, got {}", - config_.num_retries); + template + requires detail::RetryTask + auto Run(F&& task, int32_t* attempt_counter = nullptr) -> detail::RetryTaskResult { + using TaskResult = detail::RetryTaskResult; + + const auto validation = ValidateConfig(); + if (!validation.has_value()) { + return TaskResult(std::unexpected(validation.error())); } const auto deadline = ComputeDeadline(); @@ -105,7 +146,7 @@ class ICEBERG_EXPORT RetryRunner { *attempt_counter = attempt; } - auto result = task(); + auto result = std::invoke(task); if (result.has_value()) { return result; } @@ -121,89 +162,38 @@ class ICEBERG_EXPORT RetryRunner { } private: + enum class RetryPolicyMode { + // No retry policy was selected; invalid when retries are enabled. + kUnset, + // Retry only errors listed in retry_error_kinds_. + kOnlyRetryOn, + // Retry all errors except those listed in retry_error_kinds_. + kStopRetryOn, + }; + using Clock = std::chrono::steady_clock; using Duration = std::chrono::milliseconds; using TimePoint = Clock::time_point; - std::optional ComputeDeadline() const { - if (config_.total_timeout_ms <= 0) { - return std::nullopt; - } - return Clock::now() + Duration(config_.total_timeout_ms); - } - - bool HasTimedOut(const std::optional& deadline) const { - return deadline.has_value() && Clock::now() >= *deadline; - } + /// \brief Validate retry counts, timing bounds, and the selected retry policy. + Status ValidateConfig() const; + std::optional ComputeDeadline() const; + bool HasTimedOut(const std::optional& deadline) const; /// \brief Check if the given error kind should trigger a retry. - bool ShouldRetry(ErrorKind kind) const { - if (!only_retry_on_.empty()) { - return std::ranges::any_of(only_retry_on_, - [kind](ErrorKind k) { return kind == k; }); - } - - if (!stop_retry_on_.empty()) { - return !std::ranges::any_of(stop_retry_on_, - [kind](ErrorKind k) { return kind == k; }); - } - - return true; - } - + bool ShouldRetry(ErrorKind kind) const; bool CanRetry(ErrorKind kind, int32_t attempt, int32_t max_attempts, - const std::optional& deadline) const { - return attempt < max_attempts && !HasTimedOut(deadline) && ShouldRetry(kind); - } - + const std::optional& deadline) const; std::optional RetryDelayWithinBudget( - int32_t attempt, const std::optional& deadline) const { - const auto delay = Duration(CalculateDelay(attempt)); - if (!deadline.has_value()) { - return delay; - } - - const auto now = Clock::now(); - if (now >= *deadline) { - return std::nullopt; - } - - const auto remaining = std::chrono::duration_cast(*deadline - now); - if (remaining <= Duration::zero() || delay >= remaining) { - return std::nullopt; - } - - return delay; - } - + int32_t attempt, const std::optional& deadline) const; bool WaitForNextAttempt(int32_t attempt, - const std::optional& deadline) const { - const auto delay = RetryDelayWithinBudget(attempt, deadline); - if (!delay.has_value()) { - return false; - } - - std::this_thread::sleep_for(*delay); - return !HasTimedOut(deadline); - } - + const std::optional& deadline) const; /// \brief Calculate delay with exponential backoff and jitter - int32_t CalculateDelay(int32_t attempt) const { - // Calculate base delay with exponential backoff - double base_delay = config_.min_wait_ms * std::pow(config_.scale_factor, attempt - 1); - int32_t delay_ms = static_cast( - std::min(base_delay, static_cast(config_.max_wait_ms))); - - static thread_local std::mt19937 gen(std::random_device{}()); - int32_t jitter_range = std::max(1, delay_ms / 10); - std::uniform_int_distribution<> dis(0, jitter_range - 1); - delay_ms += dis(gen); - return std::max(1, delay_ms); - } + int32_t CalculateDelay(int32_t attempt) const; RetryConfig config_; - std::vector only_retry_on_; - std::vector stop_retry_on_; + RetryPolicyMode retry_policy_mode_ = RetryPolicyMode::kUnset; + std::vector retry_error_kinds_; }; /// \brief Helper function to create a RetryRunner with table commit configuration diff --git a/src/iceberg/util/retry_util_internal.h b/src/iceberg/util/retry_util_internal.h new file mode 100644 index 000000000..f52dc873f --- /dev/null +++ b/src/iceberg/util/retry_util_internal.h @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include + +#include "iceberg/iceberg_export.h" + +namespace iceberg { + +struct RetryTestHooks { + using Clock = std::chrono::steady_clock; + using Duration = std::chrono::milliseconds; + using TimePoint = Clock::time_point; + + std::function now; + std::function sleep_for; + std::function jitter; +}; + +ICEBERG_EXPORT const RetryTestHooks* GetActiveRetryTestHooks(); +ICEBERG_EXPORT void SetActiveRetryTestHooks(const RetryTestHooks* hooks); + +class ScopedRetryTestHooks { + public: + explicit ScopedRetryTestHooks(const RetryTestHooks& hooks) + : previous_hooks_(GetActiveRetryTestHooks()) { + SetActiveRetryTestHooks(&hooks); + } + + ScopedRetryTestHooks(const ScopedRetryTestHooks&) = delete; + ScopedRetryTestHooks& operator=(const ScopedRetryTestHooks&) = delete; + ScopedRetryTestHooks(ScopedRetryTestHooks&&) = delete; + ScopedRetryTestHooks& operator=(ScopedRetryTestHooks&&) = delete; + + ~ScopedRetryTestHooks() { SetActiveRetryTestHooks(previous_hooks_); } + + private: + const RetryTestHooks* previous_hooks_; +}; + +} // namespace iceberg From db7bb308220c4f155537897f681eb3a89f6c66ea Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 6 May 2026 22:21:55 +0800 Subject: [PATCH 022/151] ci: split S3/MinIO into a Linux and macOS-only workflow (#642) --- .github/workflows/s3_test.yml | 81 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 30 ------------- ci/scripts/build_iceberg.sh | 10 ++++- 3 files changed, 90 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/s3_test.yml diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml new file mode 100644 index 000000000..74ab11025 --- /dev/null +++ b/.github/workflows/s3_test.yml @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# S3-backed tests against MinIO (Linux and macOS only). +name: S3 Tests + +on: + push: + branches: + - '**' + - '!dependabot/**' + tags: + - '**' + pull_request: + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: read + +env: + ICEBERG_HOME: /tmp/iceberg + +jobs: + s3-minio: + name: S3 (${{ matrix.title }}) + runs-on: ${{ matrix.runs-on }} + timeout-minutes: 35 + strategy: + fail-fast: false + matrix: + include: + - title: AMD64 Ubuntu 24.04 + runs-on: ubuntu-24.04 + CC: gcc-14 + CXX: g++-14 + - title: AArch64 macOS 26 + runs-on: macos-26 + env: + ICEBERG_TEST_S3_URI: s3://iceberg-test + AWS_ACCESS_KEY_ID: minio + AWS_SECRET_ACCESS_KEY: minio123 + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: http://127.0.0.1:9000 + AWS_EC2_METADATA_DISABLED: "TRUE" + steps: + - name: Checkout iceberg-cpp + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - name: Install dependencies on Ubuntu + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + shell: bash + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Set Ubuntu Compilers + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + run: | + echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV + echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Start MinIO + shell: bash + run: bash ci/scripts/start_minio.sh + - name: Build and test Iceberg with S3 + shell: bash + run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ON diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f6ac1143..dffabe8ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,13 +43,6 @@ jobs: timeout-minutes: 30 strategy: fail-fast: false - env: - ICEBERG_TEST_S3_URI: s3://iceberg-test - AWS_ACCESS_KEY_ID: minio - AWS_SECRET_ACCESS_KEY: minio123 - AWS_DEFAULT_REGION: us-east-1 - AWS_ENDPOINT_URL: http://127.0.0.1:9000 - AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 @@ -58,9 +51,6 @@ jobs: - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev - - name: Start MinIO - shell: bash - run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: bash env: @@ -79,21 +69,11 @@ jobs: timeout-minutes: 30 strategy: fail-fast: false - env: - ICEBERG_TEST_S3_URI: s3://iceberg-test - AWS_ACCESS_KEY_ID: minio - AWS_SECRET_ACCESS_KEY: minio123 - AWS_DEFAULT_REGION: us-east-1 - AWS_ENDPOINT_URL: http://127.0.0.1:9000 - AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: persist-credentials: false - - name: Start MinIO - shell: bash - run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: bash run: ci/scripts/build_iceberg.sh $(pwd) @@ -106,13 +86,6 @@ jobs: timeout-minutes: 60 strategy: fail-fast: false - env: - ICEBERG_TEST_S3_URI: s3://iceberg-test - AWS_ACCESS_KEY_ID: minio - AWS_SECRET_ACCESS_KEY: minio123 - AWS_DEFAULT_REGION: us-east-1 - AWS_ENDPOINT_URL: http://127.0.0.1:9000 - AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 @@ -128,9 +101,6 @@ jobs: vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows - name: Setup sccache uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - - name: Start MinIO - shell: bash - run: bash ci/scripts/start_minio.sh - name: Build Iceberg shell: pwsh env: diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 5d69dd074..4c88427e3 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -16,6 +16,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +# +# Usage: build_iceberg.sh [rest_integration_tests=OFF] [sccache=OFF] [s3=OFF] set -eux @@ -23,6 +25,7 @@ source_dir=${1} build_dir=${1}/build build_rest_integration_test=${2:-OFF} build_enable_sccache=${3:-OFF} +build_enable_s3=${4:-OFF} mkdir ${build_dir} pushd ${build_dir} @@ -36,10 +39,15 @@ CMAKE_ARGS=( "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}" "-DICEBERG_BUILD_STATIC=ON" "-DICEBERG_BUILD_SHARED=ON" - "-DICEBERG_S3=ON" "-DICEBERG_BUILD_REST_INTEGRATION_TESTS=${build_rest_integration_test}" ) +if [[ "${build_enable_s3}" == "ON" ]]; then + CMAKE_ARGS+=("-DICEBERG_S3=ON") +else + CMAKE_ARGS+=("-DICEBERG_S3=OFF") +fi + if is_windows; then CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake") CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release") From 4550ec8ad2dbaf341a7a61b2d1feb605c3e52689 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Thu, 7 May 2026 01:54:49 -0400 Subject: [PATCH 023/151] CI: Use specific patch versions in workflow action comments (#644) Similar to https://github.com/apache/iceberg/pull/16229 The workflow files use SHA-pinned actions (immutable), but the human-readable comments referenced only major versions (e.g., `# v6`, `# v5`). **When maintainers move these mutable tags to a new commit, zizmor fails in CI because the SHA no longer matches the stated tag.** --- .github/workflows/asf-allowlist-check.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/cpp-linter.yml | 2 +- .github/workflows/docs.yml | 4 ++-- .github/workflows/license_check.yml | 2 +- .github/workflows/pre-commit.yml | 4 ++-- .github/workflows/rc.yml | 10 +++++----- .github/workflows/s3_test.yml | 2 +- .github/workflows/sanitizer_test.yml | 2 +- .github/workflows/test.yml | 10 +++++----- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 65dbe8bcb..8d7952a9d 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -40,7 +40,7 @@ jobs: asf-allowlist-check: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7e9c8208c..49212916a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 51a8f4d63..dd78a98f9 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -34,7 +34,7 @@ jobs: pull-requests: write steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f27c66061..a0d16384b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,12 +37,12 @@ jobs: runs-on: ubuntu-slim steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 1 persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.x' diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 17af559d1..4bb28c0d5 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-slim steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Check license header diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 363c234ba..583f280bd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -31,8 +31,8 @@ jobs: pre-commit: runs-on: ubuntu-slim steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index d302da6c7..fa27c99ce 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -34,7 +34,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -86,11 +86,11 @@ jobs: CXX: g++-14 steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: archive @@ -134,11 +134,11 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: archive diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml index 74ab11025..d9675a4d8 100644 --- a/.github/workflows/s3_test.yml +++ b/.github/workflows/s3_test.yml @@ -61,7 +61,7 @@ jobs: AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Install dependencies on Ubuntu diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index 58cb21f23..f33eda1be 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dffabe8ac..973d2f437 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Install dependencies @@ -71,7 +71,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Build Iceberg @@ -88,7 +88,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up MSVC Developer Command Prompt @@ -135,11 +135,11 @@ jobs: - title: AArch64 macOS 26 runs-on: macos-26 steps: - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Install build dependencies From fc80e4bdbafcd659e4b44fb9fb8ae7960a08c2d1 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Fri, 8 May 2026 22:18:40 +0800 Subject: [PATCH 024/151] feat(io): add streaming FileIO support (#641) Introduce InputFile/OutputFile stream APIs and Arrow IO adapters so bundled Avro/Parquet readers and writers can work with generic FileIO implementations. --- example/demo_example.cc | 2 +- src/iceberg/CMakeLists.txt | 5 +- src/iceberg/arrow/arrow_fs_file_io.cc | 108 ---- src/iceberg/arrow/arrow_io.cc | 590 ++++++++++++++++++ ...file_io_internal.h => arrow_io_internal.h} | 44 +- ...le_io_register.cc => arrow_io_register.cc} | 4 +- ...file_io_register.h => arrow_io_register.h} | 2 +- .../{arrow_file_io.h => arrow_io_util.h} | 0 src/iceberg/arrow/s3/arrow_s3_file_io.cc | 4 +- src/iceberg/avro/avro_reader.cc | 12 +- src/iceberg/avro/avro_writer.cc | 7 +- src/iceberg/file_io.cc | 103 +++ src/iceberg/file_io.h | 105 +++- src/iceberg/file_reader.h | 4 +- src/iceberg/file_writer.h | 4 +- src/iceberg/meson.build | 1 + src/iceberg/parquet/parquet_reader.cc | 12 +- src/iceberg/parquet/parquet_writer.cc | 7 +- src/iceberg/test/CMakeLists.txt | 2 +- src/iceberg/test/arrow_fs_file_io_test.cc | 67 -- src/iceberg/test/arrow_io_test.cc | 486 +++++++++++++++ src/iceberg/test/arrow_s3_file_io_test.cc | 2 +- src/iceberg/test/avro_test.cc | 18 +- src/iceberg/test/data_writer_test.cc | 2 +- src/iceberg/test/delete_file_index_test.cc | 2 +- src/iceberg/test/delete_loader_test.cc | 2 +- src/iceberg/test/file_scan_task_test.cc | 43 +- src/iceberg/test/gzip_decompress_test.cc | 8 +- src/iceberg/test/in_memory_catalog_test.cc | 2 +- src/iceberg/test/manifest_group_test.cc | 2 +- .../test/manifest_list_versions_test.cc | 2 +- .../test/manifest_reader_stats_test.cc | 2 +- src/iceberg/test/manifest_reader_test.cc | 2 +- .../test/manifest_writer_versions_test.cc | 2 +- src/iceberg/test/metadata_io_test.cc | 2 +- src/iceberg/test/parquet_test.cc | 44 +- .../test/rolling_manifest_writer_test.cc | 2 +- src/iceberg/test/scan_test_base.h | 2 +- src/iceberg/test/std_io.h | 299 +++++++-- src/iceberg/test/update_location_test.cc | 2 +- .../test/update_partition_spec_test.cc | 2 +- src/iceberg/test/update_test_base.h | 2 +- 42 files changed, 1700 insertions(+), 313 deletions(-) delete mode 100644 src/iceberg/arrow/arrow_fs_file_io.cc create mode 100644 src/iceberg/arrow/arrow_io.cc rename src/iceberg/arrow/{arrow_fs_file_io_internal.h => arrow_io_internal.h} (50%) rename src/iceberg/arrow/{file_io_register.cc => arrow_io_register.cc} (95%) rename src/iceberg/arrow/{file_io_register.h => arrow_io_register.h} (96%) rename src/iceberg/arrow/{arrow_file_io.h => arrow_io_util.h} (100%) create mode 100644 src/iceberg/file_io.cc delete mode 100644 src/iceberg/test/arrow_fs_file_io_test.cc create mode 100644 src/iceberg/test/arrow_io_test.cc diff --git a/example/demo_example.cc b/example/demo_example.cc index 6869aa37e..3c8745be2 100644 --- a/example/demo_example.cc +++ b/example/demo_example.cc @@ -19,7 +19,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/catalog/memory/in_memory_catalog.h" #include "iceberg/manifest/manifest_entry.h" diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 02099f6b8..c4e193b89 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -36,6 +36,7 @@ set(ICEBERG_SOURCES expression/rewrite_not.cc expression/strict_metrics_evaluator.cc expression/term.cc + file_io.cc file_io_registry.cc file_reader.cc file_writer.cc @@ -218,9 +219,9 @@ add_subdirectory(util) if(ICEBERG_BUILD_BUNDLE) set(ICEBERG_BUNDLE_SOURCES - arrow/arrow_fs_file_io.cc + arrow/arrow_io.cc arrow/s3/arrow_s3_file_io.cc - arrow/file_io_register.cc + arrow/arrow_io_register.cc arrow/metadata_column_util.cc avro/avro_data_util.cc avro/avro_direct_decoder.cc diff --git a/src/iceberg/arrow/arrow_fs_file_io.cc b/src/iceberg/arrow/arrow_fs_file_io.cc deleted file mode 100644 index 769fcfb13..000000000 --- a/src/iceberg/arrow/arrow_fs_file_io.cc +++ /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. - */ - -#include - -#include -#include - -#include "iceberg/arrow/arrow_file_io.h" -#include "iceberg/arrow/arrow_fs_file_io_internal.h" -#include "iceberg/arrow/arrow_status_internal.h" -#include "iceberg/util/macros.h" - -namespace iceberg::arrow { - -Result ArrowFileSystemFileIO::ResolvePath(const std::string& file_location) { - if (file_location.find("://") != std::string::npos) { - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto path, arrow_fs_->PathFromUri(file_location)); - return path; - } - return file_location; -} - -/// \brief Read the content of the file at the given location. -Result ArrowFileSystemFileIO::ReadFile(const std::string& file_location, - std::optional length) { - ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); - ::arrow::fs::FileInfo file_info(path); - if (length.has_value()) { - file_info.set_size(length.value()); - } - std::string content; - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file, arrow_fs_->OpenInputFile(file_info)); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file_size, file->GetSize()); - - content.resize(file_size); - size_t remain = file_size; - size_t offset = 0; - while (remain > 0) { - size_t read_length = std::min(remain, static_cast(1024 * 1024)); - ICEBERG_ARROW_ASSIGN_OR_RETURN( - auto read_bytes, - file->Read(read_length, reinterpret_cast(&content[offset]))); - if (read_bytes == 0) { - return IOError("Unexpected EOF reading {}: got {} of {} bytes", file_location, - offset, file_size); - } - remain -= read_bytes; - offset += read_bytes; - } - - return content; -} - -/// \brief Write the given content to the file at the given location. -Status ArrowFileSystemFileIO::WriteFile(const std::string& file_location, - std::string_view content) { - ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file, arrow_fs_->OpenOutputStream(path)); - ICEBERG_ARROW_RETURN_NOT_OK(file->Write(content.data(), content.size())); - ICEBERG_ARROW_RETURN_NOT_OK(file->Flush()); - ICEBERG_ARROW_RETURN_NOT_OK(file->Close()); - return {}; -} - -/// \brief Delete a file at the given location. -Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) { - ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); - ICEBERG_ARROW_RETURN_NOT_OK(arrow_fs_->DeleteFile(path)); - return {}; -} - -std::unique_ptr ArrowFileSystemFileIO::MakeMockFileIO() { - return std::make_unique( - std::make_shared<::arrow::fs::internal::MockFileSystem>( - std::chrono::system_clock::now())); -} - -std::unique_ptr ArrowFileSystemFileIO::MakeLocalFileIO() { - return std::make_unique( - std::make_shared<::arrow::fs::LocalFileSystem>()); -} - -std::unique_ptr MakeMockFileIO() { - return ArrowFileSystemFileIO::MakeMockFileIO(); -} - -std::unique_ptr MakeLocalFileIO() { - return ArrowFileSystemFileIO::MakeLocalFileIO(); -} - -} // namespace iceberg::arrow diff --git a/src/iceberg/arrow/arrow_io.cc b/src/iceberg/arrow/arrow_io.cc new file mode 100644 index 000000000..a515f3385 --- /dev/null +++ b/src/iceberg/arrow/arrow_io.cc @@ -0,0 +1,590 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/arrow/arrow_io_util.h" +#include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/util/macros.h" + +namespace iceberg::arrow { + +namespace { + +Result ToInt64Length(size_t length) { + if (length > static_cast(std::numeric_limits::max())) { + return InvalidArgument("File length {} exceeds int64_t max", length); + } + return static_cast(length); +} + +::arrow::Status ToArrowStatus(const Error& error) { + switch (error.kind) { + case ErrorKind::kInvalid: + case ErrorKind::kInvalidArgument: + return ::arrow::Status::Invalid(error.message); + case ErrorKind::kNotImplemented: + case ErrorKind::kNotSupported: + return ::arrow::Status::NotImplemented(error.message); + default: + return ::arrow::Status::IOError(error.message); + } +} + +::arrow::Result BytesToReadAt(int64_t position, int64_t nbytes, int64_t size) { + if (position < 0 || nbytes < 0) { + return ::arrow::Status::Invalid("ReadAt position and length must be non-negative"); + } + if (position > size) { + return ::arrow::Status::IOError("Read out of bounds (offset = ", position, + ", size = ", nbytes, ") in file of size ", size); + } + return std::min(nbytes, size - position); +} + +/// Adapts the generic Iceberg input stream API to Arrow's RandomAccessFile API. +/// +/// Avro and Parquet readers in the bundle layer consume Arrow IO streams. This +/// fallback keeps those readers usable with non-Arrow FileIO implementations without +/// exposing Arrow filesystem details through the generic FileIO interface. +class InputStreamAdapter : public ::arrow::io::RandomAccessFile { + public: + InputStreamAdapter(std::unique_ptr input, int64_t size) + : input_(std::move(input)), size_(size) { + RandomAccessFile::set_mode(::arrow::io::FileMode::READ); + } + + ::arrow::Status Close() override { + std::lock_guard lock(mutex_); + if (closed_) { + return ::arrow::Status::OK(); + } + auto status = input_->Close(); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + closed_ = true; + return ::arrow::Status::OK(); + } + + ::arrow::Result Tell() const override { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + auto position = input_->Position(); + if (!position.has_value()) { + return ToArrowStatus(position.error()); + } + if (position.value() < 0) { + return ::arrow::Status::IOError("FileIO input stream returned negative position"); + } + return position.value(); + } + + bool closed() const override { + std::lock_guard lock(mutex_); + return closed_; + } + + ::arrow::Status Seek(int64_t position) override { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + auto status = input_->Seek(position); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + return ::arrow::Status::OK(); + } + + ::arrow::Result Read(int64_t nbytes, void* out) override { + if (nbytes < 0) { + return ::arrow::Status::Invalid("Cannot read a negative number of bytes"); + } + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + if (nbytes == 0) { + return 0; + } + auto data = reinterpret_cast(out); + auto result = input_->Read(std::span(data, static_cast(nbytes))); + if (!result.has_value()) { + return ToArrowStatus(result.error()); + } + if (result.value() < 0 || result.value() > nbytes) { + return ::arrow::Status::IOError("FileIO input stream returned invalid byte count"); + } + return result.value(); + } + + ::arrow::Result> Read(int64_t nbytes) override { + if (nbytes < 0) { + return ::arrow::Status::Invalid("Cannot read a negative number of bytes"); + } + ARROW_ASSIGN_OR_RAISE(auto buffer, ::arrow::AllocateResizableBuffer(nbytes)); + ARROW_ASSIGN_OR_RAISE(auto bytes_read, Read(nbytes, buffer->mutable_data())); + ARROW_RETURN_NOT_OK(buffer->Resize(bytes_read, /*shrink_to_fit=*/false)); + return std::shared_ptr<::arrow::Buffer>(std::move(buffer)); + } + + ::arrow::Result GetSize() override { return size_; } + + ::arrow::Result ReadAt(int64_t position, int64_t nbytes, void* out) override { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + ARROW_ASSIGN_OR_RAISE(auto bytes_to_read, BytesToReadAt(position, nbytes, size_)); + if (bytes_to_read == 0) { + return 0; + } + auto data = reinterpret_cast(out); + auto status = + input_->ReadFully(position, std::span(data, static_cast(bytes_to_read))); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + return bytes_to_read; + } + + ::arrow::Result> ReadAt(int64_t position, + int64_t nbytes) override { + { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + } + ARROW_ASSIGN_OR_RAISE(auto bytes_to_read, BytesToReadAt(position, nbytes, size_)); + ARROW_ASSIGN_OR_RAISE(auto buffer, ::arrow::AllocateResizableBuffer(bytes_to_read)); + if (bytes_to_read == 0) { + return std::shared_ptr<::arrow::Buffer>(std::move(buffer)); + } + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + auto status = input_->ReadFully( + position, std::span(reinterpret_cast(buffer->mutable_data()), + static_cast(bytes_to_read))); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + return std::shared_ptr<::arrow::Buffer>(std::move(buffer)); + } + + private: + ::arrow::Status CheckOpenLocked() const { + if (closed_) { + return ::arrow::Status::IOError("Operation on closed FileIO input stream"); + } + return ::arrow::Status::OK(); + } + + std::unique_ptr input_; + int64_t size_; + bool closed_ = false; + mutable std::mutex mutex_; +}; + +/// Adapts the generic Iceberg output stream API to Arrow's OutputStream API. +/// +/// Avro and Parquet writers in the bundle layer consume Arrow IO streams. This +/// fallback keeps those writers usable with non-Arrow FileIO implementations without +/// requiring them to downcast to ArrowFileSystemFileIO. +class OutputStreamAdapter : public ::arrow::io::OutputStream { + public: + explicit OutputStreamAdapter(std::unique_ptr output) + : output_(std::move(output)) { + OutputStream::set_mode(::arrow::io::FileMode::WRITE); + } + + ::arrow::Status Close() override { + std::lock_guard lock(mutex_); + if (closed_) { + return ::arrow::Status::OK(); + } + auto status = output_->Close(); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + closed_ = true; + return ::arrow::Status::OK(); + } + + ::arrow::Result Tell() const override { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + auto position = output_->Position(); + if (!position.has_value()) { + return ToArrowStatus(position.error()); + } + if (position.value() < 0) { + return ::arrow::Status::IOError("FileIO output stream returned negative position"); + } + return position.value(); + } + + bool closed() const override { + std::lock_guard lock(mutex_); + return closed_; + } + + ::arrow::Status Write(const void* data, int64_t nbytes) override { + if (nbytes < 0) { + return ::arrow::Status::Invalid("Cannot write a negative number of bytes"); + } + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + if (nbytes == 0) { + return ::arrow::Status::OK(); + } + auto status = output_->Write( + std::span(reinterpret_cast(data), static_cast(nbytes))); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + return ::arrow::Status::OK(); + } + + ::arrow::Status Flush() override { + std::lock_guard lock(mutex_); + ARROW_RETURN_NOT_OK(CheckOpenLocked()); + auto status = output_->Flush(); + if (!status.has_value()) { + return ToArrowStatus(status.error()); + } + return ::arrow::Status::OK(); + } + + private: + ::arrow::Status CheckOpenLocked() const { + if (closed_) { + return ::arrow::Status::IOError("Operation on closed FileIO output stream"); + } + return ::arrow::Status::OK(); + } + + std::unique_ptr output_; + bool closed_ = false; + mutable std::mutex mutex_; +}; + +class ArrowSeekableInputStream : public SeekableInputStream { + public: + explicit ArrowSeekableInputStream(std::shared_ptr<::arrow::io::RandomAccessFile> input) + : input_(std::move(input)) {} + + Result Position() const override { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto position, input_->Tell()); + return position; + } + + Status Seek(int64_t position) override { + ICEBERG_ARROW_RETURN_NOT_OK(input_->Seek(position)); + return {}; + } + + Result Read(std::span out) override { + ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(out.size())); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto bytes_read, input_->Read(size, out.data())); + if (bytes_read < 0 || bytes_read > size) { + return IOError("Arrow input stream returned invalid byte count"); + } + return bytes_read; + } + + Status ReadFully(int64_t position, std::span out) override { + if (position < 0) { + return InvalidArgument("Cannot read from negative position {}", position); + } + ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(out.size())); + if (size == 0) { + return {}; + } + if (position > std::numeric_limits::max() - size) { + return InvalidArgument( + "Read range starting at {} with length {} exceeds int64_t max", position, size); + } + + Status read_status = {}; + int64_t bytes_read = 0; + while (bytes_read < size) { + auto* data = out.data() + bytes_read; + auto remaining = size - bytes_read; + auto read_result = input_->ReadAt(position + bytes_read, remaining, data); + if (!read_result.ok()) { + read_status = + std::unexpected{{.kind = ToErrorKind(read_result.status()), + .message = read_result.status().ToString()}}; + break; + } + auto read = read_result.ValueOrDie(); + if (read < 0 || read > remaining) { + read_status = IOError("Arrow input stream returned invalid byte count"); + break; + } + if (read == 0) { + read_status = + IOError("Unexpected EOF reading at offset {}", position + bytes_read); + break; + } + bytes_read += read; + } + return read_status; + } + + Status Close() override { + if (input_->closed()) { + return {}; + } + ICEBERG_ARROW_RETURN_NOT_OK(input_->Close()); + return {}; + } + + private: + std::shared_ptr<::arrow::io::RandomAccessFile> input_; +}; + +class ArrowPositionOutputStream : public PositionOutputStream { + public: + explicit ArrowPositionOutputStream(std::shared_ptr<::arrow::io::OutputStream> output) + : output_(std::move(output)) {} + + Result Position() const override { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto position, output_->Tell()); + return position; + } + + Status Write(std::span data) override { + ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(data.size())); + ICEBERG_ARROW_RETURN_NOT_OK(output_->Write(data.data(), size)); + return {}; + } + + Status Flush() override { + ICEBERG_ARROW_RETURN_NOT_OK(output_->Flush()); + return {}; + } + + Status Close() override { + if (output_->closed()) { + return {}; + } + ICEBERG_ARROW_RETURN_NOT_OK(output_->Close()); + return {}; + } + + private: + std::shared_ptr<::arrow::io::OutputStream> output_; +}; + +class ArrowInputFile : public InputFile { + public: + ArrowInputFile(std::shared_ptr<::arrow::fs::FileSystem> fs, std::string location, + std::string path, std::optional file_size) + : fs_(std::move(fs)), + location_(std::move(location)), + path_(std::move(path)), + file_size_(file_size) {} + + std::string_view location() const override { return location_; } + + Result Size() const override { + if (file_size_.has_value()) { + return *file_size_; + } + ::arrow::fs::FileInfo file_info(path_, ::arrow::fs::FileType::File); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto input, fs_->OpenInputFile(file_info)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto size, input->GetSize()); + return size; + } + + Result> Open() override { + ::arrow::fs::FileInfo file_info(path_, ::arrow::fs::FileType::File); + if (file_size_.has_value()) { + file_info.set_size(*file_size_); + } + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto input, fs_->OpenInputFile(file_info)); + return std::make_unique(std::move(input)); + } + + private: + std::shared_ptr<::arrow::fs::FileSystem> fs_; + std::string location_; + std::string path_; + std::optional file_size_; +}; + +class ArrowOutputFile : public OutputFile { + public: + ArrowOutputFile(std::shared_ptr<::arrow::fs::FileSystem> fs, std::string location, + std::string path) + : fs_(std::move(fs)), location_(std::move(location)), path_(std::move(path)) {} + + std::string_view location() const override { return location_; } + + Result> Create() override { + return Create(/*overwrite=*/false); + } + + Result> CreateOrOverwrite() override { + return Create(/*overwrite=*/true); + } + + private: + Result> Create(bool overwrite) { + if (!overwrite) { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto info, fs_->GetFileInfo(path_)); + if (info.type() != ::arrow::fs::FileType::NotFound) { + return AlreadyExists("File already exists: {}", location_); + } + } + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto output, fs_->OpenOutputStream(path_)); + return std::make_unique(std::move(output)); + } + + std::shared_ptr<::arrow::fs::FileSystem> fs_; + std::string location_; + std::string path_; +}; + +} // namespace + +Result ArrowFileSystemFileIO::ResolvePath(const std::string& file_location) { + if (file_location.find("://") != std::string::npos) { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto path, arrow_fs_->PathFromUri(file_location)); + return path; + } + return file_location; +} + +Result> OpenArrowInputStream( + const std::shared_ptr& io, const std::string& path, + std::optional length) { + ICEBERG_PRECHECK(io != nullptr, "FileIO cannot be null"); + + if (auto arrow_io = std::dynamic_pointer_cast(io)) { + ICEBERG_ASSIGN_OR_RAISE(auto resolved_path, arrow_io->ResolvePath(path)); + ::arrow::fs::FileInfo file_info(resolved_path, ::arrow::fs::FileType::File); + if (length.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(*length)); + file_info.set_size(size); + } + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto input, + arrow_io->arrow_fs_->OpenInputFile(file_info)); + return input; + } + + int64_t size; + std::unique_ptr input_file; + if (length.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(input_file, io->NewInputFile(path, *length)); + } else { + ICEBERG_ASSIGN_OR_RAISE(input_file, io->NewInputFile(path)); + } + ICEBERG_ASSIGN_OR_RAISE(size, input_file->Size()); + if (size < 0) { + return Invalid("Invalid negative file size {} for {}", size, path); + } + ICEBERG_ASSIGN_OR_RAISE(auto input, input_file->Open()); + return std::make_shared(std::move(input), size); +} + +Result> OpenArrowOutputStream( + const std::shared_ptr& io, const std::string& path, bool overwrite) { + ICEBERG_PRECHECK(io != nullptr, "FileIO cannot be null"); + + if (auto arrow_io = std::dynamic_pointer_cast(io)) { + ICEBERG_ASSIGN_OR_RAISE(auto resolved_path, arrow_io->ResolvePath(path)); + if (!overwrite) { + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto info, + arrow_io->arrow_fs_->GetFileInfo(resolved_path)); + if (info.type() != ::arrow::fs::FileType::NotFound) { + return AlreadyExists("File already exists: {}", path); + } + } + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto output, + arrow_io->arrow_fs_->OpenOutputStream(resolved_path)); + return output; + } + + ICEBERG_ASSIGN_OR_RAISE(auto output_file, io->NewOutputFile(path)); + std::unique_ptr output; + if (overwrite) { + ICEBERG_ASSIGN_OR_RAISE(output, output_file->CreateOrOverwrite()); + } else { + ICEBERG_ASSIGN_OR_RAISE(output, output_file->Create()); + } + return std::make_shared(std::move(output)); +} + +Result> ArrowFileSystemFileIO::NewInputFile( + std::string file_location) { + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + return std::make_unique(arrow_fs_, std::move(file_location), + std::move(path), std::nullopt); +} + +Result> ArrowFileSystemFileIO::NewInputFile( + std::string file_location, size_t length) { + ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(length)); + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + return std::make_unique(arrow_fs_, std::move(file_location), + std::move(path), size); +} + +Result> ArrowFileSystemFileIO::NewOutputFile( + std::string file_location) { + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + return std::make_unique(arrow_fs_, std::move(file_location), + std::move(path)); +} + +/// \brief Delete a file at the given location. +Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) { + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + ICEBERG_ARROW_RETURN_NOT_OK(arrow_fs_->DeleteFile(path)); + return {}; +} + +std::unique_ptr ArrowFileSystemFileIO::MakeMockFileIO() { + return std::make_unique( + std::make_shared<::arrow::fs::internal::MockFileSystem>( + std::chrono::system_clock::now())); +} + +std::unique_ptr ArrowFileSystemFileIO::MakeLocalFileIO() { + return std::make_unique( + std::make_shared<::arrow::fs::LocalFileSystem>()); +} + +std::unique_ptr MakeMockFileIO() { + return ArrowFileSystemFileIO::MakeMockFileIO(); +} + +std::unique_ptr MakeLocalFileIO() { + return ArrowFileSystemFileIO::MakeLocalFileIO(); +} + +} // namespace iceberg::arrow diff --git a/src/iceberg/arrow/arrow_fs_file_io_internal.h b/src/iceberg/arrow/arrow_io_internal.h similarity index 50% rename from src/iceberg/arrow/arrow_fs_file_io_internal.h rename to src/iceberg/arrow/arrow_io_internal.h index 92a991501..4f170a8a4 100644 --- a/src/iceberg/arrow/arrow_fs_file_io_internal.h +++ b/src/iceberg/arrow/arrow_io_internal.h @@ -19,15 +19,37 @@ #pragma once +#include #include +#include +#include -#include +#include +#include #include "iceberg/file_io.h" #include "iceberg/iceberg_bundle_export.h" namespace iceberg::arrow { +/// \brief Open a FileIO input as an Arrow input stream. +/// +/// Uses ArrowFileSystemFileIO's native Arrow stream directly when possible and falls +/// back to a FileIO stream adapter otherwise. The fallback requires FileIO to +/// implement NewInputFile. +ICEBERG_BUNDLE_EXPORT Result> +OpenArrowInputStream(const std::shared_ptr& io, const std::string& path, + std::optional length = std::nullopt); + +/// \brief Open a FileIO output as an Arrow output stream. +/// +/// Uses ArrowFileSystemFileIO's native Arrow stream directly when possible and falls +/// back to a FileIO stream adapter otherwise. The fallback requires FileIO to +/// implement NewOutputFile. +ICEBERG_BUNDLE_EXPORT Result> +OpenArrowOutputStream(const std::shared_ptr& io, const std::string& path, + bool overwrite = true); + /// \brief A concrete implementation of FileIO for Arrow file system. class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO { public: @@ -42,12 +64,15 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO { ~ArrowFileSystemFileIO() override = default; - /// \brief Read the content of the file at the given location. - Result ReadFile(const std::string& file_location, - std::optional length) override; + /// \brief Create an input file handle for the given location. + Result> NewInputFile(std::string file_location) override; + + /// \brief Create an input file handle for the given location with a known length. + Result> NewInputFile(std::string file_location, + size_t length) override; - /// \brief Write the given content to the file at the given location. - Status WriteFile(const std::string& file_location, std::string_view content) override; + /// \brief Create an output file handle for the given location. + Result> NewOutputFile(std::string file_location) override; /// \brief Delete a file at the given location. Status DeleteFile(const std::string& file_location) override; @@ -56,6 +81,13 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO { const std::shared_ptr<::arrow::fs::FileSystem>& fs() const { return arrow_fs_; } private: + friend Result> OpenArrowInputStream( + const std::shared_ptr& io, const std::string& path, + std::optional length); + + friend Result> OpenArrowOutputStream( + const std::shared_ptr& io, const std::string& path, bool overwrite); + /// \brief Resolve a file location to a filesystem path. Result ResolvePath(const std::string& file_location); diff --git a/src/iceberg/arrow/file_io_register.cc b/src/iceberg/arrow/arrow_io_register.cc similarity index 95% rename from src/iceberg/arrow/file_io_register.cc rename to src/iceberg/arrow/arrow_io_register.cc index 1140e49b8..43273c0ae 100644 --- a/src/iceberg/arrow/file_io_register.cc +++ b/src/iceberg/arrow/arrow_io_register.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include "iceberg/arrow/file_io_register.h" +#include "iceberg/arrow/arrow_io_register.h" #include #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/file_io_registry.h" namespace iceberg::arrow { diff --git a/src/iceberg/arrow/file_io_register.h b/src/iceberg/arrow/arrow_io_register.h similarity index 96% rename from src/iceberg/arrow/file_io_register.h rename to src/iceberg/arrow/arrow_io_register.h index 1b4622bd7..f28b7a565 100644 --- a/src/iceberg/arrow/file_io_register.h +++ b/src/iceberg/arrow/arrow_io_register.h @@ -19,7 +19,7 @@ #pragma once -/// \file iceberg/arrow/file_io_register.h +/// \file iceberg/arrow/arrow_io_register.h /// \brief Provide functions to register Arrow FileIO implementations. #include "iceberg/iceberg_bundle_export.h" diff --git a/src/iceberg/arrow/arrow_file_io.h b/src/iceberg/arrow/arrow_io_util.h similarity index 100% rename from src/iceberg/arrow/arrow_file_io.h rename to src/iceberg/arrow/arrow_io_util.h diff --git a/src/iceberg/arrow/s3/arrow_s3_file_io.cc b/src/iceberg/arrow/s3/arrow_s3_file_io.cc index 808415d0a..cffd95840 100644 --- a/src/iceberg/arrow/s3/arrow_s3_file_io.cc +++ b/src/iceberg/arrow/s3/arrow_s3_file_io.cc @@ -27,8 +27,8 @@ # include #endif -#include "iceberg/arrow/arrow_file_io.h" -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/arrow/s3/s3_properties.h" #include "iceberg/util/macros.h" diff --git a/src/iceberg/avro/avro_reader.cc b/src/iceberg/avro/avro_reader.cc index f4985d9ac..1d431c46b 100644 --- a/src/iceberg/avro/avro_reader.cc +++ b/src/iceberg/avro/avro_reader.cc @@ -31,7 +31,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/arrow/metadata_column_util_internal.h" #include "iceberg/avro/avro_data_util_internal.h" @@ -42,7 +42,6 @@ #include "iceberg/metadata_columns.h" #include "iceberg/name_mapping.h" #include "iceberg/schema_internal.h" -#include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" namespace iceberg::avro { @@ -51,13 +50,8 @@ namespace { Result> CreateInputStream(const ReaderOptions& options, int64_t buffer_size) { - ::arrow::fs::FileInfo file_info(options.path, ::arrow::fs::FileType::File); - if (options.length) { - file_info.set_size(options.length.value()); - } - - auto io = internal::checked_pointer_cast(options.io); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto file, io->fs()->OpenInputFile(file_info)); + ICEBERG_ASSIGN_OR_RAISE( + auto file, arrow::OpenArrowInputStream(options.io, options.path, options.length)); return std::make_unique(file, buffer_size); } diff --git a/src/iceberg/avro/avro_writer.cc b/src/iceberg/avro/avro_writer.cc index 32ce3f634..63fc31462 100644 --- a/src/iceberg/avro/avro_writer.cc +++ b/src/iceberg/avro/avro_writer.cc @@ -29,7 +29,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/avro/avro_data_util_internal.h" #include "iceberg/avro/avro_direct_encoder_internal.h" @@ -40,7 +40,6 @@ #include "iceberg/metrics_config.h" #include "iceberg/schema.h" #include "iceberg/schema_internal.h" -#include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" namespace iceberg::avro { @@ -49,8 +48,8 @@ namespace { Result> CreateOutputStream(const WriterOptions& options, int64_t buffer_size) { - auto io = internal::checked_pointer_cast(options.io); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto output, io->fs()->OpenOutputStream(options.path)); + ICEBERG_ASSIGN_OR_RAISE(auto output, + arrow::OpenArrowOutputStream(options.io, options.path)); return std::make_unique(output, buffer_size); } diff --git a/src/iceberg/file_io.cc b/src/iceberg/file_io.cc new file mode 100644 index 000000000..d76ffeb60 --- /dev/null +++ b/src/iceberg/file_io.cc @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/file_io.h" + +#include +#include + +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +Status FinishWithCloseStatus(Status operation_status, Status close_status) { + if (!operation_status.has_value()) { + auto error = operation_status.error(); + if (!close_status.has_value()) { + error.message += "; additionally failed to close stream: "; + error.message += close_status.error().message; + } + return std::unexpected(std::move(error)); + } + return close_status; +} + +} // namespace + +Result> FileIO::NewInputFile(std::string file_location) { + return NotImplemented("NewInputFile not implemented for {}", file_location); +} + +Result> FileIO::NewInputFile(std::string file_location, + size_t /*length*/) { + return NewInputFile(std::move(file_location)); +} + +Result> FileIO::NewOutputFile(std::string file_location) { + return NotImplemented("NewOutputFile not implemented for {}", file_location); +} + +Result FileIO::ReadFile(const std::string& file_location, + std::optional length) { + int64_t read_size; + std::unique_ptr input_file; + if (length.has_value()) { + if (*length > static_cast(std::numeric_limits::max())) { + return InvalidArgument("Requested read length {} exceeds int64_t max", *length); + } + ICEBERG_ASSIGN_OR_RAISE(input_file, NewInputFile(file_location, *length)); + read_size = static_cast(*length); + } else { + ICEBERG_ASSIGN_OR_RAISE(input_file, NewInputFile(file_location)); + ICEBERG_ASSIGN_OR_RAISE(read_size, input_file->Size()); + } + if (read_size < 0) { + return Invalid("Invalid negative file size {} for {}", read_size, file_location); + } + + auto size = static_cast(read_size); + std::string content(size, '\0'); + ICEBERG_ASSIGN_OR_RAISE(auto stream, input_file->Open()); + Status read_status = {}; + if (size > 0) { + auto bytes = std::as_writable_bytes(std::span(content.data(), content.size())); + read_status = stream->ReadFully(/*position=*/0, bytes); + } + ICEBERG_RETURN_UNEXPECTED( + FinishWithCloseStatus(std::move(read_status), stream->Close())); + return content; +} + +Status FileIO::WriteFile(const std::string& file_location, std::string_view content) { + ICEBERG_ASSIGN_OR_RAISE(auto output_file, NewOutputFile(file_location)); + ICEBERG_ASSIGN_OR_RAISE(auto stream, output_file->CreateOrOverwrite()); + Status status = {}; + if (!content.empty()) { + auto bytes = std::as_bytes(std::span(content.data(), content.size())); + status = stream->Write(bytes); + } + if (status.has_value()) { + status = stream->Flush(); + } + return FinishWithCloseStatus(std::move(status), stream->Close()); +} + +} // namespace iceberg diff --git a/src/iceberg/file_io.h b/src/iceberg/file_io.h index 259da7556..e772b5336 100644 --- a/src/iceberg/file_io.h +++ b/src/iceberg/file_io.h @@ -19,7 +19,11 @@ #pragma once +#include +#include +#include #include +#include #include #include @@ -28,11 +32,82 @@ namespace iceberg { +/// \brief Seekable byte stream for reading file contents. +class ICEBERG_EXPORT SeekableInputStream { + public: + virtual ~SeekableInputStream() = default; + + /// \brief Return the current read position. + virtual Result Position() const = 0; + + /// \brief Seek to an absolute byte position. + virtual Status Seek(int64_t position) = 0; + + /// \brief Read up to out.size() bytes from the current position. + virtual Result Read(std::span out) = 0; + + /// \brief Read exactly out.size() bytes from an absolute position. + /// + /// Fails if fewer than out.size() bytes are available. The current stream position + /// after this call is unspecified; callers should Seek before subsequent + /// position-dependent reads. + virtual Status ReadFully(int64_t position, std::span out) = 0; + + /// \brief Close the stream. Implementations should allow repeated Close calls. + virtual Status Close() = 0; +}; + +/// \brief Positioned byte stream for writing file contents. +class ICEBERG_EXPORT PositionOutputStream { + public: + virtual ~PositionOutputStream() = default; + + /// \brief Return the current write position. + virtual Result Position() const = 0; + + /// \brief Write all bytes in data at the current position. + virtual Status Write(std::span data) = 0; + + /// \brief Flush buffered data to the underlying store. + virtual Status Flush() = 0; + + /// \brief Close the stream. Implementations should allow repeated Close calls. + virtual Status Close() = 0; +}; + +/// \brief Handle for opening a readable file. +class ICEBERG_EXPORT InputFile { + public: + virtual ~InputFile() = default; + + /// \brief File location represented by this handle. + virtual std::string_view location() const = 0; + + /// \brief Return the total file size in bytes. + virtual Result Size() const = 0; + + /// \brief Open a new independent input stream. + virtual Result> Open() = 0; +}; + +/// \brief Handle for creating a writable file. +class ICEBERG_EXPORT OutputFile { + public: + virtual ~OutputFile() = default; + + /// \brief File location represented by this handle. + virtual std::string_view location() const = 0; + + /// \brief Create a new output stream and fail if the file already exists. + virtual Result> Create() = 0; + + /// \brief Create a new output stream, replacing any existing file. + virtual Result> CreateOrOverwrite() = 0; +}; + /// \brief Pluggable module for reading, writing, and deleting files. /// -/// This module only handle metadata files, not data files. The metadata files -/// are typically small and are used to store schema, partition information, -/// and other metadata about the table. +/// This module handles metadata and data file bytes for table IO. /// /// Note that these functions are not atomic. For example, if a write fails, /// the file may be partially written. Implementations should be careful to @@ -42,6 +117,19 @@ class ICEBERG_EXPORT FileIO { FileIO() = default; virtual ~FileIO() = default; + /// \brief Create an input file handle for the given location. + virtual Result> NewInputFile(std::string file_location); + + /// \brief Create an input file handle for the given location with a known length. + /// + /// The length is a caller-provided content length hint. Implementations may use it to + /// avoid an extra metadata lookup. + virtual Result> NewInputFile(std::string file_location, + size_t length); + + /// \brief Create an output file handle for the given location. + virtual Result> NewOutputFile(std::string file_location); + /// \brief Read the content of the file at the given location. /// /// \param file_location The location of the file to read. @@ -50,21 +138,14 @@ class ICEBERG_EXPORT FileIO { /// \return The content of the file if the read succeeded, an error code if the read /// failed. virtual Result ReadFile(const std::string& file_location, - std::optional length) { - // We provide a default implementation to avoid Windows linker error LNK2019. - return NotImplemented("ReadFile not implemented"); - } + std::optional length); /// \brief Write the given content to the file at the given location. /// /// \param file_location The location of the file to write. /// \param content The content to write to the file. - /// \param overwrite If true, overwrite the file if it exists. If false, fail if the - /// file exists. /// \return void if the write succeeded, an error code if the write failed. - virtual Status WriteFile(const std::string& file_location, std::string_view content) { - return NotImplemented("WriteFile not implemented"); - } + virtual Status WriteFile(const std::string& file_location, std::string_view content); /// \brief Delete a file at the given location. /// diff --git a/src/iceberg/file_reader.h b/src/iceberg/file_reader.h index 923ac6bdb..c31d9b292 100644 --- a/src/iceberg/file_reader.h +++ b/src/iceberg/file_reader.h @@ -95,9 +95,7 @@ struct ICEBERG_EXPORT ReaderOptions { std::optional length; /// \brief The split to read. std::optional split; - /// \brief FileIO instance to open the file. Reader implementations should down cast it - /// to the specific FileIO implementation. By default, the `iceberg-bundle` library uses - /// `ArrowFileSystemFileIO` as the default implementation. + /// \brief FileIO instance to open the file. std::shared_ptr io; /// \brief The projection schema to read from the file. This field is required. std::shared_ptr projection; diff --git a/src/iceberg/file_writer.h b/src/iceberg/file_writer.h index f3352d8fd..a49b5228e 100644 --- a/src/iceberg/file_writer.h +++ b/src/iceberg/file_writer.h @@ -73,9 +73,7 @@ struct ICEBERG_EXPORT WriterOptions { std::string path; /// \brief The schema of the data to write. std::shared_ptr schema; - /// \brief FileIO instance to open the file. Writer implementations should down cast it - /// to the specific FileIO implementation. By default, the `iceberg-bundle` library uses - /// `ArrowFileSystemFileIO` as the default implementation. + /// \brief FileIO instance to create the file. std::shared_ptr io; /// \brief Metadata to write to the file. std::unordered_map metadata; diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 41a5c2dd3..c2947f3fe 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -58,6 +58,7 @@ iceberg_sources = files( 'expression/rewrite_not.cc', 'expression/strict_metrics_evaluator.cc', 'expression/term.cc', + 'file_io.cc', 'file_io_registry.cc', 'file_reader.cc', 'file_writer.cc', diff --git a/src/iceberg/parquet/parquet_reader.cc b/src/iceberg/parquet/parquet_reader.cc index 0e2808f59..775644a94 100644 --- a/src/iceberg/parquet/parquet_reader.cc +++ b/src/iceberg/parquet/parquet_reader.cc @@ -32,7 +32,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/arrow/metadata_column_util_internal.h" #include "iceberg/parquet/parquet_data_util_internal.h" @@ -41,7 +41,6 @@ #include "iceberg/result.h" #include "iceberg/schema_internal.h" #include "iceberg/schema_util.h" -#include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" namespace iceberg::parquet { @@ -50,14 +49,7 @@ namespace { Result> OpenInputStream( const ReaderOptions& options) { - ::arrow::fs::FileInfo file_info(options.path, ::arrow::fs::FileType::File); - if (options.length) { - file_info.set_size(options.length.value()); - } - - auto io = internal::checked_pointer_cast(options.io); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto input, io->fs()->OpenInputFile(file_info)); - return input; + return arrow::OpenArrowInputStream(options.io, options.path, options.length); } Result BuildProjection(::parquet::arrow::FileReader* reader, diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index a68e9e61e..7e2d3d151 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -29,10 +29,9 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/schema_internal.h" -#include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" namespace iceberg::parquet { @@ -41,9 +40,7 @@ namespace { Result> OpenOutputStream( const WriterOptions& options) { - auto io = internal::checked_pointer_cast(options.io); - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto output, io->fs()->OpenOutputStream(options.path)); - return output; + return arrow::OpenArrowOutputStream(options.io, options.path); } Result<::arrow::Compression::type> ParseCompression(const WriterProperties& properties) { diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 6b98951ad..1d80b29a5 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -156,7 +156,7 @@ if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(arrow_test USE_BUNDLE SOURCES - arrow_fs_file_io_test.cc + arrow_io_test.cc arrow_test.cc gzip_decompress_test.cc metadata_io_test.cc diff --git a/src/iceberg/test/arrow_fs_file_io_test.cc b/src/iceberg/test/arrow_fs_file_io_test.cc deleted file mode 100644 index eacda2f75..000000000 --- a/src/iceberg/test/arrow_fs_file_io_test.cc +++ /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. - */ - -#include -#include - -#include "iceberg/arrow/arrow_fs_file_io_internal.h" -#include "iceberg/test/matchers.h" -#include "iceberg/test/temp_file_test_base.h" - -namespace iceberg { - -class LocalFileIOTest : public TempFileTestBase { - protected: - void SetUp() override { - TempFileTestBase::SetUp(); - file_io_ = std::make_shared( - std::make_shared<::arrow::fs::LocalFileSystem>()); - temp_filepath_ = CreateNewTempFilePath(); - } - - std::shared_ptr file_io_; - std::string temp_filepath_; -}; - -TEST_F(LocalFileIOTest, ReadWriteFile) { - auto read_res = file_io_->ReadFile(temp_filepath_, std::nullopt); - EXPECT_THAT(read_res, IsError(ErrorKind::kIOError)); - EXPECT_THAT(read_res, HasErrorMessage("Failed to open local file")); - - auto write_res = file_io_->WriteFile(temp_filepath_, "hello world"); - EXPECT_THAT(write_res, IsOk()); - - read_res = file_io_->ReadFile(temp_filepath_, std::nullopt); - EXPECT_THAT(read_res, IsOk()); - EXPECT_THAT(read_res, HasValue(::testing::Eq("hello world"))); -} - -TEST_F(LocalFileIOTest, DeleteFile) { - auto write_res = file_io_->WriteFile(temp_filepath_, "hello world"); - EXPECT_THAT(write_res, IsOk()); - - auto del_res = file_io_->DeleteFile(temp_filepath_); - EXPECT_THAT(del_res, IsOk()); - - del_res = file_io_->DeleteFile(temp_filepath_); - EXPECT_THAT(del_res, IsError(ErrorKind::kIOError)); - EXPECT_THAT(del_res, HasErrorMessage("Cannot delete file")); -} - -} // namespace iceberg diff --git a/src/iceberg/test/arrow_io_test.cc b/src/iceberg/test/arrow_io_test.cc new file mode 100644 index 000000000..0c885d07a --- /dev/null +++ b/src/iceberg/test/arrow_io_test.cc @@ -0,0 +1,486 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/std_io.h" +#include "iceberg/test/temp_file_test_base.h" + +namespace iceberg { + +namespace { + +struct CloseState { + bool closed = false; +}; + +class ReadFailureInputStream : public SeekableInputStream { + public: + explicit ReadFailureInputStream(std::shared_ptr state) + : state_(std::move(state)) {} + + Result Position() const override { return 0; } + + Status Seek(int64_t /*position*/) override { return {}; } + + Result Read(std::span /*out*/) override { return 0; } + + Status ReadFully(int64_t /*position*/, std::span /*out*/) override { + return IOError("read failed"); + } + + Status Close() override { + state_->closed = true; + return IOError("close failed"); + } + + private: + std::shared_ptr state_; +}; + +class ReadFailureInputFile : public InputFile { + public: + explicit ReadFailureInputFile(std::shared_ptr state) + : state_(std::move(state)) {} + + std::string_view location() const override { return "read-failure"; } + + Result Size() const override { return 4; } + + Result> Open() override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +class ReadFailureFileIO : public FileIO { + public: + explicit ReadFailureFileIO(std::shared_ptr state) + : state_(std::move(state)) {} + + Result> NewInputFile( + std::string /*file_location*/) override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +class WriteFailureOutputStream : public PositionOutputStream { + public: + explicit WriteFailureOutputStream(std::shared_ptr state) + : state_(std::move(state)) {} + + Result Position() const override { return 0; } + + Status Write(std::span /*data*/) override { + return IOError("write failed"); + } + + Status Flush() override { return {}; } + + Status Close() override { + state_->closed = true; + return IOError("close failed"); + } + + private: + std::shared_ptr state_; +}; + +class WriteFailureOutputFile : public OutputFile { + public: + explicit WriteFailureOutputFile(std::shared_ptr state) + : state_(std::move(state)) {} + + std::string_view location() const override { return "write-failure"; } + + Result> Create() override { + return std::make_unique(state_); + } + + Result> CreateOrOverwrite() override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +class WriteFailureFileIO : public FileIO { + public: + explicit WriteFailureFileIO(std::shared_ptr state) + : state_(std::move(state)) {} + + Result> NewOutputFile( + std::string /*file_location*/) override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +struct PermissiveReadState { + std::string data; + bool closed = false; + int64_t position = 0; +}; + +class PermissiveInputStream : public SeekableInputStream { + public: + explicit PermissiveInputStream(std::shared_ptr state) + : state_(std::move(state)) {} + + Result Position() const override { return state_->position; } + + Status Seek(int64_t position) override { + if (position < 0) { + return InvalidArgument("Cannot seek to negative position {}", position); + } + state_->position = position; + return {}; + } + + Result Read(std::span out) override { + auto position = static_cast(state_->position); + if (position >= state_->data.size()) { + return 0; + } + auto bytes_to_read = std::min(out.size(), state_->data.size() - position); + std::copy_n(reinterpret_cast(state_->data.data() + position), + bytes_to_read, out.data()); + state_->position += static_cast(bytes_to_read); + return static_cast(bytes_to_read); + } + + Status ReadFully(int64_t position, std::span out) override { + if (position < 0) { + return InvalidArgument("Cannot read from negative position {}", position); + } + auto offset = static_cast(position); + if (offset > state_->data.size() || out.size() > state_->data.size() - offset) { + return IOError("Unexpected EOF"); + } + std::copy_n(reinterpret_cast(state_->data.data() + offset), + out.size(), out.data()); + return {}; + } + + Status Close() override { + state_->closed = true; + return {}; + } + + private: + std::shared_ptr state_; +}; + +class PermissiveInputFile : public InputFile { + public: + explicit PermissiveInputFile(std::shared_ptr state) + : state_(std::move(state)) {} + + std::string_view location() const override { return "permissive-input"; } + + Result Size() const override { + return static_cast(state_->data.size()); + } + + Result> Open() override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +class PermissiveInputFileIO : public FileIO { + public: + explicit PermissiveInputFileIO(std::shared_ptr state) + : state_(std::move(state)) {} + + Result> NewInputFile( + std::string /*file_location*/) override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +struct PermissiveWriteState { + std::string data; + bool closed = false; +}; + +class PermissiveOutputStream : public PositionOutputStream { + public: + explicit PermissiveOutputStream(std::shared_ptr state) + : state_(std::move(state)) {} + + Result Position() const override { + return static_cast(state_->data.size()); + } + + Status Write(std::span data) override { + state_->data.append(reinterpret_cast(data.data()), data.size()); + return {}; + } + + Status Flush() override { return {}; } + + Status Close() override { + state_->closed = true; + return {}; + } + + private: + std::shared_ptr state_; +}; + +class PermissiveOutputFile : public OutputFile { + public: + explicit PermissiveOutputFile(std::shared_ptr state) + : state_(std::move(state)) {} + + std::string_view location() const override { return "permissive-output"; } + + Result> Create() override { + return std::make_unique(state_); + } + + Result> CreateOrOverwrite() override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +class PermissiveOutputFileIO : public FileIO { + public: + explicit PermissiveOutputFileIO(std::shared_ptr state) + : state_(std::move(state)) {} + + Result> NewOutputFile( + std::string /*file_location*/) override { + return std::make_unique(state_); + } + + private: + std::shared_ptr state_; +}; + +} // namespace + +class LocalFileIOTest : public TempFileTestBase { + protected: + void SetUp() override { + TempFileTestBase::SetUp(); + file_io_ = std::make_shared( + std::make_shared<::arrow::fs::LocalFileSystem>()); + temp_filepath_ = CreateNewTempFilePath(); + } + + std::shared_ptr file_io_; + std::string temp_filepath_; +}; + +TEST_F(LocalFileIOTest, ReadWriteFile) { + auto read_res = file_io_->ReadFile(temp_filepath_, std::nullopt); + EXPECT_THAT(read_res, IsError(ErrorKind::kIOError)); + EXPECT_THAT(read_res, HasErrorMessage("Failed to open local file")); + + auto write_res = file_io_->WriteFile(temp_filepath_, "hello world"); + EXPECT_THAT(write_res, IsOk()); + + read_res = file_io_->ReadFile(temp_filepath_, std::nullopt); + EXPECT_THAT(read_res, IsOk()); + EXPECT_THAT(read_res, HasValue(::testing::Eq("hello world"))); +} + +TEST_F(LocalFileIOTest, DeleteFile) { + auto write_res = file_io_->WriteFile(temp_filepath_, "hello world"); + EXPECT_THAT(write_res, IsOk()); + + auto del_res = file_io_->DeleteFile(temp_filepath_); + EXPECT_THAT(del_res, IsOk()); + + del_res = file_io_->DeleteFile(temp_filepath_); + EXPECT_THAT(del_res, IsError(ErrorKind::kIOError)); + EXPECT_THAT(del_res, HasErrorMessage("Cannot delete file")); +} + +void VerifyReadFullyReadsFromAbsolutePosition(const std::shared_ptr& file_io, + const std::string& path) { + ASSERT_THAT(file_io->WriteFile(path, "abcdef"), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto input_file, file_io->NewInputFile(path)); + ICEBERG_UNWRAP_OR_FAIL(auto stream, input_file->Open()); + ASSERT_THAT(stream->Seek(5), IsOk()); + + std::array buffer; + ASSERT_THAT(stream->ReadFully(1, buffer), IsOk()); + + std::string data(reinterpret_cast(buffer.data()), buffer.size()); + EXPECT_EQ(data, "bc"); + + ASSERT_THAT(stream->Seek(5), IsOk()); + std::array next; + ICEBERG_UNWRAP_OR_FAIL(auto bytes_read, stream->Read(next)); + ASSERT_EQ(bytes_read, 1); + EXPECT_EQ(next[0], std::byte{'f'}); +} + +TEST_F(LocalFileIOTest, ReadFullyReadsFromAbsolutePosition) { + ASSERT_NO_FATAL_FAILURE( + VerifyReadFullyReadsFromAbsolutePosition(file_io_, temp_filepath_)); +} + +TEST_F(LocalFileIOTest, StdReadFullyReadsFromAbsolutePosition) { + auto file_io = std::make_shared(); + ASSERT_NO_FATAL_FAILURE( + VerifyReadFullyReadsFromAbsolutePosition(file_io, temp_filepath_)); +} + +TEST_F(LocalFileIOTest, StdReadKeepsPositionAvailableAtEof) { + auto file_io = std::make_shared(); + ASSERT_THAT(file_io->WriteFile(temp_filepath_, "abc"), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto input_file, file_io->NewInputFile(temp_filepath_)); + ICEBERG_UNWRAP_OR_FAIL(auto stream, input_file->Open()); + + std::array buffer; + ICEBERG_UNWRAP_OR_FAIL(auto bytes_read, stream->Read(buffer)); + EXPECT_EQ(bytes_read, 3); + EXPECT_THAT(stream->Position(), HasValue(::testing::Eq(3))); + + ICEBERG_UNWRAP_OR_FAIL(bytes_read, stream->Read(buffer)); + EXPECT_EQ(bytes_read, 0); + EXPECT_THAT(stream->Position(), HasValue(::testing::Eq(3))); +} + +TEST(FileIOAdapterTest, InputAdapterRejectsReadsAfterClose) { + auto state = std::make_shared(); + state->data = "abc"; + auto file_io = std::make_shared(state); + + ICEBERG_UNWRAP_OR_FAIL(auto input, arrow::OpenArrowInputStream(file_io, "input")); + ASSERT_TRUE(input->Close().ok()); + ASSERT_TRUE(input->Close().ok()); + ASSERT_TRUE(state->closed); + + std::array out; + auto result = input->Read(static_cast(out.size()), out.data()); + auto read_at_result = input->ReadAt(0, static_cast(out.size()), out.data()); + + EXPECT_FALSE(result.ok()); + EXPECT_THAT(result.status().ToString(), ::testing::HasSubstr("closed")); + EXPECT_FALSE(read_at_result.ok()); + EXPECT_THAT(read_at_result.status().ToString(), ::testing::HasSubstr("closed")); + EXPECT_EQ(state->position, 0); +} + +TEST(FileIOAdapterTest, InputAdapterRejectsReadAtBeyondKnownSize) { + auto state = std::make_shared(); + state->data = "abc"; + auto file_io = std::make_shared(state); + + ICEBERG_UNWRAP_OR_FAIL(auto input, arrow::OpenArrowInputStream(file_io, "input")); + + std::array out; + auto read_at_end = input->ReadAt(3, static_cast(out.size()), out.data()); + auto read_past_end = input->ReadAt(4, static_cast(out.size()), out.data()); + + ASSERT_TRUE(read_at_end.ok()); + EXPECT_EQ(read_at_end.ValueOrDie(), 0); + EXPECT_FALSE(read_past_end.ok()); + EXPECT_THAT(read_past_end.status().ToString(), ::testing::HasSubstr("out of bounds")); +} + +TEST(FileIOAdapterTest, InputAdapterUsesInputFileSizeWithLengthHint) { + auto state = std::make_shared(); + state->data = "abc"; + auto file_io = std::make_shared(state); + + ICEBERG_UNWRAP_OR_FAIL(auto input, arrow::OpenArrowInputStream(file_io, "input", 99)); + auto size = input->GetSize(); + + ASSERT_TRUE(size.ok()) << size.status().ToString(); + EXPECT_EQ(size.ValueOrDie(), 3); +} + +TEST(FileIOAdapterTest, OutputAdapterRejectsWritesAfterClose) { + auto state = std::make_shared(); + auto file_io = std::make_shared(state); + + ICEBERG_UNWRAP_OR_FAIL(auto output, arrow::OpenArrowOutputStream(file_io, "output")); + ASSERT_TRUE(output->Close().ok()); + ASSERT_TRUE(output->Close().ok()); + ASSERT_TRUE(state->closed); + + auto status = output->Write("x", 1); + auto flush_status = output->Flush(); + + EXPECT_FALSE(status.ok()); + EXPECT_THAT(status.ToString(), ::testing::HasSubstr("closed")); + EXPECT_FALSE(flush_status.ok()); + EXPECT_THAT(flush_status.ToString(), ::testing::HasSubstr("closed")); + EXPECT_TRUE(state->data.empty()); +} + +TEST(FileIOTest, ReadFileReturnsReadErrorWithCloseContext) { + auto state = std::make_shared(); + ReadFailureFileIO file_io(state); + + auto result = file_io.ReadFile("read-failure", std::nullopt); + + EXPECT_TRUE(state->closed); + EXPECT_THAT(result, IsError(ErrorKind::kIOError)); + EXPECT_THAT(result, HasErrorMessage("read failed")); + EXPECT_THAT(result, HasErrorMessage("close failed")); +} + +TEST(FileIOTest, WriteFileReturnsWriteErrorWithCloseContext) { + auto state = std::make_shared(); + WriteFailureFileIO file_io(state); + + auto result = file_io.WriteFile("write-failure", "data"); + + EXPECT_TRUE(state->closed); + EXPECT_THAT(result, IsError(ErrorKind::kIOError)); + EXPECT_THAT(result, HasErrorMessage("write failed")); + EXPECT_THAT(result, HasErrorMessage("close failed")); +} + +} // namespace iceberg diff --git a/src/iceberg/test/arrow_s3_file_io_test.cc b/src/iceberg/test/arrow_s3_file_io_test.cc index d890ad10e..b1caff1e8 100644 --- a/src/iceberg/test/arrow_s3_file_io_test.cc +++ b/src/iceberg/test/arrow_s3_file_io_test.cc @@ -26,7 +26,7 @@ #include #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/arrow/s3/s3_properties.h" #include "iceberg/test/matchers.h" diff --git a/src/iceberg/test/avro_test.cc b/src/iceberg/test/avro_test.cc index 82da97ea3..b74fe829b 100644 --- a/src/iceberg/test/avro_test.cc +++ b/src/iceberg/test/avro_test.cc @@ -23,12 +23,13 @@ #include #include #include +#include #include #include #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/avro/avro_register.h" #include "iceberg/avro/avro_stream_internal.h" #include "iceberg/avro/avro_writer.h" @@ -37,16 +38,19 @@ #include "iceberg/schema.h" #include "iceberg/schema_internal.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/std_io.h" +#include "iceberg/test/temp_file_test_base.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" namespace iceberg::avro { -class AvroReaderTest : public ::testing::Test { +class AvroReaderTest : public TempFileTestBase { protected: static void SetUpTestSuite() { RegisterAll(); } void SetUp() override { + TempFileTestBase::SetUp(); file_io_ = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); temp_avro_file_ = "avro_reader_test.avro"; } @@ -187,6 +191,16 @@ TEST_F(AvroReaderTest, ReadTwoFields) { ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); } +TEST_F(AvroReaderTest, RoundTripWithGenericFileIO) { + file_io_ = std::make_shared(); + temp_avro_file_ = CreateNewTempFilePathWithSuffix(".avro"); + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", std::make_shared()), + SchemaField::MakeOptional(2, "name", std::make_shared())}); + + ASSERT_NO_FATAL_FAILURE(WriteAndVerify(schema, R"([[1, "Foo"], [2, "Bar"]])")); +} + TEST_F(AvroReaderTest, ReadReorderedFieldsWithNulls) { CreateSimpleAvroFile(); auto schema = std::make_shared(std::vector{ diff --git a/src/iceberg/test/data_writer_test.cc b/src/iceberg/test/data_writer_test.cc index a3a8fc088..14b7bf628 100644 --- a/src/iceberg/test/data_writer_test.cc +++ b/src/iceberg/test/data_writer_test.cc @@ -25,7 +25,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/avro/avro_register.h" #include "iceberg/data/equality_delete_writer.h" #include "iceberg/data/position_delete_writer.h" diff --git a/src/iceberg/test/delete_file_index_test.cc b/src/iceberg/test/delete_file_index_test.cc index b99a2816b..0c8c8821b 100644 --- a/src/iceberg/test/delete_file_index_test.cc +++ b/src/iceberg/test/delete_file_index_test.cc @@ -29,7 +29,7 @@ #include #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_list.h" diff --git a/src/iceberg/test/delete_loader_test.cc b/src/iceberg/test/delete_loader_test.cc index 6dcd564bf..c365b8bac 100644 --- a/src/iceberg/test/delete_loader_test.cc +++ b/src/iceberg/test/delete_loader_test.cc @@ -25,7 +25,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/data/equality_delete_writer.h" #include "iceberg/data/position_delete_writer.h" #include "iceberg/deletes/position_delete_index.h" diff --git a/src/iceberg/test/file_scan_task_test.cc b/src/iceberg/test/file_scan_task_test.cc index ba0c41b37..55bc6a110 100644 --- a/src/iceberg/test/file_scan_task_test.cc +++ b/src/iceberg/test/file_scan_task_test.cc @@ -27,7 +27,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/file_format.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/parquet/parquet_register.h" @@ -36,7 +36,6 @@ #include "iceberg/test/matchers.h" #include "iceberg/test/temp_file_test_base.h" #include "iceberg/type.h" -#include "iceberg/util/checked_cast.h" namespace iceberg { @@ -68,12 +67,14 @@ class FileScanTaskTest : public TempFileTestBase { .ValueOrDie()}) .ValueOrDie(); - auto io = internal::checked_cast(*file_io_); - auto outfile = io.fs()->OpenOutputStream(temp_parquet_file_).ValueOrDie(); + ICEBERG_UNWRAP_OR_FAIL(auto outfile, + arrow::OpenArrowOutputStream(file_io_, temp_parquet_file_)); ASSERT_TRUE(::parquet::arrow::WriteTable(*table, ::arrow::default_memory_pool(), outfile, chunk_size) .ok()); + ASSERT_TRUE(outfile->Close().ok()); + RefreshParquetFileSize(); } // Helper to create a valid but empty Parquet file. @@ -84,11 +85,28 @@ class FileScanTaskTest : public TempFileTestBase { ::arrow::KeyValueMetadata::Make({kParquetFieldIdKey}, {"1"}))}); auto empty_table = ::arrow::Table::FromRecordBatches(arrow_schema, {}).ValueOrDie(); - auto io = internal::checked_cast(*file_io_); - auto outfile = io.fs()->OpenOutputStream(temp_parquet_file_).ValueOrDie(); + ICEBERG_UNWRAP_OR_FAIL(auto outfile, + arrow::OpenArrowOutputStream(file_io_, temp_parquet_file_)); ASSERT_TRUE(::parquet::arrow::WriteTable(*empty_table, ::arrow::default_memory_pool(), outfile, 1024) .ok()); + ASSERT_TRUE(outfile->Close().ok()); + RefreshParquetFileSize(); + } + + void RefreshParquetFileSize() { + ICEBERG_UNWRAP_OR_FAIL(auto input_file, file_io_->NewInputFile(temp_parquet_file_)); + ICEBERG_UNWRAP_OR_FAIL(auto size, input_file->Size()); + ASSERT_GT(size, 0); + parquet_file_size_ = size; + } + + std::shared_ptr MakeDataFile() const { + auto data_file = std::make_shared(); + data_file->file_path = temp_parquet_file_; + data_file->file_format = FileFormatType::kParquet; + data_file->file_size_in_bytes = parquet_file_size_; + return data_file; } // Helper method to verify the content of the next batch from an ArrowArrayStream. @@ -124,12 +142,11 @@ class FileScanTaskTest : public TempFileTestBase { std::shared_ptr file_io_; std::string temp_parquet_file_; + int64_t parquet_file_size_ = 0; }; TEST_F(FileScanTaskTest, ReadFullSchema) { - auto data_file = std::make_shared(); - data_file->file_path = temp_parquet_file_; - data_file->file_format = FileFormatType::kParquet; + auto data_file = MakeDataFile(); auto projected_schema = std::make_shared( std::vector{SchemaField::MakeRequired(1, "id", int32()), @@ -146,9 +163,7 @@ TEST_F(FileScanTaskTest, ReadFullSchema) { } TEST_F(FileScanTaskTest, ReadProjectedAndReorderedSchema) { - auto data_file = std::make_shared(); - data_file->file_path = temp_parquet_file_; - data_file->file_format = FileFormatType::kParquet; + auto data_file = MakeDataFile(); auto projected_schema = std::make_shared( std::vector{SchemaField::MakeOptional(2, "name", string()), @@ -166,9 +181,7 @@ TEST_F(FileScanTaskTest, ReadProjectedAndReorderedSchema) { TEST_F(FileScanTaskTest, ReadEmptyFile) { CreateEmptyParquetFile(); - auto data_file = std::make_shared(); - data_file->file_path = temp_parquet_file_; - data_file->file_format = FileFormatType::kParquet; + auto data_file = MakeDataFile(); auto projected_schema = std::make_shared( std::vector{SchemaField::MakeRequired(1, "id", int32())}); diff --git a/src/iceberg/test/gzip_decompress_test.cc b/src/iceberg/test/gzip_decompress_test.cc index 3415c46be..b855e4a06 100644 --- a/src/iceberg/test/gzip_decompress_test.cc +++ b/src/iceberg/test/gzip_decompress_test.cc @@ -23,7 +23,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/file_io.h" #include "iceberg/test/matchers.h" #include "iceberg/test/temp_file_test_base.h" @@ -69,7 +69,11 @@ TEST_F(GZipTest, GZipDecompressedString) { ASSERT_TRUE(compressed_stream->Flush().ok()); ASSERT_TRUE(compressed_stream->Close().ok()); - auto result = io_->ReadFile(temp_filepath_, test_string.size()); + ICEBERG_UNWRAP_OR_FAIL(auto input_file, io_->NewInputFile(temp_filepath_)); + ICEBERG_UNWRAP_OR_FAIL(auto compressed_size, input_file->Size()); + ASSERT_GE(compressed_size, 0); + + auto result = io_->ReadFile(temp_filepath_, static_cast(compressed_size)); EXPECT_THAT(result, IsOk()); auto gzip_decompressor = std::make_unique(); diff --git a/src/iceberg/test/in_memory_catalog_test.cc b/src/iceberg/test/in_memory_catalog_test.cc index 78f67dda4..1a65098e6 100644 --- a/src/iceberg/test/in_memory_catalog_test.cc +++ b/src/iceberg/test/in_memory_catalog_test.cc @@ -27,7 +27,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" #include "iceberg/sort_order.h" diff --git a/src/iceberg/test/manifest_group_test.cc b/src/iceberg/test/manifest_group_test.cc index 34ff9993b..017f98036 100644 --- a/src/iceberg/test/manifest_group_test.cc +++ b/src/iceberg/test/manifest_group_test.cc @@ -29,7 +29,7 @@ #include #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/expression/expressions.h" #include "iceberg/manifest/manifest_entry.h" diff --git a/src/iceberg/test/manifest_list_versions_test.cc b/src/iceberg/test/manifest_list_versions_test.cc index 9c16a02ec..b173d56e7 100644 --- a/src/iceberg/test/manifest_list_versions_test.cc +++ b/src/iceberg/test/manifest_list_versions_test.cc @@ -25,7 +25,7 @@ #include #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/file_reader.h" #include "iceberg/file_writer.h" diff --git a/src/iceberg/test/manifest_reader_stats_test.cc b/src/iceberg/test/manifest_reader_stats_test.cc index a94dca120..6c0e005bc 100644 --- a/src/iceberg/test/manifest_reader_stats_test.cc +++ b/src/iceberg/test/manifest_reader_stats_test.cc @@ -25,7 +25,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/expression/expressions.h" #include "iceberg/manifest/manifest_entry.h" diff --git a/src/iceberg/test/manifest_reader_test.cc b/src/iceberg/test/manifest_reader_test.cc index 3e93f6ff5..3f85729a7 100644 --- a/src/iceberg/test/manifest_reader_test.cc +++ b/src/iceberg/test/manifest_reader_test.cc @@ -28,7 +28,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/expression/expressions.h" #include "iceberg/manifest/manifest_entry.h" diff --git a/src/iceberg/test/manifest_writer_versions_test.cc b/src/iceberg/test/manifest_writer_versions_test.cc index fc61980a7..990224528 100644 --- a/src/iceberg/test/manifest_writer_versions_test.cc +++ b/src/iceberg/test/manifest_writer_versions_test.cc @@ -25,7 +25,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/constants.h" #include "iceberg/file_format.h" diff --git a/src/iceberg/test/metadata_io_test.cc b/src/iceberg/test/metadata_io_test.cc index 72a23ecb2..c780dc18c 100644 --- a/src/iceberg/test/metadata_io_test.cc +++ b/src/iceberg/test/metadata_io_test.cc @@ -27,7 +27,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/file_io.h" #include "iceberg/json_serde_internal.h" #include "iceberg/partition_spec.h" diff --git a/src/iceberg/test/parquet_test.cc b/src/iceberg/test/parquet_test.cc index 0d983db58..65a4602d8 100644 --- a/src/iceberg/test/parquet_test.cc +++ b/src/iceberg/test/parquet_test.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -30,7 +31,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/file_reader.h" #include "iceberg/file_writer.h" @@ -41,6 +42,8 @@ #include "iceberg/schema_field.h" #include "iceberg/schema_internal.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/std_io.h" +#include "iceberg/test/temp_file_test_base.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" @@ -123,11 +126,12 @@ void DoRoundtrip(std::shared_ptr<::arrow::Array> data, std::shared_ptr s } // namespace -class ParquetReaderTest : public ::testing::Test { +class ParquetReaderTest : public TempFileTestBase { protected: static void SetUpTestSuite() { parquet::RegisterAll(); } void SetUp() override { + TempFileTestBase::SetUp(); file_io_ = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); temp_parquet_file_ = "parquet_reader_test.parquet"; } @@ -232,6 +236,42 @@ TEST_F(ParquetReaderTest, ReadTwoFields) { ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); } +TEST_F(ParquetReaderTest, RoundTripWithGenericFileIO) { + auto file_io = std::make_shared(); + auto path = CreateNewTempFilePathWithSuffix(".parquet"); + + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}); + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(*schema, &arrow_c_schema), IsOk()); + auto arrow_schema = ::arrow::ImportType(&arrow_c_schema).ValueOrDie(); + auto array = + ::arrow::json::ArrayFromJSONString(::arrow::struct_(arrow_schema->fields()), + R"([[1, "Foo"], [2, "Bar"]])") + .ValueOrDie(); + + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kParquetCompression, + std::string("uncompressed")); + auto writer_result = WriterFactoryRegistry::Open( + FileFormatType::kParquet, {.path = path, + .schema = schema, + .io = file_io, + .properties = std::move(writer_properties)}); + ASSERT_THAT(writer_result, IsOk()); + auto writer = std::move(writer_result.value()); + ASSERT_THAT(WriteArray(array, *writer), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto length, writer->length()); + + std::shared_ptr<::arrow::Array> out; + auto read_status = ReadArray( + out, {.path = path, .length = length, .io = file_io, .projection = schema}, + nullptr); + ASSERT_THAT(read_status, IsOk()); + ASSERT_TRUE(out->Equals(*array)); +} + TEST_F(ParquetReaderTest, ReadReorderedFieldsWithNulls) { CreateSimpleParquetFile(); diff --git a/src/iceberg/test/rolling_manifest_writer_test.cc b/src/iceberg/test/rolling_manifest_writer_test.cc index b996eb166..2eae5a15b 100644 --- a/src/iceberg/test/rolling_manifest_writer_test.cc +++ b/src/iceberg/test/rolling_manifest_writer_test.cc @@ -28,7 +28,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/file_format.h" #include "iceberg/manifest/manifest_entry.h" diff --git a/src/iceberg/test/scan_test_base.h b/src/iceberg/test/scan_test_base.h index 1a2f5648d..5bd1222e0 100644 --- a/src/iceberg/test/scan_test_base.h +++ b/src/iceberg/test/scan_test_base.h @@ -30,7 +30,7 @@ #include -#include "iceberg/arrow/arrow_file_io.h" +#include "iceberg/arrow/arrow_io_util.h" #include "iceberg/avro/avro_register.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_list.h" diff --git a/src/iceberg/test/std_io.h b/src/iceberg/test/std_io.h index 3b58267df..3866bddf0 100644 --- a/src/iceberg/test/std_io.h +++ b/src/iceberg/test/std_io.h @@ -19,78 +19,297 @@ #pragma once +#include +#include #include #include +#include +#include +#include #include -#include +#include #include #include +#include +#include #include "iceberg/file_io.h" #include "iceberg/result.h" +#include "iceberg/util/macros.h" namespace iceberg::test { -/// \brief Simple local filesystem FileIO implementation for testing -/// -/// This class provides a basic FileIO implementation that reads and writes -/// files to the local filesystem using standard C++ file streams. -class StdFileIO : public FileIO { +namespace detail { + +inline Result ToStreamSize(size_t size) { + if (size > static_cast(std::numeric_limits::max())) { + return InvalidArgument("Buffer size {} exceeds streamsize max", size); + } + return static_cast(size); +} + +inline Result ToInt64FileSize(uintmax_t size, std::string_view location) { + if (size > static_cast(std::numeric_limits::max())) { + return Invalid("File size for {} exceeds int64_t max", location); + } + return static_cast(size); +} + +} // namespace detail + +class StdSeekableInputStream : public SeekableInputStream { public: - Result ReadFile(const std::string& file_location, - std::optional length) override { - std::ifstream file(file_location, std::ios::binary); - if (!file.is_open()) { - return IOError("Failed to open file for reading: {}", file_location); - } - - if (length.has_value()) { - std::string content(length.value(), '\0'); - file.read(content.data(), length.value()); - if (!file) { - return IOError("Failed to read {} bytes from file: {}", length.value(), - file_location); + explicit StdSeekableInputStream(std::string location) + : location_(std::move(location)), file_(location_, std::ios::binary) {} + + bool is_open() const { return file_.is_open(); } + + Result Position() const override { + auto position = file_.tellg(); + if (position < 0) { + return IOError("Failed to get read position for: {}", location_); + } + return static_cast(position); + } + + Status Seek(int64_t position) override { + if (position < 0) { + return InvalidArgument("Cannot seek to negative position {}", position); + } + file_.clear(); + file_.seekg(position); + if (!file_) { + return IOError("Failed to seek to {} in file: {}", position, location_); + } + return {}; + } + + Result Read(std::span out) override { + if (out.empty()) { + return 0; + } + ICEBERG_ASSIGN_OR_RAISE(auto read_size, detail::ToStreamSize(out.size())); + file_.read(reinterpret_cast(out.data()), read_size); + auto bytes_read = file_.gcount(); + if (!file_) { + if (file_.bad() || !file_.eof()) { + return IOError("Failed to read from file: {}", location_); } - return content; - } else { - std::stringstream buffer; - buffer << file.rdbuf(); - if (!file && !file.eof()) { - return IOError("Failed to read file: {}", file_location); + file_.clear(); + } + if (bytes_read < 0) { + return IOError("Failed to read from file: {}", location_); + } + return static_cast(bytes_read); + } + + Status ReadFully(int64_t position, std::span out) override { + if (position < 0) { + return InvalidArgument("Cannot read from negative position {}", position); + } + if (out.empty()) { + return {}; + } + ICEBERG_ASSIGN_OR_RAISE(auto original_position, Position()); + auto seek_status = Seek(position); + if (!seek_status.has_value()) { + static_cast(Seek(original_position)); + return seek_status; + } + + Status read_status = {}; + size_t total_read = 0; + while (total_read < out.size()) { + auto read_result = Read(out.subspan(total_read)); + if (!read_result.has_value()) { + read_status = std::unexpected(read_result.error()); + break; + } + if (read_result.value() == 0) { + read_status = + IOError("Failed to read {} bytes from file: {}", out.size(), location_); + break; } - return buffer.str(); + total_read += static_cast(read_result.value()); + } + + auto restore_status = Seek(original_position); + ICEBERG_RETURN_UNEXPECTED(read_status); + return restore_status; + } + + Status Close() override { + if (!file_.is_open()) { + return {}; + } + file_.close(); + if (!file_) { + return IOError("Failed to close file: {}", location_); + } + return {}; + } + + private: + std::string location_; + mutable std::ifstream file_; +}; + +class StdPositionOutputStream : public PositionOutputStream { + public: + explicit StdPositionOutputStream(std::string location) + : location_(std::move(location)), + file_(location_, std::ios::binary | std::ios::out | std::ios::trunc) {} + + bool is_open() const { return file_.is_open(); } + + Result Position() const override { + auto position = file_.tellp(); + if (position < 0) { + return IOError("Failed to get write position for: {}", location_); + } + return static_cast(position); + } + + Status Write(std::span data) override { + if (data.empty()) { + return {}; + } + ICEBERG_ASSIGN_OR_RAISE(auto write_size, detail::ToStreamSize(data.size())); + file_.write(reinterpret_cast(data.data()), write_size); + if (!file_) { + return IOError("Failed to write to file: {}", location_); } + return {}; } - Status WriteFile(const std::string& file_location, std::string_view content) override { - // Create parent directories if they don't exist - std::filesystem::path path(file_location); + Status Flush() override { + file_.flush(); + if (!file_) { + return IOError("Failed to flush file: {}", location_); + } + return {}; + } + + Status Close() override { + if (!file_.is_open()) { + return {}; + } + file_.close(); + if (!file_) { + return IOError("Failed to close file: {}", location_); + } + return {}; + } + + private: + std::string location_; + mutable std::ofstream file_; +}; + +class StdInputFile : public InputFile { + public: + explicit StdInputFile(std::string location, + std::optional file_size = std::nullopt) + : location_(std::move(location)), file_size_(file_size) {} + + std::string_view location() const override { return location_; } + + Result Size() const override { + if (file_size_.has_value()) { + return *file_size_; + } + std::error_code ec; + auto size = std::filesystem::file_size(location_, ec); + if (ec) { + return IOError("Failed to get file size for {}: {}", location_, ec.message()); + } + return detail::ToInt64FileSize(size, location_); + } + + Result> Open() override { + auto stream = std::make_unique(location_); + if (!stream->is_open()) { + return IOError("Failed to open file for reading: {}", location_); + } + return stream; + } + + private: + std::string location_; + std::optional file_size_; +}; + +class StdOutputFile : public OutputFile { + public: + explicit StdOutputFile(std::string location) : location_(std::move(location)) {} + + std::string_view location() const override { return location_; } + + Result> Create() override { + return Create(/*overwrite=*/false); + } + + Result> CreateOrOverwrite() override { + return Create(/*overwrite=*/true); + } + + private: + Result> Create(bool overwrite) { + std::filesystem::path path(location_); + std::error_code ec; + auto exists = std::filesystem::exists(path, ec); + if (ec) { + return IOError("Failed to check file existence for {}: {}", location_, + ec.message()); + } + if (!overwrite && exists) { + return AlreadyExists("File already exists: {}", location_); + } if (path.has_parent_path()) { - std::error_code ec; std::filesystem::create_directories(path.parent_path(), ec); if (ec) { - return IOError("Failed to create parent directories for: {}", file_location); + return IOError("Failed to create parent directories for {}: {}", location_, + ec.message()); } } - - std::ofstream file(file_location, std::ios::binary); - if (!file.is_open()) { - return IOError("Failed to open file for writing: {}", file_location); + auto stream = std::make_unique(location_); + if (!stream->is_open()) { + return IOError("Failed to open file for writing: {}", location_); } + return stream; + } - file.write(content.data(), content.size()); - if (!file) { - return IOError("Failed to write to file: {}", file_location); + std::string location_; +}; + +/// \brief Simple local filesystem FileIO implementation for testing +/// +/// This class provides a basic FileIO implementation that reads and writes +/// files to the local filesystem using standard C++ file streams. +class StdFileIO : public FileIO { + public: + Result> NewInputFile(std::string file_location) override { + return std::make_unique(std::move(file_location)); + } + + Result> NewInputFile(std::string file_location, + size_t length) override { + if (length > static_cast(std::numeric_limits::max())) { + return InvalidArgument("File length {} exceeds int64_t max", length); } + return std::make_unique(std::move(file_location), + static_cast(length)); + } - return {}; + Result> NewOutputFile(std::string file_location) override { + return std::make_unique(std::move(file_location)); } Status DeleteFile(const std::string& file_location) override { std::error_code ec; if (!std::filesystem::remove(file_location, ec)) { if (ec) { - return IOError("Failed to delete file: {}", file_location); + return IOError("Failed to delete file {}: {}", file_location, ec.message()); } return IOError("File does not exist: {}", file_location); } diff --git a/src/iceberg/test/update_location_test.cc b/src/iceberg/test/update_location_test.cc index 53b347b56..a208209b3 100644 --- a/src/iceberg/test/update_location_test.cc +++ b/src/iceberg/test/update_location_test.cc @@ -26,7 +26,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/result.h" #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" diff --git a/src/iceberg/test/update_partition_spec_test.cc b/src/iceberg/test/update_partition_spec_test.cc index 632c4a55e..e310c0d1f 100644 --- a/src/iceberg/test/update_partition_spec_test.cc +++ b/src/iceberg/test/update_partition_spec_test.cc @@ -28,7 +28,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/catalog/memory/in_memory_catalog.h" #include "iceberg/expression/expressions.h" #include "iceberg/partition_spec.h" diff --git a/src/iceberg/test/update_test_base.h b/src/iceberg/test/update_test_base.h index 310feb37e..b0ad3d20f 100644 --- a/src/iceberg/test/update_test_base.h +++ b/src/iceberg/test/update_test_base.h @@ -26,7 +26,7 @@ #include #include -#include "iceberg/arrow/arrow_fs_file_io_internal.h" +#include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/catalog/memory/in_memory_catalog.h" #include "iceberg/result.h" #include "iceberg/snapshot.h" From 43eb3271126019dff1881771281631a4113ec8cc Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Tue, 12 May 2026 15:18:48 +0800 Subject: [PATCH 025/151] feat(data): add delete filter support (#650) Adds delete filter support for merge-on-read data batches, including position deletes, equality deletes, dropped-field lookup through historic schemas, optional delete counting, and required schema expansion. --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/data/delete_filter.cc | 790 ++++++++++++ src/iceberg/data/delete_filter.h | 229 ++++ src/iceberg/data/meson.build | 1 + src/iceberg/meson.build | 1 + src/iceberg/metadata_columns.h | 2 +- src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/delete_filter_test.cc | 1625 ++++++++++++++++++++++++ 8 files changed, 2649 insertions(+), 1 deletion(-) create mode 100644 src/iceberg/data/delete_filter.cc create mode 100644 src/iceberg/data/delete_filter.h create mode 100644 src/iceberg/test/delete_filter_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index c4e193b89..79298b1a1 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -161,6 +161,7 @@ add_iceberg_lib(iceberg set(ICEBERG_DATA_SOURCES data/data_writer.cc + data/delete_filter.cc data/delete_loader.cc data/equality_delete_writer.cc data/position_delete_writer.cc diff --git a/src/iceberg/data/delete_filter.cc b/src/iceberg/data/delete_filter.cc new file mode 100644 index 000000000..876d644e5 --- /dev/null +++ b/src/iceberg/data/delete_filter.cc @@ -0,0 +1,790 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/data/delete_filter.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/metadata_columns.h" +#include "iceberg/result.h" +#include "iceberg/row/arrow_array_wrapper.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/table_metadata.h" +#include "iceberg/type.h" +#include "iceberg/util/checked_cast.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/struct_like_set.h" + +namespace iceberg { + +namespace { + +std::optional FindFieldIndexById(std::span fields, + int32_t field_id) { + for (size_t pos = 0; pos < fields.size(); ++pos) { + if (fields[pos].field_id() == field_id) { + return pos; + } + } + return std::nullopt; +} + +Result RequireFieldIndexById(std::span fields, + int32_t field_id, std::string_view context) { + auto pos = FindFieldIndexById(fields, field_id); + if (pos.has_value()) { + return pos.value(); + } + return InvalidSchema("Cannot find field id {} in {}", field_id, context); +} + +// Views a source row through the equality-delete key schema: fields are selected by +// field id, then exposed by position so StructLikeSet can compare only delete keys. +class ProjectedStructLike : public StructLike { + public: + struct ProjectedField; + using ProjectedSubFields = std::vector; + + struct ProjectedField { + int32_t field_id; + size_t source_field_pos; + std::shared_ptr nested_projected_fields; + }; + + explicit ProjectedStructLike(std::shared_ptr projected_fields) + : projected_fields_(std::move(projected_fields)) { + nested_projected_structs_.reserve(projected_fields_->size()); + for (const auto& projected_field : *projected_fields_) { + nested_projected_structs_.push_back( + projected_field.nested_projected_fields == nullptr + ? nullptr + : std::make_shared( + projected_field.nested_projected_fields)); + } + } + + /// \brief Build field-id based positions from the source row to the equality keys. + /// + /// \param source_type the schema of wrapped rows + /// \param target_type the key schema used by the equality-delete set + static Result> BuildProjection( + const StructType& source_type, const StructType& target_type) { + ProjectedSubFields projected_fields; + projected_fields.reserve(target_type.fields().size()); + for (const auto& target_field : target_type.fields()) { + ICEBERG_ASSIGN_OR_RAISE( + auto source_field_pos, + RequireFieldIndexById(source_type.fields(), target_field.field_id(), + "source projection")); + const auto& source_field = source_type.fields()[source_field_pos]; + + std::shared_ptr nested_projected_fields; + if (*source_field.type() != *target_field.type()) { + if (target_field.type()->type_id() == TypeId::kStruct && + source_field.type()->type_id() == TypeId::kStruct) { + ICEBERG_ASSIGN_OR_RAISE( + nested_projected_fields, + BuildProjection( + internal::checked_cast(*source_field.type()), + internal::checked_cast(*target_field.type()))); + } else if (target_field.type()->is_nested()) { + return NotSupported("Cannot project partial non-struct equality field id {}", + target_field.field_id()); + } + } + + projected_fields.push_back(ProjectedField{ + .field_id = target_field.field_id(), + .source_field_pos = source_field_pos, + .nested_projected_fields = std::move(nested_projected_fields), + }); + } + return std::make_shared(std::move(projected_fields)); + } + + void Wrap(const StructLike& row) { + owned_row_.reset(); + row_ = &row; + } + + void Wrap(std::shared_ptr row) { + owned_row_ = std::move(row); + row_ = owned_row_.get(); + } + + Result GetField(size_t pos) const override { + ICEBERG_PRECHECK(row_ != nullptr, "ProjectedStructLike has no wrapped row"); + if (pos >= projected_fields_->size()) { + return InvalidArgument("Projected field index {} out of range (size: {})", pos, + projected_fields_->size()); + } + + const auto& projected_field = (*projected_fields_)[pos]; + ICEBERG_ASSIGN_OR_RAISE(auto scalar, + row_->GetField(projected_field.source_field_pos)); + if (projected_field.nested_projected_fields == nullptr || + std::holds_alternative(scalar)) { + return scalar; + } + + if (!std::holds_alternative>(scalar)) { + return InvalidSchema("Expected struct field id {} while projecting equality row", + projected_field.field_id); + } + + auto child = std::get>(std::move(scalar)); + if (child == nullptr) { + return Scalar{std::monostate{}}; + } + + auto projected_struct = nested_projected_structs_[pos]; + projected_struct->Wrap(std::move(child)); + return Scalar{std::static_pointer_cast(std::move(projected_struct))}; + } + + size_t num_fields() const override { return projected_fields_->size(); } + + private: + std::shared_ptr owned_row_; + const StructLike* row_ = nullptr; + std::shared_ptr projected_fields_; + std::vector> nested_projected_structs_; +}; + +Status ValidateEqualityIds(const DataFile& delete_file) { + if (delete_file.equality_ids.empty()) { + return InvalidArgument("Equality delete file '{}' has no equality field ids", + delete_file.file_path); + } + return {}; +} + +SchemaField WithType(const SchemaField& field, std::shared_ptr type) { + return SchemaField{field.field_id(), std::string(field.name()), std::move(type), + field.optional(), std::string(field.doc())}; +} + +std::shared_ptr SortStructFieldsById(const std::shared_ptr& type) { + if (type->type_id() != TypeId::kStruct) { + return type; + } + + const auto& struct_type = internal::checked_cast(*type); + auto source_fields = struct_type.fields(); + std::vector> sorted_types; + sorted_types.reserve(source_fields.size()); + bool changed = false; + for (const auto& field : source_fields) { + auto sorted_type = SortStructFieldsById(field.type()); + changed = changed || sorted_type != field.type(); + sorted_types.push_back(std::move(sorted_type)); + } + + const bool needs_sort = + !std::ranges::is_sorted(source_fields, {}, &SchemaField::field_id); + if (!changed && !needs_sort) { + return type; + } + + std::vector fields; + fields.reserve(source_fields.size()); + for (size_t pos = 0; pos < source_fields.size(); ++pos) { + const auto& field = source_fields[pos]; + fields.push_back(sorted_types[pos] == field.type() + ? field + : WithType(field, std::move(sorted_types[pos]))); + } + + if (needs_sort) { + std::ranges::sort(fields, {}, &SchemaField::field_id); + } + return std::make_shared(std::move(fields)); +} + +void SortFieldsById(std::vector& fields) { + for (auto& field : fields) { + auto sorted_type = SortStructFieldsById(field.type()); + if (sorted_type != field.type()) { + field = WithType(field, std::move(sorted_type)); + } + } + std::ranges::sort(fields, {}, &SchemaField::field_id); +} + +Result> ProjectFieldsById( + const Schema& schema, const std::set& selected_ids) { + std::unordered_set unordered_ids(selected_ids.begin(), selected_ids.end()); + ICEBERG_ASSIGN_OR_RAISE(auto projected_schema, schema.Project(unordered_ids)); + std::vector fields(projected_schema->fields().begin(), + projected_schema->fields().end()); + return fields; +} + +Result> ProjectEqualityKeyFields( + const Schema& schema, const std::set& selected_ids) { + ICEBERG_ASSIGN_OR_RAISE(auto fields, ProjectFieldsById(schema, selected_ids)); + // Equality-delete keys keep the projected struct shape; fields are sorted by id + // within each struct level, not flattened by nested leaf ids. + SortFieldsById(fields); + return fields; +} + +bool ContainsFieldId(const SchemaField& field, int32_t field_id); + +bool ContainsFieldId(const Type& type, int32_t field_id) { + if (!type.is_nested()) { + return false; + } + const auto& nested = internal::checked_cast(type); + return std::ranges::any_of(nested.fields(), [field_id](const SchemaField& field) { + return ContainsFieldId(field, field_id); + }); +} + +bool ContainsFieldId(const SchemaField& field, int32_t field_id) { + return field.field_id() == field_id || ContainsFieldId(*field.type(), field_id); +} + +Status ValidateEqualityProjectionField(int32_t field_id, const SchemaField& field) { + if (field.field_id() == field_id) { + if (!field.type()->is_primitive()) { + return InvalidArgument( + "Equality delete field id {} must reference a primitive field", field_id); + } + return {}; + } + + switch (field.type()->type_id()) { + case TypeId::kStruct: { + const auto& struct_type = internal::checked_cast(*field.type()); + for (const auto& child : struct_type.fields()) { + if (ContainsFieldId(child, field_id)) { + return ValidateEqualityProjectionField(field_id, child); + } + } + break; + } + case TypeId::kList: + case TypeId::kMap: + if (ContainsFieldId(*field.type(), field_id)) { + return InvalidArgument("Equality delete field id {} must not be nested in {}", + field_id, ToString(field.type()->type_id())); + } + break; + default: + break; + } + + return InvalidSchema("Cannot find equality delete field id {} in projection field {}", + field_id, field.field_id()); +} + +Result> LookupFieldInSchema( + const Schema& schema, int32_t field_id) { + ICEBERG_ASSIGN_OR_RAISE(auto field, schema.FindFieldById(field_id)); + if (!field.has_value()) { + return std::nullopt; + } + if (!field->get().type()->is_primitive()) { + return InvalidArgument("Equality delete field id {} must reference a primitive field", + field_id); + } + + std::set selected_ids = {field_id}; + ICEBERG_ASSIGN_OR_RAISE(auto projected_fields, ProjectFieldsById(schema, selected_ids)); + if (projected_fields.empty()) { + return InvalidSchema("Cannot project field id {} from lookup schema", field_id); + } + if (projected_fields.size() != 1) { + return InvalidSchema("Expected one top-level projection for field id {} but got {}", + field_id, projected_fields.size()); + } + + return DeleteFilter::FieldLookupResult{ + .field = field.value().get(), + .projection_field = std::move(projected_fields[0]), + }; +} + +Result MergeField(SchemaField& existing, const SchemaField& required) { + if (existing.field_id() != required.field_id()) { + return InvalidSchema("Cannot merge field id {} with field id {}", existing.field_id(), + required.field_id()); + } + + if (*existing.type() == *required.type() || !required.type()->is_nested()) { + return false; + } + + if (existing.type()->type_id() == TypeId::kStruct && + required.type()->type_id() == TypeId::kStruct) { + const auto& existing_struct = + internal::checked_cast(*existing.type()); + std::vector fields(existing_struct.fields().begin(), + existing_struct.fields().end()); + const auto& required_struct = + internal::checked_cast(*required.type()); + + bool changed = false; + for (const auto& required_child : required_struct.fields()) { + auto existing_pos = FindFieldIndexById(fields, required_child.field_id()); + if (existing_pos.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(auto child_changed, + MergeField(fields[existing_pos.value()], required_child)); + changed = changed || child_changed; + } else { + fields.push_back(required_child); + changed = true; + } + } + + if (!changed) { + return false; + } + existing = SchemaField(existing.field_id(), std::string(existing.name()), + std::make_shared(std::move(fields)), + existing.optional(), std::string(existing.doc())); + return true; + } + + return InvalidArgument( + "Cannot merge non-struct nested field id {} into delete projection", + required.field_id()); +} + +Result MergeProjectionField(std::vector& fields, + const SchemaField& required_projection) { + auto existing_pos = FindFieldIndexById(fields, required_projection.field_id()); + if (existing_pos.has_value()) { + return MergeField(fields[existing_pos.value()], required_projection); + } + + fields.push_back(required_projection); + return true; +} + +void AddIdOnce(std::vector& ids, std::unordered_set& seen, + int32_t field_id) { + if (seen.insert(field_id).second) { + ids.push_back(field_id); + } +} + +} // namespace + +struct DeleteFilter::EqDeleteGroup { + std::unique_ptr row_projection; + std::unique_ptr delete_set; +}; + +Result DeleteFilter::MakeFieldLookup( + std::shared_ptr table_schema, + std::span> schemas) { + ICEBERG_PRECHECK(table_schema != nullptr, "Table schema must not be null"); + + std::vector> lookup_schemas; + lookup_schemas.reserve(schemas.size() + 1); + const int32_t current_schema_id = table_schema->schema_id(); + lookup_schemas.push_back(std::move(table_schema)); + + std::vector> sorted_fallback_schemas; + sorted_fallback_schemas.reserve(schemas.size()); + for (const auto& schema : schemas) { + ICEBERG_PRECHECK(schema != nullptr, "Schema must not be null"); + if (schema->schema_id() != current_schema_id) { + sorted_fallback_schemas.push_back(schema); + } + } + + // Search fallback schemas from latest to oldest so the highest schema_id wins. + std::ranges::stable_sort(sorted_fallback_schemas, [](const auto& lhs, const auto& rhs) { + return lhs->schema_id() > rhs->schema_id(); + }); + + std::unordered_set seen_schema_ids; + seen_schema_ids.insert(current_schema_id); + for (const auto& schema : sorted_fallback_schemas) { + if (seen_schema_ids.insert(schema->schema_id()).second) { + lookup_schemas.push_back(schema); + } + } + + return [lookup_schemas = std::move(lookup_schemas)]( + int32_t field_id) -> Result> { + for (const auto& schema : lookup_schemas) { + ICEBERG_ASSIGN_OR_RAISE(auto field, LookupFieldInSchema(*schema, field_id)); + if (field.has_value()) { + return field; + } + } + return std::nullopt; + }; +} + +Result DeleteFilter::MakeFieldLookup( + std::shared_ptr table_metadata) { + ICEBERG_PRECHECK(table_metadata != nullptr, "Table metadata must not be null"); + + ICEBERG_ASSIGN_OR_RAISE(auto table_schema, table_metadata->Schema()); + return MakeFieldLookup(std::move(table_schema), table_metadata->schemas); +} + +Result> DeleteFilter::Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_schema, std::shared_ptr requested_schema, + std::shared_ptr io, bool need_row_pos_col, + std::shared_ptr counter) { + ICEBERG_ASSIGN_OR_RAISE(auto field_lookup, MakeFieldLookup(table_schema)); + return Make(std::move(file_path), delete_files, std::move(requested_schema), + std::move(io), std::move(field_lookup), need_row_pos_col, + std::move(counter)); +} + +Result> DeleteFilter::Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_metadata, + std::shared_ptr requested_schema, std::shared_ptr io, + bool need_row_pos_col, std::shared_ptr counter) { + ICEBERG_PRECHECK(table_metadata != nullptr, "Table metadata must not be null"); + + ICEBERG_ASSIGN_OR_RAISE(auto field_lookup, MakeFieldLookup(std::move(table_metadata))); + return Make(std::move(file_path), delete_files, std::move(requested_schema), + std::move(io), std::move(field_lookup), need_row_pos_col, + std::move(counter)); +} + +Result> DeleteFilter::Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_schema, std::shared_ptr requested_schema, + std::shared_ptr io, std::span> schemas, + bool need_row_pos_col, std::shared_ptr counter) { + ICEBERG_ASSIGN_OR_RAISE(auto field_lookup, MakeFieldLookup(table_schema, schemas)); + return Make(std::move(file_path), delete_files, std::move(requested_schema), + std::move(io), std::move(field_lookup), need_row_pos_col, + std::move(counter)); +} + +Result> DeleteFilter::Make( + std::string file_path, std::span> delete_files, + std::shared_ptr requested_schema, std::shared_ptr io, + FieldLookup field_lookup, bool need_row_pos_col, + std::shared_ptr counter) { + ICEBERG_PRECHECK(requested_schema != nullptr, "Requested schema must not be null"); + ICEBERG_PRECHECK(field_lookup != nullptr, "Field lookup must not be null"); + ICEBERG_PRECHECK(delete_files.empty() || io != nullptr, + "FileIO must not be null when delete files are present"); + + auto filter = std::unique_ptr( + new DeleteFilter(std::move(file_path), std::move(requested_schema), std::move(io), + std::move(field_lookup), need_row_pos_col, std::move(counter))); + ICEBERG_RETURN_UNEXPECTED(filter->Init(delete_files)); + return filter; +} + +DeleteFilter::DeleteFilter(std::string file_path, + std::shared_ptr requested_schema, + std::shared_ptr io, FieldLookup field_lookup, + bool need_row_pos_col, std::shared_ptr counter) + : file_path_(std::move(file_path)), + requested_schema_(std::move(requested_schema)), + field_lookup_(std::move(field_lookup)), + need_row_pos_col_(need_row_pos_col), + counter_(std::move(counter)), + delete_loader_(std::move(io)) {} + +DeleteFilter::~DeleteFilter() = default; + +Status DeleteFilter::Init(std::span> delete_files) { + for (const auto& delete_file : delete_files) { + ICEBERG_PRECHECK(delete_file != nullptr, "Delete file must not be null"); + + switch (delete_file->content) { + case DataFile::Content::kPositionDeletes: + pos_deletes_.push_back(delete_file); + break; + case DataFile::Content::kEqualityDeletes: + ICEBERG_RETURN_UNEXPECTED(ValidateEqualityIds(*delete_file)); + eq_deletes_.push_back(delete_file); + break; + case DataFile::Content::kData: + return InvalidArgument("Expected delete file but got data file '{}'", + delete_file->file_path); + default: + return InvalidArgument("Unknown delete file content type {}", + static_cast(delete_file->content)); + } + } + + ICEBERG_ASSIGN_OR_RAISE(required_schema_, ComputeRequiredSchema()); + + // Pre-compute _pos column position for reuse + pos_field_position_ = FindFieldIndexById(required_schema_->fields(), + MetadataColumns::kFilePositionColumnId); + + return {}; +} + +Result> DeleteFilter::ComputeRequiredSchema() const { + if (!HasPositionDeletes() && !HasEqualityDeletes()) { + return requested_schema_; + } + + std::vector required_ids; + std::unordered_set seen_required_ids; + if (HasPositionDeletes() && need_row_pos_col_) { + AddIdOnce(required_ids, seen_required_ids, MetadataColumns::kFilePositionColumnId); + } + + for (const auto& delete_file : eq_deletes_) { + for (int32_t field_id : delete_file->equality_ids) { + AddIdOnce(required_ids, seen_required_ids, field_id); + } + } + + std::vector fields(requested_schema_->fields().begin(), + requested_schema_->fields().end()); + bool changed = false; + + for (int32_t field_id : required_ids) { + if (field_id == MetadataColumns::kFilePositionColumnId || + field_id == MetadataColumns::kIsDeletedColumnId) { + // These columns do not exist in the table schema and will be handled later. + continue; + } + + // Top-level primitive fields already cover equality-delete needs. Nested fields + // still need lookup so we can validate/merge the required subfield projection. + auto existing_pos = FindFieldIndexById(fields, field_id); + if (existing_pos.has_value() && !fields[existing_pos.value()].type()->is_nested()) { + continue; + } + + ICEBERG_ASSIGN_OR_RAISE(auto lookup, field_lookup_(field_id)); + if (!lookup.has_value()) { + return InvalidArgument("Cannot find equality delete field id {}", field_id); + } + ICEBERG_RETURN_UNEXPECTED( + ValidateEqualityProjectionField(field_id, lookup->projection_field)); + + ICEBERG_ASSIGN_OR_RAISE(auto merged, + MergeProjectionField(fields, lookup->projection_field)); + changed = changed || merged; + } + + const bool needs_pos = + HasPositionDeletes() && need_row_pos_col_ && + !FindFieldIndexById(fields, MetadataColumns::kFilePositionColumnId).has_value(); + if (needs_pos) { + fields.push_back(MetadataColumns::kRowPosition); + changed = true; + } + + if (!changed) { + return requested_schema_; + } + + return std::make_shared(std::move(fields)); +} + +const std::shared_ptr& DeleteFilter::RequiredSchema() const { + return required_schema_; +} + +bool DeleteFilter::HasPositionDeletes() const { return !pos_deletes_.empty(); } + +bool DeleteFilter::HasEqualityDeletes() const { return !eq_deletes_.empty(); } + +Status DeleteFilter::EnsurePositionDeletesLoaded() const { + if (!HasPositionDeletes()) { + return {}; + } + + std::lock_guard lock(pos_mutex_); + if (pos_loaded_) { + return {}; + } + + ICEBERG_ASSIGN_OR_RAISE(pos_index_, + delete_loader_.LoadPositionDeletes(pos_deletes_, file_path_)); + pos_loaded_ = true; + return {}; +} + +Status DeleteFilter::EnsureEqualityDeletesLoaded() const { + if (!HasEqualityDeletes()) { + return {}; + } + + std::lock_guard lock(eq_mutex_); + if (eq_loaded_) { + return {}; + } + + std::map, std::vector>> files_by_ids; + for (const auto& delete_file : eq_deletes_) { + // equality_ids were already validated in Init, build the grouping key directly. + std::set ids(delete_file->equality_ids.begin(), + delete_file->equality_ids.end()); + files_by_ids[std::move(ids)].push_back(delete_file); + } + + std::vector> groups; + groups.reserve(files_by_ids.size()); + + for (auto& [field_ids, files] : files_by_ids) { + ICEBERG_ASSIGN_OR_RAISE(auto fields, + ProjectEqualityKeyFields(*required_schema_, field_ids)); + auto equality_type = std::make_shared(std::move(fields)); + + ICEBERG_ASSIGN_OR_RAISE(auto row_projection, ProjectedStructLike::BuildProjection( + *required_schema_, *equality_type)); + auto project_row = std::make_unique(std::move(row_projection)); + ICEBERG_ASSIGN_OR_RAISE(auto delete_set, + delete_loader_.LoadEqualityDeletes(files, *equality_type)); + groups.push_back(std::make_unique(EqDeleteGroup{ + .row_projection = std::move(project_row), + .delete_set = std::move(delete_set), + })); + } + + eq_groups_ = std::move(groups); + eq_loaded_ = true; + return {}; +} + +const std::shared_ptr& DeleteFilter::ExpectedSchema() const { + return requested_schema_; +} + +void DeleteFilter::IncrementDeleteCount(int64_t count) { + if (counter_ != nullptr) { + counter_->Increment(count); + } +} + +Result DeleteFilter::DeletedRowPositions() const { + if (!HasPositionDeletes()) { + return nullptr; + } + ICEBERG_RETURN_UNEXPECTED(EnsurePositionDeletesLoaded()); + return &pos_index_; +} + +Result(const StructLike&)>> DeleteFilter::EqDeletedRowFilter() + const { + if (!HasEqualityDeletes()) { + // No equality deletes: every row is alive. + return [](const StructLike&) -> Result { return true; }; + } + ICEBERG_RETURN_UNEXPECTED(EnsureEqualityDeletesLoaded()); + std::lock_guard lock(eq_mutex_); + if (!eq_deleted_row_filter_cache_) { + eq_deleted_row_filter_cache_ = [this](const StructLike& row) -> Result { + for (const auto& group : eq_groups_) { + auto& projected_row = *group->row_projection; + projected_row.Wrap(row); + ICEBERG_ASSIGN_OR_RAISE(auto matched, group->delete_set->Contains(projected_row)); + if (matched) { + return false; + } + } + return true; + }; + } + return eq_deleted_row_filter_cache_; +} + +Result(const StructLike&)>> +DeleteFilter::FindEqualityDeleteRows() const { + if (!HasEqualityDeletes()) { + // No equality deletes: no row is deleted. + return [](const StructLike&) -> Result { return false; }; + } + ICEBERG_ASSIGN_OR_RAISE(auto alive_filter, EqDeletedRowFilter()); + return [alive_filter = std::move(alive_filter)](const StructLike& row) -> Result { + ICEBERG_ASSIGN_OR_RAISE(auto alive, alive_filter(row)); + return !alive; + }; +} + +Result DeleteFilter::ComputeAliveRows(const ArrowSchema& batch_schema, + const ArrowArray& batch) const { + ICEBERG_PRECHECK(batch.length >= 0, "Batch length must be non-negative"); + + ICEBERG_RETURN_UNEXPECTED(EnsurePositionDeletesLoaded()); + ICEBERG_RETURN_UNEXPECTED(EnsureEqualityDeletesLoaded()); + + AliveRowSelection result; + if (batch.length == 0) { + return result; + } + + result.indices.reserve(batch.length); + ICEBERG_ASSIGN_OR_RAISE(auto row, ArrowArrayStructLike::Make(batch_schema, batch)); + + for (int64_t i = 0; i < batch.length; ++i) { + if (i > 0) { + ICEBERG_RETURN_UNEXPECTED(row->Reset(i)); + } + + bool deleted = false; + if (pos_field_position_.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(auto pos_scalar, + row->GetField(pos_field_position_.value())); + auto* pos = std::get_if(&pos_scalar); + if (pos == nullptr) { + return InvalidArrowData("Position delete filtering requires non-null int64 _pos"); + } + deleted = pos_index_.IsDeleted(*pos); + } + + if (!deleted) { + for (const auto& eq_group : eq_groups_) { + auto& projected_row = *eq_group->row_projection; + projected_row.Wrap(*row); + ICEBERG_ASSIGN_OR_RAISE(auto matched, + eq_group->delete_set->Contains(projected_row)); + if (matched) { + deleted = true; + break; + } + } + } + + if (!deleted) { + result.indices.push_back(static_cast(i)); + } else if (counter_ != nullptr) { + counter_->Increment(); + } + } + + return result; +} + +} // namespace iceberg diff --git a/src/iceberg/data/delete_filter.h b/src/iceberg/data/delete_filter.h new file mode 100644 index 000000000..4cb9bace6 --- /dev/null +++ b/src/iceberg/data/delete_filter.h @@ -0,0 +1,229 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/data/delete_filter.h +/// Delete-aware filtering for Arrow C Data batches. + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow_c_data.h" +#include "iceberg/data/delete_loader.h" +#include "iceberg/deletes/position_delete_index.h" +#include "iceberg/iceberg_data_export.h" +#include "iceberg/result.h" +#include "iceberg/schema_field.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Result of ComputeAliveRows: indices of rows not matched by any delete. +struct ICEBERG_DATA_EXPORT AliveRowSelection { + /// Zero-based row indices within the batch that are alive (not deleted). + std::vector indices; + + /// Number of alive rows (convenience accessor to avoid size_t casts). + int64_t alive_count() const { return static_cast(indices.size()); } + + bool empty() const { return indices.empty(); } +}; + +/// \brief Counts rows removed by delete filters. +class ICEBERG_DATA_EXPORT DeleteCounter { + public: + void Increment(int64_t count = 1) { + count_.fetch_add(count, std::memory_order_relaxed); + } + int64_t Get() const { return count_.load(std::memory_order_relaxed); } + + private: + std::atomic count_{0}; +}; + +/// \brief Concrete batch-oriented delete filter for merge-on-read data batches. +class ICEBERG_DATA_EXPORT DeleteFilter { + public: + /// \brief Field lookup output for current or fallback equality-delete fields. + /// + /// `field` is the exact field for validation. `projection_field` is the + /// top-level field, possibly with a pruned nested struct path, that must be + /// merged into RequiredSchema so the data reader can materialize the delete + /// column. + struct FieldLookupResult { + SchemaField field; + SchemaField projection_field; + }; + + /// \brief Lookup a field by ID, including fields from table schema fallbacks. + using FieldLookup = std::function>(int32_t)>; + + /// \brief Build a lookup from the current schema and optional table schemas. + /// + /// The current table schema is searched first. `schemas` is the table metadata + /// schema list and may contain `table_schema`; current schema duplicates are ignored + /// and fallback schemas are searched from latest schema id to oldest. + static Result MakeFieldLookup( + std::shared_ptr table_schema, + std::span> schemas = {}); + + /// \brief Build a lookup from table metadata which uses the current schema first, + /// then table metadata schemas as fallback. + static Result MakeFieldLookup( + std::shared_ptr table_metadata); + + /// \brief Create a DeleteFilter with current schema only field lookup. + /// + /// \param need_row_pos_col If true, `_pos` is added to `RequiredSchema` when + /// position deletes are present so `ComputeAliveRows` can apply them. + /// Pass false when the caller owns position filtering externally (e.g. a vectorised + /// reader that applies the position delete index directly to Arrow column buffers). + /// Note that when `need_row_pos_col` is false, `HasPositionDeletes()` may + /// return true but `ComputeAliveRows` will not apply position deletes because `_pos` + /// is absent from `RequiredSchema`. The caller is responsible for applying them. + /// \param counter Optional counter incremented for each deleted row. + static Result> Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_schema, std::shared_ptr requested_schema, + std::shared_ptr io, bool need_row_pos_col = true, + std::shared_ptr counter = nullptr); + + /// \brief Create a DeleteFilter using table metadata for schema-aware field lookup. + static Result> Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_metadata, + std::shared_ptr requested_schema, std::shared_ptr io, + bool need_row_pos_col = true, std::shared_ptr counter = nullptr); + + /// \brief Create a DeleteFilter with table schemas for dropped equality fields. + static Result> Make( + std::string file_path, std::span> delete_files, + std::shared_ptr table_schema, std::shared_ptr requested_schema, + std::shared_ptr io, std::span> schemas, + bool need_row_pos_col = true, std::shared_ptr counter = nullptr); + + /// \brief Create a DeleteFilter with a custom field lookup. + static Result> Make( + std::string file_path, std::span> delete_files, + std::shared_ptr requested_schema, std::shared_ptr io, + FieldLookup field_lookup, bool need_row_pos_col = true, + std::shared_ptr counter = nullptr); + + ~DeleteFilter(); + + /// \brief Schema required from the underlying data file reader. + const std::shared_ptr& RequiredSchema() const; + + /// \brief The original schema requested by the caller, before delete columns were + /// added. + const std::shared_ptr& ExpectedSchema() const; + + /// \brief Increment the delete counter by the given count. + /// + /// Allows callers to record deletes that occur outside `ComputeAliveRows` (e.g. when + /// applying deletes in a vectorised path). + void IncrementDeleteCount(int64_t count = 1); + + /// \brief Expose the loaded position delete index for external use. + /// + /// Triggers lazy loading of position delete files on first call. Returns nullptr + /// when there are no position deletes. Returns an error if loading fails. + /// + /// The returned pointer is valid only for the lifetime of this DeleteFilter. + Result DeletedRowPositions() const; + + /// \brief Returns a predicate that is true for rows NOT matched by any equality delete. + /// + /// The returned function is valid for the lifetime of this DeleteFilter and is cached + /// after the first call. When there are no equality deletes, returns a predicate that + /// always returns true (every row is alive). + /// + /// \note The returned predicate is NOT thread-safe: it mutates internal projection + /// state on each call. Do not invoke it concurrently from multiple threads. + Result(const StructLike&)>> EqDeletedRowFilter() const; + + /// \brief Returns a predicate that is true for rows matched by any equality delete. + /// + /// Inverse of `EqDeletedRowFilter()`. When there are no equality deletes, returns a + /// predicate that always returns false (no row is deleted). + Result(const StructLike&)>> FindEqualityDeleteRows() const; + + /// \brief Compute alive rows relative to the supplied Arrow C Data batch. + /// + /// Returns the indices (zero-based, relative to the batch) of rows not matched by + /// any delete. Deleted-row counts are forwarded to the DeleteCounter supplied at + /// construction. + Result ComputeAliveRows(const ArrowSchema& batch_schema, + const ArrowArray& batch) const; + + bool HasPositionDeletes() const; + bool HasEqualityDeletes() const; + + DeleteFilter(const DeleteFilter&) = delete; + DeleteFilter& operator=(const DeleteFilter&) = delete; + + private: + struct EqDeleteGroup; + + DeleteFilter(std::string file_path, std::shared_ptr requested_schema, + std::shared_ptr io, FieldLookup field_lookup, + bool need_row_pos_col, std::shared_ptr counter); + + Status Init(std::span> delete_files); + Result> ComputeRequiredSchema() const; + Status EnsurePositionDeletesLoaded() const; + Status EnsureEqualityDeletesLoaded() const; + + const std::string file_path_; + std::vector> pos_deletes_; + std::vector> eq_deletes_; + + std::shared_ptr requested_schema_; + std::shared_ptr required_schema_; + FieldLookup field_lookup_; + + const bool need_row_pos_col_; + // Position of `_pos` in required_schema_ when existent + std::optional pos_field_position_; + std::shared_ptr counter_; + + // TODO(gangwu): expose a factory hook (e.g. a std::function or a + // virtual newDeleteLoader()) so callers can inject a caching DeleteLoader (analogous to + // SparkDeleteFilter.CachingDeleteLoader in Java). + DeleteLoader delete_loader_; + + mutable std::mutex pos_mutex_; + mutable bool pos_loaded_ = false; + mutable PositionDeleteIndex pos_index_; + + mutable std::mutex eq_mutex_; + mutable bool eq_loaded_ = false; + mutable std::vector> eq_groups_; + mutable std::function(const StructLike&)> eq_deleted_row_filter_cache_; +}; + +} // namespace iceberg diff --git a/src/iceberg/data/meson.build b/src/iceberg/data/meson.build index 0f68deccf..f0877ec64 100644 --- a/src/iceberg/data/meson.build +++ b/src/iceberg/data/meson.build @@ -18,6 +18,7 @@ install_headers( [ 'data_writer.h', + 'delete_filter.h', 'delete_loader.h', 'equality_delete_writer.h', 'position_delete_writer.h', diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index c2947f3fe..0b5f269d5 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -142,6 +142,7 @@ iceberg_sources = files( iceberg_data_sources = files( 'data/data_writer.cc', + 'data/delete_filter.cc', 'data/delete_loader.cc', 'data/equality_delete_writer.cc', 'data/position_delete_writer.cc', diff --git a/src/iceberg/metadata_columns.h b/src/iceberg/metadata_columns.h index 61f07c488..b390a50e8 100644 --- a/src/iceberg/metadata_columns.h +++ b/src/iceberg/metadata_columns.h @@ -50,7 +50,7 @@ struct ICEBERG_EXPORT MetadataColumns { constexpr static int32_t kIsDeletedColumnId = kInt32Max - 3; inline static const SchemaField kIsDeleted = SchemaField::MakeRequired( - kIsDeletedColumnId, "_deleted", binary(), "Whether the row has been deleted"); + kIsDeletedColumnId, "_deleted", boolean(), "Whether the row has been deleted"); constexpr static int32_t kSpecIdColumnId = kInt32Max - 4; inline static const SchemaField kSpecId = diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 1d80b29a5..afafc4c14 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -220,6 +220,7 @@ if(ICEBERG_BUILD_BUNDLE) USE_BUNDLE SOURCES data_writer_test.cc + delete_filter_test.cc delete_loader_test.cc) endif() diff --git a/src/iceberg/test/delete_filter_test.cc b/src/iceberg/test/delete_filter_test.cc new file mode 100644 index 000000000..89d1b6b85 --- /dev/null +++ b/src/iceberg/test/delete_filter_test.cc @@ -0,0 +1,1625 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/data/delete_filter.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/data/equality_delete_writer.h" +#include "iceberg/data/position_delete_writer.h" +#include "iceberg/file_format.h" +#include "iceberg/file_reader.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/metadata_columns.h" +#include "iceberg/parquet/parquet_register.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/arrow_array_wrapper.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/schema_internal.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/type.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +struct ExportedBatch { + ArrowSchema schema{}; + ArrowArray array{}; + + ExportedBatch() = default; + ~ExportedBatch() { + if (array.release != nullptr) { + array.release(&array); + } + if (schema.release != nullptr) { + schema.release(&schema); + } + } + + ExportedBatch(const ExportedBatch&) = delete; + ExportedBatch& operator=(const ExportedBatch&) = delete; + + ExportedBatch(ExportedBatch&& other) noexcept + : schema(other.schema), array(other.array) { + other.schema.release = nullptr; + other.array.release = nullptr; + } + ExportedBatch& operator=(ExportedBatch&& other) noexcept = delete; +}; + +std::vector FieldNames(const Schema& schema) { + std::vector names; + for (const auto& field : schema.fields()) { + names.emplace_back(field.name()); + } + return names; +} + +std::vector FieldIds(const Schema& schema) { + std::vector ids; + for (const auto& field : schema.fields()) { + ids.push_back(field.field_id()); + } + return ids; +} + +std::vector StructFieldIds(const StructType& struct_type) { + std::vector ids; + for (const auto& field : struct_type.fields()) { + ids.push_back(field.field_id()); + } + return ids; +} + +void ExpectAliveRows(const AliveRowSelection& alive, + const std::vector& expected) { + ASSERT_EQ(alive.alive_count(), static_cast(expected.size())); + EXPECT_EQ(alive.indices, expected); +} + +class CapturingReader : public Reader { + public: + explicit CapturingReader(std::shared_ptr* projection) + : projection_(projection) {} + + Status Open(const ReaderOptions& options) override { + *projection_ = options.projection; + return {}; + } + + Status Close() override { return {}; } + + Result> Next() override { return std::nullopt; } + + Result Schema() override { + ArrowSchema schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(**projection_, &schema)); + return schema; + } + + Result> Metadata() override { + return std::unordered_map{}; + } + + private: + std::shared_ptr* projection_; +}; + +class ScopedReaderFactory { + public: + ScopedReaderFactory(FileFormatType format_type, ReaderFactory factory) + : format_type_(format_type), + previous_(ReaderFactoryRegistry::GetFactory(format_type)) { + ReaderFactoryRegistry::GetFactory(format_type_) = std::move(factory); + } + + ~ScopedReaderFactory() { + ReaderFactoryRegistry::GetFactory(format_type_) = std::move(previous_); + } + + private: + FileFormatType format_type_; + ReaderFactory previous_; +}; + +} // namespace + +class DeleteFilterTest : public ::testing::Test { + protected: + static void SetUpTestSuite() { parquet::RegisterAll(); } + + void SetUp() override { + file_io_ = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); + table_schema_ = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "category", string())}); + partition_spec_ = PartitionSpec::Unpartitioned(); + } + + std::shared_ptr Project(std::initializer_list field_ids) const { + std::unordered_set ids(field_ids.begin(), field_ids.end()); + auto result = table_schema_->Project(ids); + EXPECT_TRUE(result.has_value()) << "Projection failed: " << result.error().message; + return std::move(result.value()); + } + + Result MakeBatch(const Schema& schema, + const std::string& json_data) const { + ArrowSchema type_schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(schema, &type_schema)); + auto arrow_type_result = ::arrow::ImportType(&type_schema); + if (!arrow_type_result.ok()) { + return UnknownError(arrow_type_result.status().ToString()); + } + auto struct_type = ::arrow::struct_(arrow_type_result.MoveValueUnsafe()->fields()); + auto array_result = ::arrow::json::ArrayFromJSONString(struct_type, json_data); + if (!array_result.ok()) { + return UnknownError(array_result.status().ToString()); + } + + ExportedBatch batch; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(schema, &batch.schema)); + auto export_status = + ::arrow::ExportArray(*array_result.MoveValueUnsafe(), &batch.array); + if (!export_status.ok()) { + return UnknownError(export_status.ToString()); + } + return batch; + } + + Result> PositionDeleteFile( + const std::string& path, const std::vector& positions, + const std::string& data_path = std::string(kDataPath)) { + PositionDeleteWriterOptions options{ + .path = path, + .schema = table_schema_, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .flush_threshold = 10000, + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + + ICEBERG_ASSIGN_OR_RAISE(auto writer, PositionDeleteWriter::Make(options)); + for (int64_t pos : positions) { + ICEBERG_RETURN_UNEXPECTED(writer->WriteDelete(data_path, pos)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, writer->Metadata()); + return metadata.data_files[0]; + } + + Result> EqualityDeleteFile( + const std::string& path, const std::string& json_data, + std::vector equality_field_ids) { + EqualityDeleteWriterOptions options{ + .path = path, + .schema = table_schema_, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .equality_field_ids = std::move(equality_field_ids), + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + + ICEBERG_ASSIGN_OR_RAISE(auto writer, EqualityDeleteWriter::Make(options)); + ICEBERG_ASSIGN_OR_RAISE(auto batch, MakeBatch(*table_schema_, json_data)); + ICEBERG_RETURN_UNEXPECTED(writer->Write(&batch.array)); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, writer->Metadata()); + return metadata.data_files[0]; + } + + static constexpr std::string_view kDataPath = "data.parquet"; + + std::shared_ptr file_io_; + std::shared_ptr table_schema_; + std::shared_ptr partition_spec_; +}; + +enum class RequiredSchemaRequest { + kProjectFields, + kIdAndRowPos, +}; + +struct RequiredSchemaCase { + const char* name; + RequiredSchemaRequest request; + std::vector requested_field_ids; + std::vector> equality_ids_by_file; + bool has_pos_delete; + bool need_row_pos_col; + std::vector expected_field_ids; + std::vector expected_field_names; + bool expected_has_position_deletes; + bool expected_has_equality_deletes; +}; + +template +std::string ParamName(const testing::TestParamInfo& info) { + return info.param.name; +} + +class DeleteFilterRequiredSchemaTest + : public DeleteFilterTest, + public testing::WithParamInterface { + protected: + std::shared_ptr RequestedSchema(const RequiredSchemaCase& test_case) { + switch (test_case.request) { + case RequiredSchemaRequest::kProjectFields: { + std::unordered_set ids(test_case.requested_field_ids.begin(), + test_case.requested_field_ids.end()); + auto result = table_schema_->Project(ids); + EXPECT_TRUE(result.has_value()) + << "Projection failed: " << result.error().message; + return std::move(result.value()); + } + case RequiredSchemaRequest::kIdAndRowPos: + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), MetadataColumns::kRowPosition}); + } + return nullptr; + } + + std::vector> DeleteFiles( + const RequiredSchemaCase& test_case) { + std::vector> delete_files; + for (size_t index = 0; index < test_case.equality_ids_by_file.size(); ++index) { + delete_files.push_back(std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = std::format("{}-eq-{}.parquet", test_case.name, index), + .file_format = FileFormatType::kParquet, + .equality_ids = test_case.equality_ids_by_file[index], + })); + } + if (test_case.has_pos_delete) { + delete_files.push_back(std::make_shared(DataFile{ + .content = DataFile::Content::kPositionDeletes, + .file_path = std::format("{}-pos.parquet", test_case.name), + .file_format = FileFormatType::kParquet, + })); + } + return delete_files; + } +}; + +TEST_P(DeleteFilterRequiredSchemaTest, ComputesRequiredSchema) { + const auto& test_case = GetParam(); + auto delete_files = DeleteFiles(test_case); + auto requested_schema = RequestedSchema(test_case); + + auto filter = + DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_, test_case.need_row_pos_col); + + ASSERT_THAT(filter, IsOk()); + EXPECT_EQ(filter.value()->HasPositionDeletes(), + test_case.expected_has_position_deletes); + EXPECT_EQ(filter.value()->HasEqualityDeletes(), + test_case.expected_has_equality_deletes); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), + testing::ElementsAreArray(test_case.expected_field_ids)); + EXPECT_THAT(FieldNames(*filter.value()->RequiredSchema()), + testing::ElementsAreArray(test_case.expected_field_names)); +} + +INSTANTIATE_TEST_SUITE_P( + RequiredSchema, DeleteFilterRequiredSchemaTest, + testing::Values( + RequiredSchemaCase{ + .name = "UnchangedWithoutDeletes", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {2, 1}, + .equality_ids_by_file = {}, + .has_pos_delete = false, + .need_row_pos_col = true, + .expected_field_ids = {1, 2}, + .expected_field_names = {"id", "name"}, + .expected_has_position_deletes = false, + .expected_has_equality_deletes = false, + }, + RequiredSchemaCase{ + .name = "AddsEqualityFieldsAndRowPos", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {1}, + .equality_ids_by_file = {{2}, {3, 1}}, + .has_pos_delete = true, + .need_row_pos_col = true, + .expected_field_ids = {1, 2, 3, MetadataColumns::kFilePositionColumnId}, + .expected_field_names = {"id", "name", "category", + std::string(MetadataColumns::kRowPosition.name())}, + .expected_has_position_deletes = true, + .expected_has_equality_deletes = true, + }, + RequiredSchemaCase{ + .name = "AddsEqualityFieldsInDeclaredOrder", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {1}, + .equality_ids_by_file = {{3, 2}}, + .has_pos_delete = false, + .need_row_pos_col = true, + .expected_field_ids = {1, 3, 2}, + .expected_field_names = {"id", "category", "name"}, + .expected_has_position_deletes = false, + .expected_has_equality_deletes = true, + }, + RequiredSchemaCase{ + .name = "DeduplicatesRowPos", + .request = RequiredSchemaRequest::kIdAndRowPos, + .requested_field_ids = {}, + .equality_ids_by_file = {}, + .has_pos_delete = true, + .need_row_pos_col = true, + .expected_field_ids = {1, MetadataColumns::kFilePositionColumnId}, + .expected_field_names = {"id", + std::string(MetadataColumns::kRowPosition.name())}, + .expected_has_position_deletes = true, + .expected_has_equality_deletes = false, + }, + RequiredSchemaCase{ + .name = "NeedRowPosColFalseOmitsPos", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {1}, + .equality_ids_by_file = {}, + .has_pos_delete = true, + .need_row_pos_col = false, + .expected_field_ids = {1}, + .expected_field_names = {"id"}, + .expected_has_position_deletes = true, + .expected_has_equality_deletes = false, + }, + RequiredSchemaCase{ + .name = "NeedRowPosColTrueAppendsPos", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {1}, + .equality_ids_by_file = {}, + .has_pos_delete = true, + .need_row_pos_col = true, + .expected_field_ids = {1, MetadataColumns::kFilePositionColumnId}, + .expected_field_names = {"id", + std::string(MetadataColumns::kRowPosition.name())}, + .expected_has_position_deletes = true, + .expected_has_equality_deletes = false, + }, + RequiredSchemaCase{ + .name = "AddsFieldsInJavaOrder", + .request = RequiredSchemaRequest::kProjectFields, + .requested_field_ids = {1}, + .equality_ids_by_file = {{2}, {3}}, + .has_pos_delete = true, + .need_row_pos_col = true, + .expected_field_ids = {1, 2, 3, MetadataColumns::kFilePositionColumnId}, + .expected_field_names = {"id", "name", "category", + std::string(MetadataColumns::kRowPosition.name())}, + .expected_has_position_deletes = true, + .expected_has_equality_deletes = true, + }), + ParamName); + +TEST_F(DeleteFilterTest, EqualityFieldsCanBeTopLevelPrimitiveOrNestedPrimitive) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", struct_({SchemaField::MakeOptional(5, "city", string())}))}); + auto requested_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + auto eq_by_struct = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-id.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {1}, + }); + + std::vector> top_level_primitive_delete = {eq_by_struct}; + auto top_level_filter = + DeleteFilter::Make(std::string(kDataPath), top_level_primitive_delete, + nested_schema, requested_schema, file_io_); + ASSERT_THAT(top_level_filter, IsOk()); + EXPECT_THAT(FieldIds(*top_level_filter.value()->RequiredSchema()), + testing::ElementsAre(1)); + + auto eq_by_nested_field = std::make_shared(*eq_by_struct); + eq_by_nested_field->equality_ids = {5}; + std::vector> nested_delete = {eq_by_nested_field}; + + auto nested_filter = DeleteFilter::Make(std::string(kDataPath), nested_delete, + nested_schema, requested_schema, file_io_); + + ASSERT_THAT(nested_filter, IsOk()); + EXPECT_THAT(FieldIds(*nested_filter.value()->RequiredSchema()), + testing::ElementsAre(1, 4)); +} + +TEST_F(DeleteFilterTest, RequiredSchemaMergesNestedSibling) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}); + auto requested_schema = std::shared_ptr( + nested_schema->Project(std::unordered_set{1, 5}).value()); + auto eq_by_state = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-state.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {6}, + }); + std::vector> delete_files = {eq_by_state}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + + ASSERT_THAT(filter, IsOk()); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 4)); + const auto& info = filter.value()->RequiredSchema()->fields()[1]; + auto info_type = std::dynamic_pointer_cast(info.type()); + ASSERT_NE(info_type, nullptr); + EXPECT_THAT(StructFieldIds(*info_type), testing::ElementsAre(5, 6)); +} + +TEST_F(DeleteFilterTest, StructEqualityFieldErrors) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}); + auto requested_schema = std::shared_ptr( + nested_schema->Project(std::unordered_set{1, 5}).value()); + auto eq_by_info = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-info.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {4}, + }); + std::vector> delete_files = {eq_by_info}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(filter, HasErrorMessage("must reference a primitive field")); +} + +enum class AliveRowsDeleteKind { + kNone, + kPosition, + kEqualityName, + kEqualityNameAndCategory, + kMixedPositionAndEqualityId, +}; + +enum class CounterMode { + kNone, + kAttachCounter, + kNullCounter, +}; + +struct AliveRowsCase { + const char* name; + AliveRowsDeleteKind delete_kind; + std::vector position_delete_positions; + std::string position_delete_data_path; + bool need_row_pos_col; + CounterMode counter_mode; + std::string batch_json; + std::vector expected_alive_rows; + std::optional expected_delete_count; +}; + +class DeleteFilterAliveRowsTest : public DeleteFilterTest, + public testing::WithParamInterface {}; + +TEST_P(DeleteFilterAliveRowsTest, ComputesAliveRows) { + const auto& test_case = GetParam(); + std::vector> delete_files; + switch (test_case.delete_kind) { + case AliveRowsDeleteKind::kNone: + break; + case AliveRowsDeleteKind::kPosition: { + auto data_path = test_case.position_delete_data_path.empty() + ? std::string(kDataPath) + : test_case.position_delete_data_path; + ICEBERG_UNWRAP_OR_FAIL( + auto pos_delete, + PositionDeleteFile(std::format("{}-pos.parquet", test_case.name), + test_case.position_delete_positions, data_path)); + delete_files.push_back(pos_delete); + break; + } + case AliveRowsDeleteKind::kEqualityName: { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile(std::format("{}-eq-name.parquet", test_case.name), + R"([[0, "Bob", "unused"]])", {2})); + delete_files.push_back(eq_by_name); + break; + } + case AliveRowsDeleteKind::kEqualityNameAndCategory: { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile(std::format("{}-eq-name.parquet", test_case.name), + R"([[0, "Bob", "unused"]])", {2})); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_category, + EqualityDeleteFile(std::format("{}-eq-category.parquet", test_case.name), + R"([[0, "unused", "red"]])", {3})); + delete_files.push_back(eq_by_name); + delete_files.push_back(eq_by_category); + break; + } + case AliveRowsDeleteKind::kMixedPositionAndEqualityId: { + ICEBERG_UNWRAP_OR_FAIL( + auto pos_delete, + PositionDeleteFile(std::format("{}-pos.parquet", test_case.name), + test_case.position_delete_positions)); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_id, + EqualityDeleteFile(std::format("{}-eq-id.parquet", test_case.name), + R"([[3, "unused", "unused"]])", {1})); + delete_files.push_back(pos_delete); + delete_files.push_back(eq_by_id); + break; + } + } + + auto requested_schema = Project({1}); + std::shared_ptr counter; + if (test_case.counter_mode == CounterMode::kAttachCounter) { + counter = std::make_shared(); + } + auto filter = + DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_, test_case.need_row_pos_col, counter); + ASSERT_THAT(filter, IsOk()); + ICEBERG_UNWRAP_OR_FAIL( + auto batch, MakeBatch(*filter.value()->RequiredSchema(), test_case.batch_json)); + + auto alive = filter.value()->ComputeAliveRows(batch.schema, batch.array); + + ASSERT_THAT(alive, IsOk()); + ExpectAliveRows(alive.value(), test_case.expected_alive_rows); + if (test_case.expected_delete_count.has_value()) { + ASSERT_NE(counter, nullptr); + EXPECT_EQ(counter->Get(), test_case.expected_delete_count.value()); + } +} + +INSTANTIATE_TEST_SUITE_P( + AliveRows, DeleteFilterAliveRowsTest, + testing::Values( + AliveRowsCase{ + .name = "AllReturnedWithoutDeletes", + .delete_kind = AliveRowsDeleteKind::kNone, + .position_delete_positions = {}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = R"([[1], [2], [3]])", + .expected_alive_rows = {0, 1, 2}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "PositionDeletesFilterByRowPos", + .delete_kind = AliveRowsDeleteKind::kPosition, + .position_delete_positions = {1, 3}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = R"([[10, 0], [20, 1], [30, 2], [40, 3]])", + .expected_alive_rows = {0, 2}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "EqualityDeletesApplyOrSemantics", + .delete_kind = AliveRowsDeleteKind::kEqualityNameAndCategory, + .position_delete_positions = {}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = + R"([[1, "Alice", "blue"], [2, "Bob", "blue"], [3, "Carol", "red"], [4, "Dan", "green"]])", + .expected_alive_rows = {0, 3}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "MixedDeletesPosBeforeEqCanDeleteAll", + .delete_kind = AliveRowsDeleteKind::kMixedPositionAndEqualityId, + .position_delete_positions = {0, 1}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = R"([[1, 0], [2, 1], [3, 2]])", + .expected_alive_rows = {}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "EmptyBatchReturnsEmptyBitmap", + .delete_kind = AliveRowsDeleteKind::kNone, + .position_delete_positions = {}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = R"([])", + .expected_alive_rows = {}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "NeedRowPosColFalseSkipsPosFiltering", + .delete_kind = AliveRowsDeleteKind::kPosition, + .position_delete_positions = {0, 1}, + .position_delete_data_path = "", + .need_row_pos_col = false, + .counter_mode = CounterMode::kNone, + .batch_json = R"([[10], [20], [30]])", + .expected_alive_rows = {0, 1, 2}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "CounterCountsPosDeletes", + .delete_kind = AliveRowsDeleteKind::kPosition, + .position_delete_positions = {0, 2}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kAttachCounter, + .batch_json = R"([[10, 0], [20, 1], [30, 2], [40, 3]])", + .expected_alive_rows = {1, 3}, + .expected_delete_count = 2, + }, + AliveRowsCase{ + .name = "CounterCountsEqDeletes", + .delete_kind = AliveRowsDeleteKind::kEqualityName, + .position_delete_positions = {}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kAttachCounter, + .batch_json = R"([[1, "Alice"], [2, "Bob"], [3, "Bob"], [4, "Dan"]])", + .expected_alive_rows = {0, 3}, + .expected_delete_count = 2, + }, + AliveRowsCase{ + .name = "NullCounterIsNoOp", + .delete_kind = AliveRowsDeleteKind::kPosition, + .position_delete_positions = {0}, + .position_delete_data_path = "", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNullCounter, + .batch_json = R"([[10, 0], [20, 1]])", + .expected_alive_rows = {1}, + .expected_delete_count = std::nullopt, + }, + AliveRowsCase{ + .name = "PosDeleteOnlyFiltersMatchingPath", + .delete_kind = AliveRowsDeleteKind::kPosition, + .position_delete_positions = {0, 1, 2}, + .position_delete_data_path = "other-data.parquet", + .need_row_pos_col = true, + .counter_mode = CounterMode::kNone, + .batch_json = R"([[10, 0], [20, 1], [30, 2]])", + .expected_alive_rows = {0, 1, 2}, + .expected_delete_count = std::nullopt, + }), + ParamName); + +TEST_F(DeleteFilterTest, TopLevelStructEqualityErrors) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", struct_({SchemaField::MakeOptional(5, "city", string())}))}); + auto requested_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + + auto eq_by_info = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-info.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {4}, + }); + std::vector> delete_files = {eq_by_info}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(filter, HasErrorMessage("must reference a primitive field")); +} + +TEST_F(DeleteFilterTest, NestedStructFieldEqualityFiltersRows) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}); + auto requested_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + + EqualityDeleteWriterOptions options{ + .path = "eq-city.parquet", + .schema = nested_schema, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .equality_field_ids = {5}, + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + ICEBERG_UNWRAP_OR_FAIL(auto writer, EqualityDeleteWriter::Make(options)); + ICEBERG_UNWRAP_OR_FAIL( + auto delete_batch, + MakeBatch(*nested_schema, + R"([{"id": 0, "info": {"city": "Paris", "state": "FR"}}])")); + ASSERT_THAT(writer->Write(&delete_batch.array), IsOk()); + ASSERT_THAT(writer->Close(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto eq_by_city_meta, writer->Metadata()); + auto eq_by_city = eq_by_city_meta.data_files[0]; + + std::vector> delete_files = {eq_by_city}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 4)); + + ICEBERG_UNWRAP_OR_FAIL(auto data_batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([{"id": 1, "info": {"city": "London"}}, + {"id": 2, "info": {"city": "Paris"}}, + {"id": 3, "info": null}])")); + + auto alive = filter.value()->ComputeAliveRows(data_batch.schema, data_batch.array); + + ASSERT_THAT(alive, IsOk()); + ExpectAliveRows(alive.value(), {0, 2}); +} + +TEST_F(DeleteFilterTest, NestedEqualityWithPartialStructNoOverDelete) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}); + auto requested_schema = std::shared_ptr( + nested_schema->Project(std::unordered_set{1, 5}).value()); + + EqualityDeleteWriterOptions options{ + .path = "eq-state-partial.parquet", + .schema = nested_schema, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .equality_field_ids = {6}, + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + ICEBERG_UNWRAP_OR_FAIL(auto writer, EqualityDeleteWriter::Make(options)); + ICEBERG_UNWRAP_OR_FAIL( + auto delete_batch, + MakeBatch(*nested_schema, + R"([{"id": 0, "info": {"city": "ignored", "state": "CA"}}])")); + ASSERT_THAT(writer->Write(&delete_batch.array), IsOk()); + ASSERT_THAT(writer->Close(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto eq_by_state_meta, writer->Metadata()); + auto eq_by_state = eq_by_state_meta.data_files[0]; + + std::vector> delete_files = {eq_by_state}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto data_batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([{"id": 1, "info": {"city": "SF", "state": "CA"}}, + {"id": 2, "info": {"city": "NYC", "state": "NY"}}, + {"id": 3, "info": null}])")); + + auto alive = filter.value()->ComputeAliveRows(data_batch.schema, data_batch.array); + + ASSERT_THAT(alive, IsOk()); + ExpectAliveRows(alive.value(), {1, 2}); +} + +TEST_F(DeleteFilterTest, EqualityDeleteProjectionSortsNestedFieldsById) { + auto nested_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(6, "state", string()), + SchemaField::MakeOptional(5, "city", string())}))}); + auto requested_schema = std::shared_ptr( + nested_schema->Project(std::unordered_set{1}).value()); + auto eq_delete = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-city-state.orc", + .file_format = FileFormatType::kOrc, + .equality_ids = {6, 5}, + }); + std::vector> delete_files = {eq_delete}; + + std::shared_ptr captured_projection; + ScopedReaderFactory reader_factory( + FileFormatType::kOrc, [&captured_projection]() -> Result> { + return std::make_unique(&captured_projection); + }); + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, nested_schema, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + ASSERT_THAT(filter.value()->EqDeletedRowFilter(), IsOk()); + + ASSERT_NE(captured_projection, nullptr); + ASSERT_EQ(captured_projection->fields().size(), 1); + auto info_type = + std::dynamic_pointer_cast(captured_projection->fields()[0].type()); + ASSERT_NE(info_type, nullptr); + EXPECT_THAT(StructFieldIds(*info_type), testing::ElementsAre(5, 6)); +} + +TEST_F(DeleteFilterTest, DroppedTopLevelFieldResolvedBySchemas) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}, + /*schema_id=*/2); + auto historic_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "dropped_value", string())}, + /*schema_id=*/1); + auto requested_schema = current_schema; + auto eq_by_dropped = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-dropped.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {7}, + }); + std::vector> delete_files = {eq_by_dropped}; + std::vector> schemas = {current_schema, historic_schema}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, current_schema, + requested_schema, file_io_, schemas); + + ASSERT_THAT(filter, IsOk()); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 7)); + EXPECT_THAT(FieldNames(*filter.value()->RequiredSchema()), + testing::ElementsAre("id", "dropped_value")); +} + +TEST_F(DeleteFilterTest, MakeFieldLookupSchemasMayIncludeCurrent) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "current_value", string())}, + /*schema_id=*/2); + auto old_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "old_value", int32())}, + /*schema_id=*/1); + std::vector> schemas = {old_schema, current_schema}; + + auto lookup_result = DeleteFilter::MakeFieldLookup(current_schema, schemas); + ASSERT_THAT(lookup_result, IsOk()); + + auto field_result = lookup_result.value()(7); + ASSERT_THAT(field_result, IsOk()); + ASSERT_TRUE(field_result.value().has_value()); + EXPECT_EQ(field_result.value()->field.name(), "current_value"); + EXPECT_EQ(field_result.value()->field.type()->type_id(), TypeId::kString); +} + +TEST_F(DeleteFilterTest, MakeFieldLookupCurrentSchemaWins) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "current_value", string())}, + /*schema_id=*/3); + auto fallback_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "fallback_value", int32())}, + /*schema_id=*/2); + std::vector> schemas = {fallback_schema}; + + auto lookup_result = DeleteFilter::MakeFieldLookup(current_schema, schemas); + ASSERT_THAT(lookup_result, IsOk()); + + auto field_result = lookup_result.value()(7); + ASSERT_THAT(field_result, IsOk()); + ASSERT_TRUE(field_result.value().has_value()); + EXPECT_EQ(field_result.value()->field.name(), "current_value"); + EXPECT_EQ(field_result.value()->field.type()->type_id(), TypeId::kString); +} + +TEST_F(DeleteFilterTest, MakeFieldLookupLatestFallbackSchemaWins) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}, + /*schema_id=*/3); + auto older_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "old_value", int32())}, + /*schema_id=*/1); + auto newer_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "new_value", string())}, + /*schema_id=*/2); + std::vector> schemas = {older_schema, newer_schema}; + + auto lookup_result = DeleteFilter::MakeFieldLookup(current_schema, schemas); + ASSERT_THAT(lookup_result, IsOk()); + + auto field_result = lookup_result.value()(7); + ASSERT_THAT(field_result, IsOk()); + ASSERT_TRUE(field_result.value().has_value()); + EXPECT_EQ(field_result.value()->field.name(), "new_value"); + EXPECT_EQ(field_result.value()->field.type()->type_id(), TypeId::kString); +} + +TEST_F(DeleteFilterTest, DroppedNestedFieldResolvedBySchemas) { + auto current_schema = std::make_shared( + std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", struct_({SchemaField::MakeOptional(5, "city", string())}))}, + /*schema_id=*/2); + auto historic_schema = std::make_shared( + std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}, + /*schema_id=*/1); + auto requested_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + auto eq_by_dropped_nested = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-dropped-state.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {6}, + }); + std::vector> delete_files = {eq_by_dropped_nested}; + std::vector> schemas = {current_schema, historic_schema}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, current_schema, + requested_schema, file_io_, schemas); + + ASSERT_THAT(filter, IsOk()); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 4)); + const auto& info = filter.value()->RequiredSchema()->fields()[1]; + auto info_type = std::dynamic_pointer_cast(info.type()); + ASSERT_NE(info_type, nullptr); + EXPECT_THAT(StructFieldIds(*info_type), testing::ElementsAre(6)); +} + +TEST_F(DeleteFilterTest, MetadataLookupUsesSchemas) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}, + /*schema_id=*/2); + auto historic_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "dropped_value", string())}, + /*schema_id=*/1); + auto metadata = std::make_shared(TableMetadata{ + .format_version = TableMetadata::kDefaultTableFormatVersion, + .schemas = {historic_schema, current_schema}, + .current_schema_id = current_schema->schema_id(), + }); + auto requested_schema = current_schema; + auto eq_by_dropped = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-dropped.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {7}, + }); + std::vector> delete_files = {eq_by_dropped}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, metadata, + requested_schema, file_io_); + + ASSERT_THAT(filter, IsOk()); + EXPECT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 7)); +} + +TEST_F(DeleteFilterTest, MetadataLookupPrefersLatestFallbackSchema) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}, + /*schema_id=*/3); + auto older_historic_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "old_name", int32())}, + /*schema_id=*/1); + auto newer_historic_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "new_name", string())}, + /*schema_id=*/2); + auto metadata = std::make_shared(TableMetadata{ + .format_version = TableMetadata::kDefaultTableFormatVersion, + .schemas = {older_historic_schema, newer_historic_schema, current_schema}, + .current_schema_id = current_schema->schema_id(), + }); + auto eq_by_dropped = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-dropped.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {7}, + }); + std::vector> delete_files = {eq_by_dropped}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, metadata, + current_schema, file_io_); + + ASSERT_THAT(filter, IsOk()); + ASSERT_THAT(FieldIds(*filter.value()->RequiredSchema()), testing::ElementsAre(1, 7)); + const auto& dropped_field = filter.value()->RequiredSchema()->fields()[1]; + EXPECT_EQ(dropped_field.name(), "new_name"); + EXPECT_EQ(dropped_field.type()->type_id(), TypeId::kString); +} + +TEST_F(DeleteFilterTest, DroppedNestedFieldFiltersRowsWithSchemas) { + auto current_schema = std::make_shared( + std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", struct_({SchemaField::MakeOptional(5, "city", string())}))}, + /*schema_id=*/2); + auto historic_schema = std::make_shared( + std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional( + 4, "info", + struct_({SchemaField::MakeOptional(5, "city", string()), + SchemaField::MakeOptional(6, "state", string())}))}, + /*schema_id=*/1); + auto requested_schema = current_schema; + + EqualityDeleteWriterOptions options{ + .path = "eq-dropped-state-filter.parquet", + .schema = historic_schema, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .equality_field_ids = {6}, + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + ICEBERG_UNWRAP_OR_FAIL(auto writer, EqualityDeleteWriter::Make(options)); + ICEBERG_UNWRAP_OR_FAIL( + auto delete_batch, + MakeBatch(*historic_schema, + R"([{"id": 0, "info": {"city": "ignored", "state": "CA"}}])")); + ASSERT_THAT(writer->Write(&delete_batch.array), IsOk()); + ASSERT_THAT(writer->Close(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto eq_by_state_meta, writer->Metadata()); + auto eq_by_state = eq_by_state_meta.data_files[0]; + std::vector> delete_files = {eq_by_state}; + std::vector> schemas = {current_schema, historic_schema}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, current_schema, + requested_schema, file_io_, schemas); + ASSERT_THAT(filter, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto data_batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([{"id": 1, "info": {"city": "SF", "state": "CA"}}, + {"id": 2, "info": {"city": "NYC", "state": "NY"}}, + {"id": 3, "info": null}])")); + + auto alive = filter.value()->ComputeAliveRows(data_batch.schema, data_batch.array); + + ASSERT_THAT(alive, IsOk()); + ExpectAliveRows(alive.value(), {1, 2}); +} + +TEST_F(DeleteFilterTest, DeletionVectorErrorPropagatesFromCompute) { + auto dv_file = std::make_shared(DataFile{ + .content = DataFile::Content::kPositionDeletes, + .file_path = "dv.puffin", + .file_format = FileFormatType::kPuffin, + }); + std::vector> delete_files = {dv_file}; + auto requested_schema = Project({1}); + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + + ASSERT_THAT(filter, IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto batch, + MakeBatch(*filter.value()->RequiredSchema(), R"([[1, 0]])")); + auto alive = filter.value()->ComputeAliveRows(batch.schema, batch.array); + ASSERT_THAT(alive, IsError(ErrorKind::kNotSupported)); +} + +TEST_F(DeleteFilterTest, EmptyBatchPropagatesDeleteLoadErrors) { + auto dv_file = std::make_shared(DataFile{ + .content = DataFile::Content::kPositionDeletes, + .file_path = "dv-empty.puffin", + .file_format = FileFormatType::kPuffin, + }); + std::vector> delete_files = {dv_file}; + auto requested_schema = Project({1}); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto batch, + MakeBatch(*filter.value()->RequiredSchema(), R"([])")); + + auto alive = filter.value()->ComputeAliveRows(batch.schema, batch.array); + + ASSERT_THAT(alive, IsError(ErrorKind::kNotSupported)); +} + +TEST_F(DeleteFilterTest, CounterAccumulatesAcrossBatches) { + ICEBERG_UNWRAP_OR_FAIL(auto pos_delete, + PositionDeleteFile("pos-multi-batch.parquet", {1})); + std::vector> delete_files = {pos_delete}; + auto requested_schema = Project({1}); + auto counter = std::make_shared(); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_, + /*need_row_pos_col=*/true, counter); + ASSERT_THAT(filter, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto batch1, MakeBatch(*filter.value()->RequiredSchema(), + R"([[10, 0], [20, 1], [30, 2]])")); + ICEBERG_UNWRAP_OR_FAIL( + auto batch2, MakeBatch(*filter.value()->RequiredSchema(), R"([[40, 3], [50, 4]])")); + + ASSERT_THAT(filter.value()->ComputeAliveRows(batch1.schema, batch1.array), IsOk()); + ASSERT_THAT(filter.value()->ComputeAliveRows(batch2.schema, batch2.array), IsOk()); + EXPECT_EQ(counter->Get(), 1); +} + +enum class MakeErrorDeleteKind { + kNullDeleteFile, + kDataFile, + kEqualityDeleteWithEmptyIds, + kUnknownEqualityFieldId, +}; + +struct MakeErrorCase { + const char* name; + MakeErrorDeleteKind delete_kind; +}; + +class DeleteFilterMakeErrorTest : public DeleteFilterTest, + public testing::WithParamInterface {}; + +TEST_P(DeleteFilterMakeErrorTest, InvalidDeleteFilesError) { + const auto& test_case = GetParam(); + std::vector> delete_files; + switch (test_case.delete_kind) { + case MakeErrorDeleteKind::kNullDeleteFile: + delete_files.push_back(nullptr); + break; + case MakeErrorDeleteKind::kDataFile: + delete_files.push_back(std::make_shared(DataFile{ + .content = DataFile::Content::kData, + .file_path = "data.parquet", + .file_format = FileFormatType::kParquet, + })); + break; + case MakeErrorDeleteKind::kEqualityDeleteWithEmptyIds: + delete_files.push_back(std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-no-ids.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {}, + })); + break; + case MakeErrorDeleteKind::kUnknownEqualityFieldId: + delete_files.push_back(std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-unknown.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {999}, + })); + break; + } + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); +} + +INSTANTIATE_TEST_SUITE_P( + MakeErrors, DeleteFilterMakeErrorTest, + testing::Values( + MakeErrorCase{ + .name = "NullDeleteFile", + .delete_kind = MakeErrorDeleteKind::kNullDeleteFile, + }, + MakeErrorCase{ + .name = "DataFileAsDeleteFile", + .delete_kind = MakeErrorDeleteKind::kDataFile, + }, + MakeErrorCase{ + .name = "EqualityDeleteWithEmptyIds", + .delete_kind = MakeErrorDeleteKind::kEqualityDeleteWithEmptyIds, + }, + MakeErrorCase{ + .name = "UnknownEqualityFieldId", + .delete_kind = MakeErrorDeleteKind::kUnknownEqualityFieldId, + }), + ParamName); + +TEST_F(DeleteFilterTest, EqualityFieldNestedInListOrMapErrors) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(4, "tags", + list(SchemaField::MakeRequired(5, "element", string()))), + SchemaField::MakeOptional(6, "attrs", + map(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeOptional(8, "value", string())))}); + auto requested_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + + for (const auto& [field_id, nested_type] : + {std::pair{5, std::string_view("list")}, std::pair{8, std::string_view("map")}}) { + auto eq_delete = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-nested-container.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {field_id}, + }); + std::vector> delete_files = {eq_delete}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, schema, + requested_schema, file_io_); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(filter, + HasErrorMessage(std::format("must not be nested in {}", nested_type))); + } +} + +TEST_F(DeleteFilterTest, NullPosInBatchErrors) { + ICEBERG_UNWRAP_OR_FAIL(auto pos_delete, + PositionDeleteFile("pos-null-pos.parquet", {0})); + std::vector> delete_files = {pos_delete}; + auto requested_schema = Project({1}); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto batch, MakeBatch(*filter.value()->RequiredSchema(), + R"([[10, null], [20, null]])")); + + auto alive = filter.value()->ComputeAliveRows(batch.schema, batch.array); + + EXPECT_THAT(alive, IsError(ErrorKind::kInvalidArrowData)); +} + +TEST_F(DeleteFilterTest, ExpectedSchemaIsRequestedSchema) { + auto requested_schema = Project({1}); + auto eq_by_name = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-name.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {2}, + }); + std::vector> delete_files = {eq_by_name}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + EXPECT_EQ(filter.value()->ExpectedSchema(), requested_schema); + EXPECT_NE(filter.value()->RequiredSchema(), requested_schema); +} + +TEST_F(DeleteFilterTest, IncrementDeleteCountForwardsToCounter) { + std::vector> delete_files; + auto counter = std::make_shared(); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_, + /*need_row_pos_col=*/true, counter); + ASSERT_THAT(filter, IsOk()); + + filter.value()->IncrementDeleteCount(3); + filter.value()->IncrementDeleteCount(); + + EXPECT_EQ(counter->Get(), 4); +} + +TEST_F(DeleteFilterTest, DeletedRowPositionsNullWithNoPosDeletes) { + std::vector> delete_files; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto index = filter.value()->DeletedRowPositions(); + + ASSERT_THAT(index, IsOk()); + EXPECT_EQ(index.value(), nullptr); +} + +TEST_F(DeleteFilterTest, DeletedRowPositionsLazyLoads) { + ICEBERG_UNWRAP_OR_FAIL(auto pos_delete, + PositionDeleteFile("pos-index.parquet", {1, 3})); + std::vector> delete_files = {pos_delete}; + auto requested_schema = Project({1}); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto index = filter.value()->DeletedRowPositions(); + + ASSERT_THAT(index, IsOk()); + ASSERT_NE(index.value(), nullptr); + EXPECT_TRUE(index.value()->IsDeleted(1)); + EXPECT_TRUE(index.value()->IsDeleted(3)); + EXPECT_FALSE(index.value()->IsDeleted(0)); + EXPECT_FALSE(index.value()->IsDeleted(2)); +} + +TEST_F(DeleteFilterTest, EqDeletedRowFilterTrueWithNoEqDeletes) { + std::vector> delete_files; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto predicate_result = filter.value()->EqDeletedRowFilter(); + + ASSERT_THAT(predicate_result, IsOk()); + ASSERT_TRUE(static_cast(predicate_result.value())); + + ICEBERG_UNWRAP_OR_FAIL(auto batch, MakeBatch(*filter.value()->RequiredSchema(), + R"([[1, "Alice", "blue"]])")); + ICEBERG_UNWRAP_OR_FAIL(auto row, ArrowArrayStructLike::Make(batch.schema, batch.array)); + ICEBERG_UNWRAP_OR_FAIL(auto alive, predicate_result.value()(*row)); + EXPECT_TRUE(alive); +} + +TEST_F(DeleteFilterTest, EqDeletedRowFilterReturnsTrueForAliveRows) { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile("eq-filter.parquet", R"([[0, "Bob", "unused"]])", {2})); + std::vector> delete_files = {eq_by_name}; + auto requested_schema = Project({1}); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto predicate_result = filter.value()->EqDeletedRowFilter(); + ASSERT_THAT(predicate_result, IsOk()); + auto& predicate = predicate_result.value(); + ASSERT_TRUE(static_cast(predicate)); + + ICEBERG_UNWRAP_OR_FAIL(auto batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([[1, "Alice"], [2, "Bob"], [3, "Carol"]])")); + ICEBERG_UNWRAP_OR_FAIL(auto row, ArrowArrayStructLike::Make(batch.schema, batch.array)); + + ICEBERG_UNWRAP_OR_FAIL(auto alice_alive, predicate(*row)); + EXPECT_TRUE(alice_alive); + + ASSERT_THAT(row->Reset(1), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto bob_alive, predicate(*row)); + EXPECT_FALSE(bob_alive); + + ASSERT_THAT(row->Reset(2), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto carol_alive, predicate(*row)); + EXPECT_TRUE(carol_alive); +} + +TEST_F(DeleteFilterTest, EqDeletedRowFilterIsCached) { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile("eq-cache.parquet", R"([[0, "Bob", "unused"]])", {2})); + std::vector> delete_files = {eq_by_name}; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto result1 = filter.value()->EqDeletedRowFilter(); + auto result2 = filter.value()->EqDeletedRowFilter(); + ASSERT_THAT(result1, IsOk()); + ASSERT_THAT(result2, IsOk()); + EXPECT_TRUE(static_cast(result1.value())); + EXPECT_TRUE(static_cast(result2.value())); +} + +TEST_F(DeleteFilterTest, FindEqDeleteRowsTrueForDeleted) { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile("eq-find.parquet", R"([[0, "Bob", "unused"]])", {2})); + std::vector> delete_files = {eq_by_name}; + auto requested_schema = Project({1}); + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + requested_schema, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto predicate_result = filter.value()->FindEqualityDeleteRows(); + ASSERT_THAT(predicate_result, IsOk()); + auto& predicate = predicate_result.value(); + ASSERT_TRUE(static_cast(predicate)); + + ICEBERG_UNWRAP_OR_FAIL(auto batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([[1, "Alice"], [2, "Bob"], [3, "Carol"]])")); + ICEBERG_UNWRAP_OR_FAIL(auto row, ArrowArrayStructLike::Make(batch.schema, batch.array)); + + ICEBERG_UNWRAP_OR_FAIL(auto alice_deleted, predicate(*row)); + EXPECT_FALSE(alice_deleted); + + ASSERT_THAT(row->Reset(1), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto bob_deleted, predicate(*row)); + EXPECT_TRUE(bob_deleted); +} + +TEST_F(DeleteFilterTest, FindEqDeleteRowsFalseWithNoEqDeletes) { + std::vector> delete_files; + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, table_schema_, + table_schema_, file_io_); + ASSERT_THAT(filter, IsOk()); + + auto predicate_result = filter.value()->FindEqualityDeleteRows(); + + ASSERT_THAT(predicate_result, IsOk()); + ASSERT_TRUE(static_cast(predicate_result.value())); + + ICEBERG_UNWRAP_OR_FAIL(auto batch, MakeBatch(*filter.value()->RequiredSchema(), + R"([[1, "Alice", "blue"]])")); + ICEBERG_UNWRAP_OR_FAIL(auto row, ArrowArrayStructLike::Make(batch.schema, batch.array)); + ICEBERG_UNWRAP_OR_FAIL(auto deleted, predicate_result.value()(*row)); + EXPECT_FALSE(deleted); +} + +TEST_F(DeleteFilterTest, ExplicitFieldLookupFiltersRows) { + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile("eq-lookup.parquet", R"([[0, "Bob", "unused"]])", {2})); + std::vector> delete_files = {eq_by_name}; + auto requested_schema = Project({1}); + + ICEBERG_UNWRAP_OR_FAIL(auto base_lookup, DeleteFilter::MakeFieldLookup(table_schema_)); + DeleteFilter::FieldLookup custom_lookup = + [base_lookup = std::move(base_lookup)]( + int32_t field_id) -> Result> { + if (field_id == 2) { + return base_lookup(field_id); + } + return std::nullopt; + }; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, requested_schema, + file_io_, std::move(custom_lookup)); + + ASSERT_THAT(filter, IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto batch, + MakeBatch(*filter.value()->RequiredSchema(), + R"([[1, "Alice"], [2, "Bob"], [3, "Carol"]])")); + + auto alive = filter.value()->ComputeAliveRows(batch.schema, batch.array); + + ASSERT_THAT(alive, IsOk()); + ExpectAliveRows(alive.value(), {0, 2}); +} + +TEST_F(DeleteFilterTest, ExplicitFieldLookupNulloptErrors) { + // A lookup that returns nullopt for the equality field must produce an error + // at Make() time (during ComputeRequiredSchema), not silently skip the field. + auto eq_by_name = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-missing.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {2}, + }); + std::vector> delete_files = {eq_by_name}; + auto requested_schema = Project({1}); + + DeleteFilter::FieldLookup empty_lookup = + [](int32_t) -> Result> { + return std::nullopt; + }; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, requested_schema, + file_io_, std::move(empty_lookup)); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(DeleteFilterTest, ExplicitFieldLookupRejectsListOrMapProjection) { + auto eq_by_element = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-element.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {5}, + }); + std::vector> delete_files = {eq_by_element}; + auto requested_schema = Project({1}); + + DeleteFilter::FieldLookup list_lookup = + [](int32_t field_id) -> Result> { + auto element = SchemaField::MakeRequired(5, "element", string()); + return DeleteFilter::FieldLookupResult{ + .field = element, + .projection_field = SchemaField::MakeOptional(4, "tags", list(element)), + }; + }; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, requested_schema, + file_io_, std::move(list_lookup)); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(filter, HasErrorMessage("must not be nested in list")); +} + +TEST_F(DeleteFilterTest, ExplicitFieldLookupSkipsExistingFields) { + // When the equality field is already in requested_schema, the custom lookup + // must NOT be called + ICEBERG_UNWRAP_OR_FAIL( + auto eq_by_name, + EqualityDeleteFile("eq-already-present.parquet", R"([[0, "Bob", "unused"]])", {2})); + std::vector> delete_files = {eq_by_name}; + auto requested_schema = Project({1, 2}); + + bool lookup_called = false; + DeleteFilter::FieldLookup tracking_lookup = + [&lookup_called]( + int32_t) -> Result> { + lookup_called = true; + return std::nullopt; // would fail if called + }; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, requested_schema, + file_io_, std::move(tracking_lookup)); + + ASSERT_THAT(filter, IsOk()); + EXPECT_FALSE(lookup_called); +} + +TEST_F(DeleteFilterTest, SchemasLookupDeduplicatesCurrentSchemaId) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}, + /*schema_id=*/2); + auto same_id_historic_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(7, "not_historic", string())}, + /*schema_id=*/2); + auto eq_by_dropped = std::make_shared(DataFile{ + .content = DataFile::Content::kEqualityDeletes, + .file_path = "eq-dropped.parquet", + .file_format = FileFormatType::kParquet, + .equality_ids = {7}, + }); + std::vector> delete_files = {eq_by_dropped}; + std::vector> schemas = {current_schema, + same_id_historic_schema}; + + auto filter = DeleteFilter::Make(std::string(kDataPath), delete_files, current_schema, + current_schema, file_io_, schemas); + + EXPECT_THAT(filter, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(filter, HasErrorMessage("Cannot find equality delete field id 7")); +} + +} // namespace iceberg From 0ca52ba1e0f582c098225bdddb4cec8166f32824 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 15:42:37 +0800 Subject: [PATCH 026/151] chore(deps): bump github/codeql-action from 4.35.2 to 4.35.3 (#647) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.2 to 4.35.3.
Release notes

Sourced from github/codeql-action's releases.

v4.35.3

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

No user facing changes.

4.35.4 - 07 May 2026

  • Update default CodeQL bundle version to 2.25.4. #3881

4.35.3 - 01 May 2026

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

4.35.1 - 27 Mar 2026

4.35.0 - 27 Mar 2026

4.34.1 - 20 Mar 2026

  • Downgrade default CodeQL bundle version to 2.24.3 due to issues with a small percentage of Actions and JavaScript analyses. #3762

4.34.0 - 20 Mar 2026

  • Added an experimental change which disables TRAP caching when improved incremental analysis is enabled, since improved incremental analysis supersedes TRAP caching. This will improve performance and reduce Actions cache usage. We expect to roll this change out to everyone in March. #3569
  • We are rolling out improved incremental analysis to C/C++ analyses that use build mode none. We expect this rollout to be complete by the end of April 2026. #3584
  • Update default CodeQL bundle version to 2.25.0. #3585

4.33.0 - 16 Mar 2026

  • Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. #3562

... (truncated)

Commits
  • e46ed2c Merge pull request #3867 from github/update-v4.35.3-8c6e48dbe
  • b73d1d1 Add changelog entry for #3853
  • 24e0bb0 Reorder changelog entries
  • ec298da Update changelog for v4.35.3
  • 8c6e48d Merge pull request #3865 from github/update-bundle/codeql-bundle-v2.25.3
  • 7190983 Add changelog note
  • 2bb2095 Update default bundle to codeql-bundle-v2.25.3
  • 7851e55 Merge pull request #3850 from github/mbg/private-registry/cloudsmith-gcp
  • 262a15f Add generic non-printable chars test for OIDC configs
  • a6109b1 Merge pull request #3853 from github/mbg/start-proxy/improved-checks
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.35.2&new-version=4.35.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 49212916a..98685f3ce 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,11 +46,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 with: category: "/language:actions" From c41c26978fde247a3e29260e8f15a0a3274c4c22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 11:22:33 +0800 Subject: [PATCH 027/151] chore(deps): bump github/codeql-action from 4.35.3 to 4.35.4 (#654) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.3 to 4.35.4.
Release notes

Sourced from github/codeql-action's releases.

v4.35.4

  • Update default CodeQL bundle version to 2.25.4. #3881
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

  • Add support for SHA-256 Git object IDs. #3893

4.35.5 - 15 May 2026

  • We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. #3899
  • For performance and accuracy reasons, improved incremental analysis will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. #3791
  • If multiple inputs are provided for the GitHub-internal analysis-kinds input, only code-scanning will be enabled. The analysis-kinds input is experimental, for GitHub-internal use only, and may change without notice at any time. #3892
  • Added an experimental change which, when running a Code Scanning analysis for a PR with improved incremental analysis enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. #3880

4.35.4 - 07 May 2026

  • Update default CodeQL bundle version to 2.25.4. #3881

4.35.3 - 01 May 2026

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

4.35.1 - 27 Mar 2026

4.35.0 - 27 Mar 2026

4.34.1 - 20 Mar 2026

  • Downgrade default CodeQL bundle version to 2.24.3 due to issues with a small percentage of Actions and JavaScript analyses. #3762

4.34.0 - 20 Mar 2026

... (truncated)

Commits
  • 68bde55 Merge pull request #3885 from github/update-v4.35.4-803d9e8c3
  • 9739ad2 Update changelog for v4.35.4
  • 803d9e8 Merge pull request #3883 from github/mbg/test/macro-wrapper
  • 0fd9c7d Merge pull request #3882 from github/dependabot/github_actions/dot-github/wor...
  • 922d6fb Use makeMacro instead of test.macro
  • df77e87 Update test macro snippet
  • 6e3f985 Add wrapper for test.macro
  • e7a347d Merge pull request #3881 from github/update-bundle/codeql-bundle-v2.25.4
  • 17eabb2 Rebuild
  • aaef09c Bump ruby/setup-ruby
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.35.3&new-version=4.35.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 98685f3ce..6f25d0c9b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,11 +46,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 + uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3 + uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 with: category: "/language:actions" From d690aaa8037fda0269caac873d4d018cf291baf8 Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Mon, 18 May 2026 14:42:51 +0800 Subject: [PATCH 028/151] build: sync Meson project version with CMake (#655) Update the Meson project version from 0.2.0 to 0.3.0 to match the CMake project version. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 68dcaa0e4..69ef47a25 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ project( 'iceberg', 'cpp', - version: '0.2.0', + version: '0.3.0', license: 'Apache-2.0', meson_version: '>=1.3.0', default_options: [ From 83aa9884555fbdb37d6e171dea54606bac38531a Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Wed, 20 May 2026 07:40:21 +0200 Subject: [PATCH 029/151] fix: preserve snapshot ID width in UseRef (#661) ## Summary - keep `UseRef()` snapshot IDs as `int64_t` while resolving refs - add a regression test for a ref pointing at `INT32_MAX + 42` ## Root Cause `TableScanBuilder::UseRef()` copied `SnapshotRef::snapshot_id` into an `int32_t`, even though snapshot IDs are modeled as `int64_t` in refs, metadata lookup, and scan context. ## Testing - `uvx cmake --build build --target scan_test -j 8` - `./build/src/iceberg/test/scan_test --gtest_filter=*UseRefPreservesInt64SnapshotIds*` - `./build/src/iceberg/test/scan_test` Fixes #660 --- src/iceberg/table_scan.cc | 2 +- src/iceberg/test/table_scan_test.cc | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index f61bd3a0c..71075d90a 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -430,7 +430,7 @@ TableScanBuilder& TableScanBuilder::UseRef(const std::string auto iter = metadata_->refs.find(ref); ICEBERG_BUILDER_CHECK(iter != metadata_->refs.end(), "Cannot find ref {}", ref); ICEBERG_BUILDER_CHECK(iter->second != nullptr, "Ref {} is null", ref); - int32_t snapshot_id = iter->second->snapshot_id; + const int64_t snapshot_id = iter->second->snapshot_id; ICEBERG_BUILDER_ASSIGN_OR_RETURN(std::ignore, metadata_->SnapshotById(snapshot_id)); context_.snapshot_id = snapshot_id; diff --git a/src/iceberg/test/table_scan_test.cc b/src/iceberg/test/table_scan_test.cc index e4a3d21f4..11905a870 100644 --- a/src/iceberg/test/table_scan_test.cc +++ b/src/iceberg/test/table_scan_test.cc @@ -17,6 +17,7 @@ * under the License. */ +#include #include #include #include @@ -205,6 +206,30 @@ TEST_P(TableScanTest, TableScanBuilderOptions) { EXPECT_EQ(snapshot->snapshot_id, 1000L); } +TEST_P(TableScanTest, UseRefPreservesInt64SnapshotIds) { + constexpr int64_t kLargeSnapshotId = + static_cast(std::numeric_limits::max()) + 42; + table_metadata_->snapshots.push_back(std::make_shared( + Snapshot{.snapshot_id = kLargeSnapshotId, + .parent_snapshot_id = table_metadata_->current_snapshot_id, + .sequence_number = 2L, + .timestamp_ms = TimePointMsFromUnixMs(1609459201000L), + .manifest_list = "/tmp/metadata/snap-large-2-manifest-list.avro", + .schema_id = schema_->schema_id()})); + table_metadata_->refs["branch-with-large-snapshot-id"] = std::make_shared( + SnapshotRef{.snapshot_id = kLargeSnapshotId, .retention = SnapshotRef::Branch{}}); + + ICEBERG_UNWRAP_OR_FAIL(auto builder, + DataTableScanBuilder::Make(table_metadata_, file_io_)); + builder->UseRef("branch-with-large-snapshot-id"); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + + ASSERT_TRUE(scan->context().snapshot_id.has_value()); + EXPECT_EQ(scan->context().snapshot_id.value(), kLargeSnapshotId); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, scan->snapshot()); + EXPECT_EQ(snapshot->snapshot_id, kLargeSnapshotId); +} + TEST_P(TableScanTest, TableScanBuilderValidationErrors) { // Test negative min rows ICEBERG_UNWRAP_OR_FAIL(auto builder, From bf26218098778356b9f8d703478ddd2235d7cc68 Mon Sep 17 00:00:00 2001 From: Guotao Yu Date: Wed, 20 May 2026 14:19:01 +0800 Subject: [PATCH 030/151] feat(manifest): add ManifestFilterManager and ManifestMergeManager (#652) Implement two manifest management classes for table write operations: - ManifestFilterManager: filters manifest entries by row filter expression, file path, or partition value; supports FailMissingDeletePaths validation. Rewrites manifests that contain matching files, marking entries as DELETED; passes through manifests that cannot contain matching files unchanged. - ManifestMergeManager: merges small manifests using greedy bin-packing, grouping by partition_spec_id (manifests with different specs are never merged). Oversized manifests pass through unchanged. ADDED entries from prior manifests become EXISTING when merged (matching Java semantics). --- src/iceberg/CMakeLists.txt | 2 + .../manifest/manifest_filter_manager.cc | 423 ++++++++++++++++++ .../manifest/manifest_filter_manager.h | 229 ++++++++++ .../manifest/manifest_merge_manager.cc | 191 ++++++++ src/iceberg/manifest/manifest_merge_manager.h | 114 +++++ src/iceberg/manifest/manifest_writer.h | 5 + src/iceberg/manifest/meson.build | 2 + src/iceberg/meson.build | 2 + src/iceberg/schema.cc | 2 + src/iceberg/schema.h | 2 + src/iceberg/test/CMakeLists.txt | 2 + .../test/manifest_filter_manager_test.cc | 382 ++++++++++++++++ .../test/manifest_merge_manager_test.cc | 355 +++++++++++++++ 13 files changed, 1711 insertions(+) create mode 100644 src/iceberg/manifest/manifest_filter_manager.cc create mode 100644 src/iceberg/manifest/manifest_filter_manager.h create mode 100644 src/iceberg/manifest/manifest_merge_manager.cc create mode 100644 src/iceberg/manifest/manifest_merge_manager.h create mode 100644 src/iceberg/test/manifest_filter_manager_test.cc create mode 100644 src/iceberg/test/manifest_merge_manager_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 79298b1a1..68cacebeb 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -45,8 +45,10 @@ set(ICEBERG_SOURCES location_provider.cc manifest/manifest_adapter.cc manifest/manifest_entry.cc + manifest/manifest_filter_manager.cc manifest/manifest_group.cc manifest/manifest_list.cc + manifest/manifest_merge_manager.cc manifest/manifest_reader.cc manifest/manifest_util.cc manifest/manifest_writer.cc diff --git a/src/iceberg/manifest/manifest_filter_manager.cc b/src/iceberg/manifest/manifest_filter_manager.cc new file mode 100644 index 000000000..086c94a78 --- /dev/null +++ b/src/iceberg/manifest/manifest_filter_manager.cc @@ -0,0 +1,423 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/manifest/manifest_filter_manager.h" + +#include +#include +#include + +#include "iceberg/expression/expression.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/expression/inclusive_metrics_evaluator.h" +#include "iceberg/expression/manifest_evaluator.h" +#include "iceberg/expression/residual_evaluator.h" +#include "iceberg/expression/strict_metrics_evaluator.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/partition_spec.h" +#include "iceberg/result.h" +#include "iceberg/snapshot.h" +#include "iceberg/table_metadata.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +using PartitionSpecsById = ManifestFilterManager::PartitionSpecsById; + +bool HasRowFilterExpression(const std::shared_ptr& expr) { + return expr != nullptr && expr->op() != Expression::Operation::kFalse; +} + +Result> PartitionSpecById( + const PartitionSpecsById& specs_by_id, int32_t spec_id) { + auto iter = specs_by_id.find(spec_id); + if (iter == specs_by_id.end() || iter->second == nullptr) { + return NotFound("Partition spec with ID {} is not found", spec_id); + } + return iter->second; +} + +Result FormatPartitionPath(const PartitionSpecsById& specs_by_id, + const DataFile& file, int32_t spec_id) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, PartitionSpecById(specs_by_id, spec_id)); + return spec->PartitionPath(file.partition); +} + +} // namespace + +ManifestFilterManager::ManifestFilterManager(ManifestContent content, + std::shared_ptr file_io) + : manifest_content_(content), + file_io_(std::move(file_io)), + delete_expr_(Expressions::AlwaysFalse()) {} + +ManifestFilterManager::~ManifestFilterManager() = default; + +Status ManifestFilterManager::DeleteByRowFilter(std::shared_ptr expr) { + ICEBERG_PRECHECK(expr != nullptr, "Cannot delete files using filter: null"); + ICEBERG_ASSIGN_OR_RAISE(delete_expr_, Or::MakeFolded(delete_expr_, std::move(expr))); + manifest_evaluator_cache_.clear(); + residual_evaluator_cache_.clear(); + return {}; +} + +void ManifestFilterManager::CaseSensitive(bool case_sensitive) { + case_sensitive_ = case_sensitive; + manifest_evaluator_cache_.clear(); + residual_evaluator_cache_.clear(); +} + +void ManifestFilterManager::DeleteFile(std::string_view path) { + delete_paths_.insert(std::string(path)); +} + +Status ManifestFilterManager::DeleteFile(std::shared_ptr file) { + ICEBERG_PRECHECK(file != nullptr, "Cannot delete file: null"); + delete_paths_.insert(file->file_path); + delete_files_.insert(std::move(file)); + return {}; +} + +const DataFileSet& ManifestFilterManager::FilesToBeDeleted() const { + return delete_files_; +} + +void ManifestFilterManager::DropPartition(int32_t spec_id, PartitionValues partition) { + drop_partitions_.add(spec_id, std::move(partition)); +} + +void ManifestFilterManager::FailMissingDeletePaths() { + fail_missing_delete_paths_ = true; +} + +void ManifestFilterManager::FailAnyDelete() { fail_any_delete_ = true; } + +bool ManifestFilterManager::ContainsDeletes() const { + return HasRowFilterExpression(delete_expr_) || !delete_paths_.empty() || + !drop_partitions_.empty(); +} + +Result ManifestFilterManager::CanContainDroppedFiles(const ManifestFile&) const { + // TODO(Guotao): Use the manifest descriptor to skip unrelated object-delete + // manifests once object-delete partitions are tracked separately. + // Currently, DeleteFile(std::shared_ptr) degrades to a path-based delete, + // which forces scanning all manifests. + return !delete_paths_.empty(); +} + +Result ManifestFilterManager::CanContainDroppedPartitions( + const ManifestFile& manifest) const { + if (drop_partitions_.empty()) return false; + // TODO(Guotao): Use partition_summaries bounds to skip manifests that cannot + // contain any dropped partition, instead of only matching partition spec IDs. + // Only manifests whose partition spec matches a registered drop can contain + // entries for that partition. PartitionKey is pair. + int32_t spec_id = manifest.partition_spec_id; + for (const auto& key : drop_partitions_) { + if (key.first == spec_id) return true; + } + return false; +} + +Result ManifestFilterManager::CanContainExpressionDeletes( + const ManifestFile& manifest, const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id) { + if (!HasRowFilterExpression(delete_expr_)) return false; + int32_t spec_id = manifest.partition_spec_id; + ICEBERG_ASSIGN_OR_RAISE(auto* evaluator, + GetManifestEvaluator(schema, specs_by_id, spec_id)); + return evaluator->Evaluate(manifest); +} + +Result ManifestFilterManager::CanContainDeletedFiles( + const ManifestFile& manifest, const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, bool trust_manifest_references) { + // A manifest with no live files cannot contain files to delete. + // Missing counts mean the count is unknown; treat it as possibly non-zero. + bool has_live = !manifest.added_files_count.has_value() || + manifest.added_files_count.value() > 0 || + !manifest.existing_files_count.has_value() || + manifest.existing_files_count.value() > 0; + if (!has_live) return false; + + if (trust_manifest_references) { + // TODO(Guotao): Return whether this manifest is in the referenced manifest set. + return true; + } + + ICEBERG_ASSIGN_OR_RAISE(auto can_contain_dropped_files, + CanContainDroppedFiles(manifest)); + if (can_contain_dropped_files) return true; + + ICEBERG_ASSIGN_OR_RAISE(auto can_contain_expression_deletes, + CanContainExpressionDeletes(manifest, schema, specs_by_id)); + if (can_contain_expression_deletes) return true; + + return CanContainDroppedPartitions(manifest); +} + +Result ManifestFilterManager::GetManifestEvaluator( + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + int32_t spec_id) { + auto& evaluator = manifest_evaluator_cache_[spec_id]; + if (!evaluator) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, PartitionSpecById(specs_by_id, spec_id)); + ICEBERG_ASSIGN_OR_RAISE(evaluator, ManifestEvaluator::MakeRowFilter( + delete_expr_, spec, *schema, case_sensitive_)); + } + return evaluator.get(); +} + +Result ManifestFilterManager::GetResidualEvaluator( + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + int32_t spec_id) { + auto& evaluator = residual_evaluator_cache_[spec_id]; + if (!evaluator) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, PartitionSpecById(specs_by_id, spec_id)); + ICEBERG_ASSIGN_OR_RAISE(evaluator, ResidualEvaluator::Make(delete_expr_, *spec, + *schema, case_sensitive_)); + } + return evaluator.get(); +} + +Result ManifestFilterManager::ShouldDelete(const ManifestEntry& entry, + const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + int32_t manifest_spec_id) { + if (!entry.data_file) return false; + const DataFile& file = *entry.data_file; + int32_t spec_id = file.partition_spec_id.value_or(manifest_spec_id); + + // Path-based and partition-drop checks + if (delete_paths_.count(file.file_path) || + drop_partitions_.contains(spec_id, file.partition)) { + if (fail_any_delete_) { + ICEBERG_ASSIGN_OR_RAISE(auto partition_path, + FormatPartitionPath(specs_by_id, file, spec_id)); + return InvalidArgument("Operation would delete existing data: {}", partition_path); + } + return true; + } + + if (HasRowFilterExpression(delete_expr_)) { + ICEBERG_ASSIGN_OR_RAISE(auto* residual_eval, + GetResidualEvaluator(schema, specs_by_id, spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto residual_expr, + residual_eval->ResidualFor(file.partition)); + // TODO(Guotao): Cache strict/inclusive metrics evaluators per partition residual. + ICEBERG_ASSIGN_OR_RAISE( + auto strict_eval, + StrictMetricsEvaluator::Make(residual_expr, schema, case_sensitive_)); + ICEBERG_ASSIGN_OR_RAISE(auto strict_match, strict_eval->Evaluate(file)); + if (strict_match) { + if (fail_any_delete_) { + ICEBERG_ASSIGN_OR_RAISE(auto partition_path, + FormatPartitionPath(specs_by_id, file, spec_id)); + return InvalidArgument("Operation would delete existing data: {}", + partition_path); + } + return true; + } + + ICEBERG_ASSIGN_OR_RAISE(auto incl_eval, InclusiveMetricsEvaluator::Make( + residual_expr, *schema, case_sensitive_)); + ICEBERG_ASSIGN_OR_RAISE(auto incl_match, incl_eval->Evaluate(file)); + if (incl_match) { + if (manifest_content_ == ManifestContent::kDeletes) { + return false; + } + return InvalidArgument( + "Cannot delete file where some, but not all, rows match filter: {}", + file.file_path); + } + } + + return false; +} + +bool ManifestFilterManager::CanTrustManifestReferences( + const std::vector&) const { + // TODO(Guotao): Track source manifest locations for object deletes so manifests + // outside the referenced set can be skipped before any other delete checks. + return false; +} + +Result ManifestFilterManager::FilterManifest( + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + const ManifestFile& manifest, bool trust_manifest_references, + const ManifestWriterFactory& writer_factory, + std::unordered_set& found_paths) { + ICEBERG_ASSIGN_OR_RAISE( + auto can_contain_deleted_files, + CanContainDeletedFiles(manifest, schema, specs_by_id, trust_manifest_references)); + if (!can_contain_deleted_files) { + return manifest; + } + + int32_t spec_id = manifest.partition_spec_id; + ICEBERG_ASSIGN_OR_RAISE(auto spec, PartitionSpecById(specs_by_id, spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, file_io_, schema, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); + + ICEBERG_ASSIGN_OR_RAISE(auto has_deleted_files, + ManifestHasDeletedFiles(entries, schema, specs_by_id, spec_id)); + if (!has_deleted_files) { + return manifest; + } + + return FilterManifestWithDeletedFiles(entries, spec_id, schema, specs_by_id, + writer_factory, found_paths); +} + +Result ManifestFilterManager::ManifestHasDeletedFiles( + const std::vector& entries, const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, int32_t manifest_spec_id) { + for (const auto& entry : entries) { + ICEBERG_ASSIGN_OR_RAISE(auto should_delete, + ShouldDelete(entry, schema, specs_by_id, manifest_spec_id)); + if (should_delete) { + return true; + } + } + return false; +} + +Result ManifestFilterManager::FilterManifestWithDeletedFiles( + const std::vector& entries, int32_t manifest_spec_id, + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + const ManifestWriterFactory& writer_factory, + std::unordered_set& found_paths) { + ICEBERG_ASSIGN_OR_RAISE(auto writer, + writer_factory(manifest_spec_id, manifest_content_)); + for (const auto& entry : entries) { + ICEBERG_ASSIGN_OR_RAISE(auto should_delete, + ShouldDelete(entry, schema, specs_by_id, manifest_spec_id)); + if (should_delete) { + if (entry.data_file && delete_paths_.count(entry.data_file->file_path)) { + found_paths.insert(entry.data_file->file_path); + } + if (entry.data_file) { + // TODO(Guotao): Track duplicate deletes and avoid full DataFile copies when + // summary generation can use lighter records. + delete_files_.insert(std::make_shared(*entry.data_file)); + } + ICEBERG_RETURN_UNEXPECTED(writer->WriteDeletedEntry(entry)); + } else { + ICEBERG_RETURN_UNEXPECTED(writer->WriteExistingEntry(entry)); + } + } + + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); +} + +Status ManifestFilterManager::ValidateRequiredDeletes( + const std::unordered_set& found_paths) const { + if (!fail_missing_delete_paths_) { + return {}; + } + + std::string missing; + for (const auto& path : delete_paths_) { + if (!found_paths.count(path)) { + if (!missing.empty()) missing += ", "; + missing += path; + } + } + if (!missing.empty()) { + return InvalidArgument("Missing delete paths: {}", missing); + } + return {}; +} + +Result> ManifestFilterManager::FilterManifests( + const TableMetadata& metadata, const std::shared_ptr& base_snapshot, + const ManifestWriterFactory& writer_factory) { + if (!base_snapshot) { + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes({})); + return std::vector{}; + } + + ICEBERG_PRECHECK(file_io_ != nullptr, "Cannot filter manifests: FileIO is null"); + + ICEBERG_ASSIGN_OR_RAISE( + auto list_reader, ManifestListReader::Make(base_snapshot->manifest_list, file_io_)); + ICEBERG_ASSIGN_OR_RAISE(auto all_manifests, list_reader->Files()); + + std::vector manifests; + manifests.reserve(all_manifests.size()); + for (auto& manifest : all_manifests) { + manifests.push_back(&manifest); + } + + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + TableMetadataCache metadata_cache(&metadata); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); + + return FilterManifests(schema, specs_by_id.get(), manifests, writer_factory); +} + +Result> ManifestFilterManager::FilterManifests( + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + const std::vector& input_manifests, + const ManifestWriterFactory& writer_factory) { + ICEBERG_PRECHECK(schema != nullptr, "Cannot filter manifests: schema is null"); + ICEBERG_PRECHECK(file_io_ != nullptr, "Cannot filter manifests: FileIO is null"); + + std::vector manifests; + manifests.reserve(input_manifests.size()); + for (const auto* manifest : input_manifests) { + ICEBERG_PRECHECK(manifest != nullptr, "Cannot filter manifests: manifest is null"); + if (manifest->content == manifest_content_) { + manifests.push_back(manifest); + } + } + + std::unordered_set found_paths; + if (manifests.empty()) { + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes(found_paths)); + return std::vector{}; + } + + bool trust_manifest_references = CanTrustManifestReferences(manifests); + manifest_evaluator_cache_.clear(); + residual_evaluator_cache_.clear(); + + // TODO(Guotao): Parallelize manifest filtering with per-manifest results, then + // merge found paths and deleted files after the loop. + std::vector filtered; + filtered.reserve(manifests.size()); + for (const auto* manifest_ptr : manifests) { + ICEBERG_ASSIGN_OR_RAISE( + auto filtered_manifest, + FilterManifest(schema, specs_by_id, *manifest_ptr, trust_manifest_references, + writer_factory, found_paths)); + filtered.push_back(std::move(filtered_manifest)); + } + + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes(found_paths)); + return filtered; +} + +} // namespace iceberg diff --git a/src/iceberg/manifest/manifest_filter_manager.h b/src/iceberg/manifest/manifest_filter_manager.h new file mode 100644 index 000000000..55258b2b1 --- /dev/null +++ b/src/iceberg/manifest/manifest_filter_manager.h @@ -0,0 +1,229 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/manifest/manifest_filter_manager.h +/// Filters an existing snapshot's manifest list, marking data files as DELETED +/// or EXISTING based on row-filter expressions, exact path deletes, and partition drops. + +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/util/data_file_set.h" +#include "iceberg/util/partition_value_util.h" + +namespace iceberg { + +/// \brief Filters an existing snapshot's manifest list. +/// +/// The manager accumulates delete conditions incrementally, then applies them all +/// at once in a single FilterManifests() call. Manifests that contain no deleted +/// entries are returned unchanged (no I/O). Manifests that do contain deleted +/// entries are rewritten with those entries marked DELETED. +/// +/// The manager is content-agnostic: pass ManifestContent::kData to process data +/// manifests, or ManifestContent::kDeletes to process delete manifests. +/// +/// TODO(Guotao): For ManifestContent::kDeletes, implement cleanup for orphan delete files +/// and dangling deletion vectors. +/// +/// \note This class is non-copyable and non-movable. +class ICEBERG_EXPORT ManifestFilterManager { + public: + using PartitionSpecsById = std::unordered_map>; + + ManifestFilterManager(ManifestContent content, std::shared_ptr file_io); + ~ManifestFilterManager(); + + ManifestFilterManager(const ManifestFilterManager&) = delete; + ManifestFilterManager& operator=(const ManifestFilterManager&) = delete; + + /// \brief Register a row-filter expression. + /// + /// Any manifest entry whose column metrics indicate the file may satisfy the + /// expression will be marked DELETED. + /// + /// \param expr The expression to match files against + Status DeleteByRowFilter(std::shared_ptr expr); + + /// \brief Set whether row-filter field binding is case-sensitive. + void CaseSensitive(bool case_sensitive); + + /// \brief Register an exact file path for deletion. + /// + /// Any manifest entry whose file_path matches this path will be marked DELETED. + /// + /// \param path The exact file path to delete + void DeleteFile(std::string_view path); + + /// \brief Register a file object for deletion. + /// + /// Any manifest entry whose file_path matches file->file_path will be marked + /// DELETED. The file object is retained in FilesToBeDeleted(), allowing callers + /// to enumerate deleted file objects for follow-up delete-file cleanup. + /// Duplicate registrations (same path) are silently ignored. + /// + /// \param file The data/delete file to delete (must not be null) + Status DeleteFile(std::shared_ptr file); + + /// \brief Returns the set of file objects marked for deletion by this manager. + /// + /// This includes files registered via DeleteFile(DataFile) and files discovered + /// during FilterManifests() that were deleted by path, partition, or row-filter + /// matching. Used by higher-level operations (e.g. RowDelta) to enumerate the + /// deleted data files for delete-file cleanup. + const DataFileSet& FilesToBeDeleted() const; + + /// \brief Register a partition for dropping. + /// + /// Any manifest entry whose (spec_id, partition) pair matches will be marked DELETED. + /// + /// \param spec_id The partition spec ID + /// \param partition The partition values to drop + void DropPartition(int32_t spec_id, PartitionValues partition); + + /// \brief Set a flag that makes FilterManifests() fail if any registered + /// delete path was not found in any manifest entry. + void FailMissingDeletePaths(); + + /// \brief Set a flag that makes FilterManifests() return an error if any + /// manifest entry matches a delete condition. + void FailAnyDelete(); + + /// \brief Returns true if any delete condition has been registered. + bool ContainsDeletes() const; + + /// \brief Apply all accumulated delete conditions to the base snapshot's manifests. + /// + /// Manifests that cannot possibly contain deleted files are returned unchanged. + /// Manifests that do contain deleted files are rewritten using writer_factory. + /// + /// \param metadata Table metadata (provides specs and schema for evaluators) + /// \param base_snapshot The snapshot whose manifests to filter (may be null) + /// \param writer_factory Factory to create new ManifestWriter instances + /// \return The filtered manifest list, or an error + Result> FilterManifests( + const TableMetadata& metadata, const std::shared_ptr& base_snapshot, + const ManifestWriterFactory& writer_factory); + + /// \brief Apply all accumulated delete conditions to the provided manifests. + /// + /// This overload accepts only the context needed for filtering. It is intended for + /// callers that already have the active schema, partition specs, and manifest list. + /// + /// \param schema Active schema to bind row-filter expressions and metrics evaluators + /// \param specs_by_id All partition specs keyed by spec ID + /// \param manifests Manifest descriptors to filter + /// \param writer_factory Factory to create new ManifestWriter instances + /// \return The filtered manifest list, or an error + Result> FilterManifests( + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + const std::vector& manifests, + const ManifestWriterFactory& writer_factory); + + private: + /// \brief Returns true if the manifest might contain files matching any expression. + Result CanContainExpressionDeletes(const ManifestFile& manifest, + const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id); + + /// \brief Returns true if the manifest might contain files in a dropped partition. + /// + /// Checks whether the manifest's partition_spec_id matches any spec_id registered + /// via DropPartition(). Manifests from a different spec cannot contain the dropped + /// partition values. + Result CanContainDroppedPartitions(const ManifestFile& manifest) const; + + /// \brief Returns true if the manifest might contain path-deleted files. + Result CanContainDroppedFiles(const ManifestFile& manifest) const; + + /// \brief Returns true if the manifest possibly contains any deleted file. + Result CanContainDeletedFiles(const ManifestFile& manifest, + const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + bool trust_manifest_references); + + bool CanTrustManifestReferences( + const std::vector& manifests) const; + + Result FilterManifest(const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + const ManifestFile& manifest, + bool trust_manifest_references, + const ManifestWriterFactory& writer_factory, + std::unordered_set& found_paths); + + Result ManifestHasDeletedFiles(const std::vector& entries, + const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + int32_t manifest_spec_id); + + Result FilterManifestWithDeletedFiles( + const std::vector& entries, int32_t manifest_spec_id, + const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, + const ManifestWriterFactory& writer_factory, + std::unordered_set& found_paths); + + Status ValidateRequiredDeletes( + const std::unordered_set& found_paths) const; + + /// \brief Get or create a ManifestEvaluator for the given spec. + Result GetManifestEvaluator(const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + int32_t spec_id); + + /// \brief Get or create a ResidualEvaluator for the given spec. + Result GetResidualEvaluator(const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + int32_t spec_id); + + /// \brief Check whether a single entry should be deleted. + Result ShouldDelete(const ManifestEntry& entry, + const std::shared_ptr& schema, + const PartitionSpecsById& specs_by_id, + int32_t manifest_spec_id); + + const ManifestContent manifest_content_; + std::shared_ptr file_io_; + + std::shared_ptr delete_expr_; + std::unordered_set delete_paths_; + DataFileSet delete_files_; + PartitionSet drop_partitions_; + bool fail_missing_delete_paths_{false}; + bool fail_any_delete_{false}; + bool case_sensitive_{true}; + + std::unordered_map> + manifest_evaluator_cache_; + std::unordered_map> + residual_evaluator_cache_; +}; + +} // namespace iceberg diff --git a/src/iceberg/manifest/manifest_merge_manager.cc b/src/iceberg/manifest/manifest_merge_manager.cc new file mode 100644 index 000000000..056dce3f5 --- /dev/null +++ b/src/iceberg/manifest/manifest_merge_manager.cc @@ -0,0 +1,191 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/manifest/manifest_merge_manager.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/table_metadata.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +ManifestMergeManager::ManifestMergeManager(int64_t target_size_bytes, + int32_t min_count_to_merge, bool merge_enabled) + : target_size_bytes_(target_size_bytes), + min_count_to_merge_(min_count_to_merge), + merge_enabled_(merge_enabled) {} + +Result> ManifestMergeManager::MergeManifests( + const std::vector& existing_manifests, + const std::vector& new_manifests, int64_t snapshot_id, + const TableMetadata& metadata, std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory) { + // Combine new then existing (new-first ordering is preserved in output). + auto to_manifest_ptr = [](const ManifestFile& manifest) { return &manifest; }; + auto manifest_ranges = std::array{ + new_manifests | std::views::transform(to_manifest_ptr), + existing_manifests | std::views::transform(to_manifest_ptr), + }; + + std::vector all; + all.reserve(new_manifests.size() + existing_manifests.size()); + std::ranges::copy(manifest_ranges | std::views::join, std::back_inserter(all)); + + if (all.empty() || !merge_enabled_) { + return all | + std::views::transform([](const ManifestFile* manifest) { return *manifest; }) | + std::ranges::to>(); + } + + // Track the first (newest) manifest independently per content type. + std::map first_by_content; + std::ranges::for_each(all, [&first_by_content](const ManifestFile* manifest) { + first_by_content.try_emplace(manifest->content, manifest); + }); + + // Group manifests by (partition_spec_id, content), never merging across specs or + // content types. Reverse spec ordering preserves v3 first-row-id assignment order. + using GroupKey = std::pair; + auto group_key = [](const ManifestFile* manifest) { + return GroupKey{manifest->partition_spec_id, manifest->content}; + }; + + std::map, std::greater<>> by_spec; + std::ranges::for_each(all, [&by_spec, &group_key](const ManifestFile* manifest) { + by_spec[group_key(manifest)].push_back(manifest); + }); + + std::vector result; + result.reserve(all.size()); + for (auto& [key, group] : by_spec) { + const auto* first = first_by_content.at(key.second); + ICEBERG_ASSIGN_OR_RAISE(auto merged, MergeGroup(group, first, snapshot_id, metadata, + file_io, writer_factory)); + std::ranges::move(merged, std::back_inserter(result)); + } + return result; +} + +Result> ManifestMergeManager::MergeGroup( + const std::vector& group, const ManifestFile* first, + int64_t snapshot_id, const TableMetadata& metadata, std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory) { + // Match packEnd(group, ManifestFile::length) with lookback 1: + // 1. Process manifests in reverse order (oldest-first). + // 2. Greedy forward-pack with lookback=1: emit the current bin when the next item + // doesn't fit, then start a new bin. + // 3. Reverse each bin (restoring original item order within a bin). + // 4. Reverse the bin list (newest manifest's bin ends up first). + // Effect: the newest manifest is in the first, possibly under-filled, bin. + std::vector> bins; + std::vector current_bin; + int64_t bin_size = 0; + + for (const auto* manifest : std::views::reverse(group)) { + if (!current_bin.empty() && + bin_size + manifest->manifest_length > target_size_bytes_) { + bins.push_back(std::move(current_bin)); + current_bin.clear(); + bin_size = 0; + } + current_bin.push_back(manifest); + bin_size += manifest->manifest_length; + } + if (!current_bin.empty()) { + bins.push_back(std::move(current_bin)); + } + + for (auto& bin : bins) { + std::ranges::reverse(bin); + } + std::ranges::reverse(bins); + + // Process each bin: if the bin contains the newest manifest and is too small, + // pass its contents through unchanged. + std::vector result; + result.reserve(group.size()); + // TODO(Guotao): Flush independent bins in parallel and cache successful merged bins + // for commit retries. + for (auto& bin : bins) { + bool contains_first = std::ranges::find(bin, first) != bin.end(); + if (contains_first && std::cmp_less(bin.size(), min_count_to_merge_)) { + for (const auto* manifest : bin) { + result.push_back(*manifest); + } + } else { + ICEBERG_ASSIGN_OR_RAISE( + auto merged, FlushBin(bin, snapshot_id, metadata, file_io, writer_factory)); + result.push_back(std::move(merged)); + } + } + + return result; +} + +Result ManifestMergeManager::FlushBin( + const std::vector& bin, int64_t snapshot_id, + const TableMetadata& metadata, std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory) { + // A single-manifest bin requires no merging. + if (bin.size() == 1) return *bin[0]; + + const ManifestFile& first = *bin[0]; + int32_t spec_id = first.partition_spec_id; + + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_id)); + + ICEBERG_ASSIGN_OR_RAISE(auto writer, writer_factory(spec_id, first.content)); + + for (const auto* manifest : bin) { + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(*manifest, file_io, schema, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + for (const auto& entry : entries) { + bool is_current = + entry.snapshot_id.has_value() && entry.snapshot_id.value() == snapshot_id; + if (entry.status == ManifestStatus::kDeleted) { + // Carry forward only the current snapshot's deletes; drop older tombstones. + if (is_current) { + ICEBERG_RETURN_UNEXPECTED(writer->WriteDeletedEntry(entry)); + } + } else if (entry.status == ManifestStatus::kAdded && is_current) { + // Files added by the current snapshot retain their ADDED status. + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } else { + // Files added by prior snapshots (ADDED or EXISTING) become EXISTING. + ICEBERG_RETURN_UNEXPECTED(writer->WriteExistingEntry(entry)); + } + } + } + + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); +} + +} // namespace iceberg diff --git a/src/iceberg/manifest/manifest_merge_manager.h b/src/iceberg/manifest/manifest_merge_manager.h new file mode 100644 index 000000000..16cc8d987 --- /dev/null +++ b/src/iceberg/manifest/manifest_merge_manager.h @@ -0,0 +1,114 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/manifest/manifest_merge_manager.h +/// Merges small manifests into fewer larger ones according to table properties. + +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Merges small manifests into larger ones using greedy bin-packing. +/// +/// Manifests are grouped by partition_spec_id before merging; manifests with +/// different spec IDs are never merged together. Within a group, manifests are +/// accumulated into bins until a bin would exceed target_size_bytes, at which +/// point the bin is flushed (written) and a new one started. Manifests already +/// larger than target_size_bytes pass through unchanged. +/// +/// \note This class is non-copyable and non-movable. +class ICEBERG_EXPORT ManifestMergeManager { + public: + /// \brief Construct a merge manager with the given configuration. + /// + /// \param target_size_bytes Target output manifest size in bytes + /// \param min_count_to_merge Minimum number of manifests before any merging occurs + /// \param merge_enabled Whether merging is enabled at all + ManifestMergeManager(int64_t target_size_bytes, int32_t min_count_to_merge, + bool merge_enabled); + + ManifestMergeManager(const ManifestMergeManager&) = delete; + ManifestMergeManager& operator=(const ManifestMergeManager&) = delete; + + /// \brief Merge existing and new manifests according to configured thresholds. + /// + /// Manifests are grouped by (partition_spec_id, content) — data and delete manifests + /// are never merged together. Within each group, a greedy bin-packing algorithm + /// combines manifests up to target_size_bytes. The bin that contains the newest + /// manifest for that content type is protected by min_count_to_merge: if it has fewer + /// than that many items it is passed through unchanged. + /// + /// \note Retry and rollback cleanup are handled by the caller that owns created + /// manifest paths. + /// TODO(Guotao): Add explicit replaced-manifest tracking here if callers need direct + /// access. + /// + /// \param existing_manifests Manifests already in the base snapshot + /// \param new_manifests Newly written manifests to incorporate + /// \param snapshot_id The ID of the snapshot being committed. Used to preserve + /// ADDED/DELETED status for entries written by this snapshot and to suppress + /// stale DELETED tombstones from prior snapshots. + /// \param metadata Table metadata (provides specs and schema for readers) + /// \param file_io File IO used to open existing manifests for reading + /// \param writer_factory Factory to create new ManifestWriter instances + /// \return The merged manifest list, or an error + Result> MergeManifests( + const std::vector& existing_manifests, + const std::vector& new_manifests, int64_t snapshot_id, + const TableMetadata& metadata, std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory); + + private: + /// \brief Merge a group of manifests sharing the same spec_id. + /// + /// \param first The overall first (newest) manifest across all groups, used to + /// apply the min_count_to_merge threshold on the bin that contains it. + Result> MergeGroup( + const std::vector& group, const ManifestFile* first, + int64_t snapshot_id, const TableMetadata& metadata, std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory); + + /// \brief Write a merged manifest from all manifests in a bin. + /// + /// Entries are written snapshot-aware: + /// - ADDED from snapshot_id → WriteAddedEntry (preserve status) + /// - DELETED from snapshot_id → WriteDeletedEntry (preserve tombstone) + /// - DELETED from older snapshots → dropped (stale tombstones are not carried forward) + /// - All other entries → WriteExistingEntry + Result FlushBin(const std::vector& bin, + int64_t snapshot_id, const TableMetadata& metadata, + std::shared_ptr file_io, + const ManifestWriterFactory& writer_factory); + + const int64_t target_size_bytes_; + const int32_t min_count_to_merge_; + const bool merge_enabled_; +}; + +} // namespace iceberg diff --git a/src/iceberg/manifest/manifest_writer.h b/src/iceberg/manifest/manifest_writer.h index cc57f25fc..0eaf478d0 100644 --- a/src/iceberg/manifest/manifest_writer.h +++ b/src/iceberg/manifest/manifest_writer.h @@ -22,6 +22,7 @@ /// \file iceberg/manifest/manifest_writer.h /// Data writer interface for manifest files and manifest list files. +#include #include #include #include @@ -163,6 +164,10 @@ class ICEBERG_EXPORT ManifestWriter { std::unique_ptr partition_summary_; }; +/// \brief Factory type for creating ManifestWriter instances. +using ManifestWriterFactory = std::function>( + int32_t spec_id, ManifestContent content)>; + /// \brief Write manifest files to a manifest list file. class ICEBERG_EXPORT ManifestListWriter { public: diff --git a/src/iceberg/manifest/meson.build b/src/iceberg/manifest/meson.build index 41e685ffc..d4b039a67 100644 --- a/src/iceberg/manifest/meson.build +++ b/src/iceberg/manifest/meson.build @@ -18,8 +18,10 @@ install_headers( [ 'manifest_entry.h', + 'manifest_filter_manager.h', 'manifest_group.h', 'manifest_list.h', + 'manifest_merge_manager.h', 'manifest_reader.h', 'manifest_writer.h', 'rolling_manifest_writer.h', diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 0b5f269d5..03dc24479 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -67,8 +67,10 @@ iceberg_sources = files( 'location_provider.cc', 'manifest/manifest_adapter.cc', 'manifest/manifest_entry.cc', + 'manifest/manifest_filter_manager.cc', 'manifest/manifest_group.cc', 'manifest/manifest_list.cc', + 'manifest/manifest_merge_manager.cc', 'manifest/manifest_reader.cc', 'manifest/manifest_util.cc', 'manifest/manifest_writer.cc', diff --git a/src/iceberg/schema.cc b/src/iceberg/schema.cc index 00905378a..5fdd47998 100644 --- a/src/iceberg/schema.cc +++ b/src/iceberg/schema.cc @@ -40,6 +40,8 @@ Schema::Schema(std::vector fields, int32_t schema_id) schema_id_(schema_id), cache_(std::make_unique(this)) {} +Schema::~Schema() = default; + Result> Schema::Make(std::vector fields, int32_t schema_id, std::vector identifier_field_ids) { diff --git a/src/iceberg/schema.h b/src/iceberg/schema.h index 3c84bc2af..791ed5c8f 100644 --- a/src/iceberg/schema.h +++ b/src/iceberg/schema.h @@ -57,6 +57,8 @@ class ICEBERG_EXPORT Schema : public StructType { explicit Schema(std::vector fields, int32_t schema_id = kInitialSchemaId); + ~Schema() override; + /// \brief Create a schema. /// /// \param fields The fields that make up the schema. diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index afafc4c14..791ad9be0 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -180,6 +180,7 @@ if(ICEBERG_BUILD_BUNDLE) delete_file_index_test.cc manifest_group_test.cc manifest_list_versions_test.cc + manifest_merge_manager_test.cc manifest_reader_stats_test.cc manifest_reader_test.cc manifest_writer_versions_test.cc @@ -205,6 +206,7 @@ if(ICEBERG_BUILD_BUNDLE) SOURCES expire_snapshots_test.cc fast_append_test.cc + manifest_filter_manager_test.cc name_mapping_update_test.cc snapshot_manager_test.cc transaction_test.cc diff --git a/src/iceberg/test/manifest_filter_manager_test.cc b/src/iceberg/test/manifest_filter_manager_test.cc new file mode 100644 index 000000000..7810509fa --- /dev/null +++ b/src/iceberg/test/manifest_filter_manager_test.cc @@ -0,0 +1,382 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/manifest/manifest_filter_manager.h" + +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/expression/expression.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/result.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/update/fast_append.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +class ManifestFilterManagerTest : public MinimalUpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + MinimalUpdateTestBase::SetUp(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + // Two files in different partitions (identity(x)) + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + auto f = std::make_shared(); + f->content = DataFile::Content::kData; + f->file_path = table_location_ + path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + f->file_size_in_bytes = 1024; + f->record_count = 100; + f->partition_spec_id = spec_->spec_id(); + return f; + } + + // Append files, commit, refresh, and return the current snapshot. + Result> CommitFiles( + std::vector> files) { + ICEBERG_ASSIGN_OR_RAISE(auto fa, table_->NewFastAppend()); + for (const auto& f : files) fa->AppendFile(f); + ICEBERG_RETURN_UNEXPECTED(fa->Commit()); + ICEBERG_RETURN_UNEXPECTED(table_->Refresh()); + return table_->current_snapshot(); + } + + ManifestWriterFactory MakeWriterFactory(const TableMetadata& metadata) { + auto fv = metadata.format_version; + return [this, fv, &metadata](int32_t spec_id, ManifestContent content) mutable + -> Result> { + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + auto path = + std::format("{}/metadata/flt-{}.avro", table_location_, manifest_counter_++); + return ManifestWriter::MakeWriter(fv, kTestSnapshotId, path, file_io_, spec, schema, + content); + }; + } + + ManifestFilterManager::PartitionSpecsById SpecsById(const TableMetadata& metadata) { + ManifestFilterManager::PartitionSpecsById specs_by_id; + for (const auto& spec : metadata.partition_specs) { + specs_by_id.emplace(spec->spec_id(), spec); + } + return specs_by_id; + } + + // Read all entries from a list of ManifestFiles. + Result> ReadAllEntries( + const std::vector& manifests, const TableMetadata& metadata) { + std::vector result; + for (const auto& m : manifests) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(m.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(m, file_io_, schema, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + result.insert(result.end(), entries.begin(), entries.end()); + } + return result; + } + + static constexpr int64_t kTestSnapshotId = 55555L; + int manifest_counter_ = 0; + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; +}; + +TEST_F(ManifestFilterManagerTest, NullSnapshotReturnsEmpty) { + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, nullptr, factory)); + EXPECT_TRUE(result.empty()); +} + +TEST_F(ManifestFilterManagerTest, ContainsDeletesReturnsCorrectState) { + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + EXPECT_FALSE(mgr.ContainsDeletes()); + mgr.DeleteFile("/some/path.parquet"); + EXPECT_TRUE(mgr.ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, DeleteByRowFilterRejectsNull) { + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + EXPECT_THAT(mgr.DeleteByRowFilter(nullptr), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(ManifestFilterManagerTest, DeleteFileObjectRejectsNull) { + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + std::shared_ptr null_file; + EXPECT_THAT(mgr.DeleteFile(null_file), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(ManifestFilterManagerTest, NoConditionsReturnsManifestsUnchanged) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + // Load original manifests so we can compare paths + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto orig_manifests, list_reader->Files()); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ASSERT_EQ(result.size(), orig_manifests.size()); + for (size_t i = 0; i < result.size(); ++i) { + // No rewrite → same manifest path + EXPECT_EQ(result[i].manifest_path, orig_manifests[i].manifest_path); + } +} + +TEST_F(ManifestFilterManagerTest, DeleteFileByPath) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DeleteFile(file_a_->file_path); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + int deleted_count = 0; + int live_count = 0; + for (const auto& e : entries) { + if (e.status == ManifestStatus::kDeleted) { + ++deleted_count; + ASSERT_NE(e.data_file, nullptr); + EXPECT_EQ(e.data_file->file_path, file_a_->file_path); + } else { + ++live_count; + } + } + EXPECT_EQ(deleted_count, 1); + EXPECT_EQ(live_count, 1); +} + +TEST_F(ManifestFilterManagerTest, ExplicitContextFilterManifestsDeletesByPath) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_files, list_reader->Files()); + std::vector manifests; + manifests.reserve(manifest_files.size()); + for (const auto& manifest : manifest_files) { + manifests.push_back(&manifest); + } + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DeleteFile(file_a_->file_path); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(schema_, SpecsById(*metadata), + manifests, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + int deleted_count = 0; + for (const auto& entry : entries) { + if (entry.status == ManifestStatus::kDeleted) { + ++deleted_count; + ASSERT_NE(entry.data_file, nullptr); + EXPECT_EQ(entry.data_file->file_path, file_a_->file_path); + } + } + EXPECT_EQ(deleted_count, 1); +} + +TEST_F(ManifestFilterManagerTest, RowFilterAlwaysTrueDeletesAll) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + for (const auto& e : entries) { + EXPECT_EQ(e.status, ManifestStatus::kDeleted) << "Expected all entries to be DELETED"; + } +} + +TEST_F(ManifestFilterManagerTest, RowFilterAlwaysFalseDeletesNone) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysFalse()), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + for (const auto& e : entries) { + // AlwaysFalse means nothing can match → entries remain ADDED or EXISTING + EXPECT_NE(e.status, ManifestStatus::kDeleted) << "Expected no entries to be DELETED"; + } +} + +TEST_F(ManifestFilterManagerTest, RowFilterUsesPartitionResiduals) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.CaseSensitive(false); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("X", Literal::Long(1L))), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + int deleted_count = 0; + int live_count = 0; + for (const auto& e : entries) { + ASSERT_NE(e.data_file, nullptr); + if (e.status == ManifestStatus::kDeleted) { + ++deleted_count; + EXPECT_EQ(e.data_file->file_path, file_a_->file_path); + } else { + ++live_count; + EXPECT_EQ(e.data_file->file_path, file_b_->file_path); + } + } + + EXPECT_EQ(deleted_count, 1); + EXPECT_EQ(live_count, 1); + ASSERT_EQ(mgr.FilesToBeDeleted().size(), 1U); + EXPECT_EQ(mgr.FilesToBeDeleted().begin()->get()->file_path, file_a_->file_path); +} + +TEST_F(ManifestFilterManagerTest, DropPartition) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + // Drop partition of file_a (partition_x = 1) + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DropPartition(spec_->spec_id(), + PartitionValues(std::vector{Literal::Long(1L)})); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + int deleted_count = 0; + for (const auto& e : entries) { + if (e.status == ManifestStatus::kDeleted) { + ++deleted_count; + ASSERT_TRUE(e.data_file != nullptr); + EXPECT_EQ(e.data_file->file_path, file_a_->file_path); + } + } + EXPECT_EQ(deleted_count, 1); +} + +TEST_F(ManifestFilterManagerTest, FailMissingDeletePathsReturnsError) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DeleteFile("/does/not/exist.parquet"); + mgr.FailMissingDeletePaths(); + + auto result = mgr.FilterManifests(*metadata, snap, factory); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(ManifestFilterManagerTest, FailAnyDeleteReportsPartitionPath) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DeleteFile(file_a_->file_path); + mgr.FailAnyDelete(); + + auto result = mgr.FilterManifests(*metadata, snap, factory); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("x=1")); +} + +TEST_F(ManifestFilterManagerTest, MultipleConditionsOrCombined) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + // Both files should be deleted: file_a by path, file_b by AlwaysTrue expression + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + mgr.DeleteFile(file_a_->file_path); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + for (const auto& e : entries) { + EXPECT_EQ(e.status, ManifestStatus::kDeleted); + } +} + +TEST_F(ManifestFilterManagerTest, MultipleRowFiltersUseCombinedExpression) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("y", Literal::Long(7L))), IsOk()); + ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("x", Literal::Long(1L))), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + + ASSERT_EQ(entries.size(), 1U); + EXPECT_EQ(entries[0].status, ManifestStatus::kDeleted); +} + +} // namespace iceberg diff --git a/src/iceberg/test/manifest_merge_manager_test.cc b/src/iceberg/test/manifest_merge_manager_test.cc new file mode 100644 index 000000000..b19eace86 --- /dev/null +++ b/src/iceberg/test/manifest_merge_manager_test.cc @@ -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. + */ + +#include "iceberg/manifest/manifest_merge_manager.h" + +#include +#include +#include +#include + +#include +#include + +#include "iceberg/arrow/arrow_io_util.h" +#include "iceberg/avro/avro_register.h" +#include "iceberg/file_format.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/result.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/sort_order.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/transform.h" +#include "iceberg/type.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +constexpr int8_t kFormatVersion = 2; +constexpr int64_t kSnapshotId = 12345L; +constexpr int32_t kSpecId0 = 0; +constexpr int32_t kSpecId1 = 1; + +} // namespace + +class ManifestMergeManagerTest : public ::testing::Test { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + file_io_ = arrow::MakeMockFileIO(); + + // Simple schema: one long column + schema_ = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "x", int64()), + }); + spec0_ = PartitionSpec::Make(kSpecId0, + {PartitionField(1, 1000, "x", Transform::Identity())}) + .value(); + spec1_ = PartitionSpec::Make( + kSpecId1, {PartitionField(1, 1001, "x_bucket", Transform::Bucket(8))}) + .value(); + + // Build minimal TableMetadata with both specs + auto builder = TableMetadataBuilder::BuildFromEmpty(kFormatVersion); + builder->SetCurrentSchema(schema_, schema_->HighestFieldId().value_or(0)); + builder->SetDefaultPartitionSpec(spec0_); + builder->AddPartitionSpec(spec1_); + builder->SetDefaultSortOrder(SortOrder::Unsorted()); + ICEBERG_UNWRAP_OR_FAIL(auto metadata, builder->Build()); + metadata_ = std::shared_ptr(std::move(metadata)); + } + + // Write a small manifest with N data files and return the ManifestFile descriptor. + Result WriteManifest(int32_t spec_id, int num_files, + int64_t file_size_override = 512, + ManifestContent content = ManifestContent::kData) { + auto path = std::format("manifest-{}.avro", manifest_counter_++); + auto spec = spec_id == kSpecId0 ? spec0_ : spec1_; + ICEBERG_ASSIGN_OR_RAISE(auto writer, + ManifestWriter::MakeWriter(kFormatVersion, kSnapshotId, path, + file_io_, spec, schema_, content)); + for (int i = 0; i < num_files; ++i) { + auto f = std::make_shared(); + f->content = (content == ManifestContent::kDeletes) + ? DataFile::Content::kPositionDeletes + : DataFile::Content::kData; + f->file_path = std::format("data/file-{}-{}.parquet", manifest_counter_, i); + f->file_format = FileFormatType::kParquet; + // Identity spec uses LONG partition values; Bucket spec uses INT + Literal part_val = (spec_id == kSpecId0) ? Literal::Long(i) : Literal::Int(i % 8); + f->partition = PartitionValues(std::vector{part_val}); + f->file_size_in_bytes = 1024; + f->record_count = 10; + f->partition_spec_id = spec_id; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(f)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto manifest_file, writer->ToManifestFile()); + // Override length so we can control bin-packing behaviour in tests + manifest_file.manifest_length = file_size_override; + return manifest_file; + } + + ManifestWriterFactory MakeWriterFactory() { + return [this](int32_t spec_id, + ManifestContent content) -> Result> { + ++factory_call_count_; + auto spec = spec_id == kSpecId0 ? spec0_ : spec1_; + auto path = std::format("merged-{}.avro", manifest_counter_++); + return ManifestWriter::MakeWriter(kFormatVersion, kSnapshotId, path, file_io_, spec, + schema_, content); + }; + } + + // Count total entries across all manifests. + Result CountEntries(const std::vector& manifests) { + int total = 0; + for (const auto& m : manifests) { + auto spec = m.partition_spec_id == kSpecId0 ? spec0_ : spec1_; + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(m, file_io_, schema_, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + total += static_cast(entries.size()); + } + return total; + } + + std::shared_ptr file_io_; + std::shared_ptr schema_; + std::shared_ptr spec0_; + std::shared_ptr spec1_; + std::shared_ptr metadata_; + int manifest_counter_ = 0; + int factory_call_count_ = 0; +}; + +TEST_F(ManifestMergeManagerTest, MergeDisabled) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1)); + ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/false); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr.MergeManifests({m0, m1}, {m2}, kSnapshotId, *metadata_, file_io_, + MakeWriterFactory())); + // merge disabled → all 3 manifests returned, factory never called + EXPECT_EQ(result.size(), 3U); + EXPECT_EQ(factory_call_count_, 0); +} + +TEST_F(ManifestMergeManagerTest, BelowMinCountThreshold) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1)); + + // min_count=3, only 2 manifests total → no merge + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr.MergeManifests({m0}, {m1}, kSnapshotId, *metadata_, file_io_, + MakeWriterFactory())); + EXPECT_EQ(result.size(), 2U); + EXPECT_EQ(factory_call_count_, 0); +} + +TEST_F(ManifestMergeManagerTest, MergeOccursAtThreshold) { + // 3 small manifests (each 100 bytes), target=1024 → all fit in one bin + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1, /*size=*/100)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr.MergeManifests({m0, m1}, {m2}, kSnapshotId, *metadata_, file_io_, + MakeWriterFactory())); + // All 3 merged into 1 manifest (total 3 entries) + EXPECT_EQ(result.size(), 1U); + ICEBERG_UNWRAP_OR_FAIL(auto count1, CountEntries(result)); + EXPECT_EQ(count1, 3); +} + +TEST_F(ManifestMergeManagerTest, OversizedManifestPassedThrough) { + // m_large exceeds target → must not be merged; m_small fits + ICEBERG_UNWRAP_OR_FAIL(auto m_large, WriteManifest(kSpecId0, 2, /*size=*/2000)); + ICEBERG_UNWRAP_OR_FAIL(auto m_small, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m_small2, WriteManifest(kSpecId0, 1, /*size=*/100)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr.MergeManifests({m_large, m_small}, {m_small2}, kSnapshotId, + *metadata_, file_io_, MakeWriterFactory())); + // m_large is oversized and acts as a bin boundary — the two small manifests on either + // side of it are never merged together. m_small2 (the newest) is also protected by + // minCountToMerge (size 1 < 2). All three remain separate. + EXPECT_EQ(result.size(), 3U); + ICEBERG_UNWRAP_OR_FAIL(auto count2, CountEntries(result)); + EXPECT_EQ(count2, 4); // 2 + 1 + 1 +} + +TEST_F(ManifestMergeManagerTest, CrossSpecManifestsNotMerged) { + // Manifests with different spec IDs must never be merged together + ICEBERG_UNWRAP_OR_FAIL(auto m_spec0a, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m_spec0b, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m_spec1a, WriteManifest(kSpecId1, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m_spec1b, WriteManifest(kSpecId1, 1, /*size=*/100)); + + // With 4 manifests (target large enough for each pair), we get 2 merged outputs + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL( + auto result, + mgr.MergeManifests({m_spec0a, m_spec1a}, {m_spec0b, m_spec1b}, kSnapshotId, + *metadata_, file_io_, MakeWriterFactory())); + EXPECT_EQ(result.size(), 2U); + // Verify spec IDs are preserved per output manifest + for (const auto& m : result) { + EXPECT_THAT(m.partition_spec_id, ::testing::AnyOf(kSpecId0, kSpecId1)); + } +} + +TEST_F(ManifestMergeManagerTest, WriterFactoryCalledOncePerMergedManifest) { + // 4 small manifests in two groups → 2 merged outputs → factory called twice + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId1, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m3, WriteManifest(kSpecId1, 1, /*size=*/100)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr.MergeManifests({m0, m2}, {m1, m3}, kSnapshotId, *metadata_, + file_io_, MakeWriterFactory())); + EXPECT_EQ(result.size(), 2U); + EXPECT_EQ(factory_call_count_, 2); +} + +TEST_F(ManifestMergeManagerTest, MixedContentManifestsNotMerged) { + // Data and delete manifests sharing the same spec_id must never be merged together. + // The grouping key is (spec_id, content), so they land in separate bins. + ICEBERG_UNWRAP_OR_FAIL( + auto d0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); + ICEBERG_UNWRAP_OR_FAIL( + auto d1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); + ICEBERG_UNWRAP_OR_FAIL( + auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + ICEBERG_UNWRAP_OR_FAIL( + auto del1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr.MergeManifests({d0, del0}, {d1, del1}, kSnapshotId, *metadata_, + file_io_, MakeWriterFactory())); + // 2 data → 1 merged data manifest; 2 delete → 1 merged delete manifest + EXPECT_EQ(result.size(), 2U); + int data_count = 0; + int delete_count = 0; + for (const auto& m : result) { + if (m.content == ManifestContent::kData) ++data_count; + if (m.content == ManifestContent::kDeletes) ++delete_count; + } + EXPECT_EQ(data_count, 1); + EXPECT_EQ(delete_count, 1); +} + +TEST_F(ManifestMergeManagerTest, MixedContentUsesFirstManifestPerContent) { + ICEBERG_UNWRAP_OR_FAIL( + auto d0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); + ICEBERG_UNWRAP_OR_FAIL( + auto d1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); + ICEBERG_UNWRAP_OR_FAIL( + auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + ICEBERG_UNWRAP_OR_FAIL( + auto del1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + + // Each content type's newest manifest must be protected by the threshold + // independently. + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr.MergeManifests({d0, del0}, {d1, del1}, kSnapshotId, *metadata_, + file_io_, MakeWriterFactory())); + + // Each content type has exactly two manifests, below min_count=3, so neither pair + // should be merged. + ASSERT_EQ(result.size(), 4U); + int data_count = 0; + int delete_count = 0; + for (const auto& manifest : result) { + if (manifest.content == ManifestContent::kData) { + ++data_count; + } else if (manifest.content == ManifestContent::kDeletes) { + ++delete_count; + } + } + EXPECT_EQ(data_count, 2); + EXPECT_EQ(delete_count, 2); +} + +TEST_F(ManifestMergeManagerTest, DeleteManifestsMerged) { + // Delete manifests are bin-packed and merged just like data manifests. + ICEBERG_UNWRAP_OR_FAIL( + auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + ICEBERG_UNWRAP_OR_FAIL( + auto del1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + ICEBERG_UNWRAP_OR_FAIL( + auto del2, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); + + ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr.MergeManifests({del0, del1}, {del2}, kSnapshotId, *metadata_, + file_io_, MakeWriterFactory())); + EXPECT_EQ(result.size(), 1U); + EXPECT_EQ(result[0].content, ManifestContent::kDeletes); + ICEBERG_UNWRAP_OR_FAIL(auto count, CountEntries(result)); + EXPECT_EQ(count, 3); +} + +TEST_F(ManifestMergeManagerTest, PackEndOlderManifestsMergedNotNewest) { + // packEnd semantics: for [m0_new, m1_old, m2_old] with target=250 (pairs fit but + // triples don't), packing from the end merges m1+m2 (the older pair) and leaves + // m0 (the newest) in its own under-filled bin at the front of the output. + // This is the opposite of naive forward packing, which would merge m0+m1. + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + + // target=250 fits two 100-byte manifests but not three. + // min_count=3 so m0's single-element bin is kept as-is (below threshold). + ManifestMergeManager mgr(/*target=*/250, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr.MergeManifests({m1, m2}, {m0}, kSnapshotId, *metadata_, file_io_, + MakeWriterFactory())); + // Expected: [m0 (pass-through), merged(m1+m2)] + ASSERT_EQ(result.size(), 2U); + // First output is the newest manifest m0, passed through unchanged (under-filled bin). + EXPECT_EQ(result[0].manifest_length, m0.manifest_length); + // Second output is the merged older pair — it must be a newly written manifest + // (different path than either original). + EXPECT_NE(result[1].manifest_path, m1.manifest_path); + EXPECT_NE(result[1].manifest_path, m2.manifest_path); + ICEBERG_UNWRAP_OR_FAIL(auto count, CountEntries(result)); + EXPECT_EQ(count, 3); +} + +} // namespace iceberg From 3e7b20ab8555f51105e56176af23f22641fcea18 Mon Sep 17 00:00:00 2001 From: Xinli Shang Date: Wed, 20 May 2026 08:22:49 -0700 Subject: [PATCH 031/151] feat: add IncrementalFileCleanup strategy and dispatch in ExpireSnapshots::Finalize (#648) Mirrors Java's IncrementalFileCleanup for the linear-ancestry case: each manifest is attributed to its writer snapshot, so two passes are enough instead of the full reachability scan. Cherry-pick protection via SnapshotSummaryFields::kSourceSnapshotId is preserved. Finalize() now picks IncrementalFileCleanup when the expiration is "simple" (no explicit snapshot IDs, no removed snapshots outside the current main ancestry, and no retained snapshots outside the current main ancestry), and falls back to ReachableFileCleanup otherwise. The dispatch matches Java RemoveSnapshots.cleanExpiredSnapshots. Two existing cleanup tests (DeletesExpiredFiles, IgnoresExpiredDeleteManifestReadFailures) used an empty current manifest list, which is an unreachable-orphan scenario that only ReachableFileCleanup can resolve. They now call ExpireSnapshotId() to force the reachable path, which keeps their original intent and matches Java behavior. New tests cover both dispatch branches. --------- Co-authored-by: shangxinli Co-authored-by: Claude Opus 4.6 --- src/iceberg/manifest/manifest_group.cc | 8 +- src/iceberg/manifest/manifest_reader.cc | 14 + src/iceberg/manifest/manifest_reader.h | 11 + src/iceberg/test/expire_snapshots_test.cc | 258 +++++++++++++++ src/iceberg/update/expire_snapshots.cc | 376 ++++++++++++++++++++-- src/iceberg/update/expire_snapshots.h | 1 + 6 files changed, 636 insertions(+), 32 deletions(-) diff --git a/src/iceberg/manifest/manifest_group.cc b/src/iceberg/manifest/manifest_group.cc index 220b8585c..8af717b25 100644 --- a/src/iceberg/manifest/manifest_group.cc +++ b/src/iceberg/manifest/manifest_group.cc @@ -262,14 +262,8 @@ Result> ManifestGroup::Entries() { Result> ManifestGroup::MakeReader( const ManifestFile& manifest) { - auto spec_it = specs_by_id_.find(manifest.partition_spec_id); - if (spec_it == specs_by_id_.end()) { - return InvalidArgument("Partition spec {} not found for manifest {}", - manifest.partition_spec_id, manifest.manifest_path); - } - ICEBERG_ASSIGN_OR_RAISE(auto reader, - ManifestReader::Make(manifest, io_, schema_, spec_it->second)); + ManifestReader::Make(manifest, io_, schema_, specs_by_id_)); reader->FilterRows(data_filter_) .FilterPartitions(partition_filter_) diff --git a/src/iceberg/manifest/manifest_reader.cc b/src/iceberg/manifest/manifest_reader.cc index 53100b236..7747e2be3 100644 --- a/src/iceberg/manifest/manifest_reader.cc +++ b/src/iceberg/manifest/manifest_reader.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -998,6 +999,19 @@ Result> ManifestReader::Make( manifest.first_row_id); } +Result> ManifestReader::Make( + const ManifestFile& manifest, std::shared_ptr file_io, + std::shared_ptr schema, + const std::unordered_map>& specs_by_id) { + auto spec_it = specs_by_id.find(manifest.partition_spec_id); + if (spec_it == specs_by_id.end() || spec_it->second == nullptr) { + return InvalidArgument("Partition spec {} not found for manifest {}", + manifest.partition_spec_id, manifest.manifest_path); + } + auto spec = spec_it->second; + return Make(manifest, std::move(file_io), std::move(schema), std::move(spec)); +} + Result> ManifestReader::Make( std::string_view manifest_location, std::optional manifest_length, std::shared_ptr file_io, std::shared_ptr schema, diff --git a/src/iceberg/manifest/manifest_reader.h b/src/iceberg/manifest/manifest_reader.h index 1a1420216..42c56e1c2 100644 --- a/src/iceberg/manifest/manifest_reader.h +++ b/src/iceberg/manifest/manifest_reader.h @@ -92,6 +92,17 @@ class ICEBERG_EXPORT ManifestReader { const ManifestFile& manifest, std::shared_ptr file_io, std::shared_ptr schema, std::shared_ptr spec); + /// \brief Creates a reader for a manifest file using specs keyed by ID. + /// \param manifest A ManifestFile object containing metadata about the manifest. + /// \param file_io File IO implementation to use. + /// \param schema Schema used to bind the partition type. + /// \param specs_by_id Mapping of partition spec ID to PartitionSpec. + /// \return A Result containing the reader or an error. + static Result> Make( + const ManifestFile& manifest, std::shared_ptr file_io, + std::shared_ptr schema, + const std::unordered_map>& specs_by_id); + /// \brief Creates a reader for a manifest file. /// \param manifest_location Path to the manifest file. /// \param manifest_length Length of the manifest file. diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index 4dcc72d6c..3a99b0009 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -28,6 +28,9 @@ #include "iceberg/avro/avro_register.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" #include "iceberg/statistics_file.h" #include "iceberg/table_metadata.h" #include "iceberg/test/matchers.h" @@ -135,6 +138,13 @@ class ExpireSnapshotsCleanupTest : public UpdateTestBase { return manifest_result.value(); } + ManifestFile AssignManifestSequenceNumber(ManifestFile manifest, + int64_t sequence_number) const { + manifest.sequence_number = sequence_number; + manifest.min_sequence_number = sequence_number; + return manifest; + } + ManifestFile WriteDeleteManifest(const std::string& path, int64_t snapshot_id, std::vector entries) { auto writer_result = ManifestWriter::MakeWriter( @@ -227,6 +237,15 @@ TEST_F(ExpireSnapshotsTest, ExpireById) { EXPECT_EQ(result.snapshot_ids_to_remove.at(0), 3051729675574597004); } +TEST_F(ExpireSnapshotsTest, ExpireByIdOverridesRetainLast) { + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->RetainLast(2); + update->ExpireSnapshotId(3051729675574597004); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_THAT(result.snapshot_ids_to_remove, testing::ElementsAre(3051729675574597004)); +} + TEST_F(ExpireSnapshotsTest, ExpireOlderThan) { struct TestCase { int64_t expire_older_than; @@ -243,6 +262,30 @@ TEST_F(ExpireSnapshotsTest, ExpireOlderThan) { } } +TEST_F(ExpireSnapshotsCleanupTest, RetainsUnreferencedSnapshotAtExpireThreshold) { + const int64_t unreferenced_snapshot_id = 4055729675574597004; + const int64_t expire_at_ms = 1515100955770; + + auto metadata = ReloadMetadata(); + metadata->snapshots.push_back(std::make_shared(Snapshot{ + .snapshot_id = unreferenced_snapshot_id, + .parent_snapshot_id = std::nullopt, + .sequence_number = 2, + .timestamp_ms = TimePointMsFromUnixMs(expire_at_ms), + .manifest_list = table_location_ + "/metadata/unreferenced.avro", + .summary = {{SnapshotSummaryFields::kOperation, "append"}}, + .schema_id = metadata->current_schema_id, + })); + RewriteTable(std::move(metadata)); + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireOlderThan(expire_at_ms); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + EXPECT_THAT(result.snapshot_ids_to_remove, + testing::Not(testing::Contains(unreferenced_snapshot_id))); +} + TEST_F(ExpireSnapshotsTest, FinalizeRequiresCommittedMetadata) { std::vector deleted_files; ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); @@ -350,6 +393,8 @@ TEST_F(ExpireSnapshotsCleanupTest, IgnoresExpiredDeleteManifestReadFailures) { std::vector deleted_files; ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + // Force the reachable path. + update->ExpireSnapshotId(kExpiredSnapshotId); update->DeleteWith( [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); @@ -388,6 +433,7 @@ TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredFiles) { std::vector deleted_files; ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); update->DeleteWith( [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); @@ -573,4 +619,216 @@ TEST_F(ExpireSnapshotsCleanupTest, KeepsReusedPartitionStats) { EXPECT_THAT(deleted_files, testing::Not(testing::Contains(reused_statistics_path))); } +TEST_F(ExpireSnapshotsCleanupTest, IncrementalDispatchPreservesAncestorAddedFiles) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Contains(expired_data_manifest_path)); + EXPECT_THAT(deleted_files, testing::Contains(expired_manifest_list_path)); + EXPECT_THAT(deleted_files, testing::Not(testing::Contains(expired_data_file_path))); +} + +TEST_F(ExpireSnapshotsCleanupTest, IncrementalDeletesExpiredDeletedEntries) { + const auto deleted_data_file_path = + table_location_ + "/data/deleted-by-expired.parquet"; + const auto delete_manifest_path = + table_location_ + "/metadata/expired-delete-entry.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-deleted-entry-ml.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-deleted-entry-ml.avro"; + + auto delete_manifest = WriteDataManifest( + delete_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kDeleted, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(deleted_data_file_path))}); + delete_manifest = + AssignManifestSequenceNumber(std::move(delete_manifest), kExpiredSequenceNumber); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {delete_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {delete_manifest}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::Contains(deleted_data_file_path)); + EXPECT_THAT(deleted_files, testing::Contains(expired_manifest_list_path)); + EXPECT_THAT(deleted_files, testing::Not(testing::Contains(delete_manifest_path))); +} + +TEST_F(ExpireSnapshotsCleanupTest, ReachableDispatchDeletesUnreachableData) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, + expired_manifest_list_path)); +} + +TEST_F(ExpireSnapshotsCleanupTest, IncrementalSkipsCherryPickedSnapshotCleanup) { + const auto picked_data_file_path = table_location_ + "/data/picked-data.parquet"; + const auto picked_manifest_path = table_location_ + "/metadata/picked-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-picked-ml.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-picked-ml.avro"; + + auto picked_manifest = WriteDataManifest( + picked_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(picked_data_file_path))}); + picked_manifest = + AssignManifestSequenceNumber(std::move(picked_manifest), kExpiredSequenceNumber); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {picked_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {picked_manifest}); + + auto metadata = ReloadMetadata(); + ASSERT_EQ(metadata->snapshots.size(), 2); + metadata->snapshots.at(0)->manifest_list = expired_manifest_list_path; + metadata->snapshots.at(1)->manifest_list = current_manifest_list_path; + metadata->snapshots.at(1)->summary[SnapshotSummaryFields::kSourceSnapshotId] = + std::to_string(kExpiredSnapshotId); + RewriteTable(std::move(metadata)); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_TRUE(deleted_files.empty()); + auto committed_metadata = ReloadMetadata(); + EXPECT_EQ(committed_metadata->snapshots.size(), 1); + EXPECT_EQ(committed_metadata->snapshots.at(0)->snapshot_id, kCurrentSnapshotId); +} + +TEST_F(ExpireSnapshotsCleanupTest, ReachableCleanupFailsClosedOnUnbindableExpiredSpec) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + + auto metadata = ReloadMetadata(); + ASSERT_EQ(metadata->snapshots.size(), 2); + metadata->snapshots.at(0)->manifest_list = expired_manifest_list_path; + metadata->snapshots.at(1)->manifest_list = current_manifest_list_path; + ICEBERG_UNWRAP_OR_FAIL(auto retained_spec, PartitionSpec::Make(/*spec_id=*/1, {})); + metadata->partition_specs.push_back( + std::shared_ptr(std::move(retained_spec))); + metadata->default_spec_id = 1; + ICEBERG_UNWRAP_OR_FAIL( + auto retained_schema, + Schema::Make(std::vector{SchemaField::MakeRequired(2, "y", int64()), + SchemaField::MakeRequired(3, "z", int64())}, + /*schema_id=*/2, std::vector{})); + metadata->schemas.push_back(std::shared_ptr(std::move(retained_schema))); + metadata->current_schema_id = 2; + metadata->snapshots.at(1)->schema_id = 2; + RewriteTable(std::move(metadata)); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->CleanExpiredMetadata(true); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_manifest_path, + expired_manifest_list_path)); + EXPECT_THAT(deleted_files, testing::Not(testing::Contains(expired_data_file_path))); +} + +TEST_F(ExpireSnapshotsCleanupTest, CommitIgnoresMalformedSourceSnapshotIdCleanup) { + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-malformed-ml.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-malformed-ml.avro"; + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + + auto metadata = ReloadMetadata(); + ASSERT_EQ(metadata->snapshots.size(), 2); + metadata->snapshots.at(0)->manifest_list = expired_manifest_list_path; + metadata->snapshots.at(1)->manifest_list = current_manifest_list_path; + metadata->snapshots.at(1)->summary[SnapshotSummaryFields::kSourceSnapshotId] = + "not-a-number"; + RewriteTable(std::move(metadata)); + + std::vector deleted_files; + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->DeleteWith( + [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_TRUE(deleted_files.empty()); + auto committed_metadata = ReloadMetadata(); + EXPECT_EQ(committed_metadata->snapshots.size(), 1); + EXPECT_EQ(committed_metadata->snapshots.at(0)->snapshot_id, kCurrentSnapshotId); +} + } // namespace iceberg diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index ce65882c9..8e109d085 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -23,14 +23,16 @@ #include #include #include -#include #include +#include #include +#include #include #include "iceberg/file_io.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_reader.h" +#include "iceberg/result.h" #include "iceberg/schema.h" #include "iceberg/snapshot.h" #include "iceberg/statistics_file.h" @@ -40,18 +42,23 @@ #include "iceberg/util/error_collector.h" #include "iceberg/util/macros.h" #include "iceberg/util/snapshot_util_internal.h" +#include "iceberg/util/string_util.h" namespace iceberg { namespace { -Result> MakeManifestReader( +Result> MakeManifestReader( const ManifestFile& manifest, const std::shared_ptr& file_io, const TableMetadata& metadata) { + // TODO(gangwu): Build manifest file schemas from PartitionSpec::RawPartitionType + // with UnknownType for dropped source fields instead of requiring the table schema + // to bind every partition source field. Until then, cleanup fails closed when + // historical specs cannot bind to the metadata schema. ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); - ICEBERG_ASSIGN_OR_RAISE(auto spec, - metadata.PartitionSpecById(manifest.partition_spec_id)); - return ManifestReader::Make(manifest, file_io, std::move(schema), std::move(spec)); + TableMetadataCache metadata_cache(&metadata); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); + return ManifestReader::Make(manifest, file_io, std::move(schema), specs_by_id.get()); } /// \brief Abstract strategy for cleaning up files after snapshot expiration. @@ -67,14 +74,30 @@ class FileCleanupStrategy { /// /// \param metadata_before_expiration Table metadata before expiration. /// \param metadata_after_expiration Table metadata after expiration. - /// \param expired_snapshot_ids Snapshot IDs that were expired during this operation. /// \param level Controls which types of files are eligible for deletion. virtual Status CleanFiles(const TableMetadata& metadata_before_expiration, const TableMetadata& metadata_after_expiration, - const std::unordered_set& expired_snapshot_ids, CleanupLevel level) = 0; protected: + /// \brief Snapshot IDs present in `before` but not in `after`. + static std::unordered_set ExpiredSnapshotIds(const TableMetadata& before, + const TableMetadata& after) { + std::unordered_set after_ids; + after_ids.reserve(after.snapshots.size()); + for (const auto& s : after.snapshots) { + if (s) after_ids.insert(s->snapshot_id); + } + std::unordered_set expired; + expired.reserve(before.snapshots.size()); + for (const auto& s : before.snapshots) { + if (s && !after_ids.contains(s->snapshot_id)) { + expired.insert(s->snapshot_id); + } + } + return expired; + } + /// \brief Delete a single file void DeleteFile(const std::string& path) { try { @@ -84,11 +107,11 @@ class FileCleanupStrategy { std::ignore = file_io_->DeleteFile(path); } } catch (...) { - /// TODO(shangxinli): add retry + // TODO(shangxinli): add retry } } - /// TODO(shangxinli): Add bulk deletion + // TODO(shangxinli): Add bulk deletion void DeleteFiles(const std::unordered_set& paths) { for (const auto& path : paths) { DeleteFile(path); @@ -149,8 +172,10 @@ class ReachableFileCleanup : public FileCleanupStrategy { Status CleanFiles(const TableMetadata& metadata_before_expiration, const TableMetadata& metadata_after_expiration, - const std::unordered_set& expired_snapshot_ids, CleanupLevel level) override { + const auto expired_snapshot_ids = + ExpiredSnapshotIds(metadata_before_expiration, metadata_after_expiration); + std::unordered_set retained_snapshot_ids; for (const auto& snapshot : metadata_after_expiration.snapshots) { if (snapshot) { @@ -182,7 +207,7 @@ class ReachableFileCleanup : public FileCleanupStrategy { if (level == CleanupLevel::kAll) { // Deleting data files auto data_files_to_delete = FindDataFilesToDelete( - metadata_after_expiration, manifests_to_delete, current_manifests); + metadata_before_expiration, manifests_to_delete, current_manifests); DeleteFiles(data_files_to_delete); } @@ -195,8 +220,7 @@ class ReachableFileCleanup : public FileCleanupStrategy { DeleteFiles(manifest_lists_to_delete); // Deleting statistics files - if (HasAnyStatisticsFiles(metadata_before_expiration) || - HasAnyStatisticsFiles(metadata_after_expiration)) { + if (HasAnyStatisticsFiles(metadata_before_expiration)) { DeleteFiles( StatisticsFilesToDelete(metadata_before_expiration, metadata_after_expiration)); } @@ -262,7 +286,7 @@ class ReachableFileCleanup : public FileCleanupStrategy { "Cannot read data file paths from a delete manifest: {}", manifest.manifest_path); - /// TODO(shangxinli): optimize by only reading file paths + // TODO(shangxinli): optimize by only reading file paths ICEBERG_ASSIGN_OR_RAISE(auto reader, MakeManifestReader(manifest, file_io_, metadata)); ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); @@ -331,6 +355,296 @@ class ReachableFileCleanup : public FileCleanupStrategy { } }; +/// \brief Incremental file cleanup strategy for simple linear-ancestry expirations. +/// +/// Only safe when: +/// * No snapshot IDs were explicitly listed for expiration. +/// * No removed snapshots lived outside the current main ancestry. +/// * No retained snapshots live outside the current main ancestry. +/// +/// Each manifest is attributed to its writer snapshot via added_snapshot_id, so +/// two snapshot passes are enough -- one over retained snapshots to learn which +/// manifests are still live, one over expired snapshots to learn which manifests, +/// manifest lists, and data files to drop. Cherry-pick protection via +/// SnapshotSummaryFields::kSourceSnapshotId prevents removing data that was +/// logically introduced by a snapshot whose changes are still present in the +/// current state under a different id. +/// +/// TODO(shangxinli): Add multi-threaded manifest reading and file deletion support. +class IncrementalFileCleanup : public FileCleanupStrategy { + public: + using FileCleanupStrategy::FileCleanupStrategy; + + Status CleanFiles(const TableMetadata& metadata_before_expiration, + const TableMetadata& metadata_after_expiration, + CleanupLevel level) override { + const auto expired_snapshot_ids = + ExpiredSnapshotIds(metadata_before_expiration, metadata_after_expiration); + if (expired_snapshot_ids.empty()) { + return {}; + } + + std::unordered_set valid_ids; + valid_ids.reserve(metadata_after_expiration.snapshots.size()); + for (const auto& snapshot : metadata_after_expiration.snapshots) { + if (snapshot) { + valid_ids.insert(snapshot->snapshot_id); + } + } + + auto current_result = metadata_before_expiration.SnapshotById( + metadata_before_expiration.current_snapshot_id); + if (!current_result.has_value() || current_result.value() == nullptr) { + return {}; + } + + // Only delete files removed by ancestors of the current table state. + auto ancestors_result = SnapshotUtil::AncestorsOf( + current_result.value()->snapshot_id, [&metadata_before_expiration](int64_t id) { + return metadata_before_expiration.SnapshotById(id); + }); + if (!ancestors_result.has_value()) { + return {}; + } + std::unordered_set ancestor_ids; + ancestor_ids.reserve(ancestors_result.value().size()); + for (const auto& ancestor : ancestors_result.value()) { + if (ancestor) ancestor_ids.insert(ancestor->snapshot_id); + } + + // Protect snapshots whose changes were picked into the current ancestry. + std::unordered_set picked_ancestor_snapshot_ids; + picked_ancestor_snapshot_ids.reserve(ancestor_ids.size()); + for (const auto& ancestor : ancestors_result.value()) { + if (!ancestor) continue; + const auto& summary = ancestor->summary; + auto it = summary.find(SnapshotSummaryFields::kSourceSnapshotId); + if (it == summary.end()) continue; + ICEBERG_ASSIGN_OR_RAISE(auto source_id, + StringUtils::ParseNumber(it->second)); + picked_ancestor_snapshot_ids.insert(source_id); + } + + // Find manifests still referenced by a valid snapshot but written by an + // expired snapshot. Their deleted entries point at data files now safe to + // remove and become candidates for manifests_to_scan below. + std::unordered_set valid_manifests; + std::unordered_set manifests_to_scan; + manifests_to_scan.reserve(expired_snapshot_ids.size()); + for (const auto& snapshot : metadata_after_expiration.snapshots) { + if (!snapshot) continue; + SnapshotCache snapshot_cache(snapshot.get()); + auto manifests_result = snapshot_cache.Manifests(file_io_); + if (!manifests_result.has_value()) continue; // best-effort + auto manifests = std::move(manifests_result).value(); + for (auto& manifest : manifests) { + valid_manifests.insert(manifest.manifest_path); + + int64_t writer_id = manifest.added_snapshot_id; + bool from_valid_snapshots = valid_ids.contains(writer_id); + bool is_from_ancestor = ancestor_ids.contains(writer_id); + bool is_picked = picked_ancestor_snapshot_ids.contains(writer_id); + if (!from_valid_snapshots && (is_from_ancestor || is_picked) && + manifest.has_deleted_files()) { + manifests_to_scan.insert(std::move(manifest)); + } + } + } + + // Find manifests that were only referenced by snapshots that have expired, + // and split them by what kind of cleanup they need: + // - manifests_to_delete: not referenced by any retained snapshot; + // - manifests_to_scan: from a current-state ancestor and has deleted + // entries (data files now safe to drop); + // - manifests_to_revert: written by an expiring non-ancestor snapshot + // and contains added entries -- those data files were never adopted. + std::unordered_set manifest_lists_to_delete; + manifest_lists_to_delete.reserve(expired_snapshot_ids.size()); + std::unordered_set manifests_to_delete; + manifests_to_delete.reserve(expired_snapshot_ids.size()); + std::unordered_set manifests_to_revert; + manifests_to_revert.reserve(expired_snapshot_ids.size()); + for (const auto& snapshot : metadata_before_expiration.snapshots) { + if (!snapshot) continue; + int64_t snapshot_id = snapshot->snapshot_id; + if (valid_ids.contains(snapshot_id)) continue; + + // Skip cherry-picked snapshots; the picked snapshot owns its cleanup. + if (picked_ancestor_snapshot_ids.contains(snapshot_id)) { + continue; + } + + int64_t source_snapshot_id = -1; + auto src_it = snapshot->summary.find(SnapshotSummaryFields::kSourceSnapshotId); + if (src_it != snapshot->summary.end()) { + auto source_snapshot_id_result = + StringUtils::ParseNumber(src_it->second); + if (!source_snapshot_id_result.has_value()) { + continue; + } + source_snapshot_id = source_snapshot_id_result.value(); + } + // If this commit was cherry-picked from a still-live snapshot, skip it. + if (ancestor_ids.contains(source_snapshot_id) || + picked_ancestor_snapshot_ids.contains(source_snapshot_id)) { + continue; + } + + SnapshotCache snapshot_cache(snapshot.get()); + auto manifests_result = snapshot_cache.Manifests(file_io_); + if (!manifests_result.has_value()) { + continue; + } + + auto manifests = std::move(manifests_result).value(); + for (auto& manifest : manifests) { + if (valid_manifests.contains(manifest.manifest_path)) continue; + manifests_to_delete.insert(manifest.manifest_path); + + int64_t writer_id = manifest.added_snapshot_id; + bool is_from_ancestor = ancestor_ids.contains(writer_id); + bool is_from_expiring_snapshot = expired_snapshot_ids.contains(writer_id); + + if (is_from_ancestor && manifest.has_deleted_files()) { + manifests_to_scan.insert(std::move(manifest)); + } else if (!is_from_ancestor && is_from_expiring_snapshot && + manifest.has_added_files()) { + // The writer must be known-expired so missing history cannot make + // an ancestor look like a reverted snapshot. + manifests_to_revert.insert(std::move(manifest)); + } + } + if (!snapshot->manifest_list.empty()) { + manifest_lists_to_delete.insert(snapshot->manifest_list); + } + } + + // Deleting data files + if (level == CleanupLevel::kAll) { + // Manifests may reference partition specs that were pruned during expiration + // when CleanExpiredMetadata is enabled, so resolve schemas/specs against the + // pre-expiration metadata. + auto files_to_delete = FindFilesToDelete( + metadata_before_expiration, manifests_to_scan, manifests_to_revert, valid_ids); + DeleteFiles(files_to_delete); + } + + // Deleting manifest files + DeleteFiles(manifests_to_delete); + + // Deleting manifest-list files + DeleteFiles(manifest_lists_to_delete); + + // Deleting statistics files + if (HasAnyStatisticsFiles(metadata_before_expiration)) { + DeleteFiles( + StatisticsFilesToDelete(metadata_before_expiration, metadata_after_expiration)); + } + + return {}; + } + + private: + /// \brief Resolve the data files that the incremental pass identified for deletion. + /// + /// For manifests_to_scan, read DELETED entries whose snapshot id is no longer valid. + /// For manifests_to_revert, read every ADDED entry. + std::unordered_set FindFilesToDelete( + const TableMetadata& metadata, + const std::unordered_set& manifests_to_scan, + const std::unordered_set& manifests_to_revert, + const std::unordered_set& valid_ids) { + std::unordered_set files_to_delete; + + for (const auto& manifest : manifests_to_scan) { + auto reader_result = MakeManifestReader(manifest, file_io_, metadata); + if (!reader_result.has_value()) continue; + auto entries_result = reader_result.value()->Entries(); + if (!entries_result.has_value()) continue; + for (const auto& entry : entries_result.value()) { + if (entry.status == ManifestStatus::kDeleted && entry.snapshot_id.has_value() && + !valid_ids.contains(entry.snapshot_id.value()) && entry.data_file) { + files_to_delete.insert(entry.data_file->file_path); + } + } + } + + for (const auto& manifest : manifests_to_revert) { + auto reader_result = MakeManifestReader(manifest, file_io_, metadata); + if (!reader_result.has_value()) continue; + auto entries_result = reader_result.value()->Entries(); + if (!entries_result.has_value()) continue; + for (const auto& entry : entries_result.value()) { + if (entry.status == ManifestStatus::kAdded && entry.data_file) { + files_to_delete.insert(entry.data_file->file_path); + } + } + } + + return files_to_delete; + } +}; + +/// \brief True if any retained snapshot sits outside the current main ancestry. +bool HasNonMainSnapshots(const TableMetadata& metadata) { + auto current_result = metadata.SnapshotById(metadata.current_snapshot_id); + if (!current_result.has_value() || current_result.value() == nullptr) { + return !metadata.snapshots.empty(); + } + auto ancestors_result = SnapshotUtil::AncestorsOf( + current_result.value()->snapshot_id, + [&metadata](int64_t id) { return metadata.SnapshotById(id); }); + if (!ancestors_result.has_value()) { + return true; + } + std::unordered_set main_ancestors; + for (const auto& a : ancestors_result.value()) { + if (a) main_ancestors.insert(a->snapshot_id); + } + for (const auto& snapshot : metadata.snapshots) { + if (snapshot && !main_ancestors.contains(snapshot->snapshot_id)) { + return true; + } + } + return false; +} + +/// \brief True if any expired snapshot lived outside the current main ancestry. +/// +/// When `before` has no current snapshot, the main-ancestor set is empty; any +/// removed snapshot then counts as "non-main" and returns true. This guards the +/// dispatch in Finalize() against picking incremental cleanup when the before-state +/// has snapshots but no current pointer. +bool HasRemovedNonMainAncestors(const TableMetadata& before, const TableMetadata& after) { + std::unordered_set main_ancestors; + auto current_result = before.SnapshotById(before.current_snapshot_id); + if (current_result.has_value() && current_result.value() != nullptr) { + auto ancestors_result = SnapshotUtil::AncestorsOf( + current_result.value()->snapshot_id, + [&before](int64_t id) { return before.SnapshotById(id); }); + if (!ancestors_result.has_value()) { + return true; + } + for (const auto& a : ancestors_result.value()) { + if (a) main_ancestors.insert(a->snapshot_id); + } + } + std::unordered_set after_ids; + after_ids.reserve(after.snapshots.size()); + for (const auto& s : after.snapshots) { + if (s) after_ids.insert(s->snapshot_id); + } + for (const auto& snapshot : before.snapshots) { + if (!snapshot) continue; + bool removed = !after_ids.contains(snapshot->snapshot_id); + bool in_main = main_ancestors.contains(snapshot->snapshot_id); + if (removed && !in_main) { + return true; + } + } + return false; +} + } // namespace Result> ExpireSnapshots::Make( @@ -464,7 +778,7 @@ Result> ExpireSnapshots::UnreferencedSnapshotIdsToRe for (const auto& snapshot : base().snapshots) { ICEBERG_DCHECK(snapshot != nullptr, "Snapshot is null"); if (!referenced_ids.contains(snapshot->snapshot_id) && - snapshot->timestamp_ms > default_expire_older_than_) { + snapshot->timestamp_ms >= default_expire_older_than_) { // unreferenced and not old enough to be expired ids_to_retain.insert(snapshot->snapshot_id); } @@ -528,6 +842,8 @@ Result ExpireSnapshots::Apply() { ICEBERG_PRECHECK(!retained_id_to_refs.contains(id), "Cannot expire {}. Still referenced by refs", id); } + std::unordered_set explicit_snapshot_ids(snapshot_ids_to_expire_.begin(), + snapshot_ids_to_expire_.end()); ICEBERG_ASSIGN_OR_RAISE(auto all_branch_snapshot_ids, ComputeAllBranchSnapshotIdsToRetain(retained_refs)); ICEBERG_ASSIGN_OR_RAISE(auto unreferenced_snapshot_ids, @@ -544,8 +860,10 @@ Result ExpireSnapshots::Apply() { result.refs_to_remove.push_back(key_to_ref.first); } }); - std::ranges::for_each(base.snapshots, [&ids_to_retain, &result](const auto& snapshot) { - if (snapshot && !ids_to_retain.contains(snapshot->snapshot_id)) { + std::ranges::for_each(base.snapshots, [&explicit_snapshot_ids, &ids_to_retain, + &result](const auto& snapshot) { + if (snapshot && (explicit_snapshot_ids.contains(snapshot->snapshot_id) || + !ids_to_retain.contains(snapshot->snapshot_id))) { result.snapshot_ids_to_remove.push_back(snapshot->snapshot_id); } }); @@ -608,16 +926,24 @@ Status ExpireSnapshots::Finalize(Result commit_result) { auto metadata_before_expiration_ptr = apply_result_->metadata_before_expiration; const TableMetadata& metadata_before_expiration = *metadata_before_expiration_ptr; const TableMetadata& metadata_after_expiration = *commit_result.value(); - std::unordered_set expired_ids(apply_result_->snapshot_ids_to_remove.begin(), - apply_result_->snapshot_ids_to_remove.end()); apply_result_.reset(); - // File cleanup is best-effort: log and continue on individual file deletion failures - ReachableFileCleanup strategy(ctx_->table->io(), delete_func_); - return strategy.CleanFiles(metadata_before_expiration, metadata_after_expiration, - expired_ids, cleanup_level_); + // Pick incremental cleanup when the expiration is a simple linear-ancestry walk: + // no explicit snapshot IDs, no removed snapshots outside main ancestry, and no + // retained snapshots outside main ancestry. + const bool can_use_incremental = + !specified_snapshot_id_ && + !HasRemovedNonMainAncestors(metadata_before_expiration, + metadata_after_expiration) && + !HasNonMainSnapshots(metadata_after_expiration); + + if (can_use_incremental) { + return IncrementalFileCleanup(ctx_->table->io(), delete_func_) + .CleanFiles(metadata_before_expiration, metadata_after_expiration, + cleanup_level_); + } + return ReachableFileCleanup(ctx_->table->io(), delete_func_) + .CleanFiles(metadata_before_expiration, metadata_after_expiration, cleanup_level_); } -// TODO(shangxinli): add IncrementalFileCleanup strategy for linear ancestry optimization. - } // namespace iceberg diff --git a/src/iceberg/update/expire_snapshots.h b/src/iceberg/update/expire_snapshots.h index 7c1588aa5..a5b6e3b32 100644 --- a/src/iceberg/update/expire_snapshots.h +++ b/src/iceberg/update/expire_snapshots.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include From 136b4683f70bb48913bf236644100485e964356d Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Thu, 21 May 2026 16:19:29 +0800 Subject: [PATCH 032/151] fix(parquet): check compression codec availability (#656) ## Summary - Check Parquet compression codec availability with Arrow before opening the file writer. - Return a clear `InvalidArgument` when a requested Parquet codec is not built into Arrow. - Add a regression test that exercises an unavailable codec in the current Arrow build. ## Test Plan - `cmake --build build --target parquet_test data_test && ctest --test-dir build -R 'parquet_test|data_test' --output-on-failure` - `git diff --check` --- src/iceberg/parquet/parquet_writer.cc | 13 ++++++++ src/iceberg/test/parquet_test.cc | 48 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index 7e2d3d151..c70d3310c 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -20,9 +20,11 @@ #include "iceberg/parquet/parquet_writer.h" #include +#include #include #include +#include #include #include #include @@ -62,6 +64,14 @@ Result<::arrow::Compression::type> ParseCompression(const WriterProperties& prop } } +Status CheckCompressionAvailable(std::string_view compression_name, + ::arrow::Compression::type compression) { + ICEBERG_PRECHECK(::arrow::util::Codec::IsAvailable(compression), + "Parquet compression codec {} is not available in the current build", + compression_name); + return {}; +} + Result> ParseCodecLevel(const WriterProperties& properties) { auto level_str = properties.Get(WriterProperties::kParquetCompressionLevel); if (level_str.empty()) { @@ -98,6 +108,9 @@ class ParquetWriter::Impl { auto schema_node = std::static_pointer_cast<::parquet::schema::GroupNode>( schema_descriptor->schema_root()); + ICEBERG_RETURN_UNEXPECTED(CheckCompressionAvailable( + options.properties.Get(WriterProperties::kParquetCompression), compression)); + ICEBERG_ASSIGN_OR_RAISE(output_stream_, OpenOutputStream(options)); auto file_writer = ::parquet::ParquetFileWriter::Open( output_stream_, std::move(schema_node), std::move(writer_properties), diff --git a/src/iceberg/test/parquet_test.cc b/src/iceberg/test/parquet_test.cc index 65a4602d8..70fb9880f 100644 --- a/src/iceberg/test/parquet_test.cc +++ b/src/iceberg/test/parquet_test.cc @@ -18,6 +18,9 @@ */ #include +#include +#include +#include #include #include @@ -26,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -124,6 +128,27 @@ void DoRoundtrip(std::shared_ptr<::arrow::Array> data, std::shared_ptr s ASSERT_TRUE(out != nullptr) << "Reader.Next() returned no data"; } +struct ParquetCodec { + std::string name; + ::arrow::Compression::type compression; +}; + +std::optional FirstUnavailableParquetCodec() { + const std::vector codecs = { + {.name = "snappy", .compression = ::arrow::Compression::SNAPPY}, + {.name = "gzip", .compression = ::arrow::Compression::GZIP}, + {.name = "brotli", .compression = ::arrow::Compression::BROTLI}, + {.name = "lz4", .compression = ::arrow::Compression::LZ4}, + {.name = "zstd", .compression = ::arrow::Compression::ZSTD}, + }; + for (const auto& codec : codecs) { + if (!::arrow::util::Codec::IsAvailable(codec.compression)) { + return codec; + } + } + return std::nullopt; +} + } // namespace class ParquetReaderTest : public TempFileTestBase { @@ -461,6 +486,29 @@ TEST_F(ParquetReadWrite, EmptyStruct) { IsError(ErrorKind::kNotImplemented)); } +TEST_F(ParquetReadWrite, RejectsUnavailableCompressionCodec) { + auto unavailable_codec = FirstUnavailableParquetCodec(); + if (!unavailable_codec.has_value()) { + GTEST_SKIP() << "All optional Parquet compression codecs are available"; + } + + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32())}); + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kParquetCompression, unavailable_codec->name); + + auto writer = WriterFactoryRegistry::Open( + FileFormatType::kParquet, {.path = "unavailable_codec.parquet", + .schema = schema, + .io = arrow::ArrowFileSystemFileIO::MakeMockFileIO(), + .properties = std::move(writer_properties)}); + + EXPECT_THAT(writer, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(writer, + HasErrorMessage("Parquet compression codec " + unavailable_codec->name + + " is not available in the current build")); +} + TEST_F(ParquetReadWrite, SimpleStructRoundTrip) { auto schema = std::make_shared(std::vector{ SchemaField::MakeOptional(1, "a", From 6c781c7b1fa56a46f1f7994f18a5dbf8b62385b3 Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Thu, 21 May 2026 16:53:55 +0800 Subject: [PATCH 033/151] feat(io): add bulk delete API to FileIO. (#659) ## Summary Add a new `FileIO::DeleteFiles(...)` API as a bulk deletion entry point. The default implementation deletes files sequentially by calling the existing `DeleteFile(...)` method and returns the first deletion error encountered. This PR only adds the API and backward-compatible fallback behavior. It does not yet update `ExpireSnapshots` to use `DeleteFiles(...)`, and it does not introduce parallel deletion. Fixed: #658 ## Motivation `ExpireSnapshots` and other cleanup flows may need to delete many files. A bulk deletion API gives FileIO implementations a common extension point for future optimized deletion strategies, such as storage-native batch deletion or parallel fallback deletion. --- src/iceberg/arrow/arrow_io.cc | 13 +++++ src/iceberg/arrow/arrow_io_internal.h | 4 ++ src/iceberg/file_io.cc | 7 +++ src/iceberg/file_io.h | 11 ++++ src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/arrow_io_test.cc | 15 ++++++ src/iceberg/test/file_io_test.cc | 75 ++++++++++++++++++++++++++ src/iceberg/test/meson.build | 1 + src/iceberg/update/expire_snapshots.cc | 18 +++---- 9 files changed, 134 insertions(+), 11 deletions(-) create mode 100644 src/iceberg/test/file_io_test.cc diff --git a/src/iceberg/arrow/arrow_io.cc b/src/iceberg/arrow/arrow_io.cc index a515f3385..45ad4259e 100644 --- a/src/iceberg/arrow/arrow_io.cc +++ b/src/iceberg/arrow/arrow_io.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -568,6 +569,18 @@ Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) { return {}; } +Status ArrowFileSystemFileIO::DeleteFiles( + const std::vector& file_locations) { + std::vector paths; + paths.reserve(file_locations.size()); + for (const auto& file_location : file_locations) { + ICEBERG_ASSIGN_OR_RAISE(auto path, ResolvePath(file_location)); + paths.push_back(std::move(path)); + } + ICEBERG_ARROW_RETURN_NOT_OK(arrow_fs_->DeleteFiles(paths)); + return {}; +} + std::unique_ptr ArrowFileSystemFileIO::MakeMockFileIO() { return std::make_unique( std::make_shared<::arrow::fs::internal::MockFileSystem>( diff --git a/src/iceberg/arrow/arrow_io_internal.h b/src/iceberg/arrow/arrow_io_internal.h index 4f170a8a4..a6b85b6c9 100644 --- a/src/iceberg/arrow/arrow_io_internal.h +++ b/src/iceberg/arrow/arrow_io_internal.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,9 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO { /// \brief Delete a file at the given location. Status DeleteFile(const std::string& file_location) override; + /// \brief Delete files at the given locations. + Status DeleteFiles(const std::vector& file_locations) override; + /// \brief Get the Arrow file system. const std::shared_ptr<::arrow::fs::FileSystem>& fs() const { return arrow_fs_; } diff --git a/src/iceberg/file_io.cc b/src/iceberg/file_io.cc index d76ffeb60..e4223182e 100644 --- a/src/iceberg/file_io.cc +++ b/src/iceberg/file_io.cc @@ -100,4 +100,11 @@ Status FileIO::WriteFile(const std::string& file_location, std::string_view cont return FinishWithCloseStatus(std::move(status), stream->Close()); } +Status FileIO::DeleteFiles(const std::vector& file_locations) { + for (const auto& file_location : file_locations) { + ICEBERG_RETURN_UNEXPECTED(DeleteFile(file_location)); + } + return {}; +} + } // namespace iceberg diff --git a/src/iceberg/file_io.h b/src/iceberg/file_io.h index e772b5336..1f91fb0c1 100644 --- a/src/iceberg/file_io.h +++ b/src/iceberg/file_io.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "iceberg/iceberg_export.h" #include "iceberg/result.h" @@ -154,6 +155,16 @@ class ICEBERG_EXPORT FileIO { virtual Status DeleteFile(const std::string& file_location) { return NotImplemented("DeleteFile not implemented"); } + + /// \brief Delete files at the given locations. + /// + /// Implementations that can delete multiple files efficiently should override this + /// method. The default implementation deletes files sequentially using DeleteFile + /// and returns the first error encountered. + /// + /// \param file_locations The locations of the files to delete. + /// \return void if all deletes succeed, or an error code if any delete fails. + virtual Status DeleteFiles(const std::vector& file_locations); }; } // namespace iceberg diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 791ad9be0..37e66ed59 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -124,6 +124,7 @@ add_iceberg_test(util_test data_file_set_test.cc decimal_test.cc endian_test.cc + file_io_test.cc formatter_test.cc lazy_test.cc location_util_test.cc diff --git a/src/iceberg/test/arrow_io_test.cc b/src/iceberg/test/arrow_io_test.cc index 0c885d07a..7edaf0756 100644 --- a/src/iceberg/test/arrow_io_test.cc +++ b/src/iceberg/test/arrow_io_test.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -341,6 +342,20 @@ TEST_F(LocalFileIOTest, DeleteFile) { EXPECT_THAT(del_res, HasErrorMessage("Cannot delete file")); } +TEST_F(LocalFileIOTest, DeleteFiles) { + auto first_path = CreateNewTempFilePath(); + auto second_path = CreateNewTempFilePath(); + ASSERT_THAT(file_io_->WriteFile(first_path, "hello"), IsOk()); + ASSERT_THAT(file_io_->WriteFile(second_path, "world"), IsOk()); + + std::vector paths = {first_path, second_path}; + EXPECT_THAT(file_io_->DeleteFiles(paths), IsOk()); + + EXPECT_THAT(file_io_->ReadFile(first_path, std::nullopt), IsError(ErrorKind::kIOError)); + EXPECT_THAT(file_io_->ReadFile(second_path, std::nullopt), + IsError(ErrorKind::kIOError)); +} + void VerifyReadFullyReadsFromAbsolutePosition(const std::shared_ptr& file_io, const std::string& path) { ASSERT_THAT(file_io->WriteFile(path, "abcdef"), IsOk()); diff --git a/src/iceberg/test/file_io_test.cc b/src/iceberg/test/file_io_test.cc new file mode 100644 index 000000000..0908572f9 --- /dev/null +++ b/src/iceberg/test/file_io_test.cc @@ -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. + */ + +#include "iceberg/file_io.h" + +#include +#include +#include + +#include + +#include "iceberg/test/matchers.h" + +namespace iceberg { +namespace { + +class RecordingFileIO : public FileIO { + public: + explicit RecordingFileIO(std::string failure_path = "") + : failure_path_(std::move(failure_path)) {} + + Status DeleteFile(const std::string& file_location) override { + deleted_paths.push_back(file_location); + if (file_location == failure_path_) { + return IOError("failed to delete {}", file_location); + } + return {}; + } + + std::vector deleted_paths; + + private: + std::string failure_path_; +}; + +} // namespace + +TEST(FileIOTest, DeleteFilesFallsBackToDeleteFileForEachPath) { + RecordingFileIO file_io; + std::vector paths = {"file-a.avro", "file-b.avro"}; + + EXPECT_THAT(file_io.DeleteFiles(paths), IsOk()); + EXPECT_THAT(file_io.deleted_paths, + ::testing::ElementsAre("file-a.avro", "file-b.avro")); +} + +TEST(FileIOTest, DeleteFilesReturnsFirstDeleteFileError) { + RecordingFileIO file_io("file-b.avro"); + std::vector paths = {"file-a.avro", "file-b.avro", "file-c.avro"}; + + auto status = file_io.DeleteFiles(paths); + + EXPECT_THAT(status, IsError(ErrorKind::kIOError)); + EXPECT_THAT(status, HasErrorMessage("failed to delete file-b.avro")); + EXPECT_THAT(file_io.deleted_paths, + ::testing::ElementsAre("file-a.avro", "file-b.avro")); +} + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index e168d08bf..1acb46e9b 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -88,6 +88,7 @@ iceberg_tests = { 'data_file_set_test.cc', 'decimal_test.cc', 'endian_test.cc', + 'file_io_test.cc', 'formatter_test.cc', 'lazy_test.cc', 'location_util_test.cc', diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index 8e109d085..c9ac9e4cd 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -98,26 +98,22 @@ class FileCleanupStrategy { return expired; } - /// \brief Delete a single file - void DeleteFile(const std::string& path) { + /// \brief Delete files at the given locations. + void DeleteFiles(const std::unordered_set& paths) { try { if (delete_func_) { - delete_func_(path); + for (const auto& path : paths) { + delete_func_(path); + } } else { - std::ignore = file_io_->DeleteFile(path); + std::vector path_list(paths.begin(), paths.end()); + std::ignore = file_io_->DeleteFiles(path_list); } } catch (...) { // TODO(shangxinli): add retry } } - // TODO(shangxinli): Add bulk deletion - void DeleteFiles(const std::unordered_set& paths) { - for (const auto& path : paths) { - DeleteFile(path); - } - } - bool HasAnyStatisticsFiles(const TableMetadata& metadata) const { return !metadata.statistics.empty() || !metadata.partition_statistics.empty(); } From e97a8e84d9fa31ea15f793a009769c9d6d65e9af Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Fri, 22 May 2026 15:19:48 +0800 Subject: [PATCH 034/151] fix(ci): fix macOS ci to use provided fmt (#670) --- .github/workflows/rc.yml | 7 +++++++ .github/workflows/s3_test.yml | 6 ++++++ .github/workflows/test.yml | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index fa27c99ce..a2a85604e 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -105,6 +105,13 @@ jobs: shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Install fmt on macOS + if: ${{ startsWith(matrix.os, 'macos') }} + shell: bash + run: | + brew install fmt + echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" + - name: Verify run: | tar_gz=$(echo apache-iceberg-cpp-*.tar.gz) diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml index d9675a4d8..8e6fb1ece 100644 --- a/.github/workflows/s3_test.yml +++ b/.github/workflows/s3_test.yml @@ -73,6 +73,12 @@ jobs: run: | echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Install fmt on macOS + if: ${{ startsWith(matrix.runs-on, 'macos') }} + shell: bash + run: | + brew install fmt + echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 973d2f437..33368bb13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,6 +74,11 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Install fmt + shell: bash + run: | + brew install fmt + echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - name: Build Iceberg shell: bash run: ci/scripts/build_iceberg.sh $(pwd) From 3d2537cd3bebf3c9d5d72961e42e749cc3d42f5e Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Fri, 22 May 2026 15:20:33 +0800 Subject: [PATCH 035/151] feat(data): add MOR file scan task reader (#657) Add FileScanTaskReader as the delete-aware Arrow stream entrypoint for file scan tasks, covering both no-delete reader passthrough and merge-on-read filtering with position and equality deletes. Introduce reusable Arrow C Data utilities for stream wrapping and batch projection, including ProjectionContext caching and optional Arrow compute registration via arrow::RegisterAll. Move Arrow IO registration into arrow_register and remove FileScanTask::ToArrow. Add coverage for projection behavior across nanoarrow and Arrow compute paths, plus end-to-end FileScanTaskReader tests for projected reads, position deletes, equality deletes, dropped equality fields, and fully deleted batches. --- src/iceberg/CMakeLists.txt | 5 +- src/iceberg/arrow/arrow_c_data_util.cc | 131 +++++ ...arrow_io_register.cc => arrow_register.cc} | 52 +- .../{arrow_io_register.h => arrow_register.h} | 8 +- src/iceberg/arrow_c_data_util.cc | 397 +++++++++++++ src/iceberg/arrow_c_data_util_internal.h | 245 ++++++++ src/iceberg/data/delete_filter.cc | 6 +- src/iceberg/data/file_scan_task_reader.cc | 235 ++++++++ src/iceberg/data/file_scan_task_reader.h | 81 +++ src/iceberg/data/meson.build | 1 + src/iceberg/file_reader.h | 2 +- src/iceberg/meson.build | 2 + src/iceberg/table_scan.cc | 118 ---- src/iceberg/table_scan.h | 11 - src/iceberg/test/CMakeLists.txt | 4 +- src/iceberg/test/arrow_c_data_util_test.cc | 194 +++++++ .../test/file_scan_task_reader_test.cc | 524 ++++++++++++++++++ src/iceberg/test/file_scan_task_test.cc | 27 +- 18 files changed, 1877 insertions(+), 166 deletions(-) create mode 100644 src/iceberg/arrow/arrow_c_data_util.cc rename src/iceberg/arrow/{arrow_io_register.cc => arrow_register.cc} (50%) rename src/iceberg/arrow/{arrow_io_register.h => arrow_register.h} (79%) create mode 100644 src/iceberg/arrow_c_data_util.cc create mode 100644 src/iceberg/arrow_c_data_util_internal.h create mode 100644 src/iceberg/data/file_scan_task_reader.cc create mode 100644 src/iceberg/data/file_scan_task_reader.h create mode 100644 src/iceberg/test/arrow_c_data_util_test.cc create mode 100644 src/iceberg/test/file_scan_task_reader_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 68cacebeb..2b02b999a 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -18,6 +18,7 @@ set(ICEBERG_INCLUDES "$" "$") set(ICEBERG_SOURCES + arrow_c_data_util.cc arrow_c_data_guard_internal.cc catalog/memory/in_memory_catalog.cc delete_file_index.cc @@ -166,6 +167,7 @@ set(ICEBERG_DATA_SOURCES data/delete_filter.cc data/delete_loader.cc data/equality_delete_writer.cc + data/file_scan_task_reader.cc data/position_delete_writer.cc data/writer.cc deletes/position_delete_index.cc @@ -222,9 +224,10 @@ add_subdirectory(util) if(ICEBERG_BUILD_BUNDLE) set(ICEBERG_BUNDLE_SOURCES + arrow/arrow_c_data_util.cc arrow/arrow_io.cc arrow/s3/arrow_s3_file_io.cc - arrow/arrow_io_register.cc + arrow/arrow_register.cc arrow/metadata_column_util.cc avro/avro_data_util.cc avro/avro_direct_decoder.cc diff --git a/src/iceberg/arrow/arrow_c_data_util.cc b/src/iceberg/arrow/arrow_c_data_util.cc new file mode 100644 index 000000000..ea52d64c0 --- /dev/null +++ b/src/iceberg/arrow/arrow_c_data_util.cc @@ -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. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/arrow/nanoarrow_status_internal.h" +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_c_data_util_internal.h" +#include "iceberg/result.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +struct ArrowProjectBatchState { + std::shared_ptr<::arrow::Schema> input_schema; + std::shared_ptr<::arrow::Schema> output_schema; +}; + +Result> ImportArrowSchema( + const ArrowSchema& arrow_schema) { + ArrowSchema schema_copy; + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowSchemaDeepCopy(&arrow_schema, &schema_copy)); + internal::ArrowSchemaGuard schema_copy_guard(&schema_copy); + + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto schema, ::arrow::ImportSchema(&schema_copy)); + return schema; +} + +Result> GetArrowProjectBatchState( + ProjectionContext& projection) { + auto state = + std::static_pointer_cast(projection.project_batch_state()); + if (state != nullptr) { + return state; + } + + ICEBERG_ASSIGN_OR_RAISE(auto input_schema, + ImportArrowSchema(projection.input_arrow_schema())); + ICEBERG_ASSIGN_OR_RAISE(auto output_schema, + ImportArrowSchema(projection.output_arrow_schema())); + + state = std::make_shared( + ArrowProjectBatchState{.input_schema = std::move(input_schema), + .output_schema = std::move(output_schema)}); + projection.project_batch_state() = state; + return state; +} + +Result ProjectBatchArrowCompute(ArrowArray* input_batch, + std::span row_indices, + ProjectionContext& projection) { + ICEBERG_PRECHECK(input_batch != nullptr, "input_batch must not be null"); + ICEBERG_ASSIGN_OR_RAISE(auto state, GetArrowProjectBatchState(projection)); + + ICEBERG_ARROW_ASSIGN_OR_RETURN( + auto input_record_batch, + ::arrow::ImportRecordBatch(input_batch, state->input_schema)); + + const int32_t empty_index = 0; + // Buffer::Wrap needs a valid pointer even when the zero-length buffer is never read. + const int32_t* row_indices_data = + row_indices.empty() ? &empty_index : row_indices.data(); + auto index_array = std::make_shared<::arrow::Int32Array>( + static_cast(row_indices.size()), + ::arrow::Buffer::Wrap(row_indices_data, row_indices.size())); + + std::vector> output_columns; + output_columns.reserve(projection.selected_field_indices().size()); + for (int32_t input_index : projection.selected_field_indices()) { + ICEBERG_PRECHECK(input_index >= 0 && input_index < input_record_batch->num_columns(), + "Input field index {} out of range for batch with {} columns", + input_index, input_record_batch->num_columns()); + ICEBERG_ARROW_ASSIGN_OR_RETURN( + auto taken_column, + ::arrow::compute::Take(*input_record_batch->column(input_index), *index_array)); + output_columns.push_back(std::move(taken_column)); + } + + auto output_record_batch = ::arrow::RecordBatch::Make( + state->output_schema, static_cast(row_indices.size()), + std::move(output_columns)); + + ArrowArray output_array; + ICEBERG_ARROW_RETURN_NOT_OK( + ::arrow::ExportRecordBatch(*output_record_batch, &output_array)); + internal::ArrowArrayGuard output_array_guard(&output_array); + + return std::exchange(output_array, ArrowArray{}); +} + +} // namespace + +void RegisterArrowProjectBatch() { + static std::once_flag flag; + std::call_once(flag, []() { + ProjectionContext::RegisterProjectBatchFunction(&ProjectBatchArrowCompute); + }); +} + +} // namespace iceberg diff --git a/src/iceberg/arrow/arrow_io_register.cc b/src/iceberg/arrow/arrow_register.cc similarity index 50% rename from src/iceberg/arrow/arrow_io_register.cc rename to src/iceberg/arrow/arrow_register.cc index 43273c0ae..d2983ffae 100644 --- a/src/iceberg/arrow/arrow_io_register.cc +++ b/src/iceberg/arrow/arrow_register.cc @@ -1,28 +1,35 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "iceberg/arrow/arrow_io_register.h" +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/arrow/arrow_register.h" #include #include +#include #include "iceberg/arrow/arrow_io_util.h" #include "iceberg/file_io_registry.h" +namespace iceberg { +void RegisterArrowProjectBatch(); +} + namespace iceberg::arrow { namespace { @@ -43,8 +50,6 @@ void RegisterS3FileIO() { #endif } -} // namespace - void EnsureArrowFileIOsRegistered() { static std::once_flag flag; std::call_once(flag, []() { @@ -58,4 +63,11 @@ void EnsureArrowFileIOsRegistered() { return true; }(); +} // namespace + +void RegisterAll() { + EnsureArrowFileIOsRegistered(); + ::iceberg::RegisterArrowProjectBatch(); +} + } // namespace iceberg::arrow diff --git a/src/iceberg/arrow/arrow_io_register.h b/src/iceberg/arrow/arrow_register.h similarity index 79% rename from src/iceberg/arrow/arrow_io_register.h rename to src/iceberg/arrow/arrow_register.h index f28b7a565..7a67be516 100644 --- a/src/iceberg/arrow/arrow_io_register.h +++ b/src/iceberg/arrow/arrow_register.h @@ -19,16 +19,16 @@ #pragma once -/// \file iceberg/arrow/arrow_io_register.h -/// \brief Provide functions to register Arrow FileIO implementations. +/// \file iceberg/arrow/arrow_register.h +/// \brief Provide functions to register Arrow bundle integrations. #include "iceberg/iceberg_bundle_export.h" namespace iceberg::arrow { -/// \brief Register built-in Arrow FileIO implementations into the FileIORegistry. +/// \brief Register Arrow FileIOs and Arrow-backed C Data utilities. /// /// This operation is idempotent and safe to call multiple times. -ICEBERG_BUNDLE_EXPORT void EnsureArrowFileIOsRegistered(); +ICEBERG_BUNDLE_EXPORT void RegisterAll(); } // namespace iceberg::arrow diff --git a/src/iceberg/arrow_c_data_util.cc b/src/iceberg/arrow_c_data_util.cc new file mode 100644 index 000000000..a1d765d2c --- /dev/null +++ b/src/iceberg/arrow_c_data_util.cc @@ -0,0 +1,397 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/arrow/nanoarrow_status_internal.h" +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_c_data_util_internal.h" +#include "iceberg/file_reader.h" +#include "iceberg/result.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/schema_internal.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +Result MakeArrowArrayStream(std::unique_ptr reader) { + return MakeArrowArrayStream(std::move(reader)); +} + +namespace { + +Result FindFieldIndexById(std::span fields, int32_t field_id) { + for (size_t index = 0; index < fields.size(); ++index) { + if (fields[index].field_id() == field_id) { + return index; + } + } + return InvalidArgument("Required schema does not contain projected field id {}", + field_id); +} + +std::mutex g_project_batch_function_mutex; +ProjectionContext::ProjectBatchFunction g_project_batch_function = nullptr; + +ProjectionContext::ProjectBatchFunction GetProjectBatchFunction() { + std::lock_guard lock(g_project_batch_function_mutex); + return g_project_batch_function; +} + +Result> BuildSelectedFieldIndices( + std::span input_fields, + std::span output_fields) { + std::vector selected_field_indices; + selected_field_indices.reserve(output_fields.size()); + + for (const auto& output_field : output_fields) { + ICEBERG_ASSIGN_OR_RAISE(auto input_index, + FindFieldIndexById(input_fields, output_field.field_id())); + const auto& input_field = input_fields[input_index]; + if (*input_field.type() != *output_field.type()) { + return InvalidArgument( + "ProjectBatch only supports complete top-level fields, but field id " + "{} changes type from {} to {}", + output_field.field_id(), input_field.type()->ToString(), + output_field.type()->ToString()); + } + ICEBERG_PRECHECK( + input_index <= static_cast(std::numeric_limits::max()), + "Input field index {} exceeds int32 range", input_index); + selected_field_indices.push_back(static_cast(input_index)); + } + + return selected_field_indices; +} + +Status AppendValue(const ArrowSchema& input_schema, const ArrowArray& input_array, + const ArrowArrayView& input_view, int64_t row_index, + ArrowArray* output_array); + +Status AppendListValues(const ArrowSchema& input_schema, const ArrowArray& input_array, + const ArrowArrayView& input_view, int64_t row_index, + ArrowArray* output_array) { + const int64_t begin = ArrowArrayViewListChildOffset(&input_view, row_index); + const int64_t end = ArrowArrayViewListChildOffset(&input_view, row_index + 1); + for (int64_t element_index = begin; element_index < end; ++element_index) { + ICEBERG_RETURN_UNEXPECTED( + AppendValue(*input_schema.children[0], *input_array.children[0], + *input_view.children[0], element_index, output_array->children[0])); + } + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(output_array)); + return {}; +} + +Status AppendMapValues(const ArrowSchema& input_schema, const ArrowArray& input_array, + const ArrowArrayView& input_view, int64_t row_index, + ArrowArray* output_array) { + const int64_t begin = ArrowArrayViewListChildOffset(&input_view, row_index); + const int64_t end = ArrowArrayViewListChildOffset(&input_view, row_index + 1); + for (int64_t entry_index = begin; entry_index < end; ++entry_index) { + ICEBERG_RETURN_UNEXPECTED( + AppendValue(*input_schema.children[0], *input_array.children[0], + *input_view.children[0], entry_index, output_array->children[0])); + } + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(output_array)); + return {}; +} + +Status AppendDecimal(const ArrowSchema& input_schema, const ArrowArrayView& input_view, + int64_t row_index, ArrowArray* output_array) { + ArrowError error; + ArrowSchemaView schema_view; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowSchemaViewInit(&schema_view, &input_schema, &error), error); + + ArrowDecimal value; + ArrowDecimalInit(&value, schema_view.decimal_bitwidth, schema_view.decimal_precision, + schema_view.decimal_scale); + ArrowArrayViewGetDecimalUnsafe(&input_view, row_index, &value); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendDecimal(output_array, &value)); + return {}; +} + +Status AppendValue(const ArrowSchema& input_schema, const ArrowArray& input_array, + const ArrowArrayView& input_view, int64_t row_index, + ArrowArray* output_array) { + if (ArrowArrayViewIsNull(&input_view, row_index)) { + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendNull(output_array, 1)); + return {}; + } + + switch (input_view.storage_type) { + case NANOARROW_TYPE_NA: + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendNull(output_array, 1)); + return {}; + case NANOARROW_TYPE_BOOL: + case NANOARROW_TYPE_INT8: + case NANOARROW_TYPE_INT16: + case NANOARROW_TYPE_INT32: + case NANOARROW_TYPE_INT64: + case NANOARROW_TYPE_DATE32: + case NANOARROW_TYPE_DATE64: + case NANOARROW_TYPE_TIME32: + case NANOARROW_TYPE_TIME64: + case NANOARROW_TYPE_TIMESTAMP: + case NANOARROW_TYPE_DURATION: + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendInt( + output_array, ArrowArrayViewGetIntUnsafe(&input_view, row_index))); + return {}; + case NANOARROW_TYPE_UINT8: + case NANOARROW_TYPE_UINT16: + case NANOARROW_TYPE_UINT32: + case NANOARROW_TYPE_UINT64: + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendUInt( + output_array, ArrowArrayViewGetUIntUnsafe(&input_view, row_index))); + return {}; + case NANOARROW_TYPE_HALF_FLOAT: + case NANOARROW_TYPE_FLOAT: + case NANOARROW_TYPE_DOUBLE: + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendDouble( + output_array, ArrowArrayViewGetDoubleUnsafe(&input_view, row_index))); + return {}; + case NANOARROW_TYPE_STRING: + case NANOARROW_TYPE_LARGE_STRING: + case NANOARROW_TYPE_STRING_VIEW: { + auto value = ArrowArrayViewGetStringUnsafe(&input_view, row_index); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendString(output_array, value)); + return {}; + } + case NANOARROW_TYPE_BINARY: + case NANOARROW_TYPE_LARGE_BINARY: + case NANOARROW_TYPE_FIXED_SIZE_BINARY: + case NANOARROW_TYPE_BINARY_VIEW: { + auto value = ArrowArrayViewGetBytesUnsafe(&input_view, row_index); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendBytes(output_array, value)); + return {}; + } + case NANOARROW_TYPE_DECIMAL128: + case NANOARROW_TYPE_DECIMAL256: + return AppendDecimal(input_schema, input_view, row_index, output_array); + case NANOARROW_TYPE_STRUCT: { + for (int64_t child_index = 0; child_index < input_schema.n_children; + ++child_index) { + ICEBERG_RETURN_UNEXPECTED(AppendValue( + *input_schema.children[child_index], *input_array.children[child_index], + *input_view.children[child_index], row_index, + output_array->children[child_index])); + } + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(output_array)); + return {}; + } + case NANOARROW_TYPE_LIST: + case NANOARROW_TYPE_LARGE_LIST: + case NANOARROW_TYPE_FIXED_SIZE_LIST: + return AppendListValues(input_schema, input_array, input_view, row_index, + output_array); + case NANOARROW_TYPE_MAP: + return AppendMapValues(input_schema, input_array, input_view, row_index, + output_array); + default: + return NotImplemented("Unsupported Arrow type for merge-on-read projection: {}", + static_cast(input_view.storage_type)); + } +} + +} // namespace + +ProjectionContext::ProjectionContext(ProjectionContext&& other) noexcept + : input_schema_(std::exchange(other.input_schema_, nullptr)), + output_schema_(std::exchange(other.output_schema_, nullptr)), + selected_field_indices_(std::move(other.selected_field_indices_)), + input_arrow_schema_(other.input_arrow_schema_), + output_arrow_schema_(other.output_arrow_schema_), + project_batch_function_(std::exchange(other.project_batch_function_, nullptr)), + project_batch_state_(std::move(other.project_batch_state_)) { + other.input_arrow_schema_.release = nullptr; + other.output_arrow_schema_.release = nullptr; +} + +ProjectionContext& ProjectionContext::operator=(ProjectionContext&& other) noexcept { + if (this == &other) { + return *this; + } + + if (input_arrow_schema_.release != nullptr) { + input_arrow_schema_.release(&input_arrow_schema_); + } + if (output_arrow_schema_.release != nullptr) { + output_arrow_schema_.release(&output_arrow_schema_); + } + + input_schema_ = std::exchange(other.input_schema_, nullptr); + output_schema_ = std::exchange(other.output_schema_, nullptr); + selected_field_indices_ = std::move(other.selected_field_indices_); + input_arrow_schema_ = other.input_arrow_schema_; + other.input_arrow_schema_.release = nullptr; + output_arrow_schema_ = other.output_arrow_schema_; + other.output_arrow_schema_.release = nullptr; + project_batch_function_ = std::exchange(other.project_batch_function_, nullptr); + project_batch_state_ = std::move(other.project_batch_state_); + return *this; +} + +ProjectionContext::~ProjectionContext() { + if (input_arrow_schema_.release != nullptr) { + input_arrow_schema_.release(&input_arrow_schema_); + } + if (output_arrow_schema_.release != nullptr) { + output_arrow_schema_.release(&output_arrow_schema_); + } +} + +Result ProjectionContext::Make( + const Schema& input_schema, const Schema& output_schema, + ProjectionContext::ProjectBatchFunction project_batch_function) { + ICEBERG_ASSIGN_OR_RAISE( + auto selected_field_indices, + BuildSelectedFieldIndices(input_schema.fields(), output_schema.fields())); + + ProjectionContext context; + context.input_schema_ = &input_schema; + context.output_schema_ = &output_schema; + context.selected_field_indices_ = std::move(selected_field_indices); + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(input_schema, &context.input_arrow_schema_)); + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(output_schema, &context.output_arrow_schema_)); + context.project_batch_function_ = project_batch_function; + + return context; +} + +const Schema& ProjectionContext::input_schema() const { return *input_schema_; } + +const Schema& ProjectionContext::output_schema() const { return *output_schema_; } + +const ArrowSchema& ProjectionContext::input_arrow_schema() const { + return input_arrow_schema_; +} + +const ArrowSchema& ProjectionContext::output_arrow_schema() const { + return output_arrow_schema_; +} + +std::span ProjectionContext::selected_field_indices() const { + return selected_field_indices_; +} + +ProjectionContext::ProjectBatchFunction ProjectionContext::project_batch_function() + const { + return project_batch_function_; +} + +ProjectionContext::ProjectBatchState& ProjectionContext::project_batch_state() { + return project_batch_state_; +} + +void ProjectionContext::RegisterProjectBatchFunction( + ProjectionContext::ProjectBatchFunction project_batch_function) { + ICEBERG_DCHECK(project_batch_function != nullptr, + "ProjectBatch implementation must not be null"); + if (project_batch_function == nullptr) { + return; + } + std::lock_guard lock(g_project_batch_function_mutex); + g_project_batch_function = project_batch_function; +} + +bool ProjectionContext::HasProjectBatchFunction() { + return GetProjectBatchFunction() != nullptr; +} + +auto ProjectionContext::ResolveProjectBatchFunction() + -> ProjectionContext::ProjectBatchFunction { + return GetProjectBatchFunction(); +} + +namespace { + +Result ProjectBatchNanoarrow( + const ArrowSchema& input_arrow_schema, const ArrowArray& input_batch, + std::span row_indices, const ArrowSchema& output_arrow_schema, + std::span selected_field_indices) { + ArrowArrayView input_view; + ArrowError error; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayViewInitFromSchema(&input_view, &input_arrow_schema, &error), error); + internal::ArrowArrayViewGuard input_view_guard(&input_view); + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayViewSetArray(&input_view, &input_batch, &error), error); + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayViewValidate(&input_view, NANOARROW_VALIDATION_LEVEL_DEFAULT, &error), + error); + + ArrowArray output_array; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayInitFromSchema(&output_array, &output_arrow_schema, &error), error); + internal::ArrowArrayGuard output_array_guard(&output_array); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayStartAppending(&output_array)); + ICEBERG_NANOARROW_RETURN_UNEXPECTED( + ArrowArrayReserve(&output_array, static_cast(row_indices.size()))); + + for (int64_t row_index : row_indices) { + ICEBERG_PRECHECK(row_index >= 0 && row_index < input_batch.length, + "Row index {} out of range for batch length {}", row_index, + input_batch.length); + for (size_t output_index = 0; output_index < selected_field_indices.size(); + ++output_index) { + const int32_t input_index = selected_field_indices[output_index]; + ICEBERG_RETURN_UNEXPECTED(AppendValue(*input_arrow_schema.children[input_index], + *input_batch.children[input_index], + *input_view.children[input_index], row_index, + output_array.children[output_index])); + } + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(&output_array)); + } + + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayFinishBuildingDefault(&output_array, &error), error); + + return std::exchange(output_array, ArrowArray{}); +} + +} // namespace + +Result ProjectBatch(ArrowArray* input_batch, + std::span row_indices, + ProjectionContext& projection) { + ICEBERG_PRECHECK(input_batch != nullptr, "input_batch must not be null"); + internal::ArrowArrayGuard input_batch_guard(input_batch); + + auto project_batch_function = projection.project_batch_function(); + if (project_batch_function != nullptr) { + // ProjectBatch owns input_batch. Arrow-backed implementations import it and clear + // release, so input_batch_guard becomes a no-op instead of double-releasing. + return project_batch_function(input_batch, row_indices, projection); + } + + return ProjectBatchNanoarrow(projection.input_arrow_schema(), *input_batch, row_indices, + projection.output_arrow_schema(), + projection.selected_field_indices()); +} + +} // namespace iceberg diff --git a/src/iceberg/arrow_c_data_util_internal.h b/src/iceberg/arrow_c_data_util_internal.h new file mode 100644 index 000000000..e02db29a6 --- /dev/null +++ b/src/iceberg/arrow_c_data_util_internal.h @@ -0,0 +1,245 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Cached state for ProjectBatch over one input/output schema pair. +/// +/// Exported because this internal utility is shared across library translation units. +class ICEBERG_EXPORT ProjectionContext { + public: + using ProjectBatchState = std::shared_ptr; + + using ProjectBatchFunction = auto (*)(ArrowArray* input_batch, + std::span row_indices, + ProjectionContext& projection) + -> Result; + + /// \brief Register a custom implementation for ProjectBatch. + /// + /// Registration is process-wide. If multiple implementations are registered, + /// the last non-null implementation wins. + static void RegisterProjectBatchFunction(ProjectBatchFunction project_batch_function); + + /// \brief Returns true when a custom implementation has been registered. + static bool HasProjectBatchFunction(); + + /// \brief Resolve the registered ProjectBatch implementation. + static auto ResolveProjectBatchFunction() -> ProjectBatchFunction; + + /// \brief Build reusable projection state for a validated schema pair. + /// + /// \param input_schema Schema that describes every input batch. + /// \param output_schema Final schema and column order requested by the caller. + /// \param project_batch_function Optional implementation returned by + /// ProjectionContext::ResolveProjectBatchFunction, or nullptr to use the nanoarrow + /// path. + /// \note It validates that output_schema selects or reorders complete top-level fields + /// by field id. Nested pruning and type changes are rejected. The input_schema and + /// output_schema passed to Make must outlive the context. ProjectBatch may lazily + /// initialize backend cache; do not share one context across concurrent calls. + static Result Make(const Schema& input_schema, + const Schema& output_schema, + ProjectBatchFunction project_batch_function); + + ProjectionContext(ProjectionContext&&) noexcept; + ProjectionContext& operator=(ProjectionContext&&) noexcept; + ~ProjectionContext(); + + ProjectionContext(const ProjectionContext&) = delete; + ProjectionContext& operator=(const ProjectionContext&) = delete; + + const Schema& input_schema() const; + + const Schema& output_schema() const; + + const ArrowSchema& input_arrow_schema() const; + + const ArrowSchema& output_arrow_schema() const; + + std::span selected_field_indices() const; + + ProjectBatchFunction project_batch_function() const; + + ProjectBatchState& project_batch_state(); + + private: + ProjectionContext() = default; + + // Raw schema pointers are borrowed from caller-owned schemas. FileScanTaskReader + // keeps those schema objects alive in the same stream source that owns this context. + const Schema* input_schema_ = nullptr; + const Schema* output_schema_ = nullptr; + std::vector selected_field_indices_; + ArrowSchema input_arrow_schema_{}; + ArrowSchema output_arrow_schema_{}; + ProjectBatchFunction project_batch_function_ = nullptr; + ProjectBatchState project_batch_state_; +}; + +/// \brief Concept for sources that can be wrapped as ArrowArrayStreams. +template +concept ArrowArrayStreamProvider = requires(Source& source) { + { source.Close() } -> std::same_as; + { source.Next() } -> std::same_as>>; + { source.Schema() } -> std::same_as>; +}; + +namespace detail { + +template +struct ArrowArrayStreamPrivateData { + std::unique_ptr source; + std::string last_error; + + explicit ArrowArrayStreamPrivateData(std::unique_ptr src) + : source(std::move(src)) {} + + ~ArrowArrayStreamPrivateData() { + if (source != nullptr) { + std::ignore = source->Close(); + } + } +}; + +template +int GetSchema(struct ArrowArrayStream* stream, struct ArrowSchema* out) { + if (stream == nullptr || stream->private_data == nullptr) { + return EINVAL; + } + + auto* private_data = + static_cast*>(stream->private_data); + auto schema_result = private_data->source->Schema(); + if (!schema_result.has_value()) { + private_data->last_error = schema_result.error().message; + std::memset(out, 0, sizeof(ArrowSchema)); + return EIO; + } + + *out = std::move(schema_result.value()); + return 0; +} + +template +int GetNext(struct ArrowArrayStream* stream, struct ArrowArray* out) { + if (stream == nullptr || stream->private_data == nullptr) { + return EINVAL; + } + + auto* private_data = + static_cast*>(stream->private_data); + auto next_result = private_data->source->Next(); + if (!next_result.has_value()) { + private_data->last_error = next_result.error().message; + std::memset(out, 0, sizeof(ArrowArray)); + return EIO; + } + + auto& optional_array = next_result.value(); + if (optional_array.has_value()) { + *out = std::move(optional_array.value()); + } else { + std::memset(out, 0, sizeof(ArrowArray)); + } + + return 0; +} + +template +const char* GetLastError(struct ArrowArrayStream* stream) { + if (stream == nullptr || stream->private_data == nullptr) { + return nullptr; + } + + auto* private_data = + static_cast*>(stream->private_data); + return private_data->last_error.empty() ? nullptr : private_data->last_error.c_str(); +} + +template +void Release(struct ArrowArrayStream* stream) { + if (stream == nullptr || stream->private_data == nullptr) { + return; + } + + delete static_cast*>(stream->private_data); + stream->private_data = nullptr; + stream->release = nullptr; +} + +} // namespace detail + +/// \brief Wrap an object with Close, Next, and Schema as an ArrowArrayStream. +template +Result MakeArrowArrayStream(std::unique_ptr source) { + if (source == nullptr) { + return InvalidArgument("Cannot make ArrowArrayStream from null source"); + } + + auto private_data = + std::make_unique>(std::move(source)); + ArrowArrayStream stream{.get_schema = detail::GetSchema, + .get_next = detail::GetNext, + .get_last_error = detail::GetLastError, + .release = detail::Release, + .private_data = private_data.release()}; + return stream; +} + +/// \brief Wrap a Reader as an ArrowArrayStream. +ICEBERG_EXPORT Result MakeArrowArrayStream( + std::unique_ptr reader); + +/// \brief Project selected rows from a batch into complete top-level fields. +/// +/// `input_batch` is consumed by this function. If the projection carries a registered +/// implementation, the call is delegated to it; otherwise the built-in nanoarrow +/// implementation is used. The projection must have been created for the stable schema +/// pair that describes the input batch and requested output. This function does not +/// revalidate schema compatibility on each batch. +/// +/// \param input_batch Owned Arrow C Data batch to project. +/// \param row_indices Zero-based row positions to copy from `input_batch`. +/// \param projection Reusable schema/projection state created by +/// ProjectionContext::Make. +/// \return A newly owned ArrowArray matching `projection.output_schema()`. +ICEBERG_EXPORT Result ProjectBatch(ArrowArray* input_batch, + std::span row_indices, + ProjectionContext& projection); + +} // namespace iceberg diff --git a/src/iceberg/data/delete_filter.cc b/src/iceberg/data/delete_filter.cc index 876d644e5..5f21a32de 100644 --- a/src/iceberg/data/delete_filter.cc +++ b/src/iceberg/data/delete_filter.cc @@ -20,6 +20,7 @@ #include "iceberg/data/delete_filter.h" #include +#include #include #include #include @@ -745,7 +746,10 @@ Result DeleteFilter::ComputeAliveRows(const ArrowSchema& batc return result; } - result.indices.reserve(batch.length); + ICEBERG_PRECHECK( + batch.length <= static_cast(std::numeric_limits::max()), + "Batch length {} exceeds int32_t row index capacity", batch.length); + result.indices.reserve(static_cast(batch.length)); ICEBERG_ASSIGN_OR_RAISE(auto row, ArrowArrayStructLike::Make(batch_schema, batch)); for (int64_t i = 0; i < batch.length; ++i) { diff --git a/src/iceberg/data/file_scan_task_reader.cc b/src/iceberg/data/file_scan_task_reader.cc new file mode 100644 index 000000000..7076486ac --- /dev/null +++ b/src/iceberg/data/file_scan_task_reader.cc @@ -0,0 +1,235 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/data/file_scan_task_reader.h" + +#include +#include +#include +#include +#include + +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_c_data_util_internal.h" +#include "iceberg/data/delete_filter.h" +#include "iceberg/file_reader.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/schema.h" +#include "iceberg/schema_internal.h" +#include "iceberg/table_scan.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +ReaderOptions MakeReaderOptions(const DataFile& data_file, std::shared_ptr io, + std::shared_ptr projection, + std::shared_ptr filter, + std::shared_ptr name_mapping, + ReaderProperties properties) { + return ReaderOptions{ + .path = data_file.file_path, + .length = static_cast(data_file.file_size_in_bytes), + .io = std::move(io), + .projection = std::move(projection), + .filter = std::move(filter), + .name_mapping = std::move(name_mapping), + .properties = std::move(properties), + }; +} + +class MergeOnReadStreamSource { + public: + MergeOnReadStreamSource(std::unique_ptr reader, + std::unique_ptr delete_filter, + std::shared_ptr<::iceberg::Schema> required_schema, + std::shared_ptr<::iceberg::Schema> projected_schema, + ProjectionContext projection_context) + : reader_(std::move(reader)), + delete_filter_(std::move(delete_filter)), + required_schema_(std::move(required_schema)), + projected_schema_(std::move(projected_schema)), + project_all_rows_(required_schema_->SameSchema(*projected_schema_)), + projection_context_(std::move(projection_context)) {} + + ~MergeOnReadStreamSource() { + if (cached_schema_.has_value() && cached_schema_->release != nullptr) { + cached_schema_->release(&cached_schema_.value()); + } + } + + Status Close() { + if (reader_ == nullptr) { + return {}; + } + return reader_->Close(); + } + + Result> Next() { + if (!cached_schema_.has_value()) { + // File readers expose one stable Arrow schema for every batch in the stream. + ICEBERG_ASSIGN_OR_RAISE(cached_schema_, reader_->Schema()); + } + ArrowSchema& input_arrow_schema = cached_schema_.value(); + + while (true) { + ICEBERG_ASSIGN_OR_RAISE(auto next_batch, reader_->Next()); + if (!next_batch.has_value()) { + return std::nullopt; + } + + ArrowArray input_batch = std::move(next_batch.value()); + internal::ArrowArrayGuard input_batch_guard(&input_batch); + + ICEBERG_ASSIGN_OR_RAISE( + auto alive, delete_filter_->ComputeAliveRows(input_arrow_schema, input_batch)); + if (alive.empty()) { + continue; + } + + if (alive.alive_count() == input_batch.length && project_all_rows_) { + // Transfer ownership to the stream result; the local guard must not release it. + ArrowArray output_batch = input_batch; + input_batch.release = nullptr; + return output_batch; + } + + return ProjectBatch(&input_batch, alive.indices, projection_context_); + } + } + + Result Schema() { + ArrowSchema schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*projected_schema_, &schema)); + return schema; + } + + private: + std::unique_ptr reader_; + std::unique_ptr delete_filter_; + std::shared_ptr<::iceberg::Schema> required_schema_; + std::shared_ptr<::iceberg::Schema> projected_schema_; + bool project_all_rows_ = false; + ProjectionContext projection_context_; + std::optional cached_schema_; +}; + +} // namespace + +class FileScanTaskReader::Impl { + public: + static Result> Make(Options options) { + ICEBERG_PRECHECK(options.io != nullptr, "FileIO must not be null"); + ICEBERG_PRECHECK(options.table_schema != nullptr, "Table schema must not be null"); + ICEBERG_PRECHECK(options.projected_schema != nullptr, + "Projected schema must not be null"); + for (const auto& schema : options.schemas) { + ICEBERG_PRECHECK(schema != nullptr, "Schema list must not contain null schemas"); + } + + ICEBERG_ASSIGN_OR_RAISE( + auto field_lookup, + DeleteFilter::MakeFieldLookup(options.table_schema, options.schemas)); + auto delete_counter = std::make_shared(); + + return std::unique_ptr( + new Impl(std::move(options), std::move(field_lookup), std::move(delete_counter))); + } + + Result Open(const FileScanTask& task) { + const auto& data_file = task.data_file(); + ICEBERG_PRECHECK(data_file != nullptr, "Data file must not be null"); + ICEBERG_PRECHECK(data_file->file_size_in_bytes >= 0, + "Data file size must not be negative: {}", + data_file->file_size_in_bytes); + + if (task.delete_files().empty()) { + auto options = + MakeReaderOptions(*data_file, io_, projected_schema_, task.residual_filter(), + name_mapping_, properties_); + ICEBERG_ASSIGN_OR_RAISE( + auto reader, ReaderFactoryRegistry::Open(data_file->file_format, options)); + return MakeArrowArrayStream(std::move(reader)); + } + + const bool has_position_deletes = + std::any_of(task.delete_files().begin(), task.delete_files().end(), + [](const std::shared_ptr& f) { + return f->content == DataFile::Content::kPositionDeletes; + }); + + ICEBERG_ASSIGN_OR_RAISE( + auto delete_filter, + DeleteFilter::Make(data_file->file_path, task.delete_files(), projected_schema_, + io_, field_lookup_, has_position_deletes, delete_counter_)); + + auto required_schema = delete_filter->RequiredSchema(); + auto project_batch_function = ProjectionContext::ResolveProjectBatchFunction(); + // ProjectionContext borrows schemas that are kept in MergeOnReadStreamSource. + ICEBERG_ASSIGN_OR_RAISE(auto projection_context, + ProjectionContext::Make(*required_schema, *projected_schema_, + project_batch_function)); + + auto options = MakeReaderOptions(*data_file, io_, required_schema, + task.residual_filter(), name_mapping_, properties_); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ReaderFactoryRegistry::Open(data_file->file_format, options)); + + auto mor_reader = std::make_unique( + std::move(reader), std::move(delete_filter), std::move(required_schema), + projected_schema_, std::move(projection_context)); + return MakeArrowArrayStream(std::move(mor_reader)); + } + + private: + Impl(Options options, DeleteFilter::FieldLookup field_lookup, + std::shared_ptr delete_counter) + : io_(std::move(options.io)), + schemas_(std::move(options.schemas)), + projected_schema_(std::move(options.projected_schema)), + name_mapping_(std::move(options.name_mapping)), + properties_(ReaderProperties::FromMap(options.properties)), + field_lookup_(std::move(field_lookup)), + delete_counter_(std::move(delete_counter)) {} + + std::shared_ptr io_; + std::vector> schemas_; + std::shared_ptr projected_schema_; + std::shared_ptr name_mapping_; + ReaderProperties properties_; + DeleteFilter::FieldLookup field_lookup_; + std::shared_ptr delete_counter_; +}; + +Result> FileScanTaskReader::Make(Options options) { + ICEBERG_ASSIGN_OR_RAISE(auto impl, Impl::Make(std::move(options))); + return std::unique_ptr(new FileScanTaskReader(std::move(impl))); +} + +FileScanTaskReader::FileScanTaskReader(std::unique_ptr impl) + : impl_(std::move(impl)) {} + +FileScanTaskReader::~FileScanTaskReader() = default; + +Result FileScanTaskReader::Open(const FileScanTask& task) { + return impl_->Open(task); +} + +} // namespace iceberg diff --git a/src/iceberg/data/file_scan_task_reader.h b/src/iceberg/data/file_scan_task_reader.h new file mode 100644 index 000000000..a71ef5f84 --- /dev/null +++ b/src/iceberg/data/file_scan_task_reader.h @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/data/file_scan_task_reader.h +/// Delete-aware FileScanTask reader for copy-on-write and merge-on-read paths. + +#include +#include +#include +#include + +#include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_data_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Opens a FileScanTask as an ArrowArrayStream. +/// +/// FileScanTaskReader chooses the copy-on-write path for tasks without deletes and +/// the merge-on-read path for tasks with v2 position or equality deletes. The returned +/// stream always exposes `projected_schema`. +/// +/// TODO(gangwu): Add a mode that emits a `_deleted` column instead of filtering rows. +/// TODO(gangwu): Use evaluator to apply residual expression filters. +class ICEBERG_DATA_EXPORT FileScanTaskReader { + public: + /// \brief Options shared by all tasks opened by this reader. + struct Options { + /// FileIO instance for reading data and delete files. + std::shared_ptr io; + /// The table schema. Used as the primary field lookup for delete file resolution. + std::shared_ptr table_schema; + /// Optional list of historical table schemas for field lookup. + std::vector> schemas; + /// The output schema for the returned ArrowArrayStream. Must be a + /// projection of table_schema. + std::shared_ptr projected_schema; + /// Optional name mapping for files written without field IDs. + std::shared_ptr name_mapping; + /// Format-specific or implementation-specific options for data readers. + std::unordered_map properties; + }; + + /// \brief Create a reusable task reader from shared read context. + static Result> Make(Options options); + + ~FileScanTaskReader(); + + /// \brief Open a task and return an Arrow C stream for its projected live rows. + Result Open(const FileScanTask& task); + + FileScanTaskReader(const FileScanTaskReader&) = delete; + FileScanTaskReader& operator=(const FileScanTaskReader&) = delete; + + private: + class Impl; + explicit FileScanTaskReader(std::unique_ptr impl); + std::unique_ptr impl_; +}; + +} // namespace iceberg diff --git a/src/iceberg/data/meson.build b/src/iceberg/data/meson.build index f0877ec64..bbb26db27 100644 --- a/src/iceberg/data/meson.build +++ b/src/iceberg/data/meson.build @@ -21,6 +21,7 @@ install_headers( 'delete_filter.h', 'delete_loader.h', 'equality_delete_writer.h', + 'file_scan_task_reader.h', 'position_delete_writer.h', 'writer.h', ], diff --git a/src/iceberg/file_reader.h b/src/iceberg/file_reader.h index c31d9b292..c76c10093 100644 --- a/src/iceberg/file_reader.h +++ b/src/iceberg/file_reader.h @@ -68,7 +68,7 @@ struct ICEBERG_EXPORT Split { size_t length; }; -class ReaderProperties : public ConfigBase { +class ICEBERG_EXPORT ReaderProperties : public ConfigBase { public: template using Entry = const ConfigBase::Entry; diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 03dc24479..69fe733be 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -41,6 +41,7 @@ configure_file( iceberg_include_dir = include_directories('..') iceberg_sources = files( 'arrow_c_data_guard_internal.cc', + 'arrow_c_data_util.cc', 'catalog/memory/in_memory_catalog.cc', 'delete_file_index.cc', 'expression/aggregate.cc', @@ -147,6 +148,7 @@ iceberg_data_sources = files( 'data/delete_filter.cc', 'data/delete_loader.cc', 'data/equality_delete_writer.cc', + 'data/file_scan_task_reader.cc', 'data/position_delete_writer.cc', 'data/writer.cc', 'deletes/position_delete_index.cc', diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index 71075d90a..6881d34fb 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -20,14 +20,11 @@ #include "iceberg/table_scan.h" #include -#include -#include #include #include "iceberg/expression/binder.h" #include "iceberg/expression/expression.h" #include "iceberg/expression/residual_evaluator.h" -#include "iceberg/file_reader.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_group.h" #include "iceberg/result.h" @@ -61,103 +58,6 @@ const std::vector kScanColumnsWithStats = [] { return cols; }(); -/// \brief Private data structure to hold the Reader and error state -struct ReaderStreamPrivateData { - std::unique_ptr reader; - std::string last_error; - - explicit ReaderStreamPrivateData(std::unique_ptr reader_ptr) - : reader(std::move(reader_ptr)) {} - - ~ReaderStreamPrivateData() { - if (reader) { - std::ignore = reader->Close(); - } - } -}; - -/// \brief Callback to get the stream schema -static int GetSchema(struct ArrowArrayStream* stream, struct ArrowSchema* out) { - if (!stream || !stream->private_data) { - return EINVAL; - } - auto* private_data = static_cast(stream->private_data); - // Get schema from reader - auto schema_result = private_data->reader->Schema(); - if (!schema_result.has_value()) { - private_data->last_error = schema_result.error().message; - std::memset(out, 0, sizeof(ArrowSchema)); - return EIO; - } - - *out = std::move(schema_result.value()); - return 0; -} - -/// \brief Callback to get the next array from the stream -static int GetNext(struct ArrowArrayStream* stream, struct ArrowArray* out) { - if (!stream || !stream->private_data) { - return EINVAL; - } - - auto* private_data = static_cast(stream->private_data); - - auto next_result = private_data->reader->Next(); - if (!next_result.has_value()) { - private_data->last_error = next_result.error().message; - std::memset(out, 0, sizeof(ArrowArray)); - return EIO; - } - - auto& optional_array = next_result.value(); - if (optional_array.has_value()) { - *out = std::move(optional_array.value()); - } else { - // End of stream - set release to nullptr to signal end - std::memset(out, 0, sizeof(ArrowArray)); - out->release = nullptr; - } - - return 0; -} - -/// \brief Callback to get the last error message -static const char* GetLastError(struct ArrowArrayStream* stream) { - if (!stream || !stream->private_data) { - return nullptr; - } - - auto* private_data = static_cast(stream->private_data); - return private_data->last_error.empty() ? nullptr : private_data->last_error.c_str(); -} - -/// \brief Callback to release the stream resources -static void Release(struct ArrowArrayStream* stream) { - if (!stream || !stream->private_data) { - return; - } - - delete static_cast(stream->private_data); - stream->private_data = nullptr; - stream->release = nullptr; -} - -Result MakeArrowArrayStream(std::unique_ptr reader) { - if (!reader) { - return InvalidArgument("Reader cannot be null"); - } - - auto private_data = std::make_unique(std::move(reader)); - - ArrowArrayStream stream{.get_schema = GetSchema, - .get_next = GetNext, - .get_last_error = GetLastError, - .release = Release, - .private_data = private_data.release()}; - - return stream; -} - } // namespace namespace internal { @@ -280,24 +180,6 @@ int32_t FileScanTask::files_count() const { return 1; } int64_t FileScanTask::estimated_row_count() const { return data_file_->record_count; } -Result FileScanTask::ToArrow( - const std::shared_ptr& io, std::shared_ptr projected_schema) const { - if (!delete_files_.empty()) { - return NotSupported("Reading data files with delete files is not yet supported."); - } - - const ReaderOptions options{.path = data_file_->file_path, - .length = data_file_->file_size_in_bytes, - .io = io, - .projection = std::move(projected_schema), - .filter = residual_filter_}; - - ICEBERG_ASSIGN_OR_RAISE(auto reader, - ReaderFactoryRegistry::Open(data_file_->file_format, options)); - - return MakeArrowArrayStream(std::move(reader)); -} - // ChangelogScanTask implementation int64_t ChangelogScanTask::size_bytes() const { diff --git a/src/iceberg/table_scan.h b/src/iceberg/table_scan.h index 307946e6c..64fb3ffd1 100644 --- a/src/iceberg/table_scan.h +++ b/src/iceberg/table_scan.h @@ -27,7 +27,6 @@ #include #include -#include "iceberg/arrow_c_data.h" #include "iceberg/iceberg_export.h" #include "iceberg/result.h" #include "iceberg/table_metadata.h" @@ -87,16 +86,6 @@ class ICEBERG_EXPORT FileScanTask : public ScanTask { int32_t files_count() const override; int64_t estimated_row_count() const override; - /// TODO(gangwu): move it to iceberg/data/task_scanner.h - /// - /// \brief Returns a C-ABI compatible ArrowArrayStream to read the data for this task. - /// - /// \param io The FileIO instance for accessing the file data. - /// \param projected_schema The projected schema for reading the data. - /// \return A Result containing an ArrowArrayStream, or an error on failure. - Result ToArrow(const std::shared_ptr& io, - std::shared_ptr projected_schema) const; - private: std::shared_ptr data_file_; std::vector> delete_files_; diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 37e66ed59..c632403c3 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -222,9 +222,11 @@ if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(data_test USE_BUNDLE SOURCES + arrow_c_data_util_test.cc data_writer_test.cc delete_filter_test.cc - delete_loader_test.cc) + delete_loader_test.cc + file_scan_task_reader_test.cc) endif() diff --git a/src/iceberg/test/arrow_c_data_util_test.cc b/src/iceberg/test/arrow_c_data_util_test.cc new file mode 100644 index 000000000..c93a928a3 --- /dev/null +++ b/src/iceberg/test/arrow_c_data_util_test.cc @@ -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. + */ + +/// \file arrow_c_data_util_test.cc +/// Verifies ProjectBatch behavior across registered implementations. + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_register.h" +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_c_data_util_internal.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/schema_internal.h" +#include "iceberg/test/matchers.h" +#include "iceberg/type.h" + +namespace iceberg::internal { + +namespace { + +std::shared_ptr<::arrow::RecordBatch> MakeBatch(const Schema& schema, + std::string_view json) { + ArrowSchema c_schema; + EXPECT_THAT(ToArrowSchema(schema, &c_schema), IsOk()); + // ImportSchema takes ownership of c_schema and calls release. + auto arrow_schema = ::arrow::ImportSchema(&c_schema).ValueOrDie(); + auto struct_type = ::arrow::struct_(arrow_schema->fields()); + return ::arrow::RecordBatch::FromStructArray( + ::arrow::json::ArrayFromJSONString(struct_type, std::string(json)) + .ValueOrDie()) + .ValueOrDie(); +} + +ProjectionContext::ProjectBatchFunction ArrowComputeFunction() { + arrow::RegisterAll(); + auto function = ProjectionContext::ResolveProjectBatchFunction(); + EXPECT_NE(function, nullptr); + return function; +} + +std::shared_ptr<::arrow::RecordBatch> RunProjectBatch( + const ::arrow::RecordBatch& batch, const std::vector& alive_indices, + const Schema& required_schema, const Schema& projected_schema, + ProjectionContext::ProjectBatchFunction project_batch_function) { + ArrowSchema c_schema; + ArrowArray c_array; + EXPECT_TRUE(::arrow::ExportRecordBatch(batch, &c_array, &c_schema).ok()); + ArrowSchemaGuard schema_guard(&c_schema); + ArrowArrayGuard array_guard(&c_array); + + auto projection = + ProjectionContext::Make(required_schema, projected_schema, project_batch_function); + EXPECT_THAT(projection, IsOk()); + + auto result = ProjectBatch(&c_array, alive_indices, projection.value()); + EXPECT_THAT(result, IsOk()); + + ArrowSchema out_c_schema; + EXPECT_THAT(ToArrowSchema(projected_schema, &out_c_schema), IsOk()); + auto arrow_out_schema = ::arrow::ImportSchema(&out_c_schema).ValueOrDie(); + + ArrowArray out_array = std::exchange(result.value(), ArrowArray{}); + return ::arrow::ImportRecordBatch(&out_array, arrow_out_schema).ValueOrDie(); +} + +void ExpectProjectBatch(const ::arrow::RecordBatch& batch, + const std::vector& alive_indices, + const Schema& required_schema, const Schema& projected_schema, + std::string_view expected_json) { + auto expected = MakeBatch(projected_schema, expected_json); + auto nanoarrow = + RunProjectBatch(batch, alive_indices, required_schema, projected_schema, nullptr); + auto arrow_compute = RunProjectBatch(batch, alive_indices, required_schema, + projected_schema, ArrowComputeFunction()); + + EXPECT_TRUE(nanoarrow->Equals(*expected)) << "nanoarrow:\n" + << nanoarrow->ToString() << "expected:\n" + << expected->ToString(); + EXPECT_TRUE(arrow_compute->Equals(*expected)) + << "arrow_compute:\n" + << arrow_compute->ToString() << "expected:\n" + << expected->ToString(); + EXPECT_TRUE(nanoarrow->Equals(*arrow_compute)) + << "nanoarrow:\n" + << nanoarrow->ToString() << "arrow_compute:\n" + << arrow_compute->ToString(); +} + +std::shared_ptr MakeFullSchema() { + return std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "score", float64())}); +} + +} // namespace + +TEST(ProjectBatchTest, ProjectSelectedRowsWithoutColumnProjection) { + auto schema = MakeFullSchema(); + auto batch = MakeBatch(*schema, R"([[1,"a",1.0],[2,"b",2.0],[3,"c",3.0],[4,"d",4.0]])"); + std::vector alive = {0, 2}; + + ExpectProjectBatch(*batch, alive, *schema, *schema, R"([[1,"a",1.0],[3,"c",3.0]])"); +} + +TEST(ProjectBatchTest, ProjectColumnsWithoutRowFiltering) { + auto full_schema = MakeFullSchema(); + auto projected = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}); + auto batch = MakeBatch(*full_schema, R"([[1,"a",1.0],[2,"b",2.0],[3,"c",3.0]])"); + std::vector alive = {0, 1, 2}; + + ExpectProjectBatch(*batch, alive, *full_schema, *projected, + R"([[1,"a"],[2,"b"],[3,"c"]])"); +} + +TEST(ProjectBatchTest, ProjectSelectedRowsAndReorderColumns) { + auto full_schema = MakeFullSchema(); + // Reorder: score(3) before name(2), drop id(1). + auto projected = std::make_shared( + std::vector{SchemaField::MakeOptional(3, "score", float64()), + SchemaField::MakeOptional(2, "name", string())}); + auto batch = MakeBatch(*full_schema, R"([[1,"a",1.0],[2,"b",2.0],[3,"c",3.0]])"); + std::vector alive = {1, 2}; + + ExpectProjectBatch(*batch, alive, *full_schema, *projected, R"([[2.0,"b"],[3.0,"c"]])"); +} + +TEST(ProjectBatchTest, NullValues) { + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}); + auto batch = MakeBatch(*schema, R"([[1,null],[2,"b"],[3,null]])"); + std::vector alive = {0, 2}; + + ExpectProjectBatch(*batch, alive, *schema, *schema, R"([[1,null],[3,null]])"); +} + +TEST(ProjectBatchTest, EmptyRowSelection) { + auto schema = MakeFullSchema(); + auto batch = MakeBatch(*schema, R"([[1,"a",1.0],[2,"b",2.0]])"); + std::vector alive = {}; + + ExpectProjectBatch(*batch, alive, *schema, *schema, R"([])"); +} + +TEST(ProjectBatchTest, ProjectionRejectsNestedPruning) { + auto input_schema = Schema(std::vector{ + SchemaField::MakeOptional(1, "person", + std::make_shared(std::vector{ + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "age", int32()), + })), + }); + auto output_schema = Schema(std::vector{ + SchemaField::MakeOptional(1, "person", + std::make_shared(std::vector{ + SchemaField::MakeOptional(2, "name", string()), + })), + }); + + auto projection = ProjectionContext::Make(input_schema, output_schema, nullptr); + + EXPECT_THAT(projection, IsError(ErrorKind::kInvalidArgument)); +} + +} // namespace iceberg::internal diff --git a/src/iceberg/test/file_scan_task_reader_test.cc b/src/iceberg/test/file_scan_task_reader_test.cc new file mode 100644 index 000000000..1630a108a --- /dev/null +++ b/src/iceberg/test/file_scan_task_reader_test.cc @@ -0,0 +1,524 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/data/file_scan_task_reader.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/arrow/arrow_register.h" +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_c_data_util_internal.h" +#include "iceberg/data/equality_delete_writer.h" +#include "iceberg/data/position_delete_writer.h" +#include "iceberg/file_format.h" +#include "iceberg/file_reader.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/parquet/parquet_register.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/schema_internal.h" +#include "iceberg/table_scan.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/temp_file_test_base.h" +#include "iceberg/type.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +namespace { + +struct ExportedBatch { + ArrowSchema schema{}; + ArrowArray array{}; + + ~ExportedBatch() { + if (array.release != nullptr) { + array.release(&array); + } + if (schema.release != nullptr) { + schema.release(&schema); + } + } + + ExportedBatch() = default; + ExportedBatch(const ExportedBatch&) = delete; + ExportedBatch& operator=(const ExportedBatch&) = delete; + + ExportedBatch(ExportedBatch&& other) noexcept + : schema(other.schema), array(other.array) { + other.schema.release = nullptr; + other.array.release = nullptr; + } + ExportedBatch& operator=(ExportedBatch&& other) noexcept = delete; +}; + +} // namespace + +class FileScanTaskReaderTest : public TempFileTestBase { + protected: + static void SetUpTestSuite() { + arrow::RegisterAll(); + parquet::RegisterAll(); + } + + void SetUp() override { + TempFileTestBase::SetUp(); + file_io_ = arrow::ArrowFileSystemFileIO::MakeLocalFileIO(); + partition_spec_ = PartitionSpec::Unpartitioned(); + table_schema_ = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "category", string())}, + /*schema_id=*/2); + projected_schema_ = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}, + table_schema_->schema_id()); + } + + Result MakeBatch(const Schema& schema, + const std::string& json_data) const { + ICEBERG_ASSIGN_OR_RAISE(auto arrow_schema, MakeArrowSchema(schema)); + auto struct_type = ::arrow::struct_(arrow_schema->fields()); + auto array_result = ::arrow::json::ArrayFromJSONString(struct_type, json_data); + if (!array_result.ok()) { + return UnknownError(array_result.status().ToString()); + } + + ExportedBatch batch; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(schema, &batch.schema)); + auto export_status = + ::arrow::ExportArray(*array_result.MoveValueUnsafe(), &batch.array); + if (!export_status.ok()) { + return UnknownError(export_status.ToString()); + } + return std::move(batch); + } + + Result> MakeArrowSchema(const Schema& schema) const { + ArrowSchema c_schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(schema, &c_schema)); + auto arrow_schema_result = ::arrow::ImportSchema(&c_schema); + if (!arrow_schema_result.ok()) { + return UnknownError(arrow_schema_result.status().ToString()); + } + return arrow_schema_result.MoveValueUnsafe(); + } + + Result> MakeRecordBatch( + const std::shared_ptr<::arrow::Schema>& arrow_schema, + const std::string& json_data) const { + auto struct_type = ::arrow::struct_(arrow_schema->fields()); + auto array_result = ::arrow::json::ArrayFromJSONString(struct_type, json_data); + if (!array_result.ok()) { + return UnknownError(array_result.status().ToString()); + } + + auto batch_result = + ::arrow::RecordBatch::FromStructArray(array_result.MoveValueUnsafe()); + if (!batch_result.ok()) { + return UnknownError(batch_result.status().ToString()); + } + return batch_result.MoveValueUnsafe(); + } + + Result CreateParquetDataFile(std::shared_ptr schema, + const std::string& json_data, + int64_t row_group_size = 1024) { + auto path = CreateNewTempFilePathWithSuffix(".parquet"); + + ICEBERG_ASSIGN_OR_RAISE(auto arrow_schema, MakeArrowSchema(*schema)); + ICEBERG_ASSIGN_OR_RAISE(auto batch, MakeRecordBatch(arrow_schema, json_data)); + auto table_result = + ::arrow::Table::FromRecordBatches(arrow_schema, {std::move(batch)}); + if (!table_result.ok()) { + return UnknownError(table_result.status().ToString()); + } + + ICEBERG_ASSIGN_OR_RAISE(auto outfile, arrow::OpenArrowOutputStream(file_io_, path)); + auto write_status = ::parquet::arrow::WriteTable(*table_result.MoveValueUnsafe(), + ::arrow::default_memory_pool(), + outfile, row_group_size); + if (!write_status.ok()) { + return UnknownError(write_status.ToString()); + } + if (auto close_status = outfile->Close(); !close_status.ok()) { + return UnknownError(close_status.ToString()); + } + return path; + } + + Result CreateParquetDataFile(std::shared_ptr schema, + const std::vector& json_batches, + int64_t max_row_group_length) { + ICEBERG_PRECHECK(!json_batches.empty(), "Parquet data file must have a batch"); + + auto path = CreateNewTempFilePathWithSuffix(".parquet"); + ICEBERG_ASSIGN_OR_RAISE(auto arrow_schema, MakeArrowSchema(*schema)); + ICEBERG_ASSIGN_OR_RAISE(auto outfile, arrow::OpenArrowOutputStream(file_io_, path)); + + auto properties_builder = ::parquet::WriterProperties::Builder(); + auto writer_properties = + properties_builder.compression(::parquet::Compression::UNCOMPRESSED) + ->max_row_group_length(max_row_group_length) + ->build(); + auto writer_result = ::parquet::arrow::FileWriter::Open( + *arrow_schema, ::arrow::default_memory_pool(), outfile, writer_properties); + if (!writer_result.ok()) { + return UnknownError(writer_result.status().ToString()); + } + auto writer = writer_result.MoveValueUnsafe(); + + for (const auto& json_batch : json_batches) { + ICEBERG_ASSIGN_OR_RAISE(auto batch, MakeRecordBatch(arrow_schema, json_batch)); + if (auto write_status = writer->WriteRecordBatch(*batch); !write_status.ok()) { + return UnknownError(write_status.ToString()); + } + } + if (auto close_status = writer->Close(); !close_status.ok()) { + return UnknownError(close_status.ToString()); + } + ICEBERG_PRECHECK( + writer->metadata()->num_row_groups() == static_cast(json_batches.size()), + "Expected {} Parquet row groups, got {}", json_batches.size(), + writer->metadata()->num_row_groups()); + if (auto close_status = outfile->Close(); !close_status.ok()) { + return UnknownError(close_status.ToString()); + } + return path; + } + + Result> MakeDataFile(std::shared_ptr schema, + const std::string& json_data, + int64_t record_count = 3) { + ICEBERG_ASSIGN_OR_RAISE(auto path, + CreateParquetDataFile(std::move(schema), json_data)); + ICEBERG_ASSIGN_OR_RAISE(auto input_file, file_io_->NewInputFile(path)); + ICEBERG_ASSIGN_OR_RAISE(auto size, input_file->Size()); + return std::make_shared(DataFile{ + .content = DataFile::Content::kData, + .file_path = path, + .file_format = FileFormatType::kParquet, + .record_count = record_count, + .file_size_in_bytes = size, + }); + } + + Result> MakeDataFile( + std::shared_ptr schema, const std::vector& json_batches, + int64_t record_count, int64_t max_row_group_length) { + ICEBERG_ASSIGN_OR_RAISE( + auto path, + CreateParquetDataFile(std::move(schema), json_batches, max_row_group_length)); + ICEBERG_ASSIGN_OR_RAISE(auto input_file, file_io_->NewInputFile(path)); + ICEBERG_ASSIGN_OR_RAISE(auto size, input_file->Size()); + return std::make_shared(DataFile{ + .content = DataFile::Content::kData, + .file_path = path, + .file_format = FileFormatType::kParquet, + .record_count = record_count, + .file_size_in_bytes = size, + }); + } + + Result> MakePositionDeleteFile( + const std::string& path, const std::vector& positions, + const std::string& data_path) { + PositionDeleteWriterOptions options{ + .path = path, + .schema = table_schema_, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .flush_threshold = 10000, + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + + ICEBERG_ASSIGN_OR_RAISE(auto writer, PositionDeleteWriter::Make(options)); + for (int64_t pos : positions) { + ICEBERG_RETURN_UNEXPECTED(writer->WriteDelete(data_path, pos)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, writer->Metadata()); + return metadata.data_files[0]; + } + + Result> MakeEqualityDeleteFile( + const std::string& path, std::shared_ptr schema, + const std::string& json_data, std::vector equality_field_ids) { + EqualityDeleteWriterOptions options{ + .path = path, + .schema = schema, + .spec = partition_spec_, + .partition = PartitionValues{}, + .format = FileFormatType::kParquet, + .io = file_io_, + .equality_field_ids = std::move(equality_field_ids), + .properties = {{"write.parquet.compression-codec", "uncompressed"}}, + }; + + ICEBERG_ASSIGN_OR_RAISE(auto writer, EqualityDeleteWriter::Make(options)); + ICEBERG_ASSIGN_OR_RAISE(auto batch, MakeBatch(*schema, json_data)); + ICEBERG_RETURN_UNEXPECTED(writer->Write(&batch.array)); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, writer->Metadata()); + return metadata.data_files[0]; + } + + void VerifyStream(struct ArrowArrayStream* stream, std::string_view expected_json) { + auto record_batch_reader = ::arrow::ImportRecordBatchReader(stream).ValueOrDie(); + + auto result = record_batch_reader->Next(); + ASSERT_TRUE(result.ok()) << result.status().message(); + auto actual_batch = result.ValueOrDie(); + ASSERT_NE(actual_batch, nullptr) << "Stream is exhausted but expected more data."; + + auto struct_type = ::arrow::struct_(actual_batch->schema()->fields()); + auto expected_array = + ::arrow::json::ArrayFromJSONString(struct_type, expected_json).ValueOrDie(); + auto expected_batch = + ::arrow::RecordBatch::FromStructArray(expected_array).ValueOrDie(); + + ASSERT_TRUE(actual_batch->Equals(*expected_batch)) + << "Actual batch:\n" + << actual_batch->ToString() << "\nExpected batch:\n" + << expected_batch->ToString(); + + result = record_batch_reader->Next(); + ASSERT_TRUE(result.ok()) << result.status().message(); + ASSERT_EQ(result.ValueOrDie(), nullptr) << "Reader returned an extra batch."; + } + + void VerifyDataReaderBatchLengths(const DataFile& data_file, + const std::vector& expected_lengths, + ReaderProperties properties = {}) { + ReaderOptions options{ + .path = data_file.file_path, + .length = static_cast(data_file.file_size_in_bytes), + .io = file_io_, + .projection = table_schema_, + .properties = std::move(properties), + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, + ReaderFactoryRegistry::Open(data_file.file_format, options)); + + for (int64_t expected_length : expected_lengths) { + ICEBERG_UNWRAP_OR_FAIL(auto maybe_batch, reader->Next()); + ASSERT_TRUE(maybe_batch.has_value()) << "Reader is exhausted too early."; + + ArrowArray batch = std::move(maybe_batch.value()); + internal::ArrowArrayGuard batch_guard(&batch); + ASSERT_EQ(batch.length, expected_length); + } + + ICEBERG_UNWRAP_OR_FAIL(auto maybe_batch, reader->Next()); + ASSERT_FALSE(maybe_batch.has_value()) << "Reader returned an extra batch."; + ASSERT_THAT(reader->Close(), IsOk()); + } + + std::shared_ptr file_io_; + std::shared_ptr partition_spec_; + std::shared_ptr table_schema_; + std::shared_ptr projected_schema_; +}; + +TEST_F(FileScanTaskReaderTest, OpenWithoutDeletesReadsProjectedSchema) { + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(table_schema_, + R"([[1, "Foo", "blue"], [2, "Bar", "red"], [3, "Baz", "green"]])")); + FileScanTask task(data_file); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = table_schema_, + .schemas = {table_schema_}, + .projected_schema = projected_schema_, + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE( + VerifyStream(&stream, R"([[1, "Foo"], [2, "Bar"], [3, "Baz"]])")); +} + +TEST_F(FileScanTaskReaderTest, OpenWithPositionDeletesFiltersRowsAndPrunesPos) { + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(table_schema_, + R"([[1, "Foo", "blue"], [2, "Bar", "red"], [3, "Baz", "green"]])")); + ICEBERG_UNWRAP_OR_FAIL( + auto pos_delete, MakePositionDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), + {1}, data_file->file_path)); + FileScanTask task(data_file, {pos_delete}); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = table_schema_, + .schemas = {table_schema_}, + .projected_schema = projected_schema_, + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE(VerifyStream(&stream, R"([[1, "Foo"], [3, "Baz"]])")); +} + +TEST_F(FileScanTaskReaderTest, OpenWithEqualityDeletesAddsAndPrunesDeleteOnlyColumns) { + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(table_schema_, + R"([[1, "Foo", "blue"], [2, "Bar", "red"], [3, "Baz", "green"]])")); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_delete, + MakeEqualityDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), table_schema_, + R"([[0, "unused", "red"]])", {3})); + FileScanTask task(data_file, {eq_delete}); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = table_schema_, + .schemas = {table_schema_}, + .projected_schema = projected_schema_, + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE(VerifyStream(&stream, R"([[1, "Foo"], [3, "Baz"]])")); +} + +TEST_F(FileScanTaskReaderTest, OpenWithEqualityDeletesKeepsInputBatchWhenAllRowsAlive) { + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(table_schema_, + R"([[1, "Foo", "blue"], [2, "Bar", "red"], [3, "Baz", "green"]])")); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_delete, + MakeEqualityDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), table_schema_, + R"([[99, "unused", "unused"]])", {1})); + FileScanTask task(data_file, {eq_delete}); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = table_schema_, + .schemas = {table_schema_}, + .projected_schema = projected_schema_, + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE( + VerifyStream(&stream, R"([[1, "Foo"], [2, "Bar"], [3, "Baz"]])")); +} + +TEST_F(FileScanTaskReaderTest, OpenWithSchemasResolvesDroppedEqualityField) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}, + /*schema_id=*/2); + auto old_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(4, "dropped_value", string())}, + /*schema_id=*/1); + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(old_schema, + R"([[1, "Foo", "keep"], [2, "Bar", "gone"], [3, "Baz", "keep"]])")); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_delete, + MakeEqualityDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), old_schema, + R"([[0, "unused", "gone"]])", {4})); + FileScanTask task(data_file, {eq_delete}); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = current_schema, + .schemas = {current_schema, old_schema}, + .projected_schema = current_schema, + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE(VerifyStream(&stream, R"([[1, "Foo"], [3, "Baz"]])")); +} + +TEST_F(FileScanTaskReaderTest, OpenWithMixedDeletesSkipsFullyDeletedBatches) { + ICEBERG_UNWRAP_OR_FAIL( + auto data_file, + MakeDataFile(table_schema_, + std::vector{R"([[1, "Foo", "blue"], [2, "Bar", "red"]])", + R"([[3, "Baz", "green"]])"}, + /*record_count=*/3, /*max_row_group_length=*/2)); + // Parquet can coalesce row groups when the reader batch size is larger. + ReaderProperties properties; + properties.Set(ReaderProperties::kBatchSize, int64_t{2}); + ASSERT_NO_FATAL_FAILURE(VerifyDataReaderBatchLengths(*data_file, {2, 1}, properties)); + ICEBERG_UNWRAP_OR_FAIL( + auto pos_delete, MakePositionDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), + {0, 1}, data_file->file_path)); + ICEBERG_UNWRAP_OR_FAIL( + auto eq_delete, + MakeEqualityDeleteFile(CreateNewTempFilePathWithSuffix(".parquet"), table_schema_, + R"([[0, "unused", "yellow"]])", {3})); + FileScanTask task(data_file, {pos_delete, eq_delete}); + + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = table_schema_, + .schemas = {table_schema_}, + .projected_schema = projected_schema_, + .properties = properties.configs(), + }; + ICEBERG_UNWRAP_OR_FAIL(auto reader, FileScanTaskReader::Make(std::move(options))); + auto stream_result = reader->Open(task); + ASSERT_THAT(stream_result, IsOk()); + auto stream = std::move(stream_result.value()); + + ASSERT_NO_FATAL_FAILURE(VerifyStream(&stream, R"([[3, "Baz"]])")); +} + +} // namespace iceberg diff --git a/src/iceberg/test/file_scan_task_test.cc b/src/iceberg/test/file_scan_task_test.cc index 55bc6a110..cb945ba1f 100644 --- a/src/iceberg/test/file_scan_task_test.cc +++ b/src/iceberg/test/file_scan_task_test.cc @@ -28,6 +28,7 @@ #include #include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/data/file_scan_task_reader.h" #include "iceberg/file_format.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/parquet/parquet_register.h" @@ -109,6 +110,20 @@ class FileScanTaskTest : public TempFileTestBase { return data_file; } + Result OpenTask(const FileScanTask& task, + std::shared_ptr projected_schema) { + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string())}); + FileScanTaskReader::Options options{ + .io = file_io_, + .table_schema = current_schema, + .projected_schema = std::move(projected_schema), + }; + ICEBERG_ASSIGN_OR_RAISE(auto reader, FileScanTaskReader::Make(std::move(options))); + return reader->Open(task); + } + // Helper method to verify the content of the next batch from an ArrowArrayStream. void VerifyStreamNextBatch(struct ArrowArrayStream* stream, std::string_view expected_json) { @@ -154,9 +169,7 @@ TEST_F(FileScanTaskTest, ReadFullSchema) { FileScanTask task(data_file); - auto stream_result = task.ToArrow(file_io_, projected_schema); - ASSERT_THAT(stream_result, IsOk()); - auto stream = std::move(stream_result.value()); + ICEBERG_UNWRAP_OR_FAIL(auto stream, OpenTask(task, projected_schema)); ASSERT_NO_FATAL_FAILURE( VerifyStreamNextBatch(&stream, R"([[1, "Foo"], [2, "Bar"], [3, "Baz"]])")); @@ -171,9 +184,7 @@ TEST_F(FileScanTaskTest, ReadProjectedAndReorderedSchema) { FileScanTask task(data_file); - auto stream_result = task.ToArrow(file_io_, projected_schema); - ASSERT_THAT(stream_result, IsOk()); - auto stream = std::move(stream_result.value()); + ICEBERG_UNWRAP_OR_FAIL(auto stream, OpenTask(task, projected_schema)); ASSERT_NO_FATAL_FAILURE( VerifyStreamNextBatch(&stream, R"([["Foo", null], ["Bar", null], ["Baz", null]])")); @@ -188,9 +199,7 @@ TEST_F(FileScanTaskTest, ReadEmptyFile) { FileScanTask task(data_file); - auto stream_result = task.ToArrow(file_io_, projected_schema); - ASSERT_THAT(stream_result, IsOk()); - auto stream = std::move(stream_result.value()); + ICEBERG_UNWRAP_OR_FAIL(auto stream, OpenTask(task, projected_schema)); // The stream should be immediately exhausted ASSERT_NO_FATAL_FAILURE(VerifyStreamExhausted(&stream)); From 35dde9a66e0c50f1ac19ae7e9ab4cf09d574e3f0 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sat, 23 May 2026 11:16:03 +0800 Subject: [PATCH 036/151] feat: Add v3 timestamp nanosecond primitive types (#653) --- src/iceberg/avro/avro_data_util.cc | 13 + src/iceberg/avro/avro_direct_decoder.cc | 14 + src/iceberg/avro/avro_schema_util.cc | 32 +++ src/iceberg/avro/avro_schema_util_internal.h | 2 + src/iceberg/expression/json_serde.cc | 25 ++ src/iceberg/expression/literal.cc | 108 ++++++-- src/iceberg/expression/literal.h | 4 + src/iceberg/expression/predicate.cc | 6 +- src/iceberg/json_serde.cc | 8 + src/iceberg/manifest/manifest_adapter.cc | 2 + src/iceberg/parquet/parquet_schema_util.cc | 20 ++ src/iceberg/row/partition_values.cc | 2 + src/iceberg/row/struct_like.cc | 6 + src/iceberg/schema_internal.cc | 19 +- src/iceberg/table_metadata.h | 5 +- src/iceberg/test/arrow_test.cc | 15 +- src/iceberg/test/avro_data_test.cc | 48 ++++ src/iceberg/test/avro_schema_test.cc | 44 ++++ src/iceberg/test/bucket_util_test.cc | 74 ++++++ src/iceberg/test/literal_test.cc | 86 +++++- src/iceberg/test/schema_json_test.cc | 2 + src/iceberg/test/schema_test.cc | 27 ++ src/iceberg/test/transform_util_test.cc | 86 ++++++ src/iceberg/test/type_test.cc | 16 +- src/iceberg/test/visit_type_test.cc | 16 +- src/iceberg/transform.cc | 13 + src/iceberg/transform_function.cc | 10 + src/iceberg/type.cc | 22 ++ src/iceberg/type.h | 42 +++ src/iceberg/type_fwd.h | 5 + src/iceberg/util/bucket_util.cc | 15 ++ src/iceberg/util/conversions.cc | 6 +- src/iceberg/util/projection_util_internal.h | 8 + src/iceberg/util/struct_like_set.cc | 2 + src/iceberg/util/temporal_util.cc | 96 +++++++ src/iceberg/util/temporal_util.h | 8 + src/iceberg/util/transform_util.cc | 261 ++++++++++++++----- src/iceberg/util/transform_util.h | 58 +++++ src/iceberg/util/visitor_generate.h | 2 + 39 files changed, 1140 insertions(+), 88 deletions(-) diff --git a/src/iceberg/avro/avro_data_util.cc b/src/iceberg/avro/avro_data_util.cc index 5ac565f61..17bbb394b 100644 --- a/src/iceberg/avro/avro_data_util.cc +++ b/src/iceberg/avro/avro_data_util.cc @@ -431,6 +431,19 @@ Status AppendPrimitiveValueToBuilder(const ::avro::NodePtr& avro_node, return {}; } + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: { + if (avro_node->type() != ::avro::AVRO_LONG || + avro_node->logicalType().type() != ::avro::LogicalType::TIMESTAMP_NANOS) { + return InvalidArgument( + "Expected Avro long with TIMESTAMP_NANOS for timestamp field, got: {}", + ToString(avro_node)); + } + auto* builder = internal::checked_cast<::arrow::TimestampBuilder*>(array_builder); + ICEBERG_ARROW_RETURN_NOT_OK(builder->Append(avro_datum.value())); + return {}; + } + default: return InvalidArgument("Unsupported primitive type {} to append avro node {}", projected_field.type()->ToString(), ToString(avro_node)); diff --git a/src/iceberg/avro/avro_direct_decoder.cc b/src/iceberg/avro/avro_direct_decoder.cc index 335b6064e..cb4e869cc 100644 --- a/src/iceberg/avro/avro_direct_decoder.cc +++ b/src/iceberg/avro/avro_direct_decoder.cc @@ -562,6 +562,20 @@ Status DecodePrimitiveValueToBuilder(const ::avro::NodePtr& avro_node, return {}; } + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: { + if (avro_node->type() != ::avro::AVRO_LONG || + avro_node->logicalType().type() != ::avro::LogicalType::TIMESTAMP_NANOS) { + return InvalidArgument( + "Expected Avro long with TIMESTAMP_NANOS for timestamp field, got: {}", + ToString(avro_node)); + } + auto* builder = internal::checked_cast<::arrow::TimestampBuilder*>(array_builder); + int64_t value = decoder.decodeLong(); + ICEBERG_ARROW_RETURN_NOT_OK(builder->Append(value)); + return {}; + } + default: return InvalidArgument("Unsupported primitive type {} to decode from avro node {}", projected_field.type()->ToString(), ToString(avro_node)); diff --git a/src/iceberg/avro/avro_schema_util.cc b/src/iceberg/avro/avro_schema_util.cc index 75db6d8d9..3d61d283f 100644 --- a/src/iceberg/avro/avro_schema_util.cc +++ b/src/iceberg/avro/avro_schema_util.cc @@ -194,6 +194,24 @@ Status ToAvroNodeVisitor::Visit(const TimestampTzType& type, ::avro::NodePtr* no return {}; } +Status ToAvroNodeVisitor::Visit(const TimestampNsType& type, ::avro::NodePtr* node) { + *node = std::make_shared<::avro::NodePrimitive>(::avro::AVRO_LONG); + (*node)->setLogicalType(::avro::LogicalType{::avro::LogicalType::TIMESTAMP_NANOS}); + ::avro::CustomAttributes attributes; + attributes.addAttribute(std::string(kAdjustToUtcProp), "false", /*addQuotes=*/false); + (*node)->addCustomAttributesForField(attributes); + return {}; +} + +Status ToAvroNodeVisitor::Visit(const TimestampTzNsType& type, ::avro::NodePtr* node) { + *node = std::make_shared<::avro::NodePrimitive>(::avro::AVRO_LONG); + (*node)->setLogicalType(::avro::LogicalType{::avro::LogicalType::TIMESTAMP_NANOS}); + ::avro::CustomAttributes attributes; + attributes.addAttribute(std::string(kAdjustToUtcProp), "true", /*addQuotes=*/false); + (*node)->addCustomAttributesForField(attributes); + return {}; +} + Status ToAvroNodeVisitor::Visit(const StringType& type, ::avro::NodePtr* node) { *node = std::make_shared<::avro::NodePrimitive>(::avro::AVRO_STRING); return {}; @@ -548,6 +566,20 @@ Status ValidateAvroSchemaEvolution(const Type& expected_type, return {}; } break; + case TypeId::kTimestampNs: + if (avro_node->type() == ::avro::AVRO_LONG && + HasLogicalType(avro_node, ::avro::LogicalType::TIMESTAMP_NANOS) && + GetAdjustToUtc(avro_node).value_or("false") == "false") { + return {}; + } + break; + case TypeId::kTimestampTzNs: + if (avro_node->type() == ::avro::AVRO_LONG && + HasLogicalType(avro_node, ::avro::LogicalType::TIMESTAMP_NANOS) && + GetAdjustToUtc(avro_node).value_or("false") == "true") { + return {}; + } + break; case TypeId::kString: if (avro_node->type() == ::avro::AVRO_STRING) { return {}; diff --git a/src/iceberg/avro/avro_schema_util_internal.h b/src/iceberg/avro/avro_schema_util_internal.h index bdfbf135a..e3b7a7ffd 100644 --- a/src/iceberg/avro/avro_schema_util_internal.h +++ b/src/iceberg/avro/avro_schema_util_internal.h @@ -52,6 +52,8 @@ class ToAvroNodeVisitor { Status Visit(const TimeType& type, ::avro::NodePtr* node); Status Visit(const TimestampType& type, ::avro::NodePtr* node); Status Visit(const TimestampTzType& type, ::avro::NodePtr* node); + Status Visit(const TimestampNsType& type, ::avro::NodePtr* node); + Status Visit(const TimestampTzNsType& type, ::avro::NodePtr* node); Status Visit(const StringType& type, ::avro::NodePtr* node); Status Visit(const UuidType& type, ::avro::NodePtr* node); Status Visit(const FixedType& type, ::avro::NodePtr* node); diff --git a/src/iceberg/expression/json_serde.cc b/src/iceberg/expression/json_serde.cc index 38e7a8e2f..065f41cf2 100644 --- a/src/iceberg/expression/json_serde.cc +++ b/src/iceberg/expression/json_serde.cc @@ -272,6 +272,11 @@ Result ToJson(const Literal& literal) { case TypeId::kTimestampTz: return nlohmann::json( TransformUtil::HumanTimestampWithZone(std::get(value))); + case TypeId::kTimestampNs: + return nlohmann::json(TransformUtil::HumanTimestampNs(std::get(value))); + case TypeId::kTimestampTzNs: + return nlohmann::json( + TransformUtil::HumanTimestampNsWithZone(std::get(value))); case TypeId::kFloat: return nlohmann::json(std::get(value)); case TypeId::kDouble: @@ -390,6 +395,26 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { return Literal::TimestampTz(micros); } + case TypeId::kTimestampNs: { + if (!json.is_string()) [[unlikely]] { + return JsonParseError("Cannot parse {} as a timestamp_ns value", + SafeDumpJson(json)); + } + ICEBERG_ASSIGN_OR_RAISE(auto nanos, + TransformUtil::ParseTimestampNs(json.get())); + return Literal::TimestampNs(nanos); + } + + case TypeId::kTimestampTzNs: { + if (!json.is_string()) [[unlikely]] { + return JsonParseError("Cannot parse {} as a timestamptz_ns value", + SafeDumpJson(json)); + } + ICEBERG_ASSIGN_OR_RAISE( + auto nanos, TransformUtil::ParseTimestampNsWithZone(json.get())); + return Literal::TimestampTzNs(nanos); + } + case TypeId::kUuid: { if (!json.is_string()) [[unlikely]] { return JsonParseError("Cannot parse {} as a uuid value", SafeDumpJson(json)); diff --git a/src/iceberg/expression/literal.cc b/src/iceberg/expression/literal.cc index 9b8060a19..e14d3def2 100644 --- a/src/iceberg/expression/literal.cc +++ b/src/iceberg/expression/literal.cc @@ -150,6 +150,10 @@ Result LiteralCaster::CastFromLong( return Literal::Timestamp(long_val); case TypeId::kTimestampTz: return Literal::TimestampTz(long_val); + case TypeId::kTimestampNs: + return Literal::TimestampNs(long_val); + case TypeId::kTimestampTzNs: + return Literal::TimestampTzNs(long_val); default: return NotSupported("Cast from Long to {} is not supported", target_type->ToString()); @@ -215,6 +219,15 @@ Result LiteralCaster::CastFromString( TransformUtil::ParseTimestampWithZone(str_val)); return Literal::TimestampTz(micros); } + case TypeId::kTimestampNs: { + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TransformUtil::ParseTimestampNs(str_val)); + return Literal::TimestampNs(nanos); + } + case TypeId::kTimestampTzNs: { + ICEBERG_ASSIGN_OR_RAISE(auto nanos, + TransformUtil::ParseTimestampNsWithZone(str_val)); + return Literal::TimestampTzNs(nanos); + } case TypeId::kBinary: { ICEBERG_ASSIGN_OR_RAISE(auto bytes, StringUtils::HexStringToBytes(str_val)); return Literal::Binary(std::move(bytes)); @@ -250,14 +263,37 @@ Result LiteralCaster::CastFromString( Result LiteralCaster::CastFromTimestamp( const Literal& literal, const std::shared_ptr& target_type) { auto timestamp_val = std::get(literal.value_); + const auto& source_timestamp = + internal::checked_cast(*literal.type()); + const bool source_is_nanos = source_timestamp.time_unit() == TimeUnit::kNanosecond; switch (target_type->type_id()) { case TypeId::kDate: { ICEBERG_ASSIGN_OR_RAISE(auto days, TemporalUtils::ExtractDay(literal)); return Literal::Date(std::get(days.value())); } + case TypeId::kTimestamp: + return source_is_nanos + ? Literal::Timestamp(TemporalUtils::NanosToMicros(timestamp_val)) + : Literal::Timestamp(timestamp_val); case TypeId::kTimestampTz: - return Literal::TimestampTz(timestamp_val); + return source_is_nanos + ? Literal::TimestampTz(TemporalUtils::NanosToMicros(timestamp_val)) + : Literal::TimestampTz(timestamp_val); + case TypeId::kTimestampNs: { + if (source_is_nanos) { + return Literal::TimestampNs(timestamp_val); + } + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TemporalUtils::MicrosToNanos(timestamp_val)); + return Literal::TimestampNs(nanos); + } + case TypeId::kTimestampTzNs: { + if (source_is_nanos) { + return Literal::TimestampTzNs(timestamp_val); + } + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TemporalUtils::MicrosToNanos(timestamp_val)); + return Literal::TimestampTzNs(nanos); + } default: return NotSupported("Cast from Timestamp to {} is not supported", target_type->ToString()); @@ -266,15 +302,38 @@ Result LiteralCaster::CastFromTimestamp( Result LiteralCaster::CastFromTimestampTz( const Literal& literal, const std::shared_ptr& target_type) { - auto micros = std::get(literal.value_); + auto timestamp_val = std::get(literal.value_); + const auto& source_timestamp = + internal::checked_cast(*literal.type()); + const bool source_is_nanos = source_timestamp.time_unit() == TimeUnit::kNanosecond; switch (target_type->type_id()) { case TypeId::kDate: { ICEBERG_ASSIGN_OR_RAISE(auto days, TemporalUtils::ExtractDay(literal)); return Literal::Date(std::get(days.value())); } + case TypeId::kTimestampTz: + return source_is_nanos + ? Literal::TimestampTz(TemporalUtils::NanosToMicros(timestamp_val)) + : Literal::TimestampTz(timestamp_val); case TypeId::kTimestamp: - return Literal::Timestamp(micros); + return source_is_nanos + ? Literal::Timestamp(TemporalUtils::NanosToMicros(timestamp_val)) + : Literal::Timestamp(timestamp_val); + case TypeId::kTimestampNs: { + if (source_is_nanos) { + return Literal::TimestampNs(timestamp_val); + } + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TemporalUtils::MicrosToNanos(timestamp_val)); + return Literal::TimestampNs(nanos); + } + case TypeId::kTimestampTzNs: { + if (source_is_nanos) { + return Literal::TimestampTzNs(timestamp_val); + } + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TemporalUtils::MicrosToNanos(timestamp_val)); + return Literal::TimestampTzNs(nanos); + } default: return NotSupported("Cast from TimestampTz to {} is not supported", target_type->ToString()); @@ -329,6 +388,10 @@ Literal Literal::Timestamp(int64_t value) { return {Value{value}, timestamp()}; Literal Literal::TimestampTz(int64_t value) { return {Value{value}, timestamp_tz()}; } +Literal Literal::TimestampNs(int64_t value) { return {Value{value}, timestamp_ns()}; } + +Literal Literal::TimestampTzNs(int64_t value) { return {Value{value}, timestamptz_ns()}; } + Literal Literal::Float(float value) { return {Value{value}, float32()}; } Literal Literal::Double(double value) { return {Value{value}, float64()}; } @@ -388,18 +451,19 @@ std::strong_ordering CompareFloat(T lhs, T rhs) { namespace { bool Comparable(TypeId lhs, TypeId rhs) { - switch (lhs) { - case TypeId::kInt: - case TypeId::kDate: - return rhs == TypeId::kInt || rhs == TypeId::kDate; - case TypeId::kLong: - case TypeId::kTimestamp: - case TypeId::kTimestampTz: - return rhs == TypeId::kLong || rhs == TypeId::kTimestamp || - rhs == TypeId::kTimestampTz; - default: - return lhs == rhs; + if (lhs == rhs) { + return true; + } + if ((lhs == TypeId::kInt || lhs == TypeId::kDate) && + (rhs == TypeId::kInt || rhs == TypeId::kDate)) { + return true; } + if ((lhs == TypeId::kTimestamp || lhs == TypeId::kTimestampTz) && + (rhs == TypeId::kTimestamp || rhs == TypeId::kTimestampTz)) { + return true; + } + return (lhs == TypeId::kTimestampNs || lhs == TypeId::kTimestampTzNs) && + (rhs == TypeId::kTimestampNs || rhs == TypeId::kTimestampTzNs); } } // namespace @@ -408,8 +472,8 @@ bool Literal::operator==(const Literal& other) const { return (*this <=> other) // Three-way comparison operator std::partial_ordering Literal::operator<=>(const Literal& other) const { - // If types are different, comparison is unordered - // (Int & Date) (Timestamp & Long) were excluded from this check to allow comparison + // Allow date/int comparisons for transformed date bounds. Otherwise, comparisons + // are limited to identical logical values. if (!Comparable(type_->type_id(), other.type_->type_id())) { return std::partial_ordering::unordered; } @@ -439,7 +503,9 @@ std::partial_ordering Literal::operator<=>(const Literal& other) const { case TypeId::kLong: case TypeId::kTime: case TypeId::kTimestamp: - case TypeId::kTimestampTz: { + case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: { auto this_val = std::get(value_); auto other_val = std::get(other.value_); return this_val <=> other_val; @@ -548,7 +614,9 @@ std::string Literal::ToString() const { } case TypeId::kTime: case TypeId::kTimestamp: - case TypeId::kTimestampTz: { + case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: { return std::to_string(std::get(value_)); } case TypeId::kDate: { @@ -613,6 +681,10 @@ Result LiteralCaster::CastTo(const Literal& literal, return CastFromTimestamp(literal, target_type); case TypeId::kTimestampTz: return CastFromTimestampTz(literal, target_type); + case TypeId::kTimestampNs: + return CastFromTimestamp(literal, target_type); + case TypeId::kTimestampTzNs: + return CastFromTimestampTz(literal, target_type); default: break; } diff --git a/src/iceberg/expression/literal.h b/src/iceberg/expression/literal.h index b07aaa5e0..dbcabb521 100644 --- a/src/iceberg/expression/literal.h +++ b/src/iceberg/expression/literal.h @@ -73,6 +73,8 @@ class ICEBERG_EXPORT Literal : public util::Formattable { static Literal Time(int64_t value); static Literal Timestamp(int64_t value); static Literal TimestampTz(int64_t value); + static Literal TimestampNs(int64_t value); + static Literal TimestampTzNs(int64_t value); static Literal Float(float value); static Literal Double(double value); static Literal String(std::string value); @@ -199,6 +201,8 @@ DEFINE_LITERAL_TRAIT(kLong, int64_t) DEFINE_LITERAL_TRAIT(kTime, int64_t) DEFINE_LITERAL_TRAIT(kTimestamp, int64_t) DEFINE_LITERAL_TRAIT(kTimestampTz, int64_t) +DEFINE_LITERAL_TRAIT(kTimestampNs, int64_t) +DEFINE_LITERAL_TRAIT(kTimestampTzNs, int64_t) DEFINE_LITERAL_TRAIT(kFloat, float) DEFINE_LITERAL_TRAIT(kDouble, double) DEFINE_LITERAL_TRAIT(kDecimal, Decimal) diff --git a/src/iceberg/expression/predicate.cc b/src/iceberg/expression/predicate.cc index 3c92c2fcb..307c3c609 100644 --- a/src/iceberg/expression/predicate.cc +++ b/src/iceberg/expression/predicate.cc @@ -494,10 +494,10 @@ bool BoundLiteralPredicate::Equals(const Expression& other) const { } } - // TODO(gangwu): add TypeId::kTimestampNano static const std::unordered_set kIntegralTypes = { - TypeId::kInt, TypeId::kLong, TypeId::kDate, - TypeId::kTime, TypeId::kTimestamp, TypeId::kTimestampTz}; + TypeId::kInt, TypeId::kLong, TypeId::kDate, + TypeId::kTime, TypeId::kTimestamp, TypeId::kTimestampTz, + TypeId::kTimestampNs, TypeId::kTimestampTzNs}; if (kIntegralTypes.contains(term_->type()->type_id()) && term_->Equals(*other_pred->term())) { diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index 2d8c22255..3944e510c 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -363,6 +363,10 @@ nlohmann::json ToJson(const Type& type) { return "timestamp"; case TypeId::kTimestampTz: return "timestamptz"; + case TypeId::kTimestampNs: + return "timestamp_ns"; + case TypeId::kTimestampTzNs: + return "timestamptz_ns"; case TypeId::kString: return "string"; case TypeId::kBinary: @@ -488,6 +492,10 @@ Result> TypeFromJson(const nlohmann::json& json) { return std::make_unique(); } else if (type_str == "timestamptz") { return std::make_unique(); + } else if (type_str == "timestamp_ns") { + return std::make_unique(); + } else if (type_str == "timestamptz_ns") { + return std::make_unique(); } else if (type_str == "string") { return std::make_unique(); } else if (type_str == "binary") { diff --git a/src/iceberg/manifest/manifest_adapter.cc b/src/iceberg/manifest/manifest_adapter.cc index cf0a0515b..b37d82702 100644 --- a/src/iceberg/manifest/manifest_adapter.cc +++ b/src/iceberg/manifest/manifest_adapter.cc @@ -222,6 +222,8 @@ Status ManifestEntryAdapter::AppendPartitionValues( case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: ICEBERG_RETURN_UNEXPECTED( AppendField(child_array, std::get(partition_value.value()))); break; diff --git a/src/iceberg/parquet/parquet_schema_util.cc b/src/iceberg/parquet/parquet_schema_util.cc index e9574a48c..849bbd1f8 100644 --- a/src/iceberg/parquet/parquet_schema_util.cc +++ b/src/iceberg/parquet/parquet_schema_util.cc @@ -125,6 +125,26 @@ Status ValidateParquetSchemaEvolution( } } break; + case TypeId::kTimestampNs: + if (arrow_type->id() == ::arrow::Type::TIMESTAMP) { + const auto& timestamp_type = + internal::checked_cast(*arrow_type); + if (timestamp_type.unit() == ::arrow::TimeUnit::NANO && + timestamp_type.timezone().empty()) { + return {}; + } + } + break; + case TypeId::kTimestampTzNs: + if (arrow_type->id() == ::arrow::Type::TIMESTAMP) { + const auto& timestamp_type = + internal::checked_cast(*arrow_type); + if (timestamp_type.unit() == ::arrow::TimeUnit::NANO && + !timestamp_type.timezone().empty()) { + return {}; + } + } + break; case TypeId::kString: if (arrow_type->id() == ::arrow::Type::STRING) { return {}; diff --git a/src/iceberg/row/partition_values.cc b/src/iceberg/row/partition_values.cc index 712c801ad..fcd4691d0 100644 --- a/src/iceberg/row/partition_values.cc +++ b/src/iceberg/row/partition_values.cc @@ -57,6 +57,8 @@ Result PartitionValues::GetField(size_t pos) const { case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: return Scalar{std::get(literal.value())}; case TypeId::kFloat: return Scalar{std::get(literal.value())}; diff --git a/src/iceberg/row/struct_like.cc b/src/iceberg/row/struct_like.cc index 5b814204d..355af84c5 100644 --- a/src/iceberg/row/struct_like.cc +++ b/src/iceberg/row/struct_like.cc @@ -45,6 +45,8 @@ Result LiteralToScalar(const Literal& literal) { case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: return Scalar{std::get(literal.value())}; case TypeId::kFloat: return Scalar{std::get(literal.value())}; @@ -152,6 +154,10 @@ Result StructLikeAccessor::GetLiteral(const StructLike& struct_like) co return Literal::Timestamp(std::get(scalar)); case TypeId::kTimestampTz: return Literal::TimestampTz(std::get(scalar)); + case TypeId::kTimestampNs: + return Literal::TimestampNs(std::get(scalar)); + case TypeId::kTimestampTzNs: + return Literal::TimestampTzNs(std::get(scalar)); case TypeId::kFixed: { const auto& fixed_data = std::get(scalar); return Literal::Fixed(std::vector(fixed_data.cbegin(), fixed_data.cend())); diff --git a/src/iceberg/schema_internal.cc b/src/iceberg/schema_internal.cc index dedb603e2..bdd5b859f 100644 --- a/src/iceberg/schema_internal.cc +++ b/src/iceberg/schema_internal.cc @@ -123,6 +123,15 @@ ArrowErrorCode ToArrowSchema(const Type& type, bool optional, std::string_view n NANOARROW_RETURN_NOT_OK(ArrowSchemaSetTypeDateTime( schema, NANOARROW_TYPE_TIMESTAMP, NANOARROW_TIME_UNIT_MICRO, "UTC")); } break; + case TypeId::kTimestampNs: { + NANOARROW_RETURN_NOT_OK(ArrowSchemaSetTypeDateTime(schema, NANOARROW_TYPE_TIMESTAMP, + NANOARROW_TIME_UNIT_NANO, + /*timezone=*/nullptr)); + } break; + case TypeId::kTimestampTzNs: { + NANOARROW_RETURN_NOT_OK(ArrowSchemaSetTypeDateTime( + schema, NANOARROW_TYPE_TIMESTAMP, NANOARROW_TIME_UNIT_NANO, "UTC")); + } break; case TypeId::kString: NANOARROW_RETURN_NOT_OK(ArrowSchemaSetType(schema, NANOARROW_TYPE_STRING)); break; @@ -270,10 +279,18 @@ Result> FromArrowSchema(const ArrowSchema& schema) { case NANOARROW_TYPE_TIMESTAMP: { bool with_timezone = schema_view.timezone != nullptr && std::strlen(schema_view.timezone) > 0; - if (schema_view.time_unit != NANOARROW_TIME_UNIT_MICRO) { + if (schema_view.time_unit != NANOARROW_TIME_UNIT_MICRO && + schema_view.time_unit != NANOARROW_TIME_UNIT_NANO) { return InvalidSchema("Unsupported time unit for Arrow timestamp type: {}", static_cast(schema_view.time_unit)); } + if (schema_view.time_unit == NANOARROW_TIME_UNIT_NANO) { + if (with_timezone) { + return iceberg::timestamptz_ns(); + } else { + return iceberg::timestamp_ns(); + } + } if (with_timezone) { return iceberg::timestamp_tz(); } else { diff --git a/src/iceberg/table_metadata.h b/src/iceberg/table_metadata.h index cfae0ce2c..2f0c7e181 100644 --- a/src/iceberg/table_metadata.h +++ b/src/iceberg/table_metadata.h @@ -77,7 +77,10 @@ struct ICEBERG_EXPORT TableMetadata { static constexpr int64_t kInitialSequenceNumber = 0; static constexpr int64_t kInitialRowId = 0; - static inline const std::unordered_map kMinFormatVersions = {}; + static inline const std::unordered_map kMinFormatVersions = { + {TypeId::kTimestampNs, 3}, + {TypeId::kTimestampTzNs, 3}, + }; /// An integer version number for the format int8_t format_version; diff --git a/src/iceberg/test/arrow_test.cc b/src/iceberg/test/arrow_test.cc index 12039280e..dcfdb6b56 100644 --- a/src/iceberg/test/arrow_test.cc +++ b/src/iceberg/test/arrow_test.cc @@ -92,8 +92,14 @@ INSTANTIATE_TEST_SUITE_P( .arrow_type = ::arrow::time64(arrow::TimeUnit::MICRO)}, ToArrowSchemaParam{.iceberg_type = iceberg::timestamp(), .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO)}, - ToArrowSchemaParam{.iceberg_type = iceberg::timestamp(), - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO)}, + ToArrowSchemaParam{ + .iceberg_type = iceberg::timestamp_tz(), + .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO, "UTC")}, + ToArrowSchemaParam{.iceberg_type = iceberg::timestamp_ns(), + .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO)}, + ToArrowSchemaParam{ + .iceberg_type = iceberg::timestamptz_ns(), + .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO, "UTC")}, ToArrowSchemaParam{.iceberg_type = iceberg::string(), .arrow_type = ::arrow::utf8()}, ToArrowSchemaParam{.iceberg_type = iceberg::binary(), @@ -289,6 +295,11 @@ INSTANTIATE_TEST_SUITE_P( FromArrowSchemaParam{ .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO, "UTC"), .iceberg_type = std::make_shared()}, + FromArrowSchemaParam{.arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO), + .iceberg_type = iceberg::timestamp_ns()}, + FromArrowSchemaParam{ + .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO, "UTC"), + .iceberg_type = iceberg::timestamptz_ns()}, FromArrowSchemaParam{.arrow_type = ::arrow::utf8(), .iceberg_type = iceberg::string()}, FromArrowSchemaParam{.arrow_type = ::arrow::binary(), diff --git a/src/iceberg/test/avro_data_test.cc b/src/iceberg/test/avro_data_test.cc index c0e42f67b..2979ad9bd 100644 --- a/src/iceberg/test/avro_data_test.cc +++ b/src/iceberg/test/avro_data_test.cc @@ -298,6 +298,30 @@ const std::vector kPrimitiveTestCases = { .expected_json = R"([{"a": 1672531200000000}, {"a": 1672531201000000}, {"a": 1672531202000000}])", }, + { + .name = "TimestampNs", + .projected_type = iceberg::timestamp_ns(), + .source_type = iceberg::timestamp_ns(), + .value_setter = + [](::avro::GenericDatum& datum, int i) { + datum.value<::avro::GenericRecord>().fieldAt(0).value() = + 1672531200000000000LL + i * 1000000000LL + i; + }, + .expected_json = + R"([{"a": 1672531200000000000}, {"a": 1672531201000000001}, {"a": 1672531202000000002}])", + }, + { + .name = "TimestampTzNs", + .projected_type = iceberg::timestamptz_ns(), + .source_type = iceberg::timestamptz_ns(), + .value_setter = + [](::avro::GenericDatum& datum, int i) { + datum.value<::avro::GenericRecord>().fieldAt(0).value() = + 1672531200000000000LL + i * 1000000000LL + i; + }, + .expected_json = + R"([{"a": 1672531200000000000}, {"a": 1672531201000000001}, {"a": 1672531202000000002}])", + }, { .name = "IntToLongPromotion", .projected_type = iceberg::int64(), @@ -948,6 +972,30 @@ const std::vector kExtractDatumTestCases = { 1672531200000000LL + i * 1000000LL); }, }, + { + .name = "TimestampNs", + .iceberg_type = timestamp_ns(), + .arrow_json = + R"([{"a": 1672531200000000000}, {"a": 1672531201000000001}, {"a": 1672531202000000002}])", + .value_verifier = + [](const ::avro::GenericDatum& datum, int i) { + const auto& record = datum.value<::avro::GenericRecord>(); + EXPECT_EQ(record.fieldAt(0).value(), + 1672531200000000000LL + i * 1000000000LL + i); + }, + }, + { + .name = "TimestampTzNs", + .iceberg_type = timestamptz_ns(), + .arrow_json = + R"([{"a": 1672531200000000000}, {"a": 1672531201000000001}, {"a": 1672531202000000002}])", + .value_verifier = + [](const ::avro::GenericDatum& datum, int i) { + const auto& record = datum.value<::avro::GenericRecord>(); + EXPECT_EQ(record.fieldAt(0).value(), + 1672531200000000000LL + i * 1000000000LL + i); + }, + }, }; INSTANTIATE_TEST_SUITE_P(AllPrimitiveTypes, ExtractDatumFromArrayTest, diff --git a/src/iceberg/test/avro_schema_test.cc b/src/iceberg/test/avro_schema_test.cc index 2c1ee8a96..dc2cb0a51 100644 --- a/src/iceberg/test/avro_schema_test.cc +++ b/src/iceberg/test/avro_schema_test.cc @@ -199,6 +199,26 @@ TEST(ToAvroNodeVisitorTest, TimestampTzType) { EXPECT_EQ(node->customAttributesAt(0).getAttribute("adjust-to-utc"), "true"); } +TEST(ToAvroNodeVisitorTest, TimestampNsType) { + ::avro::NodePtr node; + EXPECT_THAT(ToAvroNodeVisitor{}.Visit(TimestampNsType{}, &node), IsOk()); + EXPECT_EQ(node->type(), ::avro::AVRO_LONG); + EXPECT_EQ(node->logicalType().type(), ::avro::LogicalType::TIMESTAMP_NANOS); + + ASSERT_EQ(node->customAttributes(), 1); + EXPECT_EQ(node->customAttributesAt(0).getAttribute("adjust-to-utc"), "false"); +} + +TEST(ToAvroNodeVisitorTest, TimestampTzNsType) { + ::avro::NodePtr node; + EXPECT_THAT(ToAvroNodeVisitor{}.Visit(TimestampTzNsType{}, &node), IsOk()); + EXPECT_EQ(node->type(), ::avro::AVRO_LONG); + EXPECT_EQ(node->logicalType().type(), ::avro::LogicalType::TIMESTAMP_NANOS); + + ASSERT_EQ(node->customAttributes(), 1); + EXPECT_EQ(node->customAttributesAt(0).getAttribute("adjust-to-utc"), "true"); +} + TEST(ToAvroNodeVisitorTest, StringType) { ::avro::NodePtr node; EXPECT_THAT(ToAvroNodeVisitor{}.Visit(StringType{}, &node), IsOk()); @@ -1023,6 +1043,30 @@ TEST(AvroSchemaProjectionTest, ProjectMapType) { ASSERT_EQ(projection.fields[0].children.size(), 2); } +TEST(AvroSchemaProjectionTest, RejectTimestampNsFromMicrosType) { + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "ts", iceberg::timestamp_ns()), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "ts", "type": { + "type": "long", + "logicalType": "timestamp-micros", + "adjust-to-utc": false + }, "field-id": 1} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, HasErrorMessage("Cannot read")); +} + TEST(AvroSchemaProjectionTest, ProjectMapTypeWithNonStringKey) { ::iceberg::avro::RegisterLogicalTypes(); diff --git a/src/iceberg/test/bucket_util_test.cc b/src/iceberg/test/bucket_util_test.cc index 9c0d46f00..bee84a7cb 100644 --- a/src/iceberg/test/bucket_util_test.cc +++ b/src/iceberg/test/bucket_util_test.cc @@ -23,6 +23,7 @@ #include +#include "iceberg/expression/literal.h" #include "iceberg/test/temporal_test_helper.h" #include "iceberg/util/decimal.h" #include "iceberg/util/uuid.h" @@ -107,4 +108,77 @@ TEST(BucketUtilsTest, HashHelper) { EXPECT_EQ(BucketUtils::HashBytes(fixed), -188683207); } +TEST(BucketUtilsTest, BucketTimestampNanosMatchesMicros) { + constexpr int32_t kNumBuckets = 1000; + const auto ts_micros = TemporalTestHelper::CreateTimestamp({.year = 2017, + .month = 11, + .day = 16, + .hour = 22, + .minute = 31, + .second = 8, + .microsecond = 1}); + const auto ts_nanos = TemporalTestHelper::CreateTimestampNanos({.year = 2017, + .month = 11, + .day = 16, + .hour = 22, + .minute = 31, + .second = 8, + .nanosecond = 1000}); + + const auto micros_bucket = + BucketUtils::BucketIndex(Literal::Timestamp(ts_micros), kNumBuckets); + const auto nanos_bucket = + BucketUtils::BucketIndex(Literal::TimestampNs(ts_nanos), kNumBuckets); + + ASSERT_TRUE(micros_bucket.has_value()); + ASSERT_TRUE(nanos_bucket.has_value()); + EXPECT_EQ(micros_bucket.value(), nanos_bucket.value()); + + const auto ts_tz_micros = + TemporalTestHelper::CreateTimestampTz({.year = 2017, + .month = 11, + .day = 16, + .hour = 14, + .minute = 31, + .second = 8, + .microsecond = 1, + .tz_offset_minutes = -480}); + const auto ts_tz_nanos = + TemporalTestHelper::CreateTimestampTzNanos({.year = 2017, + .month = 11, + .day = 16, + .hour = 14, + .minute = 31, + .second = 8, + .nanosecond = 1000, + .tz_offset_minutes = -480}); + + const auto tz_micros_bucket = + BucketUtils::BucketIndex(Literal::TimestampTz(ts_tz_micros), kNumBuckets); + const auto tz_nanos_bucket = + BucketUtils::BucketIndex(Literal::TimestampTzNs(ts_tz_nanos), kNumBuckets); + + ASSERT_TRUE(tz_micros_bucket.has_value()); + ASSERT_TRUE(tz_nanos_bucket.has_value()); + EXPECT_EQ(tz_micros_bucket.value(), tz_nanos_bucket.value()); + + const auto pre_epoch_micros_bucket = + BucketUtils::BucketIndex(Literal::Timestamp(-876544), kNumBuckets); + const auto pre_epoch_nanos_bucket = + BucketUtils::BucketIndex(Literal::TimestampNs(-876543211), kNumBuckets); + + ASSERT_TRUE(pre_epoch_micros_bucket.has_value()); + ASSERT_TRUE(pre_epoch_nanos_bucket.has_value()); + EXPECT_EQ(pre_epoch_micros_bucket.value(), pre_epoch_nanos_bucket.value()); + + const auto pre_epoch_tz_micros_bucket = + BucketUtils::BucketIndex(Literal::TimestampTz(-876544), kNumBuckets); + const auto pre_epoch_tz_nanos_bucket = + BucketUtils::BucketIndex(Literal::TimestampTzNs(-876543211), kNumBuckets); + + ASSERT_TRUE(pre_epoch_tz_micros_bucket.has_value()); + ASSERT_TRUE(pre_epoch_tz_nanos_bucket.has_value()); + EXPECT_EQ(pre_epoch_tz_micros_bucket.value(), pre_epoch_tz_nanos_bucket.value()); +} + } // namespace iceberg diff --git a/src/iceberg/test/literal_test.cc b/src/iceberg/test/literal_test.cc index 97724aad9..86b892377 100644 --- a/src/iceberg/test/literal_test.cc +++ b/src/iceberg/test/literal_test.cc @@ -91,9 +91,21 @@ TEST_P(CastLiteralTest, CastTest) { TEST(LiteralTest, CrossTypeComparison) { auto int_literal = Literal::Int(42); auto string_literal = Literal::String("42"); + auto long_literal = Literal::Long(42); + auto timestamp_literal = Literal::Timestamp(42); + auto timestamp_tz_literal = Literal::TimestampTz(42); + auto timestamp_ns_literal = Literal::TimestampNs(42); + auto timestamp_tz_ns_literal = Literal::TimestampTzNs(42); // Different types should return unordered EXPECT_EQ(int_literal <=> string_literal, std::partial_ordering::unordered); + EXPECT_EQ(long_literal <=> timestamp_literal, std::partial_ordering::unordered); + EXPECT_EQ(timestamp_literal <=> timestamp_ns_literal, std::partial_ordering::unordered); + EXPECT_EQ(int_literal <=> Literal::Date(42), std::partial_ordering::equivalent); + EXPECT_EQ(timestamp_literal <=> timestamp_tz_literal, + std::partial_ordering::equivalent); + EXPECT_EQ(timestamp_ns_literal <=> timestamp_tz_ns_literal, + std::partial_ordering::equivalent); } // Overflow tests @@ -148,6 +160,18 @@ TEST(LiteralTest, CastToError) { // Cast to Fixed with different length should fail EXPECT_THAT(fixed_literal.CastTo(fixed(5)), IsError(ErrorKind::kNotSupported)); + + constexpr auto max_micros = std::numeric_limits::max() / 1000; + EXPECT_THAT(Literal::Timestamp(max_micros + 1).CastTo(timestamp_ns()), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(Literal::Timestamp(max_micros + 1).CastTo(timestamptz_ns()), + IsError(ErrorKind::kInvalidArgument)); + + constexpr auto min_micros = std::numeric_limits::min() / 1000; + EXPECT_THAT(Literal::TimestampTz(min_micros - 1).CastTo(timestamp_ns()), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(Literal::TimestampTz(min_micros - 1).CastTo(timestamptz_ns()), + IsError(ErrorKind::kInvalidArgument)); } // Special value tests @@ -580,7 +604,15 @@ INSTANTIATE_TEST_SUITE_P( BasicLiteralTestParam{.test_name = "TimestampTz", .literal = Literal::TimestampTz(1684137600000000LL), .expected_type_id = TypeId::kTimestampTz, - .expected_string = "1684137600000000"}), + .expected_string = "1684137600000000"}, + BasicLiteralTestParam{.test_name = "TimestampNs", + .literal = Literal::TimestampNs(1684137600000000001LL), + .expected_type_id = TypeId::kTimestampNs, + .expected_string = "1684137600000000001"}, + BasicLiteralTestParam{.test_name = "TimestampTzNs", + .literal = Literal::TimestampTzNs(1684137600000000001LL), + .expected_type_id = TypeId::kTimestampTzNs, + .expected_string = "1684137600000000001"}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); @@ -655,7 +687,15 @@ INSTANTIATE_TEST_SUITE_P( ComparisonLiteralTestParam{.test_name = "TimestampTz", .small_literal = Literal::TimestampTz(1000000LL), .large_literal = Literal::TimestampTz(2000000LL), - .equal_literal = Literal::TimestampTz(1000000LL)}), + .equal_literal = Literal::TimestampTz(1000000LL)}, + ComparisonLiteralTestParam{.test_name = "TimestampNs", + .small_literal = Literal::TimestampNs(1000000LL), + .large_literal = Literal::TimestampNs(2000000LL), + .equal_literal = Literal::TimestampNs(1000000LL)}, + ComparisonLiteralTestParam{.test_name = "TimestampTzNs", + .small_literal = Literal::TimestampTzNs(1000000LL), + .large_literal = Literal::TimestampTzNs(2000000LL), + .equal_literal = Literal::TimestampTzNs(1000000LL)}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); @@ -705,6 +745,14 @@ INSTANTIATE_TEST_SUITE_P( .source_literal = Literal::Long(42L), .target_type = timestamp_tz(), .expected_literal = Literal::TimestampTz(42L)}, + CastLiteralTestParam{.test_name = "LongToTimestampNs", + .source_literal = Literal::Long(42L), + .target_type = timestamp_ns(), + .expected_literal = Literal::TimestampNs(42L)}, + CastLiteralTestParam{.test_name = "LongToTimestampTzNs", + .source_literal = Literal::Long(42L), + .target_type = timestamptz_ns(), + .expected_literal = Literal::TimestampTzNs(42L)}, CastLiteralTestParam{ .test_name = "TimestampToDate", .source_literal = @@ -750,6 +798,30 @@ INSTANTIATE_TEST_SUITE_P( .second = 59})), .target_type = date(), .expected_literal = Literal::Date(-1)}, + CastLiteralTestParam{.test_name = "TimestampNsToTimestampBeforeEpoch", + .source_literal = Literal::TimestampNs(-876543211), + .target_type = timestamp(), + .expected_literal = Literal::Timestamp(-876544)}, + CastLiteralTestParam{.test_name = "TimestampNsToTimestampTzBeforeEpoch", + .source_literal = Literal::TimestampNs(-876543211), + .target_type = timestamp_tz(), + .expected_literal = Literal::TimestampTz(-876544)}, + CastLiteralTestParam{.test_name = "TimestampToTimestampNsBeforeEpoch", + .source_literal = Literal::Timestamp(-876544), + .target_type = timestamp_ns(), + .expected_literal = Literal::TimestampNs(-876544000)}, + CastLiteralTestParam{.test_name = "TimestampToTimestampTzNsBeforeEpoch", + .source_literal = Literal::Timestamp(-876544), + .target_type = timestamptz_ns(), + .expected_literal = Literal::TimestampTzNs(-876544000)}, + CastLiteralTestParam{.test_name = "TimestampTzNsToTimestampTzBeforeEpoch", + .source_literal = Literal::TimestampTzNs(-876543211), + .target_type = timestamp_tz(), + .expected_literal = Literal::TimestampTz(-876544)}, + CastLiteralTestParam{.test_name = "TimestampTzToTimestampTzNsBeforeEpoch", + .source_literal = Literal::TimestampTz(-876544), + .target_type = timestamptz_ns(), + .expected_literal = Literal::TimestampTzNs(-876544000)}, // Float cast tests CastLiteralTestParam{.test_name = "FloatToDouble", .source_literal = Literal::Float(2.0f), @@ -804,6 +876,16 @@ INSTANTIATE_TEST_SUITE_P( .source_literal = Literal::String("2026-01-01T00:00:01.500+00:00"), .target_type = timestamp_tz(), .expected_literal = Literal::TimestampTz(1767225601500000L)}, + CastLiteralTestParam{ + .test_name = "StringToTimestampNsBeforeEpoch", + .source_literal = Literal::String("1969-12-31T23:59:59.123456789"), + .target_type = timestamp_ns(), + .expected_literal = Literal::TimestampNs(-876543211)}, + CastLiteralTestParam{ + .test_name = "StringToTimestampTzNsBeforeEpoch", + .source_literal = Literal::String("1969-12-31T23:59:59.123456789+00:00"), + .target_type = timestamptz_ns(), + .expected_literal = Literal::TimestampTzNs(-876543211)}, CastLiteralTestParam{.test_name = "StringToBinary", .source_literal = Literal::String("010203FF"), .target_type = binary(), diff --git a/src/iceberg/test/schema_json_test.cc b/src/iceberg/test/schema_json_test.cc index 87388cbb4..c9532eeb6 100644 --- a/src/iceberg/test/schema_json_test.cc +++ b/src/iceberg/test/schema_json_test.cc @@ -71,6 +71,8 @@ INSTANTIATE_TEST_SUITE_P( SchemaJsonParam{.json = "\"timestamp\"", .type = iceberg::timestamp()}, SchemaJsonParam{.json = "\"timestamptz\"", .type = std::make_shared()}, + SchemaJsonParam{.json = "\"timestamp_ns\"", .type = iceberg::timestamp_ns()}, + SchemaJsonParam{.json = "\"timestamptz_ns\"", .type = iceberg::timestamptz_ns()}, SchemaJsonParam{ .json = R"({"element":"string","element-id":3,"element-required":true,"type":"list"})", diff --git a/src/iceberg/test/schema_test.cc b/src/iceberg/test/schema_test.cc index 9dab35fa7..838b57600 100644 --- a/src/iceberg/test/schema_test.cc +++ b/src/iceberg/test/schema_test.cc @@ -27,6 +27,7 @@ #include "iceberg/result.h" #include "iceberg/schema_field.h" +#include "iceberg/table_metadata.h" #include "iceberg/test/matchers.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep @@ -96,6 +97,32 @@ TEST(SchemaTest, Equality) { ASSERT_EQ(schema5, schema1); } +TEST(SchemaTest, ValidateRejectsV3TypesBeforeFormatV3) { + iceberg::Schema timestamp_ns_schema( + {iceberg::SchemaField(1, "timestamp_ns", iceberg::timestamp_ns(), false)}); + iceberg::Schema timestamptz_ns_schema( + {iceberg::SchemaField(1, "timestamptz_ns", iceberg::timestamptz_ns(), false)}); + + auto status = timestamp_ns_schema.Validate(2); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage( + "Invalid type for timestamp_ns: timestamp_ns is not " + "supported until v3")); + + status = timestamptz_ns_schema.Validate(2); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage( + "Invalid type for timestamptz_ns: timestamptz_ns is not " + "supported until v3")); + + EXPECT_THAT( + timestamp_ns_schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsOk()); + EXPECT_THAT(timestamptz_ns_schema.Validate( + iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsOk()); +} + TEST(SchemaTest, IdentifierFields) { using iceberg::ErrorKind; using iceberg::Schema; diff --git a/src/iceberg/test/transform_util_test.cc b/src/iceberg/test/transform_util_test.cc index 54f36cd07..5b64bb33c 100644 --- a/src/iceberg/test/transform_util_test.cc +++ b/src/iceberg/test/transform_util_test.cc @@ -19,6 +19,8 @@ #include "iceberg/util/transform_util.h" +#include + #include #include "iceberg/test/matchers.h" @@ -111,6 +113,8 @@ TEST(TransformUtilTest, HumanTimestamp) { // precision with 1 microsecond EXPECT_EQ("2026-01-01T00:00:01.000001", TransformUtil::HumanTimestamp(1767225601000001L)); + // pre-epoch timestamp with fractional microseconds + EXPECT_EQ("1969-12-31T23:59:59.123456", TransformUtil::HumanTimestamp(-876544)); } TEST(TransformUtilTest, HumanTimestampWithZone) { @@ -132,6 +136,88 @@ TEST(TransformUtilTest, HumanTimestampWithZone) { // precision with 1 microsecond EXPECT_EQ("2026-01-01T00:00:01.000001+00:00", TransformUtil::HumanTimestampWithZone(1767225601000001L)); + // pre-epoch timestamp with fractional microseconds + EXPECT_EQ("1969-12-31T23:59:59.123456+00:00", + TransformUtil::HumanTimestampWithZone(-876544)); +} + +TEST(TransformUtilTest, HumanTimestampNs) { + EXPECT_EQ("1970-01-01T00:00:00.000000001", TransformUtil::HumanTimestampNs(1)); + EXPECT_EQ("2026-01-01T00:00:01.000001001", + TransformUtil::HumanTimestampNs(1767225601000001001L)); + EXPECT_EQ("1969-12-31T23:59:59.123456789", TransformUtil::HumanTimestampNs(-876543211)); +} + +TEST(TransformUtilTest, HumanTimestampNsWithZone) { + EXPECT_EQ("1970-01-01T00:00:00.000000001+00:00", + TransformUtil::HumanTimestampNsWithZone(1)); + EXPECT_EQ("2026-01-01T00:00:01.000001001+00:00", + TransformUtil::HumanTimestampNsWithZone(1767225601000001001L)); + EXPECT_EQ("1969-12-31T23:59:59.123456789+00:00", + TransformUtil::HumanTimestampNsWithZone(-876543211)); +} + +TEST(TransformUtilTest, ParseTimestampNs) { + ICEBERG_UNWRAP_OR_FAIL( + auto nanos, TransformUtil::ParseTimestampNs("2026-01-01T00:00:01.000001001")); + EXPECT_EQ(nanos, 1767225601000001001L); + ICEBERG_UNWRAP_OR_FAIL(auto pre_epoch_nanos, TransformUtil::ParseTimestampNs( + "1969-12-31T23:59:59.123456789")); + EXPECT_EQ(pre_epoch_nanos, -876543211); + EXPECT_EQ(TransformUtil::HumanTimestampNs(pre_epoch_nanos), + "1969-12-31T23:59:59.123456789"); +} + +TEST(TransformUtilTest, ParseTimestampNsChecksInt64Bounds) { + ICEBERG_UNWRAP_OR_FAIL( + auto max_nanos, TransformUtil::ParseTimestampNs("2262-04-11T23:47:16.854775807")); + EXPECT_EQ(max_nanos, std::numeric_limits::max()); + + ICEBERG_UNWRAP_OR_FAIL( + auto min_nanos, TransformUtil::ParseTimestampNs("1677-09-21T00:12:43.145224192")); + EXPECT_EQ(min_nanos, std::numeric_limits::min()); + + EXPECT_THAT(TransformUtil::ParseTimestampNs("2262-04-11T23:47:16.854775808"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(TransformUtil::ParseTimestampNs("1677-09-21T00:12:43.145224191"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TransformUtilTest, ParseTimestampNsRejectsMoreThanNineFractionalDigits) { + EXPECT_THAT(TransformUtil::ParseTimestampNs("2026-01-01T00:00:01.0000010011"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TransformUtilTest, ParseTimestampNsWithZone) { + ICEBERG_UNWRAP_OR_FAIL(auto nanos, TransformUtil::ParseTimestampNsWithZone( + "2026-01-01T00:00:01.000001001+00:00")); + EXPECT_EQ(nanos, 1767225601000001001L); +} + +TEST(TransformUtilTest, ParseTimestampNsWithZoneChecksInt64BoundsAfterOffset) { + ICEBERG_UNWRAP_OR_FAIL(auto max_nanos, TransformUtil::ParseTimestampNsWithZone( + "2262-04-12T00:47:16.854775807+01:00")); + EXPECT_EQ(max_nanos, std::numeric_limits::max()); + + ICEBERG_UNWRAP_OR_FAIL(auto min_nanos, TransformUtil::ParseTimestampNsWithZone( + "1677-09-20T23:12:43.145224192-01:00")); + EXPECT_EQ(min_nanos, std::numeric_limits::min()); + + EXPECT_THAT( + TransformUtil::ParseTimestampNsWithZone("2262-04-11T23:47:16.854775807-00:01"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + TransformUtil::ParseTimestampNsWithZone("1677-09-21T00:12:43.145224192+00:01"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TransformUtilTest, ParseTimestampNsWithZoneRejectsOffsetPastPlusMinus1800) { + EXPECT_THAT( + TransformUtil::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001+18:01"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + TransformUtil::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001-18:30"), + IsError(ErrorKind::kInvalidArgument)); } TEST(TransformUtilTest, Base64Encode) { diff --git a/src/iceberg/test/type_test.cc b/src/iceberg/test/type_test.cc index 266ff6103..e68843be4 100644 --- a/src/iceberg/test/type_test.cc +++ b/src/iceberg/test/type_test.cc @@ -90,7 +90,7 @@ TEST_P(TypeTest, StdFormat) { ASSERT_EQ(test_case.repr, std::format("{}", *test_case.type)); } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -168,6 +168,20 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "timestamptz", }, + { + .name = "timestamp_ns", + .type = iceberg::timestamp_ns(), + .type_id = iceberg::TypeId::kTimestampNs, + .primitive = true, + .repr = "timestamp_ns", + }, + { + .name = "timestamptz_ns", + .type = iceberg::timestamptz_ns(), + .type_id = iceberg::TypeId::kTimestampTzNs, + .primitive = true, + .repr = "timestamptz_ns", + }, { .name = "binary", .type = iceberg::binary(), diff --git a/src/iceberg/test/visit_type_test.cc b/src/iceberg/test/visit_type_test.cc index 786e1fd2c..7104581f5 100644 --- a/src/iceberg/test/visit_type_test.cc +++ b/src/iceberg/test/visit_type_test.cc @@ -53,7 +53,7 @@ std::string TypeTestCaseToString(const ::testing::TestParamInfo& i return info.param.name; } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -131,6 +131,20 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "timestamptz", }, + { + .name = "timestamp_ns", + .type = iceberg::timestamp_ns(), + .type_id = iceberg::TypeId::kTimestampNs, + .primitive = true, + .repr = "timestamp_ns", + }, + { + .name = "timestamptz_ns", + .type = iceberg::timestamptz_ns(), + .type_id = iceberg::TypeId::kTimestampTzNs, + .primitive = true, + .repr = "timestamptz_ns", + }, { .name = "binary", .type = iceberg::binary(), diff --git a/src/iceberg/transform.cc b/src/iceberg/transform.cc index c210f9ed2..8a7d4b3e1 100644 --- a/src/iceberg/transform.cc +++ b/src/iceberg/transform.cc @@ -152,6 +152,8 @@ bool Transform::CanTransform(const Type& source_type) const { case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: case TypeId::kString: case TypeId::kUuid: case TypeId::kFixed: @@ -177,6 +179,8 @@ bool Transform::CanTransform(const Type& source_type) const { case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: return true; default: return false; @@ -186,6 +190,8 @@ bool Transform::CanTransform(const Type& source_type) const { case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: return true; default: return false; @@ -194,6 +200,8 @@ bool Transform::CanTransform(const Type& source_type) const { switch (source_type.type_id()) { case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: return true; default: return false; @@ -420,6 +428,11 @@ Result Transform::ToHumanString(const Literal& value) { return TransformUtil::HumanTimestamp(std::get(value.value())); case TypeId::kTimestampTz: return TransformUtil::HumanTimestampWithZone(std::get(value.value())); + case TypeId::kTimestampNs: + return TransformUtil::HumanTimestampNs(std::get(value.value())); + case TypeId::kTimestampTzNs: + return TransformUtil::HumanTimestampNsWithZone( + std::get(value.value())); case TypeId::kFixed: case TypeId::kBinary: { const auto& binary_data = std::get>(value.value()); diff --git a/src/iceberg/transform_function.cc b/src/iceberg/transform_function.cc index 9213d2ce3..d7c18555d 100644 --- a/src/iceberg/transform_function.cc +++ b/src/iceberg/transform_function.cc @@ -79,6 +79,8 @@ Result> BucketTransform::Make( case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: case TypeId::kString: case TypeId::kUuid: case TypeId::kFixed: @@ -148,6 +150,8 @@ Result> YearTransform::Make( case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for year transform", @@ -176,6 +180,8 @@ Result> MonthTransform::Make( case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for month transform", @@ -204,6 +210,8 @@ Result> DayTransform::Make( case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for day transform", @@ -231,6 +239,8 @@ Result> HourTransform::Make( switch (source_type->type_id()) { case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for hour transform", diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc index f008ad908..b5bee37e2 100644 --- a/src/iceberg/type.cc +++ b/src/iceberg/type.cc @@ -326,6 +326,22 @@ bool TimestampTzType::Equals(const Type& other) const { return other.type_id() == kTypeId; } +bool TimestampNsType::is_zoned() const { return false; } +TimeUnit TimestampNsType::time_unit() const { return TimeUnit::kNanosecond; } +TypeId TimestampNsType::type_id() const { return kTypeId; } +std::string TimestampNsType::ToString() const { return "timestamp_ns"; } +bool TimestampNsType::Equals(const Type& other) const { + return other.type_id() == kTypeId; +} + +bool TimestampTzNsType::is_zoned() const { return true; } +TimeUnit TimestampTzNsType::time_unit() const { return TimeUnit::kNanosecond; } +TypeId TimestampTzNsType::type_id() const { return kTypeId; } +std::string TimestampTzNsType::ToString() const { return "timestamptz_ns"; } +bool TimestampTzNsType::Equals(const Type& other) const { + return other.type_id() == kTypeId; +} + TypeId StringType::type_id() const { return kTypeId; } std::string StringType::ToString() const { return "string"; } bool StringType::Equals(const Type& other) const { return other.type_id() == kTypeId; } @@ -371,6 +387,8 @@ TYPE_FACTORY(date, DateType) TYPE_FACTORY(time, TimeType) TYPE_FACTORY(timestamp, TimestampType) TYPE_FACTORY(timestamp_tz, TimestampTzType) +TYPE_FACTORY(timestamp_ns, TimestampNsType) +TYPE_FACTORY(timestamptz_ns, TimestampTzNsType) TYPE_FACTORY(binary, BinaryType) TYPE_FACTORY(string, StringType) TYPE_FACTORY(uuid, UuidType) @@ -425,6 +443,10 @@ std::string_view ToString(TypeId id) { return "timestamp"; case TypeId::kTimestampTz: return "timestamptz"; + case TypeId::kTimestampNs: + return "timestamp_ns"; + case TypeId::kTimestampTzNs: + return "timestamptz_ns"; case TypeId::kString: return "string"; case TypeId::kUuid: diff --git a/src/iceberg/type.h b/src/iceberg/type.h index 1c50135dc..53237cdb5 100644 --- a/src/iceberg/type.h +++ b/src/iceberg/type.h @@ -396,6 +396,44 @@ class ICEBERG_EXPORT TimestampTzType : public TimestampBase { bool Equals(const Type& other) const override; }; +/// \brief A data type representing a timestamp in nanoseconds without +/// reference to a timezone. +class ICEBERG_EXPORT TimestampNsType : public TimestampBase { + public: + constexpr static const TypeId kTypeId = TypeId::kTimestampNs; + + TimestampNsType() = default; + ~TimestampNsType() override = default; + + bool is_zoned() const override; + TimeUnit time_unit() const override; + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; +}; + +/// \brief A data type representing a timestamp as nanoseconds since the +/// epoch in UTC. A time zone or offset is not stored. +class ICEBERG_EXPORT TimestampTzNsType : public TimestampBase { + public: + constexpr static const TypeId kTypeId = TypeId::kTimestampTzNs; + + TimestampTzNsType() = default; + ~TimestampTzNsType() override = default; + + bool is_zoned() const override; + TimeUnit time_unit() const override; + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; +}; + /// \brief A data type representing an arbitrary-length byte sequence. class ICEBERG_EXPORT BinaryType : public PrimitiveType { public: @@ -490,6 +528,10 @@ ICEBERG_EXPORT const std::shared_ptr& time(); ICEBERG_EXPORT const std::shared_ptr& timestamp(); /// \brief Return a TimestampTzType instance. ICEBERG_EXPORT const std::shared_ptr& timestamp_tz(); +/// \brief Return a TimestampNsType instance. +ICEBERG_EXPORT const std::shared_ptr& timestamp_ns(); +/// \brief Return a TimestampTzNsType instance. +ICEBERG_EXPORT const std::shared_ptr& timestamptz_ns(); /// \brief Return a BinaryType instance. ICEBERG_EXPORT const std::shared_ptr& binary(); /// \brief Return a StringType instance. diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 3fe199d8a..144a9e33a 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -46,6 +46,8 @@ enum class TypeId { kTime, kTimestamp, kTimestampTz, + kTimestampNs, + kTimestampTzNs, kString, kUuid, kFixed, @@ -55,6 +57,7 @@ enum class TypeId { /// \brief The time unit. In Iceberg V3 nanoseconds are also supported. enum class TimeUnit { kMicrosecond, + kNanosecond, }; /// \brief Data type family. @@ -77,6 +80,8 @@ class TimeType; class TimestampBase; class TimestampType; class TimestampTzType; +class TimestampNsType; +class TimestampTzNsType; class Type; class UuidType; diff --git a/src/iceberg/util/bucket_util.cc b/src/iceberg/util/bucket_util.cc index 88b240de7..2c0718f5d 100644 --- a/src/iceberg/util/bucket_util.cc +++ b/src/iceberg/util/bucket_util.cc @@ -24,6 +24,7 @@ #include "iceberg/expression/literal.h" #include "iceberg/util/endian.h" #include "iceberg/util/murmurhash3_internal.h" +#include "iceberg/util/temporal_util.h" namespace iceberg { @@ -63,6 +64,18 @@ int32_t HashLiteral(const Literal& literal) { return BucketUtils::HashLong(std::get(literal.value())); } +template <> +int32_t HashLiteral(const Literal& literal) { + return BucketUtils::HashLong( + TemporalUtils::NanosToMicros(std::get(literal.value()))); +} + +template <> +int32_t HashLiteral(const Literal& literal) { + return BucketUtils::HashLong( + TemporalUtils::NanosToMicros(std::get(literal.value()))); +} + template <> int32_t HashLiteral(const Literal& literal) { const auto& decimal = std::get(literal.value()); @@ -131,6 +144,8 @@ Result BucketUtils::BucketIndex(const Literal& literal, int32_t num_buc DISPATCH_HASH_LITERAL(TypeId::kTime) DISPATCH_HASH_LITERAL(TypeId::kTimestamp) DISPATCH_HASH_LITERAL(TypeId::kTimestampTz) + DISPATCH_HASH_LITERAL(TypeId::kTimestampNs) + DISPATCH_HASH_LITERAL(TypeId::kTimestampTzNs) DISPATCH_HASH_LITERAL(TypeId::kDecimal) DISPATCH_HASH_LITERAL(TypeId::kString) DISPATCH_HASH_LITERAL(TypeId::kUuid) diff --git a/src/iceberg/util/conversions.cc b/src/iceberg/util/conversions.cc index 0cc7c55d8..5c5356103 100644 --- a/src/iceberg/util/conversions.cc +++ b/src/iceberg/util/conversions.cc @@ -109,6 +109,8 @@ Result> Conversions::ToBytes(const PrimitiveType& type, DISPATCH_LITERAL_TO_BYTES(TypeId::kTime) DISPATCH_LITERAL_TO_BYTES(TypeId::kTimestamp) DISPATCH_LITERAL_TO_BYTES(TypeId::kTimestampTz) + DISPATCH_LITERAL_TO_BYTES(TypeId::kTimestampNs) + DISPATCH_LITERAL_TO_BYTES(TypeId::kTimestampTzNs) DISPATCH_LITERAL_TO_BYTES(TypeId::kFloat) DISPATCH_LITERAL_TO_BYTES(TypeId::kDouble) DISPATCH_LITERAL_TO_BYTES(TypeId::kDecimal) @@ -158,7 +160,9 @@ Result Conversions::FromBytes(const PrimitiveType& type, case TypeId::kLong: case TypeId::kTime: case TypeId::kTimestamp: - case TypeId::kTimestampTz: { + case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: { int64_t value; if (data.size() < 8) { // Type was promoted from int to long diff --git a/src/iceberg/util/projection_util_internal.h b/src/iceberg/util/projection_util_internal.h index df4fe9789..e9cda56ca 100644 --- a/src/iceberg/util/projection_util_internal.h +++ b/src/iceberg/util/projection_util_internal.h @@ -54,6 +54,10 @@ class ProjectionUtil { return Literal::Timestamp(std::get(literal.value()) + adjustment); case TypeId::kTimestampTz: return Literal::TimestampTz(std::get(literal.value()) + adjustment); + case TypeId::kTimestampNs: + return Literal::TimestampNs(std::get(literal.value()) + adjustment); + case TypeId::kTimestampTzNs: + return Literal::TimestampTzNs(std::get(literal.value()) + adjustment); case TypeId::kDecimal: { const auto& decimal_type = internal::checked_cast(*literal.type()); @@ -143,6 +147,8 @@ class ProjectionUtil { case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for numeric transform", @@ -179,6 +185,8 @@ class ProjectionUtil { case TypeId::kDate: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: break; default: return NotSupported("{} is not a valid input type for numeric transform", diff --git a/src/iceberg/util/struct_like_set.cc b/src/iceberg/util/struct_like_set.cc index cc3de5293..433cfa681 100644 --- a/src/iceberg/util/struct_like_set.cc +++ b/src/iceberg/util/struct_like_set.cc @@ -276,6 +276,8 @@ Status ValidateScalarAgainstType(const Scalar& scalar, const Type& type) { case TypeId::kTime: case TypeId::kTimestamp: case TypeId::kTimestampTz: + case TypeId::kTimestampNs: + case TypeId::kTimestampTzNs: ICEBERG_PRECHECK(std::holds_alternative(scalar), "Expected {} but got {}", type.ToString(), ScalarTypeName(scalar)); return {}; diff --git a/src/iceberg/util/temporal_util.cc b/src/iceberg/util/temporal_util.cc index 05aafb961..b91fcec77 100644 --- a/src/iceberg/util/temporal_util.cc +++ b/src/iceberg/util/temporal_util.cc @@ -21,9 +21,11 @@ #include #include +#include #include #include "iceberg/expression/literal.h" +#include "iceberg/util/int128.h" namespace iceberg { @@ -31,9 +33,28 @@ namespace { using namespace std::chrono; // NOLINT +constexpr int64_t kNanosPerMicro = 1000; + constexpr auto kEpochYmd = year{1970} / January / 1; constexpr auto kEpochDays = sys_days(kEpochYmd); +inline constexpr int64_t FloorDiv(int64_t dividend, int64_t divisor) { + const auto quotient = dividend / divisor; + if ((dividend ^ divisor) < 0 && quotient * divisor != dividend) { + return quotient - 1; + } + return quotient; +} + +Result MultiplyExact(int64_t lhs, int64_t rhs) { + const auto result = static_cast(lhs) * static_cast(rhs); + if (result > std::numeric_limits::max() || + result < std::numeric_limits::min()) [[unlikely]] { + return InvalidArgument("Long overflow when multiplying {} by {}", lhs, rhs); + } + return static_cast(result); +} + inline constexpr year_month_day DateToYmd(int32_t days_since_epoch) { return {kEpochDays + days{days_since_epoch}}; } @@ -42,6 +63,10 @@ inline constexpr year_month_day TimestampToYmd(int64_t micros_since_epoch) { return {floor(sys_time(microseconds{micros_since_epoch}))}; } +inline constexpr year_month_day TimestampNsToYmd(int64_t nanos_since_epoch) { + return {floor(sys_time(nanoseconds{nanos_since_epoch}))}; +} + template requires std::is_same_v || std::is_same_v inline constexpr int32_t TimestampToDuration(int64_t micros_since_epoch) { @@ -51,6 +76,15 @@ inline constexpr int32_t TimestampToDuration(int64_t micros_since_epoch) { .count()); } +template + requires std::is_same_v || std::is_same_v +inline constexpr int32_t TimestampNsToDuration(int64_t nanos_since_epoch) { + return static_cast( + floor( + sys_time(nanoseconds{nanos_since_epoch}).time_since_epoch()) + .count()); +} + inline constexpr int32_t MonthsSinceEpoch(const year_month_day& ymd) { auto delta = ymd.year() - kEpochYmd.year(); // Calculate the month as months from 1970-01 @@ -78,11 +112,23 @@ Result ExtractYearImpl(const Literal& literal) { return Literal::Int((ymd.year() - kEpochYmd.year()).count()); } +template <> +Result ExtractYearImpl(const Literal& literal) { + auto value = std::get(literal.value()); + auto ymd = TimestampNsToYmd(value); + return Literal::Int((ymd.year() - kEpochYmd.year()).count()); +} + template <> Result ExtractYearImpl(const Literal& literal) { return ExtractYearImpl(literal); } +template <> +Result ExtractYearImpl(const Literal& literal) { + return ExtractYearImpl(literal); +} + template Result ExtractMonthImpl(const Literal& literal) { std::unreachable(); @@ -102,11 +148,23 @@ Result ExtractMonthImpl(const Literal& literal) { return Literal::Int(MonthsSinceEpoch(ymd)); } +template <> +Result ExtractMonthImpl(const Literal& literal) { + auto value = std::get(literal.value()); + auto ymd = TimestampNsToYmd(value); + return Literal::Int(MonthsSinceEpoch(ymd)); +} + template <> Result ExtractMonthImpl(const Literal& literal) { return ExtractMonthImpl(literal); } +template <> +Result ExtractMonthImpl(const Literal& literal) { + return ExtractMonthImpl(literal); +} + template Result ExtractDayImpl(const Literal& literal) { std::unreachable(); @@ -123,11 +181,22 @@ Result ExtractDayImpl(const Literal& literal) { return Literal::Int(TimestampToDuration(value)); } +template <> +Result ExtractDayImpl(const Literal& literal) { + auto value = std::get(literal.value()); + return Literal::Int(TimestampNsToDuration(value)); +} + template <> Result ExtractDayImpl(const Literal& literal) { return ExtractDayImpl(literal); } +template <> +Result ExtractDayImpl(const Literal& literal) { + return ExtractDayImpl(literal); +} + template Result ExtractHourImpl(const Literal& literal) { std::unreachable(); @@ -139,13 +208,32 @@ Result ExtractHourImpl(const Literal& literal) { return Literal::Int(TimestampToDuration(value)); } +template <> +Result ExtractHourImpl(const Literal& literal) { + auto value = std::get(literal.value()); + return Literal::Int(TimestampNsToDuration(value)); +} + template <> Result ExtractHourImpl(const Literal& literal) { return ExtractHourImpl(literal); } +template <> +Result ExtractHourImpl(const Literal& literal) { + return ExtractHourImpl(literal); +} + } // namespace +int64_t TemporalUtils::NanosToMicros(int64_t nanos) { + return FloorDiv(nanos, kNanosPerMicro); +} + +Result TemporalUtils::MicrosToNanos(int64_t micros) { + return MultiplyExact(micros, kNanosPerMicro); +} + #define DISPATCH_EXTRACT_YEAR(type_id) \ case type_id: \ return ExtractYearImpl(literal); @@ -163,6 +251,8 @@ Result TemporalUtils::ExtractYear(const Literal& literal) { DISPATCH_EXTRACT_YEAR(TypeId::kDate) DISPATCH_EXTRACT_YEAR(TypeId::kTimestamp) DISPATCH_EXTRACT_YEAR(TypeId::kTimestampTz) + DISPATCH_EXTRACT_YEAR(TypeId::kTimestampNs) + DISPATCH_EXTRACT_YEAR(TypeId::kTimestampTzNs) default: return NotSupported("Extract year from type {} is not supported", literal.type()->ToString()); @@ -186,6 +276,8 @@ Result TemporalUtils::ExtractMonth(const Literal& literal) { DISPATCH_EXTRACT_MONTH(TypeId::kDate) DISPATCH_EXTRACT_MONTH(TypeId::kTimestamp) DISPATCH_EXTRACT_MONTH(TypeId::kTimestampTz) + DISPATCH_EXTRACT_MONTH(TypeId::kTimestampNs) + DISPATCH_EXTRACT_MONTH(TypeId::kTimestampTzNs) default: return NotSupported("Extract month from type {} is not supported", literal.type()->ToString()); @@ -209,6 +301,8 @@ Result TemporalUtils::ExtractDay(const Literal& literal) { DISPATCH_EXTRACT_DAY(TypeId::kDate) DISPATCH_EXTRACT_DAY(TypeId::kTimestamp) DISPATCH_EXTRACT_DAY(TypeId::kTimestampTz) + DISPATCH_EXTRACT_DAY(TypeId::kTimestampNs) + DISPATCH_EXTRACT_DAY(TypeId::kTimestampTzNs) default: return NotSupported("Extract day from type {} is not supported", literal.type()->ToString()); @@ -231,6 +325,8 @@ Result TemporalUtils::ExtractHour(const Literal& literal) { switch (literal.type()->type_id()) { DISPATCH_EXTRACT_HOUR(TypeId::kTimestamp) DISPATCH_EXTRACT_HOUR(TypeId::kTimestampTz) + DISPATCH_EXTRACT_HOUR(TypeId::kTimestampNs) + DISPATCH_EXTRACT_HOUR(TypeId::kTimestampTzNs) default: return NotSupported("Extract hour from type {} is not supported", literal.type()->ToString()); diff --git a/src/iceberg/util/temporal_util.h b/src/iceberg/util/temporal_util.h index 750c3d8b7..414e4fd20 100644 --- a/src/iceberg/util/temporal_util.h +++ b/src/iceberg/util/temporal_util.h @@ -19,6 +19,8 @@ #pragma once +#include + #include "iceberg/iceberg_export.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" @@ -27,6 +29,12 @@ namespace iceberg { class ICEBERG_EXPORT TemporalUtils { public: + /// \brief Convert nanoseconds since epoch to microseconds using floor division. + static int64_t NanosToMicros(int64_t nanos); + + /// \brief Convert microseconds since epoch to nanoseconds, failing on overflow. + static Result MicrosToNanos(int64_t micros); + /// \brief Extract a date or timestamp year, as years from 1970 static Result ExtractYear(const Literal& literal); diff --git a/src/iceberg/util/transform_util.cc b/src/iceberg/util/transform_util.cc index a9221310e..fc1b104e5 100644 --- a/src/iceberg/util/transform_util.cc +++ b/src/iceberg/util/transform_util.cc @@ -21,7 +21,9 @@ #include #include +#include +#include "iceberg/util/int128.h" #include "iceberg/util/macros.h" #include "iceberg/util/string_util.h" @@ -32,6 +34,9 @@ constexpr auto kEpochDate = std::chrono::year{1970} / std::chrono::January / 1; constexpr int64_t kMicrosPerMillis = 1'000; constexpr int64_t kMicrosPerSecond = 1'000'000; constexpr int64_t kMicrosPerDay = 86'400'000'000LL; +constexpr int64_t kNanosPerMillis = 1'000'000; +constexpr int64_t kNanosPerSecond = 1'000'000'000; +constexpr int64_t kNanosPerDay = 86'400'000'000'000LL; /// Parse a timezone offset of the form "+HH:mm" or "-HH:mm" and return the /// offset in microseconds (positive for east of UTC, negative for west). @@ -44,28 +49,124 @@ Result ParseTimezoneOffset(std::string_view offset) { StringUtils::ParseNumber(offset.substr(1, 2))); ICEBERG_ASSIGN_OR_RAISE(auto minutes, StringUtils::ParseNumber(offset.substr(4, 2))); - if (hours > 18 || minutes > 59) { + if (hours > 18 || minutes > 59) [[unlikely]] { return InvalidArgument("Invalid timezone offset: '{}'", offset); } + + if (hours == 18 && minutes != 0) [[unlikely]] { + return InvalidArgument("Timezone offset '{}' not in range [-18:00, +18:00]", offset); + } + auto micros = hours * 3'600 * kMicrosPerSecond + minutes * 60 * kMicrosPerSecond; return negative ? -micros : micros; } +Result> ParseTimestampWithZoneSuffix( + std::string_view str) { + if (str.empty()) [[unlikely]] { + return InvalidArgument("Invalid timestamptz string: '{}'", str); + } + + int64_t offset_micros = 0; + std::string_view timestamp_part; + + if (str.back() == 'Z') { + timestamp_part = str.substr(0, str.size() - 1); + } else if (str.size() >= 6 && + (str[str.size() - 6] == '+' || str[str.size() - 6] == '-')) { + // Parse "+HH:mm" or "-HH:mm" offset suffix + ICEBERG_ASSIGN_OR_RAISE(offset_micros, + ParseTimezoneOffset(str.substr(str.size() - 6))); + timestamp_part = str.substr(0, str.size() - 6); + } else { + return InvalidArgument("Invalid timestamptz string (missing timezone suffix): '{}'", + str); + } + + return std::make_pair(timestamp_part, offset_micros); +} + +Result TimestampFromDayTime(int32_t days, int64_t time_units, + int64_t units_per_day, int64_t offset_micros, + int64_t units_per_micro) { + const auto offset_units = + static_cast(offset_micros) * static_cast(units_per_micro); + const auto timestamp = + static_cast(days) * static_cast(units_per_day) + + static_cast(time_units) - offset_units; + + if (timestamp > std::numeric_limits::max() || + timestamp < std::numeric_limits::min()) [[unlikely]] { + return InvalidArgument("Timestamp value is out of int64 range"); + } + + return static_cast(timestamp); +} + /// Parse fractional seconds (after '.') and return micros. /// Digits beyond 6 are truncated (nanosecond precision). Result ParseFractionalMicros(std::string_view frac) { - if (frac.empty()) { + if (frac.empty() || frac.size() > 9) [[unlikely]] { return InvalidArgument("Invalid fractional seconds: '{}'", frac); } // Truncate to microsecond precision (6 digits), matching Java ISO_LOCAL_TIME behavior if (frac.size() > 6) frac = frac.substr(0, 6); ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); - // Right-pad to 6 digits: "500" → 500000, "001" → 1000, "000001" → 1 + // Right-pad to 6 digits: "500" -> 500000, "001" -> 1000, "000001" -> 1000 for (size_t i = frac.size(); i < 6; ++i) { val *= 10; } return static_cast(val); } + +/// Parse fractional seconds (after '.') and return nanos. +Result ParseFractionalNanos(std::string_view frac) { + if (frac.empty() || frac.size() > 9) [[unlikely]] { + return InvalidArgument("Invalid fractional seconds: '{}'", frac); + } + ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); + // Right-pad to 9 digits: "500" -> 500000000, "001" -> 1000000, "000001" -> 1000 + for (size_t i = frac.size(); i < 9; ++i) { + val *= 10; + } + return static_cast(val); +} + +template +Result ParseTimeWithFraction(std::string_view str, int64_t units_per_second, + TimeScaleParser&& parse_fraction) { + if (str.size() < 5 || str[2] != ':') [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + + ICEBERG_ASSIGN_OR_RAISE(auto hours, + StringUtils::ParseNumber(str.substr(0, 2))); + ICEBERG_ASSIGN_OR_RAISE(auto minutes, + StringUtils::ParseNumber(str.substr(3, 2))); + int64_t seconds = 0; + + int64_t frac_units = 0; + if (str.size() > 5) { + if (str[5] != ':' || str.size() < 8) [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + ICEBERG_ASSIGN_OR_RAISE(seconds, StringUtils::ParseNumber(str.substr(6, 2))); + if (str.size() > 8) { + if (str[8] != '.') [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + ICEBERG_ASSIGN_OR_RAISE(frac_units, parse_fraction(str.substr(9))); + } + } + + if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || + seconds > 59) [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + + return hours * 3'600 * units_per_second + minutes * 60 * units_per_second + + seconds * units_per_second + frac_units; +} } // namespace std::string TransformUtil::HumanYear(int32_t year_ordinal) { @@ -79,7 +180,7 @@ std::string TransformUtil::HumanMonth(int32_t month_ordinal) { } std::string TransformUtil::HumanDay(int32_t day_ordinal) { - auto ymd = std::chrono::sys_days(kEpochDate) + std::chrono::days{day_ordinal}; + auto ymd = std::chrono::sys_days{kEpochDate} + std::chrono::days{day_ordinal}; return std::format("{:%F}", ymd); } @@ -105,9 +206,14 @@ std::string TransformUtil::HumanTime(int64_t micros_from_midnight) { } std::string TransformUtil::HumanTimestamp(int64_t timestamp_micros) { + const auto micros_since_epoch = std::chrono::microseconds{timestamp_micros}; + const auto seconds_since_epoch = + std::chrono::floor(micros_since_epoch); auto tp = std::chrono::time_point{ - std::chrono::seconds(timestamp_micros / kMicrosPerSecond)}; - auto micros = timestamp_micros % kMicrosPerSecond; + seconds_since_epoch}; + auto micros = std::chrono::duration_cast(micros_since_epoch - + seconds_since_epoch) + .count(); if (micros == 0) { return std::format("{:%FT%T}", tp); } else if (micros % kMicrosPerMillis == 0) { @@ -117,10 +223,35 @@ std::string TransformUtil::HumanTimestamp(int64_t timestamp_micros) { } } +std::string TransformUtil::HumanTimestampNs(int64_t timestamp_nanos) { + const auto nanos_since_epoch = std::chrono::nanoseconds{timestamp_nanos}; + const auto seconds_since_epoch = + std::chrono::floor(nanos_since_epoch); + auto tp = std::chrono::time_point{ + seconds_since_epoch}; + auto nanos = std::chrono::duration_cast(nanos_since_epoch - + seconds_since_epoch) + .count(); + if (nanos == 0) { + return std::format("{:%FT%T}", tp); + } else if (nanos % kNanosPerMillis == 0) { + return std::format("{:%FT%T}.{:03d}", tp, nanos / kNanosPerMillis); + } else if (nanos % kMicrosPerMillis == 0) { + return std::format("{:%FT%T}.{:06d}", tp, nanos / kMicrosPerMillis); + } else { + return std::format("{:%FT%T}.{:09d}", tp, nanos); + } +} + std::string TransformUtil::HumanTimestampWithZone(int64_t timestamp_micros) { + const auto micros_since_epoch = std::chrono::microseconds{timestamp_micros}; + const auto seconds_since_epoch = + std::chrono::floor(micros_since_epoch); auto tp = std::chrono::time_point{ - std::chrono::seconds(timestamp_micros / kMicrosPerSecond)}; - auto micros = timestamp_micros % kMicrosPerSecond; + seconds_since_epoch}; + auto micros = std::chrono::duration_cast(micros_since_epoch - + seconds_since_epoch) + .count(); if (micros == 0) { return std::format("{:%FT%T}+00:00", tp); } else if (micros % kMicrosPerMillis == 0) { @@ -130,6 +261,26 @@ std::string TransformUtil::HumanTimestampWithZone(int64_t timestamp_micros) { } } +std::string TransformUtil::HumanTimestampNsWithZone(int64_t timestamp_nanos) { + const auto nanos_since_epoch = std::chrono::nanoseconds{timestamp_nanos}; + const auto seconds_since_epoch = + std::chrono::floor(nanos_since_epoch); + auto tp = std::chrono::time_point{ + seconds_since_epoch}; + auto nanos = std::chrono::duration_cast(nanos_since_epoch - + seconds_since_epoch) + .count(); + if (nanos == 0) { + return std::format("{:%FT%T}+00:00", tp); + } else if (nanos % kNanosPerMillis == 0) { + return std::format("{:%FT%T}.{:03d}+00:00", tp, nanos / kNanosPerMillis); + } else if (nanos % kMicrosPerMillis == 0) { + return std::format("{:%FT%T}.{:06d}+00:00", tp, nanos / kMicrosPerMillis); + } else { + return std::format("{:%FT%T}.{:09d}+00:00", tp, nanos); + } +} + Result TransformUtil::ParseDay(std::string_view str) { // Expected format: "[+-]yyyy-MM-dd" // Parse year, month, day manually, skipping leading '+' or '-' to find first date dash @@ -156,82 +307,76 @@ Result TransformUtil::ParseDay(std::string_view str) { return InvalidArgument("Invalid date: '{}'", str); } - auto days = std::chrono::sys_days(ymd) - std::chrono::sys_days(kEpochDate); + auto days = std::chrono::sys_days{ymd} - std::chrono::sys_days{kEpochDate}; return static_cast(days.count()); } Result TransformUtil::ParseTime(std::string_view str) { - if (str.size() < 5 || str[2] != ':') [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } + return ParseTimeWithFraction(str, kMicrosPerSecond, ParseFractionalMicros); +} - ICEBERG_ASSIGN_OR_RAISE(auto hours, - StringUtils::ParseNumber(str.substr(0, 2))); - ICEBERG_ASSIGN_OR_RAISE(auto minutes, - StringUtils::ParseNumber(str.substr(3, 2))); - int64_t seconds = 0; +Result TransformUtil::ParseTimeNs(std::string_view str) { + return ParseTimeWithFraction(str, kNanosPerSecond, ParseFractionalNanos); +} - int64_t frac_micros = 0; - if (str.size() > 5) { - if (str[5] != ':' || str.size() < 8) [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - ICEBERG_ASSIGN_OR_RAISE(seconds, StringUtils::ParseNumber(str.substr(6, 2))); - if (str.size() > 8) { - if (str[8] != '.') [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - ICEBERG_ASSIGN_OR_RAISE(frac_micros, ParseFractionalMicros(str.substr(9))); - } +Result TransformUtil::ParseTimestamp(std::string_view str) { + auto t_pos = str.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); } - // check that hours, minutes, seconds are in valid ranges - if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || - seconds > 59) [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } + ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(str.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(str.substr(t_pos + 1))); - return hours * 3'600 * kMicrosPerSecond + minutes * 60 * kMicrosPerSecond + - seconds * kMicrosPerSecond + frac_micros; + return TimestampFromDayTime(days, time_micros, kMicrosPerDay, /*offset_micros=*/0, + /*units_per_micro=*/1); } -Result TransformUtil::ParseTimestamp(std::string_view str) { - // Format: "yyyy-MM-ddTHH:mm:ss[.SSS[SSS]]" +Result TransformUtil::ParseTimestampNs(std::string_view str) { auto t_pos = str.find('T'); if (t_pos == std::string_view::npos) [[unlikely]] { return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); } ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(str.substr(0, t_pos))); - ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(str.substr(t_pos + 1))); + ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(str.substr(t_pos + 1))); - return static_cast(days) * kMicrosPerDay + time_micros; + return TimestampFromDayTime(days, time_nanos, kNanosPerDay, /*offset_micros=*/0, + /*units_per_micro=*/1'000); } Result TransformUtil::ParseTimestampWithZone(std::string_view str) { - if (str.empty()) [[unlikely]] { - return InvalidArgument("Invalid timestamptz string: '{}'", str); + ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); + const auto [timestamp_part, offset_micros] = timestamp_with_offset; + + auto t_pos = timestamp_part.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", + timestamp_part); } - int64_t offset_micros = 0; - std::string_view timestamp_part; + ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(timestamp_part.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(timestamp_part.substr(t_pos + 1))); - if (str.back() == 'Z') { - // "Z" suffix means UTC (offset = 0) - timestamp_part = str.substr(0, str.size() - 1); - } else if (str.size() >= 6 && - (str[str.size() - 6] == '+' || str[str.size() - 6] == '-')) { - // Parse "+HH:mm" or "-HH:mm" offset suffix - ICEBERG_ASSIGN_OR_RAISE(offset_micros, - ParseTimezoneOffset(str.substr(str.size() - 6))); - timestamp_part = str.substr(0, str.size() - 6); - } else { - return InvalidArgument("Invalid timestamptz string (missing timezone suffix): '{}'", - str); + return TimestampFromDayTime(days, time_micros, kMicrosPerDay, offset_micros, + /*units_per_micro=*/1); +} + +Result TransformUtil::ParseTimestampNsWithZone(std::string_view str) { + ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); + const auto [timestamp_part, offset_micros] = timestamp_with_offset; + + auto t_pos = timestamp_part.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", + timestamp_part); } - ICEBERG_ASSIGN_OR_RAISE(auto local_micros, ParseTimestamp(timestamp_part)); - return local_micros - offset_micros; + ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(timestamp_part.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(timestamp_part.substr(t_pos + 1))); + + return TimestampFromDayTime(days, time_nanos, kNanosPerDay, offset_micros, + /*units_per_micro=*/1'000); } std::string TransformUtil::Base64Encode(std::string_view str_to_encode) { diff --git a/src/iceberg/util/transform_util.h b/src/iceberg/util/transform_util.h index c23d08c8c..b9c692098 100644 --- a/src/iceberg/util/transform_util.h +++ b/src/iceberg/util/transform_util.h @@ -23,6 +23,7 @@ #include "iceberg/iceberg_export.h" #include "iceberg/result.h" +#include "iceberg/type_fwd.h" namespace iceberg { @@ -86,6 +87,19 @@ class ICEBERG_EXPORT TransformUtil { /// \return a string representation of this timestamp. static std::string HumanTimestamp(int64_t timestamp_micros); + /// \brief Returns a string representation of a timestamp in nanoseconds. + /// + /// The output will be one of the following forms, according to the precision of the + /// timestamp: + /// - yyyy-MM-ddTHH:mm:ss + /// - yyyy-MM-ddTHH:mm:ss.SSS + /// - yyyy-MM-ddTHH:mm:ss.SSSSSS + /// - yyyy-MM-ddTHH:mm:ss.SSSSSSSSS + /// + /// \param timestamp_nanos the timestamp in nanoseconds. + /// \return a string representation of this timestamp. + static std::string HumanTimestampNs(int64_t timestamp_nanos); + /// \brief Returns a human-readable string representation of a timestamp with a time /// zone. /// @@ -99,6 +113,20 @@ class ICEBERG_EXPORT TransformUtil { /// \return a string representation of this timestamp. static std::string HumanTimestampWithZone(int64_t timestamp_micros); + /// \brief Returns a string representation of a timestamp in nanoseconds with a time + /// zone. + /// + /// The output will be one of the following forms, according to the precision of the + /// timestamp: + /// - yyyy-MM-ddTHH:mm:ss+00:00 + /// - yyyy-MM-ddTHH:mm:ss.SSS+00:00 + /// - yyyy-MM-ddTHH:mm:ss.SSSSSS+00:00 + /// - yyyy-MM-ddTHH:mm:ss.SSSSSSSSS+00:00 + /// + /// \param timestamp_nanos the timestamp in nanoseconds. + /// \return a string representation of this timestamp. + static std::string HumanTimestampNsWithZone(int64_t timestamp_nanos); + /// \brief Parses a date string in "[+-]yyyy-MM-dd" format into days since epoch. /// /// Supports an optional '+' or '-' prefix for extended years beyond 9999. @@ -117,6 +145,16 @@ class ICEBERG_EXPORT TransformUtil { /// \return The number of microseconds from midnight, or an error. static Result ParseTime(std::string_view str); + /// \brief Parses a time string into nanoseconds from midnight. + /// + /// Accepts ISO-8601 local time formats: "HH:mm", "HH:mm:ss", or + /// "HH:mm:ss.f" where the fractional part can be 1-9 digits. + /// Digits beyond 9 (nanosecond precision) are truncated. + /// + /// \param str The time string to parse. + /// \return The number of nanoseconds from midnight, or an error. + static Result ParseTimeNs(std::string_view str); + /// \brief Parses a timestamp string into microseconds since epoch. /// /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", @@ -127,6 +165,16 @@ class ICEBERG_EXPORT TransformUtil { /// \return The number of microseconds since epoch, or an error. static Result ParseTimestamp(std::string_view str); + /// \brief Parses a timestamp string into nanoseconds since epoch. + /// + /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", + /// "yyyy-MM-ddTHH:mm:ss", or "yyyy-MM-ddTHH:mm:ss.f" where the + /// fractional part can be 1-9 digits. + /// + /// \param str The timestamp string to parse. + /// \return The number of nanoseconds since epoch, or an error. + static Result ParseTimestampNs(std::string_view str); + /// \brief Parses a timestamp-with-zone string into microseconds since epoch (UTC). /// /// Accepts the same formats as ParseTimestamp, with a timezone suffix: @@ -137,6 +185,16 @@ class ICEBERG_EXPORT TransformUtil { /// \return The number of microseconds since epoch (UTC), or an error. static Result ParseTimestampWithZone(std::string_view str); + /// \brief Parses a timestamp-with-zone string into nanoseconds since epoch (UTC). + /// + /// Accepts the same formats as ParseTimestampNs, with a timezone suffix: + /// "Z", "+HH:mm", or "-HH:mm". Non-UTC offsets are converted to UTC. + /// The seconds and fractional parts are optional (e.g. "yyyy-MM-ddTHH:mm+00:00"). + /// + /// \param str The timestamp string to parse. + /// \return The number of nanoseconds since epoch (UTC), or an error. + static Result ParseTimestampNsWithZone(std::string_view str); + /// \brief Base64 encode a string static std::string Base64Encode(std::string_view str_to_encode); }; diff --git a/src/iceberg/util/visitor_generate.h b/src/iceberg/util/visitor_generate.h index 053371d41..7a3648546 100644 --- a/src/iceberg/util/visitor_generate.h +++ b/src/iceberg/util/visitor_generate.h @@ -32,6 +32,8 @@ namespace iceberg { ACTION(Time); \ ACTION(Timestamp); \ ACTION(TimestampTz); \ + ACTION(TimestampNs); \ + ACTION(TimestampTzNs); \ ACTION(String); \ ACTION(Uuid); \ ACTION(Fixed); \ From fa3683546f85dd46fdbb05deb550b6c6c758e69f Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Sun, 24 May 2026 08:49:02 +0200 Subject: [PATCH 037/151] fix: evaluate ManifestGroup file filters (#664) ## Summary Fixes #663. This implements `ManifestGroup::FilterFiles()` instead of accepting the filter as a silent no-op. The change adds a `DataFile` `StructLike` wrapper, binds a file-level evaluator against file metadata, and applies it to each manifest entry before returning it. The evaluator schema is aligned with Java `ManifestGroup`: concrete partition fields are not exposed under `partition`, so callers should use `FilterData(...)` for logical data predicates. Supported file metadata includes `spec_id`, and unsupported concrete partition filters fail during binding rather than being ignored. The reader projection now includes file-filter referenced metadata columns when callers use `Select(...)`. Empty container-backed optional metadata is exposed as null so projected or missing metadata does not look present to the evaluator. ## Tests - `uvx pre-commit run --files src/iceberg/manifest/manifest_group.cc src/iceberg/manifest/manifest_entry.h src/iceberg/row/manifest_wrapper.cc src/iceberg/row/manifest_wrapper.h src/iceberg/test/manifest_group_test.cc` - `cmake --build build --target manifest_test -j 8` - `./build/src/iceberg/test/manifest_test --gtest_filter='ManifestGroupVersions/ManifestGroupTest.FilterFiles*'` - `./build/src/iceberg/test/manifest_test` --- src/iceberg/manifest/manifest_entry.h | 4 + src/iceberg/manifest/manifest_group.cc | 87 ++++++++++- src/iceberg/row/manifest_wrapper.cc | 173 ++++++++++++++++++++++ src/iceberg/row/manifest_wrapper.h | 21 +++ src/iceberg/test/manifest_group_test.cc | 186 +++++++++++++++++++++++- 5 files changed, 463 insertions(+), 8 deletions(-) diff --git a/src/iceberg/manifest/manifest_entry.h b/src/iceberg/manifest/manifest_entry.h index c1f81d0ae..17c5388bd 100644 --- a/src/iceberg/manifest/manifest_entry.h +++ b/src/iceberg/manifest/manifest_entry.h @@ -193,6 +193,10 @@ struct ICEBERG_EXPORT DataFile { SchemaField::MakeRequired(kFileFormatFieldId, "file_format", string(), "File format name: avro, orc, or parquet"); + static constexpr int32_t kSpecIdFieldId = 141; + inline static const SchemaField kSpecId = + SchemaField::MakeOptional(kSpecIdFieldId, "spec_id", int32(), "Partition spec ID"); + static constexpr int32_t kPartitionFieldId = 102; inline static const std::string kPartitionField = "partition"; inline static const std::string kPartitionDoc = diff --git a/src/iceberg/manifest/manifest_group.cc b/src/iceberg/manifest/manifest_group.cc index 8af717b25..61bb57da2 100644 --- a/src/iceberg/manifest/manifest_group.cc +++ b/src/iceberg/manifest/manifest_group.cc @@ -19,8 +19,14 @@ #include "iceberg/manifest/manifest_group.h" +#include +#include +#include +#include #include +#include +#include "iceberg/expression/binder.h" #include "iceberg/expression/evaluator.h" #include "iceberg/expression/expression.h" #include "iceberg/expression/manifest_evaluator.h" @@ -29,14 +35,47 @@ #include "iceberg/file_io.h" #include "iceberg/manifest/manifest_reader.h" #include "iceberg/partition_spec.h" +#include "iceberg/row/manifest_wrapper.h" #include "iceberg/schema.h" #include "iceberg/table_scan.h" +#include "iceberg/type.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/content_file_util.h" #include "iceberg/util/macros.h" namespace iceberg { +namespace { + +std::shared_ptr DataFileFilterSchema() { + auto empty_partition_type = std::make_shared(std::vector{}); + return std::make_shared(std::vector{ + DataFile::kContent, + DataFile::kFilePath, + DataFile::kFileFormat, + DataFile::kSpecId, + SchemaField::MakeRequired(DataFile::kPartitionFieldId, DataFile::kPartitionField, + std::move(empty_partition_type), DataFile::kPartitionDoc), + DataFile::kRecordCount, + DataFile::kFileSize, + DataFile::kColumnSizes, + DataFile::kValueCounts, + DataFile::kNullValueCounts, + DataFile::kNanValueCounts, + DataFile::kLowerBounds, + DataFile::kUpperBounds, + DataFile::kKeyMetadata, + DataFile::kSplitOffsets, + DataFile::kEqualityIds, + DataFile::kSortOrderId, + DataFile::kFirstRowId, + DataFile::kReferencedDataFile, + DataFile::kContentOffset, + DataFile::kContentSize}); +} + +} // namespace + Result> ManifestGroup::Make( std::shared_ptr io, std::shared_ptr schema, std::unordered_map> specs_by_id, @@ -265,10 +304,39 @@ Result> ManifestGroup::MakeReader( ICEBERG_ASSIGN_OR_RAISE(auto reader, ManifestReader::Make(manifest, io_, schema_, specs_by_id_)); + auto columns = columns_; + if (file_filter_ && file_filter_->op() != Expression::Operation::kTrue && + !columns.empty() && + std::ranges::find(columns, Schema::kAllColumns) == columns.end()) { + auto data_file_schema = DataFileFilterSchema(); + ICEBERG_ASSIGN_OR_RAISE( + auto bound_file_filter, + Binder::Bind(*data_file_schema, file_filter_, case_sensitive_)); + ICEBERG_ASSIGN_OR_RAISE(auto referenced_field_ids, + ReferenceVisitor::GetReferencedFieldIds(bound_file_filter)); + + std::unordered_set selected_columns(columns.cbegin(), columns.cend()); + for (const auto field_id : referenced_field_ids) { + if (field_id == DataFile::kSpecIdFieldId) { + continue; + } + ICEBERG_ASSIGN_OR_RAISE(auto column_name, + data_file_schema->FindColumnNameById(field_id)); + if (column_name.has_value()) { + std::string column_name_str(column_name.value()); + if (selected_columns.contains(column_name_str)) { + continue; + } + columns.push_back(std::move(column_name_str)); + selected_columns.insert(columns.back()); + } + } + } + reader->FilterRows(data_filter_) .FilterPartitions(partition_filter_) .CaseSensitive(case_sensitive_) - .Select(columns_); + .Select(std::move(columns)); return reader; } @@ -299,10 +367,13 @@ ManifestGroup::ReadEntries() { return eval_cache[spec_id].get(); }; + const bool has_file_filter = + file_filter_ && file_filter_->op() != Expression::Operation::kTrue; std::unique_ptr data_file_evaluator; - if (file_filter_ && file_filter_->op() != Expression::Operation::kTrue) { - // TODO(gangwu): create an Evaluator on the DataFile schema with empty - // partition type + if (has_file_filter) { + ICEBERG_ASSIGN_OR_RAISE( + data_file_evaluator, + Evaluator::Make(*DataFileFilterSchema(), file_filter_, case_sensitive_)); } std::unordered_map> result; @@ -343,8 +414,12 @@ ManifestGroup::ReadEntries() { } if (data_file_evaluator != nullptr) { - // TODO(gangwu): implement data_file_evaluator to evaluate StructLike on - // top of entry.data_file + DataFileStructLike data_file(*entry.data_file); + ICEBERG_ASSIGN_OR_RAISE(bool should_match, + data_file_evaluator->Evaluate(data_file)); + if (!should_match) { + continue; + } } if (!manifest_entry_predicate_(entry)) { diff --git a/src/iceberg/row/manifest_wrapper.cc b/src/iceberg/row/manifest_wrapper.cc index 851f9e72f..18be82233 100644 --- a/src/iceberg/row/manifest_wrapper.cc +++ b/src/iceberg/row/manifest_wrapper.cc @@ -19,18 +19,57 @@ #include "iceberg/row/manifest_wrapper.h" +#include +#include +#include +#include +#include +#include + #include "iceberg/manifest/manifest_reader_internal.h" #include "iceberg/util/macros.h" namespace iceberg { namespace { + +enum class DataFileFieldPosition : size_t { + kContent = 0, + kFilePath = 1, + kFileFormat = 2, + kSpecId = 3, + kPartition = 4, + kRecordCount = 5, + kFileSize = 6, + kColumnSizes = 7, + kValueCounts = 8, + kNullValueCounts = 9, + kNanValueCounts = 10, + kLowerBounds = 11, + kUpperBounds = 12, + kKeyMetadata = 13, + kSplitOffsets = 14, + kEqualityIds = 15, + kSortOrderId = 16, + kFirstRowId = 17, + kReferencedDataFile = 18, + kContentOffset = 19, + kContentSize = 20, + kNextUnusedId = 21, +}; + template requires std::is_same_v> || std::is_same_v std::string_view ToView(const T& value) { return {reinterpret_cast(value.data()), value.size()}; // NOLINT } +Scalar ToScalar(const int32_t value) { return value; } + +Scalar ToScalar(const int64_t value) { return value; } + +Scalar ToScalar(const std::vector& value) { return ToView(value); } + template Result FromOptional(const std::optional& value) { if (value.has_value()) { @@ -39,6 +78,79 @@ Result FromOptional(const std::optional& value) { return std::monostate{}; } +Result FromOptionalString(const std::optional& value) { + if (value.has_value()) { + return ToView(value.value()); + } + return std::monostate{}; +} + +template +class VectorArrayLike : public ArrayLike { + public: + explicit VectorArrayLike(std::span values) : values_(values) {} + + Result GetElement(size_t pos) const override { + if (pos >= size()) { + return InvalidArgument("Invalid array index: {}", pos); + } + return ToScalar(values_[pos]); + } + + size_t size() const override { return values_.size(); } + + private: + std::span values_; +}; + +template +class IntMapLike : public MapLike { + public: + explicit IntMapLike(const std::map& values) : values_(values) {} + + Result GetKey(size_t pos) const override { + if (pos >= size()) { + return InvalidArgument("Invalid map index: {}", pos); + } + return std::next(values_.get().cbegin(), pos)->first; + } + + Result GetValue(size_t pos) const override { + if (pos >= size()) { + return InvalidArgument("Invalid map index: {}", pos); + } + return ToScalar(std::next(values_.get().cbegin(), pos)->second); + } + + size_t size() const override { return values_.get().size(); } + + private: + std::reference_wrapper> values_; +}; + +template +Result FromOptionalMap(const std::map& values) { + if (values.empty()) { + return std::monostate{}; + } + return std::make_shared>(values); +} + +template +Result FromOptionalVector(const std::vector& values) { + if (values.empty()) { + return std::monostate{}; + } + return std::make_shared>(values); +} + +Result FromOptionalBytes(const std::vector& value) { + if (value.empty()) { + return std::monostate{}; + } + return ToView(value); +} + } // namespace Result PartitionFieldSummaryStructLike::GetField(size_t pos) const { @@ -134,4 +246,65 @@ std::unique_ptr FromManifestFile(const ManifestFile& file) { return std::make_unique(file); } +Result DataFileStructLike::GetField(size_t pos) const { + if (pos >= num_fields()) { + return InvalidArgument("Invalid data file field index: {}", pos); + } + + const auto& data_file = data_file_.get(); + switch (static_cast(pos)) { + case DataFileFieldPosition::kContent: + return static_cast(data_file.content); + case DataFileFieldPosition::kFilePath: + return ToView(data_file.file_path); + case DataFileFieldPosition::kFileFormat: + return ToString(data_file.file_format); + case DataFileFieldPosition::kSpecId: + return FromOptional(data_file.partition_spec_id); + case DataFileFieldPosition::kPartition: { + partition_ = std::make_shared(data_file.partition); + return partition_; + } + case DataFileFieldPosition::kRecordCount: + return data_file.record_count; + case DataFileFieldPosition::kFileSize: + return data_file.file_size_in_bytes; + case DataFileFieldPosition::kColumnSizes: + return FromOptionalMap(data_file.column_sizes); + case DataFileFieldPosition::kValueCounts: + return FromOptionalMap(data_file.value_counts); + case DataFileFieldPosition::kNullValueCounts: + return FromOptionalMap(data_file.null_value_counts); + case DataFileFieldPosition::kNanValueCounts: + return FromOptionalMap(data_file.nan_value_counts); + case DataFileFieldPosition::kLowerBounds: + return FromOptionalMap(data_file.lower_bounds); + case DataFileFieldPosition::kUpperBounds: + return FromOptionalMap(data_file.upper_bounds); + case DataFileFieldPosition::kKeyMetadata: + return FromOptionalBytes(data_file.key_metadata); + case DataFileFieldPosition::kSplitOffsets: + return FromOptionalVector(data_file.split_offsets); + case DataFileFieldPosition::kEqualityIds: + return FromOptionalVector(data_file.equality_ids); + case DataFileFieldPosition::kSortOrderId: + return FromOptional(data_file.sort_order_id); + case DataFileFieldPosition::kFirstRowId: + return FromOptional(data_file.first_row_id); + case DataFileFieldPosition::kReferencedDataFile: + return FromOptionalString(data_file.referenced_data_file); + case DataFileFieldPosition::kContentOffset: + return FromOptional(data_file.content_offset); + case DataFileFieldPosition::kContentSize: + return FromOptional(data_file.content_size_in_bytes); + case DataFileFieldPosition::kNextUnusedId: + return InvalidArgument("Invalid data file field index: {}", pos); + } + return InvalidArgument("Invalid data file field index: {}", pos); +} + +size_t DataFileStructLike::num_fields() const { + return static_cast(DataFileFieldPosition::kNextUnusedId); +} + } // namespace iceberg diff --git a/src/iceberg/row/manifest_wrapper.h b/src/iceberg/row/manifest_wrapper.h index bc04c1e8b..20c2165b2 100644 --- a/src/iceberg/row/manifest_wrapper.h +++ b/src/iceberg/row/manifest_wrapper.h @@ -26,6 +26,7 @@ #include #include "iceberg/iceberg_export.h" +#include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_list.h" #include "iceberg/row/struct_like.h" @@ -97,4 +98,24 @@ class ICEBERG_EXPORT ManifestFileStructLike : public StructLike { mutable std::shared_ptr summaries_; }; +/// \brief StructLike wrapper for DataFile metadata. +class ICEBERG_EXPORT DataFileStructLike : public StructLike { + public: + explicit DataFileStructLike(const DataFile& file) : data_file_(file) {} + ~DataFileStructLike() override = default; + + DataFileStructLike(const DataFileStructLike&) = delete; + DataFileStructLike& operator=(const DataFileStructLike&) = delete; + + Result GetField(size_t pos) const override; + + size_t num_fields() const override; + + void Reset(const DataFile& file) { data_file_ = std::cref(file); } + + private: + std::reference_wrapper data_file_; + mutable std::shared_ptr partition_; +}; + } // namespace iceberg diff --git a/src/iceberg/test/manifest_group_test.cc b/src/iceberg/test/manifest_group_test.cc index 017f98036..70e2cea99 100644 --- a/src/iceberg/test/manifest_group_test.cc +++ b/src/iceberg/test/manifest_group_test.cc @@ -76,13 +76,14 @@ class ManifestGroupTest : public testing::TestWithParam { std::shared_ptr MakeDataFile(const std::string& path, const PartitionValues& partition, - int32_t spec_id, int64_t record_count = 1) { + int32_t spec_id, int64_t record_count = 1, + int64_t file_size_in_bytes = 10) { return std::make_shared(DataFile{ .file_path = path, .file_format = FileFormatType::kParquet, .partition = partition, .record_count = record_count, - .file_size_in_bytes = 10, + .file_size_in_bytes = file_size_in_bytes, .sort_order_id = 0, .partition_spec_id = spec_id, }); @@ -404,6 +405,187 @@ TEST_P(ManifestGroupTest, CustomManifestEntriesFilter) { "/path/to/data3.parquet")); } +TEST_P(ManifestGroupTest, FilterFilesByRecordCount) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto part_value = PartitionValues({Literal::Int(0)}); + + std::vector data_entries{ + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/small.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/5)), + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/boundary.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/10)), + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/large.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/15))}; + auto data_manifest = + WriteDataManifest(version, kSnapshotId, std::move(data_entries), partitioned_spec_); + + std::vector manifests = {data_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->FilterFiles(Expressions::GreaterThanOrEqual("record_count", Literal::Long(10))); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, group->Entries()); + EXPECT_THAT(GetEntryPaths(entries), + testing::UnorderedElementsAre("/path/to/boundary.parquet", + "/path/to/large.parquet")); +} + +TEST_P(ManifestGroupTest, FilterFilesRejectsPartitionMetadata) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto part_value = PartitionValues({Literal::Int(0)}); + + std::vector data_entries{MakeEntry( + ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/data.parquet", part_value, partitioned_spec_->spec_id()))}; + auto data_manifest = + WriteDataManifest(version, kSnapshotId, std::move(data_entries), partitioned_spec_); + + std::vector manifests = {data_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->FilterFiles(Expressions::Equal("partition.data_bucket_16_2", Literal::Int(1))); + + auto result = group->Entries(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidExpression)); + EXPECT_THAT(result, HasErrorMessage("Cannot find field 'partition.data_bucket_16_2'")); +} + +TEST_P(ManifestGroupTest, FilterFilesRejectsPartitionMetadataWhenEmpty) { + std::vector manifests; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->FilterFiles(Expressions::Equal("partition.data_bucket_16_2", Literal::Int(1))); + + auto result = group->Entries(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidExpression)); + EXPECT_THAT(result, HasErrorMessage("Cannot find field 'partition.data_bucket_16_2'")); +} + +TEST_P(ManifestGroupTest, FilterFilesRejectsPartitionMetadataBeforeManifestPruning) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto part_value = PartitionValues({Literal::Int(0)}); + + std::vector data_entries{MakeEntry( + ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/data.parquet", part_value, partitioned_spec_->spec_id()))}; + auto data_manifest = + WriteDataManifest(version, kSnapshotId, std::move(data_entries), partitioned_spec_); + + std::vector manifests = {data_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->FilterPartitions(Expressions::Equal("data_bucket_16_2", Literal::Int(1))) + .FilterFiles(Expressions::Equal("partition.data_bucket_16_2", Literal::Int(1))); + + auto result = group->Entries(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidExpression)); + EXPECT_THAT(result, HasErrorMessage("Cannot find field 'partition.data_bucket_16_2'")); +} + +TEST_P(ManifestGroupTest, FilterFilesReadsFilteredColumnsWhenSelected) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto part_value = PartitionValues({Literal::Int(0)}); + + std::vector data_entries{ + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/too-small.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/1, + /*file_size_in_bytes=*/5)), + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/matching.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/1, + /*file_size_in_bytes=*/20))}; + auto data_manifest = + WriteDataManifest(version, kSnapshotId, std::move(data_entries), partitioned_spec_); + + std::vector manifests = {data_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->Select({"file_path"}) + .FilterFiles(Expressions::GreaterThan("file_size_in_bytes", Literal::Long(10))); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, group->Entries()); + EXPECT_THAT(GetEntryPaths(entries), testing::ElementsAre("/path/to/matching.parquet")); +} + +TEST_P(ManifestGroupTest, FilterFilesHonorsCaseInsensitiveMatchingWhenSelected) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto part_value = PartitionValues({Literal::Int(0)}); + + std::vector data_entries{ + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/small.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/5)), + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/large.parquet", part_value, + partitioned_spec_->spec_id(), /*record_count=*/15))}; + auto data_manifest = + WriteDataManifest(version, kSnapshotId, std::move(data_entries), partitioned_spec_); + + std::vector manifests = {data_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->CaseSensitive(false) + .Select({"FILE_PATH"}) + .FilterFiles(Expressions::GreaterThanOrEqual("RECORD_COUNT", Literal::Long(10))); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, group->Entries()); + EXPECT_THAT(GetEntryPaths(entries), testing::ElementsAre("/path/to/large.parquet")); +} + +TEST_P(ManifestGroupTest, FilterFilesBySpecIdWhenSelected) { + auto version = GetParam(); + + constexpr int64_t kSnapshotId = 1000L; + const auto unpartitioned_value = PartitionValues(std::vector{}); + const auto partitioned_value = PartitionValues({Literal::Int(1)}); + + std::vector unpartitioned_entries{ + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/unpartitioned.parquet", unpartitioned_value, + unpartitioned_spec_->spec_id()))}; + auto unpartitioned_manifest = WriteDataManifest( + version, kSnapshotId, std::move(unpartitioned_entries), unpartitioned_spec_); + + std::vector partitioned_entries{ + MakeEntry(ManifestStatus::kAdded, kSnapshotId, /*sequence_number=*/1, + MakeDataFile("/path/to/partitioned.parquet", partitioned_value, + partitioned_spec_->spec_id()))}; + auto partitioned_manifest = WriteDataManifest( + version, kSnapshotId, std::move(partitioned_entries), partitioned_spec_); + + std::vector manifests = {unpartitioned_manifest, partitioned_manifest}; + ICEBERG_UNWRAP_OR_FAIL( + auto group, + ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + group->Select({"file_path"}) + .FilterFiles( + Expressions::Equal("spec_id", Literal::Int(partitioned_spec_->spec_id()))); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, group->Entries()); + EXPECT_THAT(GetEntryPaths(entries), + testing::ElementsAre("/path/to/partitioned.parquet")); +} + TEST_P(ManifestGroupTest, EmptyManifestGroup) { std::vector manifests; ICEBERG_UNWRAP_OR_FAIL( From 41f32f8f1592e374bd7445687178a5f66bb8f2cc Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sun, 24 May 2026 14:49:43 +0800 Subject: [PATCH 038/151] fix: disallow zoned and non-zoned literal comparisons (#676) --- src/iceberg/expression/literal.cc | 8 ++------ src/iceberg/test/literal_test.cc | 8 +++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/iceberg/expression/literal.cc b/src/iceberg/expression/literal.cc index e14d3def2..cbf0ab017 100644 --- a/src/iceberg/expression/literal.cc +++ b/src/iceberg/expression/literal.cc @@ -458,12 +458,8 @@ bool Comparable(TypeId lhs, TypeId rhs) { (rhs == TypeId::kInt || rhs == TypeId::kDate)) { return true; } - if ((lhs == TypeId::kTimestamp || lhs == TypeId::kTimestampTz) && - (rhs == TypeId::kTimestamp || rhs == TypeId::kTimestampTz)) { - return true; - } - return (lhs == TypeId::kTimestampNs || lhs == TypeId::kTimestampTzNs) && - (rhs == TypeId::kTimestampNs || rhs == TypeId::kTimestampTzNs); + // Java allows zoned/non-zoned timestamp comparisons; keep C++ stricter for now. + return false; } } // namespace diff --git a/src/iceberg/test/literal_test.cc b/src/iceberg/test/literal_test.cc index 86b892377..e77533828 100644 --- a/src/iceberg/test/literal_test.cc +++ b/src/iceberg/test/literal_test.cc @@ -102,10 +102,12 @@ TEST(LiteralTest, CrossTypeComparison) { EXPECT_EQ(long_literal <=> timestamp_literal, std::partial_ordering::unordered); EXPECT_EQ(timestamp_literal <=> timestamp_ns_literal, std::partial_ordering::unordered); EXPECT_EQ(int_literal <=> Literal::Date(42), std::partial_ordering::equivalent); - EXPECT_EQ(timestamp_literal <=> timestamp_tz_literal, - std::partial_ordering::equivalent); + EXPECT_EQ(timestamp_literal <=> timestamp_tz_literal, std::partial_ordering::unordered); + EXPECT_EQ(timestamp_tz_literal <=> timestamp_literal, std::partial_ordering::unordered); EXPECT_EQ(timestamp_ns_literal <=> timestamp_tz_ns_literal, - std::partial_ordering::equivalent); + std::partial_ordering::unordered); + EXPECT_EQ(timestamp_tz_ns_literal <=> timestamp_ns_literal, + std::partial_ordering::unordered); } // Overflow tests From 5bbe9eeb02b93fdc855445d93f146ea5ec2baf1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 10:02:39 +0800 Subject: [PATCH 039/151] chore(deps): bump github/codeql-action from 4.35.4 to 4.35.5 (#677) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.4 to 4.35.5.
Release notes

Sourced from github/codeql-action's releases.

v4.35.5

  • We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. #3899
  • For performance and accuracy reasons, improved incremental analysis will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. #3791
  • If multiple inputs are provided for the GitHub-internal analysis-kinds input, only code-scanning will be enabled. The analysis-kinds input is experimental, for GitHub-internal use only, and may change without notice at any time. #3892
  • Added an experimental change which, when running a Code Scanning analysis for a PR with improved incremental analysis enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. #3880
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

No user facing changes.

4.36.0 - 22 May 2026

  • Breaking change: Bump the minimum required CodeQL bundle version to 2.19.4. #3894
  • Add support for SHA-256 Git object IDs. #3893
  • Update default CodeQL bundle version to 2.25.5. #3926

4.35.5 - 15 May 2026

  • We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. #3899
  • For performance and accuracy reasons, improved incremental analysis will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. #3791
  • If multiple inputs are provided for the GitHub-internal analysis-kinds input, only code-scanning will be enabled. The analysis-kinds input is experimental, for GitHub-internal use only, and may change without notice at any time. #3892
  • Added an experimental change which, when running a Code Scanning analysis for a PR with improved incremental analysis enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. #3880

4.35.4 - 07 May 2026

  • Update default CodeQL bundle version to 2.25.4. #3881

4.35.3 - 01 May 2026

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

4.35.1 - 27 Mar 2026

4.35.0 - 27 Mar 2026

... (truncated)

Commits
  • 9e0d7b8 Merge pull request #3905 from github/update-v4.35.5-d4b485515
  • 6d7d599 Add changelog entry for #3899
  • 51f7e38 Update changelog for v4.35.5
  • d4b4855 Merge pull request #3899 from github/mbg/esbuild/split
  • 127de81 Merge remote-tracking branch 'origin/main' into mbg/esbuild/split
  • 7fde13f Use src + basename in header to avoid issues on Windows
  • dfa61e7 Improve pattern matching and error handling
  • 52aafec Import and call runWrapper normally in analyze tests
  • 0d08c01 Auto-generate shared bundle
  • 14085a6 Auto-generate entry points
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.35.4&new-version=4.35.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6f25d0c9b..a811068b1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,11 +46,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 + uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4 + uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 with: category: "/language:actions" From 1f7a318dd01283f46bdd67ae519c3df7a0950cf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 10:07:20 +0800 Subject: [PATCH 040/151] chore(deps): bump zizmorcore/zizmor-action from 0.5.3 to 0.5.6 (#678) Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.3 to 0.5.6.
Release notes

Sourced from zizmorcore/zizmor-action's releases.

v0.5.6

  • 1.25.2 is now available via the action
  • 1.25.2 is now the default version of zizmor used by the action

v0.5.5

This is a no-op release.

v0.5.4

  • 1.25.0 is now available via the action
  • 1.25.0 is now the default version of zizmor used by the action
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zizmorcore/zizmor-action&package-manager=github_actions&previous-version=0.5.3&new-version=0.5.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/zizmor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index a265483fa..eb70d46bb 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -39,7 +39,7 @@ jobs: persist-credentials: false - name: Run zizmor 🌈 - uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 + uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 with: advanced-security: false min-severity: medium From a8578e1bddb55f7efbd3a9319f96ed8d03f53c2a Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 25 May 2026 13:34:02 +0800 Subject: [PATCH 041/151] chore(ci): skip actions for draft PRs (#680) --- .github/workflows/asf-allowlist-check.yml | 2 ++ .github/workflows/codeql.yml | 2 ++ .github/workflows/cpp-linter.yml | 2 ++ .github/workflows/license_check.yml | 5 ++++- .github/workflows/pre-commit.yml | 2 ++ .github/workflows/s3_test.yml | 2 ++ .github/workflows/sanitizer_test.yml | 2 ++ .github/workflows/test.yml | 5 +++++ .github/workflows/zizmor.yml | 2 ++ 9 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 8d7952a9d..5c91ccf9d 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -25,6 +25,7 @@ name: "ASF Allowlist Check" on: pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths: - ".github/**" push: @@ -38,6 +39,7 @@ permissions: jobs: asf-allowlist-check: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-24.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a811068b1..1e98f27ce 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -23,6 +23,7 @@ on: push: branches: [ "main" ] pull_request: + types: [opened, synchronize, reopened, ready_for_review] branches: [ "main" ] schedule: - cron: '16 4 * * 1' @@ -32,6 +33,7 @@ permissions: jobs: analyze: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Analyze Actions runs-on: ubuntu-slim permissions: diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index dd78a98f9..aa5262a52 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -19,6 +19,7 @@ name: C++ Linter on: pull_request: + types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - '.github/**' - 'ci/**' @@ -28,6 +29,7 @@ on: jobs: cpp-linter: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-24.04 permissions: contents: read diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 4bb28c0d5..47f974e82 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -17,13 +17,16 @@ name: "Run License Check" -on: pull_request +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] permissions: contents: read jobs: license-check: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: "License Check" runs-on: ubuntu-slim steps: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 583f280bd..4bbc2355f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -19,6 +19,7 @@ name: pre-commit on: pull_request: + types: [opened, synchronize, reopened, ready_for_review] push: branches: - '**' @@ -29,6 +30,7 @@ permissions: jobs: pre-commit: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-slim steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml index 8e6fb1ece..415477b2f 100644 --- a/.github/workflows/s3_test.yml +++ b/.github/workflows/s3_test.yml @@ -26,6 +26,7 @@ on: tags: - '**' pull_request: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} @@ -39,6 +40,7 @@ env: jobs: s3-minio: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: S3 (${{ matrix.title }}) runs-on: ${{ matrix.runs-on }} timeout-minutes: 35 diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index f33eda1be..efe9f49ac 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -25,6 +25,7 @@ on: tags: - '**' pull_request: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} @@ -35,6 +36,7 @@ permissions: jobs: sanitizer-test: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: "ASAN and UBSAN Tests" runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33368bb13..7d2e09fd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ on: tags: - '**' pull_request: + types: [opened, synchronize, reopened, ready_for_review] concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} @@ -38,6 +39,7 @@ env: jobs: ubuntu: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: AMD64 Ubuntu 24.04 runs-on: ubuntu-24.04 timeout-minutes: 30 @@ -64,6 +66,7 @@ jobs: CXX: g++-14 run: ci/scripts/build_example.sh $(pwd)/example macos: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: AArch64 macOS 26 runs-on: macos-26 timeout-minutes: 30 @@ -86,6 +89,7 @@ jobs: shell: bash run: ci/scripts/build_example.sh $(pwd)/example windows: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: AMD64 Windows 2025 runs-on: windows-2025 timeout-minutes: 60 @@ -121,6 +125,7 @@ jobs: $ErrorActionPreference = "Stop" bash -lc 'ci/scripts/build_example.sh $(pwd)/example' meson: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Meson - ${{ matrix.title }} runs-on: ${{ matrix.runs-on }} timeout-minutes: 30 diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index eb70d46bb..904f4726a 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -23,12 +23,14 @@ on: push: branches: ["main"] pull_request: + types: [opened, synchronize, reopened, ready_for_review] branches: ["**"] permissions: {} jobs: zizmor: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Run zizmor 🌈 runs-on: ubuntu-24.04 permissions: {} From 76fa723b4919d581fcf105e6c62fd09be35660b9 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 25 May 2026 16:55:41 +0800 Subject: [PATCH 042/151] refactor: move temporal utilities out of transform util (#675) Also add internal math helpers for floor division and checked multiplication. Keep the Human* formatting helpers in TransformUtil to stay consistent with the Java TransformUtil implementation. --- src/iceberg/expression/json_serde.cc | 13 +- src/iceberg/expression/literal.cc | 13 +- src/iceberg/test/CMakeLists.txt | 2 + ...e_metrics_evaluator_with_transform_test.cc | 6 +- src/iceberg/test/literal_test.cc | 10 +- src/iceberg/test/math_util_internal_test.cc | 56 ++++ src/iceberg/test/meson.build | 2 + src/iceberg/test/temporal_test_helper.h | 7 +- src/iceberg/test/temporal_util_test.cc | 230 ++++++++++++++ src/iceberg/test/transform_util_test.cc | 275 ----------------- src/iceberg/transform.cc | 1 + src/iceberg/util/math_util_internal.h | 47 +++ src/iceberg/util/temporal_util.cc | 252 ++++++++++++++-- src/iceberg/util/temporal_util.h | 90 ++++++ src/iceberg/util/transform_util.cc | 282 ++---------------- src/iceberg/util/transform_util.h | 72 +---- 16 files changed, 708 insertions(+), 650 deletions(-) create mode 100644 src/iceberg/test/math_util_internal_test.cc create mode 100644 src/iceberg/test/temporal_util_test.cc create mode 100644 src/iceberg/util/math_util_internal.h diff --git a/src/iceberg/expression/json_serde.cc b/src/iceberg/expression/json_serde.cc index 065f41cf2..df8aba88f 100644 --- a/src/iceberg/expression/json_serde.cc +++ b/src/iceberg/expression/json_serde.cc @@ -33,6 +33,7 @@ #include "iceberg/util/json_util_internal.h" #include "iceberg/util/macros.h" #include "iceberg/util/string_util.h" +#include "iceberg/util/temporal_util.h" #include "iceberg/util/transform_util.h" namespace iceberg { @@ -363,7 +364,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { return JsonParseError("Cannot parse {} as a date value", SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE(auto days, - TransformUtil::ParseDay(json.get())); + TemporalUtils::ParseDay(json.get())); return Literal::Date(days); } @@ -372,7 +373,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { return JsonParseError("Cannot parse {} as a time value", SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE(auto micros, - TransformUtil::ParseTime(json.get())); + TemporalUtils::ParseTime(json.get())); return Literal::Time(micros); } @@ -381,7 +382,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { return JsonParseError("Cannot parse {} as a timestamp value", SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE(auto micros, - TransformUtil::ParseTimestamp(json.get())); + TemporalUtils::ParseTimestamp(json.get())); return Literal::Timestamp(micros); } @@ -391,7 +392,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE( - auto micros, TransformUtil::ParseTimestampWithZone(json.get())); + auto micros, TemporalUtils::ParseTimestampWithZone(json.get())); return Literal::TimestampTz(micros); } @@ -401,7 +402,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE(auto nanos, - TransformUtil::ParseTimestampNs(json.get())); + TemporalUtils::ParseTimestampNs(json.get())); return Literal::TimestampNs(nanos); } @@ -411,7 +412,7 @@ Result LiteralFromJson(const nlohmann::json& json, const Type* type) { SafeDumpJson(json)); } ICEBERG_ASSIGN_OR_RAISE( - auto nanos, TransformUtil::ParseTimestampNsWithZone(json.get())); + auto nanos, TemporalUtils::ParseTimestampNsWithZone(json.get())); return Literal::TimestampTzNs(nanos); } diff --git a/src/iceberg/expression/literal.cc b/src/iceberg/expression/literal.cc index cbf0ab017..d11ab2656 100644 --- a/src/iceberg/expression/literal.cc +++ b/src/iceberg/expression/literal.cc @@ -32,7 +32,6 @@ #include "iceberg/util/macros.h" #include "iceberg/util/string_util.h" #include "iceberg/util/temporal_util.h" -#include "iceberg/util/transform_util.h" namespace iceberg { @@ -203,29 +202,29 @@ Result LiteralCaster::CastFromString( return Literal::UUID(uuid); } case TypeId::kDate: { - ICEBERG_ASSIGN_OR_RAISE(auto days, TransformUtil::ParseDay(str_val)); + ICEBERG_ASSIGN_OR_RAISE(auto days, TemporalUtils::ParseDay(str_val)); return Literal::Date(days); } case TypeId::kTime: { - ICEBERG_ASSIGN_OR_RAISE(auto micros, TransformUtil::ParseTime(str_val)); + ICEBERG_ASSIGN_OR_RAISE(auto micros, TemporalUtils::ParseTime(str_val)); return Literal::Time(micros); } case TypeId::kTimestamp: { - ICEBERG_ASSIGN_OR_RAISE(auto micros, TransformUtil::ParseTimestamp(str_val)); + ICEBERG_ASSIGN_OR_RAISE(auto micros, TemporalUtils::ParseTimestamp(str_val)); return Literal::Timestamp(micros); } case TypeId::kTimestampTz: { ICEBERG_ASSIGN_OR_RAISE(auto micros, - TransformUtil::ParseTimestampWithZone(str_val)); + TemporalUtils::ParseTimestampWithZone(str_val)); return Literal::TimestampTz(micros); } case TypeId::kTimestampNs: { - ICEBERG_ASSIGN_OR_RAISE(auto nanos, TransformUtil::ParseTimestampNs(str_val)); + ICEBERG_ASSIGN_OR_RAISE(auto nanos, TemporalUtils::ParseTimestampNs(str_val)); return Literal::TimestampNs(nanos); } case TypeId::kTimestampTzNs: { ICEBERG_ASSIGN_OR_RAISE(auto nanos, - TransformUtil::ParseTimestampNsWithZone(str_val)); + TemporalUtils::ParseTimestampNsWithZone(str_val)); return Literal::TimestampTzNs(nanos); } case TypeId::kBinary: { diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index c632403c3..7b5462673 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -128,11 +128,13 @@ add_iceberg_test(util_test formatter_test.cc lazy_test.cc location_util_test.cc + math_util_internal_test.cc roaring_position_bitmap_test.cc position_delete_index_test.cc retry_util_test.cc string_util_test.cc struct_like_set_test.cc + temporal_util_test.cc transform_util_test.cc truncate_util_test.cc url_encoder_test.cc diff --git a/src/iceberg/test/inclusive_metrics_evaluator_with_transform_test.cc b/src/iceberg/test/inclusive_metrics_evaluator_with_transform_test.cc index 935f3c3ab..4502cda72 100644 --- a/src/iceberg/test/inclusive_metrics_evaluator_with_transform_test.cc +++ b/src/iceberg/test/inclusive_metrics_evaluator_with_transform_test.cc @@ -30,6 +30,7 @@ #include "iceberg/schema.h" #include "iceberg/test/matchers.h" #include "iceberg/type.h" +#include "iceberg/util/temporal_util.h" namespace iceberg { @@ -38,9 +39,8 @@ constexpr bool kRowsMightMatch = true; constexpr bool kRowCannotMatch = false; constexpr int64_t kIntMinValue = 30; constexpr int64_t kIntMaxValue = 79; -constexpr int64_t kMicrosPerDay = 86'400'000'000LL; -constexpr int64_t kTsMinValue = 30 * kMicrosPerDay; -constexpr int64_t kTsMaxValue = 79 * kMicrosPerDay; +constexpr int64_t kTsMinValue = 30 * internal::kMicrosPerDay; +constexpr int64_t kTsMaxValue = 79 * internal::kMicrosPerDay; std::shared_ptr> ToBoundTransform( const std::shared_ptr& transform) { diff --git a/src/iceberg/test/literal_test.cc b/src/iceberg/test/literal_test.cc index e77533828..433c4fbed 100644 --- a/src/iceberg/test/literal_test.cc +++ b/src/iceberg/test/literal_test.cc @@ -29,6 +29,7 @@ #include "iceberg/test/matchers.h" #include "iceberg/test/temporal_test_helper.h" #include "iceberg/type.h" +#include "iceberg/util/temporal_util.h" namespace iceberg { @@ -678,10 +679,11 @@ INSTANTIATE_TEST_SUITE_P( .small_literal = Literal::Date(100), .large_literal = Literal::Date(200), .equal_literal = Literal::Date(100)}, - ComparisonLiteralTestParam{.test_name = "Time", - .small_literal = Literal::Time(43200000000LL), - .large_literal = Literal::Time(86400000000LL), - .equal_literal = Literal::Time(43200000000LL)}, + ComparisonLiteralTestParam{ + .test_name = "Time", + .small_literal = Literal::Time(internal::kMicrosPerDay / 2), + .large_literal = Literal::Time(internal::kMicrosPerDay), + .equal_literal = Literal::Time(internal::kMicrosPerDay / 2)}, ComparisonLiteralTestParam{.test_name = "Timestamp", .small_literal = Literal::Timestamp(1000000LL), .large_literal = Literal::Timestamp(2000000LL), diff --git a/src/iceberg/test/math_util_internal_test.cc b/src/iceberg/test/math_util_internal_test.cc new file mode 100644 index 000000000..ac9ef36cb --- /dev/null +++ b/src/iceberg/test/math_util_internal_test.cc @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/util/math_util_internal.h" + +#include + +#include + +#include "iceberg/test/matchers.h" + +namespace iceberg { + +TEST(MathUtilInternalTest, FloorDiv) { + EXPECT_EQ(0, FloorDiv(0, 1000)); + EXPECT_EQ(1, FloorDiv(1001, 1000)); + EXPECT_EQ(-1, FloorDiv(-1, 1000)); + EXPECT_EQ(-2, FloorDiv(-1001, 1000)); + EXPECT_EQ(1, FloorDiv(-1001, -1000)); + EXPECT_EQ(-2, FloorDiv(1001, -1000)); +} + +TEST(MathUtilInternalTest, MultiplyExact) { + ICEBERG_UNWRAP_OR_FAIL(auto positive, MultiplyExact(1000, 1000)); + EXPECT_EQ(1000000, positive); + + ICEBERG_UNWRAP_OR_FAIL(auto negative, MultiplyExact(-1000, 1000)); + EXPECT_EQ(-1000000, negative); + + ICEBERG_UNWRAP_OR_FAIL(auto min_value, + MultiplyExact(std::numeric_limits::min(), 1)); + EXPECT_EQ(std::numeric_limits::min(), min_value); + + EXPECT_THAT(MultiplyExact(std::numeric_limits::max(), 2), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(MultiplyExact(std::numeric_limits::min(), -1), + IsError(ErrorKind::kInvalidArgument)); +} + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 1acb46e9b..6928ab820 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -92,11 +92,13 @@ iceberg_tests = { 'formatter_test.cc', 'lazy_test.cc', 'location_util_test.cc', + 'math_util_internal_test.cc', 'position_delete_index_test.cc', 'retry_util_test.cc', 'roaring_position_bitmap_test.cc', 'string_util_test.cc', 'struct_like_set_test.cc', + 'temporal_util_test.cc', 'transform_util_test.cc', 'truncate_util_test.cc', 'url_encoder_test.cc', diff --git a/src/iceberg/test/temporal_test_helper.h b/src/iceberg/test/temporal_test_helper.h index 0f2904891..c4ba3a152 100644 --- a/src/iceberg/test/temporal_test_helper.h +++ b/src/iceberg/test/temporal_test_helper.h @@ -22,6 +22,8 @@ #include #include +#include "iceberg/util/temporal_util.h" + namespace iceberg { using namespace std::chrono; // NOLINT @@ -64,13 +66,12 @@ struct TimestampNanosParts { }; class TemporalTestHelper { - static constexpr auto kEpochDays = sys_days(year{1970} / January / 1); - public: /// \brief Construct a Calendar date without timezone or time static int32_t CreateDate(const DateParts& parts) { return static_cast( - (sys_days(year{parts.year} / month{parts.month} / day{parts.day}) - kEpochDays) + (sys_days(year{parts.year} / month{parts.month} / day{parts.day}) - + internal::kEpochDays) .count()); } diff --git a/src/iceberg/test/temporal_util_test.cc b/src/iceberg/test/temporal_util_test.cc new file mode 100644 index 000000000..0d4426b0b --- /dev/null +++ b/src/iceberg/test/temporal_util_test.cc @@ -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. + */ + +#include "iceberg/util/temporal_util.h" + +#include +#include + +#include + +#include "iceberg/test/matchers.h" + +namespace iceberg { + +TEST(TemporalUtilTest, ParseTimestampNs) { + ICEBERG_UNWRAP_OR_FAIL( + auto nanos, TemporalUtils::ParseTimestampNs("2026-01-01T00:00:01.000001001")); + EXPECT_EQ(nanos, 1767225601000001001L); + + ICEBERG_UNWRAP_OR_FAIL(auto pre_epoch_nanos, TemporalUtils::ParseTimestampNs( + "1969-12-31T23:59:59.123456789")); + EXPECT_EQ(pre_epoch_nanos, -876543211); +} + +TEST(TemporalUtilTest, ParseTimestampNsChecksInt64Bounds) { + ICEBERG_UNWRAP_OR_FAIL( + auto max_nanos, TemporalUtils::ParseTimestampNs("2262-04-11T23:47:16.854775807")); + EXPECT_EQ(max_nanos, std::numeric_limits::max()); + + ICEBERG_UNWRAP_OR_FAIL( + auto min_nanos, TemporalUtils::ParseTimestampNs("1677-09-21T00:12:43.145224192")); + EXPECT_EQ(min_nanos, std::numeric_limits::min()); + + EXPECT_THAT(TemporalUtils::ParseTimestampNs("2262-04-11T23:47:16.854775808"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(TemporalUtils::ParseTimestampNs("1677-09-21T00:12:43.145224191"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TemporalUtilTest, ParseTimestampNsRejectsMoreThanNineFractionalDigits) { + EXPECT_THAT(TemporalUtils::ParseTimestampNs("2026-01-01T00:00:01.0000010011"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TemporalUtilTest, ParseTimestampNsWithZone) { + ICEBERG_UNWRAP_OR_FAIL(auto nanos, TemporalUtils::ParseTimestampNsWithZone( + "2026-01-01T00:00:01.000001001+00:00")); + EXPECT_EQ(nanos, 1767225601000001001L); +} + +TEST(TemporalUtilTest, ParseTimestampNsWithZoneChecksInt64BoundsAfterOffset) { + ICEBERG_UNWRAP_OR_FAIL(auto max_nanos, TemporalUtils::ParseTimestampNsWithZone( + "2262-04-12T00:47:16.854775807+01:00")); + EXPECT_EQ(max_nanos, std::numeric_limits::max()); + + ICEBERG_UNWRAP_OR_FAIL(auto min_nanos, TemporalUtils::ParseTimestampNsWithZone( + "1677-09-20T23:12:43.145224192-01:00")); + EXPECT_EQ(min_nanos, std::numeric_limits::min()); + + EXPECT_THAT( + TemporalUtils::ParseTimestampNsWithZone("2262-04-11T23:47:16.854775807-00:01"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + TemporalUtils::ParseTimestampNsWithZone("1677-09-21T00:12:43.145224192+00:01"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST(TemporalUtilTest, ParseTimestampNsWithZoneRejectsOffsetPastPlusMinus1800) { + EXPECT_THAT( + TemporalUtils::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001+18:01"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + TemporalUtils::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001-18:30"), + IsError(ErrorKind::kInvalidArgument)); +} + +struct ParseParam { + std::string name; + std::string str; + int64_t value; + enum Kind { kDay, kTime, kTimestamp, kTimestampTz } kind; +}; + +class TemporalParseTest : public ::testing::TestWithParam {}; + +TEST_P(TemporalParseTest, ParsesCorrectly) { + const auto& param = GetParam(); + switch (param.kind) { + case ParseParam::kDay: { + ICEBERG_UNWRAP_OR_FAIL(auto parsed, TemporalUtils::ParseDay(param.str)); + EXPECT_EQ(parsed, static_cast(param.value)); + break; + } + case ParseParam::kTime: { + ICEBERG_UNWRAP_OR_FAIL(auto parsed, TemporalUtils::ParseTime(param.str)); + EXPECT_EQ(parsed, param.value); + break; + } + case ParseParam::kTimestamp: { + ICEBERG_UNWRAP_OR_FAIL(auto parsed, TemporalUtils::ParseTimestamp(param.str)); + EXPECT_EQ(parsed, param.value); + break; + } + case ParseParam::kTimestampTz: { + ICEBERG_UNWRAP_OR_FAIL(auto parsed, + TemporalUtils::ParseTimestampWithZone(param.str)); + EXPECT_EQ(parsed, param.value); + break; + } + } +} + +struct ParseTimeErrorParam { + std::string name; + std::string str; +}; + +class ParseTimeErrorTest : public ::testing::TestWithParam {}; + +TEST_P(ParseTimeErrorTest, ReturnsError) { + EXPECT_THAT(TemporalUtils::ParseTime(GetParam().str), + IsError(ErrorKind::kInvalidArgument)); +} + +INSTANTIATE_TEST_SUITE_P( + TemporalUtilTest, TemporalParseTest, + ::testing::Values( + ParseParam{"DayEpoch", "1970-01-01", 0, ParseParam::kDay}, + ParseParam{"DayNext", "1970-01-02", 1, ParseParam::kDay}, + ParseParam{"DayBeforeEpoch", "1969-12-31", -1, ParseParam::kDay}, + ParseParam{"DayYear999", "0999-12-31", -354286, ParseParam::kDay}, + ParseParam{"DayNonLeap", "1971-01-01", 365, ParseParam::kDay}, + ParseParam{"DayY2K", "2000-01-01", 10957, ParseParam::kDay}, + ParseParam{"Day2026", "2026-01-01", 20454, ParseParam::kDay}, + ParseParam{"TimeMidnight", "00:00", 0, ParseParam::kTime}, + ParseParam{"TimeOneSec", "00:00:01", 1000000, ParseParam::kTime}, + ParseParam{"TimeMillis", "00:00:01.500", 1500000, ParseParam::kTime}, + ParseParam{"TimeOneMillis", "00:00:01.001", 1001000, ParseParam::kTime}, + ParseParam{"TimeMicros", "00:00:01.000001", 1000001, ParseParam::kTime}, + ParseParam{"TimeHourMinSec", "01:02:03", 3723000000, ParseParam::kTime}, + ParseParam{"TimeEndOfDay", "23:59:59", 86399000000, ParseParam::kTime}, + ParseParam{"TimestampEpoch", "1970-01-01T00:00:00", 0, ParseParam::kTimestamp}, + ParseParam{"TimestampOneSec", "1970-01-01T00:00:01", 1000000, + ParseParam::kTimestamp}, + ParseParam{"TimestampMillis", "2026-01-01T00:00:01.500", 1767225601500000L, + ParseParam::kTimestamp}, + ParseParam{"TimestampOneMillis", "2026-01-01T00:00:01.001", 1767225601001000L, + ParseParam::kTimestamp}, + ParseParam{"TimestampMicros", "2026-01-01T00:00:01.000001", 1767225601000001L, + ParseParam::kTimestamp}, + ParseParam{"TimestampTzEpoch", "1970-01-01T00:00:00+00:00", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzOneSec", "1970-01-01T00:00:01+00:00", 1000000, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzMillis", "2026-01-01T00:00:01.500+00:00", + 1767225601500000L, ParseParam::kTimestampTz}, + ParseParam{"TimestampTzOneMillis", "2026-01-01T00:00:01.001+00:00", + 1767225601001000L, ParseParam::kTimestampTz}, + ParseParam{"TimestampTzMicros", "2026-01-01T00:00:01.000001+00:00", + 1767225601000001L, ParseParam::kTimestampTz}, + ParseParam{"TimestampTzSuffixZ_Epoch", "1970-01-01T00:00:00Z", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzSuffixZ_Millis", "2026-01-01T00:00:01.500Z", + 1767225601500000L, ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNegZero_Epoch", "1970-01-01T00:00:00-00:00", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNegZero_Millis", "2026-01-01T00:00:01.500-00:00", + 1767225601500000L, ParseParam::kTimestampTz}, + ParseParam{"TimeTruncatesNanos", "00:00:01.123456789", 1123456, + ParseParam::kTime}, + ParseParam{"1Digit", "00:00:01.5", 1500000, ParseParam::kTime}, + ParseParam{"2Digits", "00:00:01.50", 1500000, ParseParam::kTime}, + ParseParam{"2DigitsNonZero", "00:00:01.12", 1120000, ParseParam::kTime}, + ParseParam{"4Digits", "00:00:01.0001", 1000100, ParseParam::kTime}, + ParseParam{"TimestampNoSec_Zero", "1970-01-01T00:00", 0, ParseParam::kTimestamp}, + ParseParam{"TimestampNoSec_OneMin", "1970-01-01T00:01", 60000000, + ParseParam::kTimestamp}, + ParseParam{"TimestampTzNoSec_Offset", "1970-01-01T00:00+00:00", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNoSec_OneMin", "1970-01-01T00:01+00:00", 60000000, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNoSec_Z", "1970-01-01T00:00Z", 0, + ParseParam::kTimestampTz}, + ParseParam{"ExtendedYearPlusEpoch", "+1970-01-01", 0, ParseParam::kDay}, + ParseParam{"ExtendedYearPlus2026", "+2026-01-01", 20454, ParseParam::kDay}, + ParseParam{"ExtendedYearMinus2026", "-2026-01-01", -1459509, ParseParam::kDay}, + ParseParam{"TimestampTzPositiveOffset", "1970-01-01T05:00:00+05:00", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNegativeOffset", "1970-01-01T00:00:00-05:00", 18000000000, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzOffsetWithMillis", "2026-01-01T05:30:01.500+05:30", + 1767225601500000L, ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNegOffsetToEpoch", "1969-12-31T19:00:00-05:00", 0, + ParseParam::kTimestampTz}, + ParseParam{"TimestampTzNoSecWithOffset", "1970-01-01T05:30+05:30", 0, + ParseParam::kTimestampTz}), + [](const ::testing::TestParamInfo& info) { return info.param.name; }); + +INSTANTIATE_TEST_SUITE_P( + TemporalUtilTest, ParseTimeErrorTest, + ::testing::Values(ParseTimeErrorParam{"EmptyString", ""}, + ParseTimeErrorParam{"TooShort1Char", "1"}, + ParseTimeErrorParam{"TooShort2Chars", "12"}, + ParseTimeErrorParam{"TooShort4Chars", "12:3"}, + ParseTimeErrorParam{"MissingColon", "1200:00"}, + ParseTimeErrorParam{"OutofRangeHours", "24:00:00"}, + ParseTimeErrorParam{"OutofRangeMinutes", "12:60:00"}, + ParseTimeErrorParam{"OutofRangeSeconds", "12:30:61"}, + ParseTimeErrorParam{"SpaceInsteadOfColon", "12 30"}), + [](const ::testing::TestParamInfo& info) { + return info.param.name; + }); + +} // namespace iceberg diff --git a/src/iceberg/test/transform_util_test.cc b/src/iceberg/test/transform_util_test.cc index 5b64bb33c..f5a22233a 100644 --- a/src/iceberg/test/transform_util_test.cc +++ b/src/iceberg/test/transform_util_test.cc @@ -19,12 +19,8 @@ #include "iceberg/util/transform_util.h" -#include - #include -#include "iceberg/test/matchers.h" - namespace iceberg { TEST(TransformUtilTest, HumanYear) { @@ -157,69 +153,6 @@ TEST(TransformUtilTest, HumanTimestampNsWithZone) { TransformUtil::HumanTimestampNsWithZone(-876543211)); } -TEST(TransformUtilTest, ParseTimestampNs) { - ICEBERG_UNWRAP_OR_FAIL( - auto nanos, TransformUtil::ParseTimestampNs("2026-01-01T00:00:01.000001001")); - EXPECT_EQ(nanos, 1767225601000001001L); - ICEBERG_UNWRAP_OR_FAIL(auto pre_epoch_nanos, TransformUtil::ParseTimestampNs( - "1969-12-31T23:59:59.123456789")); - EXPECT_EQ(pre_epoch_nanos, -876543211); - EXPECT_EQ(TransformUtil::HumanTimestampNs(pre_epoch_nanos), - "1969-12-31T23:59:59.123456789"); -} - -TEST(TransformUtilTest, ParseTimestampNsChecksInt64Bounds) { - ICEBERG_UNWRAP_OR_FAIL( - auto max_nanos, TransformUtil::ParseTimestampNs("2262-04-11T23:47:16.854775807")); - EXPECT_EQ(max_nanos, std::numeric_limits::max()); - - ICEBERG_UNWRAP_OR_FAIL( - auto min_nanos, TransformUtil::ParseTimestampNs("1677-09-21T00:12:43.145224192")); - EXPECT_EQ(min_nanos, std::numeric_limits::min()); - - EXPECT_THAT(TransformUtil::ParseTimestampNs("2262-04-11T23:47:16.854775808"), - IsError(ErrorKind::kInvalidArgument)); - EXPECT_THAT(TransformUtil::ParseTimestampNs("1677-09-21T00:12:43.145224191"), - IsError(ErrorKind::kInvalidArgument)); -} - -TEST(TransformUtilTest, ParseTimestampNsRejectsMoreThanNineFractionalDigits) { - EXPECT_THAT(TransformUtil::ParseTimestampNs("2026-01-01T00:00:01.0000010011"), - IsError(ErrorKind::kInvalidArgument)); -} - -TEST(TransformUtilTest, ParseTimestampNsWithZone) { - ICEBERG_UNWRAP_OR_FAIL(auto nanos, TransformUtil::ParseTimestampNsWithZone( - "2026-01-01T00:00:01.000001001+00:00")); - EXPECT_EQ(nanos, 1767225601000001001L); -} - -TEST(TransformUtilTest, ParseTimestampNsWithZoneChecksInt64BoundsAfterOffset) { - ICEBERG_UNWRAP_OR_FAIL(auto max_nanos, TransformUtil::ParseTimestampNsWithZone( - "2262-04-12T00:47:16.854775807+01:00")); - EXPECT_EQ(max_nanos, std::numeric_limits::max()); - - ICEBERG_UNWRAP_OR_FAIL(auto min_nanos, TransformUtil::ParseTimestampNsWithZone( - "1677-09-20T23:12:43.145224192-01:00")); - EXPECT_EQ(min_nanos, std::numeric_limits::min()); - - EXPECT_THAT( - TransformUtil::ParseTimestampNsWithZone("2262-04-11T23:47:16.854775807-00:01"), - IsError(ErrorKind::kInvalidArgument)); - EXPECT_THAT( - TransformUtil::ParseTimestampNsWithZone("1677-09-21T00:12:43.145224192+00:01"), - IsError(ErrorKind::kInvalidArgument)); -} - -TEST(TransformUtilTest, ParseTimestampNsWithZoneRejectsOffsetPastPlusMinus1800) { - EXPECT_THAT( - TransformUtil::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001+18:01"), - IsError(ErrorKind::kInvalidArgument)); - EXPECT_THAT( - TransformUtil::ParseTimestampNsWithZone("2026-01-01T00:00:01.000001001-18:30"), - IsError(ErrorKind::kInvalidArgument)); -} - TEST(TransformUtilTest, Base64Encode) { // Empty string EXPECT_EQ("", TransformUtil::Base64Encode("")); @@ -245,212 +178,4 @@ TEST(TransformUtilTest, Base64Encode) { EXPECT_EQ("AA==", TransformUtil::Base64Encode({"\x00", 1})); } -struct ParseRoundTripParam { - std::string name; - std::string str; - int64_t value; - enum Kind { kDay, kTime, kTimestamp, kTimestampTz } kind; -}; - -class ParseRoundTripTest : public ::testing::TestWithParam {}; - -TEST_P(ParseRoundTripTest, RoundTrip) { - const auto& param = GetParam(); - switch (param.kind) { - case ParseRoundTripParam::kDay: { - EXPECT_EQ(TransformUtil::HumanDay(static_cast(param.value)), param.str); - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseDay(param.str)); - EXPECT_EQ(parsed, static_cast(param.value)); - break; - } - case ParseRoundTripParam::kTime: { - EXPECT_EQ(TransformUtil::HumanTime(param.value), param.str); - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseTime(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - case ParseRoundTripParam::kTimestamp: { - EXPECT_EQ(TransformUtil::HumanTimestamp(param.value), param.str); - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseTimestamp(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - case ParseRoundTripParam::kTimestampTz: { - EXPECT_EQ(TransformUtil::HumanTimestampWithZone(param.value), param.str); - ICEBERG_UNWRAP_OR_FAIL(auto parsed, - TransformUtil::ParseTimestampWithZone(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - } -} - -struct ParseOnlyParam { - std::string name; - std::string str; - int64_t value; - enum Kind { kDay, kTime, kTimestamp, kTimestampTz } kind; -}; - -class ParseOnlyTest : public ::testing::TestWithParam {}; - -TEST_P(ParseOnlyTest, ParsesCorrectly) { - const auto& param = GetParam(); - switch (param.kind) { - case ParseOnlyParam::kDay: { - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseDay(param.str)); - EXPECT_EQ(parsed, static_cast(param.value)); - break; - } - case ParseOnlyParam::kTime: { - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseTime(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - case ParseOnlyParam::kTimestamp: { - ICEBERG_UNWRAP_OR_FAIL(auto parsed, TransformUtil::ParseTimestamp(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - case ParseOnlyParam::kTimestampTz: { - ICEBERG_UNWRAP_OR_FAIL(auto parsed, - TransformUtil::ParseTimestampWithZone(param.str)); - EXPECT_EQ(parsed, param.value); - break; - } - } -} - -struct ParseTimeErrorParam { - std::string name; - std::string str; -}; - -class ParseTimeErrorTest : public ::testing::TestWithParam {}; - -TEST_P(ParseTimeErrorTest, ReturnsError) { - EXPECT_THAT(TransformUtil::ParseTime(GetParam().str), - IsError(ErrorKind::kInvalidArgument)); -} - -INSTANTIATE_TEST_SUITE_P( - TransformUtilTest, ParseRoundTripTest, - ::testing::Values( - // Day round-trips - ParseRoundTripParam{"DayEpoch", "1970-01-01", 0, ParseRoundTripParam::kDay}, - ParseRoundTripParam{"DayNext", "1970-01-02", 1, ParseRoundTripParam::kDay}, - ParseRoundTripParam{"DayBeforeEpoch", "1969-12-31", -1, - ParseRoundTripParam::kDay}, - ParseRoundTripParam{"DayYear999", "0999-12-31", -354286, - ParseRoundTripParam::kDay}, - ParseRoundTripParam{"DayNonLeap", "1971-01-01", 365, ParseRoundTripParam::kDay}, - ParseRoundTripParam{"DayY2K", "2000-01-01", 10957, ParseRoundTripParam::kDay}, - ParseRoundTripParam{"Day2026", "2026-01-01", 20454, ParseRoundTripParam::kDay}, - // Time round-trips - ParseRoundTripParam{"TimeMidnight", "00:00", 0, ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeOneSec", "00:00:01", 1000000, - ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeMillis", "00:00:01.500", 1500000, - ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeOneMillis", "00:00:01.001", 1001000, - ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeMicros", "00:00:01.000001", 1000001, - ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeHourMinSec", "01:02:03", 3723000000, - ParseRoundTripParam::kTime}, - ParseRoundTripParam{"TimeEndOfDay", "23:59:59", 86399000000, - ParseRoundTripParam::kTime}, - // Timestamp round-trips - ParseRoundTripParam{"TimestampEpoch", "1970-01-01T00:00:00", 0, - ParseRoundTripParam::kTimestamp}, - ParseRoundTripParam{"TimestampOneSec", "1970-01-01T00:00:01", 1000000, - ParseRoundTripParam::kTimestamp}, - ParseRoundTripParam{"TimestampMillis", "2026-01-01T00:00:01.500", - 1767225601500000L, ParseRoundTripParam::kTimestamp}, - ParseRoundTripParam{"TimestampOneMillis", "2026-01-01T00:00:01.001", - 1767225601001000L, ParseRoundTripParam::kTimestamp}, - ParseRoundTripParam{"TimestampMicros", "2026-01-01T00:00:01.000001", - 1767225601000001L, ParseRoundTripParam::kTimestamp}, - // TimestampTz round-trips - ParseRoundTripParam{"TimestampTzEpoch", "1970-01-01T00:00:00+00:00", 0, - ParseRoundTripParam::kTimestampTz}, - ParseRoundTripParam{"TimestampTzOneSec", "1970-01-01T00:00:01+00:00", 1000000, - ParseRoundTripParam::kTimestampTz}, - ParseRoundTripParam{"TimestampTzMillis", "2026-01-01T00:00:01.500+00:00", - 1767225601500000L, ParseRoundTripParam::kTimestampTz}, - ParseRoundTripParam{"TimestampTzOneMillis", "2026-01-01T00:00:01.001+00:00", - 1767225601001000L, ParseRoundTripParam::kTimestampTz}, - ParseRoundTripParam{"TimestampTzMicros", "2026-01-01T00:00:01.000001+00:00", - 1767225601000001L, ParseRoundTripParam::kTimestampTz}), - [](const ::testing::TestParamInfo& info) { - return info.param.name; - }); - -INSTANTIATE_TEST_SUITE_P( - TransformUtilTest, ParseOnlyTest, - ::testing::Values( - // TimestampTz with "Z" suffix - ParseOnlyParam{"TimestampTzSuffixZ_Epoch", "1970-01-01T00:00:00Z", 0, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzSuffixZ_Millis", "2026-01-01T00:00:01.500Z", - 1767225601500000L, ParseOnlyParam::kTimestampTz}, - // TimestampTz with "-00:00" suffix - ParseOnlyParam{"TimestampTzNegZero_Epoch", "1970-01-01T00:00:00-00:00", 0, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNegZero_Millis", "2026-01-01T00:00:01.500-00:00", - 1767225601500000L, ParseOnlyParam::kTimestampTz}, - // Fractional micros truncates nanos - ParseOnlyParam{"TimeTruncatesNanos", "00:00:01.123456789", 1123456, - ParseOnlyParam::kTime}, - // Fractional seconds (trimmed trailing zeros) - ParseOnlyParam{"1Digit", "00:00:01.5", 1500000, ParseOnlyParam::kTime}, - ParseOnlyParam{"2Digits", "00:00:01.50", 1500000, ParseOnlyParam::kTime}, - ParseOnlyParam{"2DigitsNonZero", "00:00:01.12", 1120000, ParseOnlyParam::kTime}, - ParseOnlyParam{"4Digits", "00:00:01.0001", 1000100, ParseOnlyParam::kTime}, - // Timestamp without seconds - ParseOnlyParam{"TimestampNoSec_Zero", "1970-01-01T00:00", 0, - ParseOnlyParam::kTimestamp}, - ParseOnlyParam{"TimestampNoSec_OneMin", "1970-01-01T00:01", 60000000, - ParseOnlyParam::kTimestamp}, - // TimestampTz without seconds - ParseOnlyParam{"TimestampTzNoSec_Offset", "1970-01-01T00:00+00:00", 0, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNoSec_OneMin", "1970-01-01T00:01+00:00", 60000000, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNoSec_Z", "1970-01-01T00:00Z", 0, - ParseOnlyParam::kTimestampTz}, - // Extended year with '+' prefix - ParseOnlyParam{"ExtendedYearPlusEpoch", "+1970-01-01", 0, ParseOnlyParam::kDay}, - ParseOnlyParam{"ExtendedYearPlus2026", "+2026-01-01", 20454, - ParseOnlyParam::kDay}, - ParseOnlyParam{"ExtendedYearMinus2026", "-2026-01-01", -1459509, - ParseOnlyParam::kDay}, - // Non-UTC timezone offsets - ParseOnlyParam{"TimestampTzPositiveOffset", "1970-01-01T05:00:00+05:00", 0, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNegativeOffset", "1970-01-01T00:00:00-05:00", - 18000000000, ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzOffsetWithMillis", "2026-01-01T05:30:01.500+05:30", - 1767225601500000L, ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNegOffsetToEpoch", "1969-12-31T19:00:00-05:00", 0, - ParseOnlyParam::kTimestampTz}, - ParseOnlyParam{"TimestampTzNoSecWithOffset", "1970-01-01T05:30+05:30", 0, - ParseOnlyParam::kTimestampTz}), - [](const ::testing::TestParamInfo& info) { return info.param.name; }); - -INSTANTIATE_TEST_SUITE_P( - TransformUtilTest, ParseTimeErrorTest, - ::testing::Values(ParseTimeErrorParam{"EmptyString", ""}, - ParseTimeErrorParam{"TooShort1Char", "1"}, - ParseTimeErrorParam{"TooShort2Chars", "12"}, - ParseTimeErrorParam{"TooShort4Chars", "12:3"}, - ParseTimeErrorParam{"MissingColon", "1200:00"}, - ParseTimeErrorParam{"OutofRangeHours", "24:00:00"}, - ParseTimeErrorParam{"OutofRangeMinutes", "12:60:00"}, - ParseTimeErrorParam{"OutofRangeSeconds", "12:30:61"}, - ParseTimeErrorParam{"SpaceInsteadOfColon", "12 30"}), - [](const ::testing::TestParamInfo& info) { - return info.param.name; - }); - } // namespace iceberg diff --git a/src/iceberg/transform.cc b/src/iceberg/transform.cc index 8a7d4b3e1..c019c7ead 100644 --- a/src/iceberg/transform.cc +++ b/src/iceberg/transform.cc @@ -32,6 +32,7 @@ #include "iceberg/util/macros.h" #include "iceberg/util/projection_util_internal.h" #include "iceberg/util/string_util.h" +#include "iceberg/util/temporal_util.h" #include "iceberg/util/transform_util.h" namespace iceberg { diff --git a/src/iceberg/util/math_util_internal.h b/src/iceberg/util/math_util_internal.h new file mode 100644 index 000000000..20d8ef898 --- /dev/null +++ b/src/iceberg/util/math_util_internal.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/result.h" +#include "iceberg/util/int128.h" + +namespace iceberg { + +inline constexpr int64_t FloorDiv(int64_t dividend, int64_t divisor) { + const auto quotient = dividend / divisor; + if ((dividend ^ divisor) < 0 && quotient * divisor != dividend) { + return quotient - 1; + } + return quotient; +} + +inline Result MultiplyExact(int64_t lhs, int64_t rhs) { + const auto result = static_cast(lhs) * static_cast(rhs); + if (result > std::numeric_limits::max() || + result < std::numeric_limits::min()) [[unlikely]] { + return InvalidArgument("Long overflow when multiplying {} by {}", lhs, rhs); + } + return static_cast(result); +} + +} // namespace iceberg diff --git a/src/iceberg/util/temporal_util.cc b/src/iceberg/util/temporal_util.cc index b91fcec77..e00ee7cf5 100644 --- a/src/iceberg/util/temporal_util.cc +++ b/src/iceberg/util/temporal_util.cc @@ -26,6 +26,9 @@ #include "iceberg/expression/literal.h" #include "iceberg/util/int128.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/math_util_internal.h" +#include "iceberg/util/string_util.h" namespace iceberg { @@ -33,30 +36,136 @@ namespace { using namespace std::chrono; // NOLINT -constexpr int64_t kNanosPerMicro = 1000; +/// Parse a timezone offset of the form "+HH:mm" or "-HH:mm" and return the +/// offset in microseconds (positive for east of UTC, negative for west). +Result ParseTimezoneOffset(std::string_view offset) { + if (offset.size() != 6 || (offset[0] != '+' && offset[0] != '-') || offset[3] != ':') { + return InvalidArgument("Invalid timezone offset: '{}'", offset); + } + bool negative = offset[0] == '-'; + ICEBERG_ASSIGN_OR_RAISE(auto hours, + StringUtils::ParseNumber(offset.substr(1, 2))); + ICEBERG_ASSIGN_OR_RAISE(auto minutes, + StringUtils::ParseNumber(offset.substr(4, 2))); + if (hours > 18 || minutes > 59) [[unlikely]] { + return InvalidArgument("Invalid timezone offset: '{}'", offset); + } + + if (hours == 18 && minutes != 0) [[unlikely]] { + return InvalidArgument("Timezone offset '{}' not in range [-18:00, +18:00]", offset); + } -constexpr auto kEpochYmd = year{1970} / January / 1; -constexpr auto kEpochDays = sys_days(kEpochYmd); + auto micros = hours * internal::kSecondsPerHour * internal::kMicrosPerSecond + + minutes * internal::kSecondsPerMinute * internal::kMicrosPerSecond; + return negative ? -micros : micros; +} + +Result> ParseTimestampWithZoneSuffix( + std::string_view str) { + if (str.empty()) [[unlikely]] { + return InvalidArgument("Invalid timestamptz string: '{}'", str); + } -inline constexpr int64_t FloorDiv(int64_t dividend, int64_t divisor) { - const auto quotient = dividend / divisor; - if ((dividend ^ divisor) < 0 && quotient * divisor != dividend) { - return quotient - 1; + int64_t offset_micros = 0; + std::string_view timestamp_part; + + if (str.back() == 'Z') { + timestamp_part = str.substr(0, str.size() - 1); + } else if (str.size() >= 6 && + (str[str.size() - 6] == '+' || str[str.size() - 6] == '-')) { + ICEBERG_ASSIGN_OR_RAISE(offset_micros, + ParseTimezoneOffset(str.substr(str.size() - 6))); + timestamp_part = str.substr(0, str.size() - 6); + } else { + return InvalidArgument("Invalid timestamptz string (missing timezone suffix): '{}'", + str); } - return quotient; + + return std::make_pair(timestamp_part, offset_micros); } -Result MultiplyExact(int64_t lhs, int64_t rhs) { - const auto result = static_cast(lhs) * static_cast(rhs); - if (result > std::numeric_limits::max() || - result < std::numeric_limits::min()) [[unlikely]] { - return InvalidArgument("Long overflow when multiplying {} by {}", lhs, rhs); +Result TimestampFromDayTime(int32_t days, int64_t time_units, + int64_t units_per_day, int64_t offset_micros, + int64_t units_per_micro) { + const auto offset_units = + static_cast(offset_micros) * static_cast(units_per_micro); + const auto timestamp = + static_cast(days) * static_cast(units_per_day) + + static_cast(time_units) - offset_units; + + if (timestamp > std::numeric_limits::max() || + timestamp < std::numeric_limits::min()) [[unlikely]] { + return InvalidArgument("Timestamp value is out of int64 range"); } - return static_cast(result); + + return static_cast(timestamp); +} + +/// Parse fractional seconds (after '.') and return micros. +/// Digits beyond 6 are truncated. +Result ParseFractionalMicros(std::string_view frac) { + if (frac.empty() || frac.size() > 9) [[unlikely]] { + return InvalidArgument("Invalid fractional seconds: '{}'", frac); + } + if (frac.size() > 6) frac = frac.substr(0, 6); + ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); + for (size_t i = frac.size(); i < 6; ++i) { + val *= 10; + } + return static_cast(val); +} + +/// Parse fractional seconds (after '.') and return nanos. +Result ParseFractionalNanos(std::string_view frac) { + if (frac.empty() || frac.size() > 9) [[unlikely]] { + return InvalidArgument("Invalid fractional seconds: '{}'", frac); + } + ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); + for (size_t i = frac.size(); i < 9; ++i) { + val *= 10; + } + return static_cast(val); +} + +template +Result ParseTimeWithFraction(std::string_view str, int64_t units_per_second, + TimeScaleParser&& parse_fraction) { + if (str.size() < 5 || str[2] != ':') [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + + ICEBERG_ASSIGN_OR_RAISE(auto hours, + StringUtils::ParseNumber(str.substr(0, 2))); + ICEBERG_ASSIGN_OR_RAISE(auto minutes, + StringUtils::ParseNumber(str.substr(3, 2))); + int64_t seconds = 0; + + int64_t frac_units = 0; + if (str.size() > 5) { + if (str[5] != ':' || str.size() < 8) [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + ICEBERG_ASSIGN_OR_RAISE(seconds, StringUtils::ParseNumber(str.substr(6, 2))); + if (str.size() > 8) { + if (str[8] != '.') [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + ICEBERG_ASSIGN_OR_RAISE(frac_units, parse_fraction(str.substr(9))); + } + } + + if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || + seconds > 59) [[unlikely]] { + return InvalidArgument("Invalid time string: '{}'", str); + } + + return hours * internal::kSecondsPerHour * units_per_second + + minutes * internal::kSecondsPerMinute * units_per_second + + seconds * units_per_second + frac_units; } inline constexpr year_month_day DateToYmd(int32_t days_since_epoch) { - return {kEpochDays + days{days_since_epoch}}; + return {internal::kEpochDays + days{days_since_epoch}}; } inline constexpr year_month_day TimestampToYmd(int64_t micros_since_epoch) { @@ -86,7 +195,7 @@ inline constexpr int32_t TimestampNsToDuration(int64_t nanos_since_epoch) { } inline constexpr int32_t MonthsSinceEpoch(const year_month_day& ymd) { - auto delta = ymd.year() - kEpochYmd.year(); + auto delta = ymd.year() - internal::kEpochYmd.year(); // Calculate the month as months from 1970-01 // Note: January is month 1, so we subtract 1 to get zero-based month count. return static_cast(delta.count() * 12 + static_cast(ymd.month()) - @@ -102,21 +211,21 @@ template <> Result ExtractYearImpl(const Literal& literal) { auto value = std::get(literal.value()); auto ymd = DateToYmd(value); - return Literal::Int((ymd.year() - kEpochYmd.year()).count()); + return Literal::Int((ymd.year() - internal::kEpochYmd.year()).count()); } template <> Result ExtractYearImpl(const Literal& literal) { auto value = std::get(literal.value()); auto ymd = TimestampToYmd(value); - return Literal::Int((ymd.year() - kEpochYmd.year()).count()); + return Literal::Int((ymd.year() - internal::kEpochYmd.year()).count()); } template <> Result ExtractYearImpl(const Literal& literal) { auto value = std::get(literal.value()); auto ymd = TimestampNsToYmd(value); - return Literal::Int((ymd.year() - kEpochYmd.year()).count()); + return Literal::Int((ymd.year() - internal::kEpochYmd.year()).count()); } template <> @@ -227,11 +336,112 @@ Result ExtractHourImpl(const Literal& literal) } // namespace int64_t TemporalUtils::NanosToMicros(int64_t nanos) { - return FloorDiv(nanos, kNanosPerMicro); + return FloorDiv(nanos, internal::kNanosPerMicro); } Result TemporalUtils::MicrosToNanos(int64_t micros) { - return MultiplyExact(micros, kNanosPerMicro); + return MultiplyExact(micros, internal::kNanosPerMicro); +} + +Result TemporalUtils::ParseDay(std::string_view str) { + auto dash1 = str.find('-', (!str.empty() && (str[0] == '-' || str[0] == '+')) ? 1 : 0); + auto dash2 = str.find('-', dash1 + 1); + if (str.size() < 10 || dash1 == std::string_view::npos || + dash2 == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid date string: '{}'", str); + } + auto year_str = str.substr(0, dash1); + if (!year_str.empty() && year_str[0] == '+') { + year_str = year_str.substr(1); + } + ICEBERG_ASSIGN_OR_RAISE(auto year_value, StringUtils::ParseNumber(year_str)); + ICEBERG_ASSIGN_OR_RAISE(auto month_value, StringUtils::ParseNumber(str.substr( + dash1 + 1, dash2 - dash1 - 1))); + ICEBERG_ASSIGN_OR_RAISE(auto day_value, + StringUtils::ParseNumber(str.substr(dash2 + 1))); + + auto ymd = std::chrono::year{year_value} / + std::chrono::month{static_cast(month_value)} / + std::chrono::day{static_cast(day_value)}; + if (!ymd.ok()) [[unlikely]] { + return InvalidArgument("Invalid date: '{}'", str); + } + + auto days_since_epoch = std::chrono::sys_days{ymd} - internal::kEpochDays; + return static_cast(days_since_epoch.count()); +} + +Result TemporalUtils::ParseTime(std::string_view str) { + return ParseTimeWithFraction(str, internal::kMicrosPerSecond, ParseFractionalMicros); +} + +Result TemporalUtils::ParseTimeNs(std::string_view str) { + return ParseTimeWithFraction(str, internal::kNanosPerSecond, ParseFractionalNanos); +} + +Result TemporalUtils::ParseTimestamp(std::string_view str) { + auto t_pos = str.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); + } + + ICEBERG_ASSIGN_OR_RAISE(auto days_since_epoch, ParseDay(str.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(str.substr(t_pos + 1))); + + return TimestampFromDayTime(days_since_epoch, time_micros, internal::kMicrosPerDay, + /*offset_micros=*/0, /*units_per_micro=*/1); +} + +Result TemporalUtils::ParseTimestampNs(std::string_view str) { + auto t_pos = str.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); + } + + ICEBERG_ASSIGN_OR_RAISE(auto days_since_epoch, ParseDay(str.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(str.substr(t_pos + 1))); + + return TimestampFromDayTime(days_since_epoch, time_nanos, internal::kNanosPerDay, + /*offset_micros=*/0, + /*units_per_micro=*/internal::kNanosPerMicro); +} + +Result TemporalUtils::ParseTimestampWithZone(std::string_view str) { + ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); + const auto [timestamp_part, offset_micros] = timestamp_with_offset; + + auto t_pos = timestamp_part.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", + timestamp_part); + } + + ICEBERG_ASSIGN_OR_RAISE(auto days_since_epoch, + ParseDay(timestamp_part.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(timestamp_part.substr(t_pos + 1))); + + return TimestampFromDayTime(days_since_epoch, time_micros, internal::kMicrosPerDay, + offset_micros, + /*units_per_micro=*/1); +} + +Result TemporalUtils::ParseTimestampNsWithZone(std::string_view str) { + ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); + const auto [timestamp_part, offset_micros] = timestamp_with_offset; + + auto t_pos = timestamp_part.find('T'); + if (t_pos == std::string_view::npos) [[unlikely]] { + return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", + timestamp_part); + } + + ICEBERG_ASSIGN_OR_RAISE(auto days_since_epoch, + ParseDay(timestamp_part.substr(0, t_pos))); + ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(timestamp_part.substr(t_pos + 1))); + + return TimestampFromDayTime(days_since_epoch, time_nanos, internal::kNanosPerDay, + offset_micros, + /*units_per_micro=*/internal::kNanosPerMicro); } #define DISPATCH_EXTRACT_YEAR(type_id) \ diff --git a/src/iceberg/util/temporal_util.h b/src/iceberg/util/temporal_util.h index 414e4fd20..2121f565d 100644 --- a/src/iceberg/util/temporal_util.h +++ b/src/iceberg/util/temporal_util.h @@ -19,12 +19,34 @@ #pragma once +#include #include +#include #include "iceberg/iceberg_export.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" +namespace iceberg::internal { + +inline constexpr int64_t kNanosPerMicro = 1000; +inline constexpr int64_t kMicrosPerMilli = 1000; +inline constexpr int64_t kMicrosPerSecond = 1000 * kMicrosPerMilli; +inline constexpr int64_t kSecondsPerMinute = 60; +inline constexpr int64_t kMinutesPerHour = 60; +inline constexpr int64_t kHoursPerDay = 24; +inline constexpr int64_t kSecondsPerHour = kMinutesPerHour * kSecondsPerMinute; +inline constexpr int64_t kSecondsPerDay = kHoursPerDay * kSecondsPerHour; +inline constexpr int64_t kMicrosPerDay = kSecondsPerDay * kMicrosPerSecond; +inline constexpr int64_t kNanosPerMilli = kMicrosPerMilli * kNanosPerMicro; +inline constexpr int64_t kNanosPerSecond = kMicrosPerSecond * kNanosPerMicro; +inline constexpr int64_t kNanosPerDay = kMicrosPerDay * kNanosPerMicro; + +inline constexpr auto kEpochYmd = std::chrono::year{1970} / std::chrono::January / 1; +inline constexpr auto kEpochDays = std::chrono::sys_days{kEpochYmd}; + +} // namespace iceberg::internal + namespace iceberg { class ICEBERG_EXPORT TemporalUtils { @@ -35,6 +57,74 @@ class ICEBERG_EXPORT TemporalUtils { /// \brief Convert microseconds since epoch to nanoseconds, failing on overflow. static Result MicrosToNanos(int64_t micros); + /// \brief Parses a date string in "[+-]yyyy-MM-dd" format into days since epoch. + /// + /// Supports an optional '+' or '-' prefix for extended years beyond 9999. + /// + /// \param str The date string to parse. + /// \return The number of days since 1970-01-01, or an error. + static Result ParseDay(std::string_view str); + + /// \brief Parses a time string into microseconds from midnight. + /// + /// Accepts ISO-8601 local time formats: "HH:mm", "HH:mm:ss", or + /// "HH:mm:ss.f" where the fractional part can be 1-9 digits. + /// Digits beyond 6 (microsecond precision) are truncated. + /// + /// \param str The time string to parse. + /// \return The number of microseconds from midnight, or an error. + static Result ParseTime(std::string_view str); + + /// \brief Parses a time string into nanoseconds from midnight. + /// + /// Accepts ISO-8601 local time formats: "HH:mm", "HH:mm:ss", or + /// "HH:mm:ss.f" where the fractional part can be 1-9 digits. + /// Digits beyond 9 (nanosecond precision) are truncated. + /// + /// \param str The time string to parse. + /// \return The number of nanoseconds from midnight, or an error. + static Result ParseTimeNs(std::string_view str); + + /// \brief Parses a timestamp string into microseconds since epoch. + /// + /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", + /// "yyyy-MM-ddTHH:mm:ss", or "yyyy-MM-ddTHH:mm:ss.f" where the + /// fractional part can be 1-9 digits (truncated to microseconds). + /// + /// \param str The timestamp string to parse. + /// \return The number of microseconds since epoch, or an error. + static Result ParseTimestamp(std::string_view str); + + /// \brief Parses a timestamp string into nanoseconds since epoch. + /// + /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", + /// "yyyy-MM-ddTHH:mm:ss", or "yyyy-MM-ddTHH:mm:ss.f" where the + /// fractional part can be 1-9 digits. + /// + /// \param str The timestamp string to parse. + /// \return The number of nanoseconds since epoch, or an error. + static Result ParseTimestampNs(std::string_view str); + + /// \brief Parses a timestamp-with-zone string into microseconds since epoch (UTC). + /// + /// Accepts the same formats as ParseTimestamp, with a timezone suffix: + /// "Z", "+HH:mm", or "-HH:mm". Non-UTC offsets are converted to UTC. + /// The seconds and fractional parts are optional (e.g. "yyyy-MM-ddTHH:mm+00:00"). + /// + /// \param str The timestamp string to parse. + /// \return The number of microseconds since epoch (UTC), or an error. + static Result ParseTimestampWithZone(std::string_view str); + + /// \brief Parses a timestamp-with-zone string into nanoseconds since epoch (UTC). + /// + /// Accepts the same formats as ParseTimestampNs, with a timezone suffix: + /// "Z", "+HH:mm", or "-HH:mm". Non-UTC offsets are converted to UTC. + /// The seconds and fractional parts are optional (e.g. "yyyy-MM-ddTHH:mm+00:00"). + /// + /// \param str The timestamp string to parse. + /// \return The number of nanoseconds since epoch (UTC), or an error. + static Result ParseTimestampNsWithZone(std::string_view str); + /// \brief Extract a date or timestamp year, as years from 1970 static Result ExtractYear(const Literal& literal); diff --git a/src/iceberg/util/transform_util.cc b/src/iceberg/util/transform_util.cc index fc1b104e5..d12449382 100644 --- a/src/iceberg/util/transform_util.cc +++ b/src/iceberg/util/transform_util.cc @@ -21,166 +21,24 @@ #include #include -#include +#include -#include "iceberg/util/int128.h" -#include "iceberg/util/macros.h" -#include "iceberg/util/string_util.h" +#include "iceberg/util/temporal_util.h" namespace iceberg { -namespace { -constexpr auto kEpochDate = std::chrono::year{1970} / std::chrono::January / 1; -constexpr int64_t kMicrosPerMillis = 1'000; -constexpr int64_t kMicrosPerSecond = 1'000'000; -constexpr int64_t kMicrosPerDay = 86'400'000'000LL; -constexpr int64_t kNanosPerMillis = 1'000'000; -constexpr int64_t kNanosPerSecond = 1'000'000'000; -constexpr int64_t kNanosPerDay = 86'400'000'000'000LL; - -/// Parse a timezone offset of the form "+HH:mm" or "-HH:mm" and return the -/// offset in microseconds (positive for east of UTC, negative for west). -Result ParseTimezoneOffset(std::string_view offset) { - if (offset.size() != 6 || (offset[0] != '+' && offset[0] != '-') || offset[3] != ':') { - return InvalidArgument("Invalid timezone offset: '{}'", offset); - } - bool negative = offset[0] == '-'; - ICEBERG_ASSIGN_OR_RAISE(auto hours, - StringUtils::ParseNumber(offset.substr(1, 2))); - ICEBERG_ASSIGN_OR_RAISE(auto minutes, - StringUtils::ParseNumber(offset.substr(4, 2))); - if (hours > 18 || minutes > 59) [[unlikely]] { - return InvalidArgument("Invalid timezone offset: '{}'", offset); - } - - if (hours == 18 && minutes != 0) [[unlikely]] { - return InvalidArgument("Timezone offset '{}' not in range [-18:00, +18:00]", offset); - } - - auto micros = hours * 3'600 * kMicrosPerSecond + minutes * 60 * kMicrosPerSecond; - return negative ? -micros : micros; -} - -Result> ParseTimestampWithZoneSuffix( - std::string_view str) { - if (str.empty()) [[unlikely]] { - return InvalidArgument("Invalid timestamptz string: '{}'", str); - } - - int64_t offset_micros = 0; - std::string_view timestamp_part; - - if (str.back() == 'Z') { - timestamp_part = str.substr(0, str.size() - 1); - } else if (str.size() >= 6 && - (str[str.size() - 6] == '+' || str[str.size() - 6] == '-')) { - // Parse "+HH:mm" or "-HH:mm" offset suffix - ICEBERG_ASSIGN_OR_RAISE(offset_micros, - ParseTimezoneOffset(str.substr(str.size() - 6))); - timestamp_part = str.substr(0, str.size() - 6); - } else { - return InvalidArgument("Invalid timestamptz string (missing timezone suffix): '{}'", - str); - } - - return std::make_pair(timestamp_part, offset_micros); -} - -Result TimestampFromDayTime(int32_t days, int64_t time_units, - int64_t units_per_day, int64_t offset_micros, - int64_t units_per_micro) { - const auto offset_units = - static_cast(offset_micros) * static_cast(units_per_micro); - const auto timestamp = - static_cast(days) * static_cast(units_per_day) + - static_cast(time_units) - offset_units; - - if (timestamp > std::numeric_limits::max() || - timestamp < std::numeric_limits::min()) [[unlikely]] { - return InvalidArgument("Timestamp value is out of int64 range"); - } - - return static_cast(timestamp); -} - -/// Parse fractional seconds (after '.') and return micros. -/// Digits beyond 6 are truncated (nanosecond precision). -Result ParseFractionalMicros(std::string_view frac) { - if (frac.empty() || frac.size() > 9) [[unlikely]] { - return InvalidArgument("Invalid fractional seconds: '{}'", frac); - } - // Truncate to microsecond precision (6 digits), matching Java ISO_LOCAL_TIME behavior - if (frac.size() > 6) frac = frac.substr(0, 6); - ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); - // Right-pad to 6 digits: "500" -> 500000, "001" -> 1000, "000001" -> 1000 - for (size_t i = frac.size(); i < 6; ++i) { - val *= 10; - } - return static_cast(val); -} - -/// Parse fractional seconds (after '.') and return nanos. -Result ParseFractionalNanos(std::string_view frac) { - if (frac.empty() || frac.size() > 9) [[unlikely]] { - return InvalidArgument("Invalid fractional seconds: '{}'", frac); - } - ICEBERG_ASSIGN_OR_RAISE(auto val, StringUtils::ParseNumber(frac)); - // Right-pad to 9 digits: "500" -> 500000000, "001" -> 1000000, "000001" -> 1000 - for (size_t i = frac.size(); i < 9; ++i) { - val *= 10; - } - return static_cast(val); -} - -template -Result ParseTimeWithFraction(std::string_view str, int64_t units_per_second, - TimeScaleParser&& parse_fraction) { - if (str.size() < 5 || str[2] != ':') [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - - ICEBERG_ASSIGN_OR_RAISE(auto hours, - StringUtils::ParseNumber(str.substr(0, 2))); - ICEBERG_ASSIGN_OR_RAISE(auto minutes, - StringUtils::ParseNumber(str.substr(3, 2))); - int64_t seconds = 0; - - int64_t frac_units = 0; - if (str.size() > 5) { - if (str[5] != ':' || str.size() < 8) [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - ICEBERG_ASSIGN_OR_RAISE(seconds, StringUtils::ParseNumber(str.substr(6, 2))); - if (str.size() > 8) { - if (str[8] != '.') [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - ICEBERG_ASSIGN_OR_RAISE(frac_units, parse_fraction(str.substr(9))); - } - } - - if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || - seconds > 59) [[unlikely]] { - return InvalidArgument("Invalid time string: '{}'", str); - } - - return hours * 3'600 * units_per_second + minutes * 60 * units_per_second + - seconds * units_per_second + frac_units; -} -} // namespace - std::string TransformUtil::HumanYear(int32_t year_ordinal) { - auto y = kEpochDate + std::chrono::years{year_ordinal}; + auto y = internal::kEpochYmd + std::chrono::years{year_ordinal}; return std::format("{:%Y}", y); } std::string TransformUtil::HumanMonth(int32_t month_ordinal) { - auto ym = kEpochDate + std::chrono::months(month_ordinal); + auto ym = internal::kEpochYmd + std::chrono::months(month_ordinal); return std::format("{:%Y-%m}", ym); } std::string TransformUtil::HumanDay(int32_t day_ordinal) { - auto ymd = std::chrono::sys_days{kEpochDate} + std::chrono::days{day_ordinal}; + auto ymd = internal::kEpochDays + std::chrono::days{day_ordinal}; return std::format("{:%F}", ymd); } @@ -192,14 +50,14 @@ std::string TransformUtil::HumanHour(int32_t hour_ordinal) { std::string TransformUtil::HumanTime(int64_t micros_from_midnight) { std::chrono::hh_mm_ss hms{ - std::chrono::seconds{micros_from_midnight / kMicrosPerSecond}}; - auto micros = micros_from_midnight % kMicrosPerSecond; + std::chrono::seconds{micros_from_midnight / internal::kMicrosPerSecond}}; + auto micros = micros_from_midnight % internal::kMicrosPerSecond; if (micros == 0 && hms.seconds().count() == 0) { return std::format("{:%R}", hms); } else if (micros == 0) { return std::format("{:%T}", hms); - } else if (micros % kMicrosPerMillis == 0) { - return std::format("{:%T}.{:03d}", hms, micros / kMicrosPerMillis); + } else if (micros % internal::kMicrosPerMilli == 0) { + return std::format("{:%T}.{:03d}", hms, micros / internal::kMicrosPerMilli); } else { return std::format("{:%T}.{:06d}", hms, micros); } @@ -216,8 +74,8 @@ std::string TransformUtil::HumanTimestamp(int64_t timestamp_micros) { .count(); if (micros == 0) { return std::format("{:%FT%T}", tp); - } else if (micros % kMicrosPerMillis == 0) { - return std::format("{:%FT%T}.{:03d}", tp, micros / kMicrosPerMillis); + } else if (micros % internal::kMicrosPerMilli == 0) { + return std::format("{:%FT%T}.{:03d}", tp, micros / internal::kMicrosPerMilli); } else { return std::format("{:%FT%T}.{:06d}", tp, micros); } @@ -234,10 +92,10 @@ std::string TransformUtil::HumanTimestampNs(int64_t timestamp_nanos) { .count(); if (nanos == 0) { return std::format("{:%FT%T}", tp); - } else if (nanos % kNanosPerMillis == 0) { - return std::format("{:%FT%T}.{:03d}", tp, nanos / kNanosPerMillis); - } else if (nanos % kMicrosPerMillis == 0) { - return std::format("{:%FT%T}.{:06d}", tp, nanos / kMicrosPerMillis); + } else if (nanos % internal::kNanosPerMilli == 0) { + return std::format("{:%FT%T}.{:03d}", tp, nanos / internal::kNanosPerMilli); + } else if (nanos % internal::kNanosPerMicro == 0) { + return std::format("{:%FT%T}.{:06d}", tp, nanos / internal::kNanosPerMicro); } else { return std::format("{:%FT%T}.{:09d}", tp, nanos); } @@ -254,8 +112,8 @@ std::string TransformUtil::HumanTimestampWithZone(int64_t timestamp_micros) { .count(); if (micros == 0) { return std::format("{:%FT%T}+00:00", tp); - } else if (micros % kMicrosPerMillis == 0) { - return std::format("{:%FT%T}.{:03d}+00:00", tp, micros / kMicrosPerMillis); + } else if (micros % internal::kMicrosPerMilli == 0) { + return std::format("{:%FT%T}.{:03d}+00:00", tp, micros / internal::kMicrosPerMilli); } else { return std::format("{:%FT%T}.{:06d}+00:00", tp, micros); } @@ -272,113 +130,15 @@ std::string TransformUtil::HumanTimestampNsWithZone(int64_t timestamp_nanos) { .count(); if (nanos == 0) { return std::format("{:%FT%T}+00:00", tp); - } else if (nanos % kNanosPerMillis == 0) { - return std::format("{:%FT%T}.{:03d}+00:00", tp, nanos / kNanosPerMillis); - } else if (nanos % kMicrosPerMillis == 0) { - return std::format("{:%FT%T}.{:06d}+00:00", tp, nanos / kMicrosPerMillis); + } else if (nanos % internal::kNanosPerMilli == 0) { + return std::format("{:%FT%T}.{:03d}+00:00", tp, nanos / internal::kNanosPerMilli); + } else if (nanos % internal::kNanosPerMicro == 0) { + return std::format("{:%FT%T}.{:06d}+00:00", tp, nanos / internal::kNanosPerMicro); } else { return std::format("{:%FT%T}.{:09d}+00:00", tp, nanos); } } -Result TransformUtil::ParseDay(std::string_view str) { - // Expected format: "[+-]yyyy-MM-dd" - // Parse year, month, day manually, skipping leading '+' or '-' to find first date dash - auto dash1 = str.find('-', (!str.empty() && (str[0] == '-' || str[0] == '+')) ? 1 : 0); - auto dash2 = str.find('-', dash1 + 1); - if (str.size() < 10 || dash1 == std::string_view::npos || - dash2 == std::string_view::npos) [[unlikely]] { - return InvalidArgument("Invalid date string: '{}'", str); - } - auto year_str = str.substr(0, dash1); - // std::from_chars does not accept '+' prefix, strip it for positive extended years - if (!year_str.empty() && year_str[0] == '+') { - year_str = year_str.substr(1); - } - ICEBERG_ASSIGN_OR_RAISE(auto year, StringUtils::ParseNumber(year_str)); - ICEBERG_ASSIGN_OR_RAISE(auto month, StringUtils::ParseNumber( - str.substr(dash1 + 1, dash2 - dash1 - 1))); - ICEBERG_ASSIGN_OR_RAISE(auto day, - StringUtils::ParseNumber(str.substr(dash2 + 1))); - - auto ymd = std::chrono::year{year} / std::chrono::month{static_cast(month)} / - std::chrono::day{static_cast(day)}; - if (!ymd.ok()) [[unlikely]] { - return InvalidArgument("Invalid date: '{}'", str); - } - - auto days = std::chrono::sys_days{ymd} - std::chrono::sys_days{kEpochDate}; - return static_cast(days.count()); -} - -Result TransformUtil::ParseTime(std::string_view str) { - return ParseTimeWithFraction(str, kMicrosPerSecond, ParseFractionalMicros); -} - -Result TransformUtil::ParseTimeNs(std::string_view str) { - return ParseTimeWithFraction(str, kNanosPerSecond, ParseFractionalNanos); -} - -Result TransformUtil::ParseTimestamp(std::string_view str) { - auto t_pos = str.find('T'); - if (t_pos == std::string_view::npos) [[unlikely]] { - return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); - } - - ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(str.substr(0, t_pos))); - ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(str.substr(t_pos + 1))); - - return TimestampFromDayTime(days, time_micros, kMicrosPerDay, /*offset_micros=*/0, - /*units_per_micro=*/1); -} - -Result TransformUtil::ParseTimestampNs(std::string_view str) { - auto t_pos = str.find('T'); - if (t_pos == std::string_view::npos) [[unlikely]] { - return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", str); - } - - ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(str.substr(0, t_pos))); - ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(str.substr(t_pos + 1))); - - return TimestampFromDayTime(days, time_nanos, kNanosPerDay, /*offset_micros=*/0, - /*units_per_micro=*/1'000); -} - -Result TransformUtil::ParseTimestampWithZone(std::string_view str) { - ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); - const auto [timestamp_part, offset_micros] = timestamp_with_offset; - - auto t_pos = timestamp_part.find('T'); - if (t_pos == std::string_view::npos) [[unlikely]] { - return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", - timestamp_part); - } - - ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(timestamp_part.substr(0, t_pos))); - ICEBERG_ASSIGN_OR_RAISE(auto time_micros, ParseTime(timestamp_part.substr(t_pos + 1))); - - return TimestampFromDayTime(days, time_micros, kMicrosPerDay, offset_micros, - /*units_per_micro=*/1); -} - -Result TransformUtil::ParseTimestampNsWithZone(std::string_view str) { - ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); - const auto [timestamp_part, offset_micros] = timestamp_with_offset; - - auto t_pos = timestamp_part.find('T'); - if (t_pos == std::string_view::npos) [[unlikely]] { - return InvalidArgument("Invalid timestamp string (missing 'T'): '{}'", - timestamp_part); - } - - ICEBERG_ASSIGN_OR_RAISE(auto days, ParseDay(timestamp_part.substr(0, t_pos))); - ICEBERG_ASSIGN_OR_RAISE(auto time_nanos, ParseTimeNs(timestamp_part.substr(t_pos + 1))); - - return TimestampFromDayTime(days, time_nanos, kNanosPerDay, offset_micros, - /*units_per_micro=*/1'000); -} - std::string TransformUtil::Base64Encode(std::string_view str_to_encode) { static constexpr std::string_view kBase64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; diff --git a/src/iceberg/util/transform_util.h b/src/iceberg/util/transform_util.h index b9c692098..2fbcb3e55 100644 --- a/src/iceberg/util/transform_util.h +++ b/src/iceberg/util/transform_util.h @@ -19,11 +19,11 @@ #pragma once +#include #include +#include #include "iceberg/iceberg_export.h" -#include "iceberg/result.h" -#include "iceberg/type_fwd.h" namespace iceberg { @@ -127,74 +127,6 @@ class ICEBERG_EXPORT TransformUtil { /// \return a string representation of this timestamp. static std::string HumanTimestampNsWithZone(int64_t timestamp_nanos); - /// \brief Parses a date string in "[+-]yyyy-MM-dd" format into days since epoch. - /// - /// Supports an optional '+' or '-' prefix for extended years beyond 9999. - /// - /// \param str The date string to parse. - /// \return The number of days since 1970-01-01, or an error. - static Result ParseDay(std::string_view str); - - /// \brief Parses a time string into microseconds from midnight. - /// - /// Accepts ISO-8601 local time formats: "HH:mm", "HH:mm:ss", or - /// "HH:mm:ss.f" where the fractional part can be 1-9 digits. - /// Digits beyond 6 (microsecond precision) are truncated. - /// - /// \param str The time string to parse. - /// \return The number of microseconds from midnight, or an error. - static Result ParseTime(std::string_view str); - - /// \brief Parses a time string into nanoseconds from midnight. - /// - /// Accepts ISO-8601 local time formats: "HH:mm", "HH:mm:ss", or - /// "HH:mm:ss.f" where the fractional part can be 1-9 digits. - /// Digits beyond 9 (nanosecond precision) are truncated. - /// - /// \param str The time string to parse. - /// \return The number of nanoseconds from midnight, or an error. - static Result ParseTimeNs(std::string_view str); - - /// \brief Parses a timestamp string into microseconds since epoch. - /// - /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", - /// "yyyy-MM-ddTHH:mm:ss", or "yyyy-MM-ddTHH:mm:ss.f" where the - /// fractional part can be 1-9 digits (truncated to microseconds). - /// - /// \param str The timestamp string to parse. - /// \return The number of microseconds since epoch, or an error. - static Result ParseTimestamp(std::string_view str); - - /// \brief Parses a timestamp string into nanoseconds since epoch. - /// - /// Accepts ISO-8601 local date-time formats: "yyyy-MM-ddTHH:mm", - /// "yyyy-MM-ddTHH:mm:ss", or "yyyy-MM-ddTHH:mm:ss.f" where the - /// fractional part can be 1-9 digits. - /// - /// \param str The timestamp string to parse. - /// \return The number of nanoseconds since epoch, or an error. - static Result ParseTimestampNs(std::string_view str); - - /// \brief Parses a timestamp-with-zone string into microseconds since epoch (UTC). - /// - /// Accepts the same formats as ParseTimestamp, with a timezone suffix: - /// "Z", "+HH:mm", or "-HH:mm". Non-UTC offsets are converted to UTC. - /// The seconds and fractional parts are optional (e.g. "yyyy-MM-ddTHH:mm+00:00"). - /// - /// \param str The timestamp string to parse. - /// \return The number of microseconds since epoch (UTC), or an error. - static Result ParseTimestampWithZone(std::string_view str); - - /// \brief Parses a timestamp-with-zone string into nanoseconds since epoch (UTC). - /// - /// Accepts the same formats as ParseTimestampNs, with a timezone suffix: - /// "Z", "+HH:mm", or "-HH:mm". Non-UTC offsets are converted to UTC. - /// The seconds and fractional parts are optional (e.g. "yyyy-MM-ddTHH:mm+00:00"). - /// - /// \param str The timestamp string to parse. - /// \return The number of nanoseconds since epoch (UTC), or an error. - static Result ParseTimestampNsWithZone(std::string_view str); - /// \brief Base64 encode a string static std::string Base64Encode(std::string_view str_to_encode); }; From 97ea8708d216a554b550d86510437fb91027cb20 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Tue, 26 May 2026 12:55:45 +0800 Subject: [PATCH 043/151] feat: metrics for parquet writer (#651) --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/file_writer.h | 3 + src/iceberg/metrics.h | 29 + src/iceberg/metrics_config.cc | 22 + src/iceberg/metrics_config.h | 11 + src/iceberg/parquet/parquet_metrics.cc | 370 ++++++++ src/iceberg/parquet/parquet_metrics.h | 64 ++ src/iceberg/parquet/parquet_writer.cc | 40 +- src/iceberg/test/CMakeLists.txt | 2 + src/iceberg/test/metrics_test_base.cc | 1020 ++++++++++++++++++++++ src/iceberg/test/metrics_test_base.h | 138 +++ src/iceberg/test/parquet_metrics_test.cc | 88 ++ src/iceberg/test/truncate_util_test.cc | 10 +- src/iceberg/util/truncate_util.cc | 63 +- src/iceberg/util/truncate_util.h | 43 +- 15 files changed, 1865 insertions(+), 39 deletions(-) create mode 100644 src/iceberg/parquet/parquet_metrics.cc create mode 100644 src/iceberg/parquet/parquet_metrics.h create mode 100644 src/iceberg/test/metrics_test_base.cc create mode 100644 src/iceberg/test/metrics_test_base.h create mode 100644 src/iceberg/test/parquet_metrics_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 2b02b999a..672cf54a8 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -239,6 +239,7 @@ if(ICEBERG_BUILD_BUNDLE) avro/avro_schema_util.cc avro/avro_stream_internal.cc parquet/parquet_data_util.cc + parquet/parquet_metrics.cc parquet/parquet_reader.cc parquet/parquet_register.cc parquet/parquet_schema_util.cc diff --git a/src/iceberg/file_writer.h b/src/iceberg/file_writer.h index a49b5228e..3c890453b 100644 --- a/src/iceberg/file_writer.h +++ b/src/iceberg/file_writer.h @@ -30,6 +30,7 @@ #include "iceberg/arrow_c_data.h" #include "iceberg/file_format.h" #include "iceberg/metrics.h" +#include "iceberg/metrics_config.h" #include "iceberg/result.h" #include "iceberg/type_fwd.h" #include "iceberg/util/config.h" @@ -77,6 +78,8 @@ struct ICEBERG_EXPORT WriterOptions { std::shared_ptr io; /// \brief Metadata to write to the file. std::unordered_map metadata; + /// \brief Metrics configuration. + std::shared_ptr metrics_config = MetricsConfig::Default(); /// \brief Format-specific or implementation-specific properties. WriterProperties properties; }; diff --git a/src/iceberg/metrics.h b/src/iceberg/metrics.h index b476a4759..083cd0410 100644 --- a/src/iceberg/metrics.h +++ b/src/iceberg/metrics.h @@ -30,6 +30,35 @@ namespace iceberg { +/// \brief Field-level metrics for a single column. +/// +/// This structure captures value counts, null counts, NaN counts, and optional +/// lower/upper bounds for a specific field identified by its field_id. +struct ICEBERG_EXPORT FieldMetrics { + /// \brief The field ID this metrics belongs to. + int32_t field_id; + + /// \brief The total number of values (including nulls) for this field. + /// A negative value indicates the count is unknown. + int64_t value_count = -1; + + /// \brief The number of null values for this field. + /// A negative value indicates the count is unknown. + int64_t null_value_count = -1; + + /// \brief The number of NaN values for this field. + /// A negative value indicates the count is unknown. + int64_t nan_value_count = -1; + + /// \brief The lower bound value as a Literal. + /// Empty if no lower bound is available. + std::optional lower_bound = std::nullopt; + + /// \brief The upper bound value as a Literal. + /// Empty if no upper bound is available. + std::optional upper_bound = std::nullopt; +}; + /// \brief Iceberg file format metrics struct ICEBERG_EXPORT Metrics { std::optional row_count; diff --git a/src/iceberg/metrics_config.cc b/src/iceberg/metrics_config.cc index e378640e0..ea20d47e1 100644 --- a/src/iceberg/metrics_config.cc +++ b/src/iceberg/metrics_config.cc @@ -19,6 +19,7 @@ #include "iceberg/metrics_config.h" +#include #include #include @@ -100,6 +101,19 @@ Result MetricsMode::FromString(std::string_view mode) { return InvalidArgument("Invalid metrics mode: {}", mode); } +int32_t MetricsMode::TruncateLength() const { + switch (kind) { + case Kind::kNone: + case Kind::kCounts: + return 0; + case Kind::kTruncate: + return std::get(length); + case Kind::kFull: + return std::numeric_limits::max(); + } + return 0; +} + MetricsConfig::MetricsConfig(ColumnModeMap column_modes, MetricsMode default_mode) : column_modes_(std::move(column_modes)), default_mode_(default_mode) {} @@ -116,6 +130,14 @@ Result> MetricsConfig::Make(const Table& table) { *sort_order.value_or(SortOrder::Unsorted())); } +Result> MetricsConfig::Make( + std::unordered_map properties) { + // Create a minimal TableProperties wrapper for the properties + TableProperties props = TableProperties::FromMap(std::move(properties)); + + return MakeInternal(props, Schema({}), *SortOrder::Unsorted()); +} + Result> MetricsConfig::MakeInternal( const TableProperties& props, const Schema& schema, const SortOrder& order) { ColumnModeMap column_modes; diff --git a/src/iceberg/metrics_config.h b/src/iceberg/metrics_config.h index 7a49e906f..a5e51ee6c 100644 --- a/src/iceberg/metrics_config.h +++ b/src/iceberg/metrics_config.h @@ -52,6 +52,11 @@ struct ICEBERG_EXPORT MetricsMode { Kind kind; std::variant length; + + /// \brief Get the truncate length from this MetricsMode. + /// \return 0 for None/Counts modes, the truncate length for Truncate mode, + /// or INT_MAX for Full mode. + int32_t TruncateLength() const; }; /// \brief Configuration for collecting column metrics for an Iceberg table. @@ -63,6 +68,12 @@ class ICEBERG_EXPORT MetricsConfig { /// \brief Creates a metrics config from a table. static Result> Make(const Table& table); + /// \brief Creates a metrics config from properties (for testing) + /// \param properties Map of property key-value pairs + /// \return A shared pointer to the created MetricsConfig + static Result> Make( + std::unordered_map properties); + /// \brief Get `limit` num of primitive field ids from schema static Result> LimitFieldIds(const Schema& schema, int32_t limit); diff --git a/src/iceberg/parquet/parquet_metrics.cc b/src/iceberg/parquet/parquet_metrics.cc new file mode 100644 index 000000000..09b727a1a --- /dev/null +++ b/src/iceberg/parquet/parquet_metrics.cc @@ -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. + */ + +#include "iceberg/parquet/parquet_metrics.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "iceberg/expression/literal.h" +#include "iceberg/result.h" +#include "iceberg/schema.h" +#include "iceberg/type.h" +#include "iceberg/util/checked_cast.h" +#include "iceberg/util/conversions.h" +#include "iceberg/util/truncate_util.h" +#include "iceberg/util/visit_type.h" + +namespace iceberg::parquet { + +namespace { + +/// \brief Get the Iceberg field ID from a Parquet column descriptor. +/// \return The field ID, or nullopt if no field ID is set. +std::optional GetFieldId(const ::parquet::ColumnDescriptor& column) { + const auto& node = column.schema_node(); + if (node == nullptr || !node->is_primitive()) { + return std::nullopt; + } + if (node->field_id() < 0) { + return std::nullopt; + } + return node->field_id(); +} + +/// \brief Find the column index for a field in the Parquet schema. +std::optional FindColumnIndex(const ::parquet::SchemaDescriptor& parquet_schema, + int32_t field_id) { + auto columns = std::views::iota(0, parquet_schema.num_columns()); + auto it = std::ranges::find_if(columns, [&](int i) { + auto column_field_id = GetFieldId(*parquet_schema.Column(i)); + return column_field_id.has_value() && column_field_id.value() == field_id; + }); + return it != columns.end() ? std::optional(*it) : std::nullopt; +} + +/// \brief Collect counts (value count and null count) from footer statistics. +/// \param field_id The Iceberg field ID. +/// \param metadata The Parquet file metadata. +/// \param column_idx The column index in the Parquet schema. +/// \return A pair of (value_count, null_count), or nullopt if stats are not available. +std::optional CollectCounts(int32_t field_id, + const ::parquet::FileMetaData& metadata, + int32_t column_idx) { + int64_t value_count = 0; + int64_t null_count = 0; + + for (int rg = 0; rg < metadata.num_row_groups(); ++rg) { + auto row_group = metadata.RowGroup(rg); + auto column_chunk = row_group->ColumnChunk(column_idx); + auto stats = column_chunk->statistics(); + if (stats == nullptr || !stats->HasNullCount()) { + return std::nullopt; + } + + null_count += stats->null_count(); + value_count += column_chunk->num_values(); + } + + return FieldMetrics{ + .field_id = field_id, .value_count = value_count, .null_value_count = null_count}; +} + +/// \brief Collect bounds (lower and upper) from footer statistics. +/// \param field_id The Iceberg field ID. +/// \param iceberg_type The Iceberg primitive type for deserializing values. +/// \param metadata The Parquet file metadata. +/// \param column_idx The column index in the Parquet schema. +/// \param truncate_length The length to truncate strings/binary values. +/// \return FieldMetrics with counts and bounds, or nullopt if stats are not available. +Result> CollectBounds( + int32_t field_id, std::shared_ptr iceberg_type, + const ::parquet::FileMetaData& metadata, int32_t column_idx, + int32_t truncate_length) { + int64_t null_count = 0; + int64_t value_count = 0; + std::optional lower_bound; + std::optional upper_bound; + + for (int32_t rg = 0; rg < metadata.num_row_groups(); ++rg) { + auto row_group = metadata.RowGroup(rg); + auto column_chunk = row_group->ColumnChunk(column_idx); + auto stats = column_chunk->statistics(); + if (stats == nullptr || !stats->HasNullCount()) { + return std::nullopt; + } + + null_count += stats->null_count(); + value_count += column_chunk->num_values(); + + if (stats->HasMinMax()) { + auto min_bytes = stats->EncodeMin(); + auto min_span = std::span( + reinterpret_cast(min_bytes.data()), min_bytes.size()); + ICEBERG_ASSIGN_OR_RAISE(auto min_value, + Conversions::FromBytes(iceberg_type, min_span)); + if (!lower_bound.has_value() || min_value < lower_bound.value()) { + lower_bound = std::move(min_value); + } + + auto max_bytes = stats->EncodeMax(); + auto max_span = std::span( + reinterpret_cast(max_bytes.data()), max_bytes.size()); + ICEBERG_ASSIGN_OR_RAISE(auto max_value, + Conversions::FromBytes(iceberg_type, max_span)); + if (!upper_bound.has_value() || max_value > upper_bound.value()) { + upper_bound = std::move(max_value); + } + } + } + + if (!lower_bound.has_value() || !upper_bound.has_value() || lower_bound->IsNaN() || + upper_bound->IsNaN()) { + return FieldMetrics{ + .field_id = field_id, + .value_count = value_count, + .null_value_count = null_count, + }; + } + + ICEBERG_ASSIGN_OR_RAISE(auto truncated_lower, + TruncateUtils::TruncateLowerBound( + *iceberg_type, lower_bound.value(), truncate_length)); + ICEBERG_ASSIGN_OR_RAISE(auto truncated_upper, + TruncateUtils::TruncateUpperBound( + *iceberg_type, upper_bound.value(), truncate_length)); + + return FieldMetrics{ + .field_id = field_id, + .value_count = value_count, + .null_value_count = null_count, + .lower_bound = std::move(truncated_lower), + .upper_bound = std::move(truncated_upper), + }; +} + +/// \brief Process pre-computed field metrics, applying truncation if needed. +/// \param field_id The field ID to look up. +/// \param field_metrics The map of pre-computed field metrics. +/// \param primitive_type The primitive type for truncation. +/// \param truncate_length The truncation length (0 means no bounds). +/// \return Processed FieldMetrics with truncated bounds if applicable. +Result> MetricsFromFieldMetrics( + int32_t field_id, const std::unordered_map& field_metrics, + std::shared_ptr primitive_type, int32_t truncate_length) { + auto it = field_metrics.find(field_id); + if (it == field_metrics.end()) { + return std::nullopt; + } + + const auto& fm = it->second; + FieldMetrics result{.field_id = fm.field_id, + .value_count = fm.value_count, + .null_value_count = fm.null_value_count, + .nan_value_count = fm.nan_value_count}; + + if (truncate_length > 0) { + if (fm.lower_bound.has_value()) { + ICEBERG_ASSIGN_OR_RAISE( + auto lower, TruncateUtils::TruncateLowerBound( + *primitive_type, fm.lower_bound.value(), truncate_length)); + result.lower_bound = std::move(lower); + } + if (fm.upper_bound.has_value()) { + ICEBERG_ASSIGN_OR_RAISE( + auto upper, TruncateUtils::TruncateUpperBound( + *primitive_type, fm.upper_bound.value(), truncate_length)); + result.upper_bound = std::move(upper); + } + } + + return result; +} + +/// \brief Collect metrics for a single primitive field from footer statistics. +Result> MetricsFromFooter( + int32_t field_id, std::shared_ptr iceberg_type, + const ::parquet::SchemaDescriptor& parquet_schema, + const ::parquet::FileMetaData& metadata, int32_t truncate_length) { + auto column_idx = FindColumnIndex(parquet_schema, field_id); + if (!column_idx.has_value()) { + return std::nullopt; + } + + auto column_desc = parquet_schema.Column(column_idx.value()); + if (column_desc->physical_type() == ::parquet::Type::INT96) { + return std::nullopt; + } + + if (truncate_length <= 0) { + return CollectCounts(field_id, metadata, column_idx.value()); + } + + return CollectBounds(field_id, iceberg_type, metadata, column_idx.value(), + truncate_length); +} + +/// \brief Visitor for collecting metrics from all primitive fields in a schema. +class CollectMetricsVisitor { + public: + CollectMetricsVisitor(const ::parquet::SchemaDescriptor& parquet_schema, + const MetricsConfig& metrics_config, + const ::parquet::FileMetaData& metadata, + const std::unordered_map& field_metrics, + Metrics& metrics) + : parquet_schema_(parquet_schema), + metrics_config_(metrics_config), + metadata_(metadata), + field_metrics_(field_metrics), + metrics_(metrics) {} + + Status VisitStruct(const StructType& type, const std::string& prefix) { + for (const auto& field : type.fields()) { + std::string full_name = prefix.empty() ? std::string(field.name()) + : prefix + "." + std::string(field.name()); + ICEBERG_RETURN_UNEXPECTED(VisitField(field, full_name)); + } + return {}; + } + + Status VisitList(const ListType& /*type*/, const std::string& /*prefix*/) { return {}; } + + Status VisitMap(const MapType& /*type*/, const std::string& /*prefix*/) { return {}; } + + Status VisitPrimitive(const PrimitiveType& /*type*/, const std::string& /*prefix*/) { + return {}; + } + + private: + Status VisitField(const SchemaField& field, const std::string& full_name) { + if (field.type()->is_primitive()) { + return ProcessPrimitiveField(field, full_name); + } else if (field.type()->is_nested()) { + return VisitTypeCategory(*field.type(), this, full_name); + } + return {}; + } + + Status ProcessPrimitiveField(const SchemaField& field, const std::string& full_name) { + int32_t field_id = field.field_id(); + MetricsMode mode = metrics_config_.ColumnMode(full_name); + if (mode.kind == MetricsMode::Kind::kNone) { + return {}; + } + + int32_t truncate_length = mode.TruncateLength(); + const auto& primitive_type = + internal::checked_pointer_cast(field.type()); + + ICEBERG_ASSIGN_OR_RAISE(auto field_metrics, + MetricsFromFieldMetrics(field_id, field_metrics_, + primitive_type, truncate_length)); + if (field_metrics.has_value()) { + ApplyFieldMetrics(field_id, std::move(field_metrics.value())); + return {}; + } + + ICEBERG_ASSIGN_OR_RAISE(auto footer_metrics, + MetricsFromFooter(field_id, primitive_type, parquet_schema_, + metadata_, truncate_length)); + if (footer_metrics.has_value()) { + ApplyFieldMetrics(field_id, std::move(footer_metrics.value())); + } + return {}; + } + + void ApplyFieldMetrics(int32_t field_id, FieldMetrics&& fm) { + if (fm.value_count >= 0) { + metrics_.value_counts[field_id] = fm.value_count; + } + if (fm.null_value_count >= 0) { + metrics_.null_value_counts[field_id] = fm.null_value_count; + } + if (fm.nan_value_count >= 0) { + metrics_.nan_value_counts[field_id] = fm.nan_value_count; + } + if (fm.lower_bound.has_value()) { + metrics_.lower_bounds.emplace(field_id, std::move(fm.lower_bound.value())); + } + if (fm.upper_bound.has_value()) { + metrics_.upper_bounds.emplace(field_id, std::move(fm.upper_bound.value())); + } + } + + const ::parquet::SchemaDescriptor& parquet_schema_; + const MetricsConfig& metrics_config_; + const ::parquet::FileMetaData& metadata_; + const std::unordered_map& field_metrics_; + Metrics& metrics_; +}; + +} // namespace + +Result ParquetMetrics::GetMetrics( + const Schema& schema, const ::parquet::SchemaDescriptor& parquet_schema, + const MetricsConfig& metrics_config, const ::parquet::FileMetaData& metadata, + const std::unordered_map& field_metrics) { + Metrics metrics; + + // Collect row count and column sizes + int64_t row_count = 0; + for (int rg = 0; rg < metadata.num_row_groups(); ++rg) { + auto row_group = metadata.RowGroup(rg); + row_count += row_group->num_rows(); + for (int col = 0; col < row_group->num_columns(); ++col) { + auto column_chunk = row_group->ColumnChunk(col); + auto field_id_opt = GetFieldId(*parquet_schema.Column(col)); + if (!field_id_opt.has_value()) { + continue; + } + int32_t field_id = field_id_opt.value(); + + ICEBERG_ASSIGN_OR_RAISE(auto field_name, schema.FindColumnNameById(field_id)); + if (!field_name.has_value()) { + continue; + } + + MetricsMode mode = metrics_config.ColumnMode(field_name.value()); + if (mode.kind != MetricsMode::Kind::kNone) { + metrics.column_sizes[field_id] = + metrics.column_sizes.contains(field_id) + ? metrics.column_sizes[field_id] + column_chunk->total_compressed_size() + : column_chunk->total_compressed_size(); + } + } + } + metrics.row_count = row_count; + + // Collect metrics for all primitive fields + CollectMetricsVisitor visitor(parquet_schema, metrics_config, metadata, field_metrics, + metrics); + ICEBERG_RETURN_UNEXPECTED(visitor.VisitStruct(schema, "")); + + return metrics; +} + +} // namespace iceberg::parquet diff --git a/src/iceberg/parquet/parquet_metrics.h b/src/iceberg/parquet/parquet_metrics.h new file mode 100644 index 000000000..eb916241c --- /dev/null +++ b/src/iceberg/parquet/parquet_metrics.h @@ -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. + */ + +#pragma once + +/// \file iceberg/parquet/parquet_metrics.h +/// \brief Utilities for extracting metrics from Parquet files. + +#include + +#include + +#include "iceberg/iceberg_bundle_export.h" +#include "iceberg/metrics.h" +#include "iceberg/metrics_config.h" +#include "iceberg/result.h" +#include "iceberg/schema.h" + +namespace iceberg::parquet { + +/// \brief Utility class for computing metrics from Parquet files. +class ICEBERG_BUNDLE_EXPORT ParquetMetrics { + public: + ParquetMetrics() = delete; + + /// \brief Compute file-level metrics from Parquet file metadata. + /// + /// This function extracts metrics including row count, column sizes, value counts, + /// null value counts, and lower/upper bounds from Parquet file metadata. + /// NaN value counts are not currently collected from Parquet metadata. + /// The metrics are computed according to the provided MetricsConfig, which determines + /// which columns to collect metrics for and at what granularity (counts only, truncated + /// bounds, or full bounds). + /// + /// \param schema The Iceberg schema for the table. + /// \param parquet_schema The Parquet schema descriptor. + /// \param metrics_config The configuration specifying how to collect metrics. + /// \param metadata The Parquet file metadata containing row group statistics. + /// \param field_metrics Optional per-field metrics computed during write. + /// If provided, these take precedence over footer statistics. + /// \return Result containing the computed Metrics or an error. + static Result GetMetrics( + const Schema& schema, const ::parquet::SchemaDescriptor& parquet_schema, + const MetricsConfig& metrics_config, const ::parquet::FileMetaData& metadata, + const std::unordered_map& field_metrics = {}); +}; + +} // namespace iceberg::parquet diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index c70d3310c..e91a2a6cf 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -33,6 +33,7 @@ #include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/parquet/parquet_metrics.h" #include "iceberg/schema_internal.h" #include "iceberg/util/macros.h" @@ -86,6 +87,8 @@ Result> ParseCodecLevel(const WriterProperties& propertie class ParquetWriter::Impl { public: Status Open(const WriterOptions& options) { + schema_ = options.schema; + ICEBERG_ASSIGN_OR_RAISE(auto compression, ParseCompression(options.properties)); ICEBERG_ASSIGN_OR_RAISE(auto compression_level, ParseCodecLevel(options.properties)); @@ -98,15 +101,14 @@ class ParquetWriter::Impl { auto arrow_writer_properties = ::parquet::default_arrow_writer_properties(); ArrowSchema c_schema; - ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*options.schema, &c_schema)); + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*schema_, &c_schema)); ICEBERG_ARROW_ASSIGN_OR_RETURN(arrow_schema_, ::arrow::ImportSchema(&c_schema)); - std::shared_ptr<::parquet::SchemaDescriptor> schema_descriptor; ICEBERG_ARROW_RETURN_NOT_OK( ::parquet::arrow::ToParquetSchema(arrow_schema_.get(), *writer_properties, - *arrow_writer_properties, &schema_descriptor)); + *arrow_writer_properties, &parquet_schema_)); auto schema_node = std::static_pointer_cast<::parquet::schema::GroupNode>( - schema_descriptor->schema_root()); + parquet_schema_->schema_root()); ICEBERG_RETURN_UNEXPECTED(CheckCompressionAvailable( options.properties.Get(WriterProperties::kParquetCompression), compression)); @@ -119,6 +121,8 @@ class ParquetWriter::Impl { ::parquet::arrow::FileWriter::Make(pool_, std::move(file_writer), arrow_schema_, std::move(arrow_writer_properties), &writer_)); + metrics_config_ = options.metrics_config; + return {}; } @@ -143,6 +147,7 @@ class ParquetWriter::Impl { for (int i = 0; i < metadata->num_row_groups(); ++i) { split_offsets_.push_back(metadata->RowGroup(i)->file_offset()); } + metadata_ = writer_->metadata(); writer_.reset(); ICEBERG_ARROW_ASSIGN_OR_RETURN(total_bytes_, output_stream_->Tell()); @@ -165,15 +170,35 @@ class ParquetWriter::Impl { std::vector split_offsets() const { return split_offsets_; } + Result metrics() { + if (writer_) { + return Invalid("Cannot return metrics for unclosed writer"); + } + if (!metadata_) { + return Metrics(); + } + // TODO(WZhuo): collect write-side FieldMetrics to support NaN value counts. + return ParquetMetrics::GetMetrics(*schema_, *parquet_schema_, *metrics_config_, + *metadata_, {}); + } + private: // TODO(gangwu): make memory pool configurable ::arrow::MemoryPool* pool_ = ::arrow::default_memory_pool(); + // Schema to write from the Iceberg table. + std::shared_ptr schema_; // Schema to write from the Parquet file. std::shared_ptr<::arrow::Schema> arrow_schema_; + // Parquet schema descriptor generated from the Arrow schema. + std::shared_ptr<::parquet::SchemaDescriptor> parquet_schema_; + // Metrics config for collecting metrics during write. + std::shared_ptr metrics_config_; // The output stream to write Parquet file. std::shared_ptr<::arrow::io::OutputStream> output_stream_; // Parquet file writer to write ArrowArray. std::unique_ptr<::parquet::arrow::FileWriter> writer_; + // Store the metadata if writer has been closed. + std::shared_ptr<::parquet::FileMetaData> metadata_; // Total length of the written Parquet file. int64_t total_bytes_{0}; // Row group start offsets in the Parquet file. @@ -191,12 +216,7 @@ Status ParquetWriter::Write(ArrowArray* array) { return impl_->Write(array); } Status ParquetWriter::Close() { return impl_->Close(); } -Result ParquetWriter::metrics() { - if (!impl_->Closed()) { - return Invalid("ParquetWriter is not closed"); - } - return {}; -} +Result ParquetWriter::metrics() { return impl_->metrics(); } Result ParquetWriter::length() { return impl_->length(); } diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 7b5462673..b415154d6 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -192,7 +192,9 @@ if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(parquet_test USE_BUNDLE SOURCES + metrics_test_base.cc parquet_data_test.cc + parquet_metrics_test.cc parquet_schema_test.cc parquet_test.cc) diff --git a/src/iceberg/test/metrics_test_base.cc b/src/iceberg/test/metrics_test_base.cc new file mode 100644 index 000000000..cc5f7cd60 --- /dev/null +++ b/src/iceberg/test/metrics_test_base.cc @@ -0,0 +1,1020 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/test/metrics_test_base.h" + +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/schema_internal.h" +#include "iceberg/test/matchers.h" +#include "iceberg/type.h" +#include "iceberg/util/decimal.h" + +namespace iceberg::test { + +void MetricsTestBase::SetUp() { + file_io_ = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); + temp_dir_ = "metrics_test"; +} + +void MetricsTestBase::AssertCounts(int field_id, + std::optional expected_value_count, + std::optional expected_null_count, + const Metrics& metrics) { + if (expected_value_count.has_value()) { + ASSERT_TRUE(metrics.value_counts.contains(field_id)) + << "Field " << field_id << " should have value count"; + EXPECT_EQ(metrics.value_counts.at(field_id), expected_value_count.value()) + << "Field " << field_id << " value count mismatch"; + } else { + EXPECT_FALSE(metrics.value_counts.contains(field_id)) + << "Field " << field_id << " should not have value count"; + } + + if (expected_null_count.has_value()) { + ASSERT_TRUE(metrics.null_value_counts.contains(field_id)) + << "Field " << field_id << " should have null count"; + EXPECT_EQ(metrics.null_value_counts.at(field_id), expected_null_count.value()) + << "Field " << field_id << " null count mismatch"; + } else { + EXPECT_FALSE(metrics.null_value_counts.contains(field_id)) + << "Field " << field_id << " should not have null count"; + } +} + +void MetricsTestBase::AssertCounts(int field_id, + std::optional expected_value_count, + std::optional expected_null_count, + std::optional expected_nan_count, + const Metrics& metrics) { + AssertCounts(field_id, expected_value_count, expected_null_count, metrics); + + if (expected_nan_count.has_value()) { + ASSERT_TRUE(metrics.nan_value_counts.contains(field_id)) + << "Field " << field_id << " should have NaN count"; + EXPECT_EQ(metrics.nan_value_counts.at(field_id), expected_nan_count.value()) + << "Field " << field_id << " NaN count mismatch"; + } else { + EXPECT_FALSE(metrics.nan_value_counts.contains(field_id)) + << "Field " << field_id << " should not have NaN count"; + } +} + +template +void MetricsTestBase::AssertBounds(int field_id, std::shared_ptr type, + std::optional expected_lower, + std::optional expected_upper, + const Metrics& metrics) { + if (expected_lower.has_value()) { + ASSERT_TRUE(metrics.lower_bounds.contains(field_id)) + << "Field " << field_id << " should have lower bound"; + const auto& literal = metrics.lower_bounds.at(field_id); + ASSERT_FALSE(literal.IsNull()) + << "Field " << field_id << " lower bound literal should not be null"; + EXPECT_EQ(std::get(literal.value()), expected_lower.value()) + << "Field " << field_id << " lower bound mismatch"; + } else { + EXPECT_FALSE(metrics.lower_bounds.contains(field_id)); + } + + if (expected_upper.has_value()) { + ASSERT_TRUE(metrics.upper_bounds.contains(field_id)) + << "Field " << field_id << " should have upper bound"; + const auto& literal = metrics.upper_bounds.at(field_id); + ASSERT_FALSE(literal.IsNull()) + << "Field " << field_id << " upper bound literal should not be null"; + EXPECT_EQ(std::get(literal.value()), expected_upper.value()) + << "Field " << field_id << " upper bound mismatch"; + } else { + EXPECT_FALSE(metrics.upper_bounds.contains(field_id)); + } +} + +// Explicit template instantiations for common types +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, const Metrics&); +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, + const Metrics&); +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, + const Metrics&); +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, const Metrics&); +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, + const Metrics&); +template void MetricsTestBase::AssertBounds(int, + std::shared_ptr, + std::optional, + std::optional, + const Metrics&); +template void MetricsTestBase::AssertBounds>( + int, std::shared_ptr, std::optional>, + std::optional>, const Metrics&); + +template void MetricsTestBase::AssertBounds(int, std::shared_ptr, + std::optional, + std::optional, + const Metrics&); + +std::shared_ptr<::arrow::Array> MetricsTestBase::CreateRecordArrays( + const std::shared_ptr<::arrow::Schema>& arrow_schema, const std::string& json_data) { + auto struct_type = ::arrow::struct_(arrow_schema->fields()); + return ::arrow::json::ArrayFromJSONString(struct_type, json_data).ValueOrDie(); +} + +std::shared_ptr MetricsTestBase::SimpleSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "booleanCol", boolean()), + SchemaField::MakeRequired(2, "intCol", int32()), + SchemaField::MakeOptional(3, "longCol", int64()), + SchemaField::MakeRequired(4, "floatCol", float32()), + SchemaField::MakeOptional(5, "doubleCol", float64()), + SchemaField::MakeOptional(6, "decimalCol", decimal(10, 2)), + SchemaField::MakeRequired(7, "stringCol", string()), + SchemaField::MakeOptional(8, "dateCol", date()), + SchemaField::MakeRequired(9, "timeCol", time()), + SchemaField::MakeRequired(10, "timestampColAboveEpoch", timestamp()), + SchemaField::MakeRequired(11, "fixedCol", fixed(4)), + SchemaField::MakeRequired(12, "binaryCol", binary()), + SchemaField::MakeRequired(13, "timestampColBelowEpoch", timestamp()), + }); +} + +std::shared_ptr MetricsTestBase::NestedSchema() { + auto leaf_struct = struct_({ + SchemaField::MakeOptional(5, "leafLongCol", int64()), + SchemaField::MakeOptional(6, "leafBinaryCol", binary()), + }); + + auto nested_struct = struct_({ + SchemaField::MakeRequired(3, "longCol", int64()), + SchemaField::MakeRequired(4, "leafStructCol", leaf_struct), + SchemaField::MakeRequired(7, "doubleCol", float64()), + }); + + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "intCol", int32()), + SchemaField::MakeRequired(2, "nestedStructCol", nested_struct), + }); +} + +std::shared_ptr MetricsTestBase::FloatDoubleSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "floatCol", float32()), + SchemaField::MakeOptional(2, "doubleCol", float64()), + }); +} + +Result> ToArrowSchema(std::shared_ptr schema) { + ArrowSchema c_schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*schema, &c_schema)); + std::shared_ptr<::arrow::Schema> arrow_schema; + ICEBERG_ARROW_ASSIGN_OR_RETURN(arrow_schema, ::arrow::ImportSchema(&c_schema)); + return arrow_schema; +} + +void MetricsTestBase::MetricsForRepeatedValues() { + auto schema = SimpleSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto arrow_schema, ToArrowSchema(schema)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildSimpleRecords(arrow_schema, 2)); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 2); + + AssertCounts(1, 2, 0, metrics); + AssertCounts(2, 2, 0, metrics); + AssertCounts(3, 2, 1, metrics); + // TODO(WZhuo) Assert NaN metrics + AssertCounts(4, 2, 0, metrics); // floatCol has 2 NaN values + AssertCounts(5, 2, 0, metrics); + AssertCounts(6, 2, 1, metrics); + AssertCounts(7, 2, 0, metrics); + AssertCounts(8, 2, 0, metrics); + AssertCounts(9, 2, 0, metrics); + AssertCounts(10, 2, 0, metrics); + AssertCounts(11, 2, 0, metrics); + AssertCounts(12, 2, 0, metrics); + AssertCounts(13, 2, 0, metrics); +} + +void MetricsTestBase::MetricsForTopLevelFields() { + auto schema = SimpleSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto arrow_schema, ToArrowSchema(schema)); + + auto records = CreateRecordArrays(arrow_schema, R"([ + {"booleanCol": true, "intCol": 3, "longCol": 5, "floatCol": 2.0, "doubleCol": 2.0, + "decimalCol": "3.50", "stringCol": "AAA", "dateCol": 1500, "timeCol": 2000, + "timestampColAboveEpoch": 0, "fixedCol": "abcd", "binaryCol": "S", "timestampColBelowEpoch": -1900300}, + {"booleanCol": false, "intCol": -2147483648, "longCol": null, "floatCol": 1.0, "doubleCol": null, + "decimalCol": null, "stringCol": "ZZZ", "dateCol": null, "timeCol": 3000, + "timestampColAboveEpoch": 900, "fixedCol": "abcd", "binaryCol": "W", "timestampColBelowEpoch": -7000} + ])"); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 2); + + AssertCounts(1, 2, 0, metrics); + AssertBounds(1, boolean(), false, true, metrics); + AssertCounts(2, 2, 0, metrics); + AssertBounds(2, int32(), std::numeric_limits::min(), 3, metrics); + AssertCounts(3, 2, 1, metrics); + AssertBounds(3, int64(), 5, 5, metrics); + AssertCounts(4, 2, 0, metrics); + AssertBounds(4, float32(), 1.0F, 2.0F, metrics); + AssertCounts(5, 2, 1, metrics); + AssertBounds(5, float64(), 2.0, 2.0, metrics); + AssertCounts(6, 2L, 1L, metrics); + AssertBounds(6, std::make_shared(10, 2), Decimal(350), + Decimal(350), metrics); + AssertCounts(7, 2, 0, metrics); + AssertBounds(7, string(), std::string("AAA"), std::string("ZZZ"), metrics); + + AssertCounts(8, 2, 1, metrics); + AssertBounds(8, date(), 1500, 1500, metrics); + + AssertCounts(9, 2, 0, metrics); + AssertBounds(9, time(), 2000, 3000, metrics); + + AssertCounts(10, 2, 0, metrics); + AssertBounds(10, timestamp(), 0, 900, metrics); + + AssertCounts(11, 2, 0, metrics); + std::vector fixed_val = {'a', 'b', 'c', 'd'}; + AssertBounds>(11, fixed(4), fixed_val, fixed_val, metrics); + + AssertCounts(12, 2, 0, metrics); + AssertBounds>(12, binary(), std::vector{'S'}, + std::vector{'W'}, metrics); + + AssertCounts(13, 2, 0, metrics); + AssertBounds(13, timestamp(), -1900300, -7000, metrics); +} + +void MetricsTestBase::MetricsForDecimals() { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "decimalAsInt32", decimal(4, 2)), + SchemaField::MakeRequired(2, "decimalAsInt64", decimal(14, 2)), + SchemaField::MakeRequired(3, "decimalAsFixed", decimal(22, 2)), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("decimalAsInt32", ::arrow::decimal128(4, 2), false), + ::arrow::field("decimalAsInt64", ::arrow::decimal128(14, 2), false), + ::arrow::field("decimalAsFixed", ::arrow::decimal128(22, 2), false), + }); + + // Create decimal values + ::arrow::Decimal128Builder builder1(::arrow::decimal128(4, 2)); + ::arrow::Decimal128Builder builder2(::arrow::decimal128(14, 2)); + ::arrow::Decimal128Builder builder3(::arrow::decimal128(22, 2)); + + // 2.55, 4.75, 5.80 + ASSERT_TRUE(builder1.Append(::arrow::Decimal128("255")).ok()); // 2.55 with scale 2 + ASSERT_TRUE(builder2.Append(::arrow::Decimal128("475")).ok()); // 4.75 with scale 2 + ASSERT_TRUE(builder3.Append(::arrow::Decimal128("580")).ok()); // 5.80 with scale 2 + + auto array1 = builder1.Finish().ValueOrDie(); + auto array2 = builder2.Finish().ValueOrDie(); + auto array3 = builder3.Finish().ValueOrDie(); + + std::vector> field_arrays = {array1, array2, array3}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + AssertCounts(1, 1, 0, metrics); + // For decimals, bounds exist but we just check they're present + EXPECT_TRUE(metrics.lower_bounds.contains(1)); + EXPECT_TRUE(metrics.upper_bounds.contains(1)); + + AssertCounts(2, 1, 0, metrics); + EXPECT_TRUE(metrics.lower_bounds.contains(2)); + EXPECT_TRUE(metrics.upper_bounds.contains(2)); + + AssertCounts(3, 1, 0, metrics); + EXPECT_TRUE(metrics.lower_bounds.contains(3)); + EXPECT_TRUE(metrics.upper_bounds.contains(3)); +} + +void MetricsTestBase::MetricsForNestedStructFields() { + auto schema = NestedSchema(); + + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords()); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + AssertCounts(1, 1, 0, metrics); + AssertBounds(1, int32(), std::numeric_limits::min(), + std::numeric_limits::min(), metrics); + + AssertCounts(3, 1, 0, metrics); + AssertBounds(3, int64(), 100, 100, metrics); + + AssertCounts(5, 1, 0, metrics); + AssertBounds(5, int64(), 20, 20, metrics); + + AssertCounts(6, 1L, 0L, metrics); + AssertBounds>(6, binary(), std::vector{'A'}, + std::vector{'A'}, metrics); + + // TODO(WZhuo) Assert NaN metrics + AssertCounts(7, 1L, 0L, metrics); + AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::MetricsModeForNestedStructFields() { + auto schema = NestedSchema(); + + // Create MetricsConfig with custom column modes + // Default mode is None, but nestedStructCol.longCol should be Full + std::unordered_map properties = { + {"write.metadata.metrics.default", "none"}, + {"write.metadata.metrics.column.nestedStructCol.longCol", "full"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords()); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // Only field 3 (nestedStructCol.longCol) should have bounds + EXPECT_EQ(metrics.lower_bounds.size(), 1); + EXPECT_EQ(metrics.upper_bounds.size(), 1); + AssertBounds(3, int64(), 100, 100, metrics); +} + +void MetricsTestBase::MetricsForListAndMapElements() { + // Create struct type for map values + auto leaf_struct = struct_({ + SchemaField::MakeRequired(1, "leafIntCol", int32()), + SchemaField::MakeOptional(2, "leafStringCol", string()), + }); + + // Create list and map types using constructors directly + auto list_type = list(SchemaField::MakeRequired(4, "element", int32())); + auto map_type = map(SchemaField::MakeRequired(6, "key", string()), + SchemaField::MakeRequired(7, "value", leaf_struct)); + + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(3, "intListCol", list_type), + SchemaField::MakeOptional(5, "mapCol", map_type), + }); + + // Create Arrow schema + auto arrow_leaf_struct = ::arrow::struct_({ + ::arrow::field("leafIntCol", ::arrow::int32(), false), + ::arrow::field("leafStringCol", ::arrow::utf8(), true), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("intListCol", + ::arrow::list(::arrow::field("element", ::arrow::int32(), false)), + true), + ::arrow::field("mapCol", ::arrow::map(::arrow::utf8(), arrow_leaf_struct), true), + }); + + // Create list: [10, 11, 12] + ::arrow::Int32Builder int_builder; + ASSERT_TRUE(int_builder.Append(10).ok()); + ASSERT_TRUE(int_builder.Append(11).ok()); + ASSERT_TRUE(int_builder.Append(12).ok()); + auto int_array = int_builder.Finish().ValueOrDie(); + + ::arrow::ListBuilder list_builder(::arrow::default_memory_pool(), + std::make_shared<::arrow::Int32Builder>()); + ASSERT_TRUE(list_builder.Append().ok()); + auto list_value_builder = + static_cast<::arrow::Int32Builder*>(list_builder.value_builder()); + ASSERT_TRUE(list_value_builder->Append(10).ok()); + ASSERT_TRUE(list_value_builder->Append(11).ok()); + ASSERT_TRUE(list_value_builder->Append(12).ok()); + auto list_array = list_builder.Finish().ValueOrDie(); + + // Create map: {"4" -> {leafIntCol: 1, leafStringCol: "BBB"}} + // MapArray needs offsets, keys, and items (struct values) + ::arrow::Int32Builder offset_builder; + ASSERT_TRUE(offset_builder.Append(0).ok()); // Start offset + ASSERT_TRUE(offset_builder.Append(1).ok()); // End offset (1 entry) + auto offsets = offset_builder.Finish().ValueOrDie(); + + ::arrow::StringBuilder key_builder; + ASSERT_TRUE(key_builder.Append("4").ok()); + auto keys = key_builder.Finish().ValueOrDie(); + + ::arrow::Int32Builder struct_int_builder; + ::arrow::StringBuilder struct_str_builder; + ASSERT_TRUE(struct_int_builder.Append(1).ok()); + ASSERT_TRUE(struct_str_builder.Append("BBB").ok()); + auto struct_int_array = struct_int_builder.Finish().ValueOrDie(); + auto struct_str_array = struct_str_builder.Finish().ValueOrDie(); + auto items = + ::arrow::StructArray::Make({struct_int_array, struct_str_array}, + {::arrow::field("leafIntCol", ::arrow::int32(), false), + ::arrow::field("leafStringCol", ::arrow::utf8(), true)}) + .ValueOrDie(); + + auto map_array = ::arrow::MapArray::FromArrays(offsets, keys, items).ValueOrDie(); + + std::vector> field_arrays = {list_array, map_array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // For list and map elements, metrics should not be collected + // Field IDs: 1 (leafIntCol), 2 (leafStringCol), 4 (list element), 6 (map key), 7 (map + // value) + AssertCounts(1, std::nullopt, std::nullopt, metrics); + AssertCounts(2, std::nullopt, std::nullopt, metrics); + AssertCounts(4, std::nullopt, std::nullopt, metrics); + AssertCounts(6, std::nullopt, std::nullopt, metrics); + + AssertBounds(1, int32(), std::nullopt, std::nullopt, metrics); + AssertBounds(2, string(), std::nullopt, std::nullopt, metrics); + AssertBounds(4, int32(), std::nullopt, std::nullopt, metrics); + AssertBounds(6, string(), std::nullopt, std::nullopt, metrics); + ASSERT_FALSE(metrics.lower_bounds.contains(7)); + ASSERT_FALSE(metrics.upper_bounds.contains(7)); +} + +void MetricsTestBase::MetricsForNullColumns() { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "intCol", int32()), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("intCol", ::arrow::int32(), true), + }); + + auto records = CreateRecordArrays(arrow_schema, R"([ + {"intCol": null}, + {"intCol": null} + ])"); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 2); + AssertCounts(1, 2, 2, metrics); + AssertBounds(1, int32(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::MetricsForNaNColumns() { + auto schema = FloatDoubleSchema(); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("floatCol", ::arrow::float32(), true), + ::arrow::field("doubleCol", ::arrow::float64(), true), + }); + + ::arrow::FloatBuilder float_builder; + ::arrow::DoubleBuilder double_builder; + + ASSERT_TRUE(float_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(double_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(float_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(double_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + + auto float_array = float_builder.Finish().ValueOrDie(); + auto double_array = double_builder.Finish().ValueOrDie(); + + std::vector> field_arrays = {float_array, double_array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 2); + // TODO(WZhuo) Assert NaN metrics + AssertCounts(1, 2, 0, metrics); + AssertCounts(2, 2, 0, metrics); + + // When all values are NaN, bounds should not be set + AssertBounds(1, float32(), std::nullopt, std::nullopt, metrics); + AssertBounds(2, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::ColumnBoundsWithNaNValueAtFront() { + auto schema = FloatDoubleSchema(); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("floatCol", ::arrow::float32(), true), + ::arrow::field("doubleCol", ::arrow::float64(), true), + }); + + ::arrow::FloatBuilder float_builder; + ::arrow::DoubleBuilder double_builder; + + // NaN, 1.2, 5.6 + ASSERT_TRUE(float_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(double_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(float_builder.Append(1.2F).ok()); + ASSERT_TRUE(double_builder.Append(3.4).ok()); + ASSERT_TRUE(float_builder.Append(5.6F).ok()); + ASSERT_TRUE(double_builder.Append(7.8).ok()); + + auto float_array = float_builder.Finish().ValueOrDie(); + auto double_array = double_builder.Finish().ValueOrDie(); + + std::vector> field_arrays = {float_array, double_array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 3); + // TODO(WZhuo) Assert NaN metrics + AssertCounts(1, 3, 0, metrics); + AssertCounts(2, 3, 0, metrics); + + // Bounds should be computed from non-NaN values + if (metrics.lower_bounds.contains(1)) { + AssertBounds(1, float32(), 1.2F, 5.6F, metrics); + AssertBounds(2, float64(), 3.4, 7.8, metrics); + } +} + +void MetricsTestBase::ColumnBoundsWithNaNValueInMiddle() { + auto schema = FloatDoubleSchema(); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("floatCol", ::arrow::float32(), true), + ::arrow::field("doubleCol", ::arrow::float64(), true), + }); + + ::arrow::FloatBuilder float_builder; + ::arrow::DoubleBuilder double_builder; + + // 1.2, NaN, 5.6 + ASSERT_TRUE(float_builder.Append(1.2F).ok()); + ASSERT_TRUE(double_builder.Append(3.4).ok()); + ASSERT_TRUE(float_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(double_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(float_builder.Append(5.6F).ok()); + ASSERT_TRUE(double_builder.Append(7.8).ok()); + + auto float_array = float_builder.Finish().ValueOrDie(); + auto double_array = double_builder.Finish().ValueOrDie(); + + std::vector> field_arrays = {float_array, double_array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 3); + AssertCounts(1, 3, 0, metrics); + AssertCounts(2, 3, 0, metrics); + + if (metrics.lower_bounds.contains(1)) { + AssertBounds(1, float32(), 1.2F, 5.6F, metrics); + AssertBounds(2, float64(), 3.4, 7.8, metrics); + } +} + +void MetricsTestBase::ColumnBoundsWithNaNValueAtEnd() { + auto schema = FloatDoubleSchema(); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("floatCol", ::arrow::float32(), true), + ::arrow::field("doubleCol", ::arrow::float64(), true), + }); + + ::arrow::FloatBuilder float_builder; + ::arrow::DoubleBuilder double_builder; + + // 1.2, 5.6, NaN + ASSERT_TRUE(float_builder.Append(1.2F).ok()); + ASSERT_TRUE(double_builder.Append(3.4).ok()); + ASSERT_TRUE(float_builder.Append(5.6F).ok()); + ASSERT_TRUE(double_builder.Append(7.8).ok()); + ASSERT_TRUE(float_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + ASSERT_TRUE(double_builder.Append(std::numeric_limits::quiet_NaN()).ok()); + + auto float_array = float_builder.Finish().ValueOrDie(); + auto double_array = double_builder.Finish().ValueOrDie(); + + std::vector> field_arrays = {float_array, double_array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 3); + AssertCounts(1, 3, 0, metrics); + AssertCounts(2, 3, 0, metrics); + + if (metrics.lower_bounds.contains(1)) { + AssertBounds(1, float32(), 1.2F, 5.6F, metrics); + AssertBounds(2, float64(), 3.4, 7.8, metrics); + } +} + +void MetricsTestBase::MetricsForTopLevelWithMultipleRowGroup() { + auto schema = SimpleSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto arrow_schema, ToArrowSchema(schema)); + + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildSimpleRecords(arrow_schema, 201)); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + if (SupportsSmallRowGroups()) { + ICEBERG_UNWRAP_OR_FAIL(auto split_count, GetSplitCount()); + EXPECT_EQ(split_count, 3); + } + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 201); + + // Verify metrics are collected for top-level fields + AssertCounts(1, 201, 0, metrics); + AssertBounds(1, boolean(), false, true, metrics); + AssertCounts(2, 201, 0, metrics); + AssertBounds(2, int32(), 3, 203, metrics); + AssertCounts(3, 201, 1, metrics); + AssertBounds(3, int64(), 1, 200, metrics); + AssertCounts(4, 201, 0, metrics); + AssertBounds(4, float32(), 2.0F, 201.0F, metrics); + AssertCounts(5, 201, 0, metrics); + AssertBounds(5, float64(), 2.0, 201.0, metrics); + AssertCounts(6, 201L, 1L, metrics); + AssertBounds(6, std::make_shared(10, 2), Decimal(101), + Decimal(300), metrics); +} + +void MetricsTestBase::MetricsForNestedStructFieldsWithMultipleRowGroup() { + auto schema = NestedSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto arrow_schema, ToArrowSchema(schema)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords(201)); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, records)); + + if (SupportsSmallRowGroups()) { + ICEBERG_UNWRAP_OR_FAIL(auto split_count, GetSplitCount()); + EXPECT_EQ(split_count, 3); + } + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 201); + + // Verify metrics for top-level field + AssertCounts(1, 201, 0, metrics); + AssertBounds(1, int32(), std::numeric_limits::min(), + std::numeric_limits::min() + 200, metrics); + + // Verify metrics for nested struct fields + AssertCounts(3, 201, 0, metrics); + AssertBounds(3, int64(), 100, 100 + 200, metrics); + + AssertCounts(5, 201, 0, metrics); + AssertBounds(5, int64(), 20, 20 + 200, metrics); + + AssertCounts(6, 201, 0L, metrics); + AssertBounds>(6, binary(), std::vector{'A'}, + std::vector{'A'}, metrics); + + AssertCounts(7, 201, 0L, metrics); + AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::NoneMetricsMode() { + auto schema = NestedSchema(); + + std::unordered_map properties = { + {"write.metadata.metrics.default", "none"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords()); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // In None mode, column_sizes should be empty + EXPECT_TRUE(metrics.column_sizes.empty()); + + // All counts should be null + AssertCounts(1, std::nullopt, std::nullopt, metrics); + AssertBounds(1, int32(), std::nullopt, std::nullopt, metrics); + AssertCounts(3, std::nullopt, std::nullopt, metrics); + AssertBounds(3, int64(), std::nullopt, std::nullopt, metrics); + AssertCounts(5, std::nullopt, std::nullopt, metrics); + AssertBounds(5, int64(), std::nullopt, std::nullopt, metrics); + AssertCounts(6, std::nullopt, std::nullopt, metrics); + AssertBounds(6, binary(), std::nullopt, std::nullopt, metrics); + AssertCounts(7, std::nullopt, std::nullopt, metrics); + AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::CountsMetricsMode() { + auto schema = NestedSchema(); + + std::unordered_map properties = { + {"write.metadata.metrics.default", "counts"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords()); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // In Counts mode, column_sizes should not be empty + EXPECT_FALSE(metrics.column_sizes.empty()); + + // Counts should be present but bounds should be null + AssertCounts(1, 1, 0, metrics); + AssertBounds(1, int32(), std::nullopt, std::nullopt, metrics); + AssertCounts(3, 1, 0, metrics); + AssertBounds(3, int64(), std::nullopt, std::nullopt, metrics); + AssertCounts(5, 1, 0, metrics); + AssertBounds(5, int64(), std::nullopt, std::nullopt, metrics); + AssertCounts(6, 1, 0, metrics); + AssertBounds(6, binary(), std::nullopt, std::nullopt, metrics); + AssertCounts(7, 1, 0, metrics); + AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::FullMetricsMode() { + auto schema = NestedSchema(); + + std::unordered_map properties = { + {"write.metadata.metrics.default", "full"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto records, BuildNestedRecords()); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // In Full mode, column_sizes should not be empty + EXPECT_FALSE(metrics.column_sizes.empty()); + + // Both counts and bounds should be present + AssertCounts(1, 1, 0, metrics); + AssertBounds(1, int32(), std::numeric_limits::min(), + std::numeric_limits::min(), metrics); + AssertCounts(3, 1, 0, metrics); + AssertBounds(3, int64(), 100, 100, metrics); + AssertCounts(5, 1, 0, metrics); + AssertBounds(5, int64(), 20, 20, metrics); + AssertCounts(6, 1, 0, metrics); + AssertBounds>(6, binary(), std::vector{'A'}, + std::vector{'A'}, metrics); + AssertCounts(7, 1, 0, metrics); + AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); +} + +void MetricsTestBase::TruncateStringMetricsMode() { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "str_to_truncate", string()), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("str_to_truncate", ::arrow::utf8(), false), + }); + + auto records = CreateRecordArrays(arrow_schema, R"([ + {"str_to_truncate": "Lorem ipsum dolor sit amet"} + ])"); + + std::unordered_map properties = { + {"write.metadata.metrics.default", "truncate(10)"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // Column sizes should not be empty + EXPECT_FALSE(metrics.column_sizes.empty()); + + AssertCounts(1, 1, 0, metrics); + + // Bounds should be truncated to 10 characters + // Lower bound: "Lorem ipsu" (first 10 chars) + // Upper bound: "Lorem ipsv" (first 10 chars with last char incremented) + std::string expected_lower = "Lorem ipsu"; + std::string expected_upper = "Lorem ipsv"; + AssertBounds(1, string(), expected_lower, expected_upper, metrics); +} + +void MetricsTestBase::TruncateBinaryMetricsMode() { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "bin_to_truncate", binary()), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("bin_to_truncate", ::arrow::binary(), false), + }); + + // Create binary data: {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x10, 0xA, 0xB} + ::arrow::BinaryBuilder builder; + std::vector data = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, + 0x7, 0x8, 0x9, 0x10, 0xA, 0xB}; + ASSERT_TRUE(builder.Append(data.data(), data.size()).ok()); + auto array = builder.Finish().ValueOrDie(); + + std::vector> field_arrays = {array}; + auto records = + ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); + + std::unordered_map properties = { + {"write.metadata.metrics.default", "truncate(5)"}}; + + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; + EXPECT_EQ(*metrics.row_count, 1); + + // Column sizes should not be empty + EXPECT_FALSE(metrics.column_sizes.empty()); + + AssertCounts(1, 1, 0, metrics); + + // Bounds should be truncated to 5 bytes + // Lower bound: {0x1, 0x2, 0x3, 0x4, 0x5} + // Upper bound: {0x1, 0x2, 0x3, 0x4, 0x6} (last byte incremented) + auto expected_lower = std::vector{0x1, 0x2, 0x3, 0x4, 0x5}; + auto expected_upper = std::vector{0x1, 0x2, 0x3, 0x4, 0x6}; + AssertBounds>(1, binary(), expected_lower, expected_upper, + metrics); +} + +Result> MetricsTestBase::BuildSimpleRecords( + std::shared_ptr<::arrow::Schema> arrow_schema, int32_t count) { + ::arrow::BooleanBuilder boolean_builder; + ::arrow::Int32Builder int_builder; + ::arrow::Int64Builder long_builder; + ::arrow::FloatBuilder float_builder; + ::arrow::DoubleBuilder double_builder; + ::arrow::Decimal128Builder decimal_builder(::arrow::decimal128(10, 2)); + ::arrow::StringBuilder string_builder; + ::arrow::Date32Builder date_builder; + ::arrow::Time64Builder time_builder(::arrow::time64(::arrow::TimeUnit::MICRO), + ::arrow::default_memory_pool()); + ::arrow::TimestampBuilder timestamp_above_builder( + ::arrow::timestamp(::arrow::TimeUnit::MICRO), ::arrow::default_memory_pool()); + ::arrow::FixedSizeBinaryBuilder fixed_builder(::arrow::fixed_size_binary(4)); + ::arrow::BinaryBuilder binary_builder; + ::arrow::TimestampBuilder timestamp_below_builder( + ::arrow::timestamp(::arrow::TimeUnit::MICRO), ::arrow::default_memory_pool()); + + // Append identical records + for (int i = 0; i < count; i++) { + ICEBERG_ARROW_RETURN_NOT_OK(boolean_builder.Append(i != 0)); + ICEBERG_ARROW_RETURN_NOT_OK(int_builder.Append(3 + i)); + ICEBERG_ARROW_RETURN_NOT_OK(i == 0 ? long_builder.AppendNull() + : long_builder.Append(i)); + ICEBERG_ARROW_RETURN_NOT_OK( + i == 0 ? float_builder.Append(std::numeric_limits::quiet_NaN()) + : float_builder.Append(1.0 + i)); + ICEBERG_ARROW_RETURN_NOT_OK( + i == 0 ? double_builder.Append(std::numeric_limits::quiet_NaN()) + : double_builder.Append(1.0 + i)); + ICEBERG_ARROW_RETURN_NOT_OK(i == 0 + ? decimal_builder.AppendNull() + : decimal_builder.Append(::arrow::Decimal128("100") + + i)); // 1.00 with scale 2 + ICEBERG_ARROW_RETURN_NOT_OK(string_builder.Append("AAA")); + ICEBERG_ARROW_RETURN_NOT_OK(date_builder.Append(1500 + i)); + ICEBERG_ARROW_RETURN_NOT_OK(time_builder.Append(2000 + i)); + ICEBERG_ARROW_RETURN_NOT_OK(timestamp_above_builder.Append(i + 1)); + ICEBERG_ARROW_RETURN_NOT_OK(fixed_builder.Append("abcd")); + ICEBERG_ARROW_RETURN_NOT_OK(binary_builder.Append("S")); + ICEBERG_ARROW_RETURN_NOT_OK(timestamp_below_builder.Append((i + 1) * -1)); + } + + auto boolean_array = boolean_builder.Finish().ValueOrDie(); + auto int_array = int_builder.Finish().ValueOrDie(); + auto long_array = long_builder.Finish().ValueOrDie(); + auto float_array = float_builder.Finish().ValueOrDie(); + auto double_array = double_builder.Finish().ValueOrDie(); + auto decimal_array = decimal_builder.Finish().ValueOrDie(); + auto string_array = string_builder.Finish().ValueOrDie(); + auto date_array = date_builder.Finish().ValueOrDie(); + auto time_array = time_builder.Finish().ValueOrDie(); + auto timestamp_above_array = timestamp_above_builder.Finish().ValueOrDie(); + auto fixed_array = fixed_builder.Finish().ValueOrDie(); + auto binary_array = binary_builder.Finish().ValueOrDie(); + auto timestamp_below_array = timestamp_below_builder.Finish().ValueOrDie(); + + std::vector> field_arrays = { + boolean_array, int_array, long_array, + float_array, double_array, decimal_array, + string_array, date_array, time_array, + timestamp_above_array, fixed_array, binary_array, + timestamp_below_array}; + return ::arrow::StructArray::Make(field_arrays, arrow_schema->fields()).ValueOrDie(); +} + +Result> MetricsTestBase::BuildNestedRecords( + int32_t count) { + auto leaf_struct_type = ::arrow::struct_({ + ::arrow::field("leafLongCol", ::arrow::int64(), true), + ::arrow::field("leafBinaryCol", ::arrow::binary(), true), + }); + + auto nested_struct_type = ::arrow::struct_({ + ::arrow::field("longCol", ::arrow::int64(), false), + ::arrow::field("leafStructCol", leaf_struct_type, false), + ::arrow::field("doubleCol", ::arrow::float64(), false), + }); + + auto arrow_schema = ::arrow::schema({ + ::arrow::field("intCol", ::arrow::int32(), false), + ::arrow::field("nestedStructCol", nested_struct_type, false), + }); + + // Build leaf struct: {leafLongCol: 20, leafBinaryCol: "A"} + ::arrow::Int64Builder leaf_long_builder; + ::arrow::BinaryBuilder leaf_binary_builder; + ::arrow::Int64Builder nested_long_builder; + ::arrow::DoubleBuilder nested_double_builder; + ::arrow::Int32Builder int_builder; + + for (int32_t i = 0; i < count; i++) { + ICEBERG_ARROW_RETURN_NOT_OK(leaf_long_builder.Append(20 + i)); + ICEBERG_ARROW_RETURN_NOT_OK(leaf_binary_builder.Append("A")); + + // Build nested struct: {longCol: 100, leafStructCol: {...}, doubleCol: NaN} + + ICEBERG_ARROW_RETURN_NOT_OK(nested_long_builder.Append(100 + i)); + ICEBERG_ARROW_RETURN_NOT_OK( + nested_double_builder.Append(std::numeric_limits::quiet_NaN())); + + // Build top-level struct: {intCol: 2147483647, nestedStructCol: {...}} + ICEBERG_ARROW_RETURN_NOT_OK( + int_builder.Append(std::numeric_limits::min() + i)); + } + + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto leaf_long_array, leaf_long_builder.Finish()); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto leaf_binary_array, leaf_binary_builder.Finish()); + ICEBERG_ARROW_ASSIGN_OR_RETURN( + auto leaf_struct_array, + ::arrow::StructArray::Make({leaf_long_array, leaf_binary_array}, + leaf_struct_type->fields())); + + // Build nested struct: {longCol: 100, leafStructCol: {...}, doubleCol: NaN} + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto nested_long_array, nested_long_builder.Finish()); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto nested_double_array, + nested_double_builder.Finish()); + ICEBERG_ARROW_ASSIGN_OR_RETURN( + auto nested_struct_array, + ::arrow::StructArray::Make( + {nested_long_array, leaf_struct_array, nested_double_array}, + nested_struct_type->fields())); + + // Build top-level struct: {intCol: 2147483647, nestedStructCol: {...}} + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto int_array, int_builder.Finish()); + ICEBERG_ARROW_ASSIGN_OR_RETURN( + auto records, ::arrow::StructArray::Make({int_array, nested_struct_array}, + arrow_schema->fields())); + return records; +} + +} // namespace iceberg::test diff --git a/src/iceberg/test/metrics_test_base.h b/src/iceberg/test/metrics_test_base.h new file mode 100644 index 000000000..1ad9c8823 --- /dev/null +++ b/src/iceberg/test/metrics_test_base.h @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include + +#include + +#include "iceberg/file_io.h" +#include "iceberg/metrics.h" +#include "iceberg/metrics_config.h" +#include "iceberg/result.h" +#include "iceberg/schema.h" + +namespace iceberg::test { + +/// \brief Base test class for metrics testing, similar to Java's TestMetrics +/// +/// This class provides common test infrastructure and helper methods for testing +/// metrics collection across different file formats (Parquet, Avro, ORC). +class MetricsTestBase { + protected: + virtual void SetUp(); + + /// \brief Get metrics for the given schema and records + virtual Result GetMetrics(std::shared_ptr schema, + std::shared_ptr<::arrow::Array> records) = 0; + + /// \brief Get metrics with custom MetricsConfig + virtual Result GetMetrics(std::shared_ptr schema, + std::shared_ptr config, + std::shared_ptr<::arrow::Array> records) = 0; + + /// \brief Create an output file for testing + virtual std::string CreateOutputFile() = 0; + + /// \brief Get the number of row groups/splits in a file + virtual Result GetSplitCount() = 0; + + /// \brief Whether the format supports small row groups for testing + virtual bool SupportsSmallRowGroups() const { return false; } + + // Helper methods for assertions + void AssertCounts(int field_id, std::optional expected_value_count, + std::optional expected_null_count, const Metrics& metrics); + + void AssertCounts(int field_id, std::optional expected_value_count, + std::optional expected_null_count, + std::optional expected_nan_count, const Metrics& metrics); + + template + void AssertBounds(int field_id, std::shared_ptr type, + std::optional expected_lower, std::optional expected_upper, + const Metrics& metrics); + + // Helper methods for creating test data + std::shared_ptr<::arrow::Array> CreateRecordArrays( + const std::shared_ptr<::arrow::Schema>& arrow_schema, const std::string& json_data); + + // Common test schemas + static std::shared_ptr SimpleSchema(); + static std::shared_ptr NestedSchema(); + static std::shared_ptr FloatDoubleSchema(); + + // Test case methods - subclasses should call these from TEST_F macros + void MetricsForRepeatedValues(); + void MetricsForTopLevelFields(); + void MetricsForDecimals(); + void MetricsForNestedStructFields(); + void MetricsModeForNestedStructFields(); + void MetricsForListAndMapElements(); + void MetricsForNullColumns(); + void MetricsForNaNColumns(); + void ColumnBoundsWithNaNValueAtFront(); + void ColumnBoundsWithNaNValueInMiddle(); + void ColumnBoundsWithNaNValueAtEnd(); + void MetricsForTopLevelWithMultipleRowGroup(); + void MetricsForNestedStructFieldsWithMultipleRowGroup(); + void NoneMetricsMode(); + void CountsMetricsMode(); + void FullMetricsMode(); + void TruncateStringMetricsMode(); + void TruncateBinaryMetricsMode(); + + private: + Result> BuildSimpleRecords( + std::shared_ptr<::arrow::Schema> arrow_schema, int32_t count = 1); + Result> BuildNestedRecords(int32_t count = 1); + + protected: + std::shared_ptr file_io_; + std::string temp_dir_; + std::string path_; +}; + +#define DEFINE_METRICS_TEST_CASE(TestClass, Case) \ + TEST_F(TestClass, Case) { Case(); } + +#define DEFINE_METRICS_TESTS(TestClass) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForRepeatedValues) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForTopLevelFields) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForNestedStructFields) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForNullColumns) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForNaNColumns) \ + DEFINE_METRICS_TEST_CASE(TestClass, ColumnBoundsWithNaNValueAtFront) \ + DEFINE_METRICS_TEST_CASE(TestClass, ColumnBoundsWithNaNValueInMiddle) \ + DEFINE_METRICS_TEST_CASE(TestClass, ColumnBoundsWithNaNValueAtEnd) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForDecimals) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForListAndMapElements) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsModeForNestedStructFields) \ + DEFINE_METRICS_TEST_CASE(TestClass, NoneMetricsMode) \ + DEFINE_METRICS_TEST_CASE(TestClass, CountsMetricsMode) \ + DEFINE_METRICS_TEST_CASE(TestClass, FullMetricsMode) \ + DEFINE_METRICS_TEST_CASE(TestClass, TruncateStringMetricsMode) \ + DEFINE_METRICS_TEST_CASE(TestClass, TruncateBinaryMetricsMode) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForTopLevelWithMultipleRowGroup) \ + DEFINE_METRICS_TEST_CASE(TestClass, MetricsForNestedStructFieldsWithMultipleRowGroup) + +} // namespace iceberg::test diff --git a/src/iceberg/test/parquet_metrics_test.cc b/src/iceberg/test/parquet_metrics_test.cc new file mode 100644 index 000000000..93c024b01 --- /dev/null +++ b/src/iceberg/test/parquet_metrics_test.cc @@ -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. + */ + +#include +#include +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/arrow/arrow_status_internal.h" +#include "iceberg/file_writer.h" +#include "iceberg/parquet/parquet_register.h" +#include "iceberg/test/metrics_test_base.h" +#include "iceberg/util/checked_cast.h" + +namespace iceberg::test { + +class ParquetMetricsTest : public MetricsTestBase, public ::testing::Test { + protected: + static void SetUpTestSuite() { parquet::RegisterAll(); } + + void SetUp() override { + MetricsTestBase::SetUp(); + temp_parquet_file_ = "parquet_metrics_test.parquet"; + writer_properties_ = WriterProperties::FromMap( + {{WriterProperties::kParquetCompression.key(), "uncompressed"}}); + } + + Result GetMetrics(std::shared_ptr schema, + std::shared_ptr<::arrow::Array> records) override { + return GetMetrics(schema, MetricsConfig::Default(), records); + } + + Result GetMetrics(std::shared_ptr schema, + std::shared_ptr config, + std::shared_ptr<::arrow::Array> records) override { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, WriterFactoryRegistry::Open(FileFormatType::kParquet, + {.path = temp_parquet_file_, + .schema = schema, + .io = file_io_, + .metadata = {}, + .metrics_config = config, + .properties = writer_properties_})); + ArrowArray arr; + ICEBERG_ARROW_RETURN_NOT_OK(::arrow::ExportArray(*records, &arr)); + ICEBERG_RETURN_UNEXPECTED(writer->Write(&arr)); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->metrics(); + } + + std::string CreateOutputFile() override { return temp_parquet_file_; } + + Result GetSplitCount() override { + auto io = internal::checked_cast(*file_io_); + auto infile = io.fs()->OpenInputFile(temp_parquet_file_).ValueOrDie(); + auto metadata = ::parquet::ReadMetaData(infile); + return metadata->num_row_groups(); + } + + bool SupportsSmallRowGroups() const override { return false; } + + private: + std::string temp_parquet_file_; + WriterProperties writer_properties_; +}; + +DEFINE_METRICS_TESTS(ParquetMetricsTest); + +} // namespace iceberg::test diff --git a/src/iceberg/test/truncate_util_test.cc b/src/iceberg/test/truncate_util_test.cc index 849f67d71..f39e10cae 100644 --- a/src/iceberg/test/truncate_util_test.cc +++ b/src/iceberg/test/truncate_util_test.cc @@ -79,8 +79,9 @@ TEST(TruncateUtilTest, TruncateBinaryMax) { EXPECT_EQ(result3, Literal::Binary(test3)); // Test3b: cannot truncate when first bytes are all 0xFF - EXPECT_THAT(TruncateUtils::TruncateLiteralMax(Literal::Binary(test3), 2), - IsError(ErrorKind::kInvalidArgument)); + ICEBERG_UNWRAP_OR_FAIL(auto result3b, + TruncateUtils::TruncateLiteralMax(Literal::Binary(test3), 2)); + EXPECT_EQ(result3b, std::nullopt); // Test4: truncate {1, 1, 0} to 2 bytes -> {1, 2} ICEBERG_UNWRAP_OR_FAIL(auto result4, @@ -143,8 +144,9 @@ TEST(TruncateUtilTest, TruncateStringMax) { // Test5: Max 4-byte UTF-8 characters "\uDBFF\uDFFF\uDBFF\uDFFF" std::string test5 = "\xF4\x8F\xBF\xBF\xF4\x8F\xBF\xBF"; // U+10FFFF U+10FFFF - EXPECT_THAT(TruncateUtils::TruncateLiteralMax(Literal::String(test5), 1), - IsError(ErrorKind::kInvalidArgument)); + ICEBERG_UNWRAP_OR_FAIL(auto result5_1, + TruncateUtils::TruncateLiteralMax(Literal::String(test5), 1)); + EXPECT_EQ(result5_1, std::nullopt); // Test6: 4-byte UTF-8 character "\uD800\uDFFF\uD800\uDFFF" std::string test6 = "\xF0\x90\x8F\xBF\xF0\x90\x8F\xBF"; // U+103FF U+103FF diff --git a/src/iceberg/util/truncate_util.cc b/src/iceberg/util/truncate_util.cc index aba22d17e..8a1d07243 100644 --- a/src/iceberg/util/truncate_util.cc +++ b/src/iceberg/util/truncate_util.cc @@ -24,6 +24,7 @@ #include #include "iceberg/expression/literal.h" +#include "iceberg/type.h" #include "iceberg/util/checked_cast.h" namespace iceberg { @@ -167,23 +168,26 @@ Literal TruncateLiteralImpl(const Literal& literal, int32_t wid } template -Result TruncateLiteralMaxImpl(const Literal& literal, int32_t width) = delete; +Result> TruncateLiteralMaxImpl(const Literal& literal, + int32_t width) = delete; template <> -Result TruncateLiteralMaxImpl(const Literal& literal, - int32_t width) { +Result> TruncateLiteralMaxImpl( + const Literal& literal, int32_t width) { const auto& str = std::get(literal.value()); - ICEBERG_ASSIGN_OR_RAISE(std::string truncated, - TruncateUtils::TruncateUTF8Max(str, width)); - return Literal::String(std::move(truncated)); + ICEBERG_ASSIGN_OR_RAISE(auto truncated, TruncateUtils::TruncateUTF8Max(str, width)); + if (!truncated.has_value()) { + return std::nullopt; + } + return std::optional(Literal::String(std::move(truncated.value()))); } template <> -Result TruncateLiteralMaxImpl(const Literal& literal, - int32_t width) { +Result> TruncateLiteralMaxImpl( + const Literal& literal, int32_t width) { const auto& data = std::get>(literal.value()); if (static_cast(data.size()) <= width) { - return literal; + return std::optional(literal); } std::vector truncated(data.begin(), data.begin() + width); @@ -191,18 +195,19 @@ Result TruncateLiteralMaxImpl(const Literal& literal, if (*it < 0xFF) { ++(*it); truncated.resize(truncated.size() - std::distance(truncated.rbegin(), it)); - return Literal::Binary(std::move(truncated)); + return std::optional(Literal::Binary(std::move(truncated))); } } - return InvalidArgument("Cannot truncate upper bound for binary: all bytes are 0xFF"); + return std::nullopt; } } // namespace -Result TruncateUtils::TruncateUTF8Max(const std::string& source, size_t L) { +Result> TruncateUtils::TruncateUTF8Max( + const std::string& source, size_t L) { std::string truncated = TruncateUTF8(source, L); if (truncated == source) { - return truncated; + return std::optional(std::move(truncated)); } // Try incrementing code points from the end @@ -231,13 +236,12 @@ Result TruncateUtils::TruncateUTF8Max(const std::string& source, si if (next_code_point <= kUtf8MaxCodePoint) { truncated.resize(cp_start); AppendUtf8CodePoint(next_code_point, truncated); - return truncated; + return std::optional(std::move(truncated)); } } last_cp_start = cp_start; } - return InvalidArgument( - "Cannot truncate upper bound for string: all code points are 0x10FFFF"); + return std::nullopt; } Decimal TruncateUtils::TruncateDecimal(const Decimal& decimal, int32_t width) { @@ -274,10 +278,11 @@ Result TruncateUtils::TruncateLiteral(const Literal& literal, int32_t w case TYPE_ID: \ return TruncateLiteralMaxImpl(literal, width); -Result TruncateUtils::TruncateLiteralMax(const Literal& literal, int32_t width) { +Result> TruncateUtils::TruncateLiteralMax(const Literal& literal, + int32_t width) { if (literal.IsNull()) [[unlikely]] { // Return null as is - return literal; + return std::optional(literal); } if (literal.IsAboveMax() || literal.IsBelowMin()) [[unlikely]] { @@ -293,4 +298,26 @@ Result TruncateUtils::TruncateLiteralMax(const Literal& literal, int32_ } } +Result TruncateUtils::TruncateLowerBound(const PrimitiveType& type, + const Literal& value, int32_t length) { + switch (type.type_id()) { + case TypeId::kString: + case TypeId::kBinary: + return TruncateLiteral(value, length); + default: + return value; + } +} + +Result> TruncateUtils::TruncateUpperBound( + const PrimitiveType& type, const Literal& value, int32_t length) { + switch (type.type_id()) { + case TypeId::kString: + case TypeId::kBinary: + return TruncateLiteralMax(value, length); + default: + return std::optional(value); + } +} + } // namespace iceberg diff --git a/src/iceberg/util/truncate_util.h b/src/iceberg/util/truncate_util.h index 1a1824a24..7fee86eba 100644 --- a/src/iceberg/util/truncate_util.h +++ b/src/iceberg/util/truncate_util.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include @@ -71,9 +72,10 @@ class ICEBERG_EXPORT TruncateUtils { /// \param source The input string to truncate. /// \param L The maximum number of code points allowed in the output string. /// \return A Result containing the original string (if no truncation is - /// needed), or the smallest string greater than the truncated prefix, or an - /// error if no such value exists or the input is invalid UTF-8. - static Result TruncateUTF8Max(const std::string& source, size_t L); + /// needed), the smallest string greater than the truncated prefix, or nullopt if no + /// safe upper bound can be represented. Invalid UTF-8 is returned as an error. + static Result> TruncateUTF8Max(const std::string& source, + size_t L); /// \brief Truncate an integer v, either int32_t or int64_t, to v - (v % W). /// @@ -109,10 +111,37 @@ class ICEBERG_EXPORT TruncateUtils { /// /// \param value The input Literal maximum value to truncate. /// \param width The width to truncate to. - /// \return A Result containing either the original Literal (if no truncation is needed) - /// or the smallest Literal greater than the truncated prefix, or an error if no such - /// value exists or cannot be represented. - static Result TruncateLiteralMax(const Literal& value, int32_t width); + /// \return A Result containing either the original Literal (if no truncation is + /// needed), the smallest Literal greater than the truncated prefix, or nullopt if no + /// safe upper bound can be represented. + static Result> TruncateLiteralMax(const Literal& value, + int32_t width); + + /// \brief Truncate the lower bound of a string or binary value. + /// + /// For string/binary types, truncates to the given length. For other types, returns the + /// value unchanged. + /// + /// \param type The Iceberg primitive type. + /// \param value The lower bound literal value. + /// \param width The width to truncate to. + /// \return The truncated lower bound literal. + static Result TruncateLowerBound(const PrimitiveType& type, + const Literal& value, int32_t width); + + /// \brief Truncate the upper bound of a string or binary value. + /// + /// For string/binary types, truncates to the smallest value greater than the truncated + /// prefix. For other types, returns the value unchanged. + /// + /// \param type The Iceberg primitive type. + /// \param value The upper bound literal value. + /// \param width The width to truncate to. + /// \return The truncated upper bound literal, or nullopt if no safe upper bound can be + /// represented. + static Result> TruncateUpperBound(const PrimitiveType& type, + const Literal& value, + int32_t width); }; } // namespace iceberg From bc48b949dfca6c02dea75b7d50de1e2dfca6485a Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Tue, 26 May 2026 20:33:21 +0800 Subject: [PATCH 044/151] fix(parquet): fix parquet writer metrics conversion (#681) This is a followup of https://github.com/apache/iceberg-cpp/pull/651 to address all comments --- src/iceberg/file_writer.h | 3 + src/iceberg/metrics.h | 2 +- src/iceberg/metrics_config.cc | 27 +- src/iceberg/metrics_config.h | 10 +- src/iceberg/parquet/parquet_metrics.cc | 272 ++++++++++++++---- ...t_metrics.h => parquet_metrics_internal.h} | 5 +- src/iceberg/parquet/parquet_writer.cc | 28 +- src/iceberg/test/metrics_test_base.cc | 47 ++- src/iceberg/test/metrics_test_base.h | 4 + src/iceberg/test/parquet_metrics_test.cc | 97 ++++++- src/iceberg/util/truncate_util.cc | 14 +- 11 files changed, 387 insertions(+), 122 deletions(-) rename src/iceberg/parquet/{parquet_metrics.h => parquet_metrics_internal.h} (95%) diff --git a/src/iceberg/file_writer.h b/src/iceberg/file_writer.h index 3c890453b..4b1045a40 100644 --- a/src/iceberg/file_writer.h +++ b/src/iceberg/file_writer.h @@ -60,6 +60,9 @@ class ICEBERG_EXPORT WriterProperties : public ConfigBase { "zstd"}; inline static Entry kParquetCompressionLevel{ "write.parquet.compression-level", ""}; + /// \brief Maximum number of rows in each Parquet row group. + inline static Entry kParquetMaxRowGroupRows{"write.parquet.max-row-group-rows", + 1024 * 1024}; /// TODO(gangwu): add table properties with write.avro|parquet|orc.* diff --git a/src/iceberg/metrics.h b/src/iceberg/metrics.h index 083cd0410..8cfbbdf8b 100644 --- a/src/iceberg/metrics.h +++ b/src/iceberg/metrics.h @@ -36,7 +36,7 @@ namespace iceberg { /// lower/upper bounds for a specific field identified by its field_id. struct ICEBERG_EXPORT FieldMetrics { /// \brief The field ID this metrics belongs to. - int32_t field_id; + int32_t field_id = -1; /// \brief The total number of values (including nulls) for this field. /// A negative value indicates the count is unknown. diff --git a/src/iceberg/metrics_config.cc b/src/iceberg/metrics_config.cc index ea20d47e1..95d1a1fe1 100644 --- a/src/iceberg/metrics_config.cc +++ b/src/iceberg/metrics_config.cc @@ -125,9 +125,8 @@ const std::shared_ptr& MetricsConfig::Default() { Result> MetricsConfig::Make(const Table& table) { ICEBERG_ASSIGN_OR_RAISE(auto schema, table.schema()); - auto sort_order = table.sort_order(); - return MakeInternal(table.properties(), *schema, - *sort_order.value_or(SortOrder::Unsorted())); + auto order = table.sort_order().value_or(SortOrder::Unsorted()); + return MakeInternal(table.properties(), schema.get(), order.get()); } Result> MetricsConfig::Make( @@ -135,11 +134,11 @@ Result> MetricsConfig::Make( // Create a minimal TableProperties wrapper for the properties TableProperties props = TableProperties::FromMap(std::move(properties)); - return MakeInternal(props, Schema({}), *SortOrder::Unsorted()); + return MakeInternal(props, /*schema=*/nullptr, /*order=*/nullptr); } Result> MetricsConfig::MakeInternal( - const TableProperties& props, const Schema& schema, const SortOrder& order) { + const TableProperties& props, const Schema* schema, const SortOrder* order) { ColumnModeMap column_modes; MetricsMode default_mode = kDefaultMetricsMode; @@ -148,16 +147,16 @@ Result> MetricsConfig::MakeInternal( props.Get(TableProperties::kDefaultWriteMetricsMode); ICEBERG_ASSIGN_OR_RAISE(default_mode, ParseMode(configured_metrics_mode, kDefaultMetricsMode)); - } else { + } else if (schema != nullptr) { int32_t max_inferred_columns = MaxInferredColumns(props); GetProjectedIdsVisitor visitor(/*include_struct_ids=*/true); - ICEBERG_RETURN_UNEXPECTED(visitor.Visit(schema)); + ICEBERG_RETURN_UNEXPECTED(visitor.Visit(*schema)); auto projected_columns = static_cast(visitor.Finish().size()); if (max_inferred_columns < projected_columns) { ICEBERG_ASSIGN_OR_RAISE(auto limit_field_ids, - LimitFieldIds(schema, max_inferred_columns)); + LimitFieldIds(*schema, max_inferred_columns)); for (auto id : limit_field_ids) { - ICEBERG_ASSIGN_OR_RAISE(auto column_name, schema.FindColumnNameById(id)); + ICEBERG_ASSIGN_OR_RAISE(auto column_name, schema->FindColumnNameById(id)); ICEBERG_CHECK(column_name.has_value(), "Field id {} not found in schema", id); column_modes[std::string(column_name.value())] = kDefaultMetricsMode; } @@ -167,10 +166,12 @@ Result> MetricsConfig::MakeInternal( } // First set sorted column with sorted column default (can be overridden by user) - auto sorted_col_default_mode = SortedColumnDefaultMode(default_mode); - auto sorted_columns = SortOrder::OrderPreservingSortedColumns(schema, order); - for (const auto& sorted_column : sorted_columns) { - column_modes[std::string(sorted_column)] = sorted_col_default_mode; + if (schema != nullptr && order != nullptr) { + auto sorted_col_default_mode = SortedColumnDefaultMode(default_mode); + auto sorted_columns = SortOrder::OrderPreservingSortedColumns(*schema, *order); + for (const auto& sorted_column : sorted_columns) { + column_modes[std::string(sorted_column)] = sorted_col_default_mode; + } } // Handle user overrides of defaults diff --git a/src/iceberg/metrics_config.h b/src/iceberg/metrics_config.h index a5e51ee6c..bba7307d3 100644 --- a/src/iceberg/metrics_config.h +++ b/src/iceberg/metrics_config.h @@ -101,12 +101,14 @@ class ICEBERG_EXPORT MetricsConfig { /// /// \param props will be read for metrics overrides (write.metadata.metrics.column.*) /// and default(write.metadata.metrics.default) - /// \param schema table schema - /// \param order sort order columns, will be promoted to truncate(16) + /// \param schema table schema, or nullptr when only properties are available + /// \param order table sort order, or nullptr when unavailable. If provided, sorted + /// columns use at least the default truncate metrics mode (`truncate(16)`) when + /// the default mode is `none` or `counts`; explicit column overrides still win. /// \return metrics configuration static Result> MakeInternal(const TableProperties& props, - const Schema& schema, - const SortOrder& order); + const Schema* schema, + const SortOrder* order); ColumnModeMap column_modes_; MetricsMode default_mode_; diff --git a/src/iceberg/parquet/parquet_metrics.cc b/src/iceberg/parquet/parquet_metrics.cc index 09b727a1a..32dc9fec8 100644 --- a/src/iceberg/parquet/parquet_metrics.cc +++ b/src/iceberg/parquet/parquet_metrics.cc @@ -17,13 +17,15 @@ * under the License. */ -#include "iceberg/parquet/parquet_metrics.h" - +#include #include #include #include +#include #include #include +#include +#include #include #include @@ -31,12 +33,14 @@ #include #include "iceberg/expression/literal.h" +#include "iceberg/parquet/parquet_metrics_internal.h" #include "iceberg/result.h" #include "iceberg/schema.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" -#include "iceberg/util/conversions.h" +#include "iceberg/util/decimal.h" #include "iceberg/util/truncate_util.h" +#include "iceberg/util/uuid.h" #include "iceberg/util/visit_type.h" namespace iceberg::parquet { @@ -67,6 +71,163 @@ std::optional FindColumnIndex(const ::parquet::SchemaDescriptor& parque return it != columns.end() ? std::optional(*it) : std::nullopt; } +int64_t CollectColumnSize(const ::parquet::FileMetaData& metadata, int32_t column_idx) { + int64_t size = 0; + for (int rg = 0; rg < metadata.num_row_groups(); ++rg) { + size += metadata.RowGroup(rg)->ColumnChunk(column_idx)->total_compressed_size(); + } + return size; +} + +template +Result TypedStatsLiteral(const ::parquet::Statistics& stats, bool is_min, + Converter&& converter) { + const auto& typed_stats = internal::checked_cast(stats); + return converter(is_min ? typed_stats.min() : typed_stats.max()); +} + +std::vector BytesFromByteArray(const ::parquet::ByteArray& value) { + return std::vector{value.ptr, value.ptr + value.len}; +} + +std::vector BytesFromFLBA(const ::parquet::FixedLenByteArray& value, + int32_t length) { + return std::vector{value.ptr, value.ptr + length}; +} + +Literal DecimalLiteral(int128_t value, const PrimitiveType& iceberg_type) { + const auto& decimal_type = internal::checked_cast(iceberg_type); + return Literal::Decimal(value, decimal_type.precision(), decimal_type.scale()); +} + +Result DecimalLiteralFromBytes(std::span bytes, + const PrimitiveType& iceberg_type) { + ICEBERG_ASSIGN_OR_RAISE(auto decimal, + Decimal::FromBigEndian(bytes.data(), bytes.size())); + return DecimalLiteral(decimal.value(), iceberg_type); +} + +Result BinaryStatsLiteral(std::vector bytes, + const PrimitiveType& iceberg_type) { + switch (iceberg_type.type_id()) { + case TypeId::kString: + return Literal::String(std::string(bytes.begin(), bytes.end())); + case TypeId::kBinary: + return Literal::Binary(std::move(bytes)); + case TypeId::kFixed: + return Literal::Fixed(std::move(bytes)); + case TypeId::kUuid: { + ICEBERG_ASSIGN_OR_RAISE(auto uuid, Uuid::FromBytes(bytes)); + return Literal::UUID(std::move(uuid)); + } + case TypeId::kDecimal: + return DecimalLiteralFromBytes(bytes, iceberg_type); + default: + return InvalidArgument( + "Cannot convert Parquet binary statistics to Iceberg type {}", + iceberg_type.ToString()); + } +} + +Result Int32StatsLiteral(int32_t value, const PrimitiveType& iceberg_type) { + switch (iceberg_type.type_id()) { + case TypeId::kInt: + return Literal::Int(value); + case TypeId::kLong: + return Literal::Long(value); + case TypeId::kDate: + return Literal::Date(value); + case TypeId::kDecimal: + return DecimalLiteral(value, iceberg_type); + default: + return InvalidArgument("Cannot convert Parquet INT32 statistics to Iceberg type {}", + iceberg_type.ToString()); + } +} + +Result Int64StatsLiteral(int64_t value, const PrimitiveType& iceberg_type) { + switch (iceberg_type.type_id()) { + case TypeId::kLong: + return Literal::Long(value); + case TypeId::kTime: + return Literal::Time(value); + case TypeId::kTimestamp: + return Literal::Timestamp(value); + case TypeId::kTimestampTz: + return Literal::TimestampTz(value); + case TypeId::kTimestampNs: + return Literal::TimestampNs(value); + case TypeId::kTimestampTzNs: + return Literal::TimestampTzNs(value); + case TypeId::kDecimal: + return DecimalLiteral(value, iceberg_type); + default: + return InvalidArgument("Cannot convert Parquet INT64 statistics to Iceberg type {}", + iceberg_type.ToString()); + } +} + +Result FloatStatsLiteral(float value, const PrimitiveType& iceberg_type) { + switch (iceberg_type.type_id()) { + case TypeId::kFloat: + return Literal::Float(value); + case TypeId::kDouble: + return Literal::Double(value); + default: + return InvalidArgument("Cannot convert Parquet FLOAT statistics to Iceberg type {}", + iceberg_type.ToString()); + } +} + +bool IsFloatingType(const PrimitiveType& type) { + return type.type_id() == TypeId::kFloat || type.type_id() == TypeId::kDouble; +} + +bool NeedsBoundTruncation(const PrimitiveType& type) { + return type.type_id() == TypeId::kString || type.type_id() == TypeId::kBinary; +} + +Result StatsValueToLiteral(const ::parquet::ColumnDescriptor& column, + const PrimitiveType& iceberg_type, + const ::parquet::Statistics& stats, bool is_min) { + switch (column.physical_type()) { + case ::parquet::Type::BOOLEAN: + return TypedStatsLiteral<::parquet::BoolStatistics>( + stats, is_min, [](bool value) { return Literal::Boolean(value); }); + case ::parquet::Type::INT32: + return TypedStatsLiteral<::parquet::Int32Statistics>( + stats, is_min, + [&](int32_t value) { return Int32StatsLiteral(value, iceberg_type); }); + case ::parquet::Type::INT64: + return TypedStatsLiteral<::parquet::Int64Statistics>( + stats, is_min, + [&](int64_t value) { return Int64StatsLiteral(value, iceberg_type); }); + case ::parquet::Type::FLOAT: + return TypedStatsLiteral<::parquet::FloatStatistics>( + stats, is_min, + [&](float value) { return FloatStatsLiteral(value, iceberg_type); }); + case ::parquet::Type::DOUBLE: + return TypedStatsLiteral<::parquet::DoubleStatistics>( + stats, is_min, [](double value) { return Literal::Double(value); }); + case ::parquet::Type::BYTE_ARRAY: + return TypedStatsLiteral<::parquet::ByteArrayStatistics>( + stats, is_min, [&](const ::parquet::ByteArray& value) { + return BinaryStatsLiteral(BytesFromByteArray(value), iceberg_type); + }); + case ::parquet::Type::FIXED_LEN_BYTE_ARRAY: + return TypedStatsLiteral<::parquet::FLBAStatistics>( + stats, is_min, [&](const ::parquet::FixedLenByteArray& value) { + return BinaryStatsLiteral(BytesFromFLBA(value, column.type_length()), + iceberg_type); + }); + case ::parquet::Type::INT96: + case ::parquet::Type::UNDEFINED: + return NotSupported("Cannot convert Parquet statistics for physical type {}", + static_cast(column.physical_type())); + } + std::unreachable(); +} + /// \brief Collect counts (value count and null count) from footer statistics. /// \param field_id The Iceberg field ID. /// \param metadata The Parquet file metadata. @@ -105,6 +266,7 @@ Result> CollectBounds( int32_t field_id, std::shared_ptr iceberg_type, const ::parquet::FileMetaData& metadata, int32_t column_idx, int32_t truncate_length) { + auto column_desc = metadata.schema()->Column(column_idx); int64_t null_count = 0; int64_t value_count = 0; std::optional lower_bound; @@ -122,28 +284,24 @@ Result> CollectBounds( value_count += column_chunk->num_values(); if (stats->HasMinMax()) { - auto min_bytes = stats->EncodeMin(); - auto min_span = std::span( - reinterpret_cast(min_bytes.data()), min_bytes.size()); ICEBERG_ASSIGN_OR_RAISE(auto min_value, - Conversions::FromBytes(iceberg_type, min_span)); + StatsValueToLiteral(*column_desc, *iceberg_type, *stats, + /*is_min=*/true)); if (!lower_bound.has_value() || min_value < lower_bound.value()) { lower_bound = std::move(min_value); } - auto max_bytes = stats->EncodeMax(); - auto max_span = std::span( - reinterpret_cast(max_bytes.data()), max_bytes.size()); ICEBERG_ASSIGN_OR_RAISE(auto max_value, - Conversions::FromBytes(iceberg_type, max_span)); + StatsValueToLiteral(*column_desc, *iceberg_type, *stats, + /*is_min=*/false)); if (!upper_bound.has_value() || max_value > upper_bound.value()) { upper_bound = std::move(max_value); } } } - if (!lower_bound.has_value() || !upper_bound.has_value() || lower_bound->IsNaN() || - upper_bound->IsNaN()) { + if (!lower_bound.has_value() || !upper_bound.has_value() || + (IsFloatingType(*iceberg_type) && (lower_bound->IsNaN() || upper_bound->IsNaN()))) { return FieldMetrics{ .field_id = field_id, .value_count = value_count, @@ -151,19 +309,21 @@ Result> CollectBounds( }; } - ICEBERG_ASSIGN_OR_RAISE(auto truncated_lower, - TruncateUtils::TruncateLowerBound( - *iceberg_type, lower_bound.value(), truncate_length)); - ICEBERG_ASSIGN_OR_RAISE(auto truncated_upper, - TruncateUtils::TruncateUpperBound( - *iceberg_type, upper_bound.value(), truncate_length)); + if (NeedsBoundTruncation(*iceberg_type)) { + ICEBERG_ASSIGN_OR_RAISE( + lower_bound, TruncateUtils::TruncateLowerBound(*iceberg_type, lower_bound.value(), + truncate_length)); + ICEBERG_ASSIGN_OR_RAISE( + upper_bound, TruncateUtils::TruncateUpperBound(*iceberg_type, upper_bound.value(), + truncate_length)); + } return FieldMetrics{ .field_id = field_id, .value_count = value_count, .null_value_count = null_count, - .lower_bound = std::move(truncated_lower), - .upper_bound = std::move(truncated_upper), + .lower_bound = std::move(lower_bound), + .upper_bound = std::move(upper_bound), }; } @@ -187,19 +347,27 @@ Result> MetricsFromFieldMetrics( .null_value_count = fm.null_value_count, .nan_value_count = fm.nan_value_count}; - if (truncate_length > 0) { - if (fm.lower_bound.has_value()) { - ICEBERG_ASSIGN_OR_RAISE( - auto lower, TruncateUtils::TruncateLowerBound( - *primitive_type, fm.lower_bound.value(), truncate_length)); - result.lower_bound = std::move(lower); - } - if (fm.upper_bound.has_value()) { - ICEBERG_ASSIGN_OR_RAISE( - auto upper, TruncateUtils::TruncateUpperBound( - *primitive_type, fm.upper_bound.value(), truncate_length)); - result.upper_bound = std::move(upper); - } + if (truncate_length <= 0) { + return result; + } + + if (!NeedsBoundTruncation(*primitive_type)) { + result.lower_bound = fm.lower_bound; + result.upper_bound = fm.upper_bound; + return result; + } + + if (fm.lower_bound.has_value()) { + ICEBERG_ASSIGN_OR_RAISE( + result.lower_bound, + TruncateUtils::TruncateLowerBound(*primitive_type, fm.lower_bound.value(), + truncate_length)); + } + if (fm.upper_bound.has_value()) { + ICEBERG_ASSIGN_OR_RAISE( + result.upper_bound, + TruncateUtils::TruncateUpperBound(*primitive_type, fm.upper_bound.value(), + truncate_length)); } return result; @@ -279,6 +447,10 @@ class CollectMetricsVisitor { int32_t truncate_length = mode.TruncateLength(); const auto& primitive_type = internal::checked_pointer_cast(field.type()); + auto column_idx = FindColumnIndex(parquet_schema_, field_id); + if (column_idx.has_value()) { + metrics_.column_sizes[field_id] = CollectColumnSize(metadata_, column_idx.value()); + } ICEBERG_ASSIGN_OR_RAISE(auto field_metrics, MetricsFromFieldMetrics(field_id, field_metrics_, @@ -330,36 +502,10 @@ Result ParquetMetrics::GetMetrics( const std::unordered_map& field_metrics) { Metrics metrics; - // Collect row count and column sizes - int64_t row_count = 0; - for (int rg = 0; rg < metadata.num_row_groups(); ++rg) { - auto row_group = metadata.RowGroup(rg); - row_count += row_group->num_rows(); - for (int col = 0; col < row_group->num_columns(); ++col) { - auto column_chunk = row_group->ColumnChunk(col); - auto field_id_opt = GetFieldId(*parquet_schema.Column(col)); - if (!field_id_opt.has_value()) { - continue; - } - int32_t field_id = field_id_opt.value(); - - ICEBERG_ASSIGN_OR_RAISE(auto field_name, schema.FindColumnNameById(field_id)); - if (!field_name.has_value()) { - continue; - } - - MetricsMode mode = metrics_config.ColumnMode(field_name.value()); - if (mode.kind != MetricsMode::Kind::kNone) { - metrics.column_sizes[field_id] = - metrics.column_sizes.contains(field_id) - ? metrics.column_sizes[field_id] + column_chunk->total_compressed_size() - : column_chunk->total_compressed_size(); - } - } - } - metrics.row_count = row_count; + metrics.row_count = metadata.num_rows(); - // Collect metrics for all primitive fields + // Apply MetricsConfig while visiting schema fields, then collect footer metrics only + // for fields whose mode is not `none`. CollectMetricsVisitor visitor(parquet_schema, metrics_config, metadata, field_metrics, metrics); ICEBERG_RETURN_UNEXPECTED(visitor.VisitStruct(schema, "")); diff --git a/src/iceberg/parquet/parquet_metrics.h b/src/iceberg/parquet/parquet_metrics_internal.h similarity index 95% rename from src/iceberg/parquet/parquet_metrics.h rename to src/iceberg/parquet/parquet_metrics_internal.h index eb916241c..c78c114ab 100644 --- a/src/iceberg/parquet/parquet_metrics.h +++ b/src/iceberg/parquet/parquet_metrics_internal.h @@ -19,14 +19,13 @@ #pragma once -/// \file iceberg/parquet/parquet_metrics.h +/// \file iceberg/parquet/parquet_metrics_internal.h /// \brief Utilities for extracting metrics from Parquet files. #include #include -#include "iceberg/iceberg_bundle_export.h" #include "iceberg/metrics.h" #include "iceberg/metrics_config.h" #include "iceberg/result.h" @@ -35,7 +34,7 @@ namespace iceberg::parquet { /// \brief Utility class for computing metrics from Parquet files. -class ICEBERG_BUNDLE_EXPORT ParquetMetrics { +class ParquetMetrics { public: ParquetMetrics() = delete; diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index e91a2a6cf..da794cc3e 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -33,7 +34,7 @@ #include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" -#include "iceberg/parquet/parquet_metrics.h" +#include "iceberg/parquet/parquet_metrics_internal.h" #include "iceberg/schema_internal.h" #include "iceberg/util/macros.h" @@ -94,6 +95,11 @@ class ParquetWriter::Impl { auto properties_builder = ::parquet::WriterProperties::Builder(); properties_builder.compression(compression); + auto max_row_group_rows = + options.properties.Get(WriterProperties::kParquetMaxRowGroupRows); + ICEBERG_PRECHECK(max_row_group_rows > 0, + "Parquet max row group rows must be greater than 0"); + properties_builder.max_row_group_length(max_row_group_rows); if (compression_level.has_value()) { properties_builder.compression_level(compression_level.value()); } @@ -142,12 +148,11 @@ class ParquetWriter::Impl { } ICEBERG_ARROW_RETURN_NOT_OK(writer_->Close()); - auto& metadata = writer_->metadata(); - split_offsets_.reserve(metadata->num_row_groups()); - for (int i = 0; i < metadata->num_row_groups(); ++i) { - split_offsets_.push_back(metadata->RowGroup(i)->file_offset()); - } metadata_ = writer_->metadata(); + split_offsets_.reserve(metadata_->num_row_groups()); + for (int i = 0; i < metadata_->num_row_groups(); ++i) { + split_offsets_.push_back(metadata_->RowGroup(i)->file_offset()); + } writer_.reset(); ICEBERG_ARROW_ASSIGN_OR_RETURN(total_bytes_, output_stream_->Tell()); @@ -171,15 +176,12 @@ class ParquetWriter::Impl { std::vector split_offsets() const { return split_offsets_; } Result metrics() { - if (writer_) { - return Invalid("Cannot return metrics for unclosed writer"); - } - if (!metadata_) { - return Metrics(); - } + ICEBERG_PRECHECK(writer_ == nullptr, "Cannot return metrics for unclosed writer"); + ICEBERG_PRECHECK(metadata_ != nullptr, + "Cannot return metrics because Parquet metadata is not available"); // TODO(WZhuo): collect write-side FieldMetrics to support NaN value counts. return ParquetMetrics::GetMetrics(*schema_, *parquet_schema_, *metrics_config_, - *metadata_, {}); + *metadata_); } private: diff --git a/src/iceberg/test/metrics_test_base.cc b/src/iceberg/test/metrics_test_base.cc index cc5f7cd60..7913a7207 100644 --- a/src/iceberg/test/metrics_test_base.cc +++ b/src/iceberg/test/metrics_test_base.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" @@ -80,6 +81,17 @@ void MetricsTestBase::AssertCounts(int field_id, } } +void MetricsTestBase::AssertColumnSizeFields(std::vector expected_field_ids, + const Metrics& metrics) { + std::vector actual_field_ids; + actual_field_ids.reserve(metrics.column_sizes.size()); + for (const auto& [field_id, size] : metrics.column_sizes) { + EXPECT_GT(size, 0) << "Field " << field_id << " should have a positive size"; + actual_field_ids.push_back(field_id); + } + EXPECT_THAT(actual_field_ids, testing::UnorderedElementsAreArray(expected_field_ids)); +} + template void MetricsTestBase::AssertBounds(int field_id, std::shared_ptr type, std::optional expected_lower, @@ -91,6 +103,8 @@ void MetricsTestBase::AssertBounds(int field_id, std::shared_ptr const auto& literal = metrics.lower_bounds.at(field_id); ASSERT_FALSE(literal.IsNull()) << "Field " << field_id << " lower bound literal should not be null"; + EXPECT_EQ(*literal.type(), *type) + << "Field " << field_id << " lower bound literal type mismatch"; EXPECT_EQ(std::get(literal.value()), expected_lower.value()) << "Field " << field_id << " lower bound mismatch"; } else { @@ -103,6 +117,8 @@ void MetricsTestBase::AssertBounds(int field_id, std::shared_ptr const auto& literal = metrics.upper_bounds.at(field_id); ASSERT_FALSE(literal.IsNull()) << "Field " << field_id << " upper bound literal should not be null"; + EXPECT_EQ(*literal.type(), *type) + << "Field " << field_id << " upper bound literal type mismatch"; EXPECT_EQ(std::get(literal.value()), expected_upper.value()) << "Field " << field_id << " upper bound mismatch"; } else { @@ -208,12 +224,12 @@ void MetricsTestBase::MetricsForRepeatedValues() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 2); + AssertColumnSizeFields({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, metrics); AssertCounts(1, 2, 0, metrics); AssertCounts(2, 2, 0, metrics); AssertCounts(3, 2, 1, metrics); - // TODO(WZhuo) Assert NaN metrics - AssertCounts(4, 2, 0, metrics); // floatCol has 2 NaN values + AssertCounts(4, 2, 0, metrics); AssertCounts(5, 2, 0, metrics); AssertCounts(6, 2, 1, metrics); AssertCounts(7, 2, 0, metrics); @@ -317,17 +333,13 @@ void MetricsTestBase::MetricsForDecimals() { EXPECT_EQ(*metrics.row_count, 1); AssertCounts(1, 1, 0, metrics); - // For decimals, bounds exist but we just check they're present - EXPECT_TRUE(metrics.lower_bounds.contains(1)); - EXPECT_TRUE(metrics.upper_bounds.contains(1)); + AssertBounds(1, decimal(4, 2), Decimal(255), Decimal(255), metrics); AssertCounts(2, 1, 0, metrics); - EXPECT_TRUE(metrics.lower_bounds.contains(2)); - EXPECT_TRUE(metrics.upper_bounds.contains(2)); + AssertBounds(2, decimal(14, 2), Decimal(475), Decimal(475), metrics); AssertCounts(3, 1, 0, metrics); - EXPECT_TRUE(metrics.lower_bounds.contains(3)); - EXPECT_TRUE(metrics.upper_bounds.contains(3)); + AssertBounds(3, decimal(22, 2), Decimal(580), Decimal(580), metrics); } void MetricsTestBase::MetricsForNestedStructFields() { @@ -338,6 +350,7 @@ void MetricsTestBase::MetricsForNestedStructFields() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 1); + AssertColumnSizeFields({1, 3, 5, 6, 7}, metrics); AssertCounts(1, 1, 0, metrics); AssertBounds(1, int32(), std::numeric_limits::min(), @@ -353,7 +366,6 @@ void MetricsTestBase::MetricsForNestedStructFields() { AssertBounds>(6, binary(), std::vector{'A'}, std::vector{'A'}, metrics); - // TODO(WZhuo) Assert NaN metrics AssertCounts(7, 1L, 0L, metrics); AssertBounds(7, float64(), std::nullopt, std::nullopt, metrics); } @@ -373,6 +385,7 @@ void MetricsTestBase::MetricsModeForNestedStructFields() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 1); + AssertColumnSizeFields({3}, metrics); // Only field 3 (nestedStructCol.longCol) should have bounds EXPECT_EQ(metrics.lower_bounds.size(), 1); @@ -460,6 +473,7 @@ void MetricsTestBase::MetricsForListAndMapElements() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 1); + AssertColumnSizeFields({}, metrics); // For list and map elements, metrics should not be collected // Field IDs: 1 (leafIntCol), 2 (leafStringCol), 4 (list element), 6 (map key), 7 (map @@ -468,6 +482,7 @@ void MetricsTestBase::MetricsForListAndMapElements() { AssertCounts(2, std::nullopt, std::nullopt, metrics); AssertCounts(4, std::nullopt, std::nullopt, metrics); AssertCounts(6, std::nullopt, std::nullopt, metrics); + AssertCounts(7, std::nullopt, std::nullopt, metrics); AssertBounds(1, int32(), std::nullopt, std::nullopt, metrics); AssertBounds(2, string(), std::nullopt, std::nullopt, metrics); @@ -526,7 +541,6 @@ void MetricsTestBase::MetricsForNaNColumns() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 2); - // TODO(WZhuo) Assert NaN metrics AssertCounts(1, 2, 0, metrics); AssertCounts(2, 2, 0, metrics); @@ -565,7 +579,6 @@ void MetricsTestBase::ColumnBoundsWithNaNValueAtFront() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 3); - // TODO(WZhuo) Assert NaN metrics AssertCounts(1, 3, 0, metrics); AssertCounts(2, 3, 0, metrics); @@ -664,6 +677,8 @@ void MetricsTestBase::MetricsForTopLevelWithMultipleRowGroup() { if (SupportsSmallRowGroups()) { ICEBERG_UNWRAP_OR_FAIL(auto split_count, GetSplitCount()); EXPECT_EQ(split_count, 3); + } else { + FAIL() << "This test must force multiple row groups"; } ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; @@ -694,6 +709,8 @@ void MetricsTestBase::MetricsForNestedStructFieldsWithMultipleRowGroup() { if (SupportsSmallRowGroups()) { ICEBERG_UNWRAP_OR_FAIL(auto split_count, GetSplitCount()); EXPECT_EQ(split_count, 3); + } else { + FAIL() << "This test must force multiple row groups"; } ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 201); @@ -732,7 +749,7 @@ void MetricsTestBase::NoneMetricsMode() { EXPECT_EQ(*metrics.row_count, 1); // In None mode, column_sizes should be empty - EXPECT_TRUE(metrics.column_sizes.empty()); + AssertColumnSizeFields({}, metrics); // All counts should be null AssertCounts(1, std::nullopt, std::nullopt, metrics); @@ -761,7 +778,7 @@ void MetricsTestBase::CountsMetricsMode() { EXPECT_EQ(*metrics.row_count, 1); // In Counts mode, column_sizes should not be empty - EXPECT_FALSE(metrics.column_sizes.empty()); + AssertColumnSizeFields({1, 3, 5, 6, 7}, metrics); // Counts should be present but bounds should be null AssertCounts(1, 1, 0, metrics); @@ -790,7 +807,7 @@ void MetricsTestBase::FullMetricsMode() { EXPECT_EQ(*metrics.row_count, 1); // In Full mode, column_sizes should not be empty - EXPECT_FALSE(metrics.column_sizes.empty()); + AssertColumnSizeFields({1, 3, 5, 6, 7}, metrics); // Both counts and bounds should be present AssertCounts(1, 1, 0, metrics); diff --git a/src/iceberg/test/metrics_test_base.h b/src/iceberg/test/metrics_test_base.h index 1ad9c8823..07b3b62f3 100644 --- a/src/iceberg/test/metrics_test_base.h +++ b/src/iceberg/test/metrics_test_base.h @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -67,6 +68,9 @@ class MetricsTestBase { std::optional expected_null_count, std::optional expected_nan_count, const Metrics& metrics); + void AssertColumnSizeFields(std::vector expected_field_ids, + const Metrics& metrics); + template void AssertBounds(int field_id, std::shared_ptr type, std::optional expected_lower, std::optional expected_upper, diff --git a/src/iceberg/test/parquet_metrics_test.cc b/src/iceberg/test/parquet_metrics_test.cc index 93c024b01..8286efe08 100644 --- a/src/iceberg/test/parquet_metrics_test.cc +++ b/src/iceberg/test/parquet_metrics_test.cc @@ -17,6 +17,7 @@ * under the License. */ +#include #include #include #include @@ -27,7 +28,9 @@ #include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/file_writer.h" +#include "iceberg/parquet/parquet_metrics_internal.h" #include "iceberg/parquet/parquet_register.h" +#include "iceberg/test/matchers.h" #include "iceberg/test/metrics_test_base.h" #include "iceberg/util/checked_cast.h" @@ -40,8 +43,10 @@ class ParquetMetricsTest : public MetricsTestBase, public ::testing::Test { void SetUp() override { MetricsTestBase::SetUp(); temp_parquet_file_ = "parquet_metrics_test.parquet"; - writer_properties_ = WriterProperties::FromMap( - {{WriterProperties::kParquetCompression.key(), "uncompressed"}}); + writer_properties_ = WriterProperties::FromMap({ + {WriterProperties::kParquetCompression.key(), "uncompressed"}, + {WriterProperties::kParquetMaxRowGroupRows.key(), "100"}, + }); } Result GetMetrics(std::shared_ptr schema, @@ -76,7 +81,31 @@ class ParquetMetricsTest : public MetricsTestBase, public ::testing::Test { return metadata->num_row_groups(); } - bool SupportsSmallRowGroups() const override { return false; } + Result GetMetricsWithFieldMetrics( + std::shared_ptr schema, std::shared_ptr config, + std::shared_ptr<::arrow::Array> records, + const std::unordered_map& field_metrics) { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, WriterFactoryRegistry::Open(FileFormatType::kParquet, + {.path = temp_parquet_file_, + .schema = schema, + .io = file_io_, + .metadata = {}, + .metrics_config = config, + .properties = writer_properties_})); + ArrowArray arr; + ICEBERG_ARROW_RETURN_NOT_OK(::arrow::ExportArray(*records, &arr)); + ICEBERG_RETURN_UNEXPECTED(writer->Write(&arr)); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + + auto io = internal::checked_cast(*file_io_); + auto infile = io.fs()->OpenInputFile(temp_parquet_file_).ValueOrDie(); + auto metadata = ::parquet::ReadMetaData(infile); + return parquet::ParquetMetrics::GetMetrics(*schema, *metadata->schema(), *config, + *metadata, field_metrics); + } + + bool SupportsSmallRowGroups() const override { return true; } private: std::string temp_parquet_file_; @@ -85,4 +114,66 @@ class ParquetMetricsTest : public MetricsTestBase, public ::testing::Test { DEFINE_METRICS_TESTS(ParquetMetricsTest); +TEST_F(ParquetMetricsTest, FieldMetricsOverrideFooterStats) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "floatCol", float32()), + SchemaField::MakeOptional(2, "strCol", string()), + }); + auto arrow_schema = ::arrow::schema({ + ::arrow::field("floatCol", ::arrow::float32(), true), + ::arrow::field("strCol", ::arrow::utf8(), true), + }); + auto records = CreateRecordArrays(arrow_schema, R"([ + {"floatCol": 1.0, "strCol": "footer-value"} + ])"); + std::unordered_map properties = { + {"write.metadata.metrics.default", "truncate(3)"}}; + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + + std::unordered_map field_metrics{ + {1, FieldMetrics{.field_id = 1, + .value_count = 10, + .null_value_count = 2, + .lower_bound = Literal::Float(5.0F), + .upper_bound = Literal::Float(9.0F)}}, + {2, FieldMetrics{.field_id = 2, + .value_count = 10, + .null_value_count = 1, + .lower_bound = Literal::String("abcdef"), + .upper_bound = Literal::String("abcxyz")}}, + }; + + ICEBERG_UNWRAP_OR_FAIL( + auto metrics, GetMetricsWithFieldMetrics(schema, config, records, field_metrics)); + + AssertCounts(1, 10, 2, metrics); + AssertBounds(1, float32(), 5.0F, 9.0F, metrics); + AssertCounts(2, 10, 1, metrics); + AssertBounds(2, string(), std::string("abc"), std::string("abd"), metrics); +} + +TEST_F(ParquetMetricsTest, UnrepresentableTruncatedUpperBoundIsOmitted) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "binCol", binary()), + }); + auto arrow_schema = ::arrow::schema({ + ::arrow::field("binCol", ::arrow::binary(), false), + }); + + ::arrow::BinaryBuilder builder; + std::vector data = {0xFF, 0xFF, 0x01}; + ASSERT_TRUE(builder.Append(data.data(), data.size()).ok()); + auto array = builder.Finish().ValueOrDie(); + auto records = ::arrow::StructArray::Make({array}, arrow_schema->fields()).ValueOrDie(); + std::unordered_map properties = { + {"write.metadata.metrics.default", "truncate(2)"}}; + ICEBERG_UNWRAP_OR_FAIL(auto config, MetricsConfig::Make(properties)); + + ICEBERG_UNWRAP_OR_FAIL(auto metrics, GetMetrics(schema, config, records)); + + AssertCounts(1, 1, 0, metrics); + AssertBounds>(1, binary(), std::vector({0xFF, 0xFF}), + std::nullopt, metrics); +} + } // namespace iceberg::test diff --git a/src/iceberg/util/truncate_util.cc b/src/iceberg/util/truncate_util.cc index 8a1d07243..1778000f9 100644 --- a/src/iceberg/util/truncate_util.cc +++ b/src/iceberg/util/truncate_util.cc @@ -179,7 +179,7 @@ Result> TruncateLiteralMaxImpl( if (!truncated.has_value()) { return std::nullopt; } - return std::optional(Literal::String(std::move(truncated.value()))); + return Literal::String(std::move(*truncated)); } template <> @@ -187,7 +187,7 @@ Result> TruncateLiteralMaxImpl( const Literal& literal, int32_t width) { const auto& data = std::get>(literal.value()); if (static_cast(data.size()) <= width) { - return std::optional(literal); + return literal; } std::vector truncated(data.begin(), data.begin() + width); @@ -195,7 +195,7 @@ Result> TruncateLiteralMaxImpl( if (*it < 0xFF) { ++(*it); truncated.resize(truncated.size() - std::distance(truncated.rbegin(), it)); - return std::optional(Literal::Binary(std::move(truncated))); + return Literal::Binary(std::move(truncated)); } } return std::nullopt; @@ -207,7 +207,7 @@ Result> TruncateUtils::TruncateUTF8Max( const std::string& source, size_t L) { std::string truncated = TruncateUTF8(source, L); if (truncated == source) { - return std::optional(std::move(truncated)); + return truncated; } // Try incrementing code points from the end @@ -236,7 +236,7 @@ Result> TruncateUtils::TruncateUTF8Max( if (next_code_point <= kUtf8MaxCodePoint) { truncated.resize(cp_start); AppendUtf8CodePoint(next_code_point, truncated); - return std::optional(std::move(truncated)); + return truncated; } } last_cp_start = cp_start; @@ -282,7 +282,7 @@ Result> TruncateUtils::TruncateLiteralMax(const Literal& int32_t width) { if (literal.IsNull()) [[unlikely]] { // Return null as is - return std::optional(literal); + return literal; } if (literal.IsAboveMax() || literal.IsBelowMin()) [[unlikely]] { @@ -316,7 +316,7 @@ Result> TruncateUtils::TruncateUpperBound( case TypeId::kBinary: return TruncateLiteralMax(value, length); default: - return std::optional(value); + return value; } } From e599010ef210d0be073815f493339cf6029a9a6a Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Wed, 27 May 2026 05:16:00 +0200 Subject: [PATCH 045/151] feat(data): coalesce position deletes into range inserts (#645) Add ForEachPositionDelete (the C++ equivalent of Java's PositionDeleteRangeConsumer) and route DeleteLoader through it, replacing the per-position PositionDeleteIndex::Delete(pos) call. The function sniffs a 1024-position prefix and dispatches to either run coalescing (CRoaring addRange) or bulk addMany grouped by high-32-bit key. Also rework DeleteLoader::LoadPositionDelete to read Arrow batches via nanoarrow's ArrowArrayView directly. When the delete file's referenced_data_file matches the target (V2 writer hint), positions are passed as a zero-copy span; otherwise a per-batch staging vector filters by path. Local microbenchmarks: 2.2x-10.6x for ForEachPositionDelete and 2.1x-2.5x end-to-end through LoadPositionDeletes. Equivalent of apache/iceberg#16052. --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/data/delete_loader.cc | 98 ++++++++-- src/iceberg/deletes/position_delete_index.cc | 5 + src/iceberg/deletes/position_delete_index.h | 11 ++ .../deletes/position_delete_range_consumer.cc | 145 +++++++++++++++ .../deletes/position_delete_range_consumer.h | 44 +++++ .../deletes/roaring_position_bitmap.cc | 6 + src/iceberg/deletes/roaring_position_bitmap.h | 9 + src/iceberg/meson.build | 1 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/delete_loader_test.cc | 32 ++++ src/iceberg/test/meson.build | 1 + .../position_delete_range_consumer_test.cc | 175 ++++++++++++++++++ 13 files changed, 515 insertions(+), 14 deletions(-) create mode 100644 src/iceberg/deletes/position_delete_range_consumer.cc create mode 100644 src/iceberg/deletes/position_delete_range_consumer.h create mode 100644 src/iceberg/test/position_delete_range_consumer_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 672cf54a8..7be689f8d 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -171,6 +171,7 @@ set(ICEBERG_DATA_SOURCES data/position_delete_writer.cc data/writer.cc deletes/position_delete_index.cc + deletes/position_delete_range_consumer.cc deletes/roaring_position_bitmap.cc puffin/file_metadata.cc puffin/json_serde.cc diff --git a/src/iceberg/data/delete_loader.cc b/src/iceberg/data/delete_loader.cc index 35bc926ba..922173401 100644 --- a/src/iceberg/data/delete_loader.cc +++ b/src/iceberg/data/delete_loader.cc @@ -19,14 +19,21 @@ #include "iceberg/data/delete_loader.h" +#include +#include #include #include +#include + +#include "iceberg/arrow/nanoarrow_status_internal.h" #include "iceberg/arrow_c_data_guard_internal.h" #include "iceberg/deletes/position_delete_index.h" +#include "iceberg/deletes/position_delete_range_consumer.h" #include "iceberg/file_reader.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/metadata_columns.h" +#include "iceberg/result.h" #include "iceberg/row/arrow_array_wrapper.h" #include "iceberg/schema.h" #include "iceberg/util/macros.h" @@ -57,6 +64,25 @@ Result> OpenDeleteFile(const DataFile& file, return ReaderFactoryRegistry::Open(file.file_format, options); } +/// Raw `int64` values buffer (offset-adjusted). Skips the validity bitmap: +/// `kDeleteFilePos` is required by the V2 spec. +const int64_t* Int64ValuesBuffer(const ArrowArrayView* view) { + return view->buffer_views[1].data.as_int64 + view->offset; +} + +/// String-equals at `row_idx` via nanoarrow's unsafe direct-buffer access. +/// Skips the validity bitmap: `kDeleteFilePath` is required by the V2 spec. +bool StringEquals(const ArrowArrayView* view, int64_t row_idx, std::string_view target) { + ArrowStringView sv = ArrowArrayViewGetStringUnsafe(view, row_idx); + if (static_cast(sv.size_bytes) != target.size()) { + return false; + } + if (target.empty()) { + return true; + } + return sv.data != nullptr && std::memcmp(sv.data, target.data(), target.size()) == 0; +} + } // namespace DeleteLoader::DeleteLoader(std::shared_ptr io) : io_(std::move(io)) {} @@ -71,6 +97,28 @@ Status DeleteLoader::LoadPositionDelete(const DataFile& file, PositionDeleteInde ICEBERG_ASSIGN_OR_RAISE(auto arrow_schema, reader->Schema()); internal::ArrowSchemaGuard schema_guard(&arrow_schema); + // Reused across batches; reads child buffers directly to avoid the + // per-row `Scalar` dispatch in `ArrowArrayStructLike`. + ArrowArrayView array_view; + internal::ArrowArrayViewGuard view_guard(&array_view); + ArrowError error; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayViewInitFromSchema(&array_view, &arrow_schema, &error), error); + + // Fast path when the writer's `referenced_data_file` hint matches our + // target: skip the path column, hand `pos_data` straight to + // `ForEachPositionDelete`. Trusts the hint -- spec-compliant writers + // only set it when all rows share one data file. + const bool use_referenced_data_file_fast_path = + file.referenced_data_file.has_value() && + file.referenced_data_file.value() == data_file_path; + + // Filter-path staging buffer; reused across batches via `clear()`. + std::vector positions; + // Scratch buffer for `ForEachPositionDelete`'s bulk dispatch path; + // reused across batches and across both routing branches. + std::vector bulk_scratch; + while (true) { ICEBERG_ASSIGN_OR_RAISE(auto batch_opt, reader->Next()); if (!batch_opt.has_value()) break; @@ -78,23 +126,45 @@ Status DeleteLoader::LoadPositionDelete(const DataFile& file, PositionDeleteInde auto& batch = batch_opt.value(); internal::ArrowArrayGuard batch_guard(&batch); - ICEBERG_ASSIGN_OR_RAISE( - auto row, ArrowArrayStructLike::Make(arrow_schema, batch, /*row_index=*/0)); + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayViewSetArray(&array_view, &batch, &error), error); - for (int64_t i = 0; i < batch.length; ++i) { - if (i > 0) { - ICEBERG_RETURN_UNEXPECTED(row->Reset(i)); - } - // Field 0: file_path - ICEBERG_ASSIGN_OR_RAISE(auto path_scalar, row->GetField(0)); - auto path = std::get(path_scalar); - - if (path == data_file_path) { - // Field 1: pos - ICEBERG_ASSIGN_OR_RAISE(auto pos_scalar, row->GetField(1)); - index.Delete(std::get(pos_scalar)); + const int64_t length = batch.length; + if (length <= 0) { + continue; + } + + // Child indices must match `PosDeleteSchema()`: 0 = file_path, 1 = pos. + const ArrowArrayView* path_view = array_view.children[0]; + const ArrowArrayView* pos_view = array_view.children[1]; + + // V2 spec marks pos and file_path as required (NOT NULL). The direct + // buffer access below skips the validity bitmap, so a non-compliant + // batch would silently corrupt the index. Fail fast instead. + if (ArrowArrayViewComputeNullCount(pos_view) != 0 || + ArrowArrayViewComputeNullCount(path_view) != 0) { + return InvalidArrowData( + "position delete file has null values in required pos/file_path columns"); + } + + const int64_t* pos_data = Int64ValuesBuffer(pos_view); + + if (use_referenced_data_file_fast_path) { + ForEachPositionDelete(std::span(pos_data, length), index, + bulk_scratch); + continue; + } + + positions.clear(); + if (positions.capacity() < static_cast(length)) { + positions.reserve(static_cast(length)); + } + for (int64_t i = 0; i < length; ++i) { + if (StringEquals(path_view, i, data_file_path)) { + positions.push_back(pos_data[i]); } } + ForEachPositionDelete(positions, index, bulk_scratch); } return reader->Close(); diff --git a/src/iceberg/deletes/position_delete_index.cc b/src/iceberg/deletes/position_delete_index.cc index 0ff8f8303..f09d0b480 100644 --- a/src/iceberg/deletes/position_delete_index.cc +++ b/src/iceberg/deletes/position_delete_index.cc @@ -39,4 +39,9 @@ void PositionDeleteIndex::Merge(const PositionDeleteIndex& other) { bitmap_.Or(other.bitmap_); } +void PositionDeleteIndex::BulkAddForKey(int32_t key, + std::span positions) { + bitmap_.AddManyForKey(key, positions); +} + } // namespace iceberg diff --git a/src/iceberg/deletes/position_delete_index.h b/src/iceberg/deletes/position_delete_index.h index 5de82a591..592216ed6 100644 --- a/src/iceberg/deletes/position_delete_index.h +++ b/src/iceberg/deletes/position_delete_index.h @@ -24,6 +24,8 @@ #include #include +#include +#include #include "iceberg/deletes/roaring_position_bitmap.h" #include "iceberg/iceberg_data_export.h" @@ -65,6 +67,15 @@ class ICEBERG_DATA_EXPORT PositionDeleteIndex { void Merge(const PositionDeleteIndex& other); private: + // Bulk-add positions sharing high-32-bit `key`. Private hook for + // `ForEachPositionDelete`'s bulk path; keeps `Delete` the sole public + // mutation surface. + void BulkAddForKey(int32_t key, std::span positions); + + friend void ICEBERG_DATA_EXPORT + ForEachPositionDelete(std::span positions, PositionDeleteIndex& target, + std::vector& scratch); + RoaringPositionBitmap bitmap_; }; diff --git a/src/iceberg/deletes/position_delete_range_consumer.cc b/src/iceberg/deletes/position_delete_range_consumer.cc new file mode 100644 index 000000000..f7cf258c3 --- /dev/null +++ b/src/iceberg/deletes/position_delete_range_consumer.cc @@ -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. + */ + +#include "iceberg/deletes/position_delete_range_consumer.h" + +#include +#include +#include +#include + +#include "iceberg/deletes/position_delete_index.h" +#include "iceberg/deletes/roaring_position_bitmap.h" + +namespace iceberg { + +namespace { + +bool IsValidPosition(int64_t pos) { + return pos >= 0 && pos <= RoaringPositionBitmap::kMaxPosition; +} + +// Unsigned subtraction so negative or wrap-around input can't +// false-positive via signed overflow. +bool IsAdjacent(int64_t prev, int64_t next) { + return (static_cast(next) - static_cast(prev)) == 1; +} + +// `RoaringPositionBitmap` shards positions by their high 32 bits; the +// bulk path groups by this key before flushing via `BulkAddForKey`. +int32_t HighKeyFromPosition(int64_t pos) { return static_cast(pos >> 32); } + +// Emit `[range_start, last_position]`, collapsing singletons. Callers +// pre-filter via `IsValidPosition`, so `last_position + 1` cannot overflow. +void EmitRange(PositionDeleteIndex& target, int64_t range_start, int64_t last_position) { + if (range_start == last_position) { + target.Delete(range_start); + } else { + target.Delete(range_start, last_position + 1); + } +} + +// Emit closed-interval runs; out-of-range positions are silently skipped +// to match `Delete(pos)`. +void CoalesceIntoRanges(std::span positions, PositionDeleteIndex& target) { + const size_t n = positions.size(); + + size_t i = 0; + while (i < n && !IsValidPosition(positions[i])) { + ++i; + } + if (i == n) { + return; + } + + int64_t range_start = positions[i]; + int64_t last_position = range_start; + ++i; + + for (; i < n; ++i) { + const int64_t pos = positions[i]; + if (!IsValidPosition(pos)) { + continue; + } + if (!IsAdjacent(last_position, pos)) { + EmitRange(target, range_start, last_position); + range_start = pos; + } + last_position = pos; + } + + EmitRange(target, range_start, last_position); +} + +} // namespace + +void ForEachPositionDelete(std::span positions, + PositionDeleteIndex& target, std::vector& scratch) { + if (positions.empty()) { + return; + } + + // Below this size the bulk path's fixed overhead beats any coalescing win. + constexpr size_t kMinSniffSize = 64; + if (positions.size() < kMinSniffSize) { + CoalesceIntoRanges(positions, target); + return; + } + + // Bounded prefix size for the boundary-density estimate. + constexpr size_t kSniffSize = 1024; + // Above this boundary density take the bulk path; below it stay on coalesce. + constexpr size_t kBulkThresholdPercent = 10; + + const size_t sniff = std::min(positions.size(), kSniffSize); + size_t boundaries = 0; + for (size_t i = 1; i < sniff; ++i) { + boundaries += static_cast(!IsAdjacent(positions[i - 1], positions[i])); + } + + // boundaries / (sniff - 1) > kBulkThresholdPercent / 100, without FP. + if (boundaries * 100 > (sniff - 1) * kBulkThresholdPercent) { + // Bulk path: group by high-32-bit key, flush each group via CRoaring's + // `addMany` (through `BulkAddForKey`). Reuses the caller-owned `scratch` + // vector across key groups -- cleared between groups, capacity retained. + const size_t n = positions.size(); + size_t i = 0; + while (i < n) { + while (i < n && !IsValidPosition(positions[i])) { + ++i; + } + if (i == n) { + break; + } + const int32_t key = HighKeyFromPosition(positions[i]); + scratch.clear(); + while (i < n && IsValidPosition(positions[i]) && + HighKeyFromPosition(positions[i]) == key) { + scratch.push_back(static_cast(positions[i] & 0xFFFFFFFFu)); + ++i; + } + target.BulkAddForKey(key, scratch); + } + return; + } + + CoalesceIntoRanges(positions, target); +} + +} // namespace iceberg diff --git a/src/iceberg/deletes/position_delete_range_consumer.h b/src/iceberg/deletes/position_delete_range_consumer.h new file mode 100644 index 000000000..69d1c33d7 --- /dev/null +++ b/src/iceberg/deletes/position_delete_range_consumer.h @@ -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. + */ + +#pragma once + +#include +#include +#include + +#include "iceberg/iceberg_data_export.h" + +namespace iceberg { + +class PositionDeleteIndex; + +/// \brief Apply `positions` to `target` as deletes; semantically equivalent +/// to calling `target.Delete(pos)` for each entry. Out-of-range positions +/// are silently ignored. Sorted, mostly-contiguous input is fastest. +/// +/// \param scratch Caller-owned reusable buffer for the bulk dispatch path. +/// Cleared and reused per key group; retain across calls to amortize +/// allocations. Pass a distinct `scratch` per thread when calling +/// concurrently with disjoint `target`. +void ICEBERG_DATA_EXPORT ForEachPositionDelete(std::span positions, + PositionDeleteIndex& target, + std::vector& scratch); + +} // namespace iceberg diff --git a/src/iceberg/deletes/roaring_position_bitmap.cc b/src/iceberg/deletes/roaring_position_bitmap.cc index 2bf749589..e31efeec1 100644 --- a/src/iceberg/deletes/roaring_position_bitmap.cc +++ b/src/iceberg/deletes/roaring_position_bitmap.cc @@ -105,6 +105,12 @@ void RoaringPositionBitmap::Add(int64_t pos) { impl_->bitmaps[key].add(pos32); } +void RoaringPositionBitmap::AddManyForKey(int32_t key, + std::span positions) { + impl_->AllocateBitmapsIfNeeded(key + 1); + impl_->bitmaps[key].addMany(positions.size(), positions.data()); +} + void RoaringPositionBitmap::AddRange(int64_t pos_start, int64_t pos_end) { pos_start = std::max(pos_start, int64_t{0}); pos_end = std::min(pos_end, kMaxPosition + 1); diff --git a/src/iceberg/deletes/roaring_position_bitmap.h b/src/iceberg/deletes/roaring_position_bitmap.h index 8d4b3586d..bfb7d7c9e 100644 --- a/src/iceberg/deletes/roaring_position_bitmap.h +++ b/src/iceberg/deletes/roaring_position_bitmap.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,8 @@ namespace iceberg { +class PositionDeleteIndex; + /// \brief A bitmap that supports positive 64-bit positions, optimized /// for cases where most positions fit in 32 bits. /// @@ -110,6 +113,12 @@ class ICEBERG_DATA_EXPORT RoaringPositionBitmap { std::unique_ptr impl_; explicit RoaringPositionBitmap(std::unique_ptr impl); + + // Bulk-add positions sharing high-32-bit `key`. Internal hook for + // `PositionDeleteIndex::BulkAddForKey`; per-key grouping is the caller's + // job, keeping this a thin wrapper around CRoaring's `addMany`. + void AddManyForKey(int32_t key, std::span positions); + friend class PositionDeleteIndex; }; } // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 69fe733be..48b5d4250 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -152,6 +152,7 @@ iceberg_data_sources = files( 'data/position_delete_writer.cc', 'data/writer.cc', 'deletes/position_delete_index.cc', + 'deletes/position_delete_range_consumer.cc', 'deletes/roaring_position_bitmap.cc', 'puffin/file_metadata.cc', 'puffin/json_serde.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index b415154d6..d9059c567 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -131,6 +131,7 @@ add_iceberg_test(util_test math_util_internal_test.cc roaring_position_bitmap_test.cc position_delete_index_test.cc + position_delete_range_consumer_test.cc retry_util_test.cc string_util_test.cc struct_like_set_test.cc diff --git a/src/iceberg/test/delete_loader_test.cc b/src/iceberg/test/delete_loader_test.cc index c365b8bac..b392065cf 100644 --- a/src/iceberg/test/delete_loader_test.cc +++ b/src/iceberg/test/delete_loader_test.cc @@ -169,6 +169,10 @@ TEST_F(DeleteLoaderTest, LoadPositionDeletesFiltersByDataFilePath) { {"data_b.parquet", 10}, {"data_b.parquet", 20}}); + // Mixed paths -> writer must NOT set the hint, forcing the loader's + // per-row filter path. Locks the routing in case the writer behavior changes. + ASSERT_FALSE(delete_file->referenced_data_file.has_value()); + std::vector> files = {delete_file}; // Load only positions for data_a.parquet @@ -207,6 +211,34 @@ TEST_F(DeleteLoaderTest, LoadPositionDeletesSkipsMismatchedReferencedDataFile) { ASSERT_TRUE(result.value().IsEmpty()); } +TEST_F(DeleteLoaderTest, LoadPositionDeletesFastPathHonorsReferencedDataFile) { + // Single-file writes -> writer sets referenced_data_file -> loader takes + // the zero-copy fast path. Sized above the consumer's 64-element sniff + // threshold so the dispatcher's real coalesce/bulk logic runs end-to-end, + // not just the small-input shortcut covered by LoadPositionDeletesSingleFile. + constexpr int64_t kRowCount = 128; + std::vector> deletes; + deletes.reserve(kRowCount); + for (int64_t i = 0; i < kRowCount; ++i) { + deletes.emplace_back("data.parquet", i); + } + auto delete_file = WritePositionDeletes("pos_deletes_fast_path.parquet", deletes); + + ASSERT_TRUE(delete_file->referenced_data_file.has_value()); + ASSERT_EQ(delete_file->referenced_data_file.value(), "data.parquet"); + + std::vector> files = {delete_file}; + auto result = loader_->LoadPositionDeletes(files, "data.parquet"); + ASSERT_THAT(result, IsOk()); + + auto& index = result.value(); + ASSERT_EQ(index.Cardinality(), kRowCount); + ASSERT_TRUE(index.IsDeleted(0)); + ASSERT_TRUE(index.IsDeleted(kRowCount / 2)); + ASSERT_TRUE(index.IsDeleted(kRowCount - 1)); + ASSERT_FALSE(index.IsDeleted(kRowCount)); +} + TEST_F(DeleteLoaderTest, LoadPositionDeletesRejectsDV) { auto dv_file = std::make_shared(DataFile{ .content = DataFile::Content::kPositionDeletes, diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 6928ab820..e7f6165c9 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -94,6 +94,7 @@ iceberg_tests = { 'location_util_test.cc', 'math_util_internal_test.cc', 'position_delete_index_test.cc', + 'position_delete_range_consumer_test.cc', 'retry_util_test.cc', 'roaring_position_bitmap_test.cc', 'string_util_test.cc', diff --git a/src/iceberg/test/position_delete_range_consumer_test.cc b/src/iceberg/test/position_delete_range_consumer_test.cc new file mode 100644 index 000000000..5a58fa5a2 --- /dev/null +++ b/src/iceberg/test/position_delete_range_consumer_test.cc @@ -0,0 +1,175 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/deletes/position_delete_range_consumer.h" + +#include +#include +#include +#include +#include + +#include + +#include "iceberg/deletes/position_delete_index.h" +#include "iceberg/deletes/roaring_position_bitmap.h" + +namespace iceberg { + +namespace { + +// Reference set: positions a per-pos `Delete(pos)` loop would accept. +std::set ExpectedValidSet(const std::vector& positions) { + std::set expected; + for (int64_t pos : positions) { + if (pos >= 0 && pos <= RoaringPositionBitmap::kMaxPosition) { + expected.insert(pos); + } + } + return expected; +} + +// Strict contents check: cardinality plus per-position membership. +// Weaker checks would miss divergences at the 32-bit key boundary. +void AssertMatchesBaseline(const std::vector& positions) { + PositionDeleteIndex index; + std::vector scratch; + ForEachPositionDelete(std::span(positions), index, scratch); + const auto expected = ExpectedValidSet(positions); + ASSERT_EQ(index.Cardinality(), static_cast(expected.size())) + << "input size=" << positions.size(); + for (int64_t pos : expected) { + ASSERT_TRUE(index.IsDeleted(pos)) << "missing pos=" << pos; + } +} + +} // namespace + +TEST(PositionDeleteRangeConsumerTest, EmptySpan) { AssertMatchesBaseline({}); } + +TEST(PositionDeleteRangeConsumerTest, SinglePosition) { AssertMatchesBaseline({42}); } + +TEST(PositionDeleteRangeConsumerTest, FullyContiguousRunBecomesSingleRange) { + std::vector positions; + for (int64_t i = 100; i < 200; ++i) { + positions.push_back(i); + } + AssertMatchesBaseline(positions); +} + +TEST(PositionDeleteRangeConsumerTest, AlternatingPositionsProduceNoCoalescing) { + std::vector positions; + for (int64_t i = 0; i < 50; ++i) { + positions.push_back(i * 2); + } + AssertMatchesBaseline(positions); +} + +TEST(PositionDeleteRangeConsumerTest, MixedShortAndLongRuns) { + AssertMatchesBaseline({1, 2, 3, 7, 10, 11, 20, 30, 31, 32, 33, 34}); +} + +TEST(PositionDeleteRangeConsumerTest, UnsortedInputStillCorrect) { + AssertMatchesBaseline({10, 5, 11, 12, 4, 13, 100}); +} + +TEST(PositionDeleteRangeConsumerTest, DuplicatesAreIdempotent) { + AssertMatchesBaseline({5, 5, 5, 6, 6, 7}); +} + +TEST(PositionDeleteRangeConsumerTest, InvalidPositionsSilentlySkipped) { + // Invalids at the edges, mid-run, and mixed with valid contiguous runs + // must all be dropped without breaking coalescing around them. We stay + // well below `kMaxPosition` to avoid forcing the bitmap to resize its + // backing vector to ~2^31 empty containers. + AssertMatchesBaseline({std::numeric_limits::min(), -5, -4, 10, 11, -999, 12, + 13, RoaringPositionBitmap::kMaxPosition + 1, + std::numeric_limits::max()}); +} + +TEST(PositionDeleteRangeConsumerTest, ContiguousRunAcrossKeyBoundary) { + // Pins `last_position + 1` and the adjacency check at a non-zero + // high-32 key. The coalesced run must survive the key transition. + constexpr int64_t kBoundary = int64_t{1} << 32; + std::vector positions; + for (int64_t i = kBoundary - 3; i < kBoundary + 3; ++i) { + positions.push_back(i); + } + AssertMatchesBaseline(positions); +} + +TEST(PositionDeleteRangeConsumerTest, DispatcherAgreesAtBothDensities) { + // Above the sniff threshold at densities below and above the 10% + // cutoff. We can't observe the choice directly; agreement with the + // baseline is the contract. + std::vector low_density; + std::vector high_density; + int64_t lo = 0; + int64_t hi = 0; + for (int64_t i = 0; i < 2'048; ++i) { + low_density.push_back(lo); + ++lo; + if ((i + 1) % 20 == 0) { + lo += 5; + } + high_density.push_back(hi); + hi += ((i % 5 == 0) ? 5 : 1); + } + AssertMatchesBaseline(low_density); + AssertMatchesBaseline(high_density); +} + +TEST(PositionDeleteRangeConsumerTest, DispatcherSkipsSniffOnSmallInputs) { + // Below the 64-element threshold the dispatcher bypasses the sniff. + // Exercise both a scattered tiny input (where bulk would win at large + // n) and a contiguous tiny input (the range path always wins). + std::vector scattered; + std::vector contiguous; + for (int64_t i = 0; i < 32; ++i) { + scattered.push_back(i * 100); + contiguous.push_back(i); + } + AssertMatchesBaseline(scattered); + AssertMatchesBaseline(contiguous); +} + +TEST(PositionDeleteRangeConsumerTest, DispatcherAgreesAtThresholdBoundary) { + // The dispatcher selects the bulk path when + // boundaries * 100 > (sniff - 1) * kBulkThresholdPercent + // With `sniff = 1024` and `kBulkThresholdPercent = 10`, the cutoff is + // 102.3 boundaries: 102 stays on coalesce, 103 flips to bulk. Both + // inputs must still produce the same cardinality and membership as + // the per-position baseline; this test guards against arithmetic + // regressions around the threshold constant. + auto build = [](int64_t target_boundaries) { + std::vector positions; + positions.reserve(1024); + int64_t pos = 0; + positions.push_back(pos); + for (int64_t i = 1; i < 1024; ++i) { + pos += (i <= target_boundaries) ? 2 : 1; + positions.push_back(pos); + } + return positions; + }; + AssertMatchesBaseline(build(/*target_boundaries=*/102)); + AssertMatchesBaseline(build(/*target_boundaries=*/103)); +} + +} // namespace iceberg From 7b0720953caf1d8c2d7a2a63fb098ce8f969736c Mon Sep 17 00:00:00 2001 From: Guotao Yu Date: Wed, 27 May 2026 14:47:41 +0800 Subject: [PATCH 046/151] ci: update pre-commit workflow permissions to write (#683) Change `contents` permission from `read` to `write` in the pre-commit workflow. --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4bbc2355f..15e34082b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -26,7 +26,7 @@ on: - '!dependabot/**' permissions: - contents: read + contents: write jobs: pre-commit: From 8601f168a2e61c00656b8821d16b82e96f84c96b Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 27 May 2026 17:37:11 +0800 Subject: [PATCH 047/151] fix(meson): add missing install headers for meson (#684) --- src/iceberg/catalog/rest/auth/meson.build | 27 +++++++++++++++++++++++ src/iceberg/catalog/rest/meson.build | 11 +-------- src/iceberg/deletes/meson.build | 6 ++++- src/iceberg/meson.build | 1 + src/iceberg/util/meson.build | 1 + 5 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 src/iceberg/catalog/rest/auth/meson.build diff --git a/src/iceberg/catalog/rest/auth/meson.build b/src/iceberg/catalog/rest/auth/meson.build new file mode 100644 index 000000000..4de6e821e --- /dev/null +++ b/src/iceberg/catalog/rest/auth/meson.build @@ -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. + +install_headers( + [ + 'auth_manager.h', + 'auth_managers.h', + 'auth_properties.h', + 'auth_session.h', + 'oauth2_util.h', + ], + subdir: 'iceberg/catalog/rest/auth', +) diff --git a/src/iceberg/catalog/rest/meson.build b/src/iceberg/catalog/rest/meson.build index a1f8ce973..cc05576a2 100644 --- a/src/iceberg/catalog/rest/meson.build +++ b/src/iceberg/catalog/rest/meson.build @@ -80,13 +80,4 @@ install_headers( subdir: 'iceberg/catalog/rest', ) -install_headers( - [ - 'auth/auth_manager.h', - 'auth/auth_managers.h', - 'auth/auth_properties.h', - 'auth/auth_session.h', - 'auth/oauth2_util.h', - ], - subdir: 'iceberg/catalog/rest/auth', -) +subdir('auth') diff --git a/src/iceberg/deletes/meson.build b/src/iceberg/deletes/meson.build index fcbe45cff..904c28169 100644 --- a/src/iceberg/deletes/meson.build +++ b/src/iceberg/deletes/meson.build @@ -16,6 +16,10 @@ # under the License. install_headers( - ['position_delete_index.h', 'roaring_position_bitmap.h'], + [ + 'position_delete_index.h', + 'position_delete_range_consumer.h', + 'roaring_position_bitmap.h', + ], subdir: 'iceberg/deletes', ) diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 48b5d4250..0ec4f58f1 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -258,6 +258,7 @@ install_headers( 'table.h', 'table_identifier.h', 'table_metadata.h', + 'table_properties.h', 'table_requirement.h', 'table_requirements.h', 'table_scan.h', diff --git a/src/iceberg/util/meson.build b/src/iceberg/util/meson.build index a38dc886c..d70855016 100644 --- a/src/iceberg/util/meson.build +++ b/src/iceberg/util/meson.build @@ -36,6 +36,7 @@ install_headers( 'property_util.h', 'retry_util.h', 'string_util.h', + 'struct_like_set.h', 'temporal_util.h', 'timepoint.h', 'transform_util.h', From 100bbe39624f3eb5724359e258dbacd8a320e5b2 Mon Sep 17 00:00:00 2001 From: ZhaoXuan <425932451@qq.com> Date: Thu, 28 May 2026 08:59:59 +0800 Subject: [PATCH 048/151] feat(puffin): add puffin file reader and writer (#624) --- src/iceberg/CMakeLists.txt | 4 +- src/iceberg/meson.build | 2 + src/iceberg/puffin/meson.build | 8 +- src/iceberg/puffin/puffin_format.cc | 24 +- src/iceberg/puffin/puffin_format.h | 10 + src/iceberg/puffin/puffin_reader.cc | 271 +++++++++++++++ src/iceberg/puffin/puffin_reader.h | 90 +++++ src/iceberg/puffin/puffin_writer.cc | 184 ++++++++++ src/iceberg/puffin/puffin_writer.h | 107 ++++++ src/iceberg/test/CMakeLists.txt | 3 +- src/iceberg/test/meson.build | 6 +- src/iceberg/test/mock_io.h | 217 ++++++++++++ src/iceberg/test/puffin_reader_writer_test.cc | 313 ++++++++++++++++++ src/iceberg/type_fwd.h | 5 + 14 files changed, 1228 insertions(+), 16 deletions(-) create mode 100644 src/iceberg/puffin/puffin_reader.cc create mode 100644 src/iceberg/puffin/puffin_reader.h create mode 100644 src/iceberg/puffin/puffin_writer.cc create mode 100644 src/iceberg/puffin/puffin_writer.h create mode 100644 src/iceberg/test/puffin_reader_writer_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 7be689f8d..18cf70bdb 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -175,7 +175,9 @@ set(ICEBERG_DATA_SOURCES deletes/roaring_position_bitmap.cc puffin/file_metadata.cc puffin/json_serde.cc - puffin/puffin_format.cc) + puffin/puffin_format.cc + puffin/puffin_reader.cc + puffin/puffin_writer.cc) set(ICEBERG_DATA_STATIC_BUILD_INTERFACE_LIBS) set(ICEBERG_DATA_SHARED_BUILD_INTERFACE_LIBS) diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 0ec4f58f1..a5a60b605 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -157,6 +157,8 @@ iceberg_data_sources = files( 'puffin/file_metadata.cc', 'puffin/json_serde.cc', 'puffin/puffin_format.cc', + 'puffin/puffin_reader.cc', + 'puffin/puffin_writer.cc', ) # CRoaring does not export symbols, so on Windows it must diff --git a/src/iceberg/puffin/meson.build b/src/iceberg/puffin/meson.build index 7869d7b2c..7f30468db 100644 --- a/src/iceberg/puffin/meson.build +++ b/src/iceberg/puffin/meson.build @@ -16,6 +16,12 @@ # under the License. install_headers( - ['file_metadata.h', 'puffin_format.h', 'type_fwd.h'], + [ + 'file_metadata.h', + 'puffin_format.h', + 'puffin_reader.h', + 'puffin_writer.h', + 'type_fwd.h', + ], subdir: 'iceberg/puffin', ) diff --git a/src/iceberg/puffin/puffin_format.cc b/src/iceberg/puffin/puffin_format.cc index 88807d0ca..88d378f04 100644 --- a/src/iceberg/puffin/puffin_format.cc +++ b/src/iceberg/puffin/puffin_format.cc @@ -36,6 +36,18 @@ constexpr std::pair GetFlagPosition(PuffinFlag flag) { std::unreachable(); } +} // namespace + +bool IsFlagSet(std::span flags, PuffinFlag flag) { + auto [byte_num, bit_num] = GetFlagPosition(flag); + return (flags[byte_num] & (1 << bit_num)) != 0; +} + +void SetFlag(std::span flags, PuffinFlag flag) { + auto [byte_num, bit_num] = GetFlagPosition(flag); + flags[byte_num] |= (1 << bit_num); +} + // TODO(zhaoxuan1994): Move compression logic to a unified codec interface. Result> Compress(PuffinCompressionCodec codec, std::span input) { @@ -63,16 +75,4 @@ Result> Decompress(PuffinCompressionCodec codec, std::unreachable(); } -} // namespace - -bool IsFlagSet(std::span flags, PuffinFlag flag) { - auto [byte_num, bit_num] = GetFlagPosition(flag); - return (flags[byte_num] & (1 << bit_num)) != 0; -} - -void SetFlag(std::span flags, PuffinFlag flag) { - auto [byte_num, bit_num] = GetFlagPosition(flag); - flags[byte_num] |= (1 << bit_num); -} - } // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_format.h b/src/iceberg/puffin/puffin_format.h index e5ecf9003..b3b5f10de 100644 --- a/src/iceberg/puffin/puffin_format.h +++ b/src/iceberg/puffin/puffin_format.h @@ -23,8 +23,10 @@ /// Puffin file format constants and utilities. #include +#include #include #include +#include #include "iceberg/iceberg_data_export.h" #include "iceberg/puffin/file_metadata.h" @@ -66,4 +68,12 @@ ICEBERG_DATA_EXPORT bool IsFlagSet(std::span flags, PuffinFlag /// \brief Set a flag in the flags bytes. ICEBERG_DATA_EXPORT void SetFlag(std::span flags, PuffinFlag flag); +/// \brief Compress data using the specified codec. +ICEBERG_DATA_EXPORT Result> Compress( + PuffinCompressionCodec codec, std::span input); + +/// \brief Decompress data using the specified codec. +ICEBERG_DATA_EXPORT Result> Decompress( + PuffinCompressionCodec codec, std::span input); + } // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_reader.cc b/src/iceberg/puffin/puffin_reader.cc new file mode 100644 index 000000000..47ac58f13 --- /dev/null +++ b/src/iceberg/puffin/puffin_reader.cc @@ -0,0 +1,271 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/puffin/puffin_reader.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/file_io.h" +#include "iceberg/puffin/json_serde_internal.h" +#include "iceberg/puffin/puffin_format.h" +#include "iceberg/util/endian.h" +#include "iceberg/util/macros.h" + +namespace iceberg::puffin { + +namespace { + +struct FooterInfo { + int32_t payload_size; + PuffinCompressionCodec compression; +}; + +Status CheckMagic(std::span data, int64_t offset = 0) { + ICEBERG_PRECHECK(offset >= 0, "Invalid file: magic offset {} is negative", offset); + auto offset_size = static_cast(offset); + ICEBERG_PRECHECK(offset_size <= data.size() && + data.size() - offset_size >= PuffinFormat::kMagicLength, + "Invalid file: buffer too small for magic at offset {}", offset); + auto* begin = reinterpret_cast(data.data() + offset_size); + ICEBERG_PRECHECK( + std::equal(PuffinFormat::kMagicV1.cbegin(), PuffinFormat::kMagicV1.cend(), begin), + "Invalid file: expected magic at offset {}, got [{:#04x}, {:#04x}, {:#04x}, " + "{:#04x}]", + offset, begin[0], begin[1], begin[2], begin[3]); + return {}; +} + +Status CheckUnknownFlags(std::span flags) { + constexpr uint8_t kKnownBitsMask = 0x01; + ICEBERG_PRECHECK( + (flags[0] & ~kKnownBitsMask) == 0 && flags[1] == 0 && flags[2] == 0 && + flags[3] == 0, + "Invalid file: unknown footer flags set [{:#04x}, {:#04x}, {:#04x}, {:#04x}]", + flags[0], flags[1], flags[2], flags[3]); + return {}; +} + +Result FooterPayloadSize(std::span footer_struct) { + ICEBERG_PRECHECK(footer_struct.size() >= PuffinFormat::kFooterStructLength, + "Invalid file: footer struct is too small"); + auto payload_size = ReadLittleEndian( + footer_struct.data() + PuffinFormat::kFooterStructPayloadSizeOffset); + ICEBERG_PRECHECK(payload_size >= 0, "Invalid file: negative payload size {}", + payload_size); + return payload_size; +} + +Result> DecodeFlags(std::span footer_struct) { + ICEBERG_PRECHECK(footer_struct.size() >= PuffinFormat::kFooterStructLength, + "Invalid file: footer struct is too small"); + std::array flags{}; + std::memcpy(flags.data(), footer_struct.data() + PuffinFormat::kFooterStructFlagsOffset, + flags.size()); + ICEBERG_RETURN_UNEXPECTED(CheckUnknownFlags(flags)); + return flags; +} + +PuffinCompressionCodec FooterCompressionCodec(std::span flags) { + if (IsFlagSet(flags, PuffinFlag::kFooterPayloadCompressed)) { + return PuffinFormat::kDefaultFooterCompressionCodec; + } + return PuffinCompressionCodec::kNone; +} + +Status CheckFooterSize(int64_t footer_size, int32_t payload_size) { + auto expected_footer_size = PuffinFormat::kFooterStartMagicLength + + static_cast(payload_size) + + PuffinFormat::kFooterStructLength; + ICEBERG_PRECHECK(footer_size == expected_footer_size, + "Invalid file: footer size {} does not match payload size {}", + footer_size, payload_size); + return {}; +} + +Result DecodeFooterInfo(std::span footer, + int64_t footer_size) { + ICEBERG_PRECHECK(footer_size >= PuffinFormat::kFooterStartMagicLength + + PuffinFormat::kFooterStructLength, + "Invalid file: footer size {} is too small", footer_size); + ICEBERG_PRECHECK(static_cast(footer_size) <= footer.size(), + "Invalid file: footer size {} exceeds buffer size {}", footer_size, + footer.size()); + + ICEBERG_RETURN_UNEXPECTED(CheckMagic(footer, PuffinFormat::kFooterStartMagicOffset)); + + auto footer_struct_offset = footer_size - PuffinFormat::kFooterStructLength; + std::span footer_struct(footer.data() + footer_struct_offset, + PuffinFormat::kFooterStructLength); + ICEBERG_RETURN_UNEXPECTED( + CheckMagic(footer_struct, PuffinFormat::kFooterStructMagicOffset)); + + ICEBERG_ASSIGN_OR_RAISE(auto payload_size, FooterPayloadSize(footer_struct)); + ICEBERG_RETURN_UNEXPECTED(CheckFooterSize(footer_size, payload_size)); + + ICEBERG_ASSIGN_OR_RAISE(auto flags, DecodeFlags(footer_struct)); + return FooterInfo{.payload_size = payload_size, + .compression = FooterCompressionCodec(flags)}; +} + +Result ParseFileMetadata(std::span payload, + PuffinCompressionCodec compression) { + std::vector decompressed; + if (compression != PuffinCompressionCodec::kNone) { + ICEBERG_ASSIGN_OR_RAISE(decompressed, Decompress(compression, payload)); + payload = decompressed; + } + + return FileMetadataFromJsonString( + std::string_view(reinterpret_cast(payload.data()), payload.size())); +} + +} // namespace + +PuffinReader::PuffinReader(std::unique_ptr stream, int64_t file_size, + std::optional known_footer_size) + : stream_(std::move(stream)), + file_size_(file_size), + known_footer_size_(known_footer_size) {} + +PuffinReader::~PuffinReader() = default; + +Result> PuffinReader::Make( + std::unique_ptr input_file, std::optional footer_size, + std::optional file_size) { + ICEBERG_PRECHECK(input_file, "Input file must not be null"); + int64_t resolved_file_size = 0; + if (file_size.has_value()) { + ICEBERG_PRECHECK(*file_size >= 0, "File size must not be negative: {}", *file_size); + resolved_file_size = *file_size; + } else { + ICEBERG_ASSIGN_OR_RAISE(resolved_file_size, input_file->Size()); + } + if (footer_size.has_value()) { + ICEBERG_PRECHECK(*footer_size > 0, "Footer size must be positive: {}", *footer_size); + ICEBERG_PRECHECK(*footer_size <= resolved_file_size - PuffinFormat::kMagicLength, + "Footer size {} exceeds file size {}", *footer_size, + resolved_file_size); + ICEBERG_PRECHECK(*footer_size <= std::numeric_limits::max(), + "Footer size {} is too large", *footer_size); + } + ICEBERG_ASSIGN_OR_RAISE(auto stream, input_file->Open()); + return std::unique_ptr( + new PuffinReader(std::move(stream), resolved_file_size, footer_size)); +} + +Result> PuffinReader::ReadBytes(int64_t offset, int64_t length) { + ICEBERG_PRECHECK(!closed_, "Reader already closed"); + ICEBERG_PRECHECK(offset >= 0, "Offset must not be negative: {}", offset); + ICEBERG_PRECHECK(length >= 0, "Length must not be negative: {}", length); + ICEBERG_PRECHECK(offset <= file_size_, "Offset {} exceeds file size {}", offset, + file_size_); + ICEBERG_PRECHECK(length <= file_size_ - offset, + "Length {} exceeds file size {} at offset {}", length, file_size_, + offset); + std::vector buf(length); + ICEBERG_RETURN_UNEXPECTED(stream_->ReadFully(offset, buf)); + return buf; +} + +Result PuffinReader::FooterSize() { + if (known_footer_size_.has_value()) { + return *known_footer_size_; + } + + ICEBERG_ASSIGN_OR_RAISE(auto footer_struct, + ReadBytes(file_size_ - PuffinFormat::kFooterStructLength, + PuffinFormat::kFooterStructLength)); + ICEBERG_RETURN_UNEXPECTED( + CheckMagic(footer_struct, PuffinFormat::kFooterStructMagicOffset)); + + ICEBERG_ASSIGN_OR_RAISE(auto payload_size, FooterPayloadSize(footer_struct)); + known_footer_size_ = PuffinFormat::kFooterStartMagicLength + + static_cast(payload_size) + + PuffinFormat::kFooterStructLength; + return *known_footer_size_; +} + +Result> PuffinReader::ReadFooter(int64_t footer_size) { + return ReadBytes(file_size_ - footer_size, footer_size); +} + +Result PuffinReader::ReadFileMetadata() { + ICEBERG_ASSIGN_OR_RAISE(auto header_bytes, ReadBytes(0, PuffinFormat::kMagicLength)); + ICEBERG_RETURN_UNEXPECTED(CheckMagic(header_bytes)); + + ICEBERG_ASSIGN_OR_RAISE(auto footer_size, FooterSize()); + ICEBERG_ASSIGN_OR_RAISE(auto footer, ReadFooter(footer_size)); + ICEBERG_ASSIGN_OR_RAISE(auto footer_info, DecodeFooterInfo(footer, footer_size)); + std::span payload_bytes( + footer.data() + PuffinFormat::kFooterStartMagicLength, footer_info.payload_size); + return ParseFileMetadata(payload_bytes, footer_info.compression); +} + +Result>> PuffinReader::ReadBlob( + const BlobMetadata& blob_metadata) { + ICEBERG_ASSIGN_OR_RAISE(auto raw_data, + ReadBytes(blob_metadata.offset, blob_metadata.length)); + + ICEBERG_ASSIGN_OR_RAISE( + auto codec, PuffinCompressionCodecFromName(blob_metadata.compression_codec)); + if (codec == PuffinCompressionCodec::kNone) { + return std::pair{blob_metadata, std::move(raw_data)}; + } + + ICEBERG_ASSIGN_OR_RAISE(auto decompressed, Decompress(codec, raw_data)); + + return std::pair{blob_metadata, std::move(decompressed)}; +} + +Result>>> +PuffinReader::ReadAll(const std::vector& blobs) { + // Sort by offset for sequential I/O access pattern + std::vector sorted; + sorted.reserve(blobs.size()); + for (const auto& blob : blobs) { + sorted.push_back(&blob); + } + std::ranges::sort(sorted, + [](const auto* a, const auto* b) { return a->offset < b->offset; }); + + std::vector>> results; + results.reserve(blobs.size()); + for (const auto* blob : sorted) { + ICEBERG_ASSIGN_OR_RAISE(auto blob_pair, ReadBlob(*blob)); + results.push_back(std::move(blob_pair)); + } + return results; +} + +Status PuffinReader::Close() { + if (closed_) { + return {}; + } + ICEBERG_RETURN_UNEXPECTED(stream_->Close()); + closed_ = true; + return {}; +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_reader.h b/src/iceberg/puffin/puffin_reader.h new file mode 100644 index 000000000..3b805426b --- /dev/null +++ b/src/iceberg/puffin/puffin_reader.h @@ -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. + */ + +#pragma once + +/// \file iceberg/puffin/puffin_reader.h +/// Puffin file reader. + +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_data_export.h" +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg::puffin { + +/// \brief Reader for Puffin files. +/// +/// Reads from an InputFile with seek support for efficient blob access. +class ICEBERG_DATA_EXPORT PuffinReader { + public: + /// \brief Create a PuffinReader for the given input file. + /// \param input_file The input file to read from. + /// \param footer_size Optional known footer size hint to avoid an extra seek. + /// \param file_size Optional known file size hint to avoid fetching size. + static Result> Make( + std::unique_ptr input_file, + std::optional footer_size = std::nullopt, + std::optional file_size = std::nullopt); + + ~PuffinReader(); + + /// \brief Read and return the file metadata from the footer. + Result ReadFileMetadata(); + + /// \brief Read a specific blob's data by its metadata. + /// \param blob_metadata The metadata describing the blob to read. + /// \return A pair of (BlobMetadata, decompressed data), or an error. + Result>> ReadBlob( + const BlobMetadata& blob_metadata); + + /// \brief Read all blobs described in the file metadata. + /// \return A vector of (BlobMetadata, decompressed data) pairs, or an error. + Result>>> ReadAll( + const std::vector& blobs); + + /// \brief Close the underlying input stream. + Status Close(); + + private: + PuffinReader(std::unique_ptr stream, int64_t file_size, + std::optional known_footer_size); + + Result> ReadBytes(int64_t offset, int64_t length); + Result FooterSize(); + Result> ReadFooter(int64_t footer_size); + + /// Opened input stream. + std::unique_ptr stream_; + /// Total file size. + int64_t file_size_; + /// Known footer size hint (avoids one seek if provided). + std::optional known_footer_size_; + /// Whether the reader has been closed. + bool closed_ = false; +}; + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_writer.cc b/src/iceberg/puffin/puffin_writer.cc new file mode 100644 index 000000000..db749117f --- /dev/null +++ b/src/iceberg/puffin/puffin_writer.cc @@ -0,0 +1,184 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/puffin/puffin_writer.h" + +#include +#include + +#include "iceberg/file_io.h" +#include "iceberg/puffin/json_serde_internal.h" +#include "iceberg/puffin/puffin_format.h" +#include "iceberg/util/endian.h" +#include "iceberg/util/macros.h" + +namespace iceberg::puffin { + +PuffinWriter::PuffinWriter(std::unique_ptr stream, + std::unordered_map properties, + PuffinCompressionCodec default_codec, bool compress_footer) + : stream_(std::move(stream)), + properties_(std::move(properties)), + default_codec_(default_codec), + compress_footer_(compress_footer) {} + +PuffinWriter::~PuffinWriter() = default; + +Result> PuffinWriter::Make( + std::unique_ptr output_file, + std::unordered_map properties, + PuffinCompressionCodec default_codec, bool compress_footer) { + ICEBERG_PRECHECK(output_file, "Output file must not be null"); + ICEBERG_ASSIGN_OR_RAISE(auto stream, output_file->Create()); + return std::unique_ptr(new PuffinWriter( + std::move(stream), std::move(properties), default_codec, compress_footer)); +} + +Status PuffinWriter::WriteBytes(std::span data) { + return stream_->Write(data); +} + +Status PuffinWriter::WriteMagic() { + const auto& magic = PuffinFormat::kMagicV1; + return WriteBytes(std::span( + reinterpret_cast(magic.data()), magic.size())); +} + +Status PuffinWriter::WriteHeader() { + if (header_written_) return {}; + ICEBERG_RETURN_UNEXPECTED(WriteMagic()); + header_written_ = true; + return {}; +} + +Result PuffinWriter::Write(const Blob& blob) { + ICEBERG_PRECHECK(!finished_ && !footer_written_, "Writer already finished"); + ICEBERG_RETURN_UNEXPECTED(WriteHeader()); + + auto codec = blob.requested_compression.value_or(default_codec_); + std::span input_span( + reinterpret_cast(blob.data.data()), blob.data.size()); + std::vector compressed; + auto output_span = input_span; + if (codec != PuffinCompressionCodec::kNone) { + ICEBERG_ASSIGN_OR_RAISE(compressed, Compress(codec, input_span)); + output_span = std::span(compressed.data(), compressed.size()); + } + + ICEBERG_ASSIGN_OR_RAISE(auto offset, stream_->Position()); + ICEBERG_RETURN_UNEXPECTED(WriteBytes(output_span)); + auto length = static_cast(output_span.size()); + + auto codec_name = CodecName(codec); + BlobMetadata metadata{ + .type = blob.type, + .input_fields = blob.input_fields, + .snapshot_id = blob.snapshot_id, + .sequence_number = blob.sequence_number, + .offset = offset, + .length = length, + .compression_codec = std::string(codec_name), + .properties = blob.properties, + }; + written_blobs_metadata_.push_back(metadata); + return metadata; +} + +Status PuffinWriter::Finish() { + ICEBERG_PRECHECK(!finished_, "Writer already finished"); + ICEBERG_PRECHECK(!footer_written_, "Footer already written"); + + ICEBERG_RETURN_UNEXPECTED(WriteHeader()); + + FileMetadata file_metadata{ + .blobs = written_blobs_metadata_, + .properties = properties_, + }; + + auto footer_json = ToJsonString(file_metadata); + std::span footer_payload( + reinterpret_cast(footer_json.data()), footer_json.size()); + std::vector compressed_footer_payload; + + // Compress footer if requested + std::array flags{}; + if (compress_footer_) { + ICEBERG_ASSIGN_OR_RAISE( + compressed_footer_payload, + Compress(PuffinFormat::kDefaultFooterCompressionCodec, footer_payload)); + footer_payload = std::span(compressed_footer_payload.data(), + compressed_footer_payload.size()); + SetFlag(flags, PuffinFlag::kFooterPayloadCompressed); + } + ICEBERG_CHECK( + footer_payload.size() <= static_cast(std::numeric_limits::max()), + "Footer payload is too large: {}", footer_payload.size()); + auto payload_size = static_cast(footer_payload.size()); + + // Footer start magic + ICEBERG_ASSIGN_OR_RAISE(auto footer_start, stream_->Position()); + ICEBERG_RETURN_UNEXPECTED(WriteMagic()); + + // Footer payload + ICEBERG_RETURN_UNEXPECTED(WriteBytes(footer_payload)); + + // Footer struct: payload_size (4) + flags (4) + magic (4) + std::array size_buf{}; + WriteLittleEndian(payload_size, size_buf.data()); + ICEBERG_RETURN_UNEXPECTED(WriteBytes(size_buf)); + + // Flags + ICEBERG_RETURN_UNEXPECTED(WriteBytes(std::span( + reinterpret_cast(flags.data()), flags.size()))); + + // Footer end magic + ICEBERG_RETURN_UNEXPECTED(WriteMagic()); + + ICEBERG_ASSIGN_OR_RAISE(auto end_pos, stream_->Position()); + footer_size_ = end_pos - footer_start; + footer_written_ = true; + ICEBERG_RETURN_UNEXPECTED(stream_->Flush()); + ICEBERG_RETURN_UNEXPECTED(stream_->Close()); + ICEBERG_ASSIGN_OR_RAISE(file_size_, stream_->Position()); + finished_ = true; + return {}; +} + +Status PuffinWriter::Close() { + if (finished_) { + return {}; + } + return Finish(); +} + +const std::vector& PuffinWriter::written_blobs_metadata() const { + return written_blobs_metadata_; +} + +Result PuffinWriter::FooterSize() const { + ICEBERG_PRECHECK(footer_written_, "Footer not written yet"); + return footer_size_; +} + +Result PuffinWriter::FileSize() const { + ICEBERG_PRECHECK(finished_, "Writer not finished yet"); + return file_size_; +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/puffin/puffin_writer.h b/src/iceberg/puffin/puffin_writer.h new file mode 100644 index 000000000..2a7984091 --- /dev/null +++ b/src/iceberg/puffin/puffin_writer.h @@ -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. + */ + +#pragma once + +/// \file iceberg/puffin/puffin_writer.h +/// Puffin file writer. + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_data_export.h" +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg::puffin { + +/// \brief Writer for Puffin files. +/// +/// Writes blobs and footer to an OutputFile stream. +class ICEBERG_DATA_EXPORT PuffinWriter { + public: + /// \brief Create a PuffinWriter for the given output file. + /// \param output_file The output file to write to. + /// \param properties File-level properties to include in the footer. + /// \param default_codec Default compression codec for blobs. + /// \param compress_footer Whether to compress the footer payload. + static Result> Make( + std::unique_ptr output_file, + std::unordered_map properties = {}, + PuffinCompressionCodec default_codec = PuffinCompressionCodec::kNone, + bool compress_footer = false); + + ~PuffinWriter(); + + /// \brief Write a blob and return its metadata. + Result Write(const Blob& blob); + + /// \brief Finalize the file by writing the footer and closing the stream. + Status Finish(); + + /// \brief Close the writer, finalizing the file if needed. + Status Close(); + + /// \brief Get metadata for all blobs written so far. + const std::vector& written_blobs_metadata() const; + + /// \brief Get the footer size. Returns error if the footer has not been written. + Result FooterSize() const; + + /// \brief Get the total file size. Returns error if Finish() has not succeeded. + Result FileSize() const; + + private: + PuffinWriter(std::unique_ptr stream, + std::unordered_map properties, + PuffinCompressionCodec default_codec, bool compress_footer); + + Status WriteBytes(std::span data); + Status WriteHeader(); + Status WriteMagic(); + + /// Output stream. + std::unique_ptr stream_; + /// File-level properties to include in the footer. + std::unordered_map properties_; + /// Default compression codec for blobs without explicit compression. + const PuffinCompressionCodec default_codec_; + /// Whether to compress the footer payload. + const bool compress_footer_; + /// Metadata for all blobs written so far. + std::vector written_blobs_metadata_; + /// Whether the header magic has been written. + bool header_written_ = false; + /// Whether the footer has been written. + bool footer_written_ = false; + /// Whether Finish() has succeeded. + bool finished_ = false; + /// Footer size, set after the footer is written. + int64_t footer_size_ = -1; + /// Total file size, set after Finish(). + int64_t file_size_ = -1; +}; + +} // namespace iceberg::puffin diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index d9059c567..997d18354 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -146,7 +146,8 @@ add_iceberg_test(puffin_test USE_DATA SOURCES puffin_format_test.cc - puffin_json_test.cc) + puffin_json_test.cc + puffin_reader_writer_test.cc) if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(avro_test diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index e7f6165c9..b21a264b1 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -109,7 +109,11 @@ iceberg_tests = { 'use_data': true, }, 'puffin_test': { - 'sources': files('puffin_format_test.cc', 'puffin_json_test.cc'), + 'sources': files( + 'puffin_format_test.cc', + 'puffin_json_test.cc', + 'puffin_reader_writer_test.cc', + ), 'use_data': true, }, } diff --git a/src/iceberg/test/mock_io.h b/src/iceberg/test/mock_io.h index c9f38e505..f643a852b 100644 --- a/src/iceberg/test/mock_io.h +++ b/src/iceberg/test/mock_io.h @@ -19,10 +19,25 @@ #pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include "iceberg/file_io.h" +#include "iceberg/util/macros.h" namespace iceberg { @@ -31,12 +46,214 @@ class MockFileIO : public FileIO { MockFileIO() = default; ~MockFileIO() override = default; + Result> NewInputFile(std::string file_location) override { + auto file = FindFile(file_location); + if (!file) { + return NotFound("File does not exist: {}", file_location); + } + return std::make_unique(std::move(file_location), std::move(file), + std::nullopt); + } + + Result> NewInputFile(std::string file_location, + size_t length) override { + if (length > static_cast(std::numeric_limits::max())) { + return InvalidArgument("File length {} exceeds int64_t max", length); + } + auto file = FindFile(file_location); + if (!file) { + return NotFound("File does not exist: {}", file_location); + } + return std::make_unique(std::move(file_location), std::move(file), + static_cast(length)); + } + + Result> NewOutputFile(std::string file_location) override { + return std::make_unique(files_, std::move(file_location)); + } + + void AddFile(std::string file_location, std::span data) { + files_->insert_or_assign( + std::move(file_location), + std::make_shared>(data.begin(), data.end())); + } + + void AddFile(std::string file_location, std::string_view data) { + AddFile(std::move(file_location), + std::as_bytes(std::span(data.data(), data.size()))); + } + + std::vector& FileData(const std::string& file_location) { + return *GetOrCreateFile(file_location); + } + + const std::vector& FileData(const std::string& file_location) const { + return *files_->at(file_location); + } + MOCK_METHOD((Result), ReadFile, (const std::string&, std::optional), (override)); MOCK_METHOD(Status, WriteFile, (const std::string&, std::string_view), (override)); MOCK_METHOD(Status, DeleteFile, (const std::string&), (override)); + + private: + using FileMap = + std::unordered_map>>; + + class InMemoryInputStream : public SeekableInputStream { + public: + explicit InMemoryInputStream(std::shared_ptr> data) + : data_(std::move(data)) {} + + Result Position() const override { return position_; } + + Status Seek(int64_t position) override { + ICEBERG_PRECHECK(!closed_, "Input stream is closed"); + ICEBERG_PRECHECK(position >= 0, "Position must not be negative: {}", position); + position_ = position; + return {}; + } + + Result Read(std::span out) override { + ICEBERG_PRECHECK(!closed_, "Input stream is closed"); + auto file_size = static_cast(data_->size()); + ICEBERG_PRECHECK(position_ <= file_size, "Position {} exceeds file size {}", + position_, file_size); + auto bytes_to_read = + std::min(static_cast(out.size()), file_size - position_); + if (bytes_to_read > 0) { + std::memcpy(out.data(), data_->data() + static_cast(position_), + static_cast(bytes_to_read)); + position_ += bytes_to_read; + } + return bytes_to_read; + } + + Status ReadFully(int64_t position, std::span out) override { + ICEBERG_PRECHECK(!closed_, "Input stream is closed"); + ICEBERG_PRECHECK(position >= 0, "Position must not be negative: {}", position); + auto file_size = static_cast(data_->size()); + ICEBERG_PRECHECK(static_cast(out.size()) <= file_size - position, + "Read out of bounds: offset {} + length {} exceeds file size {}", + position, out.size(), file_size); + if (!out.empty()) { + std::memcpy(out.data(), data_->data() + static_cast(position), + out.size()); + } + return {}; + } + + Status Close() override { + closed_ = true; + return {}; + } + + private: + std::shared_ptr> data_; + int64_t position_ = 0; + bool closed_ = false; + }; + + class InMemoryOutputStream : public PositionOutputStream { + public: + explicit InMemoryOutputStream(std::shared_ptr> data) + : data_(std::move(data)) {} + + Result Position() const override { + return static_cast(data_->size()); + } + + Status Write(std::span data) override { + ICEBERG_PRECHECK(!closed_, "Output stream is closed"); + data_->insert(data_->end(), data.begin(), data.end()); + return {}; + } + + Status Flush() override { + ICEBERG_PRECHECK(!closed_, "Output stream is closed"); + return {}; + } + + Status Close() override { + closed_ = true; + return {}; + } + + private: + std::shared_ptr> data_; + bool closed_ = false; + }; + + class InMemoryInputFile : public InputFile { + public: + InMemoryInputFile(std::string location, std::shared_ptr> data, + std::optional length) + : location_(std::move(location)), data_(std::move(data)), length_(length) {} + + std::string_view location() const override { return location_; } + + Result Size() const override { + return length_.value_or(static_cast(data_->size())); + } + + Result> Open() override { + return std::make_unique(data_); + } + + private: + std::string location_; + std::shared_ptr> data_; + std::optional length_; + }; + + class InMemoryOutputFile : public OutputFile { + public: + InMemoryOutputFile(std::shared_ptr files, std::string location) + : files_(std::move(files)), location_(std::move(location)) {} + + std::string_view location() const override { return location_; } + + Result> Create() override { + if (files_->contains(location_)) { + return AlreadyExists("File already exists: {}", location_); + } + auto file = std::make_shared>(); + files_->emplace(location_, file); + return std::make_unique(std::move(file)); + } + + Result> CreateOrOverwrite() override { + auto file = std::make_shared>(); + files_->insert_or_assign(location_, file); + return std::make_unique(std::move(file)); + } + + private: + std::shared_ptr files_; + std::string location_; + }; + + std::shared_ptr> FindFile( + const std::string& file_location) const { + auto file = files_->find(file_location); + if (file == files_->end()) { + return nullptr; + } + return file->second; + } + + std::shared_ptr> GetOrCreateFile( + const std::string& file_location) { + auto& file = (*files_)[file_location]; + if (!file) { + file = std::make_shared>(); + } + return file; + } + + std::shared_ptr files_ = std::make_shared(); }; } // namespace iceberg diff --git a/src/iceberg/test/puffin_reader_writer_test.cc b/src/iceberg/test/puffin_reader_writer_test.cc new file mode 100644 index 000000000..8d610cee9 --- /dev/null +++ b/src/iceberg/test/puffin_reader_writer_test.cc @@ -0,0 +1,313 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/puffin/file_metadata.h" +#include "iceberg/puffin/puffin_reader.h" +#include "iceberg/puffin/puffin_writer.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/mock_io.h" + +namespace iceberg::puffin { + +namespace { + +struct PuffinFile { + MockFileIO io; + std::string location = "memory://test.puffin"; + + std::unique_ptr Output() { + auto output_file = io.NewOutputFile(location); + EXPECT_THAT(output_file, IsOk()); + if (!output_file) { + return nullptr; + } + return std::move(output_file.value()); + } + + std::unique_ptr Input() { + auto input_file = io.NewInputFile(location); + EXPECT_THAT(input_file, IsOk()); + if (!input_file) { + return nullptr; + } + return std::move(input_file.value()); + } + + std::unique_ptr Input(int64_t file_size) { + auto input_file = io.NewInputFile(location, static_cast(file_size)); + EXPECT_THAT(input_file, IsOk()); + if (!input_file) { + return nullptr; + } + return std::move(input_file.value()); + } + + std::vector& Data() { return io.FileData(location); } + + const std::vector& Data() const { return io.FileData(location); } + + void SetData(std::span bytes) { io.AddFile(location, bytes); } +}; + +std::vector ToBytes(std::string_view str) { + return {reinterpret_cast(str.data()), + reinterpret_cast(str.data() + str.size())}; +} + +} // namespace + +TEST(PuffinWriterTest, WriteEmptyFile) { + PuffinFile file; + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ASSERT_THAT(writer->Finish(), IsOk()); + + auto& data = file.Data(); + EXPECT_GE(data.size(), 20u); + EXPECT_EQ(data[0], std::byte{0x50}); + EXPECT_EQ(data[1], std::byte{0x46}); + EXPECT_EQ(data[2], std::byte{0x41}); + EXPECT_EQ(data[3], std::byte{0x31}); + auto sz = data.size(); + EXPECT_EQ(data[sz - 4], std::byte{0x50}); + EXPECT_EQ(data[sz - 3], std::byte{0x46}); + EXPECT_EQ(data[sz - 2], std::byte{0x41}); + EXPECT_EQ(data[sz - 1], std::byte{0x31}); + + EXPECT_TRUE(writer->written_blobs_metadata().empty()); + ICEBERG_UNWRAP_OR_FAIL(auto fsize, writer->FileSize()); + EXPECT_EQ(fsize, static_cast(data.size())); +} + +TEST(PuffinWriterTest, WriterRejectsAfterFinish) { + PuffinFile file; + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ASSERT_THAT(writer->Finish(), IsOk()); + + EXPECT_THAT(writer->Finish(), IsError(ErrorKind::kInvalidArgument)); + + Blob blob{.type = "a", .snapshot_id = 1, .sequence_number = 0}; + EXPECT_THAT(writer->Write(blob), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinWriterTest, MakeRejectsNullOutput) { + EXPECT_THAT(PuffinWriter::Make(nullptr), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinWriterTest, MakeDoesNotOverwriteExistingFile) { + PuffinFile file; + file.Data().push_back(std::byte{0x42}); + + EXPECT_THAT(PuffinWriter::Make(file.Output()), IsError(ErrorKind::kAlreadyExists)); + ASSERT_EQ(file.Data().size(), 1); + EXPECT_EQ(file.Data().front(), std::byte{0x42}); +} + +TEST(PuffinWriterTest, SizesBeforeFinishReturnError) { + PuffinFile file; + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + EXPECT_THAT(writer->FooterSize(), IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(writer->FileSize(), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinWriterTest, CloseImplicitlyFinishesFile) { + PuffinFile file; + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + + ASSERT_THAT(writer->Close(), IsOk()); + EXPECT_THAT(writer->Close(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto fsize, writer->FileSize()); + EXPECT_EQ(fsize, static_cast(file.Data().size())); + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + EXPECT_TRUE(fm.blobs.empty()); +} + +TEST(PuffinRoundTripTest, SingleBlob) { + PuffinFile file; + { + ICEBERG_UNWRAP_OR_FAIL(auto writer, + PuffinWriter::Make(file.Output(), {{"created-by", "test"}})); + std::vector blob_data = {0x01, 0x02, 0x03, 0x04, 0x05}; + ICEBERG_UNWRAP_OR_FAIL(auto meta, writer->Write(Blob{.type = "test-blob", + .input_fields = {1, 2}, + .snapshot_id = 42, + .sequence_number = 7, + .data = blob_data})); + EXPECT_EQ(meta.type, "test-blob"); + EXPECT_EQ(meta.offset, 4); + EXPECT_EQ(meta.length, 5); + ASSERT_THAT(writer->Finish(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto fsize, writer->FileSize()); + EXPECT_GT(fsize, 0); + } + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + ASSERT_EQ(fm.blobs.size(), 1); + EXPECT_EQ(fm.blobs[0].type, "test-blob"); + EXPECT_EQ(fm.properties.at("created-by"), "test"); + + ICEBERG_UNWRAP_OR_FAIL(auto blob_result, reader->ReadBlob(fm.blobs[0])); + std::vector expected = {std::byte{0x01}, std::byte{0x02}, std::byte{0x03}, + std::byte{0x04}, std::byte{0x05}}; + EXPECT_EQ(blob_result.second, expected); +} + +TEST(PuffinRoundTripTest, MultipleBlobs) { + PuffinFile file; + { + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ICEBERG_UNWRAP_OR_FAIL(auto m1, writer->Write(Blob{.type = "first", + .input_fields = {1}, + .snapshot_id = 1, + .sequence_number = 0, + .data = {'a', 'b', 'c'}})); + ICEBERG_UNWRAP_OR_FAIL(auto m2, writer->Write(Blob{.type = "second", + .input_fields = {2}, + .snapshot_id = 2, + .sequence_number = 1, + .data = {'d', 'e', 'f', 'g'}, + .properties = {{"key", "val"}}})); + EXPECT_EQ(m2.offset, 7); + EXPECT_EQ(m2.length, 4); + ASSERT_THAT(writer->Finish(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + ASSERT_EQ(fm.blobs.size(), 2); + EXPECT_TRUE(fm.blobs[0].properties.empty()); + EXPECT_EQ(fm.blobs[1].properties.at("key"), "val"); + + ICEBERG_UNWRAP_OR_FAIL(auto all, reader->ReadAll(fm.blobs)); + ASSERT_EQ(all.size(), 2); + EXPECT_EQ(all[0].second, ToBytes("abc")); + EXPECT_EQ(all[1].second, ToBytes("defg")); +} + +TEST(PuffinRoundTripTest, WithProperties) { + PuffinFile file; + { + ICEBERG_UNWRAP_OR_FAIL( + auto writer, + PuffinWriter::Make(file.Output(), {{"created-by", "iceberg-cpp-test"}})); + std::string text = "hello puffin"; + std::vector blob_data(text.begin(), text.end()); + ASSERT_THAT(writer->Write(Blob{.type = "text-blob", + .input_fields = {1}, + .snapshot_id = 100, + .sequence_number = 5, + .data = blob_data, + .properties = {{"encoding", "utf-8"}}}), + IsOk()); + ASSERT_THAT(writer->Finish(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + EXPECT_EQ(fm.properties.at("created-by"), "iceberg-cpp-test"); + ASSERT_EQ(fm.blobs.size(), 1); + EXPECT_EQ(fm.blobs[0].properties.at("encoding"), "utf-8"); + + ICEBERG_UNWRAP_OR_FAIL(auto blob_result, reader->ReadBlob(fm.blobs[0])); + EXPECT_EQ(blob_result.second, ToBytes("hello puffin")); +} + +TEST(PuffinReaderTest, MakeRejectsNullInput) { + EXPECT_THAT(PuffinReader::Make(nullptr), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinReaderTest, MakeUsesKnownFileSizeAndFooterSize) { + PuffinFile file; + int64_t footer_size = 0; + int64_t file_size = 0; + { + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ASSERT_THAT(writer->Finish(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(footer_size, writer->FooterSize()); + ICEBERG_UNWRAP_OR_FAIL(file_size, writer->FileSize()); + } + + ICEBERG_UNWRAP_OR_FAIL( + auto reader, PuffinReader::Make(file.Input(file_size), footer_size, file_size)); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + EXPECT_TRUE(fm.blobs.empty()); +} + +TEST(PuffinReaderTest, KnownFooterSizeMismatchIsRejected) { + PuffinFile file; + int64_t footer_size = 0; + int64_t file_size = 0; + { + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ASSERT_THAT(writer->Finish(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(footer_size, writer->FooterSize()); + ICEBERG_UNWRAP_OR_FAIL(file_size, writer->FileSize()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto reader, + PuffinReader::Make(file.Input(), footer_size - 1, file_size)); + EXPECT_THAT(reader->ReadFileMetadata(), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinReaderTest, UnknownFlagsRejected) { + PuffinFile file; + { + ICEBERG_UNWRAP_OR_FAIL(auto writer, PuffinWriter::Make(file.Output())); + ASSERT_THAT(writer->Finish(), IsOk()); + } + auto& data = file.Data(); + data[data.size() - 8] = std::byte{0x02}; + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + EXPECT_THAT(reader->ReadFileMetadata(), IsError(ErrorKind::kInvalidArgument)); +} + +TEST(PuffinReaderTest, EmptyPuffinCompatibility) { + PuffinFile file; + std::vector data{ + std::byte{0x50}, std::byte{0x46}, std::byte{0x41}, std::byte{0x31}, std::byte{0x50}, + std::byte{0x46}, std::byte{0x41}, std::byte{0x31}, std::byte{0x7b}, std::byte{0x22}, + std::byte{0x62}, std::byte{0x6c}, std::byte{0x6f}, std::byte{0x62}, std::byte{0x73}, + std::byte{0x22}, std::byte{0x3a}, std::byte{0x5b}, std::byte{0x5d}, std::byte{0x7d}, + std::byte{0x0c}, std::byte{0x00}, std::byte{0x00}, std::byte{0x00}, std::byte{0x00}, + std::byte{0x00}, std::byte{0x00}, std::byte{0x00}, std::byte{0x50}, std::byte{0x46}, + std::byte{0x41}, std::byte{0x31}, + }; + file.SetData(data); + + ICEBERG_UNWRAP_OR_FAIL(auto reader, PuffinReader::Make(file.Input())); + ICEBERG_UNWRAP_OR_FAIL(auto fm, reader->ReadFileMetadata()); + EXPECT_TRUE(fm.blobs.empty()); + EXPECT_TRUE(fm.properties.empty()); +} + +} // namespace iceberg::puffin diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 144a9e33a..064ec285a 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -188,6 +188,11 @@ class FileIO; class Reader; class Writer; +class InputFile; +class OutputFile; +class PositionOutputStream; +class SeekableInputStream; + /// \brief Row-based data structures. class ArrayLike; class MapLike; From d6c1da02c2b4fb53479ba1b3a7f5ad2a44d9784f Mon Sep 17 00:00:00 2001 From: Yingfan Guo <115908952+sentomk@users.noreply.github.com> Date: Fri, 29 May 2026 00:02:57 +0800 Subject: [PATCH 049/151] fix: correct StrictMetricsEvaluator::CanContainNulls/CanContainNaNs when field missing from stats map (#686) ## Summary - Fix `StrictMetricsEvaluator::CanContainNulls` to return `true` (conservative) when a field is absent from a non-empty `null_value_counts` map, and `false` for required fields per schema - Fix `StrictMetricsEvaluator::CanContainNaNs` to return `true` (conservative) when a field is absent from a non-empty `nan_value_counts` map, and `false` for non-floating-point types - Add regression tests covering the missing-entry scenario Close #685 ## Motivation When `null_value_counts` or `nan_value_counts` is non-empty but does not contain an entry for the queried field, the evaluator incorrectly returned `false`. This caused comparison operators to erroneously return `kRowsMustMatch`, potentially skipping row-level filtering and returning rows that do not satisfy the predicate. ## Test plan - All 40 existing + new StrictMetrics tests pass - pre-commit (clang-format, trailing whitespace, etc.) passes --- .../expression/strict_metrics_evaluator.cc | 56 ++++++++++++++--- .../test/strict_metrics_evaluator_test.cc | 63 +++++++++++++++++++ 2 files changed, 109 insertions(+), 10 deletions(-) diff --git a/src/iceberg/expression/strict_metrics_evaluator.cc b/src/iceberg/expression/strict_metrics_evaluator.cc index e2fe34f14..a9b5ded46 100644 --- a/src/iceberg/expression/strict_metrics_evaluator.cc +++ b/src/iceberg/expression/strict_metrics_evaluator.cc @@ -142,7 +142,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } @@ -168,7 +170,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } @@ -194,7 +198,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } @@ -226,7 +232,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } @@ -258,7 +266,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } auto lower_it = data_file_.lower_bounds.find(id); @@ -330,7 +340,9 @@ class StrictMetricsVisitor : public BoundVisitor { return kRowsMightNotMatch; } - if (CanContainNulls(id) || CanContainNaNs(id)) { + ICEBERG_ASSIGN_OR_RAISE(auto has_nulls, CanContainNulls(id)); + ICEBERG_ASSIGN_OR_RAISE(auto has_nans, CanContainNaNs(id)); + if (has_nulls || has_nans) { return kRowsMightNotMatch; } auto lower_it = data_file_.lower_bounds.find(id); @@ -435,19 +447,43 @@ class StrictMetricsVisitor : public BoundVisitor { return Literal::Deserialize(stats, primitive_type); } - bool CanContainNulls(int32_t id) { + Result CanContainNulls(int32_t id) { + ICEBERG_ASSIGN_OR_RAISE(auto field_opt, schema_.FindFieldById(id)); + if (field_opt.has_value() && !field_opt->get().optional()) { + return false; + } + + // When null_value_counts is not empty, the evaluator expects all fields to be + // present. A missing entry indicates that the field's null count is unknown. if (data_file_.null_value_counts.empty()) { return true; } auto it = data_file_.null_value_counts.find(id); - return it != data_file_.null_value_counts.cend() && it->second > 0; + if (it == data_file_.null_value_counts.cend()) { + return true; + } + return it->second > 0; } - bool CanContainNaNs(int32_t id) { + Result CanContainNaNs(int32_t id) { + ICEBERG_ASSIGN_OR_RAISE(auto field_opt, schema_.FindFieldById(id)); + if (field_opt.has_value()) { + auto type_id = field_opt->get().type()->type_id(); + if (type_id != TypeId::kFloat && type_id != TypeId::kDouble) { + return false; + } + } + // nan counts might be null for early version writers when nan counters are not // populated. + if (data_file_.nan_value_counts.empty()) { + return true; + } auto it = data_file_.nan_value_counts.find(id); - return it != data_file_.nan_value_counts.cend() && it->second > 0; + if (it == data_file_.nan_value_counts.cend()) { + return true; + } + return it->second > 0; } bool ContainsNullsOnly(int32_t id) { diff --git a/src/iceberg/test/strict_metrics_evaluator_test.cc b/src/iceberg/test/strict_metrics_evaluator_test.cc index fa6185c3b..fcb997929 100644 --- a/src/iceberg/test/strict_metrics_evaluator_test.cc +++ b/src/iceberg/test/strict_metrics_evaluator_test.cc @@ -846,4 +846,67 @@ TEST_F(StrictMetricsEvaluatorMigratedTest, EvaluateOnNestedColumnWithStats) { ExpectShouldRead(Expressions::NotNull("struct.nested_col_with_stats"), false); } +TEST(StrictMetricsEvaluatorRegressionTest, MissingNullCountForField) { + // Field 14 (no_nan_stats, float64, optional) has bounds and value_counts but is + // missing from null_value_counts. The evaluator must conservatively assume nulls + // may exist and return kRowsMightNotMatch for comparison operators. + auto schema = std::make_shared( + std::vector{ + SchemaField::MakeOptional(14, "no_nan_stats", float64()), + }, + /*schema_id=*/0); + + auto data_file = std::make_shared(); + data_file->file_path = "null_test.parquet"; + data_file->file_format = FileFormatType::kParquet; + data_file->record_count = 50; + data_file->value_counts = {{14, 50L}}; + data_file->null_value_counts = {{4, 0L}, {5, 0L}}; + data_file->nan_value_counts = {{14, 0L}}; + data_file->lower_bounds = {{14, Literal::Double(1.0).Serialize().value()}}; + data_file->upper_bounds = {{14, Literal::Double(100.0).Serialize().value()}}; + + auto evaluate = [&](const std::shared_ptr& expr) { + ICEBERG_UNWRAP_OR_FAIL(auto eval, StrictMetricsEvaluator::Make(expr, schema, true)); + ICEBERG_UNWRAP_OR_FAIL(auto result, eval->Evaluate(*data_file)); + EXPECT_EQ(result, kRowsMightNotMatch) << expr->ToString(); + }; + + evaluate(Expressions::LessThan("no_nan_stats", Literal::Double(200.0))); + evaluate(Expressions::LessThanOrEqual("no_nan_stats", Literal::Double(200.0))); + evaluate(Expressions::GreaterThan("no_nan_stats", Literal::Double(-1.0))); + evaluate(Expressions::GreaterThanOrEqual("no_nan_stats", Literal::Double(-1.0))); + evaluate(Expressions::Equal("no_nan_stats", Literal::Double(50.0))); +} + +TEST(StrictMetricsEvaluatorRegressionTest, MissingNanCountForField) { + // Field 14 (no_nan_stats, float64, optional) is missing from nan_value_counts. + // For a floating-point field, the evaluator must conservatively assume NaNs may + // exist and return kRowsMightNotMatch for comparison operators. + auto schema = std::make_shared( + std::vector{ + SchemaField::MakeOptional(14, "no_nan_stats", float64()), + }, + /*schema_id=*/0); + + auto data_file = std::make_shared(); + data_file->file_path = "nan_test.parquet"; + data_file->file_format = FileFormatType::kParquet; + data_file->record_count = 50; + data_file->value_counts = {{14, 50L}}; + data_file->null_value_counts = {{14, 0L}}; + data_file->nan_value_counts = {{8, 0L}}; + data_file->lower_bounds = {{14, Literal::Double(1.0).Serialize().value()}}; + data_file->upper_bounds = {{14, Literal::Double(100.0).Serialize().value()}}; + + auto evaluate = [&](const std::shared_ptr& expr) { + ICEBERG_UNWRAP_OR_FAIL(auto eval, StrictMetricsEvaluator::Make(expr, schema, true)); + ICEBERG_UNWRAP_OR_FAIL(auto result, eval->Evaluate(*data_file)); + EXPECT_EQ(result, kRowsMightNotMatch) << expr->ToString(); + }; + + evaluate(Expressions::LessThan("no_nan_stats", Literal::Double(200.0))); + evaluate(Expressions::GreaterThan("no_nan_stats", Literal::Double(-1.0))); +} + } // namespace iceberg From 18e055cd1685fa69a0b5ad4415433bb38b36f4d3 Mon Sep 17 00:00:00 2001 From: Sung Yun <107272191+sungwy@users.noreply.github.com> Date: Thu, 28 May 2026 15:54:32 -0400 Subject: [PATCH 050/151] docs: add Iceberg security model (#688) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to: https://github.com/apache/iceberg/pull/16538 This PR publishes a security model for Iceberg and adds a detailed threat model referenced from AGENTS.md so there is a clear project reference for how Iceberg distinguishes security issues from other bugs. The goal is to make Iceberg’s security boundaries explicit for both human triage and automated scanning, and to reduce false positives in future security reporting. This PR was drafted with AI assistance and then manually reviewed and edited to reflect the project’s current approach to security roles, trust boundaries, and the handling of recent security reports. ### Note: `AGENTS.md` is currently in `.gitignore`, but this file was force committed to ensure that agents running automated security scans will be able to find the security model. --- AGENTS.md | 30 +++++ SECURITY-THREAT-MODEL.md | 238 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 268 insertions(+) create mode 100644 AGENTS.md create mode 100644 SECURITY-THREAT-MODEL.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..fff50198d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ + + +# Apache Iceberg C++ — Agent Instructions + +This file provides repository-specific guidance for automated agents working +in this repository. + +## Security Model + +When assessing potential vulnerabilities or calibrating automated security +findings, use [`SECURITY-THREAT-MODEL.md`](SECURITY-THREAT-MODEL.md) as the +authoritative detailed description of this repository's security boundaries, +trust assumptions, and non-boundaries. diff --git a/SECURITY-THREAT-MODEL.md b/SECURITY-THREAT-MODEL.md new file mode 100644 index 000000000..5498078e0 --- /dev/null +++ b/SECURITY-THREAT-MODEL.md @@ -0,0 +1,238 @@ + + +# Apache Iceberg C++ Security Threat Model + +This document describes the detailed security threat model for Apache +Iceberg C++. It is intended for maintainers and automated security triage. + +## Purpose + +Apache Iceberg C++ is primarily a native library implementing Iceberg table +format handling, catalog interactions, and related tooling for C++ +applications and services. It is commonly embedded in larger systems that +provide their own authentication, authorization, and credential management. +Because of that deployment model, not every unsafe or surprising behavior is a +security vulnerability in Iceberg C++ itself. + +This model is intended to answer: + +- what Iceberg C++ generally treats as a security vulnerability +- what Iceberg C++ generally treats as correctness, hardening, or deployment + work +- which boundaries are primarily owned by Iceberg C++ versus the surrounding + catalog, application, or service +- which issue classes should be downgraded by default by scanners + +## Scope + +This model is scoped to the Apache Iceberg C++ repository itself: + +- table format and metadata handling +- catalog and REST catalog clients +- transport, credential, and configuration handling implemented in this repo +- native parsing, memory management, and helper tooling shipped in this repo + +It is not a general threat model for every application that embeds Iceberg +C++. + +In particular, it does not attempt to define the complete security model for: + +- applications or services that embed Iceberg C++ +- storage-level authorization enforced outside Iceberg C++ + +## Security Goals + +Iceberg C++ should: + +- avoid exposing secrets or delegated credentials to principals that were not + already trusted with them +- avoid creating new unauthorized capabilities in Iceberg C++-owned + components +- avoid violating trust boundaries that Iceberg C++ itself owns, such as + leaking auth, transport, or credential-bearing state across catalog or + client boundaries in the same process +- avoid memory-safety violations triggered by untrusted input, including + out-of-bounds access, use-after-free, and other memory corruption + +Iceberg C++ does not aim to be the primary enforcement point for: + +- user-to-user authorization inside the embedding application +- storage-level authorization +- service-side credential scoping performed by an external catalog + +## Roles + +### Operator + +The operator configures the surrounding catalog, application, service, and +storage integration around Iceberg C++. This role is trusted to choose +endpoints, warehouses, storage integrations, and credentials. + +### Catalog control plane + +The catalog control plane resolves tables and supplies metadata, locations, +configuration, and delegated credentials to Iceberg C++. It may be +implemented by a REST catalog server or another catalog implementation. +Iceberg C++ assumes this control plane is trusted and outside its primary +security boundary. + +### REST catalog client + +The REST catalog client consumes catalog-provided metadata, configuration, and +credentials. Client-side bugs in routing, caching, or reuse may still be +security-relevant if they leak credential-bearing state across boundaries that +the Iceberg C++ client is expected to preserve. + +### Embedding application + +Applications and services embedding Iceberg C++ are responsible for their own +user-facing authorization boundaries unless Iceberg C++ explicitly documents +otherwise. + +### Table writer or maintainer + +This role may already have legitimate power to write or replace table +metadata, write or delete files, choose paths under an allowed warehouse or +table location, and invoke destructive maintenance operations. If a report +only shows a new way to achieve the same effect this role can already cause +legitimately, it is usually not a security issue in Iceberg C++. + +## Trust Boundaries + +### Boundary 1: operator-trusted configuration + +The following are generally treated as trusted operator or deployment inputs: + +- catalog properties +- endpoint configuration +- warehouse and storage roots +- transport wiring and credential configuration + +If a report depends on the attacker controlling those values directly, it is +usually not a vulnerability in Iceberg C++ itself. + +### Boundary 2: catalog-supplied metadata + +Iceberg C++ often accepts metadata locations, table properties, namespace +properties, and related control-plane information from a catalog. By default, +Iceberg C++ treats those sources as trusted. + +This means a malicious catalog supplying incorrect or malicious metadata is +usually not an Iceberg C++ vulnerability by itself. + +### Boundary 3: REST catalog-supplied configuration and delegated storage access + +In REST deployments, Iceberg C++ may also accept service endpoints, +configuration, and delegated storage access from the REST catalog server. By +default, those are treated as trusted control-plane inputs unless Iceberg C++ +explicitly documents a stronger guarantee. + +This means a malicious REST catalog server sending dangerous endpoints is +usually not an Iceberg C++ vulnerability by itself. It also means many +credential-selection bugs are often correctness or specification issues rather +than security boundary failures. + +The major exception is secret exposure. If Iceberg C++ surfaces credentials or +secrets to a new audience that was not already trusted with them, that is +security-relevant. + +### Boundary 4: storage-level authorization + +Object store permissions are enforced by the storage provider and the +credentials the surrounding deployment chooses to hand to Iceberg C++. +Iceberg C++ is not the root authority for bucket- or object-level +authorization. + +## In-Scope Security Vulnerabilities + +The following categories are generally security-relevant in Iceberg C++ when +the report is credible and reproducible. + +### 1. Secret or credential disclosure to a new audience + +Examples include: + +- catalog or storage credentials exposed through a user-visible surface +- one catalog's credentials or auth state leaking into another catalog or + client + +### 2. Iceberg C++-owned trust-boundary violations + +Security issues exist when Iceberg C++ itself is expected to separate +catalogs, clients, or principals and fails to do so. + +Examples include: + +- process-global auth or transport state crossing catalog instances +- secret-bearing state from one principal reused for another principal within + an Iceberg C++-owned boundary + +### 3. Memory-safety violations from untrusted input + +Out-of-bounds access, use-after-free, memory corruption, and similar native +memory-safety issues triggered by untrusted input are generally security- +relevant in Iceberg C++. + +## Usually Out of Scope or Non-Security by Default + +These categories may still be real bugs worth fixing, but they are not usually +security vulnerabilities in Iceberg C++ itself. + +### 1. Correctness bugs + +Examples include incorrect metadata handling, ambiguous matching semantics, +and logic bugs that do not create a new trust-boundary violation. + +### 2. Parser hardening and malformed-input robustness without memory corruption + +Malformed-input crashes, bounded allocation failures, and memory amplification +without memory corruption are usually treated as robustness or hardening work +rather than security issues in Iceberg C++ itself. + +### 3. Malicious catalog or external service scenarios + +Reports that require a malicious catalog or other external control-plane +service are usually outside Iceberg C++'s primary security boundary. + +### 4. Equivalent-harm reports + +If the actor already has a legitimate capability that can cause the same harm, +the new path is usually not a security issue. + +## Scanner Calibration Rules + +A scanner targeting Iceberg C++ should treat a finding as higher-confidence +only if it plausibly shows one of the following: + +- exposure of a secret or delegated credential to a new audience +- creation of a new unauthorized capability in an Iceberg C++-owned component +- violation of an Iceberg C++-owned trust boundary rather than a surrounding + catalog, application, service, or operator boundary +- memory corruption or other native memory-safety violations triggered by + untrusted input + +A finding should be downgraded or rejected by default if it instead depends +primarily on: + +- malformed-input robustness or denial-of-service behavior without memory + corruption +- a malicious catalog or external service +- a principal that already has equivalent power through legitimate write or + maintenance capabilities From b92e0227a7c87ddd5c2074f384e419028175cd55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 31 May 2026 15:50:10 +0800 Subject: [PATCH 051/151] chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 (#691) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.5 to 4.36.0.
Release notes

Sourced from github/codeql-action's releases.

v4.36.0

  • Breaking change: Bump the minimum required CodeQL bundle version to 2.19.4. #3894
  • Add support for SHA-256 Git object IDs. #3893
  • Update default CodeQL bundle version to 2.25.5. #3926
Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

No user facing changes.

4.36.0 - 22 May 2026

  • Breaking change: Bump the minimum required CodeQL bundle version to 2.19.4. #3894
  • Add support for SHA-256 Git object IDs. #3893
  • Update default CodeQL bundle version to 2.25.5. #3926

4.35.5 - 15 May 2026

  • We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. #3899
  • For performance and accuracy reasons, improved incremental analysis will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. #3791
  • If multiple inputs are provided for the GitHub-internal analysis-kinds input, only code-scanning will be enabled. The analysis-kinds input is experimental, for GitHub-internal use only, and may change without notice at any time. #3892
  • Added an experimental change which, when running a Code Scanning analysis for a PR with improved incremental analysis enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. #3880

4.35.4 - 07 May 2026

  • Update default CodeQL bundle version to 2.25.4. #3881

4.35.3 - 01 May 2026

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

4.35.1 - 27 Mar 2026

4.35.0 - 27 Mar 2026

... (truncated)

Commits
  • 7211b7c Merge pull request #3927 from github/update-v4.36.0-ebc2d9e2b
  • 7740f2f Update changelog for v4.36.0
  • ebc2d9e Merge pull request #3926 from github/update-bundle/codeql-bundle-v2.25.5
  • d1f74b7 Add changelog note
  • 2dc40ce Update default bundle to codeql-bundle-v2.25.5
  • 8449852 Merge pull request #3910 from github/henrymercer/repo-size-diff-check
  • 72ac23c Update excluded required check list
  • c5297a2 Merge pull request #3919 from github/henrymercer/workflow-concurrency
  • 8ffeae7 CI: Automatically cancel non-generated workflows
  • f3f52bf Revert getErrorMessage import
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.35.5&new-version=4.36.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1e98f27ce..d565a0a75 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,11 +48,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 + uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5 + uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 with: category: "/language:actions" From a0c494817347658a780e7f65f8f4a0af5c5fc7e0 Mon Sep 17 00:00:00 2001 From: liuxiaoyu <45345701+MisterRaindrop@users.noreply.github.com> Date: Sun, 31 May 2026 15:52:25 +0800 Subject: [PATCH 052/151] build(hive): add ICEBERG_BUILD_HIVE option and skeleton (#689) Introduce a top-level ICEBERG_BUILD_HIVE CMake option (default OFF) and wire src/iceberg/catalog/hive/ into the build as a subdirectory. The new directory installs only iceberg_hive_export.h for now and mirrors the iceberg_rest_export.h pattern so that follow-up commits can add sources without further layout changes. The default OFF keeps builds without Apache Thrift unaffected. README's CMake options table is updated. First commit of the iceberg-cpp HiveCatalog that follows iceberg-rust's iceberg-catalog-hms crate as a blueprint. --- CMakeLists.txt | 1 + README.md | 1 + src/iceberg/catalog/CMakeLists.txt | 4 +++ src/iceberg/catalog/hive/CMakeLists.txt | 25 ++++++++++++++ .../catalog/hive/iceberg_hive_export.h | 34 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 src/iceberg/catalog/hive/CMakeLists.txt create mode 100644 src/iceberg/catalog/hive/iceberg_hive_export.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c0f2eb73f..38837aedd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ option(ICEBERG_BUILD_TESTS "Build tests" ON) option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON) option(ICEBERG_BUILD_REST "Build rest catalog client" ON) option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF) +option(ICEBERG_BUILD_HIVE "Build hive (HMS) catalog client" OFF) option(ICEBERG_S3 "Build with S3 support" OFF) option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) diff --git a/README.md b/README.md index 281987c3c..3d69a01fc 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ cmake --install build | `ICEBERG_BUILD_BUNDLE` | `ON` | Build the battery-included library | | `ICEBERG_BUILD_REST` | `ON` | Build REST catalog client | | `ICEBERG_BUILD_REST_INTEGRATION_TESTS` | `OFF` | Build REST catalog integration tests | +| `ICEBERG_BUILD_HIVE` | `OFF` | Build Hive (HMS) catalog client | | `ICEBERG_ENABLE_ASAN` | `OFF` | Enable Address Sanitizer | | `ICEBERG_ENABLE_UBSAN` | `OFF` | Enable Undefined Behavior Sanitizer | diff --git a/src/iceberg/catalog/CMakeLists.txt b/src/iceberg/catalog/CMakeLists.txt index 13cdb0949..0b288e260 100644 --- a/src/iceberg/catalog/CMakeLists.txt +++ b/src/iceberg/catalog/CMakeLists.txt @@ -20,3 +20,7 @@ add_subdirectory(memory) if(ICEBERG_BUILD_REST) add_subdirectory(rest) endif() + +if(ICEBERG_BUILD_HIVE) + add_subdirectory(hive) +endif() diff --git a/src/iceberg/catalog/hive/CMakeLists.txt b/src/iceberg/catalog/hive/CMakeLists.txt new file mode 100644 index 000000000..0dee1ad10 --- /dev/null +++ b/src/iceberg/catalog/hive/CMakeLists.txt @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Skeleton for the iceberg_hive library target. +# +# Sources, dependency wiring and the actual `iceberg_hive` library target +# are introduced in follow-up commits. For now this file installs only the +# public export header so that the directory is wired into the build system +# end-to-end. + +iceberg_install_all_headers(iceberg/catalog/hive) diff --git a/src/iceberg/catalog/hive/iceberg_hive_export.h b/src/iceberg/catalog/hive/iceberg_hive_export.h new file mode 100644 index 000000000..229304553 --- /dev/null +++ b/src/iceberg/catalog/hive/iceberg_hive_export.h @@ -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. + */ + +#pragma once + +#if defined(_WIN32) || defined(__CYGWIN__) +# ifdef ICEBERG_HIVE_STATIC +# define ICEBERG_HIVE_EXPORT +# elif defined(ICEBERG_HIVE_EXPORTING) +# define ICEBERG_HIVE_EXPORT __declspec(dllexport) +# else +# define ICEBERG_HIVE_EXPORT __declspec(dllimport) +# endif +#else // Not Windows +# ifndef ICEBERG_HIVE_EXPORT +# define ICEBERG_HIVE_EXPORT __attribute__((visibility("default"))) +# endif +#endif From f936553ef248ff5204a0988c4c691301800a5950 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 1 Jun 2026 23:14:50 +0800 Subject: [PATCH 053/151] chore(doc): bump minimum Clang version to 18 (#695) ErrorCollector uses the C++23 "deducing this" feature (P0847 / explicit object parameters), which is first supported in Clang 18. For example, the following code compiles with Clang 18+ but fails with Clang 17: https://godbolt.org/z/17YebzKo4 --- README.md | 2 +- dev/release/README.md | 2 +- mkdocs/docs/getting-started.md | 2 +- mkdocs/docs/verify-rc.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3d69a01fc..3590a2a7d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ C++ implementation of [Apache Iceberg™](https://iceberg.apache.org/). **Required:** -- C++23 compliant compiler (GCC 14+, Clang 16+, MSVC 2022+) +- C++23 compliant compiler (GCC 14+, Clang 18+, MSVC 2022+) - CMake 3.25+ or Meson 1.5+ - [Ninja](https://ninja-build.org/) (recommended build backend) diff --git a/dev/release/README.md b/dev/release/README.md index d6dc95aca..13b63e605 100644 --- a/dev/release/README.md +++ b/dev/release/README.md @@ -99,7 +99,7 @@ You must install the following to run the script: * `shasum` or `sha512sum` * `tar` * `cmake` (3.25 or higher) - * C++23 compliant compiler (GCC 14+, Clang 16+, MSVC 2022+) + * C++23 compliant compiler (GCC 14+, Clang 18+, MSVC 2022+) To verify a RC, run the following: diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 14c53e7ce..012817c51 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -23,7 +23,7 @@ **Required:** -- C++23 compliant compiler (GCC 14+, Clang 16+, MSVC 2022+) +- C++23 compliant compiler (GCC 14+, Clang 18+, MSVC 2022+) - CMake 3.25+ or Meson 1.5+ - [Ninja](https://ninja-build.org/) (recommended build backend) diff --git a/mkdocs/docs/verify-rc.md b/mkdocs/docs/verify-rc.md index 4da82ce39..1f34a1235 100644 --- a/mkdocs/docs/verify-rc.md +++ b/mkdocs/docs/verify-rc.md @@ -28,7 +28,7 @@ When a release candidate (RC) is published for a vote, community members are enc - `shasum` or `sha512sum` - `tar` - CMake 3.25+ -- C++23 compliant compiler (GCC 14+, Clang 16+, MSVC 2022+) +- C++23 compliant compiler (GCC 14+, Clang 18+, MSVC 2022+) ## Verification Steps From 5e13fb13d1e26d49331736f625fe1f5b1c560ba5 Mon Sep 17 00:00:00 2001 From: Guotao Yu Date: Wed, 3 Jun 2026 11:56:59 +0800 Subject: [PATCH 054/151] feat: add MergingSnapshotUpdate (#682) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abstract base for merge-based snapshot operations (MergeAppend, OverwriteFiles, RowDelta, etc.), implementing the filter → write → merge pipeline consistent with Java's MergingSnapshotProducer. --- .github/workflows/sanitizer_test.yml | 10 +- src/iceberg/CMakeLists.txt | 1 + src/iceberg/manifest/manifest_entry.h | 2 +- .../manifest/manifest_filter_manager.cc | 357 +++- .../manifest/manifest_filter_manager.h | 124 +- .../manifest/manifest_merge_manager.cc | 208 +- src/iceberg/manifest/manifest_merge_manager.h | 84 +- src/iceberg/manifest/manifest_reader.cc | 39 +- src/iceberg/manifest/manifest_reader.h | 16 +- .../manifest/manifest_reader_internal.h | 4 +- src/iceberg/meson.build | 1 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/data_file_set_test.cc | 79 +- src/iceberg/test/fast_append_test.cc | 13 +- .../test/manifest_filter_manager_test.cc | 921 ++++++++- .../test/manifest_merge_manager_test.cc | 402 ++-- src/iceberg/test/manifest_reader_test.cc | 35 + .../test/manifest_writer_versions_test.cc | 14 + .../test/merging_snapshot_update_test.cc | 1706 +++++++++++++++++ src/iceberg/test/snapshot_util_test.cc | 36 +- src/iceberg/update/fast_append.cc | 3 +- src/iceberg/update/fast_append.h | 2 +- src/iceberg/update/merging_snapshot_update.cc | 1325 +++++++++++++ src/iceberg/update/merging_snapshot_update.h | 385 ++++ src/iceberg/update/meson.build | 1 + src/iceberg/update/snapshot_update.cc | 73 +- src/iceberg/update/snapshot_update.h | 24 +- src/iceberg/util/data_file_set.h | 164 +- 28 files changed, 5633 insertions(+), 397 deletions(-) create mode 100644 src/iceberg/test/merging_snapshot_update_test.cc create mode 100644 src/iceberg/update/merging_snapshot_update.cc create mode 100644 src/iceberg/update/merging_snapshot_update.h diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index efe9f49ac..faac265e8 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -58,9 +58,9 @@ jobs: - name: Run Tests working-directory: build env: - ASAN_OPTIONS: log_path=out.log:detect_leaks=1:symbolize=1:strict_string_checks=1:halt_on_error=1:detect_container_overflow=0 + ASAN_OPTIONS: log_path=${{ github.workspace }}/asan.log:detect_leaks=1:symbolize=1:strict_string_checks=1:halt_on_error=1:detect_container_overflow=0 LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan-suppressions.txt - UBSAN_OPTIONS: log_path=out.log:halt_on_error=1:print_stacktrace=1:suppressions=${{ github.workspace }}/.github/ubsan-suppressions.txt + UBSAN_OPTIONS: log_path=${{ github.workspace }}/ubsan.log:halt_on_error=1:print_stacktrace=1:suppressions=${{ github.workspace }}/.github/ubsan-suppressions.txt run: | ctest --output-on-failure - name: Save the test output @@ -68,4 +68,8 @@ jobs: uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: test-output - path: build/test/out.log* + path: | + asan.log* + ubsan.log* + build/Testing/Temporary/LastTest.log + build/Testing/Temporary/LastTestsFailed.log diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 18cf70bdb..38d85534a 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -89,6 +89,7 @@ set(ICEBERG_SOURCES type.cc update/expire_snapshots.cc update/fast_append.cc + update/merging_snapshot_update.cc update/pending_update.cc update/set_snapshot.cc update/snapshot_manager.cc diff --git a/src/iceberg/manifest/manifest_entry.h b/src/iceberg/manifest/manifest_entry.h index 17c5388bd..e2dd5ea61 100644 --- a/src/iceberg/manifest/manifest_entry.h +++ b/src/iceberg/manifest/manifest_entry.h @@ -374,7 +374,7 @@ struct ICEBERG_EXPORT ManifestEntry { ManifestEntry AsAdded() const { ManifestEntry copy = *this; copy.status = ManifestStatus::kAdded; - if (copy.data_file->first_row_id.has_value()) { + if (copy.data_file != nullptr && copy.data_file->first_row_id.has_value()) { copy.data_file = std::make_unique(*copy.data_file); copy.data_file->first_row_id = std::nullopt; } diff --git a/src/iceberg/manifest/manifest_filter_manager.cc b/src/iceberg/manifest/manifest_filter_manager.cc index 086c94a78..49fec0461 100644 --- a/src/iceberg/manifest/manifest_filter_manager.cc +++ b/src/iceberg/manifest/manifest_filter_manager.cc @@ -20,6 +20,7 @@ #include "iceberg/manifest/manifest_filter_manager.h" #include +#include #include #include @@ -29,6 +30,7 @@ #include "iceberg/expression/manifest_evaluator.h" #include "iceberg/expression/residual_evaluator.h" #include "iceberg/expression/strict_metrics_evaluator.h" +#include "iceberg/file_io.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_list.h" #include "iceberg/manifest/manifest_reader.h" @@ -63,18 +65,76 @@ Result FormatPartitionPath(const PartitionSpecsById& specs_by_id, return spec->PartitionPath(file.partition); } +void AddDeletedFileToManager(ManifestContent manifest_content, DataFileSet& data_files, + DeleteFileSet& delete_files, + std::vector>& deleted_files, + DataFileSet& deleted_data_file_set, + DeleteFileSet& deleted_file_set, + const std::shared_ptr& file) { + if (file == nullptr) { + return; + } + + bool inserted; + if (manifest_content == ManifestContent::kData) { + data_files.insert(file); + inserted = deleted_data_file_set.insert(file).second; + } else { + delete_files.insert(file); + inserted = deleted_file_set.insert(file).second; + } + if (inserted) { + deleted_files.push_back(file); + } +} + +bool AddDeletedFileToManifest(ManifestContent manifest_content, + std::vector>& deleted_files, + DataFileSet& deleted_data_file_set, + DeleteFileSet& deleted_file_set, + const std::shared_ptr& file) { + if (file == nullptr) { + return false; + } + bool inserted = manifest_content == ManifestContent::kData + ? deleted_data_file_set.insert(file).second + : deleted_file_set.insert(file).second; + if (inserted) { + deleted_files.push_back(file); + } + return inserted; +} + } // namespace -ManifestFilterManager::ManifestFilterManager(ManifestContent content, - std::shared_ptr file_io) +Result> ManifestFilterManager::Make( + ManifestContent content, std::shared_ptr file_io, + std::function delete_file) { + ICEBERG_PRECHECK(file_io != nullptr, "FileIO cannot be null"); + return std::unique_ptr( + new ManifestFilterManager(content, std::move(file_io), std::move(delete_file))); +} + +ManifestFilterManager::ManifestFilterManager( + ManifestContent content, std::shared_ptr file_io, + std::function delete_file) : manifest_content_(content), file_io_(std::move(file_io)), - delete_expr_(Expressions::AlwaysFalse()) {} + delete_file_(std::move(delete_file)), + delete_expr_(Expressions::AlwaysFalse()) { + ICEBERG_DCHECK(file_io_, "FileIO cannot be null"); + if (delete_file_ == nullptr) { + delete_file_ = [this](const std::string& location) { + return file_io_->DeleteFile(location); + }; + } +} ManifestFilterManager::~ManifestFilterManager() = default; Status ManifestFilterManager::DeleteByRowFilter(std::shared_ptr expr) { ICEBERG_PRECHECK(expr != nullptr, "Cannot delete files using filter: null"); + ICEBERG_RETURN_UNEXPECTED(InvalidateFilteredCache()); ICEBERG_ASSIGN_OR_RAISE(delete_expr_, Or::MakeFolded(delete_expr_, std::move(expr))); manifest_evaluator_cache_.clear(); residual_evaluator_cache_.clear(); @@ -87,23 +147,58 @@ void ManifestFilterManager::CaseSensitive(bool case_sensitive) { residual_evaluator_cache_.clear(); } -void ManifestFilterManager::DeleteFile(std::string_view path) { +Status ManifestFilterManager::DeleteFile(std::string_view path) { + ICEBERG_RETURN_UNEXPECTED(InvalidateFilteredCache()); delete_paths_.insert(std::string(path)); + return {}; } Status ManifestFilterManager::DeleteFile(std::shared_ptr file) { ICEBERG_PRECHECK(file != nullptr, "Cannot delete file: null"); - delete_paths_.insert(file->file_path); - delete_files_.insert(std::move(file)); + ICEBERG_RETURN_UNEXPECTED(InvalidateFilteredCache()); + if (manifest_content_ == ManifestContent::kData) { + data_files_.insert(file); + data_files_to_delete_.insert(std::move(file)); + } else { + delete_files_.insert(file); + delete_files_to_delete_.insert(std::move(file)); + } return {}; } -const DataFileSet& ManifestFilterManager::FilesToBeDeleted() const { - return delete_files_; +const DataFileSet& ManifestFilterManager::FilesToBeDeleted() const { return data_files_; } + +const std::vector>& ManifestFilterManager::DeletedFiles() + const { + return deleted_files_; +} + +Result ManifestFilterManager::BuildSummary( + const std::vector& manifests, + const PartitionSpecsById& specs_by_id) const { + SnapshotSummaryBuilder summary; + for (const auto& manifest : manifests) { + auto deleted_iter = filtered_manifest_to_deleted_files_.find(manifest); + if (deleted_iter == filtered_manifest_to_deleted_files_.end()) { + continue; + } + + ICEBERG_ASSIGN_OR_RAISE(auto spec, + PartitionSpecById(specs_by_id, manifest.partition_spec_id)); + for (const auto& file : deleted_iter->second.files) { + if (file != nullptr) { + ICEBERG_RETURN_UNEXPECTED(summary.DeletedFile(*spec, *file)); + } + } + } + summary.IncrementDuplicateDeletes(duplicate_deletes_count_); + return summary; } -void ManifestFilterManager::DropPartition(int32_t spec_id, PartitionValues partition) { +Status ManifestFilterManager::DropPartition(int32_t spec_id, PartitionValues partition) { + ICEBERG_RETURN_UNEXPECTED(InvalidateFilteredCache()); drop_partitions_.add(spec_id, std::move(partition)); + return {}; } void ManifestFilterManager::FailMissingDeletePaths() { @@ -114,15 +209,32 @@ void ManifestFilterManager::FailAnyDelete() { fail_any_delete_ = true; } bool ManifestFilterManager::ContainsDeletes() const { return HasRowFilterExpression(delete_expr_) || !delete_paths_.empty() || + !data_files_to_delete_.empty() || !delete_files_to_delete_.empty() || !drop_partitions_.empty(); } +Status ManifestFilterManager::DropDeleteFilesOlderThan(int64_t sequence_number) { + ICEBERG_PRECHECK(sequence_number >= 0, "Invalid minimum data sequence number: {}", + sequence_number); + min_sequence_number_ = sequence_number; + return {}; +} + +void ManifestFilterManager::RemoveDanglingDeletesFor(const DataFileSet& deleted_files) { + std::unordered_set removed_data_file_paths; + for (const auto& file : deleted_files) { + if (file != nullptr) { + removed_data_file_paths.insert(file->file_path); + } + } + removed_data_file_paths_ = std::move(removed_data_file_paths); +} + Result ManifestFilterManager::CanContainDroppedFiles(const ManifestFile&) const { - // TODO(Guotao): Use the manifest descriptor to skip unrelated object-delete - // manifests once object-delete partitions are tracked separately. - // Currently, DeleteFile(std::shared_ptr) degrades to a path-based delete, - // which forces scanning all manifests. - return !delete_paths_.empty(); + // TODO(Guotao): prune object deletes by partition once manifest partition + // summary checks are available. + return !delete_paths_.empty() || !data_files_to_delete_.empty() || + !delete_files_to_delete_.empty() || !removed_data_file_paths_.empty(); } Result ManifestFilterManager::CanContainDroppedPartitions( @@ -208,15 +320,42 @@ Result ManifestFilterManager::ShouldDelete(const ManifestEntry& entry, const DataFile& file = *entry.data_file; int32_t spec_id = file.partition_spec_id.value_or(manifest_spec_id); - // Path-based and partition-drop checks - if (delete_paths_.count(file.file_path) || - drop_partitions_.contains(spec_id, file.partition)) { + // All delete branches share fail-any-delete handling. + auto marked_for_delete = [&]() -> Result { if (fail_any_delete_) { ICEBERG_ASSIGN_OR_RAISE(auto partition_path, FormatPartitionPath(specs_by_id, file, spec_id)); - return InvalidArgument("Operation would delete existing data: {}", partition_path); + return ValidationFailed("Operation would delete existing data: {}", partition_path); } return true; + }; + + // Path/object-based and partition-drop checks. + bool object_delete = manifest_content_ == ManifestContent::kData + ? data_files_to_delete_.contains(file) + : delete_files_to_delete_.contains(file); + if (delete_paths_.count(file.file_path) || object_delete || + drop_partitions_.contains(spec_id, file.partition)) { + return marked_for_delete(); + } + + // Delete-manifest-specific cleanup (only for ManifestContent::kDeletes). + if (manifest_content_ == ManifestContent::kDeletes) { + // Drop delete files whose data sequence number is older than the minimum + // retained by the table (they can no longer match any live data rows). + // seq == 0 (kInitialSequenceNumber / nullopt) is intentionally excluded: + // those entries predate sequence number assignment and must not be pruned. + int64_t seq = entry.sequence_number.value_or(0); + if (min_sequence_number_ > 0 && seq > 0 && seq < min_sequence_number_) { + return marked_for_delete(); + } + + // Drop DVs that reference a data file that has been removed (dangling DV). + if (!removed_data_file_paths_.empty() && file.IsDeletionVector() && + file.referenced_data_file.has_value() && + removed_data_file_paths_.count(*file.referenced_data_file)) { + return marked_for_delete(); + } } if (HasRowFilterExpression(delete_expr_)) { @@ -230,13 +369,7 @@ Result ManifestFilterManager::ShouldDelete(const ManifestEntry& entry, StrictMetricsEvaluator::Make(residual_expr, schema, case_sensitive_)); ICEBERG_ASSIGN_OR_RAISE(auto strict_match, strict_eval->Evaluate(file)); if (strict_match) { - if (fail_any_delete_) { - ICEBERG_ASSIGN_OR_RAISE(auto partition_path, - FormatPartitionPath(specs_by_id, file, spec_id)); - return InvalidArgument("Operation would delete existing data: {}", - partition_path); - } - return true; + return marked_for_delete(); } ICEBERG_ASSIGN_OR_RAISE(auto incl_eval, InclusiveMetricsEvaluator::Make( @@ -246,7 +379,7 @@ Result ManifestFilterManager::ShouldDelete(const ManifestEntry& entry, if (manifest_content_ == ManifestContent::kDeletes) { return false; } - return InvalidArgument( + return ValidationFailed( "Cannot delete file where some, but not all, rows match filter: {}", file.file_path); } @@ -257,20 +390,34 @@ Result ManifestFilterManager::ShouldDelete(const ManifestEntry& entry, bool ManifestFilterManager::CanTrustManifestReferences( const std::vector&) const { - // TODO(Guotao): Track source manifest locations for object deletes so manifests - // outside the referenced set can be skipped before any other delete checks. + // TODO(Guotao): add DataFile manifest locations and use them to skip unrelated + // manifests. Until then, take the conservative path. return false; } Result ManifestFilterManager::FilterManifest( const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, const ManifestFile& manifest, bool trust_manifest_references, - const ManifestWriterFactory& writer_factory, - std::unordered_set& found_paths) { + const ManifestWriterFactory& writer_factory) { + auto cached = filtered_manifests_.find(manifest); + if (cached != filtered_manifests_.end()) { + auto deleted_iter = filtered_manifest_to_deleted_files_.find(cached->second); + if (deleted_iter != filtered_manifest_to_deleted_files_.end()) { + for (const auto& file : deleted_iter->second.files) { + AddDeletedFileToManager(manifest_content_, data_files_, delete_files_, + deleted_files_, deleted_data_file_set_, + deleted_delete_file_set_, file); + } + duplicate_deletes_count_ += deleted_iter->second.duplicate_deletes_count; + } + return cached->second; + } + ICEBERG_ASSIGN_OR_RAISE( auto can_contain_deleted_files, CanContainDeletedFiles(manifest, schema, specs_by_id, trust_manifest_references)); if (!can_contain_deleted_files) { + filtered_manifests_.emplace(manifest, manifest); return manifest; } @@ -283,11 +430,16 @@ Result ManifestFilterManager::FilterManifest( ICEBERG_ASSIGN_OR_RAISE(auto has_deleted_files, ManifestHasDeletedFiles(entries, schema, specs_by_id, spec_id)); if (!has_deleted_files) { + filtered_manifests_.emplace(manifest, manifest); return manifest; } - return FilterManifestWithDeletedFiles(entries, spec_id, schema, specs_by_id, - writer_factory, found_paths); + ICEBERG_ASSIGN_OR_RAISE(auto filtered_manifest, + FilterManifestWithDeletedFiles(entries, spec_id, schema, + specs_by_id, writer_factory)); + filtered_manifests_.emplace(manifest, filtered_manifest); + ++replaced_manifests_count_; + return filtered_manifest; } Result ManifestFilterManager::ManifestHasDeletedFiles( @@ -306,21 +458,26 @@ Result ManifestFilterManager::ManifestHasDeletedFiles( Result ManifestFilterManager::FilterManifestWithDeletedFiles( const std::vector& entries, int32_t manifest_spec_id, const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, - const ManifestWriterFactory& writer_factory, - std::unordered_set& found_paths) { + const ManifestWriterFactory& writer_factory) { ICEBERG_ASSIGN_OR_RAISE(auto writer, writer_factory(manifest_spec_id, manifest_content_)); + std::vector> deleted_files; + DataFileSet deleted_data_file_set; + DeleteFileSet deleted_file_set; + int32_t duplicate_deletes_count = 0; for (const auto& entry : entries) { ICEBERG_ASSIGN_OR_RAISE(auto should_delete, ShouldDelete(entry, schema, specs_by_id, manifest_spec_id)); if (should_delete) { - if (entry.data_file && delete_paths_.count(entry.data_file->file_path)) { - found_paths.insert(entry.data_file->file_path); - } if (entry.data_file) { - // TODO(Guotao): Track duplicate deletes and avoid full DataFile copies when - // summary generation can use lighter records. - delete_files_.insert(std::make_shared(*entry.data_file)); + auto file = std::make_shared(*entry.data_file); + AddDeletedFileToManager(manifest_content_, data_files_, delete_files_, + deleted_files_, deleted_data_file_set_, + deleted_delete_file_set_, file); + if (!AddDeletedFileToManifest(manifest_content_, deleted_files, + deleted_data_file_set, deleted_file_set, file)) { + ++duplicate_deletes_count; + } } ICEBERG_RETURN_UNEXPECTED(writer->WriteDeletedEntry(entry)); } else { @@ -329,24 +486,72 @@ Result ManifestFilterManager::FilterManifestWithDeletedFiles( } ICEBERG_RETURN_UNEXPECTED(writer->Close()); - return writer->ToManifestFile(); + ICEBERG_ASSIGN_OR_RAISE(auto filtered_manifest, writer->ToManifestFile()); + duplicate_deletes_count_ += duplicate_deletes_count; + filtered_manifest_to_deleted_files_[filtered_manifest] = FilteredManifestDeletes{ + .files = std::move(deleted_files), + .duplicate_deletes_count = duplicate_deletes_count, + }; + return filtered_manifest; +} + +Status ManifestFilterManager::InvalidateFilteredCache() { + ICEBERG_RETURN_UNEXPECTED(CleanUncommitted({})); + replaced_manifests_count_ = 0; + return {}; +} + +void ManifestFilterManager::ResetDeletedFiles() { + data_files_.clear(); + for (const auto& file : data_files_to_delete_) { + data_files_.insert(file); + } + delete_files_.clear(); + for (const auto& file : delete_files_to_delete_) { + delete_files_.insert(file); + } } -Status ManifestFilterManager::ValidateRequiredDeletes( - const std::unordered_set& found_paths) const { +Status ManifestFilterManager::ValidateRequiredDeletes() const { if (!fail_missing_delete_paths_) { return {}; } - std::string missing; + std::string missing_files; + const auto append_missing = [&missing_files](const std::string& path) { + if (!missing_files.empty()) missing_files += ","; + missing_files += path; + }; + for (const auto& key : data_files_to_delete_) { + if (!deleted_data_file_set_.contains(key)) { + append_missing(key->file_path); + } + } + for (const auto& key : delete_files_to_delete_) { + if (!deleted_delete_file_set_.contains(key)) { + append_missing(key->file_path); + } + } + if (!missing_files.empty()) { + return ValidationFailed("Missing required files to delete: {}", missing_files); + } + + std::string missing_paths; for (const auto& path : delete_paths_) { - if (!found_paths.count(path)) { - if (!missing.empty()) missing += ", "; - missing += path; + bool found = false; + for (const auto& deleted_file : deleted_files_) { + if (deleted_file != nullptr && deleted_file->file_path == path) { + found = true; + break; + } + } + if (!found) { + if (!missing_paths.empty()) missing_paths += ","; + missing_paths += path; } } - if (!missing.empty()) { - return InvalidArgument("Missing delete paths: {}", missing); + if (!missing_paths.empty()) { + return ValidationFailed("Missing required files to delete: {}", missing_paths); } return {}; } @@ -354,8 +559,21 @@ Status ManifestFilterManager::ValidateRequiredDeletes( Result> ManifestFilterManager::FilterManifests( const TableMetadata& metadata, const std::shared_ptr& base_snapshot, const ManifestWriterFactory& writer_factory) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + return FilterManifests(schema, metadata, base_snapshot, writer_factory); +} + +Result> ManifestFilterManager::FilterManifests( + const std::shared_ptr& schema, const TableMetadata& metadata, + const std::shared_ptr& base_snapshot, + const ManifestWriterFactory& writer_factory) { + ResetDeletedFiles(); + deleted_files_.clear(); + deleted_data_file_set_.clear(); + deleted_delete_file_set_.clear(); + duplicate_deletes_count_ = 0; if (!base_snapshot) { - ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes({})); + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes()); return std::vector{}; } @@ -371,7 +589,6 @@ Result> ManifestFilterManager::FilterManifests( manifests.push_back(&manifest); } - ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); TableMetadataCache metadata_cache(&metadata); ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); @@ -394,9 +611,13 @@ Result> ManifestFilterManager::FilterManifests( } } - std::unordered_set found_paths; + ResetDeletedFiles(); + deleted_files_.clear(); + deleted_data_file_set_.clear(); + deleted_delete_file_set_.clear(); + duplicate_deletes_count_ = 0; if (manifests.empty()) { - ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes(found_paths)); + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes()); return std::vector{}; } @@ -409,15 +630,35 @@ Result> ManifestFilterManager::FilterManifests( std::vector filtered; filtered.reserve(manifests.size()); for (const auto* manifest_ptr : manifests) { - ICEBERG_ASSIGN_OR_RAISE( - auto filtered_manifest, - FilterManifest(schema, specs_by_id, *manifest_ptr, trust_manifest_references, - writer_factory, found_paths)); + ICEBERG_ASSIGN_OR_RAISE(auto filtered_manifest, + FilterManifest(schema, specs_by_id, *manifest_ptr, + trust_manifest_references, writer_factory)); filtered.push_back(std::move(filtered_manifest)); } - ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes(found_paths)); + ICEBERG_RETURN_UNEXPECTED(ValidateRequiredDeletes()); return filtered; } +Status ManifestFilterManager::CleanUncommitted( + const std::unordered_set& committed) { + auto entries = std::vector>{ + filtered_manifests_.begin(), filtered_manifests_.end()}; + for (const auto& [manifest, filtered] : entries) { + if (committed.contains(filtered.manifest_path)) { + continue; + } + + if (manifest != filtered) { + std::ignore = delete_file_(filtered.manifest_path); + if (replaced_manifests_count_ > 0) { + --replaced_manifests_count_; + } + } + filtered_manifests_.erase(manifest); + filtered_manifest_to_deleted_files_.erase(filtered); + } + return {}; +} + } // namespace iceberg diff --git a/src/iceberg/manifest/manifest_filter_manager.h b/src/iceberg/manifest/manifest_filter_manager.h index 55258b2b1..e742812cc 100644 --- a/src/iceberg/manifest/manifest_filter_manager.h +++ b/src/iceberg/manifest/manifest_filter_manager.h @@ -24,6 +24,7 @@ /// or EXISTING based on row-filter expressions, exact path deletes, and partition drops. #include +#include #include #include #include @@ -34,6 +35,7 @@ #include "iceberg/manifest/manifest_list.h" #include "iceberg/manifest/manifest_writer.h" #include "iceberg/result.h" +#include "iceberg/snapshot.h" #include "iceberg/type_fwd.h" #include "iceberg/util/data_file_set.h" #include "iceberg/util/partition_value_util.h" @@ -47,9 +49,6 @@ namespace iceberg { /// entries are returned unchanged (no I/O). Manifests that do contain deleted /// entries are rewritten with those entries marked DELETED. /// -/// The manager is content-agnostic: pass ManifestContent::kData to process data -/// manifests, or ManifestContent::kDeletes to process delete manifests. -/// /// TODO(Guotao): For ManifestContent::kDeletes, implement cleanup for orphan delete files /// and dangling deletion vectors. /// @@ -58,7 +57,9 @@ class ICEBERG_EXPORT ManifestFilterManager { public: using PartitionSpecsById = std::unordered_map>; - ManifestFilterManager(ManifestContent content, std::shared_ptr file_io); + static Result> Make( + ManifestContent content, std::shared_ptr file_io, + std::function delete_file = {}); ~ManifestFilterManager(); ManifestFilterManager(const ManifestFilterManager&) = delete; @@ -80,33 +81,43 @@ class ICEBERG_EXPORT ManifestFilterManager { /// Any manifest entry whose file_path matches this path will be marked DELETED. /// /// \param path The exact file path to delete - void DeleteFile(std::string_view path); + Status DeleteFile(std::string_view path); /// \brief Register a file object for deletion. /// /// Any manifest entry whose file_path matches file->file_path will be marked - /// DELETED. The file object is retained in FilesToBeDeleted(), allowing callers - /// to enumerate deleted file objects for follow-up delete-file cleanup. - /// Duplicate registrations (same path) are silently ignored. + /// DELETED. Duplicate registrations (same path) are silently ignored. /// /// \param file The data/delete file to delete (must not be null) Status DeleteFile(std::shared_ptr file); /// \brief Returns the set of file objects marked for deletion by this manager. /// - /// This includes files registered via DeleteFile(DataFile) and files discovered - /// during FilterManifests() that were deleted by path, partition, or row-filter - /// matching. Used by higher-level operations (e.g. RowDelta) to enumerate the - /// deleted data files for delete-file cleanup. + /// Includes file objects explicitly registered for deletion plus files deleted while + /// filtering manifests. const DataFileSet& FilesToBeDeleted() const; + /// \brief Returns content-file objects deleted by the most recent + /// FilterManifests() call, deduplicated by content-file identity. + const std::vector>& DeletedFiles() const; + + /// \brief Returns how many duplicate file deletes were found in the most recent + /// FilterManifests() call. + int32_t DuplicateDeletesCount() const { return duplicate_deletes_count_; } + + /// \brief Build a snapshot-summary fragment from filtered manifests. + /// + Result BuildSummary( + const std::vector& manifests, + const PartitionSpecsById& specs_by_id) const; + /// \brief Register a partition for dropping. /// /// Any manifest entry whose (spec_id, partition) pair matches will be marked DELETED. /// /// \param spec_id The partition spec ID /// \param partition The partition values to drop - void DropPartition(int32_t spec_id, PartitionValues partition); + Status DropPartition(int32_t spec_id, PartitionValues partition); /// \brief Set a flag that makes FilterManifests() fail if any registered /// delete path was not found in any manifest entry. @@ -116,9 +127,36 @@ class ICEBERG_EXPORT ManifestFilterManager { /// manifest entry matches a delete condition. void FailAnyDelete(); + /// \brief Returns the number of manifests rewritten (replaced) by the last + /// FilterManifests() call. A manifest is replaced when it contained deleted entries + /// and was rewritten with those entries marked DELETED. + int32_t ReplacedManifestsCount() const { return replaced_manifests_count_; } + /// \brief Returns true if any delete condition has been registered. bool ContainsDeletes() const; + /// \brief Set the minimum data sequence number for delete files to retain. + /// + /// Only valid for ManifestContent::kDeletes managers. Delete entries whose + /// data_sequence_number is positive and less than sequence_number will be + /// marked DELETED. This continuously removes delete files that cannot match + /// any remaining data rows (i.e. all data written before that sequence number + /// has itself been deleted). + /// + /// \param sequence_number the inclusive lower bound; delete files older than + /// this value are dropped + Status DropDeleteFilesOlderThan(int64_t sequence_number); + + /// \brief Register data files that have been removed so their dangling DVs + /// can be cleaned up. + /// + /// Only valid for ManifestContent::kDeletes managers. For each DV whose + /// referenced_data_file path appears in deleted_files, the DV entry is + /// marked DELETED because the data file it targets no longer exists. + /// + /// \param deleted_files set of data files that have been marked for deletion + void RemoveDanglingDeletesFor(const DataFileSet& deleted_files); + /// \brief Apply all accumulated delete conditions to the base snapshot's manifests. /// /// Manifests that cannot possibly contain deleted files are returned unchanged. @@ -132,6 +170,15 @@ class ICEBERG_EXPORT ManifestFilterManager { const TableMetadata& metadata, const std::shared_ptr& base_snapshot, const ManifestWriterFactory& writer_factory); + /// \brief Apply all accumulated delete conditions using an explicit schema. + /// + /// This overload is used when callers need row-filter evaluation bound against a + /// schema other than metadata.Schema(), such as the schema at a branch head. + Result> FilterManifests( + const std::shared_ptr& schema, const TableMetadata& metadata, + const std::shared_ptr& base_snapshot, + const ManifestWriterFactory& writer_factory); + /// \brief Apply all accumulated delete conditions to the provided manifests. /// /// This overload accepts only the context needed for filtering. It is intended for @@ -147,7 +194,14 @@ class ICEBERG_EXPORT ManifestFilterManager { const std::vector& manifests, const ManifestWriterFactory& writer_factory); + /// \brief Delete cached filtered manifests that were not committed and roll back + /// replaced-manifest accounting. + Status CleanUncommitted(const std::unordered_set& committed); + private: + ManifestFilterManager(ManifestContent content, std::shared_ptr file_io, + std::function delete_file); + /// \brief Returns true if the manifest might contain files matching any expression. Result CanContainExpressionDeletes(const ManifestFile& manifest, const std::shared_ptr& schema, @@ -172,12 +226,16 @@ class ICEBERG_EXPORT ManifestFilterManager { bool CanTrustManifestReferences( const std::vector& manifests) const; + struct FilteredManifestDeletes { + std::vector> files; + int32_t duplicate_deletes_count = 0; + }; + Result FilterManifest(const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, const ManifestFile& manifest, bool trust_manifest_references, - const ManifestWriterFactory& writer_factory, - std::unordered_set& found_paths); + const ManifestWriterFactory& writer_factory); Result ManifestHasDeletedFiles(const std::vector& entries, const std::shared_ptr& schema, @@ -187,11 +245,12 @@ class ICEBERG_EXPORT ManifestFilterManager { Result FilterManifestWithDeletedFiles( const std::vector& entries, int32_t manifest_spec_id, const std::shared_ptr& schema, const PartitionSpecsById& specs_by_id, - const ManifestWriterFactory& writer_factory, - std::unordered_set& found_paths); + const ManifestWriterFactory& writer_factory); + + Status ValidateRequiredDeletes() const; - Status ValidateRequiredDeletes( - const std::unordered_set& found_paths) const; + Status InvalidateFilteredCache(); + void ResetDeletedFiles(); /// \brief Get or create a ManifestEvaluator for the given spec. Result GetManifestEvaluator(const std::shared_ptr& schema, @@ -211,14 +270,39 @@ class ICEBERG_EXPORT ManifestFilterManager { const ManifestContent manifest_content_; std::shared_ptr file_io_; + std::function delete_file_; std::shared_ptr delete_expr_; std::unordered_set delete_paths_; - DataFileSet delete_files_; + // Delete files explicitly registered for deletion by object identity. + DeleteFileSet delete_files_to_delete_; + // Data files explicitly registered for deletion by object identity. + DataFileSet data_files_to_delete_; + // Data files to remove: explicit object deletes plus files found while filtering. + DataFileSet data_files_; + // Delete files to remove: explicit object deletes plus files found while filtering. + DeleteFileSet delete_files_; + std::unordered_map + filtered_manifest_to_deleted_files_; + // Ordered files deleted by the latest filter pass, used for summaries. + std::vector> deleted_files_; + // Data-file identity set for latest-pass dedup and required-delete validation. + DataFileSet deleted_data_file_set_; + // Delete-file identity set for latest-pass dedup and required-delete validation. + DeleteFileSet deleted_delete_file_set_; PartitionSet drop_partitions_; bool fail_missing_delete_paths_{false}; bool fail_any_delete_{false}; bool case_sensitive_{true}; + int32_t duplicate_deletes_count_{0}; + int32_t replaced_manifests_count_{0}; + + // minimum data sequence number; delete entries older than this are dropped + int64_t min_sequence_number_{0}; + // paths of data files that were removed; DVs referencing these are dangling + std::unordered_set removed_data_file_paths_; + + std::unordered_map filtered_manifests_; std::unordered_map> manifest_evaluator_cache_; diff --git a/src/iceberg/manifest/manifest_merge_manager.cc b/src/iceberg/manifest/manifest_merge_manager.cc index 056dce3f5..b2becf920 100644 --- a/src/iceberg/manifest/manifest_merge_manager.cc +++ b/src/iceberg/manifest/manifest_merge_manager.cc @@ -21,12 +21,15 @@ #include #include +#include #include #include #include +#include #include #include +#include "iceberg/file_io.h" #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_reader.h" #include "iceberg/table_metadata.h" @@ -34,27 +37,68 @@ namespace iceberg { -ManifestMergeManager::ManifestMergeManager(int64_t target_size_bytes, - int32_t min_count_to_merge, bool merge_enabled) - : target_size_bytes_(target_size_bytes), +namespace { + +size_t CombineHash(size_t seed, size_t value) { + return seed ^ (value + 0x9e3779b9 + (seed << 6) + (seed >> 2)); +} + +} // namespace + +ManifestMergeManager::ManifestMergeManager( + ManifestContent content, int64_t target_size_bytes, int32_t min_count_to_merge, + bool merge_enabled, std::shared_ptr file_io, + SnapshotIdSupplier snapshot_id_supplier, + std::function delete_file) + : manifest_content_(content), + target_size_bytes_(target_size_bytes), min_count_to_merge_(min_count_to_merge), - merge_enabled_(merge_enabled) {} + merge_enabled_(merge_enabled), + file_io_(std::move(file_io)), + snapshot_id_supplier_(std::move(snapshot_id_supplier)), + delete_file_(std::move(delete_file)) { + ICEBERG_DCHECK(file_io_, "FileIO cannot be null"); + ICEBERG_DCHECK(snapshot_id_supplier_, "Snapshot ID supplier cannot be null"); + if (delete_file_ == nullptr) { + delete_file_ = [this](const std::string& location) { + return file_io_->DeleteFile(location); + }; + } +} + +Result> ManifestMergeManager::Make( + ManifestContent content, int64_t target_size_bytes, int32_t min_count_to_merge, + bool merge_enabled, std::shared_ptr file_io, + SnapshotIdSupplier snapshot_id_supplier, + std::function delete_file) { + ICEBERG_PRECHECK(file_io != nullptr, "FileIO cannot be null"); + ICEBERG_PRECHECK(snapshot_id_supplier != nullptr, + "Snapshot ID supplier cannot be null"); + return std::unique_ptr(new ManifestMergeManager( + content, target_size_bytes, min_count_to_merge, merge_enabled, std::move(file_io), + std::move(snapshot_id_supplier), std::move(delete_file))); +} Result> ManifestMergeManager::MergeManifests( const std::vector& existing_manifests, - const std::vector& new_manifests, int64_t snapshot_id, - const TableMetadata& metadata, std::shared_ptr file_io, + const std::vector& new_manifests, const TableMetadata& metadata, const ManifestWriterFactory& writer_factory) { - // Combine new then existing (new-first ordering is preserved in output). - auto to_manifest_ptr = [](const ManifestFile& manifest) { return &manifest; }; - auto manifest_ranges = std::array{ - new_manifests | std::views::transform(to_manifest_ptr), - existing_manifests | std::views::transform(to_manifest_ptr), + auto append_manifest = [this](const ManifestFile& manifest, + std::vector& manifests) -> Status { + ICEBERG_PRECHECK(manifest.content == manifest_content_, + "Cannot merge manifest with unexpected content"); + manifests.push_back(&manifest); + return {}; }; std::vector all; all.reserve(new_manifests.size() + existing_manifests.size()); - std::ranges::copy(manifest_ranges | std::views::join, std::back_inserter(all)); + for (const auto& manifest : new_manifests) { + ICEBERG_RETURN_UNEXPECTED(append_manifest(manifest, all)); + } + for (const auto& manifest : existing_manifests) { + ICEBERG_RETURN_UNEXPECTED(append_manifest(manifest, all)); + } if (all.empty() || !merge_enabled_) { return all | @@ -62,30 +106,18 @@ Result> ManifestMergeManager::MergeManifests( std::ranges::to>(); } - // Track the first (newest) manifest independently per content type. - std::map first_by_content; - std::ranges::for_each(all, [&first_by_content](const ManifestFile* manifest) { - first_by_content.try_emplace(manifest->content, manifest); - }); - - // Group manifests by (partition_spec_id, content), never merging across specs or - // content types. Reverse spec ordering preserves v3 first-row-id assignment order. - using GroupKey = std::pair; - auto group_key = [](const ManifestFile* manifest) { - return GroupKey{manifest->partition_spec_id, manifest->content}; - }; - - std::map, std::greater<>> by_spec; - std::ranges::for_each(all, [&by_spec, &group_key](const ManifestFile* manifest) { - by_spec[group_key(manifest)].push_back(manifest); + const auto* first = all.front(); + std::map, std::greater<>> by_spec; + std::ranges::for_each(all, [&by_spec](const ManifestFile* manifest) { + by_spec[manifest->partition_spec_id].push_back(manifest); }); std::vector result; result.reserve(all.size()); - for (auto& [key, group] : by_spec) { - const auto* first = first_by_content.at(key.second); - ICEBERG_ASSIGN_OR_RAISE(auto merged, MergeGroup(group, first, snapshot_id, metadata, - file_io, writer_factory)); + for (auto& [spec_id, group] : by_spec) { + std::ignore = spec_id; + ICEBERG_ASSIGN_OR_RAISE(auto merged, + MergeGroup(group, first, metadata, writer_factory)); std::ranges::move(merged, std::back_inserter(result)); } return result; @@ -93,8 +125,7 @@ Result> ManifestMergeManager::MergeManifests( Result> ManifestMergeManager::MergeGroup( const std::vector& group, const ManifestFile* first, - int64_t snapshot_id, const TableMetadata& metadata, std::shared_ptr file_io, - const ManifestWriterFactory& writer_factory) { + const TableMetadata& metadata, const ManifestWriterFactory& writer_factory) { // Match packEnd(group, ManifestFile::length) with lookback 1: // 1. Process manifests in reverse order (oldest-first). // 2. Greedy forward-pack with lookback=1: emit the current bin when the next item @@ -129,18 +160,29 @@ Result> ManifestMergeManager::MergeGroup( // pass its contents through unchanged. std::vector result; result.reserve(group.size()); - // TODO(Guotao): Flush independent bins in parallel and cache successful merged bins - // for commit retries. for (auto& bin : bins) { - bool contains_first = std::ranges::find(bin, first) != bin.end(); - if (contains_first && std::cmp_less(bin.size(), min_count_to_merge_)) { + if (bin.size() == 1) { + result.push_back(*bin[0]); + } else if (bool contains_first = std::ranges::find(bin, first) != bin.end(); + contains_first && std::cmp_less(bin.size(), min_count_to_merge_)) { for (const auto* manifest : bin) { result.push_back(*manifest); } } else { - ICEBERG_ASSIGN_OR_RAISE( - auto merged, FlushBin(bin, snapshot_id, metadata, file_io, writer_factory)); - result.push_back(std::move(merged)); + const auto* cached = merged_manifests_.Find(bin); + if (cached != nullptr) { + result.push_back(*cached); + } else { + const int64_t snapshot_id = snapshot_id_supplier_(); + ICEBERG_ASSIGN_OR_RAISE(auto merged, FlushBin(bin, metadata, writer_factory)); + merged_manifests_.Add(bin, merged); + for (const auto* manifest : bin) { + if (manifest->added_snapshot_id != snapshot_id) { + ++replaced_manifests_count_; + } + } + result.push_back(std::move(merged)); + } } } @@ -148,23 +190,22 @@ Result> ManifestMergeManager::MergeGroup( } Result ManifestMergeManager::FlushBin( - const std::vector& bin, int64_t snapshot_id, - const TableMetadata& metadata, std::shared_ptr file_io, + const std::vector& bin, const TableMetadata& metadata, const ManifestWriterFactory& writer_factory) { - // A single-manifest bin requires no merging. - if (bin.size() == 1) return *bin[0]; - const ManifestFile& first = *bin[0]; int32_t spec_id = first.partition_spec_id; ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_id)); - ICEBERG_ASSIGN_OR_RAISE(auto writer, writer_factory(spec_id, first.content)); + ICEBERG_ASSIGN_OR_RAISE(auto writer, writer_factory(spec_id, manifest_content_)); + const int64_t snapshot_id = snapshot_id_supplier_(); for (const auto* manifest : bin) { - ICEBERG_ASSIGN_OR_RAISE(auto reader, - ManifestReader::Make(*manifest, file_io, schema, spec)); + bool is_committed = manifest->added_snapshot_id != kInvalidSnapshotId && + manifest->added_snapshot_id != snapshot_id; + ICEBERG_ASSIGN_OR_RAISE(auto reader, ManifestReader::Make(*manifest, file_io_, schema, + spec, is_committed)); ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); for (const auto& entry : entries) { bool is_current = @@ -188,4 +229,73 @@ Result ManifestMergeManager::FlushBin( return writer->ToManifestFile(); } +ManifestMergeManager::MergedManifestCache::Key +ManifestMergeManager::MergedManifestCache::MakeKey( + const std::vector& bin) { + Key key; + key.bin.reserve(bin.size()); + for (const auto* manifest : bin) { + key.bin.push_back(*manifest); + } + return key; +} + +const ManifestFile* ManifestMergeManager::MergedManifestCache::Find( + const std::vector& bin) const { + auto iter = entries_.find(MakeKey(bin)); + if (iter == entries_.end()) { + return nullptr; + } + return &iter->second; +} + +void ManifestMergeManager::MergedManifestCache::Add( + const std::vector& bin, const ManifestFile& manifest) { + entries_.emplace(MakeKey(bin), manifest); +} + +size_t ManifestMergeManager::MergedManifestCache::KeyHash::operator()( + const Key& key) const { + size_t hash = 0; + for (const auto& manifest : key.bin) { + hash = CombineHash(hash, std::hash{}(manifest.manifest_path)); + } + return hash; +} + +Result ManifestMergeManager::MergedManifestCache::CleanUncommitted( + const std::unordered_set& committed, int64_t snapshot_id, + const std::function& delete_file) { + int32_t removed_replaced_manifests_count = 0; + auto cached_entries = + std::vector>{entries_.begin(), entries_.end()}; + for (const auto& [bin, merged] : cached_entries) { + if (committed.contains(merged.manifest_path)) { + continue; + } + + std::ignore = delete_file(merged.manifest_path); + for (const auto& manifest : bin.bin) { + if (manifest.added_snapshot_id != snapshot_id) { + ++removed_replaced_manifests_count; + } + } + entries_.erase(bin); + } + return removed_replaced_manifests_count; +} + +Status ManifestMergeManager::CleanUncommitted( + const std::unordered_set& committed) { + if (merged_manifests_.empty()) { + return {}; + } + const int64_t snapshot_id = snapshot_id_supplier_(); + ICEBERG_ASSIGN_OR_RAISE( + auto removed_replaced_manifests_count, + merged_manifests_.CleanUncommitted(committed, snapshot_id, delete_file_)); + replaced_manifests_count_ -= removed_replaced_manifests_count; + return {}; +} + } // namespace iceberg diff --git a/src/iceberg/manifest/manifest_merge_manager.h b/src/iceberg/manifest/manifest_merge_manager.h index 16cc8d987..031c31420 100644 --- a/src/iceberg/manifest/manifest_merge_manager.h +++ b/src/iceberg/manifest/manifest_merge_manager.h @@ -23,7 +23,11 @@ /// Merges small manifests into fewer larger ones according to table properties. #include +#include #include +#include +#include +#include #include #include "iceberg/iceberg_export.h" @@ -45,54 +49,87 @@ namespace iceberg { /// \note This class is non-copyable and non-movable. class ICEBERG_EXPORT ManifestMergeManager { public: + using SnapshotIdSupplier = std::function; + /// \brief Construct a merge manager with the given configuration. /// + /// \param content Manifest content this manager accepts /// \param target_size_bytes Target output manifest size in bytes /// \param min_count_to_merge Minimum number of manifests before any merging occurs /// \param merge_enabled Whether merging is enabled at all - ManifestMergeManager(int64_t target_size_bytes, int32_t min_count_to_merge, - bool merge_enabled); + /// \param file_io File IO used to open manifests for reading + /// \param snapshot_id_supplier Supplies the snapshot id being committed + /// \param delete_file Callback that deletes uncommitted merged manifest files + static Result> Make( + ManifestContent content, int64_t target_size_bytes, int32_t min_count_to_merge, + bool merge_enabled, std::shared_ptr file_io, + SnapshotIdSupplier snapshot_id_supplier, + std::function delete_file = {}); ManifestMergeManager(const ManifestMergeManager&) = delete; ManifestMergeManager& operator=(const ManifestMergeManager&) = delete; /// \brief Merge existing and new manifests according to configured thresholds. /// - /// Manifests are grouped by (partition_spec_id, content) — data and delete manifests - /// are never merged together. Within each group, a greedy bin-packing algorithm - /// combines manifests up to target_size_bytes. The bin that contains the newest - /// manifest for that content type is protected by min_count_to_merge: if it has fewer + /// Manifests are grouped by partition_spec_id. Within each group, a greedy + /// bin-packing algorithm combines manifests up to target_size_bytes. The bin that + /// contains the newest manifest is protected by min_count_to_merge: if it has fewer /// than that many items it is passed through unchanged. /// - /// \note Retry and rollback cleanup are handled by the caller that owns created - /// manifest paths. - /// TODO(Guotao): Add explicit replaced-manifest tracking here if callers need direct - /// access. - /// /// \param existing_manifests Manifests already in the base snapshot /// \param new_manifests Newly written manifests to incorporate - /// \param snapshot_id The ID of the snapshot being committed. Used to preserve - /// ADDED/DELETED status for entries written by this snapshot and to suppress - /// stale DELETED tombstones from prior snapshots. /// \param metadata Table metadata (provides specs and schema for readers) - /// \param file_io File IO used to open existing manifests for reading /// \param writer_factory Factory to create new ManifestWriter instances /// \return The merged manifest list, or an error Result> MergeManifests( const std::vector& existing_manifests, - const std::vector& new_manifests, int64_t snapshot_id, - const TableMetadata& metadata, std::shared_ptr file_io, + const std::vector& new_manifests, const TableMetadata& metadata, const ManifestWriterFactory& writer_factory); + /// \brief Returns the number of manifests replaced by cached merged outputs. + int32_t ReplacedManifestsCount() const { return replaced_manifests_count_; } + + /// \brief Delete cached merged manifests whose paths were not committed and roll + /// back replaced-manifest accounting. + Status CleanUncommitted(const std::unordered_set& committed); + private: + ManifestMergeManager(ManifestContent content, int64_t target_size_bytes, + int32_t min_count_to_merge, bool merge_enabled, + std::shared_ptr file_io, + SnapshotIdSupplier snapshot_id_supplier, + std::function delete_file); + + struct MergedManifestCache { + struct Key { + std::vector bin; + bool operator==(const Key& other) const = default; + }; + + struct KeyHash { + size_t operator()(const Key& key) const; + }; + + const ManifestFile* Find(const std::vector& bin) const; + void Add(const std::vector& bin, const ManifestFile& manifest); + bool empty() const { return entries_.empty(); } + Result CleanUncommitted( + const std::unordered_set& committed, int64_t snapshot_id, + const std::function& delete_file); + + private: + static Key MakeKey(const std::vector& bin); + + std::unordered_map entries_; + }; + /// \brief Merge a group of manifests sharing the same spec_id. /// /// \param first The overall first (newest) manifest across all groups, used to /// apply the min_count_to_merge threshold on the bin that contains it. Result> MergeGroup( const std::vector& group, const ManifestFile* first, - int64_t snapshot_id, const TableMetadata& metadata, std::shared_ptr file_io, - const ManifestWriterFactory& writer_factory); + const TableMetadata& metadata, const ManifestWriterFactory& writer_factory); /// \brief Write a merged manifest from all manifests in a bin. /// @@ -102,13 +139,18 @@ class ICEBERG_EXPORT ManifestMergeManager { /// - DELETED from older snapshots → dropped (stale tombstones are not carried forward) /// - All other entries → WriteExistingEntry Result FlushBin(const std::vector& bin, - int64_t snapshot_id, const TableMetadata& metadata, - std::shared_ptr file_io, + const TableMetadata& metadata, const ManifestWriterFactory& writer_factory); + const ManifestContent manifest_content_; const int64_t target_size_bytes_; const int32_t min_count_to_merge_; const bool merge_enabled_; + std::shared_ptr file_io_; + SnapshotIdSupplier snapshot_id_supplier_; + std::function delete_file_; + int32_t replaced_manifests_count_{0}; + MergedManifestCache merged_manifests_; }; } // namespace iceberg diff --git a/src/iceberg/manifest/manifest_reader.cc b/src/iceberg/manifest/manifest_reader.cc index 7747e2be3..6c166df53 100644 --- a/src/iceberg/manifest/manifest_reader.cc +++ b/src/iceberg/manifest/manifest_reader.cc @@ -432,7 +432,7 @@ Status ParsePartitionValues(ArrowArrayView* view, int64_t row_idx, Status ParseDataFile(const std::shared_ptr& data_file_schema, ArrowArrayView* view, std::optional& first_row_id, - std::vector& manifest_entries) { + bool is_committed, std::vector& manifest_entries) { ICEBERG_RETURN_UNEXPECTED( AssertViewTypeAndChildren(view, ArrowType::NANOARROW_TYPE_STRUCT, data_file_schema->fields().size(), "data_file")); @@ -556,12 +556,14 @@ Status ParseDataFile(const std::shared_ptr& data_file_schema, first_row_id = first_row_id.value() + entry.data_file->record_count; } }); - } else { + } else if (is_committed) { // data file's first_row_id is null when the manifest's first_row_id is null std::ranges::for_each( - manifest_entries, [](auto& first_row_id) { first_row_id = std::nullopt; }, + manifest_entries, [](auto& row_id) { row_id = std::nullopt; }, proj_data_file(&DataFile::first_row_id)); } + // Preserve firstRowId for entries in uncommitted manifests, including EXISTING + // entries that may be merged later break; } case DataFile::kReferencedDataFileFieldId: @@ -589,7 +591,7 @@ Status ParseDataFile(const std::shared_ptr& data_file_schema, Result> ParseManifestEntry( ArrowSchema* arrow_schema, ArrowArray* array, const Schema& schema, - std::optional& first_row_id) { + std::optional& first_row_id, bool is_committed) { ArrowError error; ArrowArrayView view; ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( @@ -642,8 +644,8 @@ Result> ParseManifestEntry( case ManifestEntry::kDataFileFieldId: { auto data_file_schema = internal::checked_pointer_cast(field->get().type()); - ICEBERG_RETURN_UNEXPECTED( - ParseDataFile(data_file_schema, field_view, first_row_id, manifest_entries)); + ICEBERG_RETURN_UNEXPECTED(ParseDataFile( + data_file_schema, field_view, first_row_id, is_committed, manifest_entries)); break; } default: @@ -727,14 +729,15 @@ ManifestReaderImpl::ManifestReaderImpl( std::shared_ptr file_io, std::shared_ptr schema, std::shared_ptr spec, std::unique_ptr inheritable_metadata, - std::optional first_row_id) + std::optional first_row_id, bool is_committed) : manifest_path_(std::move(manifest_path)), manifest_length_(manifest_length), file_io_(std::move(file_io)), schema_(std::move(schema)), spec_(std::move(spec)), inheritable_metadata_(std::move(inheritable_metadata)), - first_row_id_(first_row_id) {} + first_row_id_(first_row_id), + is_committed_(is_committed) {} ManifestReader& ManifestReaderImpl::Select(const std::vector& columns) { columns_ = columns; @@ -907,8 +910,8 @@ Result> ManifestReaderImpl::ReadEntries(bool only_liv internal::ArrowArrayGuard array_guard(&result.value()); ICEBERG_ASSIGN_OR_RAISE( - auto entries, - ParseManifestEntry(&arrow_schema, &result.value(), *file_schema_, first_row_id_)); + auto entries, ParseManifestEntry(&arrow_schema, &result.value(), *file_schema_, + first_row_id_, is_committed_)); for (auto& entry : entries) { ICEBERG_RETURN_UNEXPECTED(inheritable_metadata_->Apply(entry)); @@ -984,7 +987,8 @@ Result ManifestFileFieldFromIndex(int32_t index) { Result> ManifestReader::Make( const ManifestFile& manifest, std::shared_ptr file_io, - std::shared_ptr schema, std::shared_ptr spec) { + std::shared_ptr schema, std::shared_ptr spec, + bool is_committed) { if (file_io == nullptr || schema == nullptr || spec == nullptr) { return InvalidArgument( "FileIO, Schema, and PartitionSpec cannot be null to create ManifestReader"); @@ -996,20 +1000,22 @@ Result> ManifestReader::Make( return std::make_unique( manifest.manifest_path, manifest.manifest_length, std::move(file_io), std::move(schema), std::move(spec), std::move(inheritable_metadata), - manifest.first_row_id); + manifest.first_row_id, is_committed); } Result> ManifestReader::Make( const ManifestFile& manifest, std::shared_ptr file_io, std::shared_ptr schema, - const std::unordered_map>& specs_by_id) { + const std::unordered_map>& specs_by_id, + bool is_committed) { auto spec_it = specs_by_id.find(manifest.partition_spec_id); if (spec_it == specs_by_id.end() || spec_it->second == nullptr) { return InvalidArgument("Partition spec {} not found for manifest {}", manifest.partition_spec_id, manifest.manifest_path); } auto spec = spec_it->second; - return Make(manifest, std::move(file_io), std::move(schema), std::move(spec)); + return Make(manifest, std::move(file_io), std::move(schema), std::move(spec), + is_committed); } Result> ManifestReader::Make( @@ -1017,7 +1023,7 @@ Result> ManifestReader::Make( std::shared_ptr file_io, std::shared_ptr schema, std::shared_ptr spec, std::unique_ptr inheritable_metadata, - std::optional first_row_id) { + std::optional first_row_id, bool is_committed) { ICEBERG_PRECHECK(file_io != nullptr, "FileIO cannot be null to read manifest"); ICEBERG_PRECHECK(schema != nullptr, "Schema cannot be null to read manifest"); ICEBERG_PRECHECK(spec != nullptr, "PartitionSpec cannot be null to read manifest"); @@ -1028,7 +1034,8 @@ Result> ManifestReader::Make( return std::make_unique( std::string(manifest_location), manifest_length, std::move(file_io), - std::move(schema), std::move(spec), std::move(inheritable_metadata), first_row_id); + std::move(schema), std::move(spec), std::move(inheritable_metadata), first_row_id, + is_committed); } Result> ManifestListReader::Make( diff --git a/src/iceberg/manifest/manifest_reader.h b/src/iceberg/manifest/manifest_reader.h index 42c56e1c2..b2d1c6505 100644 --- a/src/iceberg/manifest/manifest_reader.h +++ b/src/iceberg/manifest/manifest_reader.h @@ -87,21 +87,26 @@ class ICEBERG_EXPORT ManifestReader { /// \param file_io File IO implementation to use. /// \param schema Schema used to bind the partition type. /// \param spec Partition spec used for this manifest file. + /// \param is_committed Whether the manifest was committed by an older snapshot. /// \return A Result containing the reader or an error. - static Result> Make( - const ManifestFile& manifest, std::shared_ptr file_io, - std::shared_ptr schema, std::shared_ptr spec); + static Result> Make(const ManifestFile& manifest, + std::shared_ptr file_io, + std::shared_ptr schema, + std::shared_ptr spec, + bool is_committed = true); /// \brief Creates a reader for a manifest file using specs keyed by ID. /// \param manifest A ManifestFile object containing metadata about the manifest. /// \param file_io File IO implementation to use. /// \param schema Schema used to bind the partition type. /// \param specs_by_id Mapping of partition spec ID to PartitionSpec. + /// \param is_committed Whether the manifest was committed by an older snapshot. /// \return A Result containing the reader or an error. static Result> Make( const ManifestFile& manifest, std::shared_ptr file_io, std::shared_ptr schema, - const std::unordered_map>& specs_by_id); + const std::unordered_map>& specs_by_id, + bool is_committed = true); /// \brief Creates a reader for a manifest file. /// \param manifest_location Path to the manifest file. @@ -111,13 +116,14 @@ class ICEBERG_EXPORT ManifestReader { /// \param spec Partition spec used for this manifest file. /// \param inheritable_metadata Inheritable metadata. /// \param first_row_id First row ID to use for the manifest entries. + /// \param is_committed Whether the manifest was committed by an older snapshot. /// \return A Result containing the reader or an error. static Result> Make( std::string_view manifest_location, std::optional manifest_length, std::shared_ptr file_io, std::shared_ptr schema, std::shared_ptr spec, std::unique_ptr inheritable_metadata, - std::optional first_row_id = std::nullopt); + std::optional first_row_id = std::nullopt, bool is_committed = true); /// \brief Add stats columns to the column list if needed. static std::vector WithStatsColumns( diff --git a/src/iceberg/manifest/manifest_reader_internal.h b/src/iceberg/manifest/manifest_reader_internal.h index 2b4b1e0ba..53ce2fcb5 100644 --- a/src/iceberg/manifest/manifest_reader_internal.h +++ b/src/iceberg/manifest/manifest_reader_internal.h @@ -53,12 +53,13 @@ class ManifestReaderImpl : public ManifestReader { /// \param spec Partition spec. /// \param inheritable_metadata Metadata inherited from manifest. /// \param first_row_id First row ID for V3 manifests. + /// \param is_committed Whether the manifest was committed by an older snapshot. /// \note ManifestReader::Make() functions should guarantee non-null parameters. ManifestReaderImpl(std::string manifest_path, std::optional manifest_length, std::shared_ptr file_io, std::shared_ptr schema, std::shared_ptr spec, std::unique_ptr inheritable_metadata, - std::optional first_row_id); + std::optional first_row_id, bool is_committed); Result> Entries() override; @@ -106,6 +107,7 @@ class ManifestReaderImpl : public ManifestReader { const std::shared_ptr spec_; const std::unique_ptr inheritable_metadata_; std::optional first_row_id_; + bool is_committed_; // Configuration fields std::vector columns_; diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index a5a60b605..678f30fbd 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -111,6 +111,7 @@ iceberg_sources = files( 'type.cc', 'update/expire_snapshots.cc', 'update/fast_append.cc', + 'update/merging_snapshot_update.cc', 'update/pending_update.cc', 'update/set_snapshot.cc', 'update/snapshot_manager.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 997d18354..20babf19c 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -214,6 +214,7 @@ if(ICEBERG_BUILD_BUNDLE) expire_snapshots_test.cc fast_append_test.cc manifest_filter_manager_test.cc + merging_snapshot_update_test.cc name_mapping_update_test.cc snapshot_manager_test.cc transaction_test.cc diff --git a/src/iceberg/test/data_file_set_test.cc b/src/iceberg/test/data_file_set_test.cc index 60539adfa..e677b0e2e 100644 --- a/src/iceberg/test/data_file_set_test.cc +++ b/src/iceberg/test/data_file_set_test.cc @@ -38,6 +38,21 @@ class DataFileSetTest : public ::testing::Test { file->content = DataFile::Content::kData; return file; } + + std::shared_ptr CreateDeleteFile(const std::string& path) { + auto file = CreateDataFile(path); + file->content = DataFile::Content::kPositionDeletes; + return file; + } + + std::shared_ptr CreateDV(const std::string& path, int64_t offset, + int64_t size) { + auto file = CreateDeleteFile(path); + file->file_format = FileFormatType::kPuffin; + file->content_offset = offset; + file->content_size_in_bytes = size; + return file; + } }; TEST_F(DataFileSetTest, EmptySet) { @@ -260,12 +275,11 @@ TEST_F(DataFileSetTest, RangeBasedForLoop) { TEST_F(DataFileSetTest, CaseSensitivePaths) { DataFileSet set; auto file1 = CreateDataFile("/path/to/file.parquet"); - auto file2 = CreateDataFile("/path/to/FILE.parquet"); // Different case + auto file2 = CreateDataFile("/path/to/FILE.parquet"); set.insert(file1); set.insert(file2); - // Should be treated as different files EXPECT_EQ(set.size(), 2); } @@ -273,7 +287,6 @@ TEST_F(DataFileSetTest, MultipleInsertsSameFile) { DataFileSet set; auto file = CreateDataFile("/path/to/file.parquet"); - // Insert the same file multiple times set.insert(file); set.insert(file); set.insert(file); @@ -281,4 +294,64 @@ TEST_F(DataFileSetTest, MultipleInsertsSameFile) { EXPECT_EQ(set.size(), 1); } +TEST_F(DataFileSetTest, CopyRebuildsDataFileIndex) { + DataFileSet original; + original.insert(CreateDataFile("/path/to/file1.parquet")); + original.insert(CreateDataFile("/path/to/file2.parquet")); + + DataFileSet copy = original; + auto duplicate = CreateDataFile("/path/to/file1.parquet"); + + auto [iter, inserted] = copy.insert(duplicate); + EXPECT_FALSE(inserted); + ASSERT_NE(iter, copy.end()); + EXPECT_EQ((*iter)->file_path, "/path/to/file1.parquet"); + EXPECT_EQ(copy.size(), 2U); +} + +TEST_F(DataFileSetTest, DeleteFileSetDeduplicatesByPathForRegularDeletes) { + DeleteFileSet set; + auto first = CreateDeleteFile("/path/to/delete.parquet"); + auto duplicate = CreateDeleteFile("/path/to/delete.parquet"); + + auto [first_iter, first_inserted] = set.insert(first); + EXPECT_TRUE(first_inserted); + EXPECT_EQ(*first_iter, first); + + auto [duplicate_iter, duplicate_inserted] = set.insert(duplicate); + EXPECT_FALSE(duplicate_inserted); + EXPECT_EQ(*duplicate_iter, first); + EXPECT_EQ(set.size(), 1U); + EXPECT_TRUE(set.contains(*duplicate)); +} + +TEST_F(DataFileSetTest, DeleteFileSetDistinguishesDeletionVectorContentRanges) { + DeleteFileSet set; + auto first = CreateDV("/path/to/dv.puffin", /*offset=*/0, /*size=*/10); + auto same_range = CreateDV("/path/to/dv.puffin", /*offset=*/0, /*size=*/10); + auto different_offset = CreateDV("/path/to/dv.puffin", /*offset=*/10, /*size=*/10); + auto different_size = CreateDV("/path/to/dv.puffin", /*offset=*/0, /*size=*/20); + + EXPECT_TRUE(set.insert(first).second); + EXPECT_FALSE(set.insert(same_range).second); + EXPECT_TRUE(set.insert(different_offset).second); + EXPECT_TRUE(set.insert(different_size).second); + EXPECT_EQ(set.size(), 3U); +} + +TEST_F(DataFileSetTest, DeleteFileSetCopyRebuildsIndex) { + DeleteFileSet original; + original.insert(CreateDV("/path/to/dv.puffin", /*offset=*/0, /*size=*/10)); + original.insert(CreateDV("/path/to/dv.puffin", /*offset=*/10, /*size=*/10)); + + DeleteFileSet copy = original; + auto duplicate = CreateDV("/path/to/dv.puffin", /*offset=*/0, /*size=*/10); + + auto [iter, inserted] = copy.insert(duplicate); + EXPECT_FALSE(inserted); + ASSERT_NE(iter, copy.end()); + EXPECT_EQ((*iter)->content_offset, 0); + EXPECT_EQ(copy.size(), 2U); +} + } // namespace iceberg diff --git a/src/iceberg/test/fast_append_test.cc b/src/iceberg/test/fast_append_test.cc index 6c77fad16..98956ba7c 100644 --- a/src/iceberg/test/fast_append_test.cc +++ b/src/iceberg/test/fast_append_test.cc @@ -160,6 +160,18 @@ TEST_F(FastAppendTest, AppendNullFile) { EXPECT_THAT(table_->current_snapshot(), HasErrorMessage("No current snapshot")); } +TEST_F(FastAppendTest, FinalizeIgnoresCleanupDeleteFailure) { + std::shared_ptr fast_append; + ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); + fast_append->AppendFile(file_a_); + fast_append->DeleteWith([](const std::string&) { return IOError("delete failed"); }); + + EXPECT_THAT(static_cast(*fast_append).Apply(), IsOk()); + EXPECT_THAT(fast_append->Finalize(Result( + std::unexpected(CommitFailed("commit failed").error()))), + IsOk()); +} + TEST_F(FastAppendTest, AppendDuplicateFile) { std::shared_ptr fast_append; ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); @@ -170,7 +182,6 @@ TEST_F(FastAppendTest, AppendDuplicateFile) { EXPECT_THAT(table_->Refresh(), IsOk()); ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); - // Should only count the file once EXPECT_EQ(snapshot->summary.at("added-data-files"), "1"); EXPECT_EQ(snapshot->summary.at("added-records"), "100"); } diff --git a/src/iceberg/test/manifest_filter_manager_test.cc b/src/iceberg/test/manifest_filter_manager_test.cc index 7810509fa..442bbe063 100644 --- a/src/iceberg/test/manifest_filter_manager_test.cc +++ b/src/iceberg/test/manifest_filter_manager_test.cc @@ -41,6 +41,7 @@ #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" #include "iceberg/update/fast_append.h" +#include "iceberg/util/data_file_set.h" #include "iceberg/util/macros.h" namespace iceberg { @@ -127,29 +128,99 @@ class ManifestFilterManagerTest : public MinimalUpdateTestBase { }; TEST_F(ManifestFilterManagerTest, NullSnapshotReturnsEmpty) { - ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, nullptr, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, nullptr, factory)); EXPECT_TRUE(result.empty()); } +TEST_F(ManifestFilterManagerTest, MakeRejectsNullFileIO) { + EXPECT_THAT(ManifestFilterManager::Make(ManifestContent::kData, nullptr), + IsError(ErrorKind::kInvalidArgument)); +} + TEST_F(ManifestFilterManagerTest, ContainsDeletesReturnsCorrectState) { - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - EXPECT_FALSE(mgr.ContainsDeletes()); - mgr.DeleteFile("/some/path.parquet"); - EXPECT_TRUE(mgr.ContainsDeletes()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_FALSE(mgr->ContainsDeletes()); + ASSERT_THAT(mgr->DeleteFile("/some/path.parquet"), IsOk()); + EXPECT_TRUE(mgr->ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, ContainsDeletesTrueAfterRowFilter) { + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_FALSE(mgr->ContainsDeletes()); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::Equal("x", Literal::Long(1L))), IsOk()); + EXPECT_TRUE(mgr->ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, ContainsDeletesFalseForAlwaysFalseRowFilter) { + // An always-false row filter does not count as a delete condition. + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::AlwaysFalse()), IsOk()); + EXPECT_FALSE(mgr->ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, ContainsDeletesTrueAfterDropPartition) { + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_FALSE(mgr->ContainsDeletes()); + ASSERT_THAT( + mgr->DropPartition(spec_->spec_id(), + PartitionValues(std::vector{Literal::Long(1L)})), + IsOk()); + EXPECT_TRUE(mgr->ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, ContainsDeletesTrueAfterDeleteFileObject) { + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_FALSE(mgr->ContainsDeletes()); + EXPECT_THAT(mgr->DeleteFile(file_a_), IsOk()); + EXPECT_TRUE(mgr->ContainsDeletes()); +} + +TEST_F(ManifestFilterManagerTest, FilesToBeDeletedIncludesRegisteredFileObject) { + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + + EXPECT_THAT(mgr->DeleteFile(file_a_), IsOk()); + + ASSERT_EQ(mgr->FilesToBeDeleted().size(), 1U); + EXPECT_EQ(mgr->FilesToBeDeleted().begin()->get()->file_path, file_a_->file_path); +} + +TEST_F(ManifestFilterManagerTest, FilesToBeDeletedKeepsRegisteredFileObjectAfterFilter) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_b_})); + auto factory = MakeWriterFactory(*table_->metadata()); + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_THAT(mgr->DeleteFile(file_a_), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->FilterManifests(*table_->metadata(), snap, factory)); + EXPECT_THAT(result, ::testing::Not(::testing::IsEmpty())); + + ASSERT_EQ(mgr->FilesToBeDeleted().size(), 1U); + EXPECT_EQ(mgr->FilesToBeDeleted().begin()->get()->file_path, file_a_->file_path); } TEST_F(ManifestFilterManagerTest, DeleteByRowFilterRejectsNull) { - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - EXPECT_THAT(mgr.DeleteByRowFilter(nullptr), IsError(ErrorKind::kInvalidArgument)); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + EXPECT_THAT(mgr->DeleteByRowFilter(nullptr), IsError(ErrorKind::kInvalidArgument)); } TEST_F(ManifestFilterManagerTest, DeleteFileObjectRejectsNull) { - ManifestFilterManager mgr(ManifestContent::kData, file_io_); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); std::shared_ptr null_file; - EXPECT_THAT(mgr.DeleteFile(null_file), IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(mgr->DeleteFile(null_file), IsError(ErrorKind::kInvalidArgument)); } TEST_F(ManifestFilterManagerTest, NoConditionsReturnsManifestsUnchanged) { @@ -162,12 +233,12 @@ TEST_F(ManifestFilterManagerTest, NoConditionsReturnsManifestsUnchanged) { ManifestListReader::Make(snap->manifest_list, file_io_)); ICEBERG_UNWRAP_OR_FAIL(auto orig_manifests, list_reader->Files()); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ASSERT_EQ(result.size(), orig_manifests.size()); for (size_t i = 0; i < result.size(); ++i) { - // No rewrite → same manifest path EXPECT_EQ(result[i].manifest_path, orig_manifests[i].manifest_path); } } @@ -177,10 +248,11 @@ TEST_F(ManifestFilterManagerTest, DeleteFileByPath) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DeleteFile(file_a_->file_path); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); int deleted_count = 0; @@ -198,6 +270,146 @@ TEST_F(ManifestFilterManagerTest, DeleteFileByPath) { EXPECT_EQ(live_count, 1); } +TEST_F(ManifestFilterManagerTest, FilterManifestsCachesFilteredManifestAcrossRetries) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_files, list_reader->Files()); + std::vector manifests; + manifests.reserve(manifest_files.size()); + for (const auto& manifest : manifest_files) { + manifests.push_back(&manifest); + } + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + auto specs = SpecsById(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto first, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(first.size(), 1U); + EXPECT_NE(first[0].manifest_path, manifest_files[0].manifest_path); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 1); + int after_first = manifest_counter_; + + ICEBERG_UNWRAP_OR_FAIL(auto second, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(second.size(), 1U); + EXPECT_EQ(second[0].manifest_path, first[0].manifest_path); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 1); + EXPECT_EQ(manifest_counter_, after_first); +} + +TEST_F(ManifestFilterManagerTest, DeleteFileInvalidatesFilteredCache) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_files, list_reader->Files()); + std::vector manifests; + manifests.reserve(manifest_files.size()); + for (const auto& manifest : manifest_files) { + manifests.push_back(&manifest); + } + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + auto specs = SpecsById(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto first, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(first.size(), 1U); + + ASSERT_THAT(mgr->DeleteFile(file_b_->file_path), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto second, + mgr->FilterManifests(schema, specs, manifests, factory)); + EXPECT_NE(second[0].manifest_path, first[0].manifest_path); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(second, *metadata)); + auto deleted_count = + std::count_if(entries.begin(), entries.end(), [](const ManifestEntry& entry) { + return entry.status == ManifestStatus::kDeleted; + }); + EXPECT_EQ(deleted_count, 2); +} + +TEST_F(ManifestFilterManagerTest, CleanUncommittedDropsFilteredCacheAndRollsBackCount) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_files, list_reader->Files()); + std::vector manifests; + manifests.reserve(manifest_files.size()); + for (const auto& manifest : manifest_files) { + manifests.push_back(&manifest); + } + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + auto specs = SpecsById(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto first, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(first.size(), 1U); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 1); + EXPECT_THAT(mgr->CleanUncommitted({}), IsOk()); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); + + int after_cleanup = manifest_counter_; + ICEBERG_UNWRAP_OR_FAIL(auto second, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(second.size(), 1U); + EXPECT_NE(second[0].manifest_path, first[0].manifest_path); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 1); + EXPECT_GT(manifest_counter_, after_cleanup); +} + +TEST_F(ManifestFilterManagerTest, CleanUncommittedIgnoresDeleteCallbackError) { + ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto list_reader, + ManifestListReader::Make(snap->manifest_list, file_io_)); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_files, list_reader->Files()); + std::vector manifests; + manifests.reserve(manifest_files.size()); + for (const auto& manifest : manifest_files) { + manifests.push_back(&manifest); + } + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make( + ManifestContent::kData, file_io_, + [](const std::string&) { return IOError("delete failed"); })); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + auto specs = SpecsById(*metadata); + + ICEBERG_UNWRAP_OR_FAIL(auto first, + mgr->FilterManifests(schema, specs, manifests, factory)); + ASSERT_EQ(first.size(), 1U); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 1); + + EXPECT_THAT(mgr->CleanUncommitted({}), IsOk()); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); +} + TEST_F(ManifestFilterManagerTest, ExplicitContextFilterManifestsDeletesByPath) { ICEBERG_UNWRAP_OR_FAIL(auto snap, CommitFiles({file_a_, file_b_})); auto* metadata = table_->metadata().get(); @@ -212,11 +424,12 @@ TEST_F(ManifestFilterManagerTest, ExplicitContextFilterManifestsDeletesByPath) { manifests.push_back(&manifest); } - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DeleteFile(file_a_->file_path); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(schema_, SpecsById(*metadata), - manifests, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(schema_, SpecsById(*metadata), + manifests, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); int deleted_count = 0; @@ -235,10 +448,11 @@ TEST_F(ManifestFilterManagerTest, RowFilterAlwaysTrueDeletesAll) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); for (const auto& e : entries) { @@ -251,14 +465,14 @@ TEST_F(ManifestFilterManagerTest, RowFilterAlwaysFalseDeletesNone) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysFalse()), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::AlwaysFalse()), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); for (const auto& e : entries) { - // AlwaysFalse means nothing can match → entries remain ADDED or EXISTING EXPECT_NE(e.status, ManifestStatus::kDeleted) << "Expected no entries to be DELETED"; } } @@ -268,11 +482,12 @@ TEST_F(ManifestFilterManagerTest, RowFilterUsesPartitionResiduals) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.CaseSensitive(false); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("X", Literal::Long(1L))), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + mgr->CaseSensitive(false); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::Equal("X", Literal::Long(1L))), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); int deleted_count = 0; @@ -290,8 +505,8 @@ TEST_F(ManifestFilterManagerTest, RowFilterUsesPartitionResiduals) { EXPECT_EQ(deleted_count, 1); EXPECT_EQ(live_count, 1); - ASSERT_EQ(mgr.FilesToBeDeleted().size(), 1U); - EXPECT_EQ(mgr.FilesToBeDeleted().begin()->get()->file_path, file_a_->file_path); + ASSERT_EQ(mgr->FilesToBeDeleted().size(), 1U); + EXPECT_EQ(mgr->FilesToBeDeleted().begin()->get()->file_path, file_a_->file_path); } TEST_F(ManifestFilterManagerTest, DropPartition) { @@ -300,11 +515,14 @@ TEST_F(ManifestFilterManagerTest, DropPartition) { auto factory = MakeWriterFactory(*metadata); // Drop partition of file_a (partition_x = 1) - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DropPartition(spec_->spec_id(), - PartitionValues(std::vector{Literal::Long(1L)})); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT( + mgr->DropPartition(spec_->spec_id(), + PartitionValues(std::vector{Literal::Long(1L)})), + IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); int deleted_count = 0; @@ -323,12 +541,14 @@ TEST_F(ManifestFilterManagerTest, FailMissingDeletePathsReturnsError) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DeleteFile("/does/not/exist.parquet"); - mgr.FailMissingDeletePaths(); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile("/does/not/exist.parquet"), IsOk()); + mgr->FailMissingDeletePaths(); - auto result = mgr.FilterManifests(*metadata, snap, factory); - EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + auto result = mgr->FilterManifests(*metadata, snap, factory); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Missing required files to delete")); } TEST_F(ManifestFilterManagerTest, FailAnyDeleteReportsPartitionPath) { @@ -336,12 +556,13 @@ TEST_F(ManifestFilterManagerTest, FailAnyDeleteReportsPartitionPath) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DeleteFile(file_a_->file_path); - mgr.FailAnyDelete(); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + mgr->FailAnyDelete(); - auto result = mgr.FilterManifests(*metadata, snap, factory); - EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + auto result = mgr->FilterManifests(*metadata, snap, factory); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); EXPECT_THAT(result, HasErrorMessage("x=1")); } @@ -351,11 +572,12 @@ TEST_F(ManifestFilterManagerTest, MultipleConditionsOrCombined) { auto factory = MakeWriterFactory(*metadata); // Both files should be deleted: file_a by path, file_b by AlwaysTrue expression - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - mgr.DeleteFile(file_a_->file_path); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteFile(file_a_->file_path), IsOk()); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::AlwaysTrue()), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); for (const auto& e : entries) { @@ -368,15 +590,604 @@ TEST_F(ManifestFilterManagerTest, MultipleRowFiltersUseCombinedExpression) { auto* metadata = table_->metadata().get(); auto factory = MakeWriterFactory(*metadata); - ManifestFilterManager mgr(ManifestContent::kData, file_io_); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("y", Literal::Long(7L))), IsOk()); - ASSERT_THAT(mgr.DeleteByRowFilter(Expressions::Equal("x", Literal::Long(1L))), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestFilterManager::Make(ManifestContent::kData, file_io_)); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::Equal("y", Literal::Long(7L))), IsOk()); + ASSERT_THAT(mgr->DeleteByRowFilter(Expressions::Equal("x", Literal::Long(1L))), IsOk()); - ICEBERG_UNWRAP_OR_FAIL(auto result, mgr.FilterManifests(*metadata, snap, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(*metadata, snap, factory)); ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); ASSERT_EQ(entries.size(), 1U); EXPECT_EQ(entries[0].status, ManifestStatus::kDeleted); } +// Helper: write one or more delete-file entries to a new manifest. +// Each entry is (DataFile, data_sequence_number). +using DeleteFileWithSequenceNumber = std::pair, int64_t>; +static Result WriteDeleteManifest( + const std::vector& files, + std::shared_ptr file_io, const TableMetadata& metadata, + const std::string& path) { + if (files.empty()) { + return InvalidArgument("WriteDeleteManifest requires at least one entry"); + } + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + int32_t spec_id = files[0].first->partition_spec_id.value_or(0); + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_id)); + ICEBERG_ASSIGN_OR_RAISE( + auto writer, + ManifestWriter::MakeWriter(metadata.format_version, /*snapshot_id=*/1L, path, + file_io, spec, schema, ManifestContent::kDeletes)); + for (auto& [file, seq] : files) { + ManifestEntry entry; + entry.status = ManifestStatus::kAdded; + entry.snapshot_id = 1L; + entry.sequence_number = seq; + entry.data_file = file; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); +} + +// Convenience overload for a single entry. +static Result WriteDeleteManifest(std::shared_ptr delete_file, + int64_t data_sequence_number, + std::shared_ptr file_io, + const TableMetadata& metadata, + const std::string& path) { + return WriteDeleteManifest({{delete_file, data_sequence_number}}, file_io, metadata, + path); +} + +TEST_F(ManifestFilterManagerTest, DropDeleteFilesOlderThanDoesNotRewriteOnItsOwn) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + // Create a position-delete file with data_sequence_number = 2 (below threshold 5). + auto del_file = std::make_shared(); + del_file->content = DataFile::Content::kPositionDeletes; + del_file->file_path = table_location_ + "/delete/del_old.parquet"; + del_file->file_format = FileFormatType::kParquet; + del_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + del_file->file_size_in_bytes = 512; + del_file->record_count = 10; + del_file->partition_spec_id = spec_->spec_id(); + + auto manifest_path = std::format("{}/metadata/del-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto del_manifest, + WriteDeleteManifest(del_file, /*data_seq=*/2L, file_io_, *metadata, manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DropDeleteFilesOlderThan(5), IsOk()); + + std::vector manifests{&del_manifest}; + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->FilterManifests(schema, specs, manifests, factory)); + + ASSERT_EQ(result.size(), 1U); + EXPECT_EQ(result[0].manifest_path, del_manifest.manifest_path); +} + +TEST_F(ManifestFilterManagerTest, DropDeleteFilesOlderThanRejectsNegativeSequenceNumber) { + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DropDeleteFilesOlderThan(-1), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(ManifestFilterManagerTest, DropDeleteFilesOlderThanDuringDeleteManifestRewrite) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + auto make_del_file = [&](const std::string& path) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 512; + f->record_count = 10; + f->partition_spec_id = spec_->spec_id(); + return f; + }; + auto old_file = make_del_file(table_location_ + "/delete/del_old.parquet"); + auto targeted_file = make_del_file(table_location_ + "/delete/del_targeted.parquet"); + auto keep_file = make_del_file(table_location_ + "/delete/del_keep.parquet"); + + auto manifest_path = std::format("{}/metadata/del-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto del_manifest, + WriteDeleteManifest({{old_file, 2L}, {targeted_file, 10L}, {keep_file, 10L}}, + file_io_, *metadata, manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + ASSERT_THAT(mgr->DeleteFile(targeted_file->file_path), IsOk()); + EXPECT_THAT(mgr->DropDeleteFilesOlderThan(5), IsOk()); + + std::vector manifests{&del_manifest}; + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->FilterManifests(schema, specs, manifests, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + ASSERT_EQ(entries.size(), 3U); + auto deleted = std::count_if( + entries.begin(), entries.end(), + [](const ManifestEntry& e) { return e.status == ManifestStatus::kDeleted; }); + auto existing = std::count_if( + entries.begin(), entries.end(), + [](const ManifestEntry& e) { return e.status == ManifestStatus::kExisting; }); + EXPECT_EQ(deleted, 2); + EXPECT_EQ(existing, 1); + for (const auto& e : entries) { + if (e.status == ManifestStatus::kExisting) { + EXPECT_EQ(e.data_file->file_path, keep_file->file_path); + } else { + EXPECT_THAT(e.data_file->file_path, + ::testing::AnyOf(old_file->file_path, targeted_file->file_path)); + EXPECT_EQ(e.status, ManifestStatus::kDeleted); + } + } +} + +TEST_F(ManifestFilterManagerTest, FailAnyDeleteFailsOnSequenceNumberPruning) { + // An unrelated object delete opens the manifest; sequence-number pruning is the + // branch that marks this entry. + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + auto old_file = std::make_shared(); + old_file->content = DataFile::Content::kPositionDeletes; + old_file->file_path = table_location_ + "/delete/del_old.parquet"; + old_file->file_format = FileFormatType::kParquet; + old_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + old_file->file_size_in_bytes = 512; + old_file->record_count = 10; + old_file->partition_spec_id = spec_->spec_id(); + + auto manifest_path = std::format("{}/metadata/del-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto del_manifest, + WriteDeleteManifest(old_file, /*data_seq=*/2L, file_io_, *metadata, manifest_path)); + + // Unrelated registered delete file: opens the manifest without matching its entry. + auto unrelated = std::make_shared(); + unrelated->content = DataFile::Content::kPositionDeletes; + unrelated->file_path = table_location_ + "/delete/unrelated.parquet"; + unrelated->file_format = FileFormatType::kParquet; + unrelated->partition = PartitionValues(std::vector{Literal::Long(9L)}); + unrelated->file_size_in_bytes = 512; + unrelated->record_count = 10; + unrelated->partition_spec_id = spec_->spec_id(); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DeleteFile(unrelated), IsOk()); + EXPECT_THAT(mgr->DropDeleteFilesOlderThan(5), IsOk()); + mgr->FailAnyDelete(); + + std::vector manifests{&del_manifest}; + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + + auto result = mgr->FilterManifests(schema, specs, manifests, factory); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Operation would delete existing data")); +} + +TEST_F(ManifestFilterManagerTest, FailAnyDeleteFailsOnDanglingDeletionVector) { + // Dangling DVs honor fail-any-delete just like other delete branches. + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + const std::string data_file_path = table_location_ + "/data/referenced.parquet"; + + auto dv_file = std::make_shared(); + dv_file->content = DataFile::Content::kPositionDeletes; + dv_file->file_path = table_location_ + "/delete/dv.puffin"; + dv_file->file_format = FileFormatType::kPuffin; + dv_file->referenced_data_file = data_file_path; + dv_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + dv_file->file_size_in_bytes = 256; + dv_file->record_count = 5; + dv_file->partition_spec_id = spec_->spec_id(); + + auto manifest_path = std::format("{}/metadata/dv-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto dv_manifest, + WriteDeleteManifest(dv_file, /*data_seq=*/3L, file_io_, *metadata, manifest_path)); + + auto deleted_data_file = std::make_shared(); + deleted_data_file->content = DataFile::Content::kData; + deleted_data_file->file_path = data_file_path; + deleted_data_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + deleted_data_file->file_size_in_bytes = 1024; + deleted_data_file->record_count = 50; + deleted_data_file->partition_spec_id = spec_->spec_id(); + + DataFileSet deleted_files; + deleted_files.insert(deleted_data_file); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + mgr->RemoveDanglingDeletesFor(deleted_files); + mgr->FailAnyDelete(); + + std::vector manifests{&dv_manifest}; + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + + auto result = mgr->FilterManifests(schema, specs, manifests, factory); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Operation would delete existing data")); +} + +TEST_F(ManifestFilterManagerTest, RemoveDanglingDeletesForFiltersDanglingDV) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + const std::string data_file_path = table_location_ + "/data/referenced.parquet"; + + // Create a DV (position-delete, puffin format) referencing the data file. + auto dv_file = std::make_shared(); + dv_file->content = DataFile::Content::kPositionDeletes; + dv_file->file_path = table_location_ + "/delete/dv.puffin"; + dv_file->file_format = FileFormatType::kPuffin; + dv_file->referenced_data_file = data_file_path; + dv_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + dv_file->file_size_in_bytes = 256; + dv_file->record_count = 5; + dv_file->partition_spec_id = spec_->spec_id(); + + auto manifest_path = std::format("{}/metadata/dv-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto dv_manifest, + WriteDeleteManifest(dv_file, /*data_seq=*/3L, file_io_, *metadata, manifest_path)); + + // Register the referenced data file as deleted. + auto deleted_data_file = std::make_shared(); + deleted_data_file->content = DataFile::Content::kData; + deleted_data_file->file_path = data_file_path; + deleted_data_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + deleted_data_file->file_size_in_bytes = 1024; + deleted_data_file->record_count = 50; + deleted_data_file->partition_spec_id = spec_->spec_id(); + + DataFileSet deleted_files; + deleted_files.insert(deleted_data_file); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + mgr->RemoveDanglingDeletesFor(deleted_files); + + std::vector manifests{&dv_manifest}; + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->FilterManifests(schema, specs, manifests, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, *metadata)); + ASSERT_EQ(entries.size(), 1U); + EXPECT_EQ(entries[0].status, ManifestStatus::kDeleted); +} + +TEST_F(ManifestFilterManagerTest, RemoveDanglingDeletesForKeepsNonDanglingDeletes) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + const std::string deleted_data_file_path = table_location_ + "/data/deleted.parquet"; + + auto make_delete = [&](std::string path, FileFormatType format, + std::optional referenced_data_file) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = std::move(path); + f->file_format = format; + f->referenced_data_file = std::move(referenced_data_file); + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 256; + f->record_count = 5; + f->partition_spec_id = spec_->spec_id(); + return f; + }; + + auto ordinary_position_delete = + make_delete(table_location_ + "/delete/ordinary.parquet", FileFormatType::kParquet, + deleted_data_file_path); + auto dv_without_reference = make_delete(table_location_ + "/delete/no-ref.puffin", + FileFormatType::kPuffin, std::nullopt); + auto unrelated_dv = + make_delete(table_location_ + "/delete/unrelated.puffin", FileFormatType::kPuffin, + table_location_ + "/data/other.parquet"); + + auto manifest_path = std::format("{}/metadata/dv-keep-manifest-{}.avro", + table_location_, manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL(auto manifest, + WriteDeleteManifest({{ordinary_position_delete, 3L}, + {dv_without_reference, 3L}, + {unrelated_dv, 3L}}, + file_io_, *metadata, manifest_path)); + + auto deleted_data_file = std::make_shared(); + deleted_data_file->content = DataFile::Content::kData; + deleted_data_file->file_path = deleted_data_file_path; + deleted_data_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + deleted_data_file->file_size_in_bytes = 1024; + deleted_data_file->record_count = 50; + deleted_data_file->partition_spec_id = spec_->spec_id(); + + DataFileSet deleted_files; + deleted_files.insert(deleted_data_file); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + mgr->RemoveDanglingDeletesFor(deleted_files); + + std::vector manifests{&manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(schema, SpecsById(*metadata), + manifests, factory)); + + ASSERT_EQ(result.size(), 1U); + EXPECT_EQ(result[0].manifest_path, manifest.manifest_path); +} + +TEST_F(ManifestFilterManagerTest, RemoveDanglingDeletesForReplacesRemovedFileSet) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + auto make_dv = [&](std::string path, std::string referenced_data_file) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = std::move(path); + f->file_format = FileFormatType::kPuffin; + f->referenced_data_file = std::move(referenced_data_file); + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 256; + f->record_count = 5; + f->partition_spec_id = spec_->spec_id(); + return f; + }; + + const std::string first_data = table_location_ + "/data/first.parquet"; + const std::string second_data = table_location_ + "/data/second.parquet"; + auto first_dv = make_dv(table_location_ + "/delete/first.puffin", first_data); + auto second_dv = make_dv(table_location_ + "/delete/second.puffin", second_data); + + auto first_manifest_path = + std::format("{}/metadata/dv-first-{}.avro", table_location_, manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto first_manifest, + WriteDeleteManifest(first_dv, 3L, file_io_, *metadata, first_manifest_path)); + auto second_manifest_path = + std::format("{}/metadata/dv-second-{}.avro", table_location_, manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto second_manifest, + WriteDeleteManifest(second_dv, 3L, file_io_, *metadata, second_manifest_path)); + + auto make_deleted_data = [&](std::string path) { + auto file = std::make_shared(); + file->content = DataFile::Content::kData; + file->file_path = std::move(path); + file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + file->file_size_in_bytes = 1024; + file->record_count = 50; + file->partition_spec_id = spec_->spec_id(); + return file; + }; + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + DataFileSet first_deleted; + first_deleted.insert(make_deleted_data(first_data)); + mgr->RemoveDanglingDeletesFor(first_deleted); + + DataFileSet second_deleted; + second_deleted.insert(make_deleted_data(second_data)); + mgr->RemoveDanglingDeletesFor(second_deleted); + + std::vector manifests{&first_manifest, &second_manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + ICEBERG_UNWRAP_OR_FAIL( + auto second_result, + mgr->FilterManifests(schema, SpecsById(*metadata), manifests, factory)); + ASSERT_EQ(second_result.size(), 2U); + EXPECT_EQ(second_result[0].manifest_path, first_manifest.manifest_path); + EXPECT_NE(second_result[1].manifest_path, second_manifest.manifest_path); + ICEBERG_UNWRAP_OR_FAIL(auto second_entries, ReadAllEntries(second_result, *metadata)); + + bool saw_first_live = false; + bool saw_second_deleted = false; + for (const auto& entry : second_entries) { + ASSERT_NE(entry.data_file, nullptr); + if (entry.data_file->file_path == first_dv->file_path) { + saw_first_live = true; + EXPECT_NE(entry.status, ManifestStatus::kDeleted); + } else if (entry.data_file->file_path == second_dv->file_path) { + saw_second_deleted = true; + EXPECT_EQ(entry.status, ManifestStatus::kDeleted); + } + } + EXPECT_TRUE(saw_first_live); + EXPECT_TRUE(saw_second_deleted); +} + +TEST_F(ManifestFilterManagerTest, DeleteFileObjectMatchesDeletionVectorByContent) { + auto metadata = *table_->metadata(); + metadata.format_version = 3; + auto factory = MakeWriterFactory(metadata); + + auto make_dv = [&](int64_t offset) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = table_location_ + "/delete/dv.puffin"; + f->file_format = FileFormatType::kPuffin; + f->referenced_data_file = + std::format("{}/data/referenced-{}.parquet", table_location_, offset); + f->content_offset = offset; + f->content_size_in_bytes = 10; + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 256; + f->record_count = 5; + f->partition_spec_id = spec_->spec_id(); + return f; + }; + auto dv0 = make_dv(0); + auto dv1 = make_dv(10); + + auto manifest_path = std::format("{}/metadata/dv-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteDeleteManifest({{dv0, 3L}, {dv1, 3L}}, file_io_, metadata, manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DeleteFile(dv0), IsOk()); + + std::vector manifests{&manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata.Schema()); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->FilterManifests(schema, SpecsById(metadata), manifests, factory)); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(result, metadata)); + ASSERT_EQ(entries.size(), 2U); + for (const auto& entry : entries) { + ASSERT_NE(entry.data_file, nullptr); + if (entry.data_file->content_offset == 0) { + EXPECT_EQ(entry.status, ManifestStatus::kDeleted); + } else { + EXPECT_EQ(entry.status, ManifestStatus::kExisting); + } + } +} + +TEST_F(ManifestFilterManagerTest, FailMissingDeleteFileObjectUsesDeleteFileIdentity) { + auto metadata = *table_->metadata(); + metadata.format_version = 3; + auto factory = MakeWriterFactory(metadata); + + auto make_dv = [&](int64_t offset) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = table_location_ + "/delete/dv.puffin"; + f->file_format = FileFormatType::kPuffin; + f->referenced_data_file = + std::format("{}/data/referenced-{}.parquet", table_location_, offset); + f->content_offset = offset; + f->content_size_in_bytes = 10; + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 256; + f->record_count = 5; + f->partition_spec_id = spec_->spec_id(); + return f; + }; + auto present_dv = make_dv(0); + auto missing_dv = make_dv(10); + + auto manifest_path = std::format("{}/metadata/dv-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteDeleteManifest(present_dv, 3L, file_io_, + metadata, manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DeleteFile(missing_dv), IsOk()); + mgr->FailMissingDeletePaths(); + + std::vector manifests{&manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata.Schema()); + EXPECT_THAT(mgr->FilterManifests(schema, SpecsById(metadata), manifests, factory), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(ManifestFilterManagerTest, DuplicateDeletesCountRepeatedDeletedFiles) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + auto del_file = std::make_shared(); + del_file->content = DataFile::Content::kPositionDeletes; + del_file->file_path = table_location_ + "/delete/duplicate.parquet"; + del_file->file_format = FileFormatType::kParquet; + del_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + del_file->file_size_in_bytes = 512; + del_file->record_count = 10; + del_file->partition_spec_id = spec_->spec_id(); + + auto manifest_path = std::format("{}/metadata/dup-manifest-{}.avro", table_location_, + manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL(auto manifest, + WriteDeleteManifest({{del_file, 3L}, {del_file, 3L}}, file_io_, + *metadata, manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DeleteFile(del_file), IsOk()); + + std::vector manifests{&manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->FilterManifests(schema, SpecsById(*metadata), + manifests, factory)); + + EXPECT_EQ(mgr->DeletedFiles().size(), 1U); + EXPECT_EQ(mgr->DuplicateDeletesCount(), 1); +} + +TEST_F(ManifestFilterManagerTest, DuplicateDeletesCountDoesNotCrossManifestBoundary) { + auto* metadata = table_->metadata().get(); + auto factory = MakeWriterFactory(*metadata); + + auto del_file = std::make_shared(); + del_file->content = DataFile::Content::kPositionDeletes; + del_file->file_path = table_location_ + "/delete/reused.parquet"; + del_file->file_format = FileFormatType::kParquet; + del_file->partition = PartitionValues(std::vector{Literal::Long(1L)}); + del_file->file_size_in_bytes = 512; + del_file->record_count = 10; + del_file->partition_spec_id = spec_->spec_id(); + + auto first_manifest_path = + std::format("{}/metadata/reused-a-{}.avro", table_location_, manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto first_manifest, + WriteDeleteManifest(del_file, 3L, file_io_, *metadata, first_manifest_path)); + auto second_manifest_path = + std::format("{}/metadata/reused-b-{}.avro", table_location_, manifest_counter_++); + ICEBERG_UNWRAP_OR_FAIL( + auto second_manifest, + WriteDeleteManifest(del_file, 3L, file_io_, *metadata, second_manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestFilterManager::Make(ManifestContent::kDeletes, file_io_)); + EXPECT_THAT(mgr->DeleteFile(del_file), IsOk()); + + std::vector manifests{&first_manifest, &second_manifest}; + ICEBERG_UNWRAP_OR_FAIL(auto schema, metadata->Schema()); + auto specs = SpecsById(*metadata); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->FilterManifests(schema, specs, manifests, factory)); + ICEBERG_UNWRAP_OR_FAIL(auto summary, mgr->BuildSummary(result, specs)); + + EXPECT_EQ(mgr->DeletedFiles().size(), 1U); + EXPECT_EQ(mgr->DuplicateDeletesCount(), 0); + auto summary_map = summary.Build(); + EXPECT_EQ(summary_map.at(SnapshotSummaryFields::kRemovedDeleteFiles), "2"); + EXPECT_EQ(summary_map.count(SnapshotSummaryFields::kDeletedDuplicatedFiles), 0U); +} + } // namespace iceberg diff --git a/src/iceberg/test/manifest_merge_manager_test.cc b/src/iceberg/test/manifest_merge_manager_test.cc index b19eace86..18d24db29 100644 --- a/src/iceberg/test/manifest_merge_manager_test.cc +++ b/src/iceberg/test/manifest_merge_manager_test.cc @@ -20,6 +20,7 @@ #include "iceberg/manifest/manifest_merge_manager.h" #include +#include #include #include #include @@ -51,6 +52,7 @@ namespace iceberg { namespace { constexpr int8_t kFormatVersion = 2; +constexpr int8_t kRowIdFormatVersion = 3; constexpr int64_t kSnapshotId = 12345L; constexpr int32_t kSpecId0 = 0; constexpr int32_t kSpecId1 = 1; @@ -85,6 +87,17 @@ class ManifestMergeManagerTest : public ::testing::Test { metadata_ = std::shared_ptr(std::move(metadata)); } + Result> BuildV3Metadata() { + auto builder = TableMetadataBuilder::BuildFromEmpty(kRowIdFormatVersion); + builder->SetCurrentSchema(schema_, schema_->HighestFieldId().value_or(0)); + builder->SetDefaultPartitionSpec(spec0_); + builder->AddPartitionSpec(spec1_); + builder->SetDefaultSortOrder(SortOrder::Unsorted()); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, builder->Build()); + metadata->next_row_id = 1000; + return std::shared_ptr(std::move(metadata)); + } + // Write a small manifest with N data files and return the ManifestFile descriptor. Result WriteManifest(int32_t spec_id, int num_files, int64_t file_size_override = 512, @@ -116,14 +129,61 @@ class ManifestMergeManagerTest : public ::testing::Test { return manifest_file; } - ManifestWriterFactory MakeWriterFactory() { - return [this](int32_t spec_id, - ManifestContent content) -> Result> { + Result WriteDataManifestWithFileRowIds( + std::optional manifest_first_row_id, + std::optional entry_first_row_id, int64_t snapshot_id, + int64_t file_size_override = 512) { + auto path = std::format("manifest-{}.avro", manifest_counter_++); + ICEBERG_ASSIGN_OR_RAISE(auto writer, + ManifestWriter::MakeWriter( + kRowIdFormatVersion, snapshot_id, path, file_io_, spec0_, + schema_, ManifestContent::kData, entry_first_row_id)); + auto f = std::make_shared(); + f->content = DataFile::Content::kData; + f->file_path = std::format("data/row-id-file-{}.parquet", manifest_counter_); + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(0)}); + f->file_size_in_bytes = 1024; + f->record_count = 10; + f->partition_spec_id = kSpecId0; + f->first_row_id = entry_first_row_id; + ICEBERG_RETURN_UNEXPECTED( + writer->WriteExistingEntry(ManifestEntry{.status = ManifestStatus::kExisting, + .snapshot_id = snapshot_id, + .sequence_number = kSnapshotId, + .file_sequence_number = kSnapshotId, + .data_file = std::move(f)})); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + ICEBERG_ASSIGN_OR_RAISE(auto manifest_file, writer->ToManifestFile()); + manifest_file.manifest_length = file_size_override; + manifest_file.first_row_id = manifest_first_row_id; + manifest_file.added_snapshot_id = snapshot_id; + return manifest_file; + } + + ManifestWriterFactory MakeWriterFactory() { return MakeWriterFactory(kFormatVersion); } + + Result> MakeMergeManager( + int64_t target_size_bytes, int32_t min_count_to_merge, bool merge_enabled, + ManifestContent content = ManifestContent::kData) { + return ManifestMergeManager::Make( + content, target_size_bytes, min_count_to_merge, merge_enabled, file_io_, + [] { return kSnapshotId; }, + [this](const std::string& location) { return file_io_->DeleteFile(location); }); + } + + ManifestWriterFactory MakeWriterFactory(int8_t format_version) { + return [this, format_version]( + int32_t spec_id, + ManifestContent content) -> Result> { ++factory_call_count_; auto spec = spec_id == kSpecId0 ? spec0_ : spec1_; auto path = std::format("merged-{}.avro", manifest_counter_++); - return ManifestWriter::MakeWriter(kFormatVersion, kSnapshotId, path, file_io_, spec, - schema_, content); + return ManifestWriter::MakeWriter( + format_version, kSnapshotId, path, file_io_, spec, schema_, content, + content == ManifestContent::kData && format_version >= 3 + ? std::make_optional(1000) + : std::nullopt); }; } @@ -140,6 +200,12 @@ class ManifestMergeManagerTest : public ::testing::Test { return total; } + Result> ReadEntries(const ManifestFile& manifest) { + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, file_io_, schema_, spec0_)); + return reader->Entries(); + } + std::shared_ptr file_io_; std::shared_ptr schema_; std::shared_ptr spec0_; @@ -154,160 +220,276 @@ TEST_F(ManifestMergeManagerTest, MergeDisabled) { ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1)); ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1)); - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/false); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/false)); ICEBERG_UNWRAP_OR_FAIL( - auto result, mgr.MergeManifests({m0, m1}, {m2}, kSnapshotId, *metadata_, file_io_, - MakeWriterFactory())); - // merge disabled → all 3 manifests returned, factory never called + auto result, mgr->MergeManifests({m0, m1}, {m2}, *metadata_, MakeWriterFactory())); EXPECT_EQ(result.size(), 3U); EXPECT_EQ(factory_call_count_, 0); } +TEST_F(ManifestMergeManagerTest, MakeRejectsNullParameters) { + EXPECT_THAT( + ManifestMergeManager::Make(ManifestContent::kData, /*target=*/1024, /*min_count=*/2, + /*enabled=*/true, nullptr, [] { return kSnapshotId; }), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + ManifestMergeManager::Make(ManifestContent::kData, /*target=*/1024, /*min_count=*/2, + /*enabled=*/true, file_io_, {}), + IsError(ErrorKind::kInvalidArgument)); +} + TEST_F(ManifestMergeManagerTest, BelowMinCountThreshold) { ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1)); ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1)); - // min_count=3, only 2 manifests total → no merge - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL(auto result, - mgr.MergeManifests({m0}, {m1}, kSnapshotId, *metadata_, file_io_, - MakeWriterFactory())); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/3, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->MergeManifests({m0}, {m1}, *metadata_, MakeWriterFactory())); EXPECT_EQ(result.size(), 2U); EXPECT_EQ(factory_call_count_, 0); } TEST_F(ManifestMergeManagerTest, MergeOccursAtThreshold) { - // 3 small manifests (each 100 bytes), target=1024 → all fit in one bin ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1, /*size=*/100)); - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/3, + /*enabled=*/true)); ICEBERG_UNWRAP_OR_FAIL( - auto result, mgr.MergeManifests({m0, m1}, {m2}, kSnapshotId, *metadata_, file_io_, - MakeWriterFactory())); - // All 3 merged into 1 manifest (total 3 entries) + auto result, mgr->MergeManifests({m0, m1}, {m2}, *metadata_, MakeWriterFactory())); EXPECT_EQ(result.size(), 1U); ICEBERG_UNWRAP_OR_FAIL(auto count1, CountEntries(result)); EXPECT_EQ(count1, 3); } +TEST_F(ManifestMergeManagerTest, ReplacedManifestCountTracksPreviousSnapshotInputs) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + + EXPECT_EQ(result.size(), 1U); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); +} + +TEST_F(ManifestMergeManagerTest, MergeManifestsCachesMergedBinAcrossRetries) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto first, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(first.size(), 1U); + EXPECT_EQ(factory_call_count_, 1); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); + + ICEBERG_UNWRAP_OR_FAIL( + auto second, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(second.size(), 1U); + EXPECT_EQ(second[0].manifest_path, first[0].manifest_path); + EXPECT_EQ(factory_call_count_, 1); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); +} + +TEST_F(ManifestMergeManagerTest, CleanUncommittedDropsMergeCacheAndRollsBackCount) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto first, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(first.size(), 1U); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); + + EXPECT_THAT(mgr->CleanUncommitted({}), IsOk()); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); + + ICEBERG_UNWRAP_OR_FAIL( + auto second, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(second.size(), 1U); + EXPECT_NE(second[0].manifest_path, first[0].manifest_path); + EXPECT_EQ(factory_call_count_, 2); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); +} + +TEST_F(ManifestMergeManagerTest, CleanUncommittedDeletesMergedManifestWithCallback) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + std::vector deleted_paths; + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + ManifestMergeManager::Make( + ManifestContent::kData, /*target=*/1024, /*min_count=*/2, + /*enabled=*/true, file_io_, [] { return kSnapshotId; }, + [&deleted_paths](const std::string& path) { + deleted_paths.push_back(path); + return Status{}; + })); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(result.size(), 1U); + + EXPECT_THAT(mgr->CleanUncommitted({}), IsOk()); + + EXPECT_THAT(deleted_paths, ::testing::ElementsAre(result[0].manifest_path)); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); +} + +TEST_F(ManifestMergeManagerTest, CleanUncommittedIgnoresDeleteCallbackError) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + ICEBERG_UNWRAP_OR_FAIL( + auto mgr, ManifestMergeManager::Make( + ManifestContent::kData, /*target=*/1024, /*min_count=*/2, + /*enabled=*/true, file_io_, [] { return kSnapshotId; }, + [](const std::string&) { return IOError("delete failed"); })); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(result.size(), 1U); + + EXPECT_THAT(mgr->CleanUncommitted({}), IsOk()); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); +} + +TEST_F(ManifestMergeManagerTest, CleanUncommittedKeepsCommittedMergeCache) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + m0.added_snapshot_id = kSnapshotId - 1; + m1.added_snapshot_id = kSnapshotId - 2; + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto first, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(first.size(), 1U); + + EXPECT_THAT(mgr->CleanUncommitted({first[0].manifest_path}), IsOk()); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 2); + + ICEBERG_UNWRAP_OR_FAIL( + auto second, mgr->MergeManifests({m0, m1}, {}, *metadata_, MakeWriterFactory())); + ASSERT_EQ(second.size(), 1U); + EXPECT_EQ(second[0].manifest_path, first[0].manifest_path); + EXPECT_EQ(factory_call_count_, 1); +} + +TEST_F(ManifestMergeManagerTest, ReplacedManifestCountIgnoresCurrentSnapshotInputs) { + ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL( + auto result, mgr->MergeManifests({}, {m0, m1}, *metadata_, MakeWriterFactory())); + + EXPECT_EQ(result.size(), 1U); + EXPECT_EQ(mgr->ReplacedManifestsCount(), 0); +} + +TEST_F(ManifestMergeManagerTest, + MergePreservesCurrentSnapshotFileFirstRowIdsWhenManifestFirstRowIdIsNull) { + constexpr int64_t kEntryFirstRowId = 1234; + ICEBERG_UNWRAP_OR_FAIL(auto current, WriteDataManifestWithFileRowIds( + /*manifest_first_row_id=*/std::nullopt, + kEntryFirstRowId, kSnapshotId)); + ICEBERG_UNWRAP_OR_FAIL(auto previous, WriteManifest(kSpecId0, 1, /*size=*/512)); + previous.added_snapshot_id = 7; + + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL(auto v3_metadata, BuildV3Metadata()); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->MergeManifests({previous}, {current}, *v3_metadata, + MakeWriterFactory(kRowIdFormatVersion))); + ASSERT_EQ(result.size(), 1U); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadEntries(result[0])); + auto current_entry = std::ranges::find_if(entries, [](const ManifestEntry& entry) { + return entry.data_file != nullptr && + entry.data_file->file_path.find("row-id-file") != std::string::npos; + }); + ASSERT_NE(current_entry, entries.end()); + ASSERT_TRUE(current_entry->data_file->first_row_id.has_value()); + EXPECT_EQ(*current_entry->data_file->first_row_id, kEntryFirstRowId); +} + TEST_F(ManifestMergeManagerTest, OversizedManifestPassedThrough) { - // m_large exceeds target → must not be merged; m_small fits ICEBERG_UNWRAP_OR_FAIL(auto m_large, WriteManifest(kSpecId0, 2, /*size=*/2000)); ICEBERG_UNWRAP_OR_FAIL(auto m_small, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m_small2, WriteManifest(kSpecId0, 1, /*size=*/100)); - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); ICEBERG_UNWRAP_OR_FAIL(auto result, - mgr.MergeManifests({m_large, m_small}, {m_small2}, kSnapshotId, - *metadata_, file_io_, MakeWriterFactory())); - // m_large is oversized and acts as a bin boundary — the two small manifests on either - // side of it are never merged together. m_small2 (the newest) is also protected by - // minCountToMerge (size 1 < 2). All three remain separate. + mgr->MergeManifests({m_large, m_small}, {m_small2}, *metadata_, + MakeWriterFactory())); EXPECT_EQ(result.size(), 3U); ICEBERG_UNWRAP_OR_FAIL(auto count2, CountEntries(result)); - EXPECT_EQ(count2, 4); // 2 + 1 + 1 + EXPECT_EQ(count2, 4); } TEST_F(ManifestMergeManagerTest, CrossSpecManifestsNotMerged) { - // Manifests with different spec IDs must never be merged together ICEBERG_UNWRAP_OR_FAIL(auto m_spec0a, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m_spec0b, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m_spec1a, WriteManifest(kSpecId1, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m_spec1b, WriteManifest(kSpecId1, 1, /*size=*/100)); - // With 4 manifests (target large enough for each pair), we get 2 merged outputs - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL( - auto result, - mgr.MergeManifests({m_spec0a, m_spec1a}, {m_spec0b, m_spec1b}, kSnapshotId, - *metadata_, file_io_, MakeWriterFactory())); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL(auto result, + mgr->MergeManifests({m_spec0a, m_spec1a}, {m_spec0b, m_spec1b}, + *metadata_, MakeWriterFactory())); EXPECT_EQ(result.size(), 2U); - // Verify spec IDs are preserved per output manifest for (const auto& m : result) { EXPECT_THAT(m.partition_spec_id, ::testing::AnyOf(kSpecId0, kSpecId1)); } } TEST_F(ManifestMergeManagerTest, WriterFactoryCalledOncePerMergedManifest) { - // 4 small manifests in two groups → 2 merged outputs → factory called twice ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId1, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m3, WriteManifest(kSpecId1, 1, /*size=*/100)); - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL(auto result, - mgr.MergeManifests({m0, m2}, {m1, m3}, kSnapshotId, *metadata_, - file_io_, MakeWriterFactory())); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true)); + ICEBERG_UNWRAP_OR_FAIL(auto result, mgr->MergeManifests({m0, m2}, {m1, m3}, *metadata_, + MakeWriterFactory())); EXPECT_EQ(result.size(), 2U); EXPECT_EQ(factory_call_count_, 2); } -TEST_F(ManifestMergeManagerTest, MixedContentManifestsNotMerged) { - // Data and delete manifests sharing the same spec_id must never be merged together. - // The grouping key is (spec_id, content), so they land in separate bins. - ICEBERG_UNWRAP_OR_FAIL( - auto d0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); - ICEBERG_UNWRAP_OR_FAIL( - auto d1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); - ICEBERG_UNWRAP_OR_FAIL( - auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); - ICEBERG_UNWRAP_OR_FAIL( - auto del1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); - - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/2, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL( - auto result, mgr.MergeManifests({d0, del0}, {d1, del1}, kSnapshotId, *metadata_, - file_io_, MakeWriterFactory())); - // 2 data → 1 merged data manifest; 2 delete → 1 merged delete manifest - EXPECT_EQ(result.size(), 2U); - int data_count = 0; - int delete_count = 0; - for (const auto& m : result) { - if (m.content == ManifestContent::kData) ++data_count; - if (m.content == ManifestContent::kDeletes) ++delete_count; - } - EXPECT_EQ(data_count, 1); - EXPECT_EQ(delete_count, 1); -} - -TEST_F(ManifestMergeManagerTest, MixedContentUsesFirstManifestPerContent) { +TEST_F(ManifestMergeManagerTest, UnexpectedContentRejected) { ICEBERG_UNWRAP_OR_FAIL( auto d0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); - ICEBERG_UNWRAP_OR_FAIL( - auto d1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kData)); - ICEBERG_UNWRAP_OR_FAIL( - auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); - ICEBERG_UNWRAP_OR_FAIL( - auto del1, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); - // Each content type's newest manifest must be protected by the threshold - // independently. - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL( - auto result, mgr.MergeManifests({d0, del0}, {d1, del1}, kSnapshotId, *metadata_, - file_io_, MakeWriterFactory())); - - // Each content type has exactly two manifests, below min_count=3, so neither pair - // should be merged. - ASSERT_EQ(result.size(), 4U); - int data_count = 0; - int delete_count = 0; - for (const auto& manifest : result) { - if (manifest.content == ManifestContent::kData) { - ++data_count; - } else if (manifest.content == ManifestContent::kDeletes) { - ++delete_count; - } - } - EXPECT_EQ(data_count, 2); - EXPECT_EQ(delete_count, 2); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + MakeMergeManager(/*target=*/1024, /*min_count=*/2, + /*enabled=*/true, ManifestContent::kDeletes)); + EXPECT_THAT(mgr->MergeManifests({}, {d0}, *metadata_, MakeWriterFactory()), + IsError(ErrorKind::kInvalidArgument)); } TEST_F(ManifestMergeManagerTest, DeleteManifestsMerged) { - // Delete manifests are bin-packed and merged just like data manifests. ICEBERG_UNWRAP_OR_FAIL( auto del0, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); ICEBERG_UNWRAP_OR_FAIL( @@ -315,10 +497,12 @@ TEST_F(ManifestMergeManagerTest, DeleteManifestsMerged) { ICEBERG_UNWRAP_OR_FAIL( auto del2, WriteManifest(kSpecId0, 1, /*size=*/100, ManifestContent::kDeletes)); - ManifestMergeManager mgr(/*target=*/1024, /*min_count=*/3, /*enabled=*/true); - ICEBERG_UNWRAP_OR_FAIL(auto result, - mgr.MergeManifests({del0, del1}, {del2}, kSnapshotId, *metadata_, - file_io_, MakeWriterFactory())); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, + MakeMergeManager(/*target=*/1024, /*min_count=*/3, + /*enabled=*/true, ManifestContent::kDeletes)); + ICEBERG_UNWRAP_OR_FAIL( + auto result, + mgr->MergeManifests({del0, del1}, {del2}, *metadata_, MakeWriterFactory())); EXPECT_EQ(result.size(), 1U); EXPECT_EQ(result[0].content, ManifestContent::kDeletes); ICEBERG_UNWRAP_OR_FAIL(auto count, CountEntries(result)); @@ -326,26 +510,16 @@ TEST_F(ManifestMergeManagerTest, DeleteManifestsMerged) { } TEST_F(ManifestMergeManagerTest, PackEndOlderManifestsMergedNotNewest) { - // packEnd semantics: for [m0_new, m1_old, m2_old] with target=250 (pairs fit but - // triples don't), packing from the end merges m1+m2 (the older pair) and leaves - // m0 (the newest) in its own under-filled bin at the front of the output. - // This is the opposite of naive forward packing, which would merge m0+m1. ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(kSpecId0, 1, /*size=*/100)); ICEBERG_UNWRAP_OR_FAIL(auto m0, WriteManifest(kSpecId0, 1, /*size=*/100)); - // target=250 fits two 100-byte manifests but not three. - // min_count=3 so m0's single-element bin is kept as-is (below threshold). - ManifestMergeManager mgr(/*target=*/250, /*min_count=*/3, /*enabled=*/true); + ICEBERG_UNWRAP_OR_FAIL(auto mgr, MakeMergeManager(/*target=*/250, /*min_count=*/3, + /*enabled=*/true)); ICEBERG_UNWRAP_OR_FAIL( - auto result, mgr.MergeManifests({m1, m2}, {m0}, kSnapshotId, *metadata_, file_io_, - MakeWriterFactory())); - // Expected: [m0 (pass-through), merged(m1+m2)] + auto result, mgr->MergeManifests({m1, m2}, {m0}, *metadata_, MakeWriterFactory())); ASSERT_EQ(result.size(), 2U); - // First output is the newest manifest m0, passed through unchanged (under-filled bin). EXPECT_EQ(result[0].manifest_length, m0.manifest_length); - // Second output is the merged older pair — it must be a newly written manifest - // (different path than either original). EXPECT_NE(result[1].manifest_path, m1.manifest_path); EXPECT_NE(result[1].manifest_path, m2.manifest_path); ICEBERG_UNWRAP_OR_FAIL(auto count, CountEntries(result)); diff --git a/src/iceberg/test/manifest_reader_test.cc b/src/iceberg/test/manifest_reader_test.cc index 3f85729a7..f2c4ef406 100644 --- a/src/iceberg/test/manifest_reader_test.cc +++ b/src/iceberg/test/manifest_reader_test.cc @@ -190,6 +190,41 @@ TEST_P(TestManifestReader, TestManifestReaderWithEmptyInheritableMetadata) { EXPECT_EQ(read_entry.snapshot_id, 1000L); } +TEST_P(TestManifestReader, DeletedEntriesDoNotInheritFirstRowId) { + auto version = GetParam(); + if (version < 3) { + GTEST_SKIP() << "first_row_id is only assigned in V3 manifests"; + } + + auto deleted_file = + MakeDataFile("/path/to/deleted.parquet", PartitionValues({Literal::Int(0)}), + /*record_count=*/10); + auto added_file = + MakeDataFile("/path/to/added.parquet", PartitionValues({Literal::Int(1)}), + /*record_count=*/5); + + auto deleted_entry = + MakeEntry(ManifestStatus::kDeleted, /*snapshot_id=*/1000L, std::move(deleted_file)); + deleted_entry.sequence_number = 0; + deleted_entry.file_sequence_number = 0; + + std::vector entries; + entries.push_back(std::move(deleted_entry)); + entries.push_back( + MakeEntry(ManifestStatus::kAdded, /*snapshot_id=*/1000L, std::move(added_file))); + auto manifest = WriteManifest(version, /*snapshot_id=*/1000L, std::move(entries)); + + ICEBERG_UNWRAP_OR_FAIL(auto reader, + ManifestReader::Make(manifest, file_io_, schema_, spec_)); + ICEBERG_UNWRAP_OR_FAIL(auto read_entries, reader->Entries()); + + ASSERT_EQ(read_entries.size(), 2U); + EXPECT_EQ(read_entries[0].status, ManifestStatus::kDeleted); + EXPECT_EQ(read_entries[0].data_file->first_row_id, std::nullopt); + EXPECT_EQ(read_entries[1].status, ManifestStatus::kAdded); + EXPECT_EQ(read_entries[1].data_file->first_row_id, 0); +} + TEST_P(TestManifestReader, TestReaderWithFilterWithoutSelect) { auto version = GetParam(); auto file_a = diff --git a/src/iceberg/test/manifest_writer_versions_test.cc b/src/iceberg/test/manifest_writer_versions_test.cc index 990224528..24669d5b5 100644 --- a/src/iceberg/test/manifest_writer_versions_test.cc +++ b/src/iceberg/test/manifest_writer_versions_test.cc @@ -435,6 +435,20 @@ TEST_F(ManifestWriterVersionsTest, TestV1WriteDelete) { "Cannot write equality_deletes file to data manifest file")); } +TEST_F(ManifestWriterVersionsTest, TestWriteAddedEntryRejectsMissingDataFile) { + const std::string manifest_path = CreateManifestPath(); + ICEBERG_UNWRAP_OR_FAIL( + auto writer, ManifestWriter::MakeWriter(/*format_version=*/2, kSnapshotId, + manifest_path, file_io_, spec_, schema_)); + + ManifestEntry entry; + entry.snapshot_id = kSnapshotId; + + auto status = writer->WriteAddedEntry(entry); + EXPECT_THAT(status, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(status, HasErrorMessage("Data file cannot be null")); +} + TEST_F(ManifestWriterVersionsTest, TestV1WriteWithInheritance) { auto manifests = WriteAndReadManifests({WriteManifest(/*format_version=*/1, {data_file_})}, 1); diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc new file mode 100644 index 000000000..69ee10b91 --- /dev/null +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -0,0 +1,1706 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/merging_snapshot_update.h" + +#include +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/constants.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/table_properties.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/transaction.h" +#include "iceberg/update/fast_append.h" +#include "iceberg/update/update_properties.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +/// \brief Concrete subclass of MergingSnapshotUpdate for testing. +class TestMergeAppend : public MergingSnapshotUpdate { + public: + static Result> Make(std::string table_name, + std::shared_ptr
table) { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(std::move(table), TransactionKind::kUpdate)); + return std::unique_ptr( + new TestMergeAppend(std::move(table_name), std::move(ctx))); + } + + std::string operation() override { return "append"; } + + // Expose protected API for test access + Status AddFile(std::shared_ptr file) { return AddDataFile(std::move(file)); } + Status AddDelete(std::shared_ptr file) { + return AddDeleteFile(std::move(file)); + } + Status AddDelete(std::shared_ptr file, int64_t data_sequence_number) { + return AddDeleteFile(std::move(file), data_sequence_number); + } + Status ValidateNoNewDeletesForDataFiles(const TableMetadata& metadata, + int64_t starting_snapshot_id, + std::shared_ptr data_filter, + const DataFileSet& replaced_files, + const std::shared_ptr& parent, + std::shared_ptr io) const { + return MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + metadata, starting_snapshot_id, std::move(data_filter), replaced_files, parent, + std::move(io), IsCaseSensitive()); + } + Status RemoveDataFile(std::shared_ptr file) { + return DeleteDataFile(std::move(file)); + } + Status RemoveDeleteFile(std::shared_ptr file) { + return DeleteDeleteFile(std::move(file)); + } + Status AppendManifest(ManifestFile manifest) { + return AddManifest(std::move(manifest)); + } + Result> DataSpec() const { + return MergingSnapshotUpdate::DataSpec(); + } + int64_t GeneratedSnapshotId() { return SnapshotId(); } + void SetDataSeqNumber(int64_t seq) { SetNewDataFilesDataSequenceNumber(seq); } + void SetCaseSensitive(bool case_sensitive) { CaseSensitive(case_sensitive); } + static Status ValidateAddedDataFilesForTest(const TableMetadata& metadata, + std::optional starting_snapshot_id, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateAddedDataFiles(metadata, starting_snapshot_id, + nullptr, parent, std::move(io)); + } + static Status ValidateAddedDataFilesForTest(const TableMetadata& metadata, + int64_t starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateAddedDataFiles( + metadata, starting_snapshot_id, partition_set, parent, std::move(io)); + } + static Status ValidateDataFilesExistForTest( + const TableMetadata& metadata, int64_t starting_snapshot_id, + const std::unordered_set& file_paths, bool skip_deletes, + std::shared_ptr filter, const std::shared_ptr& parent, + std::shared_ptr io, bool case_sensitive = true) { + return MergingSnapshotUpdate::ValidateDataFilesExist( + metadata, starting_snapshot_id, file_paths, skip_deletes, std::move(filter), + parent, std::move(io), case_sensitive); + } + static Status ValidateNoNewDeletesForDataFilesForTest( + const TableMetadata& metadata, int64_t starting_snapshot_id, + const DataFileSet& replaced_files, const std::shared_ptr& parent, + std::shared_ptr io, bool ignore_equality_deletes = false) { + return MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + metadata, starting_snapshot_id, replaced_files, parent, std::move(io), + ignore_equality_deletes); + } + static Status ValidateNoNewDeletesForDataFilesForTest( + const TableMetadata& metadata, int64_t starting_snapshot_id, + std::shared_ptr data_filter, const DataFileSet& replaced_files, + const std::shared_ptr& parent, std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + metadata, starting_snapshot_id, std::move(data_filter), replaced_files, parent, + std::move(io)); + } + static Status ValidateNoNewDeleteFilesForTest(const TableMetadata& metadata, + int64_t starting_snapshot_id, + std::shared_ptr data_filter, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateNoNewDeleteFiles( + metadata, starting_snapshot_id, std::move(data_filter), parent, std::move(io)); + } + static Status ValidateNoNewDeleteFilesForTest(const TableMetadata& metadata, + int64_t starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateNoNewDeleteFiles( + metadata, starting_snapshot_id, partition_set, parent, std::move(io)); + } + static Status ValidateDeletedDataFilesForTest(const TableMetadata& metadata, + int64_t starting_snapshot_id, + std::shared_ptr data_filter, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateDeletedDataFiles( + metadata, starting_snapshot_id, std::move(data_filter), parent, std::move(io)); + } + static Status ValidateDeletedDataFilesForTest(const TableMetadata& metadata, + int64_t starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateDeletedDataFiles( + metadata, starting_snapshot_id, partition_set, parent, std::move(io)); + } + static Status ValidateAddedDVsForTest( + const TableMetadata& metadata, int64_t starting_snapshot_id, + std::shared_ptr conflict_filter, + const std::unordered_set& referenced_data_files, + const std::shared_ptr& parent, std::shared_ptr io) { + return MergingSnapshotUpdate::ValidateAddedDVs( + metadata, starting_snapshot_id, std::move(conflict_filter), referenced_data_files, + parent, std::move(io)); + } + + bool HasDataFiles() const { return AddsDataFiles(); } + bool HasDeleteFiles() const { return AddsDeleteFiles(); } + bool HasDataDeletes() const { return DeletesDataFiles(); } + + private: + TestMergeAppend(std::string table_name, std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) {} +}; + +class TestOverwriteUpdate : public MergingSnapshotUpdate { + public: + static Result> Make(std::string table_name, + std::shared_ptr
table) { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(std::move(table), TransactionKind::kUpdate)); + return std::unique_ptr( + new TestOverwriteUpdate(std::move(table_name), std::move(ctx))); + } + + std::string operation() override { return DataOperation::kOverwrite; } + int64_t GeneratedSnapshotId() { return SnapshotId(); } + + Status AddDelete(std::shared_ptr file) { + return AddDeleteFile(std::move(file)); + } + Status AddDelete(std::shared_ptr file, int64_t data_sequence_number) { + return AddDeleteFile(std::move(file), data_sequence_number); + } + Status RemoveDataFile(std::shared_ptr file) { + return DeleteDataFile(std::move(file)); + } + + private: + TestOverwriteUpdate(std::string table_name, std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) {} +}; + +class MergingSnapshotUpdateTest : public MinimalUpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + MinimalUpdateTestBase::SetUp(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + auto f = std::make_shared(); + f->content = DataFile::Content::kData; + f->file_path = table_location_ + path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + f->file_size_in_bytes = 1024; + f->record_count = 100; + f->partition_spec_id = spec_->spec_id(); + return f; + } + + std::shared_ptr MakeDeleteFile(const std::string& path, int64_t partition_x) { + auto f = MakeDataFile(path, partition_x); + f->content = DataFile::Content::kPositionDeletes; + return f; + } + + std::shared_ptr MakeEqualityDeleteFile(const std::string& path, + int64_t partition_x) { + auto f = MakeDeleteFile(path, partition_x); + f->content = DataFile::Content::kEqualityDeletes; + f->equality_ids = {1}; + return f; + } + + Result> NewMergeAppend() { + return TestMergeAppend::Make(TableName(), table_); + } + + Result> NewOverwriteUpdate() { + return TestOverwriteUpdate::Make(TableName(), table_); + } + + void SetTableFormatVersion(int8_t format_version) { + table_->metadata()->format_version = format_version; + } + + // Commit file_a_ with FastAppend and refresh the table. + void CommitFileA() { + ICEBERG_UNWRAP_OR_FAIL(auto fa, table_->NewFastAppend()); + fa->AppendFile(file_a_); + EXPECT_THAT(fa->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Read all entries from a list of ManifestFiles. + Result> ReadAllEntries( + const std::vector& manifests, const TableMetadata& metadata) { + std::vector result; + for (const auto& m : manifests) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(m.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(m, file_io_, schema, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + result.insert(result.end(), entries.begin(), entries.end()); + } + return result; + } + + // Write a manifest file containing the given data files. + // Returns a ManifestFile with added_snapshot_id = kInvalidSnapshotId so it + // is eligible for snapshot ID inheritance. + Result WriteManifest( + const std::string& path, const std::vector>& files) { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, + ManifestWriter::MakeWriter(/*format_version=*/2, kInvalidSnapshotId, path, + file_io_, spec_, schema_, ManifestContent::kData)); + for (const auto& f : files) { + ManifestEntry entry; + entry.status = ManifestStatus::kAdded; + entry.snapshot_id = std::nullopt; + entry.data_file = f; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + + Result WriteDataManifest( + const TableMetadata& metadata, const std::string& path, + const std::vector>& files, int64_t snapshot_id, + int64_t sequence_number) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_->spec_id())); + ICEBERG_ASSIGN_OR_RAISE( + auto writer, + ManifestWriter::MakeWriter(metadata.format_version, snapshot_id, path, file_io_, + spec, schema, ManifestContent::kData)); + for (const auto& f : files) { + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(f, sequence_number)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + + Result WriteDeleteManifest( + const TableMetadata& metadata, const std::string& path, + const std::vector>& files, int64_t snapshot_id, + int64_t sequence_number) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto spec, metadata.PartitionSpecById(spec_->spec_id())); + ICEBERG_ASSIGN_OR_RAISE( + auto writer, + ManifestWriter::MakeWriter(metadata.format_version, snapshot_id, path, file_io_, + spec, schema, ManifestContent::kDeletes)); + for (const auto& f : files) { + ManifestEntry entry; + entry.status = ManifestStatus::kAdded; + entry.snapshot_id = snapshot_id; + entry.sequence_number = sequence_number; + entry.data_file = f; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + + Result> MakeSyntheticSnapshot( + std::string operation, int64_t snapshot_id, + std::optional parent_snapshot_id, int64_t sequence_number, + const std::vector& manifests) { + auto manifest_list_path = table_location_ + "/metadata/manifest-list-" + + std::to_string(snapshot_id) + ".avro"; + ICEBERG_ASSIGN_OR_RAISE( + auto writer, + ManifestListWriter::MakeWriter(table_->metadata()->format_version, snapshot_id, + parent_snapshot_id, manifest_list_path, file_io_, + sequence_number)); + ICEBERG_RETURN_UNEXPECTED(writer->AddAll(manifests)); + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + + ICEBERG_ASSIGN_OR_RAISE( + auto snapshot, + Snapshot::Make(sequence_number, snapshot_id, parent_snapshot_id, TimePointMs{}, + std::move(operation), {}, table_->metadata()->current_schema_id, + manifest_list_path)); + return std::shared_ptr(std::move(snapshot)); + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; +}; + +// ------------------------------------------------------------------------- +// State query tests +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, AddsDataFilesInitiallyFalse) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_FALSE(op->HasDataFiles()); + EXPECT_FALSE(op->HasDeleteFiles()); + EXPECT_FALSE(op->HasDataDeletes()); +} + +TEST_F(MergingSnapshotUpdateTest, AddsDataFilesTrueAfterAdd) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_TRUE(op->HasDataFiles()); + EXPECT_FALSE(op->HasDeleteFiles()); +} + +TEST_F(MergingSnapshotUpdateTest, AddsDeleteFilesTrueAfterAdd) { + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_FALSE(op->HasDataFiles()); + EXPECT_TRUE(op->HasDeleteFiles()); +} + +TEST_F(MergingSnapshotUpdateTest, DeletesDataFilesTrueAfterRegisterDelete) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + EXPECT_TRUE(op->HasDataDeletes()); +} + +// ------------------------------------------------------------------------- +// Apply / Commit tests +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, CommitNewDataFile) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "100"); +} + +TEST_F(MergingSnapshotUpdateTest, CommitV3NewDataFileAssignsRowLineage) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(TableProperties::kFormatVersion.key(), "3"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto first_row_id, snapshot->FirstRowId()); + ICEBERG_UNWRAP_OR_FAIL(auto added_rows, snapshot->AddedRows()); + EXPECT_EQ(first_row_id, std::make_optional(0)); + EXPECT_EQ(added_rows, std::make_optional(100)); + EXPECT_EQ(table_->metadata()->next_row_id, 100); +} + +TEST_F(MergingSnapshotUpdateTest, CommitMultipleDataFiles) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "200"); +} + +TEST_F(MergingSnapshotUpdateTest, CommitDataFileAndDeleteFile) { + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + // Data file summary + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, CommitPreservesExistingManifests) { + // First append: file_a + CommitFileA(); + + // Second merge append: file_b + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); +} + +TEST_F(MergingSnapshotUpdateTest, CommitDeletesDataFile) { + CommitFileA(); + + // Remove file_a via merging snapshot update + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "0"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, SetNewDataFilesDataSequenceNumber) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + op->SetDataSeqNumber(42); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + + auto snapshot_cache = SnapshotCache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(table_->io())); + std::vector manifests(data_manifests.begin(), data_manifests.end()); + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(manifests, *table_->metadata())); + ASSERT_EQ(entries.size(), 1U); + EXPECT_EQ(entries[0].sequence_number, 42); +} + +TEST_F(MergingSnapshotUpdateTest, AddDataFileDoesNotMutateCallerFile) { + auto file = MakeDataFile("/data/with-row-id.parquet", 1L); + file->first_row_id = 42; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file), IsOk()); + + EXPECT_EQ(file->first_row_id, 42); +} + +TEST_F(MergingSnapshotUpdateTest, CustomSummaryPropertySurvivesApplyRebuild) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + op->Set("custom-prop", "custom-value"); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at("custom-prop"), "custom-value"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, BaseSetCustomSummaryPropertySurvivesApplyRebuild) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + SnapshotUpdate& base_update = *op; + base_update.Set("custom-prop", "custom-value"); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at("custom-prop"), "custom-value"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); +} + +// ------------------------------------------------------------------------- +// CleanUncommitted test +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, CleanUncommittedAfterSuccessfulCommitDoesNotCrash) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + // Cleanup may run from an error handler even after commit success. + EXPECT_THAT(op->CleanUncommitted({}), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, + CleanUncommittedDeletesManagerOutputsWithDeleteCallback) { + ICEBERG_UNWRAP_OR_FAIL(auto initial, NewMergeAppend()); + EXPECT_THAT(initial->AddFile(file_a_), IsOk()); + EXPECT_THAT(initial->AddFile(file_b_), IsOk()); + EXPECT_THAT(initial->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + std::vector deleted_paths; + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + op->DeleteWith([&deleted_paths](const std::string& path) { + deleted_paths.push_back(path); + return Status{}; + }); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL( + auto manifests, op->Apply(*table_->metadata(), table_->current_snapshot().value())); + EXPECT_THAT(manifests, ::testing::SizeIs(1)); + + EXPECT_THAT(op->CleanUncommitted({}), IsOk()); + EXPECT_THAT(deleted_paths, ::testing::Contains(::testing::HasSubstr("/metadata/"))); +} + +// ------------------------------------------------------------------------- +// Delete file summary tests +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, CommitDeleteFileSummaryHasAddedDeleteFiles) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedPosDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kRemovedDeleteFiles), 0); +} + +TEST_F(MergingSnapshotUpdateTest, CommitDeduplicatesStagedDeleteFiles) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedPosDeleteFiles), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, AddDeleteFileWithExplicitSequenceWritesSequenceNumber) { + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file, 17), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), nullptr)); + auto delete_manifest_it = + std::ranges::find_if(manifests, [](const ManifestFile& manifest) { + return manifest.content == ManifestContent::kDeletes; + }); + ASSERT_NE(delete_manifest_it, manifests.end()); + ICEBERG_UNWRAP_OR_FAIL(auto entries, + ReadAllEntries(std::vector{*delete_manifest_it}, + *table_->metadata())); + ASSERT_EQ(entries.size(), 1U); + ASSERT_TRUE(entries[0].sequence_number.has_value()); + EXPECT_EQ(entries[0].sequence_number.value(), 17); +} + +TEST_F(MergingSnapshotUpdateTest, ApplyRebuildsDeleteSummaryAfterPreparingDeletes) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto first_manifests, op->Apply(*table_->metadata(), nullptr)); + EXPECT_THAT(first_manifests, ::testing::Contains(::testing::Field( + &ManifestFile::content, ManifestContent::kDeletes))); + + ICEBERG_UNWRAP_OR_FAIL(auto second_manifests, op->Apply(*table_->metadata(), nullptr)); + EXPECT_THAT(second_manifests, ::testing::Contains(::testing::Field( + &ManifestFile::content, ManifestContent::kDeletes))); + + auto summary = op->Summary(); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kAddedPosDeleteFiles), "1"); +} + +// Covers the bug where deleted delete files were not tracked in the snapshot summary. +TEST_F(MergingSnapshotUpdateTest, CommitDeletesDeleteFileSummaryHasRemovedDeleteFiles) { + // Step 1: commit a delete file. + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Step 2: commit a new snapshot that removes the delete file. + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->RemoveDeleteFile(del_file), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedPosDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kAddedDeleteFiles), 0); +} + +// ------------------------------------------------------------------------- +// Deduplication test +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, DuplicateDataFileOnlyCountedOnce) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, CommitSkipsMalformedPreviousSummaryTotal) { + { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto previous_snapshot, table_->current_snapshot()); + previous_snapshot->summary[SnapshotSummaryFields::kTotalRecords] = "not-a-number"; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kTotalRecords), 0U); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "100"); +} + +// ------------------------------------------------------------------------- +// ValidateNewDeleteFile format version tests +// ------------------------------------------------------------------------- + +/// \brief V1-table test fixture. +class MergingSnapshotUpdateV1Test : public UpdateTestBase { + protected: + std::string MetadataResource() const override { return "TableMetadataV1Valid.json"; } + std::string TableName() const override { return "v1_test_table"; } + + void SetUp() override { + UpdateTestBase::SetUp(); + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + } + + std::shared_ptr MakeDeleteFile(const std::string& path) { + auto f = std::make_shared(); + f->content = DataFile::Content::kPositionDeletes; + f->file_path = table_location_ + path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(1L)}); + f->file_size_in_bytes = 512; + f->record_count = 10; + f->partition_spec_id = spec_->spec_id(); + return f; + } + + Result> NewMergeAppend() { + return TestMergeAppend::Make(TableName(), table_); + } + + std::shared_ptr spec_; +}; + +TEST_F(MergingSnapshotUpdateV1Test, ValidateNewDeleteFileV1Rejected) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet"); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileV2AllowsReferencedPositionDelete) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + del_file->referenced_data_file = table_location_ + "/data/file_a.parquet"; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileV2RejectsDeletionVector) { + auto del_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + del_file->file_format = FileFormatType::kPuffin; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileV2AllowsEqualityDelete) { + auto eq_del = MakeDeleteFile("/delete/eq_del.parquet", 1L); + eq_del->content = DataFile::Content::kEqualityDeletes; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(eq_del), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileV3RejectsNonDVPositionDelete) { + SetTableFormatVersion(3); + + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileV3AllowsDeletionVector) { + SetTableFormatVersion(3); + + auto del_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + del_file->file_format = FileFormatType::kPuffin; + del_file->referenced_data_file = file_a_->file_path; + del_file->content_offset = 0; + del_file->content_size_in_bytes = 10; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNewDeleteFileRejectsUnsupportedVersion) { + SetTableFormatVersion(TableMetadata::kSupportedTableFormatVersion + 1); + + auto del_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + del_file->file_format = FileFormatType::kPuffin; + del_file->referenced_data_file = file_a_->file_path; + del_file->content_offset = 0; + del_file->content_size_in_bytes = 10; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(MergingSnapshotUpdateTest, ApplyRejectsV2StagedPositionDeleteAfterV3Upgrade) { + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->format_version = 3; + EXPECT_THAT(op->Apply(*metadata, nullptr), IsError(ErrorKind::kInvalidArgument)); +} + +// ------------------------------------------------------------------------- +// AddManifest protected primitive behavior +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, AddManifestRejectsDeleteManifest) { + ManifestFile del_manifest; + del_manifest.manifest_path = table_location_ + "/metadata/del.avro"; + del_manifest.content = ManifestContent::kDeletes; + del_manifest.added_snapshot_id = kInvalidSnapshotId; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(del_manifest), IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(MergingSnapshotUpdateTest, AddManifestPrimitiveAllowsExistingFilesCount) { + ManifestFile manifest; + manifest.manifest_path = table_location_ + "/metadata/existing.avro"; + manifest.content = ManifestContent::kData; + manifest.added_snapshot_id = kInvalidSnapshotId; + manifest.existing_files_count = 1; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, AddManifestPrimitiveAllowsDeletedFilesCount) { + ManifestFile manifest; + manifest.manifest_path = table_location_ + "/metadata/deleted.avro"; + manifest.content = ManifestContent::kData; + manifest.added_snapshot_id = kInvalidSnapshotId; + manifest.deleted_files_count = 1; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, AddManifestCopiesManifestWithAssignedSnapshotId) { + auto path = table_location_ + "/metadata/snap.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_})); + manifest.added_snapshot_id = 12345; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + ASSERT_EQ(data_manifests.size(), 1U); + EXPECT_NE(data_manifests[0].manifest_path, path); +} + +TEST_F(MergingSnapshotUpdateTest, AddManifestRejectsManifestWithFirstRowId) { + auto path = table_location_ + "/metadata/rowid.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_})); + manifest.first_row_id = 0; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsError(ErrorKind::kInvalidArgument)); +} + +// ------------------------------------------------------------------------- +// AddManifest basic commit behavior +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, AppendManifestEmptyTable) { + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + + // In v2 with snapshot ID inheritance, the manifest path is reused directly. + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + ASSERT_EQ(data_manifests.size(), 1); + + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); +} + +TEST_F(MergingSnapshotUpdateTest, AppendManifestWithDataFiles) { + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); // file_b_ staged directly + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + // Written manifest (file_b_) + appended manifest (file_a_, file_b_) + EXPECT_EQ(data_manifests.size(), 2); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "3"); +} + +// ------------------------------------------------------------------------- +// AddManifest merge behavior +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, AppendManifestMergeWithMinCountOne) { + // Set min-count-to-merge = 1 so all manifests are merged. + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + // Both manifests merged into one. + EXPECT_EQ(data_manifests.size(), 1); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "3"); +} + +TEST_F(MergingSnapshotUpdateTest, AppendManifestDoNotMergeMinCount) { + // Set min-count-to-merge = 4 so 3 manifests are not merged. + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), "4"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto path1 = table_location_ + "/metadata/m1.avro"; + auto path2 = table_location_ + "/metadata/m2.avro"; + auto path3 = table_location_ + "/metadata/m3.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto m1, WriteManifest(path1, {file_a_})); + ICEBERG_UNWRAP_OR_FAIL(auto m2, WriteManifest(path2, {file_b_})); + ICEBERG_UNWRAP_OR_FAIL( + auto m3, WriteManifest(path3, {MakeDataFile("/data/file_c.parquet", 3L)})); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(m1), IsOk()); + EXPECT_THAT(op->AppendManifest(m2), IsOk()); + EXPECT_THAT(op->AppendManifest(m3), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + EXPECT_EQ(data_manifests.size(), 3); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "3"); +} + +// ------------------------------------------------------------------------- +// Manifest merge data files only +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, ManifestMergeMergesIntoOne) { + // Set min-count-to-merge = 1 so every append triggers a merge. + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + // Snapshot 1: file_a_ + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + EXPECT_EQ(data_manifests.size(), 1); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, ManifestMergeDoesNotMergeWhenBelowMinCount) { + // Default min-count-to-merge = 100, so manifests are not merged. + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + EXPECT_EQ(data_manifests.size(), 2); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); +} + +TEST_F(MergingSnapshotUpdateTest, ManifestMergeDoesNotMergeWhenSizeTargetTooSmall) { + // Set a tiny size target so manifests never merge. + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestTargetSizeBytes.key()), "10"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + EXPECT_EQ(data_manifests.size(), 2); +} + +// ------------------------------------------------------------------------- +// Manifest count summary +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, SummaryManifestCountsOnFirstCommit) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_F(MergingSnapshotUpdateTest, SummaryManifestCountsOnSecondCommitNoMerge) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + // 1 new manifest created, 1 existing manifest kept, 0 replaced. + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "1"); +} + +TEST_F(MergingSnapshotUpdateTest, SummaryManifestCountsAfterMerge) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + // 1 merged output created, 1 existing manifest replaced, 0 kept. + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_F(MergingSnapshotUpdateTest, SummaryManifestCountsAfterDelete) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + // Filter rewrites 1 manifest (replaced), merge produces 1 output (created). + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_F(MergingSnapshotUpdateTest, MissingRequestedDeleteDoesNotAffectSummary) { + CommitFileA(); + + auto missing = MakeDataFile("/data/missing.parquet", 3L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->RemoveDataFile(missing), IsOk()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kDeletedDataFiles), 0U); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDataFilesFailsForTruncatedHistory) { + auto metadata = std::make_shared(); + metadata->format_version = 2; + metadata->location = table_location_; + metadata->current_schema_id = 0; + metadata->schemas.push_back(schema_); + + auto make_snapshot = [](int64_t snapshot_id, + std::optional parent_snapshot_id) { + return std::make_shared(Snapshot{ + .snapshot_id = snapshot_id, + .parent_snapshot_id = parent_snapshot_id, + .sequence_number = snapshot_id, + .timestamp_ms = TimePointMs{}, + .manifest_list = "", + .summary = {}, + .schema_id = 0, + }); + }; + + auto base_snapshot = make_snapshot(1, std::nullopt); + auto main_snapshot = make_snapshot(2, 1); + auto branch_snapshot = make_snapshot(3, 1); + metadata->snapshots = {base_snapshot, main_snapshot, branch_snapshot}; + + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest(*metadata, /*starting=*/2, + branch_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateAddedDataFilesWithNoStartingSnapshotFailsForTruncatedHistory) { + auto metadata = std::make_shared(); + metadata->format_version = 2; + metadata->location = table_location_; + metadata->current_schema_id = 0; + metadata->schemas.push_back(schema_); + + auto snapshot = std::make_shared(Snapshot{ + .snapshot_id = 2, + .parent_snapshot_id = 1, + .sequence_number = 2, + .timestamp_ms = TimePointMs{}, + .manifest_list = "", + .summary = {}, + .schema_id = 0, + }); + metadata->snapshots = {snapshot}; + + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest(*metadata, std::nullopt, + snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDataFilesWithNoStartingSnapshotChecksAll) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest( + *table_->metadata(), std::nullopt, snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest( + *table_->metadata(), snapshot->snapshot_id, snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDataFilesWithPartitionSetDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto fast_append, table_->NewFastAppend()); + fast_append->AppendFile(file_b_); + EXPECT_THAT(fast_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, table_->current_snapshot()); + + PartitionSet partition_set; + ASSERT_TRUE(partition_set.add(spec_->spec_id(), file_b_->partition)); + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest( + *table_->metadata(), first_snapshot->snapshot_id, partition_set, + second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDataFilesIgnoresOldEntrySnapshotId) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto metadata = std::make_shared(*table_->metadata()); + + constexpr int64_t kSecondSnapshotId = 123456; + auto manifest_path = table_location_ + "/metadata/old-entry-data.avro"; + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteDataManifest(*metadata, manifest_path, {file_b_}, first_snapshot->snapshot_id, + first_snapshot->sequence_number)); + manifest.added_snapshot_id = kSecondSnapshotId; + manifest.sequence_number = first_snapshot->sequence_number + 1; + manifest.min_sequence_number = first_snapshot->sequence_number; + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kAppend, kSecondSnapshotId, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, {manifest})); + + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + EXPECT_THAT(TestMergeAppend::ValidateAddedDataFilesForTest( + *metadata, first_snapshot->snapshot_id, second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateDataFilesExistUsesRowFilter) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + std::unordered_set required_files{file_a_->file_path}; + EXPECT_THAT(TestMergeAppend::ValidateDataFilesExistForTest( + *metadata, first_snapshot->snapshot_id, required_files, + /*skip_deletes=*/false, Expressions::Equal("x", Literal::Long(1L)), + second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(TestMergeAppend::ValidateDataFilesExistForTest( + *metadata, first_snapshot->snapshot_id, required_files, + /*skip_deletes=*/false, Expressions::Equal("x", Literal::Long(2L)), + second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeletesForDataFilesWithFilterDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeletesForDataFilesForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + replaced_files, second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNoNewDeletesForDataFilesDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeletesForDataFilesForTest( + *metadata, first_snapshot->snapshot_id, replaced_files, second_snapshot, + file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeletesForDataFilesFailsOnPositionDeleteWhenIgnoringEqualityDeletes) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeDeleteFile("/delete/pos_del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeletesForDataFilesForTest( + *metadata, first_snapshot->snapshot_id, replaced_files, second_snapshot, + file_io_, /*ignore_equality_deletes=*/true), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeletesForDataFilesUsesConfiguredCaseSensitivity) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto overwrite, NewOverwriteUpdate()); + EXPECT_THAT(overwrite->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = overwrite->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, + overwrite->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + ICEBERG_UNWRAP_OR_FAIL(auto validate, NewMergeAppend()); + validate->SetCaseSensitive(false); + EXPECT_THAT(validate->ValidateNoNewDeletesForDataFiles( + *metadata, first_snapshot->snapshot_id, + Expressions::Equal("X", Literal::Long(1L)), replaced_files, + second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeletesForDataFilesWithFilterSkipsNonMatchingDeletes) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeletesForDataFilesForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysFalse(), + replaced_files, second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateNoNewDeleteFilesWithExpressionDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeleteFilesForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeleteFilesWithExpressionSkipsNonMatchingDeletes) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeleteFilesForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysFalse(), + second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeleteFilesWithPartitionSetDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + PartitionSet partition_set; + ASSERT_TRUE(partition_set.add(spec_->spec_id(), del_file->partition)); + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeleteFilesForTest( + *metadata, first_snapshot->snapshot_id, partition_set, second_snapshot, + file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDVsDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->format_version = 3; + + auto dv_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + dv_file->file_format = FileFormatType::kPuffin; + dv_file->referenced_data_file = file_a_->file_path; + dv_file->content_offset = 0; + dv_file->content_size_in_bytes = 10; + + constexpr int64_t kSecondSnapshotId = 123456; + auto manifest_path = table_location_ + "/metadata/dv-conflict.avro"; + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteDeleteManifest(*metadata, manifest_path, {dv_file}, kSecondSnapshotId, + first_snapshot->sequence_number + 1)); + manifest.added_snapshot_id = kSecondSnapshotId; + manifest.sequence_number = first_snapshot->sequence_number + 1; + manifest.min_sequence_number = first_snapshot->sequence_number + 1; + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, kSecondSnapshotId, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, {manifest})); + + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + const std::unordered_set referenced_data_files{file_a_->file_path}; + EXPECT_THAT(TestMergeAppend::ValidateAddedDVsForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + referenced_data_files, second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDVsIgnoresUnrelatedDVs) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->format_version = 3; + + auto dv_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + dv_file->file_format = FileFormatType::kPuffin; + dv_file->referenced_data_file = file_a_->file_path; + dv_file->content_offset = 0; + dv_file->content_size_in_bytes = 10; + + constexpr int64_t kSecondSnapshotId = 123456; + auto manifest_path = table_location_ + "/metadata/dv-unrelated.avro"; + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteDeleteManifest(*metadata, manifest_path, {dv_file}, kSecondSnapshotId, + first_snapshot->sequence_number + 1)); + manifest.added_snapshot_id = kSecondSnapshotId; + manifest.sequence_number = first_snapshot->sequence_number + 1; + manifest.min_sequence_number = first_snapshot->sequence_number + 1; + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, kSecondSnapshotId, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, {manifest})); + + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + const std::unordered_set referenced_data_files{file_b_->file_path}; + EXPECT_THAT(TestMergeAppend::ValidateAddedDVsForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + referenced_data_files, second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateAddedDVsIgnoresOldEntrySnapshotId) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->format_version = 3; + + auto dv_file = MakeDeleteFile("/delete/dv_a.puffin", 1L); + dv_file->file_format = FileFormatType::kPuffin; + dv_file->referenced_data_file = file_a_->file_path; + dv_file->content_offset = 0; + dv_file->content_size_in_bytes = 10; + + constexpr int64_t kSecondSnapshotId = 123456; + auto manifest_path = table_location_ + "/metadata/old-entry-dv.avro"; + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteDeleteManifest(*metadata, manifest_path, {dv_file}, + first_snapshot->snapshot_id, first_snapshot->sequence_number)); + manifest.added_snapshot_id = kSecondSnapshotId; + manifest.sequence_number = first_snapshot->sequence_number + 1; + manifest.min_sequence_number = first_snapshot->sequence_number; + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, kSecondSnapshotId, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, {manifest})); + + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + const std::unordered_set referenced_data_files{file_a_->file_path}; + EXPECT_THAT(TestMergeAppend::ValidateAddedDVsForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + referenced_data_files, second_snapshot, file_io_), + IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, ValidateDeletedDataFilesWithExpressionDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + EXPECT_THAT(TestMergeAppend::ValidateDeletedDataFilesForTest( + *metadata, first_snapshot->snapshot_id, Expressions::AlwaysTrue(), + second_snapshot, file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(MergingSnapshotUpdateTest, + ValidateDeletedDataFilesWithPartitionSetDetectsConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->RemoveDataFile(file_a_), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + PartitionSet partition_set; + ASSERT_TRUE(partition_set.add(spec_->spec_id(), file_a_->partition)); + EXPECT_THAT(TestMergeAppend::ValidateDeletedDataFilesForTest( + *metadata, first_snapshot->snapshot_id, partition_set, second_snapshot, + file_io_), + IsError(ErrorKind::kValidationFailed)); +} + +// ------------------------------------------------------------------------- +// DataSpec multiple partition specs +// ------------------------------------------------------------------------- + +TEST_F(MergingSnapshotUpdateTest, DataSpecThrowsWithMultipleSpecs) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->DataSpec(), IsOk()); +} + +TEST_F(MergingSnapshotUpdateTest, DataSpecThrowsWhenEmpty) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->DataSpec(), IsError(ErrorKind::kInvalidArgument)); +} + +} // namespace iceberg diff --git a/src/iceberg/test/snapshot_util_test.cc b/src/iceberg/test/snapshot_util_test.cc index a47b403da..e94769e31 100644 --- a/src/iceberg/test/snapshot_util_test.cc +++ b/src/iceberg/test/snapshot_util_test.cc @@ -301,15 +301,38 @@ TEST_F(SnapshotUtilTest, SchemaForBranch) { ICEBERG_UNWRAP_OR_FAIL(auto initial_schema, table_->schema()); ASSERT_NE(initial_schema, nullptr); + auto branch_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeRequired(2, "data", string()), + SchemaField::MakeOptional(3, "branch_only", string())}, + 1); + table_->metadata()->schemas.push_back(branch_schema); + ICEBERG_UNWRAP_OR_FAIL(auto branch_snapshot, table_->SnapshotById(branch_snapshot_id_)); + branch_snapshot->schema_id = branch_schema->schema_id(); + std::string branch = "b1"; ICEBERG_UNWRAP_OR_FAIL(auto schema, SnapshotUtil::SchemaFor(*table_, branch)); - // Branch should return current schema (not snapshot schema) + EXPECT_EQ(schema->schema_id(), initial_schema->schema_id()); EXPECT_EQ(schema->fields().size(), initial_schema->fields().size()); + + ICEBERG_UNWRAP_OR_FAIL(auto metadata_schema, + SnapshotUtil::SchemaFor(*table_->metadata(), branch)); + EXPECT_EQ(metadata_schema->schema_id(), initial_schema->schema_id()); + EXPECT_EQ(metadata_schema->fields().size(), initial_schema->fields().size()); } TEST_F(SnapshotUtilTest, SchemaForTag) { // Create a tag pointing to base snapshot auto metadata = table_->metadata(); + auto tag_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeRequired(2, "data", string()), + SchemaField::MakeOptional(3, "tag_only", string())}, + 1); + metadata->schemas.push_back(tag_schema); + ICEBERG_UNWRAP_OR_FAIL(auto base_snapshot, table_->SnapshotById(base_snapshot_id_)); + base_snapshot->schema_id = tag_schema->schema_id(); + std::string tag = "tag1"; metadata->refs[tag] = std::make_shared( SnapshotRef{.snapshot_id = base_snapshot_id_, .retention = SnapshotRef::Tag{}}); @@ -318,9 +341,14 @@ TEST_F(SnapshotUtilTest, SchemaForTag) { ASSERT_NE(initial_schema, nullptr); ICEBERG_UNWRAP_OR_FAIL(auto schema, SnapshotUtil::SchemaFor(*table_, tag)); - // Tag should return the schema of the snapshot it points to - // Since base snapshot has schema_id = 0, it should return the same schema - EXPECT_EQ(schema->fields().size(), initial_schema->fields().size()); + EXPECT_EQ(schema->schema_id(), tag_schema->schema_id()); + EXPECT_EQ(schema->fields().size(), tag_schema->fields().size()); + EXPECT_NE(schema->fields().size(), initial_schema->fields().size()); + + ICEBERG_UNWRAP_OR_FAIL(auto metadata_schema, + SnapshotUtil::SchemaFor(*table_->metadata(), tag)); + EXPECT_EQ(metadata_schema->schema_id(), tag_schema->schema_id()); + EXPECT_EQ(metadata_schema->fields().size(), tag_schema->fields().size()); } TEST_F(SnapshotUtilTest, SnapshotAfter) { diff --git a/src/iceberg/update/fast_append.cc b/src/iceberg/update/fast_append.cc index d08f497cf..24f8e744f 100644 --- a/src/iceberg/update/fast_append.cc +++ b/src/iceberg/update/fast_append.cc @@ -131,7 +131,7 @@ std::unordered_map FastAppend::Summary() { return summary_.Build(); } -void FastAppend::CleanUncommitted(const std::unordered_set& committed) { +Status FastAppend::CleanUncommitted(const std::unordered_set& committed) { // Clean up new manifests that were written but not committed if (!new_manifests_.empty()) { for (const auto& manifest : new_manifests_) { @@ -152,6 +152,7 @@ void FastAppend::CleanUncommitted(const std::unordered_set& committ } } } + return {}; } bool FastAppend::CleanupAfterCommit() const { diff --git a/src/iceberg/update/fast_append.h b/src/iceberg/update/fast_append.h index 580fa4722..a04786c88 100644 --- a/src/iceberg/update/fast_append.h +++ b/src/iceberg/update/fast_append.h @@ -72,7 +72,7 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate { const TableMetadata& metadata_to_update, const std::shared_ptr& snapshot) override; std::unordered_map Summary() override; - void CleanUncommitted(const std::unordered_set& committed) override; + Status CleanUncommitted(const std::unordered_set& committed) override; bool CleanupAfterCommit() const override; private: diff --git a/src/iceberg/update/merging_snapshot_update.cc b/src/iceberg/update/merging_snapshot_update.cc new file mode 100644 index 000000000..a0d882d14 --- /dev/null +++ b/src/iceberg/update/merging_snapshot_update.cc @@ -0,0 +1,1325 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/merging_snapshot_update.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/constants.h" +#include "iceberg/delete_file_index.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/expression/manifest_evaluator.h" +#include "iceberg/expression/projections.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_group.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/manifest/manifest_util_internal.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/table_properties.h" +#include "iceberg/transaction.h" +#include "iceberg/util/content_file_util.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/snapshot_util_internal.h" + +namespace iceberg { + +namespace { + +const std::array kValidateAddedFilesOperations = { + DataOperation::kAppend, DataOperation::kOverwrite}; +const std::array kValidateDataFilesExistOperations = { + DataOperation::kOverwrite, DataOperation::kReplace, DataOperation::kDelete}; +const std::array kValidateDataFilesExistSkipDeleteOperations = { + DataOperation::kOverwrite, DataOperation::kReplace}; +const std::array kValidateAddedDeleteFilesOperations = { + DataOperation::kOverwrite, DataOperation::kDelete}; +const std::array kValidateAddedDVsOperations = { + DataOperation::kOverwrite, DataOperation::kDelete, DataOperation::kReplace}; + +bool MatchesOperation(std::optional operation, + std::span expected) { + return operation.has_value() && + std::ranges::find(expected, operation.value()) != expected.end(); +} + +struct ValidationHistoryResult { + std::vector manifests; + std::unordered_set snapshot_ids; +}; + +Result>> ValidationAncestorsBetween( + const TableMetadata& metadata, int64_t latest_snapshot_id, + std::optional starting_snapshot_id) { + ICEBERG_ASSIGN_OR_RAISE( + auto ancestors, + SnapshotUtil::AncestorsBetween(metadata, latest_snapshot_id, starting_snapshot_id)); + if (!starting_snapshot_id.has_value()) { + if (!ancestors.empty()) { + const auto& oldest_checked = ancestors.back(); + if (oldest_checked == nullptr || oldest_checked->parent_snapshot_id.has_value()) { + return ValidationFailed( + "Cannot validate history: cannot determine complete history for snapshot {}", + latest_snapshot_id); + } + } + return ancestors; + } + + if (latest_snapshot_id == starting_snapshot_id.value()) { + return ancestors; + } + if (ancestors.empty()) { + return ValidationFailed( + "Cannot validate history: starting snapshot {} is not an ancestor " + "of snapshot {}", + starting_snapshot_id.value(), latest_snapshot_id); + } + + const auto& oldest_checked = ancestors.back(); + if (oldest_checked == nullptr || !oldest_checked->parent_snapshot_id.has_value() || + oldest_checked->parent_snapshot_id.value() != starting_snapshot_id.value()) { + return ValidationFailed( + "Cannot validate history: starting snapshot {} is not an ancestor " + "of snapshot {}", + starting_snapshot_id.value(), latest_snapshot_id); + } + return ancestors; +} + +Result ValidationHistory( + const TableMetadata& metadata, int64_t latest_snapshot_id, + std::optional starting_snapshot_id, + std::span matching_operations, ManifestContent content, + const std::shared_ptr& io) { + ICEBERG_ASSIGN_OR_RAISE( + auto ancestors, + ValidationAncestorsBetween(metadata, latest_snapshot_id, starting_snapshot_id)); + + ValidationHistoryResult result; + for (const auto& snapshot : ancestors) { + if (!MatchesOperation(snapshot->Operation(), matching_operations)) { + continue; + } + + result.snapshot_ids.insert(snapshot->snapshot_id); + auto cached = SnapshotCache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, content == ManifestContent::kData + ? cached.DataManifests(io) + : cached.DeleteManifests(io)); + for (const auto& manifest : manifests) { + if (manifest.added_snapshot_id == snapshot->snapshot_id) { + result.manifests.push_back(manifest); + } + } + } + + return result; +} + +Result>> PartitionSpecsByIdMap( + const TableMetadata& metadata) { + TableMetadataCache metadata_cache(&metadata); + ICEBERG_ASSIGN_OR_RAISE(auto specs_ref, metadata_cache.GetPartitionSpecsById()); + return std::unordered_map>( + specs_ref.get().begin(), specs_ref.get().end()); +} + +Result> MakeValidationManifestGroup( + const TableMetadata& metadata, const std::shared_ptr& io, + std::vector manifests) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, PartitionSpecsByIdMap(metadata)); + return ManifestGroup::Make(io, std::move(schema), std::move(specs_by_id), + std::move(manifests)); +} + +Result StartingSequenceNumber(const TableMetadata& metadata, + std::optional starting_snapshot_id) { + if (starting_snapshot_id.has_value()) { + auto snapshot = metadata.SnapshotById(starting_snapshot_id.value()); + if (snapshot.has_value()) { + return snapshot.value()->sequence_number; + } + } + return TableMetadata::kInitialSequenceNumber; +} + +Result> BuildDeleteFileIndex( + const TableMetadata& metadata, const std::shared_ptr& io, + std::vector delete_manifests, int64_t starting_sequence_number, + std::shared_ptr data_filter, std::shared_ptr partition_set, + bool case_sensitive) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, PartitionSpecsByIdMap(metadata)); + ICEBERG_ASSIGN_OR_RAISE(auto builder, DeleteFileIndex::BuilderFor( + io, std::move(schema), std::move(specs_by_id), + std::move(delete_manifests))); + builder.AfterSequenceNumber(starting_sequence_number); + builder.CaseSensitive(case_sensitive); + if (data_filter != nullptr) { + builder.DataFilter(std::move(data_filter)); + } + if (partition_set != nullptr) { + builder.FilterPartitions(std::move(partition_set)); + } + return builder.Build(); +} + +Result> FilterManifestsByPartition( + const TableMetadata& metadata, std::shared_ptr conflict_detection_filter, + const std::vector& manifests, bool case_sensitive) { + if (conflict_detection_filter == nullptr || + conflict_detection_filter->op() == Expression::Operation::kTrue) { + return manifests; + } + + const int32_t default_spec_id = metadata.default_spec_id; + if (std::ranges::any_of(manifests, [default_spec_id](const ManifestFile& manifest) { + return manifest.partition_spec_id != default_spec_id; + })) { + return manifests; + } + + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, PartitionSpecsByIdMap(metadata)); + std::unordered_map> eval_cache; + std::vector matching_manifests; + for (const auto& manifest : manifests) { + auto it = eval_cache.find(manifest.partition_spec_id); + if (it == eval_cache.end()) { + auto spec_it = specs_by_id.find(manifest.partition_spec_id); + if (spec_it == specs_by_id.end()) { + return InvalidArgument("Cannot find partition spec ID {}", + manifest.partition_spec_id); + } + + auto projector = Projections::Inclusive(*spec_it->second, *schema, case_sensitive); + ICEBERG_ASSIGN_OR_RAISE(auto partition_filter, + projector->Project(conflict_detection_filter)); + ICEBERG_ASSIGN_OR_RAISE( + auto evaluator, + ManifestEvaluator::MakePartitionFilter( + std::move(partition_filter), spec_it->second, *schema, case_sensitive)); + it = eval_cache.emplace(manifest.partition_spec_id, std::move(evaluator)).first; + } + + ICEBERG_ASSIGN_OR_RAISE(auto matches, it->second->Evaluate(manifest)); + if (matches) { + matching_manifests.push_back(manifest); + } + } + return matching_manifests; +} + +void FilterManifestEntriesByPartitionSet(ManifestGroup& group, + const PartitionSet* partition_set) { + if (partition_set != nullptr) { + auto partitions = std::make_shared(*partition_set); + group.FilterManifestEntries([partitions](const ManifestEntry& entry) { + return entry.data_file != nullptr && + entry.data_file->partition_spec_id.has_value() && + partitions->contains(entry.data_file->partition_spec_id.value(), + entry.data_file->partition); + }); + } +} + +Result> MatchingAddedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const PartitionSet* partition_set, + const std::shared_ptr& parent, const std::shared_ptr& io, + bool case_sensitive) { + if (parent == nullptr) { + return std::vector{}; + } + + ICEBERG_ASSIGN_OR_RAISE( + auto history, + ValidationHistory(metadata, parent->snapshot_id, starting_snapshot_id, + kValidateAddedFilesOperations, ManifestContent::kData, io)); + auto new_snapshots = + std::make_shared>(std::move(history.snapshot_ids)); + ICEBERG_ASSIGN_OR_RAISE(auto group, MakeValidationManifestGroup( + metadata, io, std::move(history.manifests))); + group->CaseSensitive(case_sensitive) + .FilterManifestEntries([new_snapshots](const ManifestEntry& entry) { + return entry.snapshot_id.has_value() && + new_snapshots->contains(entry.snapshot_id.value()) && + entry.data_file != nullptr; + }) + .IgnoreDeleted() + .IgnoreExisting(); + if (data_filter != nullptr) { + group->FilterData(std::move(data_filter)); + } + FilterManifestEntriesByPartitionSet(*group, partition_set); + return group->Entries(); +} + +Result> MatchingDeletedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const PartitionSet* partition_set, + const std::shared_ptr& parent, const std::shared_ptr& io, + bool case_sensitive) { + if (parent == nullptr) { + return std::vector{}; + } + + ICEBERG_ASSIGN_OR_RAISE( + auto history, + ValidationHistory(metadata, parent->snapshot_id, starting_snapshot_id, + kValidateDataFilesExistOperations, ManifestContent::kData, io)); + auto new_snapshots = + std::make_shared>(std::move(history.snapshot_ids)); + ICEBERG_ASSIGN_OR_RAISE(auto group, MakeValidationManifestGroup( + metadata, io, std::move(history.manifests))); + group->CaseSensitive(case_sensitive) + .FilterManifestEntries([new_snapshots](const ManifestEntry& entry) { + return entry.snapshot_id.has_value() && + new_snapshots->contains(entry.snapshot_id.value()); + }) + .FilterManifestEntries([](const ManifestEntry& entry) { + return entry.status == ManifestStatus::kDeleted && entry.data_file != nullptr; + }) + .IgnoreExisting(); + if (data_filter != nullptr) { + group->FilterData(std::move(data_filter)); + } + FilterManifestEntriesByPartitionSet(*group, partition_set); + return group->Entries(); +} + +std::string FormatLocations(std::vector locations) { + std::string result = "["; + for (size_t i = 0; i < locations.size(); ++i) { + if (i > 0) { + result += ", "; + } + result += locations[i]; + } + result += "]"; + return result; +} + +std::vector DataFilePaths(const std::vector& entries) { + std::vector paths; + paths.reserve(entries.size()); + for (const auto& entry : entries) { + if (entry.data_file != nullptr) { + paths.push_back(entry.data_file->file_path); + } + } + return paths; +} + +std::optional DataFileLocations(const std::vector& entries) { + auto paths = DataFilePaths(entries); + if (paths.empty()) { + return std::optional{}; + } + return FormatLocations(std::move(paths)); +} + +std::optional DeleteFileLocations( + const std::vector>& delete_files) { + std::vector paths; + paths.reserve(delete_files.size()); + for (const auto& delete_file : delete_files) { + if (delete_file != nullptr) { + paths.push_back(delete_file->file_path); + } + } + if (paths.empty()) { + return std::optional{}; + } + return FormatLocations(std::move(paths)); +} + +Status ValidateAddedDVsInManifest( + const TableMetadata& metadata, const ManifestFile& manifest, + std::shared_ptr conflict_detection_filter, + const std::unordered_set& new_snapshot_ids, + const std::unordered_set& referenced_data_files, + const std::shared_ptr& io, const std::shared_ptr& schema, + bool case_sensitive) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, + metadata.PartitionSpecById(manifest.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto reader, ManifestReader::Make(manifest, io, schema, spec)); + reader->CaseSensitive(case_sensitive); + reader->FilterRows(std::move(conflict_detection_filter)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); + + for (const auto& entry : entries) { + if (!entry.snapshot_id.has_value() || + !new_snapshot_ids.contains(entry.snapshot_id.value())) { + continue; + } + if (entry.data_file == nullptr || !ContentFileUtil::IsDV(*entry.data_file) || + !entry.data_file->referenced_data_file.has_value()) { + continue; + } + if (referenced_data_files.contains(*entry.data_file->referenced_data_file)) { + return ValidationFailed("Found concurrently added DV for {}: {}", + *entry.data_file->referenced_data_file, + ContentFileUtil::DVDesc(*entry.data_file)); + } + } + return {}; +} + +} // namespace + +MergingSnapshotUpdate::MergingSnapshotUpdate(std::string table_name, + std::shared_ptr ctx) + : SnapshotUpdate(std::move(ctx)), + table_name_(std::move(table_name)), + delete_expression_(Expressions::AlwaysFalse()) { + auto file_io = ctx_->table->io(); + auto data_filter_manager = ManifestFilterManager::Make( + ManifestContent::kData, file_io, + [this](const std::string& location) { return DeleteFile(location); }); + if (!data_filter_manager.has_value()) { + AddError(data_filter_manager.error()); + } else { + data_filter_manager_ = std::move(data_filter_manager.value()); + } + + auto delete_filter_manager = ManifestFilterManager::Make( + ManifestContent::kDeletes, file_io, + [this](const std::string& location) { return DeleteFile(location); }); + if (!delete_filter_manager.has_value()) { + AddError(delete_filter_manager.error()); + } else { + delete_filter_manager_ = std::move(delete_filter_manager.value()); + } + + const int64_t target_size_bytes = + base().properties.Get(TableProperties::kManifestTargetSizeBytes); + const int32_t min_count_to_merge = + base().properties.Get(TableProperties::kManifestMinMergeCount); + const bool merge_enabled = + base().properties.Get(TableProperties::kManifestMergeEnabled); + auto data_merge_manager = ManifestMergeManager::Make( + ManifestContent::kData, target_size_bytes, min_count_to_merge, merge_enabled, + file_io, [this] { return SnapshotId(); }, + [this](const std::string& location) { return DeleteFile(location); }); + if (!data_merge_manager.has_value()) { + AddError(data_merge_manager.error()); + } else { + data_merge_manager_ = std::move(data_merge_manager.value()); + } + + auto delete_merge_manager = ManifestMergeManager::Make( + ManifestContent::kDeletes, target_size_bytes, min_count_to_merge, merge_enabled, + file_io, [this] { return SnapshotId(); }, + [this](const std::string& location) { return DeleteFile(location); }); + if (!delete_merge_manager.has_value()) { + AddError(delete_merge_manager.error()); + } else { + delete_merge_manager_ = std::move(delete_merge_manager.value()); + } +} + +// ------------------------------------------------------------------------- +// Primitive API +// ------------------------------------------------------------------------- + +Status MergingSnapshotUpdate::AddDataFile(std::shared_ptr file) { + if (!file) { + return InvalidArgument("Cannot add a null data file"); + } + if (!file->partition_spec_id.has_value()) { + return InvalidArgument("Data file must have a partition spec ID"); + } + + int32_t spec_id = file->partition_spec_id.value(); + ICEBERG_ASSIGN_OR_RAISE(auto spec, base().PartitionSpecById(spec_id)); + + // Suppress first_row_id in the staged copy. The commit assigns row IDs for newly + // added files and must not mutate the caller-owned file object. + auto staged_file = std::make_shared(*file); + staged_file->first_row_id = std::nullopt; + + auto& data_files = new_data_files_by_spec_[spec_id]; + auto [it, inserted] = data_files.insert(staged_file); + if (inserted) { + has_new_data_files_ = true; + ICEBERG_RETURN_UNEXPECTED(added_data_files_summary_.AddedFile(*spec, *staged_file)); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateNewDeleteFile(const TableMetadata& metadata, + const DataFile& file) { + if (file.content == DataFile::Content::kData) { + return InvalidArgument("Expected a delete file but got a data file: {}", + file.file_path); + } + const int8_t format_version = metadata.format_version; + const bool is_dv = ContentFileUtil::IsDV(file); + switch (format_version) { + case 1: + return InvalidArgument("Deletes are supported in V2 and above"); + case 2: + // Position deletes must NOT be DVs in v2. + if (file.content == DataFile::Content::kPositionDeletes && is_dv) { + return InvalidArgument("Must not use DVs for position deletes in V2: {}", + file.file_path); + } + break; + default: + if (format_version >= 3 && + format_version <= TableMetadata::kSupportedTableFormatVersion) { + // Position deletes MUST be DVs in v3+. + if (file.content == DataFile::Content::kPositionDeletes && !is_dv) { + return InvalidArgument("Must use DVs for position deletes in V{}: {}", + format_version, file.file_path); + } + } else { + return InvalidArgument("Unsupported format version: {}", format_version); + } + break; + } + return {}; +} + +Status MergingSnapshotUpdate::AddDeleteFile(std::shared_ptr file) { + return AddDeleteFile(std::move(file), std::nullopt); +} + +Status MergingSnapshotUpdate::AddDeleteFile(std::shared_ptr file, + int64_t data_sequence_number) { + return AddDeleteFile(std::move(file), std::optional(data_sequence_number)); +} + +void MergingSnapshotUpdate::PendingDeleteFilesByReferencedFile::Add( + std::string referenced_file, PendingDeleteFile file) { + auto [iter, inserted] = + index_by_referenced_file_.try_emplace(referenced_file, entries_.size()); + if (inserted) { + entries_.push_back(Entry{.referenced_file = std::move(referenced_file), .files = {}}); + } + entries_[iter->second].files.push_back(std::move(file)); +} + +Status MergingSnapshotUpdate::AddDeleteFile(std::shared_ptr file, + std::optional data_sequence_number) { + if (!file) { + return InvalidArgument("Cannot add a null delete file"); + } + ICEBERG_RETURN_UNEXPECTED(ValidateNewDeleteFile(base(), *file)); + if (!file->partition_spec_id.has_value()) { + return InvalidArgument("Delete file must have a partition spec ID"); + } + ICEBERG_RETURN_UNEXPECTED(base().PartitionSpecById(file->partition_spec_id.value())); + has_new_delete_files_ = true; + PendingDeleteFile pending_file{.file = std::move(file), + .data_sequence_number = std::move(data_sequence_number)}; + if (ContentFileUtil::IsDV(*pending_file.file)) { + ICEBERG_PRECHECK(pending_file.file->referenced_data_file.has_value(), + "DV must have a referenced data file: {}", + pending_file.file->file_path); + auto referenced_data_file = *pending_file.file->referenced_data_file; + dvs_by_referenced_file_.Add(std::move(referenced_data_file), std::move(pending_file)); + } else { + v2_deletes_.push_back(std::move(pending_file)); + } + return {}; +} + +Status MergingSnapshotUpdate::DeleteDataFile(std::shared_ptr file) { + if (!file) { + return InvalidArgument("Cannot delete a null data file"); + } + return data_filter_manager_->DeleteFile(std::move(file)); +} + +Status MergingSnapshotUpdate::DeleteDeleteFile(std::shared_ptr file) { + if (!file) { + return InvalidArgument("Cannot delete a null delete file"); + } + return delete_filter_manager_->DeleteFile(std::move(file)); +} + +Status MergingSnapshotUpdate::DeleteByPath(std::string_view path) { + return data_filter_manager_->DeleteFile(path); +} + +Status MergingSnapshotUpdate::DeleteByRowFilter(std::shared_ptr expr) { + // If a delete file matches the row filter, it can also be removed because the rows + // it references will also be deleted. Both filter managers receive the expression. + delete_expression_ = expr; + ICEBERG_RETURN_UNEXPECTED(data_filter_manager_->DeleteByRowFilter(expr)); + return delete_filter_manager_->DeleteByRowFilter(std::move(expr)); +} + +Status MergingSnapshotUpdate::DropPartition(int32_t spec_id, PartitionValues partition) { + // Dropping data in a partition also drops all delete files in that partition. + ICEBERG_RETURN_UNEXPECTED(data_filter_manager_->DropPartition(spec_id, partition)); + ICEBERG_RETURN_UNEXPECTED( + delete_filter_manager_->DropPartition(spec_id, std::move(partition))); + return {}; +} + +void MergingSnapshotUpdate::FailMissingDeletePaths() { + data_filter_manager_->FailMissingDeletePaths(); + delete_filter_manager_->FailMissingDeletePaths(); +} + +void MergingSnapshotUpdate::FailAnyDelete() { + data_filter_manager_->FailAnyDelete(); + delete_filter_manager_->FailAnyDelete(); +} + +void MergingSnapshotUpdate::SetNewDataFilesDataSequenceNumber(int64_t sequence_number) { + new_data_files_data_seq_number_ = sequence_number; +} + +void MergingSnapshotUpdate::CaseSensitive(bool case_sensitive) { + case_sensitive_ = case_sensitive; + data_filter_manager_->CaseSensitive(case_sensitive); + delete_filter_manager_->CaseSensitive(case_sensitive); +} + +void MergingSnapshotUpdate::SetSummaryProperty(const std::string& property, + const std::string& value) { + custom_summary_properties_[property] = value; + SnapshotUpdate::SetSummaryProperty(property, value); +} + +Result> MergingSnapshotUpdate::DataSpec() const { + if (new_data_files_by_spec_.empty()) { + return InvalidArgument("DataSpec() called before any data file was added"); + } + if (new_data_files_by_spec_.size() > 1) { + return InvalidArgument( + "DataSpec() requires exactly one partition spec; got {} different specs", + new_data_files_by_spec_.size()); + } + return base().PartitionSpecById(new_data_files_by_spec_.begin()->first); +} + +std::vector> MergingSnapshotUpdate::AddedDataFiles() const { + std::vector> result; + for (const auto& [spec_id, files] : new_data_files_by_spec_) { + for (const auto& file : files) { + result.push_back(file); + } + } + return result; +} + +Status MergingSnapshotUpdate::AddManifest(ManifestFile manifest) { + if (manifest.content != ManifestContent::kData) { + return InvalidArgument("Cannot append delete manifest: {}", manifest.manifest_path); + } + if (can_inherit_snapshot_id() && manifest.added_snapshot_id == kInvalidSnapshotId) { + if (manifest.first_row_id.has_value()) { + return InvalidArgument("Cannot append manifest with assigned first row ID: {}", + manifest.manifest_path); + } + appended_manifests_summary_.AddedManifest(manifest); + append_manifests_.push_back(std::move(manifest)); + } else { + ICEBERG_ASSIGN_OR_RAISE(auto copied, CopyManifest(manifest)); + rewritten_append_manifests_.push_back(std::move(copied)); + } + return {}; +} + +Result MergingSnapshotUpdate::CopyManifest(const ManifestFile& manifest) { + const TableMetadata& current = base(); + ICEBERG_ASSIGN_OR_RAISE(auto schema, SnapshotUtil::SchemaFor(current, target_branch())); + ICEBERG_ASSIGN_OR_RAISE(auto spec, + current.PartitionSpecById(manifest.partition_spec_id)); + std::string path = ManifestPath(); + return CopyAppendManifest(manifest, ctx_->table->io(), schema, spec, SnapshotId(), path, + current.format_version, &appended_manifests_summary_); +} + +// ------------------------------------------------------------------------- +// State queries +// ------------------------------------------------------------------------- + +bool MergingSnapshotUpdate::AddsDataFiles() const { + return !new_data_files_by_spec_.empty(); +} + +bool MergingSnapshotUpdate::AddsDeleteFiles() const { + return !v2_deletes_.empty() || !dvs_by_referenced_file_.empty(); +} + +bool MergingSnapshotUpdate::DeletesDataFiles() const { + return data_filter_manager_->ContainsDeletes(); +} + +bool MergingSnapshotUpdate::DeletesDeleteFiles() const { + return delete_filter_manager_->ContainsDeletes(); +} + +Status MergingSnapshotUpdate::ManagersReady() const { + ICEBERG_CHECK(data_filter_manager_ != nullptr, + "Data filter manager is not initialized"); + ICEBERG_CHECK(delete_filter_manager_ != nullptr, + "Delete filter manager is not initialized"); + ICEBERG_CHECK(data_merge_manager_ != nullptr, "Data merge manager is not initialized"); + ICEBERG_CHECK(delete_merge_manager_ != nullptr, + "Delete merge manager is not initialized"); + return {}; +} + +// ------------------------------------------------------------------------- +// Apply pipeline +// ------------------------------------------------------------------------- + +ManifestWriterFactory MergingSnapshotUpdate::MakeWriterFactory( + const std::shared_ptr& schema) { + return + [this, schema](int32_t spec_id, + ManifestContent content) -> Result> { + const TableMetadata& meta = base(); + ICEBERG_ASSIGN_OR_RAISE(auto spec, meta.PartitionSpecById(spec_id)); + std::string path = ManifestPath(); + return ManifestWriter::MakeWriter(meta.format_version, SnapshotId(), + std::move(path), ctx_->table->io(), + std::move(spec), schema, content); + }; +} + +Result> MergingSnapshotUpdate::WriteNewDataManifests() { + // If new files were staged after the cache was populated (commit retry), invalidate. + if (has_new_data_files_ && !cached_new_data_manifests_.empty()) { + for (const auto& m : cached_new_data_manifests_) { + std::ignore = DeleteFile(m.manifest_path); + } + cached_new_data_manifests_.clear(); + } + + if (!cached_new_data_manifests_.empty()) { + return cached_new_data_manifests_; + } + + std::vector result; + for (const auto& [spec_id, data_files] : new_data_files_by_spec_) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, base().PartitionSpecById(spec_id)); + ICEBERG_ASSIGN_OR_RAISE( + auto written, + WriteDataManifests(data_files.as_span(), spec, new_data_files_data_seq_number_)); + result.insert(result.end(), std::make_move_iterator(written.begin()), + std::make_move_iterator(written.end())); + } + + cached_new_data_manifests_ = result; + has_new_data_files_ = false; + return result; +} + +Result> +MergingSnapshotUpdate::MergeDVs() const { + std::vector result; + result.reserve(dvs_by_referenced_file_.size()); + + for (const auto& entry : dvs_by_referenced_file_.entries()) { + const auto& referenced_file = entry.referenced_file; + const auto& dvs = entry.files; + if (dvs.empty()) { + continue; + } + if (dvs.size() > 1) { + // TODO(Guotao): Merge duplicate DVs for one referenced data file once C++ + // has DVUtil/Puffin DV rewriting; Java merges them before writing manifests. + return NotImplemented( + "Merging multiple deletion vectors is not supported yet for referenced " + "data file: {}", + referenced_file); + } + + result.push_back(dvs.front()); + } + + return result; +} + +Result> MergingSnapshotUpdate::WriteNewDeleteManifests() { + // If new files were staged after the cache was populated (commit retry), invalidate. + if (has_new_delete_files_ && !cached_new_delete_manifests_.empty()) { + for (const auto& m : cached_new_delete_manifests_) { + std::ignore = DeleteFile(m.manifest_path); + } + cached_new_delete_manifests_.clear(); + added_delete_files_summary_.Clear(); + } + + if (!cached_new_delete_manifests_.empty()) { + return cached_new_delete_manifests_; + } + + ICEBERG_ASSIGN_OR_RAISE(auto merged_dvs, MergeDVs()); + + std::vector new_delete_files; + new_delete_files.reserve(merged_dvs.size() + v2_deletes_.size()); + new_delete_files.insert(new_delete_files.end(), merged_dvs.begin(), merged_dvs.end()); + + DeleteFileSet v2_delete_set; + for (const auto& pending_file : v2_deletes_) { + if (v2_delete_set.insert(pending_file.file).second) { + new_delete_files.push_back(pending_file); + } + } + + // Group delete files by partition spec ID, mirroring Java newDeleteFilesAsManifests(). + std::unordered_map> delete_files_by_spec; + for (const auto& pending_file : new_delete_files) { + delete_files_by_spec[pending_file.file->partition_spec_id.value()].push_back( + pending_file); + } + + std::vector result; + added_delete_files_summary_.Clear(); + for (auto& [spec_id, delete_files] : delete_files_by_spec) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, base().PartitionSpecById(spec_id)); + std::vector delete_entries; + delete_entries.reserve(delete_files.size()); + for (const auto& pending_file : delete_files) { + ICEBERG_RETURN_UNEXPECTED( + added_delete_files_summary_.AddedFile(*spec, *pending_file.file)); + delete_entries.push_back(ContentFileWithSequenceNumber{ + .file = pending_file.file, + .data_sequence_number = pending_file.data_sequence_number, + }); + } + ICEBERG_ASSIGN_OR_RAISE(auto written, WriteDeleteManifests(delete_entries, spec)); + result.insert(result.end(), std::make_move_iterator(written.begin()), + std::make_move_iterator(written.end())); + } + + cached_new_delete_manifests_ = result; + has_new_delete_files_ = false; + return result; +} + +Result> MergingSnapshotUpdate::Apply( + const TableMetadata& metadata_to_update, const std::shared_ptr& snapshot) { + ICEBERG_RETURN_UNEXPECTED(ManagersReady()); + + // Re-validate buffered delete files against the current format version. A format + // upgrade between staging and commit could make previously-valid files invalid. + for (const auto& pending_file : v2_deletes_) { + ICEBERG_RETURN_UNEXPECTED( + ValidateNewDeleteFile(metadata_to_update, *pending_file.file)); + } + for (const auto& entry : dvs_by_referenced_file_.entries()) { + for (const auto& pending_file : entry.files) { + ICEBERG_RETURN_UNEXPECTED( + ValidateNewDeleteFile(metadata_to_update, *pending_file.file)); + } + } + + ICEBERG_ASSIGN_OR_RAISE(auto target_schema, + SnapshotUtil::SchemaFor(metadata_to_update, target_branch())); + auto writer_factory = MakeWriterFactory(target_schema); + + // Step 1: Filter data manifests. + ICEBERG_ASSIGN_OR_RAISE(auto filtered_data, data_filter_manager_->FilterManifests( + target_schema, metadata_to_update, + snapshot, writer_factory)); + + // Step 2: Compute min data sequence number; set up delete filter cleanup. + // Skip unassigned manifests written in this Apply() call. + int64_t min_data_seq = metadata_to_update.last_sequence_number; + for (const auto& manifest : filtered_data) { + if (manifest.min_sequence_number != kUnassignedSequenceNumber) { + min_data_seq = std::min(min_data_seq, manifest.min_sequence_number); + } + } + ICEBERG_RETURN_UNEXPECTED( + delete_filter_manager_->DropDeleteFilesOlderThan(min_data_seq)); + delete_filter_manager_->RemoveDanglingDeletesFor( + data_filter_manager_->FilesToBeDeleted()); + + // Step 3: Filter delete manifests. + ICEBERG_ASSIGN_OR_RAISE(auto filtered_deletes, delete_filter_manager_->FilterManifests( + target_schema, metadata_to_update, + snapshot, writer_factory)); + + TableMetadataCache metadata_cache(&metadata_to_update); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); + ICEBERG_ASSIGN_OR_RAISE( + auto data_filter_summary, + data_filter_manager_->BuildSummary(filtered_data, specs_by_id.get())); + ICEBERG_ASSIGN_OR_RAISE( + auto delete_filter_summary, + delete_filter_manager_->BuildSummary(filtered_deletes, specs_by_id.get())); + + // Drop manifests with no live files - they carry no data and should not be merged + // into the new snapshot. Manifests written by the current snapshot are always kept + // regardless of live-file counts; the merge stage handles any that are empty. + int64_t snapshot_id = SnapshotId(); + auto should_keep = [snapshot_id](const ManifestFile& m) { + return m.has_added_files() || m.has_existing_files() || + m.added_snapshot_id == snapshot_id; + }; + + // Step 4: Write (or retrieve cached) new data manifests. + ICEBERG_ASSIGN_OR_RAISE(auto written_data_manifests, WriteNewDataManifests()); + + // Incorporate append manifests (from AddManifest), stamping each with the + // current snapshot ID. append_manifests_ are used directly (inherit path); + // rewritten_append_manifests_ were already copied with the snapshot ID. + std::vector new_data_manifests = std::move(written_data_manifests); + for (const auto& src : append_manifests_) { + ManifestFile m = src; + m.added_snapshot_id = snapshot_id; + new_data_manifests.push_back(std::move(m)); + } + for (const auto& src : rewritten_append_manifests_) { + ManifestFile m = src; + m.added_snapshot_id = snapshot_id; + new_data_manifests.push_back(std::move(m)); + } + + // Step 5: Write (or retrieve cached) new delete manifests. + ICEBERG_ASSIGN_OR_RAISE(auto new_delete_manifests, WriteNewDeleteManifests()); + + std::erase_if(new_data_manifests, + [&](const ManifestFile& m) { return !should_keep(m); }); + std::erase_if(filtered_data, [&](const ManifestFile& m) { return !should_keep(m); }); + std::erase_if(new_delete_manifests, + [&](const ManifestFile& m) { return !should_keep(m); }); + std::erase_if(filtered_deletes, [&](const ManifestFile& m) { return !should_keep(m); }); + + // Rebuild summary from stable sub-builders so that commit retries don't double-count. + summary_builder().Clear(); + summary_builder().Merge(added_data_files_summary_); + summary_builder().Merge(added_delete_files_summary_); + summary_builder().Merge(appended_manifests_summary_); + for (const auto& [property, value] : custom_summary_properties_) { + summary_builder().Set(property, value); + } + summary_builder().Merge(data_filter_summary); + summary_builder().Merge(delete_filter_summary); + + // Step 6: Merge data manifests. + ICEBERG_ASSIGN_OR_RAISE(auto merged_data, data_merge_manager_->MergeManifests( + filtered_data, new_data_manifests, + metadata_to_update, writer_factory)); + + // Step 7: Merge delete manifests. + ICEBERG_ASSIGN_OR_RAISE(auto merged_deletes, delete_merge_manager_->MergeManifests( + filtered_deletes, new_delete_manifests, + metadata_to_update, writer_factory)); + + std::vector result; + result.reserve(merged_data.size() + merged_deletes.size()); + result.insert(result.end(), std::make_move_iterator(merged_data.begin()), + std::make_move_iterator(merged_data.end())); + result.insert(result.end(), std::make_move_iterator(merged_deletes.begin()), + std::make_move_iterator(merged_deletes.end())); + + // Manifest count summary: unassigned manifests count as neither created nor kept. + int32_t manifests_created = 0; + int32_t manifests_kept = 0; + for (const auto& m : result) { + if (m.added_snapshot_id == snapshot_id) { + ++manifests_created; + } else if (m.added_snapshot_id != kInvalidSnapshotId) { + ++manifests_kept; + } + } + int32_t replaced_manifests_count = data_filter_manager_->ReplacedManifestsCount() + + delete_filter_manager_->ReplacedManifestsCount() + + data_merge_manager_->ReplacedManifestsCount() + + delete_merge_manager_->ReplacedManifestsCount(); + summary_builder().Set(SnapshotSummaryFields::kManifestsCreated, + std::to_string(manifests_created)); + summary_builder().Set(SnapshotSummaryFields::kManifestsKept, + std::to_string(manifests_kept)); + summary_builder().Set(SnapshotSummaryFields::kManifestsReplaced, + std::to_string(replaced_manifests_count)); + + return result; +} + +Status MergingSnapshotUpdate::CleanUncommitted( + const std::unordered_set& committed) { + ICEBERG_RETURN_UNEXPECTED(ManagersReady()); + ICEBERG_RETURN_UNEXPECTED(data_merge_manager_->CleanUncommitted(committed)); + ICEBERG_RETURN_UNEXPECTED(data_filter_manager_->CleanUncommitted(committed)); + ICEBERG_RETURN_UNEXPECTED(delete_merge_manager_->CleanUncommitted(committed)); + ICEBERG_RETURN_UNEXPECTED(delete_filter_manager_->CleanUncommitted(committed)); + ICEBERG_RETURN_UNEXPECTED(CleanUncommittedAppends(committed)); + return {}; +} + +Status MergingSnapshotUpdate::CleanUncommittedAppends( + const std::unordered_set& committed) { + ICEBERG_RETURN_UNEXPECTED( + DeleteUncommitted(cached_new_data_manifests_, committed, /*clear=*/true)); + ICEBERG_RETURN_UNEXPECTED( + DeleteUncommitted(cached_new_delete_manifests_, committed, /*clear=*/true)); + // rewritten_append_manifests_ are always owned by the table. + ICEBERG_RETURN_UNEXPECTED( + DeleteUncommitted(rewritten_append_manifests_, committed, /*clear=*/false)); + + // append_manifests_ are only owned by the table if the commit succeeded. + if (!committed.empty()) { + ICEBERG_RETURN_UNEXPECTED( + DeleteUncommitted(append_manifests_, committed, /*clear=*/false)); + } + + has_new_data_files_ = false; + has_new_delete_files_ = false; + return {}; +} + +Status MergingSnapshotUpdate::DeleteUncommitted( + std::vector& manifests, + const std::unordered_set& committed, bool clear) { + for (const auto& manifest : manifests) { + if (!committed.contains(manifest.manifest_path)) { + std::ignore = DeleteFile(manifest.manifest_path); + } + } + if (clear) { + manifests.clear(); + } + return {}; +} + +std::unordered_map MergingSnapshotUpdate::Summary() { + summary_builder().SetPartitionSummaryLimit( + base().properties.Get(TableProperties::kWritePartitionSummaryLimit)); + return summary_builder().Build(); +} + +// ------------------------------------------------------------------------- +// Conflict-detection helpers +// ------------------------------------------------------------------------- + +Status MergingSnapshotUpdate::ValidateAddedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const std::shared_ptr& parent, + std::shared_ptr io, bool case_sensitive) { + ICEBERG_ASSIGN_OR_RAISE( + auto conflict_entries, + MatchingAddedDataFiles(metadata, starting_snapshot_id, data_filter, + /*partition_set=*/nullptr, parent, io, case_sensitive)); + auto conflict_paths = DataFileLocations(conflict_entries); + if (conflict_paths.has_value()) { + return ValidationFailed( + "Found conflicting files that can contain records matching {}: {}", + data_filter != nullptr ? data_filter->ToString() : "any expression", + conflict_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateDataFilesExist( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const std::unordered_set& file_paths, bool skip_deletes, + std::shared_ptr conflict_detection_filter, + const std::shared_ptr& parent, std::shared_ptr io, + bool /*case_sensitive*/) { + if (parent == nullptr || file_paths.empty()) { + return {}; + } + + std::span matching_operations = + skip_deletes + ? std::span(kValidateDataFilesExistSkipDeleteOperations) + : std::span(kValidateDataFilesExistOperations); + ICEBERG_ASSIGN_OR_RAISE( + auto history, ValidationHistory(metadata, parent->snapshot_id, starting_snapshot_id, + matching_operations, ManifestContent::kData, io)); + + ICEBERG_ASSIGN_OR_RAISE(auto group, MakeValidationManifestGroup( + metadata, io, std::move(history.manifests))); + group->IgnoreExisting(); + group->FilterManifestEntries([&history, &file_paths](const ManifestEntry& entry) { + return entry.status != ManifestStatus::kAdded && entry.snapshot_id.has_value() && + history.snapshot_ids.contains(entry.snapshot_id.value()) && + entry.data_file != nullptr && file_paths.contains(entry.data_file->file_path); + }); + if (conflict_detection_filter != nullptr) { + group->FilterData(std::move(conflict_detection_filter)); + } + + ICEBERG_ASSIGN_OR_RAISE(auto entries, group->Entries()); + auto deleted_paths = DataFileLocations(entries); + if (deleted_paths.has_value()) { + return ValidationFailed("Cannot commit, missing data files: {}", + deleted_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const DataFileSet& replaced_files, const std::shared_ptr& parent, + std::shared_ptr io, bool ignore_equality_deletes) { + if (parent == nullptr || replaced_files.empty() || metadata.format_version < 2) { + return {}; + } + + ICEBERG_ASSIGN_OR_RAISE(auto deletes, + AddedDeleteFiles(metadata, starting_snapshot_id, + /*data_filter=*/nullptr, + /*partition_set=*/nullptr, parent, io)); + + ICEBERG_ASSIGN_OR_RAISE(auto starting_sequence_number, + StartingSequenceNumber(metadata, starting_snapshot_id)); + + for (const auto& data_file : replaced_files) { + ICEBERG_ASSIGN_OR_RAISE(auto delete_files, + deletes->ForDataFile(starting_sequence_number, *data_file)); + if (ignore_equality_deletes) { + // Only fail on position deletes — equality deletes at higher sequence numbers + // still apply to the rewritten files and are not a conflict. + for (const auto& df : delete_files) { + if (df->content == DataFile::Content::kPositionDeletes) { + return ValidationFailed( + "Cannot commit, found new position delete for replaced data file: {}", + data_file->file_path); + } + } + } else { + if (!delete_files.empty()) { + return ValidationFailed( + "Cannot commit, found new delete for replaced data file: {}", + data_file->file_path); + } + } + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateAddedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const PartitionSet& partition_set, const std::shared_ptr& parent, + std::shared_ptr io) { + ICEBERG_ASSIGN_OR_RAISE( + auto conflict_entries, + MatchingAddedDataFiles(metadata, starting_snapshot_id, + /*data_filter=*/nullptr, &partition_set, parent, io, + /*case_sensitive=*/true)); + auto conflict_paths = DataFileLocations(conflict_entries); + if (conflict_paths.has_value()) { + return ValidationFailed( + "Found conflicting files that can contain records matching validated " + "partitions: {}", + conflict_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const DataFileSet& replaced_files, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive) { + if (parent == nullptr || replaced_files.empty() || metadata.format_version < 2) { + return {}; + } + + ICEBERG_ASSIGN_OR_RAISE( + auto deletes, + AddedDeleteFiles(metadata, starting_snapshot_id, std::move(data_filter), + /*partition_set=*/nullptr, parent, io, case_sensitive)); + + ICEBERG_ASSIGN_OR_RAISE(auto starting_sequence_number, + StartingSequenceNumber(metadata, starting_snapshot_id)); + + for (const auto& data_file : replaced_files) { + ICEBERG_ASSIGN_OR_RAISE(auto delete_files, + deletes->ForDataFile(starting_sequence_number, *data_file)); + if (!delete_files.empty()) { + return ValidationFailed( + "Cannot commit, found new delete for replaced data file: {}", + data_file->file_path); + } + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateNoNewDeleteFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const std::shared_ptr& parent, + std::shared_ptr io, bool case_sensitive) { + std::string data_filter_text = + data_filter != nullptr ? data_filter->ToString() : "any expression"; + ICEBERG_ASSIGN_OR_RAISE( + auto deletes, + AddedDeleteFiles(metadata, starting_snapshot_id, std::move(data_filter), + /*partition_set=*/nullptr, parent, io, case_sensitive)); + auto referenced_delete_files = deletes->ReferencedDeleteFiles(); + auto delete_paths = DeleteFileLocations(referenced_delete_files); + if (delete_paths.has_value()) { + return ValidationFailed( + "Found new conflicting delete files that can apply to records matching {}: {}", + data_filter_text, delete_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateNoNewDeleteFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const PartitionSet& partition_set, const std::shared_ptr& parent, + std::shared_ptr io) { + ICEBERG_ASSIGN_OR_RAISE( + auto deletes, + AddedDeleteFiles(metadata, starting_snapshot_id, + /*data_filter=*/nullptr, + std::make_shared(partition_set), parent, io)); + auto referenced_delete_files = deletes->ReferencedDeleteFiles(); + auto delete_paths = DeleteFileLocations(referenced_delete_files); + if (delete_paths.has_value()) { + return ValidationFailed( + "Found new conflicting delete files that can apply to records matching " + "validated partitions: {}", + delete_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateDeletedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const std::shared_ptr& parent, + std::shared_ptr io, bool case_sensitive) { + ICEBERG_ASSIGN_OR_RAISE( + auto conflict_entries, + MatchingDeletedDataFiles(metadata, starting_snapshot_id, data_filter, + /*partition_set=*/nullptr, parent, io, case_sensitive)); + auto conflict_paths = DataFileLocations(conflict_entries); + if (conflict_paths.has_value()) { + return ValidationFailed( + "Found conflicting deleted files that can contain records matching {}: {}", + data_filter != nullptr ? data_filter->ToString() : "any expression", + conflict_paths.value()); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateDeletedDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const PartitionSet& partition_set, const std::shared_ptr& parent, + std::shared_ptr io) { + ICEBERG_ASSIGN_OR_RAISE( + auto conflict_entries, + MatchingDeletedDataFiles(metadata, starting_snapshot_id, + /*data_filter=*/nullptr, &partition_set, parent, io, + /*case_sensitive=*/true)); + auto conflict_paths = DataFileLocations(conflict_entries); + if (conflict_paths.has_value()) { + return ValidationFailed( + "Found conflicting deleted files that can apply to records matching " + "validated partitions: {}", + conflict_paths.value()); + } + return {}; +} + +Result> MergingSnapshotUpdate::AddedDeleteFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, std::shared_ptr partition_set, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive) { + if (parent == nullptr || metadata.format_version < 2) { + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, PartitionSpecsByIdMap(metadata)); + ICEBERG_ASSIGN_OR_RAISE( + auto builder, + DeleteFileIndex::BuilderFor(io, std::move(schema), std::move(specs_by_id), + /*delete_manifests=*/{})); + return builder.Build(); + } + + ICEBERG_ASSIGN_OR_RAISE( + auto history, ValidationHistory(metadata, parent->snapshot_id, starting_snapshot_id, + kValidateAddedDeleteFilesOperations, + ManifestContent::kDeletes, io)); + + ICEBERG_ASSIGN_OR_RAISE(auto starting_sequence_number, + StartingSequenceNumber(metadata, starting_snapshot_id)); + return BuildDeleteFileIndex(metadata, io, std::move(history.manifests), + starting_sequence_number, std::move(data_filter), + std::move(partition_set), case_sensitive); +} + +Status MergingSnapshotUpdate::ValidateAddedDVs( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr conflict_detection_filter, + const std::unordered_set& referenced_data_files, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive) { + if (parent == nullptr || referenced_data_files.empty()) { + return {}; + } + + ICEBERG_ASSIGN_OR_RAISE( + auto history, + ValidationHistory(metadata, parent->snapshot_id, starting_snapshot_id, + kValidateAddedDVsOperations, ManifestContent::kDeletes, io)); + ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); + + ICEBERG_ASSIGN_OR_RAISE(auto matching_manifests, + FilterManifestsByPartition(metadata, conflict_detection_filter, + history.manifests, case_sensitive)); + for (const auto& manifest : matching_manifests) { + if (!manifest.has_added_files()) { + continue; + } + ICEBERG_RETURN_UNEXPECTED(ValidateAddedDVsInManifest( + metadata, manifest, conflict_detection_filter, history.snapshot_ids, + referenced_data_files, io, schema, case_sensitive)); + } + return {}; +} + +Status MergingSnapshotUpdate::ValidateAddedDVs( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr conflict_filter, const std::shared_ptr& parent, + std::shared_ptr io) const { + if (parent == nullptr) { + return {}; + } + + std::unordered_set referenced_data_files; + for (const auto& entry : dvs_by_referenced_file_.entries()) { + referenced_data_files.insert(entry.referenced_file); + } + if (referenced_data_files.empty()) { + return {}; + } + return ValidateAddedDVs(metadata, starting_snapshot_id, std::move(conflict_filter), + referenced_data_files, parent, std::move(io), case_sensitive_); +} + +} // namespace iceberg diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h new file mode 100644 index 000000000..5d4e128e9 --- /dev/null +++ b/src/iceberg/update/merging_snapshot_update.h @@ -0,0 +1,385 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/update/merging_snapshot_update.h + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/delete_file_index.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/manifest/manifest_filter_manager.h" +#include "iceberg/manifest/manifest_merge_manager.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/snapshot_update.h" +#include "iceberg/util/data_file_set.h" + +namespace iceberg { + +/// \brief Abstract base class for all merge-based snapshot write operations. +/// +/// Provides the complete filter → write → merge pipeline that all merge-based +/// operations (MergeAppend, OverwriteFiles, RowDelta, ReplacePartitions, +/// RewriteFiles) share. Subclasses only need to implement `operation()` and +/// call the protected primitive API to describe what changes to make. +/// +/// The Apply() pipeline: +/// 1. Filter data manifests (via data_filter_manager_) +/// 2. Compute min data sequence number and set up delete filter cleanup +/// 3. Filter delete manifests (via delete_filter_manager_) +/// 4. Write new data manifests (cached for commit retry) +/// 5. Write new delete manifests (cached for commit retry) +/// 6. Merge data manifests (via data_merge_manager_) +/// 7. Merge delete manifests (via delete_merge_manager_) +/// +/// TODO(Guotao): Java MergingSnapshotProducer overrides updateEvent() to return a +/// CreateSnapshotEvent(tableName, operation, snapshotId, sequenceNumber, summary) +/// for commit listeners. The C++ update framework does not yet have an event +/// notification mechanism, so this is intentionally not implemented here. Add it +/// once an equivalent CreateSnapshotEvent / listener facility exists. +class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { + public: + ~MergingSnapshotUpdate() override = default; + + // SnapshotUpdate overrides + Result> Apply( + const TableMetadata& metadata_to_update, + const std::shared_ptr& snapshot) override; + + Status CleanUncommitted(const std::unordered_set& committed) override; + + std::unordered_map Summary() override; + + protected: + /// \brief Constructor; reads merge configuration from table properties. + explicit MergingSnapshotUpdate(std::string table_name, + std::shared_ptr ctx); + + /// \brief Stage a data file to be added to the table. + Status AddDataFile(std::shared_ptr file); + + /// \brief Stage a delete file to be added to the table. + Status AddDeleteFile(std::shared_ptr file); + + /// \brief Validate a delete file against the table format version rules. + /// + /// - Format v1: deletes are not supported. + /// - Format v2: position deletes must NOT be deletion vectors (DVs). + /// - Format v3+: position deletes MUST be deletion vectors (DVs). + Status ValidateNewDeleteFile(const TableMetadata& metadata, const DataFile& file); + + /// \brief Stage a delete file with an explicit data sequence number. + /// + Status AddDeleteFile(std::shared_ptr file, int64_t data_sequence_number); + + /// \brief Add all files in a pre-existing data manifest to the new snapshot. + /// + /// The manifest must contain DATA content. If snapshot ID inheritance is + /// enabled and the manifest has no snapshot ID assigned, it is used directly; + /// otherwise it is copied with the current snapshot ID. + Status AddManifest(ManifestFile manifest); + + /// \brief Register a data file (by object) to be deleted from the table. + Status DeleteDataFile(std::shared_ptr file); + + /// \brief Register a delete file (by object) to be removed from the table. + Status DeleteDeleteFile(std::shared_ptr file); + + /// \brief Register a data file path to be deleted from the table. + /// + /// \note Only applies to data files. To remove delete files, use DeleteDeleteFile(). + Status DeleteByPath(std::string_view path); + + /// \brief Register an expression to delete matching rows. + /// + /// Both data and delete filter managers receive the expression: delete files that + /// match the row filter can also be removed because those rows will be deleted. + Status DeleteByRowFilter(std::shared_ptr expr); + + /// \brief Register a partition to be dropped. + /// + /// Both data and delete filter managers receive the partition drop, since dropping + /// data in a partition also drops all delete files in that partition. + Status DropPartition(int32_t spec_id, PartitionValues partition); + + /// \brief Fail if any registered delete path is not found in any manifest. + void FailMissingDeletePaths(); + + /// \brief Fail if any manifest entry matches a delete condition. + void FailAnyDelete(); + + /// \brief Override the data sequence number assigned to all newly-added data files. + void SetNewDataFilesDataSequenceNumber(int64_t sequence_number); + + /// \brief Set case sensitivity for row filter and expression evaluation. + void CaseSensitive(bool case_sensitive); + + /// \brief Returns true if case-sensitive matching is enabled (default: true). + bool IsCaseSensitive() const { return case_sensitive_; } + + /// \brief Returns true if any data files have been staged for addition. + bool AddsDataFiles() const; + + /// \brief Returns true if any delete files have been staged for addition. + bool AddsDeleteFiles() const; + + /// \brief Returns true if any data files have been registered for deletion. + bool DeletesDataFiles() const; + + /// \brief Returns true if any delete files have been registered for removal. + bool DeletesDeleteFiles() const; + + /// \brief Returns the row-filter expression set via DeleteByRowFilter, or nullptr. + const std::shared_ptr& RowFilter() const { return delete_expression_; } + + /// \brief Returns the single partition spec for all staged data files. + /// + /// Precondition: exactly one partition spec ID must be represented among staged + /// data files. + Result> DataSpec() const; + + /// \brief Returns all data files staged for addition. + std::vector> AddedDataFiles() const; + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a data file matching the given filter expression. + static Status ValidateAddedDataFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + std::shared_ptr filter, + const std::shared_ptr& parent, + std::shared_ptr io, + bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a data file in any partition of the given partition + /// set. + static Status ValidateAddedDataFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, removed a file whose path is in file_paths (and + /// skip_deletes is false). + static Status ValidateDataFilesExist( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const std::unordered_set& file_paths, bool skip_deletes, + std::shared_ptr filter, const std::shared_ptr& parent, + std::shared_ptr io, bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a delete file that covers a file in replaced_files. + /// + /// Whether equality deletes are checked is derived automatically from whether + /// a custom data sequence number was set via SetNewDataFilesDataSequenceNumber(): + /// if set, equality deletes are ignored because they still apply to the rewritten + /// files and are not a conflict. + /// + /// Subclasses should prefer this overload over the static one. + Status ValidateNoNewDeletesForDataFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + const DataFileSet& replaced_files, + const std::shared_ptr& parent, + std::shared_ptr io) const { + const bool ignore_equality_deletes = new_data_files_data_seq_number_.has_value(); + return ValidateNoNewDeletesForDataFiles(metadata, starting_snapshot_id, + replaced_files, parent, io, + ignore_equality_deletes); + } + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a delete file that covers a file in replaced_files. + /// + /// \param ignore_equality_deletes If true, only position deletes are checked. + /// Set to true when replaced data files have the same sequence number as the + /// new files (e.g. RewriteFiles), so equality deletes at higher sequence numbers + /// still apply and are not a conflict. + static Status ValidateNoNewDeletesForDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + const DataFileSet& replaced_files, const std::shared_ptr& parent, + std::shared_ptr io, bool ignore_equality_deletes = false); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a delete file matching the data filter that covers a + /// file in replaced_files. + static Status ValidateNoNewDeletesForDataFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, const DataFileSet& replaced_files, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a delete file matching the given row filter. + /// + static Status ValidateNoNewDeleteFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + std::shared_ptr data_filter, + const std::shared_ptr& parent, + std::shared_ptr io, + bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a delete file matching any partition in the given + /// partition set. + static Status ValidateNoNewDeleteFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, deleted a data file matching the given row filter. + static Status ValidateDeletedDataFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + std::shared_ptr data_filter, + const std::shared_ptr& parent, + std::shared_ptr io, + bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, deleted a data file in any partition of the given partition + /// set. + static Status ValidateDeletedDataFiles(const TableMetadata& metadata, + std::optional starting_snapshot_id, + const PartitionSet& partition_set, + const std::shared_ptr& parent, + std::shared_ptr io); + + /// \brief Build a DeleteFileIndex of delete files added since starting_snapshot_id. + static Result> AddedDeleteFiles( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr data_filter, + std::shared_ptr partition_set, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive = true); + + /// \brief Return an error if any snapshot after starting_snapshot_id, or from + /// the beginning if unset, added a deletion vector that conflicts with DVs being + /// written. + static Status ValidateAddedDVs( + const TableMetadata& metadata, std::optional starting_snapshot_id, + std::shared_ptr conflict_filter, + const std::unordered_set& referenced_data_files, + const std::shared_ptr& parent, std::shared_ptr io, + bool case_sensitive = true); + + private: + struct PendingDeleteFile { + std::shared_ptr file; + std::optional data_sequence_number; + }; + + /// \brief Ordered map from referenced data file path to pending DVs. + /// + /// Mirrors Java's LinkedHashMap-backed dvsByReferencedFile: lookup is by + /// referenced data file, and iteration preserves the first-seen key order. + struct PendingDeleteFilesByReferencedFile { + struct Entry { + std::string referenced_file; + std::vector files; + }; + + void Add(std::string referenced_file, PendingDeleteFile file); + bool empty() const { return entries_.empty(); } + size_t size() const { return entries_.size(); } + const std::vector& entries() const { return entries_; } + + private: + std::vector entries_; + std::unordered_map index_by_referenced_file_; + }; + + ManifestWriterFactory MakeWriterFactory(const std::shared_ptr& schema); + + /// \brief Copy a manifest with the current snapshot ID, for use when snapshot + /// ID inheritance is not possible. + Result CopyManifest(const ManifestFile& manifest); + + Status AddDeleteFile(std::shared_ptr file, + std::optional data_sequence_number); + + Status ValidateAddedDVs(const TableMetadata& metadata, + std::optional starting_snapshot_id, + std::shared_ptr conflict_filter, + const std::shared_ptr& parent, + std::shared_ptr io) const; + + Status ManagersReady() const; + + void SetSummaryProperty(const std::string& property, const std::string& value) override; + + Result> MergeDVs() const; + + /// \brief Write new data manifests for staged data files; caches the result. + Result> WriteNewDataManifests(); + + /// \brief Write new delete manifests for staged delete files; caches the result. + Result> WriteNewDeleteManifests(); + + Status CleanUncommittedAppends(const std::unordered_set& committed); + + Status DeleteUncommitted(std::vector& manifests, + const std::unordered_set& committed, bool clear); + + // Used for commit event notifications and diagnostic log messages. + std::string table_name_; + std::shared_ptr delete_expression_; + bool case_sensitive_ = true; + + // Stable sub-builders for added files — accumulated across retries and merged + // into summary_builder_ at the start of each Apply() call. + SnapshotSummaryBuilder added_data_files_summary_; + SnapshotSummaryBuilder added_delete_files_summary_; + SnapshotSummaryBuilder appended_manifests_summary_; + std::unordered_map custom_summary_properties_; + + std::unique_ptr data_filter_manager_; + std::unique_ptr delete_filter_manager_; + std::unique_ptr data_merge_manager_; + std::unique_ptr delete_merge_manager_; + + std::unordered_map new_data_files_by_spec_; + std::vector v2_deletes_; + PendingDeleteFilesByReferencedFile dvs_by_referenced_file_; + std::optional new_data_files_data_seq_number_; + + // Manifests passed via AddManifest(): inherit path (no copy needed) and + // rewrite path (must be copied with the current snapshot ID). + std::vector append_manifests_; + std::vector rewritten_append_manifests_; + + // Set to true when new files are staged after the cache was populated, so the + // cache is invalidated and re-written on the next Apply() call (commit retry). + bool has_new_data_files_ = false; + bool has_new_delete_files_ = false; + + std::vector cached_new_data_manifests_; + std::vector cached_new_delete_manifests_; +}; + +} // namespace iceberg diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 6acb007a1..6405f603f 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -19,6 +19,7 @@ install_headers( [ 'expire_snapshots.h', 'fast_append.h', + 'merging_snapshot_update.h', 'pending_update.h', 'set_snapshot.h', 'snapshot_manager.h', diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index a59ebdc72..bb5376fa8 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -41,28 +41,34 @@ namespace iceberg { namespace { -// The Java impl skips updating total if parsing fails. Here we choose to be strict. Status UpdateTotal(std::unordered_map& summary, const std::unordered_map& previous_summary, const std::string& total_property, const std::string& added_property, const std::string& deleted_property) { auto total_it = previous_summary.find(total_property); if (total_it != previous_summary.end()) { - ICEBERG_ASSIGN_OR_RAISE(auto new_total, - StringUtils::ParseNumber(total_it->second)); + auto parsed_total = StringUtils::ParseNumber(total_it->second); + if (!parsed_total.has_value()) { + return {}; + } + int64_t new_total = parsed_total.value(); auto added_it = summary.find(added_property); if (new_total >= 0 && added_it != summary.end()) { - ICEBERG_ASSIGN_OR_RAISE(auto added_value, - StringUtils::ParseNumber(added_it->second)); - new_total += added_value; + auto parsed_added = StringUtils::ParseNumber(added_it->second); + if (!parsed_added.has_value()) { + return {}; + } + new_total += parsed_added.value(); } auto deleted_it = summary.find(deleted_property); if (new_total >= 0 && deleted_it != summary.end()) { - ICEBERG_ASSIGN_OR_RAISE(auto deleted_value, - StringUtils::ParseNumber(deleted_it->second)); - new_total -= deleted_value; + auto parsed_deleted = StringUtils::ParseNumber(deleted_it->second); + if (!parsed_deleted.has_value()) { + return {}; + } + new_total -= parsed_deleted.value(); } if (new_total >= 0) { @@ -163,6 +169,11 @@ SnapshotUpdate::SnapshotUpdate(std::shared_ptr ctx) target_manifest_size_bytes_( base().properties.Get(TableProperties::kManifestTargetSizeBytes)) {} +void SnapshotUpdate::SetSummaryProperty(const std::string& property, + const std::string& value) { + summary_.Set(property, value); +} + // TODO(xxx): write manifests in parallel Result> SnapshotUpdate::WriteDataManifests( std::span> files, @@ -178,8 +189,7 @@ Result> SnapshotUpdate::WriteDataManifests( snapshot_id = SnapshotId()]() -> Result> { return ManifestWriter::MakeWriter( base().format_version, snapshot_id, ManifestPath(), ctx_->table->io(), - std::move(spec), std::move(schema), ManifestContent::kData, - /*first_row_id=*/base().next_row_id); + std::move(spec), std::move(schema), ManifestContent::kData); }, target_manifest_size_bytes_); @@ -192,7 +202,7 @@ Result> SnapshotUpdate::WriteDataManifests( // TODO(xxx): write manifests in parallel Result> SnapshotUpdate::WriteDeleteManifests( - std::span> files, + std::span files, const std::shared_ptr& spec) { if (files.empty()) { return std::vector{}; @@ -208,10 +218,9 @@ Result> SnapshotUpdate::WriteDeleteManifests( }, target_manifest_size_bytes_); - for (const auto& file : files) { - // FIXME: Java impl wrap it with `PendingDeleteFile` and deals with - // file->data_sequence_number - ICEBERG_RETURN_UNEXPECTED(rolling_writer.WriteAddedEntry(file)); + for (const auto& entry : files) { + ICEBERG_RETURN_UNEXPECTED( + rolling_writer.WriteAddedEntry(entry.file, entry.data_sequence_number)); } ICEBERG_RETURN_UNEXPECTED(rolling_writer.Close()); return rolling_writer.ToManifestFiles(); @@ -232,7 +241,7 @@ Result SnapshotUpdate::Apply() { std::ignore = DeleteFile(manifest_list); } manifest_lists_.clear(); - CleanUncommitted(std::unordered_set{}); + ICEBERG_RETURN_UNEXPECTED(CleanUncommitted(std::unordered_set{})); staged_snapshot_ = nullptr; summary_.Clear(); @@ -245,9 +254,7 @@ Result SnapshotUpdate::Apply() { std::optional parent_snapshot_id = parent_snapshot ? std::make_optional(parent_snapshot->snapshot_id) : std::nullopt; - if (parent_snapshot) { - ICEBERG_RETURN_UNEXPECTED(Validate(base(), parent_snapshot)); - } + ICEBERG_RETURN_UNEXPECTED(Validate(base(), parent_snapshot)); ICEBERG_ASSIGN_OR_RAISE(auto manifests, Apply(base(), parent_snapshot)); for (auto& manifest : manifests) { @@ -314,7 +321,7 @@ Status SnapshotUpdate::Finalize(Result commit_result) { if (commit_result.error().kind == ErrorKind::kCommitStateUnknown) { return {}; } - CleanAll(); + std::ignore = CleanAll(); return {}; } @@ -322,11 +329,14 @@ Status SnapshotUpdate::Finalize(Result commit_result) { ICEBERG_CHECK(staged_snapshot_ != nullptr, "Staged snapshot is null during finalize after commit"); auto cached_snapshot = SnapshotCache(staged_snapshot_.get()); - ICEBERG_ASSIGN_OR_RAISE(auto manifests, cached_snapshot.Manifests(ctx_->table->io())); - CleanUncommitted(manifests | std::views::transform([](const auto& manifest) { - return manifest.manifest_path; - }) | - std::ranges::to>()); + if (auto manifests = cached_snapshot.Manifests(ctx_->table->io()); + manifests.has_value()) { + std::ignore = CleanUncommitted(manifests.value() | + std::views::transform([](const auto& manifest) { + return manifest.manifest_path; + }) | + std::ranges::to>()); + } } // Also clean up unused manifest lists created by multiple attempts @@ -389,23 +399,20 @@ Result> SnapshotUpdate::ComputeSumm return summary; } -void SnapshotUpdate::CleanAll() { +Status SnapshotUpdate::CleanAll() { for (const auto& manifest_list : manifest_lists_) { std::ignore = DeleteFile(manifest_list); } manifest_lists_.clear(); - CleanUncommitted(std::unordered_set{}); + std::ignore = CleanUncommitted(std::unordered_set{}); + return {}; } Status SnapshotUpdate::DeleteFile(const std::string& path) { - static const auto kDefaultDeleteFunc = [this](const std::string& path) { - return this->ctx_->table->io()->DeleteFile(path); - }; if (delete_func_) { return delete_func_(path); - } else { - return kDefaultDeleteFunc(path); } + return ctx_->table->io()->DeleteFile(path); } std::string SnapshotUpdate::ManifestListPath() { diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index f48e5f44d..03a74e788 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -105,7 +105,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// \param value The property value /// \return Reference to this for method chaining auto& Set(this auto& self, const std::string& property, const std::string& value) { - self.summary_.Set(property, value); + static_cast(self).SetSummaryProperty(property, value); return self; } @@ -122,6 +122,11 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { Status Finalize(Result commit_result) override; protected: + struct ContentFileWithSequenceNumber { + std::shared_ptr file; + std::optional data_sequence_number; + }; + explicit SnapshotUpdate(std::shared_ptr ctx); /// \brief Write data manifests for the given data files @@ -135,13 +140,8 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { const std::shared_ptr& spec, std::optional data_sequence_number = std::nullopt); - /// \brief Write delete manifests for the given delete files - /// - /// \param files Delete files to write - /// \param spec The partition spec to use - /// \return A vector of manifest files Result> WriteDeleteManifests( - std::span> files, + std::span files, const std::shared_ptr& spec); const std::string& target_branch() const { return target_branch_; } @@ -161,7 +161,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// actually committed. /// /// \param committed A set of manifest paths that were actually committed - virtual void CleanUncommitted(const std::unordered_set& committed) = 0; + virtual Status CleanUncommitted(const std::unordered_set& committed) = 0; /// \brief A string that describes the action that produced the new snapshot. /// @@ -193,6 +193,12 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// \return A map of summary properties virtual std::unordered_map Summary() = 0; + /// \brief Set a summary property. + /// + /// Implementations may override this to retain custom properties across + /// retry-safe summary rebuilds. + virtual void SetSummaryProperty(const std::string& property, const std::string& value); + /// \brief Check if cleanup should happen after commit /// /// \return True if cleanup should happen after commit @@ -217,7 +223,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { const TableMetadata& previous); /// \brief Clean up all uncommitted files - void CleanAll(); + Status CleanAll(); protected: SnapshotSummaryBuilder summary_; diff --git a/src/iceberg/util/data_file_set.h b/src/iceberg/util/data_file_set.h index 741b34e56..93abdfff7 100644 --- a/src/iceberg/util/data_file_set.h +++ b/src/iceberg/util/data_file_set.h @@ -20,12 +20,15 @@ #pragma once /// \file iceberg/util/data_file_set.h -/// A set of DataFile pointers with insertion order preserved and deduplicated by file -/// path. +/// Sets of DataFile pointers with insertion order preserved and Iceberg-compatible +/// file identity deduplication. +#include #include #include +#include #include +#include #include #include #include @@ -46,6 +49,16 @@ class ICEBERG_EXPORT DataFileSet { using difference_type = typename std::vector::difference_type; DataFileSet() = default; + DataFileSet(const DataFileSet& other) : elements_(other.elements_) { RebuildIndex(); } + DataFileSet& operator=(const DataFileSet& other) { + if (this != &other) { + elements_ = other.elements_; + RebuildIndex(); + } + return *this; + } + DataFileSet(DataFileSet&&) noexcept = default; + DataFileSet& operator=(DataFileSet&&) noexcept = default; /// \brief Insert a data file into the set. /// \param file The data file to insert @@ -58,6 +71,16 @@ class ICEBERG_EXPORT DataFileSet { return InsertImpl(std::move(file)); } + /// \brief Returns whether an equivalent data file exists in the set. + bool contains(const DataFile& file) const { + return index_by_path_.contains(file.file_path); + } + + /// \brief Returns whether an equivalent data file exists in the set. + bool contains(const value_type& file) const { + return file != nullptr && contains(*file); + } + /// \brief Get the number of elements in the set. size_t size() const { return elements_.size(); } @@ -100,9 +123,146 @@ class ICEBERG_EXPORT DataFileSet { return {std::prev(elements_.end()), true}; } + void RebuildIndex() { + index_by_path_.clear(); + for (size_t i = 0; i < elements_.size(); ++i) { + if (elements_[i] != nullptr) { + index_by_path_.try_emplace(elements_[i]->file_path, i); + } + } + } + // Vector to preserve insertion order std::vector elements_; std::unordered_map index_by_path_; }; +/// \brief A set of delete-file pointers deduplicated by delete-file identity. +/// +/// Delete files, especially deletion vectors, are identified by location plus +/// content offset and content size. This mirrors Java's DeleteFileSet behavior. +class ICEBERG_EXPORT DeleteFileSet { + public: + using value_type = std::shared_ptr; + using iterator = typename std::vector::iterator; + using const_iterator = typename std::vector::const_iterator; + using difference_type = typename std::vector::difference_type; + + DeleteFileSet() = default; + DeleteFileSet(const DeleteFileSet& other) : elements_(other.elements_) { + RebuildIndex(); + } + DeleteFileSet& operator=(const DeleteFileSet& other) { + if (this != &other) { + elements_ = other.elements_; + RebuildIndex(); + } + return *this; + } + DeleteFileSet(DeleteFileSet&&) noexcept = default; + DeleteFileSet& operator=(DeleteFileSet&&) noexcept = default; + + /// \brief Insert a delete file into the set. + /// \param file The delete file to insert + /// \return A pair with an iterator to the inserted element (or the existing one) and + /// a bool indicating whether insertion took place + std::pair insert(const value_type& file) { return InsertImpl(file); } + + /// \brief Insert a delete file into the set (move version). + std::pair insert(value_type&& file) { + return InsertImpl(std::move(file)); + } + + /// \brief Returns whether an equivalent delete file exists in the set. + bool contains(const DataFile& file) const { + return index_by_file_.contains(DeleteFileKey(file)); + } + + /// \brief Returns whether an equivalent delete file exists in the set. + bool contains(const value_type& file) const { + return file != nullptr && contains(*file); + } + + /// \brief Get the number of elements in the set. + size_t size() const { return elements_.size(); } + + /// \brief Check if the set is empty. + bool empty() const { return elements_.empty(); } + + /// \brief Clear all elements from the set. + void clear() { + elements_.clear(); + index_by_file_.clear(); + } + + /// \brief Get iterator to the beginning. + iterator begin() { return elements_.begin(); } + const_iterator begin() const { return elements_.begin(); } + const_iterator cbegin() const { return elements_.cbegin(); } + + /// \brief Get iterator to the end. + iterator end() { return elements_.end(); } + const_iterator end() const { return elements_.end(); } + const_iterator cend() const { return elements_.cend(); } + + /// \brief Get a non-owning view of the delete files in insertion order. + std::span as_span() const { return elements_; } + + private: + struct DeleteFileKey { + explicit DeleteFileKey(const DataFile& file) + : path(file.file_path), + content_offset(file.content_offset), + content_size_in_bytes(file.content_size_in_bytes) {} + + std::string path; + std::optional content_offset; + std::optional content_size_in_bytes; + + bool operator==(const DeleteFileKey& other) const = default; + }; + + struct DeleteFileKeyHash { + size_t operator()(const DeleteFileKey& key) const { + size_t hash = std::hash{}(key.path); + auto combine = [&hash](const auto& value) { + size_t value_hash = value.has_value() ? std::hash{}(*value) : 0; + hash ^= value_hash + 0x9e3779b9 + (hash << 6) + (hash >> 2); + }; + combine(key.content_offset); + combine(key.content_size_in_bytes); + return hash; + } + }; + + std::pair InsertImpl(value_type file) { + if (!file) { + return {elements_.end(), false}; + } + + auto [index_iter, inserted] = + index_by_file_.try_emplace(DeleteFileKey(*file), elements_.size()); + if (!inserted) { + auto pos = static_cast(index_iter->second); + return {elements_.begin() + pos, false}; + } + + elements_.push_back(std::move(file)); + return {std::prev(elements_.end()), true}; + } + + void RebuildIndex() { + index_by_file_.clear(); + for (size_t i = 0; i < elements_.size(); ++i) { + if (elements_[i] != nullptr) { + index_by_file_.try_emplace(DeleteFileKey(*elements_[i]), i); + } + } + } + + // Vector to preserve insertion order. + std::vector elements_; + std::unordered_map index_by_file_; +}; + } // namespace iceberg From 17ae1648896419186ae7b8551a5eebfe65f5a57a Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 3 Jun 2026 11:57:44 +0800 Subject: [PATCH 055/151] chore: normalize license headers (#692) --- src/iceberg/file_io_registry.cc | 34 ++++++++++++++------------- src/iceberg/test/rest_file_io_test.cc | 34 ++++++++++++++------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/iceberg/file_io_registry.cc b/src/iceberg/file_io_registry.cc index ffba8677a..77ff4a9d7 100644 --- a/src/iceberg/file_io_registry.cc +++ b/src/iceberg/file_io_registry.cc @@ -1,19 +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. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ #include "iceberg/file_io_registry.h" diff --git a/src/iceberg/test/rest_file_io_test.cc b/src/iceberg/test/rest_file_io_test.cc index e9131da3f..c86df2753 100644 --- a/src/iceberg/test/rest_file_io_test.cc +++ b/src/iceberg/test/rest_file_io_test.cc @@ -1,19 +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. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ #include "iceberg/catalog/rest/rest_file_io.h" From 7d352f5eca23165db027b4e5140272496e1efd2a Mon Sep 17 00:00:00 2001 From: lishuxu Date: Thu, 4 Jun 2026 16:03:45 +0800 Subject: [PATCH 056/151] feat(rest): implement OAuth2 token auto-refresh for REST catalog (#646) Replace the MakeOAuth2 stub with a full OAuth2AuthSession that automatically refreshes tokens before expiration using the client_credentials grant. --- .github/workflows/test.yml | 2 +- src/iceberg/CMakeLists.txt | 1 + src/iceberg/catalog/rest/CMakeLists.txt | 1 + src/iceberg/catalog/rest/auth/auth_manager.cc | 12 +- src/iceberg/catalog/rest/auth/auth_session.cc | 257 +++++++++++++++++- src/iceberg/catalog/rest/auth/auth_session.h | 25 +- src/iceberg/catalog/rest/auth/oauth2_util.cc | 48 +++- src/iceberg/catalog/rest/auth/oauth2_util.h | 12 + .../rest/auth/token_refresh_scheduler.cc | 125 +++++++++ .../rest/auth/token_refresh_scheduler.h | 112 ++++++++ src/iceberg/catalog/rest/meson.build | 1 + src/iceberg/catalog/rest/rest_catalog.cc | 7 +- src/iceberg/meson.build | 1 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/auth_manager_test.cc | 143 ++++++++++ src/iceberg/test/base64_test.cc | 146 ++++++++++ src/iceberg/test/meson.build | 1 + src/iceberg/test/transform_util_test.cc | 26 -- src/iceberg/transform.cc | 3 +- src/iceberg/util/base64.cc | 161 +++++++++++ src/iceberg/util/base64.h | 69 +++++ src/iceberg/util/meson.build | 1 + src/iceberg/util/transform_util.cc | 50 ---- src/iceberg/util/transform_util.h | 4 - 24 files changed, 1100 insertions(+), 109 deletions(-) create mode 100644 src/iceberg/catalog/rest/auth/token_refresh_scheduler.cc create mode 100644 src/iceberg/catalog/rest/auth/token_refresh_scheduler.h create mode 100644 src/iceberg/test/base64_test.cc create mode 100644 src/iceberg/util/base64.cc create mode 100644 src/iceberg/util/base64.h diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d2e09fd2..ea0c94204 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -167,4 +167,4 @@ jobs: meson compile -C builddir - name: Test Iceberg run: | - meson test -C builddir --timeout-multiplier 0 + meson test -C builddir --timeout-multiplier 0 --print-errorlogs diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 38d85534a..b8af39bde 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -102,6 +102,7 @@ set(ICEBERG_SOURCES update/update_snapshot_reference.cc update/update_sort_order.cc update/update_statistics.cc + util/base64.cc util/bucket_util.cc util/content_file_util.cc util/conversions.cc diff --git a/src/iceberg/catalog/rest/CMakeLists.txt b/src/iceberg/catalog/rest/CMakeLists.txt index b862bc869..8fb2e93c0 100644 --- a/src/iceberg/catalog/rest/CMakeLists.txt +++ b/src/iceberg/catalog/rest/CMakeLists.txt @@ -23,6 +23,7 @@ set(ICEBERG_REST_SOURCES auth/auth_properties.cc auth/auth_session.cc auth/oauth2_util.cc + auth/token_refresh_scheduler.cc catalog_properties.cc endpoint.cc error_handlers.cc diff --git a/src/iceberg/catalog/rest/auth/auth_manager.cc b/src/iceberg/catalog/rest/auth/auth_manager.cc index 47370bd3b..247c1d538 100644 --- a/src/iceberg/catalog/rest/auth/auth_manager.cc +++ b/src/iceberg/catalog/rest/auth/auth_manager.cc @@ -25,8 +25,8 @@ #include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/auth/oauth2_util.h" +#include "iceberg/util/base64.h" #include "iceberg/util/macros.h" -#include "iceberg/util/transform_util.h" namespace iceberg::rest::auth { @@ -83,8 +83,7 @@ class BasicAuthManager : public AuthManager { "Missing required property '{}'", AuthProperties::kBasicPassword); std::string credential = username_it->second + ":" + password_it->second; return AuthSession::MakeDefault( - {{std::string(kAuthorizationHeader), - "Basic " + TransformUtil::Base64Encode(credential)}}); + {{std::string(kAuthorizationHeader), "Basic " + Base64::Encode(credential)}}); } }; @@ -130,7 +129,8 @@ class OAuth2Manager : public AuthManager { init_token_response_.reset(); return AuthSession::MakeOAuth2(token_response, config.oauth2_server_uri(), config.client_id(), config.client_secret(), - config.scope(), client); + config.scope(), config.keep_refreshed(), + config.optional_oauth_params(), client); } // If token is provided, use it directly. @@ -143,10 +143,10 @@ class OAuth2Manager : public AuthManager { auto base_session = AuthSession::MakeDefault(AuthHeaders(config.token())); OAuthTokenResponse token_response; ICEBERG_ASSIGN_OR_RAISE(token_response, FetchToken(client, *base_session, config)); - // TODO(lishuxu): should we directly pass config to the MakeOAuth2 call? return AuthSession::MakeOAuth2(token_response, config.oauth2_server_uri(), config.client_id(), config.client_secret(), - config.scope(), client); + config.scope(), config.keep_refreshed(), + config.optional_oauth_params(), client); } return AuthSession::MakeDefault({}); diff --git a/src/iceberg/catalog/rest/auth/auth_session.cc b/src/iceberg/catalog/rest/auth/auth_session.cc index 7251dc4a9..31688eedf 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.cc +++ b/src/iceberg/catalog/rest/auth/auth_session.cc @@ -19,9 +19,19 @@ #include "iceberg/catalog/rest/auth/auth_session.h" +#include +#include +#include +#include +#include +#include #include +#include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/oauth2_util.h" +#include "iceberg/catalog/rest/auth/token_refresh_scheduler.h" +#include "iceberg/catalog/rest/http_client.h" +#include "iceberg/util/macros.h" namespace iceberg::rest::auth { @@ -44,6 +54,229 @@ class DefaultAuthSession : public AuthSession { std::unordered_map headers_; }; +/// \brief OAuth2 session with automatic token refresh. +class OAuth2AuthSession : public AuthSession, + public std::enable_shared_from_this { + public: + struct Config { + std::string token_endpoint; + std::string client_id; + std::string client_secret; + std::string scope; + std::unordered_map optional_oauth_params; + bool keep_refreshed; + }; + + /// \brief Create an OAuth2 session and optionally schedule refresh. + static Result> Make( + const OAuthTokenResponse& initial_token, Config config, HttpClient& client) { + ICEBERG_ASSIGN_OR_RAISE(auto refresh_properties, MakeRefreshProperties(config)); + auto session = std::shared_ptr( + new OAuth2AuthSession(std::move(config), std::move(refresh_properties), client)); + session->SetInitialToken(initial_token); + return session; + } + + Status Authenticate(std::unordered_map& headers) override { + std::shared_lock lock(mutex_); + for (const auto& [key, value] : headers_) { + headers.try_emplace(key, value); + } + return {}; + } + + Status Close() override { return CloseImpl(); } + + ~OAuth2AuthSession() override { std::ignore = CloseImpl(); } + + private: + OAuth2AuthSession(Config config, AuthProperties refresh_properties, HttpClient& client) + : config_(std::move(config)), + refresh_properties_(std::move(refresh_properties)), + client_(client) {} + + Status CloseImpl() { + bool expected = false; + if (!closed_.compare_exchange_strong(expected, true)) { + return {}; // Already closed + } + TokenRefreshScheduler::Instance().Cancel(scheduled_task_id_.exchange(0)); + std::unique_lock lock(refresh_mutex_); + refresh_cv_.wait(lock, [this] { return active_refresh_count_ == 0; }); + TokenRefreshScheduler::Instance().Cancel(scheduled_task_id_.exchange(0)); + return {}; + } + + static Result MakeRefreshProperties(const Config& config) { + std::unordered_map properties = + config.optional_oauth_params; + properties[AuthProperties::kCredential.key()] = + config.client_id.empty() ? config.client_secret + : config.client_id + ":" + config.client_secret; + properties[AuthProperties::kScope.key()] = config.scope; + properties[AuthProperties::kOAuth2ServerUri.key()] = config.token_endpoint; + + return AuthProperties::FromProperties(properties); + } + + class RefreshAttemptGuard { + public: + explicit RefreshAttemptGuard(OAuth2AuthSession& session) : session_(session) { + std::lock_guard lock(session_.refresh_mutex_); + ++session_.active_refresh_count_; + } + + ~RefreshAttemptGuard() { + bool notify = false; + { + std::lock_guard lock(session_.refresh_mutex_); + notify = --session_.active_refresh_count_ == 0; + } + if (notify) { + session_.refresh_cv_.notify_all(); + } + } + + private: + OAuth2AuthSession& session_; + }; + + void SetInitialToken(const OAuthTokenResponse& token_response) { + token_ = token_response.access_token; + headers_ = {{std::string(kAuthorizationHeader), std::string(kBearerPrefix) + token_}}; + + // Determine expiration time + if (token_response.expires_in_secs.has_value()) { + expires_at_ = std::chrono::steady_clock::now() + + std::chrono::seconds(*token_response.expires_in_secs); + } else if (auto exp_ms = ExpiresAtMillis(token_); exp_ms.has_value()) { + // Convert absolute epoch millis to steady_clock time_point + auto now_sys = std::chrono::system_clock::now(); + auto now_steady = std::chrono::steady_clock::now(); + auto exp_sys = + std::chrono::system_clock::time_point(std::chrono::milliseconds(*exp_ms)); + expires_at_ = now_steady + (exp_sys - now_sys); + } + + if (config_.keep_refreshed && + expires_at_ != std::chrono::steady_clock::time_point{}) { + ScheduleRefresh(); + } + } + + void DoRefresh() { DoRefreshAttempt(0, std::chrono::milliseconds(200)); } + + /// \brief Single refresh attempt. On failure, schedules a retry via the + /// scheduler (non-blocking) instead of sleeping on the worker thread. + void DoRefreshAttempt(int attempt, std::chrono::milliseconds backoff) { + static constexpr int kMaxRetries = 5; + static constexpr auto kMaxBackoff = std::chrono::milliseconds(10'000); + + RefreshAttemptGuard guard(*this); + if (closed_.load()) return; + + // Use an empty session for the refresh request (no auth headers — + // avoids circular dependency of using an expired token to refresh itself) + auto empty_session = AuthSession::MakeDefault({}); + + auto result = FetchToken(client_, *empty_session, refresh_properties_); + if (result.has_value()) { + auto& response = result.value(); + { + std::unique_lock lock(mutex_); + token_ = response.access_token; + headers_ = { + {std::string(kAuthorizationHeader), std::string(kBearerPrefix) + token_}}; + + // Reset before deriving new expiry + expires_at_ = std::chrono::steady_clock::time_point{}; + + if (response.expires_in_secs.has_value()) { + expires_at_ = std::chrono::steady_clock::now() + + std::chrono::seconds(*response.expires_in_secs); + } else if (auto exp_ms = ExpiresAtMillis(token_); exp_ms.has_value()) { + auto now_sys = std::chrono::system_clock::now(); + auto now_steady = std::chrono::steady_clock::now(); + auto exp_sys = + std::chrono::system_clock::time_point(std::chrono::milliseconds(*exp_ms)); + expires_at_ = now_steady + (exp_sys - now_sys); + } + } + // Note: ScheduleRefresh must be called outside the lock. + ScheduleRefresh(); + return; // Success + } + + // Schedule retry with exponential backoff (non-blocking) + if (attempt + 1 < kMaxRetries && !closed_.load()) { + auto next_backoff = + std::min(std::chrono::duration_cast(backoff * 2), + kMaxBackoff); + std::weak_ptr weak_self = shared_from_this(); + auto retry_id = TokenRefreshScheduler::Instance().Schedule( + backoff, + [weak_self = std::move(weak_self), next_attempt = attempt + 1, next_backoff] { + if (auto self = weak_self.lock()) { + self->DoRefreshAttempt(next_attempt, next_backoff); + } + }); + scheduled_task_id_.store(retry_id); + } + // All retries exhausted — stop refreshing silently. + // Next request will use the expired token; server returns 401. + } + + /// \brief Schedule the next token refresh based on expiration time. + /// + /// Must be called outside any lock on mutex_ (CalculateRefreshDelay + /// acquires shared_lock internally). + void ScheduleRefresh() { + if (!config_.keep_refreshed || closed_.load()) return; + + auto delay = CalculateRefreshDelay(); + if (delay < std::chrono::milliseconds::zero()) return; + + std::weak_ptr weak_self = shared_from_this(); + auto new_id = TokenRefreshScheduler::Instance().Schedule( + delay, [weak_self = std::move(weak_self)] { + if (auto self = weak_self.lock()) { + self->DoRefresh(); + } + }); + scheduled_task_id_.store(new_id); + } + + std::chrono::milliseconds CalculateRefreshDelay() const { + std::shared_lock lock(mutex_); + auto now = std::chrono::steady_clock::now(); + if (expires_at_ == std::chrono::steady_clock::time_point{}) { + return std::chrono::milliseconds(-1); + } + if (expires_at_ <= now) return std::chrono::milliseconds::zero(); + + auto expires_in = + std::chrono::duration_cast(expires_at_ - now); + // Refresh window: 10% of remaining time, capped at 5 minutes + auto refresh_window = std::min(expires_in / 10, std::chrono::milliseconds(300'000)); + auto wait_time = expires_in - refresh_window; + return std::max(wait_time, std::chrono::milliseconds(10)); + } + + mutable std::shared_mutex mutex_; // protects token_, headers_, expires_at_ + std::string token_; + std::unordered_map headers_; + std::chrono::steady_clock::time_point expires_at_{}; + + Config config_; + AuthProperties refresh_properties_; + HttpClient& client_; // It should outlive the session + std::atomic scheduled_task_id_{0}; + std::atomic closed_{false}; + std::mutex refresh_mutex_; + std::condition_variable refresh_cv_; + int active_refresh_count_ = 0; +}; + } // namespace std::shared_ptr AuthSession::MakeDefault( @@ -51,13 +284,23 @@ std::shared_ptr AuthSession::MakeDefault( return std::make_shared(std::move(headers)); } -std::shared_ptr AuthSession::MakeOAuth2( - const OAuthTokenResponse& initial_token, const std::string& /*token_endpoint*/, - const std::string& /*client_id*/, const std::string& /*client_secret*/, - const std::string& /*scope*/, HttpClient& /*client*/) { - // TODO(lishuxu): Create OAuth2AuthSession with auto-refresh support. - return MakeDefault({{std::string(kAuthorizationHeader), - std::string(kBearerPrefix) + initial_token.access_token}}); +Result> AuthSession::MakeOAuth2( + const OAuthTokenResponse& initial_token, const std::string& token_endpoint, + const std::string& client_id, const std::string& client_secret, + const std::string& scope, bool keep_refreshed, + const std::unordered_map& optional_oauth_params, + HttpClient& client) { + OAuth2AuthSession::Config config{ + .token_endpoint = token_endpoint, + .client_id = client_id, + .client_secret = client_secret, + .scope = scope, + .optional_oauth_params = optional_oauth_params, + .keep_refreshed = keep_refreshed, + }; + ICEBERG_ASSIGN_OR_RAISE( + auto session, OAuth2AuthSession::Make(initial_token, std::move(config), client)); + return std::static_pointer_cast(std::move(session)); } } // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/auth_session.h b/src/iceberg/catalog/rest/auth/auth_session.h index 26b93877b..5cccacec9 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.h +++ b/src/iceberg/catalog/rest/auth/auth_session.h @@ -74,24 +74,27 @@ class ICEBERG_REST_EXPORT AuthSession { /// \brief Create an OAuth2 session with automatic token refresh. /// - /// This factory method creates a session that holds an access token and - /// optionally a refresh token. When Authenticate() is called and the token - /// is expired, it transparently refreshes the token before setting the - /// Authorization header. + /// This factory method creates a session that holds an access token and, + /// when keep_refreshed is enabled, schedules background refresh based on + /// token expiration. Authenticate() uses the latest cached Authorization + /// header and does not perform a synchronous token refresh. /// /// \param initial_token The initial token response from FetchToken(). /// \param token_endpoint Full URL of the OAuth2 token endpoint for refresh. /// \param client_id OAuth2 client ID for refresh requests. /// \param client_secret OAuth2 client secret for re-fetch if refresh fails. /// \param scope OAuth2 scope for refresh requests. - /// \param client HTTP client for making refresh requests. + /// \param keep_refreshed Whether to schedule automatic token refresh. + /// \param optional_oauth_params Optional OAuth params (audience, resource) for refresh. + /// \param client HTTP client for making refresh requests. The caller owns the + /// client and must keep it alive until the session is closed. /// \return A new session that manages token lifecycle automatically. - static std::shared_ptr MakeOAuth2(const OAuthTokenResponse& initial_token, - const std::string& token_endpoint, - const std::string& client_id, - const std::string& client_secret, - const std::string& scope, - HttpClient& client); + static Result> MakeOAuth2( + const OAuthTokenResponse& initial_token, const std::string& token_endpoint, + const std::string& client_id, const std::string& client_secret, + const std::string& scope, bool keep_refreshed, + const std::unordered_map& optional_oauth_params, + HttpClient& client); }; } // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/oauth2_util.cc b/src/iceberg/catalog/rest/auth/oauth2_util.cc index 3d209d2bd..0bb76da54 100644 --- a/src/iceberg/catalog/rest/auth/oauth2_util.cc +++ b/src/iceberg/catalog/rest/auth/oauth2_util.cc @@ -19,8 +19,6 @@ #include "iceberg/catalog/rest/auth/oauth2_util.h" -#include - #include #include "iceberg/catalog/rest/auth/auth_session.h" @@ -28,6 +26,7 @@ #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/json_serde_internal.h" +#include "iceberg/util/base64.h" #include "iceberg/util/macros.h" namespace iceberg::rest::auth { @@ -74,4 +73,49 @@ Result FetchToken(HttpClient& client, AuthSession& session, return token_response; } +std::optional ExpiresAtMillis(std::string_view token) { + if (token.empty()) { + return std::nullopt; + } + + // A JWT has exactly 3 dot-separated parts: header.payload.signature + auto first_dot = token.find('.'); + if (first_dot == std::string_view::npos) { + return std::nullopt; + } + auto second_dot = token.find('.', first_dot + 1); + if (second_dot == std::string_view::npos) { + return std::nullopt; + } + // Ensure there are exactly 3 parts (no additional dots after the signature). + // Note: JWE tokens have 5 segments — they are intentionally not supported here + // and will return nullopt (graceful degradation to not scheduling refresh). + if (token.find('.', second_dot + 1) != std::string_view::npos) { + return std::nullopt; + } + + // Extract and decode the payload (second part). + // Note: Base64::UrlDecode returns an error on invalid input, and Ok("") on empty input. + // A valid JWT payload is never empty (at minimum "{}"), so empty result reliably + // indicates the token is not a JWT we can parse. + std::string_view payload_b64 = token.substr(first_dot + 1, second_dot - first_dot - 1); + auto payload_result = Base64::UrlDecode(payload_b64); + if (!payload_result.has_value() || payload_result->empty()) { + return std::nullopt; + } + const std::string& payload = *payload_result; + + // Parse JSON and extract "exp" claim + auto json = nlohmann::json::parse(payload, nullptr, /*allow_exceptions=*/false); + if (json.is_discarded() || !json.is_object()) { + return std::nullopt; + } + auto it = json.find("exp"); + if (it == json.end() || !it->is_number()) { + return std::nullopt; + } + auto exp_seconds = static_cast(it->get()); + return exp_seconds * 1000; // Convert seconds to milliseconds +} + } // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/oauth2_util.h b/src/iceberg/catalog/rest/auth/oauth2_util.h index 39dd12964..428ebc385 100644 --- a/src/iceberg/catalog/rest/auth/oauth2_util.h +++ b/src/iceberg/catalog/rest/auth/oauth2_util.h @@ -19,6 +19,8 @@ #pragma once +#include +#include #include #include #include @@ -53,4 +55,14 @@ ICEBERG_REST_EXPORT Result FetchToken( ICEBERG_REST_EXPORT std::unordered_map AuthHeaders( const std::string& token); +/// \brief Extract expiration time from a JWT token. +/// +/// Decodes the JWT payload (base64url) and reads the "exp" claim. +/// Returns std::nullopt if the token is not a valid JWT or has no "exp" claim. +/// +/// \param token A token string. If it is a JWT (three dot-separated base64url +/// segments), the "exp" claim is extracted from the payload. +/// \return Expiration time as milliseconds since epoch, or std::nullopt. +ICEBERG_REST_EXPORT std::optional ExpiresAtMillis(std::string_view token); + } // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/token_refresh_scheduler.cc b/src/iceberg/catalog/rest/auth/token_refresh_scheduler.cc new file mode 100644 index 000000000..d66ed7d90 --- /dev/null +++ b/src/iceberg/catalog/rest/auth/token_refresh_scheduler.cc @@ -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. + */ + +#include "iceberg/catalog/rest/auth/token_refresh_scheduler.h" + +#include +#include + +namespace iceberg::rest::auth { + +TokenRefreshScheduler& TokenRefreshScheduler::Instance() { + // Intentionally leaked to avoid destruction-order races at process exit. + static auto* instance = new TokenRefreshScheduler(); + return *instance; +} + +TokenRefreshScheduler::TokenRefreshScheduler() : worker_([this] { Run(); }) {} + +TokenRefreshScheduler::~TokenRefreshScheduler() { Shutdown(); } + +uint64_t TokenRefreshScheduler::Schedule(std::chrono::milliseconds delay, + std::function callback) { + std::lock_guard lock(mutex_); + if (shutdown_) { + return 0; + } + uint64_t id = next_id_++; + tasks_.push_back(Task{.id = id, + .fire_at = std::chrono::steady_clock::now() + delay, + .callback = std::move(callback)}); + cv_.notify_one(); + return id; +} + +void TokenRefreshScheduler::Cancel(uint64_t handle) { + if (handle == 0) return; + std::lock_guard lock(mutex_); + std::erase_if(tasks_, [handle](const Task& t) { return t.id == handle; }); +} + +void TokenRefreshScheduler::Shutdown() { + { + std::lock_guard lock(mutex_); + if (shutdown_) return; + shutdown_ = true; + tasks_.clear(); + } + cv_.notify_one(); + if (worker_.joinable()) { + worker_.join(); + } +} + +void TokenRefreshScheduler::Run() { + while (true) { + std::function callback; + + { + std::unique_lock lock(mutex_); + + if (tasks_.empty() && !shutdown_) { + // Wait until a task is added or shutdown is requested + cv_.wait(lock, [this] { return !tasks_.empty() || shutdown_; }); + } + + if (shutdown_) break; + if (tasks_.empty()) continue; + + // Find the task with the earliest fire_at + auto earliest_it = std::ranges::min_element( + tasks_, [](const Task& a, const Task& b) { return a.fire_at < b.fire_at; }); + + auto fire_at = earliest_it->fire_at; + auto target_id = earliest_it->id; + + // Wait until fire_at or until woken (new task, cancel, or shutdown). + // Note: The predicate does O(n) scan on each spurious wakeup. This is + // acceptable for the expected task count (< 10). If task count grows + // significantly, consider replacing vector with a priority queue. + cv_.wait_until(lock, fire_at, [&] { + // Wake up if: shutdown, task list changed, or time is up + if (shutdown_) return true; + if (tasks_.empty()) return true; + // Check if the earliest task has changed (new task added or cancelled) + auto new_earliest = std::ranges::min_element( + tasks_, [](const Task& a, const Task& b) { return a.fire_at < b.fire_at; }); + return new_earliest->id != target_id; + }); + + if (shutdown_) break; + + // If we were woken because the earliest task changed, loop again + auto now = std::chrono::steady_clock::now(); + auto due_it = + std::ranges::find_if(tasks_, [now](const Task& t) { return t.fire_at <= now; }); + if (due_it == tasks_.end()) continue; + + callback = std::move(due_it->callback); + tasks_.erase(due_it); + } + + // Execute callback outside the lock + if (callback) { + callback(); + } + } +} + +} // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/token_refresh_scheduler.h b/src/iceberg/catalog/rest/auth/token_refresh_scheduler.h new file mode 100644 index 000000000..02dc0e14f --- /dev/null +++ b/src/iceberg/catalog/rest/auth/token_refresh_scheduler.h @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/catalog/rest/iceberg_rest_export.h" + +/// \file iceberg/catalog/rest/auth/token_refresh_scheduler.h +/// \brief Global scheduler for OAuth2 token refresh tasks. + +namespace iceberg::rest::auth { + +/// \brief A process-global scheduler for delayed token refresh tasks. +/// +/// Uses a single background thread that sleeps until the next task is due. +/// All OAuth2AuthSession instances share this scheduler. Tasks are lightweight +/// (a single HTTP POST to refresh a token), so one thread is sufficient. +/// +/// Thread safety: All public methods are thread-safe. +/// +/// TODO(lishuxu): Migrate to the shared thread pool abstraction once available +/// (see https://github.com/apache/iceberg-cpp/pull/646#discussion_r3304315308). +class ICEBERG_REST_EXPORT TokenRefreshScheduler { + public: + /// \brief Get the global singleton instance. + /// + /// Lazily created on first access and intentionally leaked: the worker + /// thread is reclaimed by the OS at process exit. Tests needing + /// deterministic shutdown should use a local instance. + static TokenRefreshScheduler& Instance(); + + /// \brief Schedule a callback to run after a delay. + /// + /// \param delay Time to wait before executing the callback. + /// \param callback Function to execute when the delay expires. + /// \return A unique handle that can be used to cancel the task. + uint64_t Schedule(std::chrono::milliseconds delay, std::function callback); + + /// \brief Cancel a previously scheduled task. + /// + /// If the task has already fired or does not exist, this is a no-op. + /// + /// \param handle The handle returned by Schedule(). + void Cancel(uint64_t handle); + + /// \brief Shutdown the scheduler, cancelling all pending tasks. + /// + /// After shutdown, Schedule() calls are no-ops (return 0). + /// This is called automatically on destruction. + /// + /// WARNING: Do not call this on the global Instance() unless you intend to + /// permanently stop all token refresh for the entire process. This is mainly + /// useful for testing with locally-constructed scheduler instances. + void Shutdown(); + + ~TokenRefreshScheduler(); + + // Non-copyable, non-movable + TokenRefreshScheduler(const TokenRefreshScheduler&) = delete; + TokenRefreshScheduler& operator=(const TokenRefreshScheduler&) = delete; + TokenRefreshScheduler(TokenRefreshScheduler&&) = delete; + TokenRefreshScheduler& operator=(TokenRefreshScheduler&&) = delete; + + /// \brief Construct a scheduler (prefer Instance() for production use). + /// + /// This constructor is public to allow testing with isolated instances. + /// In production code, use Instance() to get the global singleton. + TokenRefreshScheduler(); + + private: + /// \brief Worker loop that processes tasks. + void Run(); + + struct Task { + uint64_t id; + std::chrono::steady_clock::time_point fire_at; + std::function callback; + }; + + std::mutex mutex_; + std::condition_variable cv_; + std::vector tasks_; + uint64_t next_id_ = 1; // 0 is reserved as "invalid handle" + bool shutdown_ = false; + std::thread worker_; +}; + +} // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/meson.build b/src/iceberg/catalog/rest/meson.build index cc05576a2..f3eae6d45 100644 --- a/src/iceberg/catalog/rest/meson.build +++ b/src/iceberg/catalog/rest/meson.build @@ -21,6 +21,7 @@ iceberg_rest_sources = files( 'auth/auth_properties.cc', 'auth/auth_session.cc', 'auth/oauth2_util.cc', + 'auth/token_refresh_scheduler.cc', 'catalog_properties.cc', 'endpoint.cc', 'error_handlers.cc', diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index a0267adcb..f04f5fb55 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -27,6 +27,7 @@ #include #include "iceberg/catalog/rest/auth/auth_managers.h" +#include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/catalog_properties.h" #include "iceberg/catalog/rest/constant.h" #include "iceberg/catalog/rest/endpoint.h" @@ -119,7 +120,11 @@ Result CaptureNoSuchNamespace(const auto& status) { } // namespace -RestCatalog::~RestCatalog() = default; +RestCatalog::~RestCatalog() { + if (catalog_session_) { + std::ignore = catalog_session_->Close(); + } +} Result> RestCatalog::Make( const RestCatalogProperties& config) { diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 678f30fbd..40969e4be 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -124,6 +124,7 @@ iceberg_sources = files( 'update/update_snapshot_reference.cc', 'update/update_sort_order.cc', 'update/update_statistics.cc', + 'util/base64.cc', 'util/bucket_util.cc', 'util/content_file_util.cc', 'util/conversions.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 20babf19c..cbdd696f1 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -119,6 +119,7 @@ add_iceberg_test(json_serde_test add_iceberg_test(util_test USE_DATA SOURCES + base64_test.cc bucket_util_test.cc config_test.cc data_file_set_test.cc diff --git a/src/iceberg/test/auth_manager_test.cc b/src/iceberg/test/auth_manager_test.cc index bd06fee3f..40c0f8607 100644 --- a/src/iceberg/test/auth_manager_test.cc +++ b/src/iceberg/test/auth_manager_test.cc @@ -19,8 +19,14 @@ #include "iceberg/catalog/rest/auth/auth_manager.h" +#include +#include +#include +#include #include +#include #include +#include #include #include @@ -30,10 +36,12 @@ #include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/auth/oauth2_util.h" +#include "iceberg/catalog/rest/auth/token_refresh_scheduler.h" #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/json_serde_internal.h" #include "iceberg/test/matchers.h" +#include "iceberg/util/base64.h" namespace iceberg::rest::auth { @@ -45,6 +53,13 @@ Result ParseTokenResponse(const std::string& str) { return iceberg::rest::FromJson(json); } +std::string MakeJwt(const std::string& payload_json) { + std::string header = R"({"alg":"HS256","typ":"JWT"})"; + std::string signature = "test-signature"; + return Base64::UrlEncode(header) + "." + Base64::UrlEncode(payload_json) + "." + + Base64::UrlEncode(signature); +} + } // namespace class AuthManagerTest : public ::testing::Test { @@ -358,4 +373,132 @@ TEST_F(AuthManagerTest, OAuthTokenResponseNATokenType) { EXPECT_EQ(result->token_type, "N_A"); } +// ---- ExpiresAtMillis tests ---- + +TEST_F(AuthManagerTest, ExpiresAtMillisValidJwt) { + std::string token = MakeJwt(R"({"sub":"user","exp":1700000000})"); + + auto result = ExpiresAtMillis(token); + + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value(), 1700000000LL * 1000); +} + +TEST_F(AuthManagerTest, ExpiresAtMillisInvalidTokensReturnNullopt) { + std::vector tokens = { + "", + "just-a-plain-token", + "part1.part2", + "a.b.c.d", + MakeJwt(R"({"sub":"user","iat":1700000000})"), + MakeJwt(R"({"exp":"not-a-number"})"), + "eyJhbGciOiJIUzI1NiJ9.!!!invalid!!!.signature", + Base64::UrlEncode(R"({"alg":"HS256"})") + "." + + Base64::UrlEncode("this is not json") + ".sig", + }; + + for (const auto& token : tokens) { + EXPECT_FALSE(ExpiresAtMillis(token).has_value()) << token; + } +} + +// ---- TokenRefreshScheduler tests ---- + +// Verifies that a scheduled task fires after the specified delay +TEST(TokenRefreshSchedulerTest, ScheduleFiresAfterDelay) { + TokenRefreshScheduler scheduler; + std::mutex mutex; + std::condition_variable cv; + bool fired = false; + + scheduler.Schedule(std::chrono::milliseconds(50), [&] { + { + std::lock_guard lock(mutex); + fired = true; + } + cv.notify_one(); + }); + + { + std::unique_lock lock(mutex); + EXPECT_TRUE(cv.wait_for(lock, std::chrono::seconds(5), [&] { return fired; })); + } + + scheduler.Shutdown(); +} + +// Verifies that cancelling a task prevents it from executing +TEST(TokenRefreshSchedulerTest, CancelPreventsExecution) { + TokenRefreshScheduler scheduler; + std::atomic fired{false}; + + auto handle = + scheduler.Schedule(std::chrono::milliseconds(100), [&] { fired.store(true); }); + + // Cancel before it fires + scheduler.Cancel(handle); + + // Wait past the scheduled time + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + EXPECT_FALSE(fired.load()); + + scheduler.Shutdown(); +} + +// Verifies that shutdown with pending tasks does not crash +TEST(TokenRefreshSchedulerTest, ShutdownWithPendingTasks) { + TokenRefreshScheduler scheduler; + std::atomic fired{false}; + + scheduler.Schedule(std::chrono::milliseconds(5000), [&] { fired.store(true); }); + + // Shutdown immediately — should not crash and task should not fire + scheduler.Shutdown(); + + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + EXPECT_FALSE(fired.load()); +} + +// Verifies that Schedule after shutdown returns invalid handle (0) +TEST(TokenRefreshSchedulerTest, ScheduleAfterShutdownIsNoop) { + TokenRefreshScheduler scheduler; + scheduler.Shutdown(); + + auto handle = scheduler.Schedule(std::chrono::milliseconds(10), [] {}); + EXPECT_EQ(0u, handle); +} + +// Verifies that cancelling an invalid handle does not crash +TEST(TokenRefreshSchedulerTest, CancelInvalidHandleIsNoop) { + TokenRefreshScheduler scheduler; + // Should not crash + scheduler.Cancel(0); + scheduler.Cancel(999); + scheduler.Shutdown(); +} + +// ---- OAuth2AuthSession tests ---- + +TEST(OAuth2AuthSessionTest, InitialTokenIsUsed) { + HttpClient client({}); + OAuthTokenResponse token_response; + token_response.access_token = "initial-token-123"; + token_response.token_type = "bearer"; + token_response.expires_in_secs = 3600; + + // Create session (refresh will fail since there's no real server, but + // initial token should work) + auto session_result = + AuthSession::MakeOAuth2(token_response, "http://localhost/oauth/tokens", + "client_id", "client_secret", "catalog", true, {}, client); + ASSERT_THAT(session_result, IsOk()); + auto session = session_result.value(); + + std::unordered_map headers; + ASSERT_THAT(session->Authenticate(headers), IsOk()); + EXPECT_EQ(headers["Authorization"], "Bearer initial-token-123"); + + session->Close(); +} + } // namespace iceberg::rest::auth diff --git a/src/iceberg/test/base64_test.cc b/src/iceberg/test/base64_test.cc new file mode 100644 index 000000000..8de80c4fe --- /dev/null +++ b/src/iceberg/test/base64_test.cc @@ -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. + */ + +#include "iceberg/util/base64.h" + +#include + +#include "iceberg/test/matchers.h" + +namespace iceberg { + +TEST(Base64Test, Encode) { + // Empty string + EXPECT_EQ("", Base64::Encode("")); + + // Single character + EXPECT_EQ("YQ==", Base64::Encode("a")); + EXPECT_EQ("YWI=", Base64::Encode("ab")); + EXPECT_EQ("YWJj", Base64::Encode("abc")); + + // Multiple of 3 characters + EXPECT_EQ("YWJjZGU=", Base64::Encode("abcde")); + EXPECT_EQ("YWJjZGVm", Base64::Encode("abcdef")); + + // Common strings + EXPECT_EQ("U29tZSBkYXRhIHdpdGggY2hhcmFjdGVycw==", + Base64::Encode("Some data with characters")); + EXPECT_EQ("aGVsbG8=", Base64::Encode("hello")); + EXPECT_EQ("dGVzdCBzdHJpbmc=", Base64::Encode("test string")); + + // Unicode + EXPECT_EQ("8J+EgA==", Base64::Encode("\xF0\x9F\x84\x80")); + // Null byte + EXPECT_EQ("AA==", Base64::Encode({"\x00", 1})); +} + +TEST(Base64Test, Decode) { + // Empty string + ICEBERG_UNWRAP_OR_FAIL(auto empty, Base64::Decode("")); + EXPECT_EQ("", empty); + + // Round-trip with Base64::Encode + ICEBERG_UNWRAP_OR_FAIL(auto a, Base64::Decode("YQ==")); + EXPECT_EQ("a", a); + ICEBERG_UNWRAP_OR_FAIL(auto ab, Base64::Decode("YWI=")); + EXPECT_EQ("ab", ab); + ICEBERG_UNWRAP_OR_FAIL(auto abc, Base64::Decode("YWJj")); + EXPECT_EQ("abc", abc); + ICEBERG_UNWRAP_OR_FAIL(auto abcde, Base64::Decode("YWJjZGU=")); + EXPECT_EQ("abcde", abcde); + ICEBERG_UNWRAP_OR_FAIL(auto abcdef, Base64::Decode("YWJjZGVm")); + EXPECT_EQ("abcdef", abcdef); + ICEBERG_UNWRAP_OR_FAIL(auto hello, Base64::Decode("aGVsbG8=")); + EXPECT_EQ("hello", hello); + ICEBERG_UNWRAP_OR_FAIL(auto test_str, Base64::Decode("dGVzdCBzdHJpbmc=")); + EXPECT_EQ("test string", test_str); + + // Without padding (should still work) + ICEBERG_UNWRAP_OR_FAIL(auto a2, Base64::Decode("YQ")); + EXPECT_EQ("a", a2); + ICEBERG_UNWRAP_OR_FAIL(auto ab2, Base64::Decode("YWI")); + EXPECT_EQ("ab", ab2); + + // Invalid characters return error + EXPECT_THAT(Base64::Decode("!!!"), IsError(ErrorKind::kInvalidArgument)); + + // Invalid padding and impossible unpadded lengths return error + for (const auto* invalid : + {"=", "====", "Y=Q=", "YQ=", "YQ===", "YWJj=", "aGVsbG8==", "A", "AAAAA"}) { + EXPECT_THAT(Base64::Decode(invalid), IsError(ErrorKind::kInvalidArgument)) << invalid; + } +} + +TEST(Base64Test, UrlEncode) { + // Empty string + EXPECT_EQ("", Base64::UrlEncode("")); + + // No padding is emitted (unlike standard base64) + EXPECT_EQ("YQ", Base64::UrlEncode("a")); + EXPECT_EQ("YWI", Base64::UrlEncode("ab")); + EXPECT_EQ("YWJj", Base64::UrlEncode("abc")); + EXPECT_EQ("aGVsbG8", Base64::UrlEncode("hello")); + + // URL-safe characters: '-' and '_' instead of '+' and '/' + // bytes {0xFB, 0xFF, 0xFE} encode to "+//+" in standard base64, "-__-" in base64url + EXPECT_EQ("-__-", Base64::UrlEncode("\xFB\xFF\xFE")); + + // Round-trip with UrlDecode + ICEBERG_UNWRAP_OR_FAIL(auto decoded, Base64::UrlDecode(Base64::UrlEncode("hello"))); + EXPECT_EQ("hello", decoded); +} + +TEST(Base64Test, UrlDecode) { + // Empty string + ICEBERG_UNWRAP_OR_FAIL(auto empty, Base64::UrlDecode("")); + EXPECT_EQ("", empty); + + // Standard cases (same as Base64::Decode for alphanumeric) + ICEBERG_UNWRAP_OR_FAIL(auto hello, Base64::UrlDecode("aGVsbG8")); + EXPECT_EQ("hello", hello); + ICEBERG_UNWRAP_OR_FAIL(auto abc, Base64::UrlDecode("YWJj")); + EXPECT_EQ("abc", abc); + + // URL-safe characters: '-' and '_' instead of '+' and '/' + // bytes {0xFB, 0xFF, 0xFE} encode to "+//+" in standard base64, "-__-" in base64url + ICEBERG_UNWRAP_OR_FAIL(auto decoded, Base64::UrlDecode("-__-")); + EXPECT_EQ(3u, decoded.size()); + EXPECT_EQ('\xFB', decoded[0]); + EXPECT_EQ('\xFF', decoded[1]); + EXPECT_EQ('\xFE', decoded[2]); + + // Standard base64 chars '+' and '/' should be invalid in base64url + EXPECT_THAT(Base64::UrlDecode("+//+"), IsError(ErrorKind::kInvalidArgument)); + + // With padding (should handle gracefully) + ICEBERG_UNWRAP_OR_FAIL(auto hello2, Base64::UrlDecode("aGVsbG8=")); + EXPECT_EQ("hello", hello2); + + // Invalid characters return error + EXPECT_THAT(Base64::UrlDecode("!!!invalid!!!"), IsError(ErrorKind::kInvalidArgument)); + + // Invalid padding and impossible unpadded lengths return error + for (const auto* invalid : + {"=", "====", "Y=Q=", "YQ=", "YQ===", "YWJj=", "aGVsbG8==", "A", "AAAAA"}) { + EXPECT_THAT(Base64::UrlDecode(invalid), IsError(ErrorKind::kInvalidArgument)) + << invalid; + } +} + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index b21a264b1..2f812655f 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -83,6 +83,7 @@ iceberg_tests = { }, 'util_test': { 'sources': files( + 'base64_test.cc', 'bucket_util_test.cc', 'config_test.cc', 'data_file_set_test.cc', diff --git a/src/iceberg/test/transform_util_test.cc b/src/iceberg/test/transform_util_test.cc index f5a22233a..13c96b9e1 100644 --- a/src/iceberg/test/transform_util_test.cc +++ b/src/iceberg/test/transform_util_test.cc @@ -152,30 +152,4 @@ TEST(TransformUtilTest, HumanTimestampNsWithZone) { EXPECT_EQ("1969-12-31T23:59:59.123456789+00:00", TransformUtil::HumanTimestampNsWithZone(-876543211)); } - -TEST(TransformUtilTest, Base64Encode) { - // Empty string - EXPECT_EQ("", TransformUtil::Base64Encode("")); - - // Single character - EXPECT_EQ("YQ==", TransformUtil::Base64Encode("a")); - EXPECT_EQ("YWI=", TransformUtil::Base64Encode("ab")); - EXPECT_EQ("YWJj", TransformUtil::Base64Encode("abc")); - - // Multiple of 3 characters - EXPECT_EQ("YWJjZGU=", TransformUtil::Base64Encode("abcde")); - EXPECT_EQ("YWJjZGVm", TransformUtil::Base64Encode("abcdef")); - - // Common strings - EXPECT_EQ("U29tZSBkYXRhIHdpdGggY2hhcmFjdGVycw==", - TransformUtil::Base64Encode("Some data with characters")); - EXPECT_EQ("aGVsbG8=", TransformUtil::Base64Encode("hello")); - EXPECT_EQ("dGVzdCBzdHJpbmc=", TransformUtil::Base64Encode("test string")); - - // Unicode - EXPECT_EQ("8J+EgA==", TransformUtil::Base64Encode("\xF0\x9F\x84\x80")); - // Null byte - EXPECT_EQ("AA==", TransformUtil::Base64Encode({"\x00", 1})); -} - } // namespace iceberg diff --git a/src/iceberg/transform.cc b/src/iceberg/transform.cc index c019c7ead..c915ec067 100644 --- a/src/iceberg/transform.cc +++ b/src/iceberg/transform.cc @@ -28,6 +28,7 @@ #include "iceberg/result.h" #include "iceberg/transform_function.h" #include "iceberg/type.h" +#include "iceberg/util/base64.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" #include "iceberg/util/projection_util_internal.h" @@ -437,7 +438,7 @@ Result Transform::ToHumanString(const Literal& value) { case TypeId::kFixed: case TypeId::kBinary: { const auto& binary_data = std::get>(value.value()); - return TransformUtil::Base64Encode( + return Base64::Encode( {reinterpret_cast(binary_data.data()), binary_data.size()}); } case TypeId::kDecimal: { diff --git a/src/iceberg/util/base64.cc b/src/iceberg/util/base64.cc new file mode 100644 index 000000000..260b63d63 --- /dev/null +++ b/src/iceberg/util/base64.cc @@ -0,0 +1,161 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/util/base64.h" + +#include +#include + +namespace iceberg { + +namespace { + +// Shared base64 encode logic. The encode alphabet maps a 6-bit value -> ASCII char. +// When `pad` is true, the output is padded with '=' to a multiple of 4 characters. +std::string Base64EncodeWithAlphabet(std::string_view input, std::string_view alphabet, + bool pad) { + std::string output; + output.reserve((input.size() + 2) / 3 * 4); + + uint32_t buffer = 0; + int bits_collected = 0; + for (unsigned char byte : input) { + buffer = (buffer << 8) | byte; + bits_collected += 8; + while (bits_collected >= 6) { + bits_collected -= 6; + output.push_back(alphabet[(buffer >> bits_collected) & 0x3F]); + } + } + if (bits_collected > 0) { + // Pad the remaining bits on the right to form the final 6-bit group. + output.push_back(alphabet[(buffer << (6 - bits_collected)) & 0x3F]); + } + if (pad) { + while (output.size() % 4 != 0) { + output.push_back('='); + } + } + return output; +} + +// Shared base64 decode logic. The decode table maps ASCII char -> 6-bit value. +// 0xFF means invalid character. +Result Base64DecodeWithTable(std::string_view input, + const std::array& table) { + auto padded_size = input.size(); + if (auto padding_pos = input.find('='); padding_pos != std::string_view::npos) { + auto padding = input.substr(padding_pos); + if (padding.find_first_not_of('=') != std::string_view::npos) { + return InvalidArgument("Invalid base64 padding"); + } + auto padding_size = padding.size(); + if (padding_size > 2 || input.size() % 4 != 0) { + return InvalidArgument("Invalid base64 padding"); + } + } + + // Strip trailing padding after validating its count and placement. + while (!input.empty() && input.back() == '=') { + input.remove_suffix(1); + } + auto unpadded_size = input.size(); + if (unpadded_size % 4 == 1 || + (padded_size != unpadded_size && unpadded_size % 4 == 0)) { + return InvalidArgument("Invalid base64 length"); + } + if (input.empty()) { + return std::string{}; + } + + std::string output; + output.reserve((input.size() * 3) / 4); + + uint32_t buffer = 0; + int bits_collected = 0; + + for (char c : input) { + uint8_t val = table[static_cast(c)]; + if (val == 0xFF) { + return InvalidArgument("Invalid base64 character: '{}'", c); + } + buffer = (buffer << 6) | val; + bits_collected += 6; + if (bits_collected >= 8) { + bits_collected -= 8; + output.push_back(static_cast((buffer >> bits_collected) & 0xFF)); + } + } + + return output; +} + +// Standard base64 alphabet: A-Z=0-25, a-z=26-51, 0-9=52-61, +=62, /=63 +constexpr std::string_view kBase64Chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +// Base64url alphabet: same as standard but '-'=62, '_'=63 (RFC 4648 §5) +constexpr std::string_view kBase64UrlChars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + +// Standard base64 decode table: A-Z=0-25, a-z=26-51, 0-9=52-61, +=62, /=63 +constexpr std::array kBase64DecodeTable = [] { + std::array table{}; + table.fill(0xFF); + for (int i = 0; i < 26; ++i) { + table[static_cast('A' + i)] = static_cast(i); + table[static_cast('a' + i)] = static_cast(26 + i); + } + for (int i = 0; i < 10; ++i) { + table[static_cast('0' + i)] = static_cast(52 + i); + } + table[static_cast('+')] = 62; + table[static_cast('/')] = 63; + return table; +}(); + +// Base64url decode table: same as standard but '-'=62, '_'=63 (RFC 4648 §5) +constexpr std::array kBase64UrlDecodeTable = [] { + auto table = kBase64DecodeTable; + table[static_cast('+')] = 0xFF; // '+' is invalid in base64url + table[static_cast('/')] = 0xFF; // '/' is invalid in base64url + table[static_cast('-')] = 62; + table[static_cast('_')] = 63; + return table; +}(); + +} // namespace + +std::string Base64::Encode(std::string_view data) { + return Base64EncodeWithAlphabet(data, kBase64Chars, /*pad=*/true); +} + +Result Base64::Decode(std::string_view encoded) { + return Base64DecodeWithTable(encoded, kBase64DecodeTable); +} + +std::string Base64::UrlEncode(std::string_view data) { + return Base64EncodeWithAlphabet(data, kBase64UrlChars, /*pad=*/false); +} + +Result Base64::UrlDecode(std::string_view encoded) { + return Base64DecodeWithTable(encoded, kBase64UrlDecodeTable); +} + +} // namespace iceberg diff --git a/src/iceberg/util/base64.h b/src/iceberg/util/base64.h new file mode 100644 index 000000000..1a0ead0f0 --- /dev/null +++ b/src/iceberg/util/base64.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" + +/// \file iceberg/util/base64.h +/// \brief Base64 and base64url encoding/decoding (RFC 4648). + +namespace iceberg { + +/// \brief Utilities for base64 and base64url encoding and decoding. +class ICEBERG_EXPORT Base64 { + public: + /// \brief Base64 encode a string (standard alphabet: +/). + /// + /// The output is padded with '=' to a multiple of 4 characters. + /// + /// \param data The string to encode. + /// \return The base64-encoded string. + static std::string Encode(std::string_view data); + + /// \brief Base64 decode a string (standard alphabet: +/). + /// + /// Handles optional padding ('='). + /// \param encoded The base64-encoded string. + /// \return Decoded string, or an error if the input contains invalid characters. + static Result Decode(std::string_view encoded); + + /// \brief Base64url encode a string (URL-safe alphabet: -_). + /// + /// This variant uses '-' and '_' instead of '+' and '/' per RFC 4648 §5 and + /// emits no '=' padding, matching the encoding commonly used by JWTs. + /// + /// \param data The string to encode. + /// \return The base64url-encoded string (without padding). + static std::string UrlEncode(std::string_view data); + + /// \brief Base64url decode a string (URL-safe alphabet: -_). + /// + /// Handles optional padding ('='). This variant uses '-' and '_' instead of + /// '+' and '/' per RFC 4648 §5. + /// \param encoded The base64url-encoded string. + /// \return Decoded string, or an error if the input contains invalid characters. + static Result UrlDecode(std::string_view encoded); +}; + +} // namespace iceberg diff --git a/src/iceberg/util/meson.build b/src/iceberg/util/meson.build index d70855016..91c183bb6 100644 --- a/src/iceberg/util/meson.build +++ b/src/iceberg/util/meson.build @@ -17,6 +17,7 @@ install_headers( [ + 'base64.h', 'bucket_util.h', 'checked_cast.h', 'config.h', diff --git a/src/iceberg/util/transform_util.cc b/src/iceberg/util/transform_util.cc index d12449382..0a8af63cd 100644 --- a/src/iceberg/util/transform_util.cc +++ b/src/iceberg/util/transform_util.cc @@ -19,7 +19,6 @@ #include "iceberg/util/transform_util.h" -#include #include #include @@ -139,53 +138,4 @@ std::string TransformUtil::HumanTimestampNsWithZone(int64_t timestamp_nanos) { } } -std::string TransformUtil::Base64Encode(std::string_view str_to_encode) { - static constexpr std::string_view kBase64Chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - int32_t i = 0; - int32_t j = 0; - std::array char_array_3; - std::array char_array_4; - - std::string encoded; - encoded.reserve((str_to_encode.size() + 2) * 4 / 3); - - for (unsigned char byte : str_to_encode) { - char_array_3[i++] = byte; - if (i == 3) { - char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for (j = 0; j < 4; j++) { - encoded += kBase64Chars[char_array_4[j]]; - } - - i = 0; - } - } - - if (i) { - for (j = i; j < 3; j++) { - char_array_3[j] = '\0'; - } - - char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for (j = 0; j < i + 1; j++) { - encoded += kBase64Chars[char_array_4[j]]; - } - - while (i++ < 3) { - encoded += '='; - } - } - - return encoded; -} - } // namespace iceberg diff --git a/src/iceberg/util/transform_util.h b/src/iceberg/util/transform_util.h index 2fbcb3e55..e0918dcf3 100644 --- a/src/iceberg/util/transform_util.h +++ b/src/iceberg/util/transform_util.h @@ -21,7 +21,6 @@ #include #include -#include #include "iceberg/iceberg_export.h" @@ -126,9 +125,6 @@ class ICEBERG_EXPORT TransformUtil { /// \param timestamp_nanos the timestamp in nanoseconds. /// \return a string representation of this timestamp. static std::string HumanTimestampNsWithZone(int64_t timestamp_nanos); - - /// \brief Base64 encode a string - static std::string Base64Encode(std::string_view str_to_encode); }; } // namespace iceberg From 24cbe8444256e8f72c8c3c7f7f51fa5cc02f2aab Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Fri, 5 Jun 2026 09:55:28 +0800 Subject: [PATCH 057/151] feat(catalog): add SQL catalog (#693) Add a relational database backed SqlCatalog with a CatalogStore abstraction, built-in sqlpp23 stores for SQLite, PostgreSQL, and MySQL, and Java-compatible catalog tables. --- .github/workflows/cpp-linter.yml | 12 +- .github/workflows/sql_catalog_test.yml | 111 +++ .gitignore | 4 + CMakeLists.txt | 6 + README.md | 4 + .../IcebergThirdpartyToolchain.cmake | 88 +++ mkdocs/docs/getting-started.md | 5 + mkdocs/docs/sql-catalog.md | 69 ++ mkdocs/mkdocs.yml | 1 + src/iceberg/catalog/CMakeLists.txt | 4 + src/iceberg/catalog/sql/CMakeLists.txt | 95 +++ src/iceberg/catalog/sql/README.md | 164 +++++ src/iceberg/catalog/sql/catalog_store.h | 233 +++++++ .../catalog/sql/catalog_store_mysql.cc | 100 +++ .../catalog/sql/catalog_store_postgresql.cc | 90 +++ .../catalog/sql/catalog_store_sqlite3.cc | 86 +++ .../sql/catalog_store_sqlpp23_internal.h | 535 +++++++++++++++ src/iceberg/catalog/sql/config.h.in | 24 + src/iceberg/catalog/sql/connection_uri.cc | 98 +++ .../catalog/sql/connection_uri_internal.h | 50 ++ .../catalog/sql/iceberg_sql_catalog_export.h | 34 + src/iceberg/catalog/sql/sql_catalog.cc | 632 ++++++++++++++++++ src/iceberg/catalog/sql/sql_catalog.h | 189 ++++++ .../catalog/sql/sql_catalog_tables_internal.h | 137 ++++ src/iceberg/iceberg-config.cmake.in | 2 + src/iceberg/test/CMakeLists.txt | 16 + src/iceberg/test/sql_catalog_test.cc | 439 ++++++++++++ 27 files changed, 3225 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/sql_catalog_test.yml create mode 100644 mkdocs/docs/sql-catalog.md create mode 100644 src/iceberg/catalog/sql/CMakeLists.txt create mode 100644 src/iceberg/catalog/sql/README.md create mode 100644 src/iceberg/catalog/sql/catalog_store.h create mode 100644 src/iceberg/catalog/sql/catalog_store_mysql.cc create mode 100644 src/iceberg/catalog/sql/catalog_store_postgresql.cc create mode 100644 src/iceberg/catalog/sql/catalog_store_sqlite3.cc create mode 100644 src/iceberg/catalog/sql/catalog_store_sqlpp23_internal.h create mode 100644 src/iceberg/catalog/sql/config.h.in create mode 100644 src/iceberg/catalog/sql/connection_uri.cc create mode 100644 src/iceberg/catalog/sql/connection_uri_internal.h create mode 100644 src/iceberg/catalog/sql/iceberg_sql_catalog_export.h create mode 100644 src/iceberg/catalog/sql/sql_catalog.cc create mode 100644 src/iceberg/catalog/sql/sql_catalog.h create mode 100644 src/iceberg/catalog/sql/sql_catalog_tables_internal.h create mode 100644 src/iceberg/test/sql_catalog_test.cc diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index aa5262a52..4225d662e 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -41,14 +41,20 @@ jobs: persist-credentials: false - name: Install dependencies shell: bash - run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + run: | + sudo apt-get update + sudo apt-get install -y libcurl4-openssl-dev libsqlite3-dev libpq-dev default-libmysqlclient-dev - name: Run build env: CC: gcc-14 CXX: g++-14 run: | mkdir build && cd build - cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DICEBERG_BUILD_SQL_CATALOG=ON \ + -DICEBERG_SQL_SQLITE=ON \ + -DICEBERG_SQL_POSTGRESQL=ON \ + -DICEBERG_SQL_MYSQL=ON cmake --build . - uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8 # v2.15.1 id: linter @@ -66,7 +72,7 @@ jobs: database: build verbosity: 'debug' # need '-fno-builtin-std-forward_like', see https://github.com/llvm/llvm-project/issues/101614 - extra-args: '-std=c++23 -I$PWD/src -I$PWD/build/src -fno-builtin-std-forward_like' + extra-args: '-std=c++23 -I$PWD/src -I$PWD/build/src -I$PWD/build/_deps/sqlpp23-src/include -I/usr/include/postgresql -I/usr/include/mysql -fno-builtin-std-forward_like' - name: Fail fast?! if: steps.linter.outputs.checks-failed != 0 run: | diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml new file mode 100644 index 000000000..be0837745 --- /dev/null +++ b/.github/workflows/sql_catalog_test.yml @@ -0,0 +1,111 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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: SQL Catalog Tests + +on: + push: + branches: + - '**' + - '!dependabot/**' + tags: + - '**' + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: read + +env: + ICEBERG_HOME: /tmp/iceberg + +jobs: + sql-catalog: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + name: SQL Catalog (${{ matrix.title }}) + runs-on: ${{ matrix.runs-on }} + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + include: + - title: AMD64 Ubuntu 24.04 + runs-on: ubuntu-24.04 + CC: gcc-14 + CXX: g++-14 + cmake_build_type: Debug + cmake_extra_args: "" + - title: AArch64 macOS 26 + runs-on: macos-26 + cmake_build_type: Debug + cmake_extra_args: "" + - title: AMD64 Windows 2025 + runs-on: windows-2025 + cmake_build_type: Release + cmake_extra_args: -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + steps: + - name: Checkout iceberg-cpp + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up MSVC Developer Command Prompt + if: ${{ startsWith(matrix.runs-on, 'windows') }} + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + arch: x64 + - name: Install dependencies on Ubuntu + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + shell: bash + run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev + - name: Set Ubuntu Compilers + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + run: | + echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV + echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Install dependencies on macOS + if: ${{ startsWith(matrix.runs-on, 'macos') }} + shell: bash + run: | + brew install fmt + echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" + - name: Install dependencies on Windows + if: ${{ startsWith(matrix.runs-on, 'windows') }} + shell: pwsh + run: | + vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows sqlite3:x64-windows + - name: Configure Iceberg + shell: bash + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX="${ICEBERG_HOME}" \ + -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \ + -DICEBERG_BUILD_STATIC=ON \ + -DICEBERG_BUILD_SHARED=ON \ + -DICEBERG_BUILD_REST=OFF \ + -DICEBERG_BUILD_SQL_CATALOG=ON \ + -DICEBERG_SQL_SQLITE=ON \ + ${{ matrix.cmake_extra_args }} + - name: Build SQL catalog tests + shell: bash + run: cmake --build build --target sql_catalog_test + - name: Run SQL catalog tests + shell: bash + run: ctest --test-dir build -R '^sql_catalog_test$' --output-on-failure -C ${{ matrix.cmake_build_type }} diff --git a/.gitignore b/.gitignore index cac035cc0..458f876f7 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,10 @@ cmake-build-release/ .vscode .cache +# mkdocs generated output +/mkdocs/site/ +/mkdocs/docs/api/ + # devcontainer .devcontainer/* !.devcontainer/*.template diff --git a/CMakeLists.txt b/CMakeLists.txt index 38837aedd..c7a755ce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,12 @@ option(ICEBERG_BUILD_BUNDLE "Build the battery included library" ON) option(ICEBERG_BUILD_REST "Build rest catalog client" ON) option(ICEBERG_BUILD_REST_INTEGRATION_TESTS "Build rest catalog integration tests" OFF) option(ICEBERG_BUILD_HIVE "Build hive (HMS) catalog client" OFF) +option(ICEBERG_BUILD_SQL_CATALOG "Build SQL catalog client" OFF) +# Built-in SQL catalog database connectors. Disable all of them to build a SQL +# catalog that only works with a user-supplied CatalogStore. +option(ICEBERG_SQL_SQLITE "Build the SQLite connector for the SQL catalog" OFF) +option(ICEBERG_SQL_POSTGRESQL "Build the PostgreSQL connector for the SQL catalog" OFF) +option(ICEBERG_SQL_MYSQL "Build the MySQL connector for the SQL catalog" OFF) option(ICEBERG_S3 "Build with S3 support" OFF) option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) diff --git a/README.md b/README.md index 3590a2a7d..9dfdbcf7e 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,10 @@ cmake --install build | `ICEBERG_BUILD_REST` | `ON` | Build REST catalog client | | `ICEBERG_BUILD_REST_INTEGRATION_TESTS` | `OFF` | Build REST catalog integration tests | | `ICEBERG_BUILD_HIVE` | `OFF` | Build Hive (HMS) catalog client | +| `ICEBERG_BUILD_SQL_CATALOG` | `OFF` | Build SQL catalog client | +| `ICEBERG_SQL_SQLITE` | `OFF` | Build the SQLite connector for the SQL catalog | +| `ICEBERG_SQL_POSTGRESQL` | `OFF` | Build the PostgreSQL connector for the SQL catalog | +| `ICEBERG_SQL_MYSQL` | `OFF` | Build the MySQL connector for the SQL catalog | | `ICEBERG_ENABLE_ASAN` | `OFF` | Enable Address Sanitizer | | `ICEBERG_ENABLE_UBSAN` | `OFF` | Enable Undefined Behavior Sanitizer | diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index a0d418e05..e8f242f85 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -511,6 +511,90 @@ function(resolve_cpr_dependency) PARENT_SCOPE) endfunction() +# ---------------------------------------------------------------------- +# SQL catalog database connectors (sqlpp23) +# +# The SQL catalog talks to the database through a semantic `CatalogStore` +# interface (src/iceberg/catalog/sql/catalog_store.h). The built-in stores are +# implemented on top of sqlpp23, a header-only, compile-time type-safe SQL +# library. Each connector is opt-in and pulls in its native client library: +# +# ICEBERG_SQL_SQLITE -> sqlpp23::sqlite3 (SQLite::SQLite3) +# ICEBERG_SQL_POSTGRESQL -> sqlpp23::postgresql (PostgreSQL::PostgreSQL) +# ICEBERG_SQL_MYSQL -> sqlpp23::mysql (MySQL::MySQL) +# +# Users who inject their own `CatalogStore` do not need sqlpp23 or any connector. + +function(resolve_sql_catalog_dependencies) + if(NOT ICEBERG_SQL_SQLITE + AND NOT ICEBERG_SQL_POSTGRESQL + AND NOT ICEBERG_SQL_MYSQL) + message(STATUS "SQL catalog: no built-in connectors enabled") + return() + endif() + + if(CMAKE_VERSION VERSION_LESS 3.28) + message(FATAL_ERROR "Built-in SQL catalog connectors require CMake >= 3.28; disable " + "ICEBERG_SQL_SQLITE, ICEBERG_SQL_POSTGRESQL, and ICEBERG_SQL_MYSQL " + "or use CMake >= 3.28") + endif() + + prepare_fetchcontent() + + # sqlpp23 requires C++23 and CMake >= 3.28. + set(CMAKE_CXX_STANDARD 23) + # Header-only consumption; do not scan for C++20 modules. + set(BUILD_WITH_MODULES OFF) + # Let sqlpp23 verify and locate the native client libraries for the connectors + # we enable, exposing the sqlpp23:: targets. + set(BUILD_SQLITE3_CONNECTOR ${ICEBERG_SQL_SQLITE}) + set(BUILD_POSTGRESQL_CONNECTOR ${ICEBERG_SQL_POSTGRESQL}) + set(BUILD_MYSQL_CONNECTOR ${ICEBERG_SQL_MYSQL}) + + if(DEFINED ENV{ICEBERG_SQLPP23_URL}) + set(SQLPP23_URL "$ENV{ICEBERG_SQLPP23_URL}") + else() + set(SQLPP23_URL "https://github.com/rbock/sqlpp23/archive/refs/tags/0.69.tar.gz") + endif() + + fetchcontent_declare(sqlpp23 + ${FC_DECLARE_COMMON_OPTIONS} + URL ${SQLPP23_URL} + FIND_PACKAGE_ARGS + NAMES + Sqlpp23 + CONFIG) + fetchcontent_makeavailable(sqlpp23) + + # sqlpp23 locates the native client libraries within its own subdirectory + # scope. Re-run find_package with GLOBAL so the imported targets are visible + # where the SQL catalog library is defined, and record them as downstream + # system dependencies for the installed interface. + if(ICEBERG_SQL_SQLITE) + find_package(SQLite3 REQUIRED GLOBAL) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES SQLite3) + message(STATUS "SQL catalog: SQLite connector enabled (sqlpp23::sqlite3)") + endif() + if(ICEBERG_SQL_POSTGRESQL) + find_package(PostgreSQL REQUIRED GLOBAL) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES PostgreSQL) + message(STATUS "SQL catalog: PostgreSQL connector enabled (sqlpp23::postgresql)") + endif() + if(ICEBERG_SQL_MYSQL) + # MySQL has no standard CMake module; reuse the one sqlpp23 ships. + if(sqlpp23_SOURCE_DIR) + list(APPEND CMAKE_MODULE_PATH "${sqlpp23_SOURCE_DIR}/cmake/modules") + endif() + find_package(MySQL REQUIRED GLOBAL) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES MySQL) + message(STATUS "SQL catalog: MySQL connector enabled (sqlpp23::mysql)") + endif() + + set(ICEBERG_SYSTEM_DEPENDENCIES + ${ICEBERG_SYSTEM_DEPENDENCIES} + PARENT_SCOPE) +endfunction() + # ---------------------------------------------------------------------- # Zstd @@ -539,3 +623,7 @@ endif() if(ICEBERG_BUILD_REST) resolve_cpr_dependency() endif() + +if(ICEBERG_BUILD_SQL_CATALOG) + resolve_sql_catalog_dependencies() +endif() diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 012817c51..10a1a5c90 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -74,6 +74,11 @@ cmake --install build | `ICEBERG_BUILD_BUNDLE` | `ON` | Build the battery-included library | | `ICEBERG_BUILD_REST` | `ON` | Build REST catalog client | | `ICEBERG_BUILD_REST_INTEGRATION_TESTS` | `OFF` | Build REST catalog integration tests | +| `ICEBERG_BUILD_HIVE` | `OFF` | Build Hive (HMS) catalog client | +| `ICEBERG_BUILD_SQL_CATALOG` | `OFF` | Build SQL catalog client | +| `ICEBERG_SQL_SQLITE` | `OFF` | Build the SQLite connector for the SQL catalog | +| `ICEBERG_SQL_POSTGRESQL` | `OFF` | Build the PostgreSQL connector for the SQL catalog | +| `ICEBERG_SQL_MYSQL` | `OFF` | Build the MySQL connector for the SQL catalog | | `ICEBERG_ENABLE_ASAN` | `OFF` | Enable Address Sanitizer | | `ICEBERG_ENABLE_UBSAN` | `OFF` | Enable Undefined Behavior Sanitizer | diff --git a/mkdocs/docs/sql-catalog.md b/mkdocs/docs/sql-catalog.md new file mode 100644 index 000000000..7d2399f1f --- /dev/null +++ b/mkdocs/docs/sql-catalog.md @@ -0,0 +1,69 @@ + + +# SQL Catalog + +`SqlCatalog` implements the Iceberg `Catalog` API on top of a relational +database. Its schema is compatible with the Apache Iceberg Java `JdbcCatalog` +and stores catalog rows in `iceberg_tables` and +`iceberg_namespace_properties`. + +## Build + +The SQL catalog is currently available through the CMake build only. Meson does +not build or install it yet. + +Enable the catalog at configure time: + +```bash +cmake -S . -B build -DICEBERG_BUILD_SQL_CATALOG=ON +``` + +Built-in connectors are optional: + +| CMake option | Default | Native dependency | +|--------------|---------|-------------------| +| `ICEBERG_SQL_SQLITE` | `OFF` | SQLite3 | +| `ICEBERG_SQL_POSTGRESQL` | `OFF` | libpq | +| `ICEBERG_SQL_MYSQL` | `OFF` | libmysqlclient | + +The built-in connectors use +[sqlpp23](https://github.com/rbock/sqlpp23), which is fetched by CMake when a +connector is enabled. Projects can also supply their own `CatalogStore` +implementation and disable all built-in connectors. + +## Usage + +```cpp +#include "iceberg/catalog/sql/sql_catalog.h" + +using iceberg::sql::SqlCatalog; +using iceberg::sql::SqlCatalogConfig; + +SqlCatalogConfig config{ + .name = "prod", + .uri = "/var/lib/iceberg/catalog.db", + .warehouse_location = "s3://my-bucket/warehouse", +}; + +auto catalog = SqlCatalog::MakeSqliteCatalog(config, file_io).value(); +``` + +Connector factories are always declared in the public headers. If a connector +was not built, its factory returns `ErrorKind::kNotSupported`. diff --git a/mkdocs/mkdocs.yml b/mkdocs/mkdocs.yml index d15132ec3..724c18930 100644 --- a/mkdocs/mkdocs.yml +++ b/mkdocs/mkdocs.yml @@ -58,6 +58,7 @@ nav: - Release Process: release-process.md - Verify a Release Candidate: verify-rc.md - API Documentation: api/index.html + - SQL Catalog: sql-catalog.md extra: social: diff --git a/src/iceberg/catalog/CMakeLists.txt b/src/iceberg/catalog/CMakeLists.txt index 0b288e260..b092371cc 100644 --- a/src/iceberg/catalog/CMakeLists.txt +++ b/src/iceberg/catalog/CMakeLists.txt @@ -24,3 +24,7 @@ endif() if(ICEBERG_BUILD_HIVE) add_subdirectory(hive) endif() + +if(ICEBERG_BUILD_SQL_CATALOG) + add_subdirectory(sql) +endif() diff --git a/src/iceberg/catalog/sql/CMakeLists.txt b/src/iceberg/catalog/sql/CMakeLists.txt new file mode 100644 index 000000000..ce8cfffaa --- /dev/null +++ b/src/iceberg/catalog/sql/CMakeLists.txt @@ -0,0 +1,95 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Select the built-in database connectors to compile. The catalog logic itself +# is database-agnostic; each connector is an optional `CatalogStore` implementation +# built on sqlpp23 and linked against its native client library. +# +# sqlpp23 is a build-time-only (header-only) dependency: it is compiled into the +# connector translation units but never appears in the installed interface, so +# downstream consumers only need the native client libraries. +set(ICEBERG_SQL_CATALOG_SOURCES connection_uri.cc sql_catalog.cc) +# Targets used while building (header-only sqlpp23 connector targets). +set(ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS) +# Native client libraries required at link time, including by installed consumers. +set(ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS) + +if(ICEBERG_SQL_SQLITE) + set(BUILD_SQLITE3_CONNECTOR ON) + list(APPEND ICEBERG_SQL_CATALOG_SOURCES catalog_store_sqlite3.cc) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS sqlpp23::sqlite3) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS SQLite::SQLite3) +endif() + +if(ICEBERG_SQL_POSTGRESQL) + set(BUILD_POSTGRESQL_CONNECTOR ON) + list(APPEND ICEBERG_SQL_CATALOG_SOURCES catalog_store_postgresql.cc) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS sqlpp23::postgresql) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS PostgreSQL::PostgreSQL) +endif() + +if(ICEBERG_SQL_MYSQL) + set(BUILD_MYSQL_CONNECTOR ON) + list(APPEND ICEBERG_SQL_CATALOG_SOURCES catalog_store_mysql.cc) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS sqlpp23::mysql) + list(APPEND ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS MySQL::MySQL) +endif() + +# config.h.in uses #cmakedefine for the BUILD_*_CONNECTOR variables set above, +# so it must be configured after the connectors are selected. +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/config.h") + +set(ICEBERG_SQL_CATALOG_STATIC_BUILD_INTERFACE_LIBS) +set(ICEBERG_SQL_CATALOG_SHARED_BUILD_INTERFACE_LIBS) +set(ICEBERG_SQL_CATALOG_STATIC_INSTALL_INTERFACE_LIBS) +set(ICEBERG_SQL_CATALOG_SHARED_INSTALL_INTERFACE_LIBS) + +# The sqlpp23 connector targets are header-only and used only while building. +# The installed interface exposes only the native client libraries. +list(APPEND + ICEBERG_SQL_CATALOG_STATIC_BUILD_INTERFACE_LIBS + "$,iceberg_static,iceberg_shared>" + ${ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS} + ${ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS}) +list(APPEND + ICEBERG_SQL_CATALOG_SHARED_BUILD_INTERFACE_LIBS + "$,iceberg_shared,iceberg_static>" + ${ICEBERG_SQL_CATALOG_CONNECTOR_BUILD_LIBS} + ${ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS}) +list(APPEND + ICEBERG_SQL_CATALOG_STATIC_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_static,iceberg::iceberg_shared>" + ${ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS}) +list(APPEND + ICEBERG_SQL_CATALOG_SHARED_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_shared,iceberg::iceberg_static>" + ${ICEBERG_SQL_CATALOG_CONNECTOR_INSTALL_LIBS}) + +add_iceberg_lib(iceberg_sql_catalog + SOURCES + ${ICEBERG_SQL_CATALOG_SOURCES} + SHARED_LINK_LIBS + ${ICEBERG_SQL_CATALOG_SHARED_BUILD_INTERFACE_LIBS} + STATIC_LINK_LIBS + ${ICEBERG_SQL_CATALOG_STATIC_BUILD_INTERFACE_LIBS} + STATIC_INSTALL_INTERFACE_LIBS + ${ICEBERG_SQL_CATALOG_STATIC_INSTALL_INTERFACE_LIBS} + SHARED_INSTALL_INTERFACE_LIBS + ${ICEBERG_SQL_CATALOG_SHARED_INSTALL_INTERFACE_LIBS}) + +iceberg_install_all_headers(iceberg/catalog/sql) diff --git a/src/iceberg/catalog/sql/README.md b/src/iceberg/catalog/sql/README.md new file mode 100644 index 000000000..3dedd9325 --- /dev/null +++ b/src/iceberg/catalog/sql/README.md @@ -0,0 +1,164 @@ + + +# SQL Catalog + +`SqlCatalog` implements the Iceberg `Catalog` API on top of a relational +database. Its on-disk schema is compatible with the Apache Iceberg Java +`JdbcCatalog`: two tables, `iceberg_tables` and `iceberg_namespace_properties`, +scoped by a catalog name so multiple catalogs can share one database. + +## Design + +`SqlCatalog` owns the Iceberg catalog behavior. It validates namespaces, reads +and writes table metadata files, and performs optimistic-concurrency commits. +Database access is delegated to a small storage interface: + +``` +Application + | + v +SqlCatalog + | + | CatalogStore API + v +CatalogStore implementation + | + v +SQL database + - iceberg_tables + - iceberg_namespace_properties +``` + +`CatalogStore` (see [`catalog_store.h`](catalog_store.h)) exposes typed row +operations such as `InsertTable`, `GetTableMetadataLocation`, +`UpdateTableMetadataLocation(expected_current)`, namespace-property CRUD, and +`RunInTransaction`. It exposes no SQL strings or driver-specific types. + +The project provides built-in `CatalogStore` implementations for SQLite, +PostgreSQL, and MySQL. They are implemented with +[sqlpp23](https://github.com/rbock/sqlpp23), and the shared query code lives in +`catalog_store_sqlpp23_internal.h`. Users can also provide their own +`CatalogStore` implementation for another database, driver, or connection pool. + +sqlpp23 is a build-time-only dependency for the built-in stores. It is compiled +into the connector translation units and does not appear in the installed +interface, so downstream consumers only need the native client libraries. + +> The built-in sqlpp23 connectors require CMake >= 3.28 and C++23; sqlpp23 is +> fetched automatically via `FetchContent` when at least one built-in connector +> is enabled. A SQL catalog backed only by a user-supplied `CatalogStore` does not +> need sqlpp23. The SQL catalog is currently wired into the CMake build only; +> the Meson build does not build or install it yet. + +## Out-of-the-box usage + +Enable the SQL catalog and any built-in connectors at configure time. Built-in +connectors pull in their native client libraries via sqlpp23: + +| CMake option | Default | sqlpp23 target | Native dependency | +|-----------------------------|---------|-----------------------|------------------------| +| `ICEBERG_BUILD_SQL_CATALOG` | `OFF` | - | - | +| `ICEBERG_SQL_SQLITE` | `OFF` | `sqlpp23::sqlite3` | SQLite3 | +| `ICEBERG_SQL_POSTGRESQL` | `OFF` | `sqlpp23::postgresql` | libpq (PostgreSQL) | +| `ICEBERG_SQL_MYSQL` | `OFF` | `sqlpp23::mysql` | libmysqlclient (MySQL) | + +```bash +cmake -S . -B build -DICEBERG_BUILD_SQL_CATALOG=ON -DICEBERG_SQL_SQLITE=ON +``` + +```cpp +#include "iceberg/catalog/sql/sql_catalog.h" + +using iceberg::sql::SqlCatalog; +using iceberg::sql::SqlCatalogConfig; + +SqlCatalogConfig config{ + .name = "prod", + .uri = "/var/lib/iceberg/catalog.db", // SQLite file path + .warehouse_location = "s3://my-bucket/warehouse", +}; + +auto catalog = SqlCatalog::MakeSqliteCatalog(config, file_io).value(); +// catalog->CreateNamespace(...), CreateTable(...), LoadTable(...), ... +``` + +`MakePostgreSqlCatalog` and `MakeMySqlCatalog` use the same +`[scheme://][user[:password]@]host[:port][/database]` URI form. Connector +factories are always declared in the public headers; if a connector was not +built, its factory returns `ErrorKind::kNotSupported`. Each enabled factory +creates the schema if it does not yet exist. + +The PostgreSQL and MySQL stores use a single sqlpp23 connection when +`max_connections <= 1` and a bounded sqlpp23 connection pool otherwise. +Transaction bodies reuse the same leased connection for every store operation +issued inside `RunInTransaction`. The SQLite store ignores `max_connections` and +always uses a single connection: a file database only allows one writer (a pool +of write connections would just hit `SQLITE_BUSY`) and a `:memory:` database is +private to each connection. + +The backing schema follows the Java/Rust-compatible `iceberg_tables` layout, +including the optional `iceberg_type` column. New table rows write +`iceberg_type = 'TABLE'` as the record type; existing rows with `NULL` remain +readable for compatibility. + +## Bring your own store + +To use a database, driver, or connection pool that is not built in, implement +`CatalogStore` and inject it. No catalog code changes are required: + +```cpp +class MyCatalogStore : public iceberg::sql::CatalogStore { + public: + iceberg::Status Initialize() override { /* CREATE TABLE IF NOT EXISTS ... */ } + iceberg::Result> GetTableMetadataLocation( + std::string_view ns, std::string_view name) override { /* ... */ } + iceberg::Status InsertTable(std::string_view ns, std::string_view name, + std::string_view metadata_location) override { /* ... */ } + // ... the remaining CatalogStore operations ... + iceberg::Status RunInTransaction( + const std::function& body) override { /* ... */ } +}; + +auto store = std::make_shared(/* ... */); +auto catalog = SqlCatalog::Make(config, file_io, std::move(store)).value(); +``` + +### Implementation contract + +- **Catalog scope**: a store instance is bound to one catalog name; every row it + reads or writes must be scoped by that name. +- **Namespace identifiers**: namespace levels must not be empty and must not + contain `.` because the backing schema stores a namespace as a dot-joined + string. +- **Table rows**: new table inserts should write `iceberg_type = 'TABLE'` as + the record type. + Reads should treat both `TABLE` and `NULL` as table rows so older databases + remain readable. +- **Unique violations**: `InsertTable`, `InsertNamespaceProperty`, and + `RenameTable` must report a primary-key collision as `ErrorKind::kAlreadyExists`. + The catalog relies on this as the authoritative signal for concurrent creates. +- **Affected rows**: `UpdateTableMetadataLocation` performs the optimistic + compare-and-set; it must return the number of rows updated (0 on a stale base). +- **Atomicity**: `RunInTransaction` must commit on success and roll back on any + error so the database is left unchanged. +- **Threading**: a store may be called from multiple threads; serialize + internally or use one connection per concurrent operation. The built-in + PostgreSQL and MySQL stores use a bounded sqlpp23 connection pool when + `max_connections > 1`; the SQLite store always uses a single connection. diff --git a/src/iceberg/catalog/sql/catalog_store.h b/src/iceberg/catalog/sql/catalog_store.h new file mode 100644 index 000000000..19fbf931a --- /dev/null +++ b/src/iceberg/catalog/sql/catalog_store.h @@ -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. + */ + +#pragma once + +/// \file iceberg/catalog/sql/catalog_store.h +/// Storage abstraction for the SQL catalog. +/// +/// `CatalogStore` persists SQL catalog rows. `SqlCatalog` owns Iceberg +/// catalog semantics and uses this interface for database-specific row +/// operations. + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/catalog/sql/iceberg_sql_catalog_export.h" +#include "iceberg/result.h" + +namespace iceberg::sql { + +/// \brief A namespace property row. +struct ICEBERG_SQL_CATALOG_EXPORT NamespaceProperty { + /// Property key. + std::string key; + /// Property value, or `std::nullopt` for SQL NULL. + std::optional value; +}; + +/// \brief Connection parameters used to construct a built-in `CatalogStore`. +struct ICEBERG_SQL_CATALOG_EXPORT CatalogStoreOptions { + /// Logical catalog name used to scope rows. + std::string catalog_name; + /// Connector-specific connection string. + std::string uri; + /// Maximum number of database connections to use. + int32_t max_connections = 1; + /// Additional connector-specific properties. + std::unordered_map properties; +}; + +/// \brief Semantic, driver-agnostic storage interface for the SQL catalog. +/// +/// A store instance is scoped to one catalog name and persists namespace and +/// table rows. Implementations must be safe for concurrent calls from +/// `SqlCatalog`. +/// +/// Unique or primary-key constraint violations from insert and rename +/// operations must be reported as `ErrorKind::kAlreadyExists`. Other database +/// failures should be reported as `ErrorKind::kIOError`. +class ICEBERG_SQL_CATALOG_EXPORT CatalogStore { + public: + virtual ~CatalogStore() = default; + + /// \brief Create the backing tables if they do not already exist. + /// + /// \return Status indicating success if the tables are ready. + virtual Status Initialize() = 0; + + /// \brief Return the distinct namespace identifiers known to this catalog. + /// + /// \return A list of namespace identifiers in the store's string form. + virtual Result> ListNamespaceNames() = 0; + + /// \brief Return all property rows stored for `ns`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \return The property rows stored for the namespace. + virtual Result> GetNamespaceProperties( + std::string_view ns) = 0; + + /// \brief Insert one property row for `ns`. + /// + /// A primary-key collision (same namespace + key) must be reported as + /// `ErrorKind::kAlreadyExists`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \param key Property key. + /// \param value Property value, or `std::nullopt` for SQL NULL. + /// \return Status indicating success if the row was inserted. + virtual Status InsertNamespaceProperty(std::string_view ns, std::string_view key, + std::optional value) = 0; + + /// \brief Delete the property row identified by (`ns`, `key`), if present. + /// + /// \param ns A namespace identifier in the store's string form. + /// \param key Property key. + /// \return Status indicating success if the row was deleted or did not exist. + virtual Status DeleteNamespaceProperty(std::string_view ns, std::string_view key) = 0; + + /// \brief Delete all property rows for `ns`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \return The number of rows deleted. + virtual Result DeleteNamespace(std::string_view ns) = 0; + + /// \brief Return the table names stored directly under `ns`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \return A list of table names. + virtual Result> ListTableNames(std::string_view ns) = 0; + + /// \brief Whether a row exists for the table (`ns`, `name`). + /// + /// \param ns A namespace identifier in the store's string form. + /// \param name Table name. + /// \return true if the table row exists, false otherwise. + virtual Result TableExists(std::string_view ns, std::string_view name) = 0; + + /// \brief Return the current metadata location of (`ns`, `name`). + /// + /// \param ns A namespace identifier in the store's string form. + /// \param name Table name. + /// \return The metadata location, or `std::nullopt` if the table has no row + /// or its `metadata_location` column is NULL. + virtual Result> GetTableMetadataLocation( + std::string_view ns, std::string_view name) = 0; + + /// \brief Insert a new table row with the given metadata location. + /// + /// The `previous_metadata_location` column is set to NULL. A primary-key + /// collision must be reported as `ErrorKind::kAlreadyExists`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \param name Table name. + /// \param metadata_location Table metadata location. + /// \return Status indicating success if the row was inserted. + virtual Status InsertTable(std::string_view ns, std::string_view name, + std::string_view metadata_location) = 0; + + /// \brief Conditionally update a table's metadata location (optimistic CAS). + /// + /// The update only applies when the stored `metadata_location` still equals + /// `expected_current_location`. + /// + /// \param ns A namespace identifier in the store's string form. + /// \param name Table name. + /// \param new_location New table metadata location. + /// \param new_previous_location New previous metadata location. + /// \param expected_current_location Expected current metadata location. + /// \return The number of rows updated (1 on success, 0 on a stale base). + virtual Result UpdateTableMetadataLocation( + std::string_view ns, std::string_view name, std::string_view new_location, + std::string_view new_previous_location, + std::string_view expected_current_location) = 0; + + /// \brief Delete the table row (`ns`, `name`), if present. + /// + /// \param ns A namespace identifier in the store's string form. + /// \param name Table name. + /// \return The number of rows deleted. + virtual Result DeleteTable(std::string_view ns, std::string_view name) = 0; + + /// \brief Move a table row to a new namespace and/or name. + /// + /// A primary-key collision with an existing target must be reported as + /// `ErrorKind::kAlreadyExists`. + /// + /// \param from_ns Source namespace identifier in the store's string form. + /// \param from_name Source table name. + /// \param to_ns Target namespace identifier in the store's string form. + /// \param to_name Target table name. + /// \return The number of rows updated (1 on success, 0 if the source is gone). + virtual Result RenameTable(std::string_view from_ns, + std::string_view from_name, std::string_view to_ns, + std::string_view to_name) = 0; + + /// \brief Execute `body` atomically inside a single transaction. + /// + /// The implementation begins a transaction, invokes `body` (which issues + /// store operations on this same instance), then commits if `body` returns + /// success or rolls back otherwise. Implementations are not required to + /// support nesting. + /// + /// \param body Transaction body to execute. + /// \return Status returned by `body`, or a transaction error. + virtual Status RunInTransaction(const std::function& body) = 0; +}; + +/// \brief Build the built-in SQLite catalog store (sqlpp23 + SQLite3). +/// +/// `options.uri` is the SQLite database file path, or ":memory:". +/// +/// \param options Store connection options. +/// \return A catalog store instance, or ErrorKind::kNotSupported if the SQLite +/// connector was not built. +ICEBERG_SQL_CATALOG_EXPORT Result> MakeSqliteCatalogStore( + const CatalogStoreOptions& options); + +/// \brief Build the built-in PostgreSQL catalog store (sqlpp23 + libpq). +/// +/// `options.uri` is parsed as +/// `[scheme://][user[:password]@]host[:port][/database]`. +/// +/// \param options Store connection options. +/// \return A catalog store instance, or ErrorKind::kNotSupported if the +/// PostgreSQL connector was not built. +ICEBERG_SQL_CATALOG_EXPORT Result> +MakePostgreSqlCatalogStore(const CatalogStoreOptions& options); + +/// \brief Build the built-in MySQL catalog store (sqlpp23 + libmysqlclient). +/// +/// `options.uri` is parsed as +/// `[scheme://][user[:password]@]host[:port][/database]`. +/// +/// \param options Store connection options. +/// \return A catalog store instance, or ErrorKind::kNotSupported if the MySQL +/// connector was not built. +ICEBERG_SQL_CATALOG_EXPORT Result> MakeMySqlCatalogStore( + const CatalogStoreOptions& options); + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/catalog_store_mysql.cc b/src/iceberg/catalog/sql/catalog_store_mysql.cc new file mode 100644 index 000000000..1bd2f5787 --- /dev/null +++ b/src/iceberg/catalog/sql/catalog_store_mysql.cc @@ -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. + */ + +#include +#include +#include + +#include + +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/catalog_store_sqlpp23_internal.h" +#include "iceberg/catalog/sql/connection_uri_internal.h" +#include "iceberg/result.h" +#include "iceberg/util/macros.h" + +namespace iceberg::sql { + +namespace { + +// MySQL server error code for a duplicate key (ER_DUP_ENTRY). +constexpr unsigned int kMysqlErrDupEntry = 1062; +// MySQL server error code for a duplicate column (ER_DUP_FIELDNAME). +constexpr unsigned int kMysqlErrDupFieldName = 1060; + +/// Recognizes MySQL unique-constraint violations via the ER_DUP_ENTRY code. +struct MysqlTraits { + static bool IsUniqueViolation(const std::exception& error) { + const auto* mysql_error = dynamic_cast(&error); + return mysql_error != nullptr && mysql_error->error_code() == kMysqlErrDupEntry; + } + + static bool IsDuplicateColumn(const std::exception& error) { + const auto* mysql_error = dynamic_cast(&error); + return mysql_error != nullptr && mysql_error->error_code() == kMysqlErrDupFieldName; + } +}; + +using MysqlSingleCatalogStore = + Sqlpp23CatalogStore, MysqlTraits>; +using MysqlPooledCatalogStore = + Sqlpp23CatalogStore, + MysqlTraits>; + +void EnsureLibraryInitialized() { + static std::once_flag flag; + std::call_once(flag, [] { sqlpp::mysql::global_library_init(); }); +} + +} // namespace + +Result> MakeMySqlCatalogStore( + const CatalogStoreOptions& options) { + EnsureLibraryInitialized(); + + ICEBERG_ASSIGN_OR_RAISE(const auto parsed, ParseConnectionUri(options.uri)); + + auto config = std::make_shared(); + if (!parsed.host.empty()) { + config->host = parsed.host; + } + if (parsed.port.has_value()) { + config->port = *parsed.port; + } + config->database = parsed.database; + config->user = parsed.user; + config->password = parsed.password; + + try { + if (options.max_connections > 1) { + sqlpp::mysql::connection_pool pool( + config, static_cast(options.max_connections)); + return std::make_shared( + options.catalog_name, std::move(pool), options.max_connections); + } + + sqlpp::mysql::connection connection(config); + return std::make_shared(options.catalog_name, + std::move(connection)); + } catch (const std::exception& e) { + return IOError("Failed to connect to MySQL '{}': {}", options.uri, e.what()); + } +} + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/catalog_store_postgresql.cc b/src/iceberg/catalog/sql/catalog_store_postgresql.cc new file mode 100644 index 000000000..bcca2f367 --- /dev/null +++ b/src/iceberg/catalog/sql/catalog_store_postgresql.cc @@ -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. + */ + +#include +#include +#include + +#include + +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/catalog_store_sqlpp23_internal.h" +#include "iceberg/catalog/sql/connection_uri_internal.h" +#include "iceberg/result.h" +#include "iceberg/util/macros.h" + +namespace iceberg::sql { + +namespace { + +/// Recognizes PostgreSQL unique-constraint violations via SQLSTATE 23505 +/// (unique_violation), reported on `result_exception`. +struct PostgresqlTraits { + static bool IsUniqueViolation(const std::exception& error) { + const auto* result_error = + dynamic_cast(&error); + return result_error != nullptr && result_error->sql_state() == "23505"; + } + + static bool IsDuplicateColumn(const std::exception& error) { + const auto* result_error = + dynamic_cast(&error); + return result_error != nullptr && result_error->sql_state() == "42701"; + } +}; + +using PostgresqlSingleCatalogStore = + Sqlpp23CatalogStore, + PostgresqlTraits>; +using PostgresqlPooledCatalogStore = + Sqlpp23CatalogStore, + PostgresqlTraits>; + +} // namespace + +Result> MakePostgreSqlCatalogStore( + const CatalogStoreOptions& options) { + ICEBERG_ASSIGN_OR_RAISE(const auto parsed, ParseConnectionUri(options.uri)); + + auto config = std::make_shared(); + config->host = parsed.host; + if (parsed.port.has_value()) { + config->port = *parsed.port; + } + config->dbname = parsed.database; + config->user = parsed.user; + config->password = parsed.password; + + try { + if (options.max_connections > 1) { + sqlpp::postgresql::connection_pool pool( + config, static_cast(options.max_connections)); + return std::make_shared( + options.catalog_name, std::move(pool), options.max_connections); + } + + sqlpp::postgresql::connection connection(config); + return std::make_shared(options.catalog_name, + std::move(connection)); + } catch (const std::exception& e) { + return IOError("Failed to connect to PostgreSQL '{}': {}", options.uri, e.what()); + } +} + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/catalog_store_sqlite3.cc b/src/iceberg/catalog/sql/catalog_store_sqlite3.cc new file mode 100644 index 000000000..ca14f8af3 --- /dev/null +++ b/src/iceberg/catalog/sql/catalog_store_sqlite3.cc @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include + +#include +#include +#include + +#include + +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/catalog_store_sqlpp23_internal.h" +#include "iceberg/result.h" + +namespace iceberg::sql { + +namespace { + +/// Recognizes SQLite primary-key / unique-constraint violations. With extended +/// result codes enabled the connection reports SQLITE_CONSTRAINT_PRIMARYKEY / +/// SQLITE_CONSTRAINT_UNIQUE; the primary SQLITE_CONSTRAINT is matched too as a +/// safety net. +struct SqliteTraits { + static bool IsUniqueViolation(const std::exception& error) { + const auto* sqlite_error = dynamic_cast(&error); + if (sqlite_error == nullptr) { + return false; + } + const int code = sqlite_error->error_code(); + return code == SQLITE_CONSTRAINT || code == SQLITE_CONSTRAINT_PRIMARYKEY || + code == SQLITE_CONSTRAINT_UNIQUE; + } + + static bool IsDuplicateColumn(const std::exception& error) { + const auto* sqlite_error = dynamic_cast(&error); + return sqlite_error != nullptr && + std::string_view(sqlite_error->what()).find("duplicate column name") != + std::string_view::npos; + } +}; + +using SqliteSingleCatalogStore = + Sqlpp23CatalogStore, SqliteTraits>; + +} // namespace + +Result> MakeSqliteCatalogStore( + const CatalogStoreOptions& options) { + auto config = std::make_shared(); + config->path_to_database = options.uri.empty() ? ":memory:" : options.uri; + config->flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; + // Required so unique/primary-key violations surface their extended codes. + config->use_extended_result_codes = true; + + // SQLite always uses a single connection regardless of `max_connections`: a + // `:memory:` database is private to each connection, and a file database only + // allows one writer, so a pool of write connections would just hit + // SQLITE_BUSY. The single connection serializes access internally. + try { + sqlpp::sqlite3::connection connection(config); + return std::make_shared(options.catalog_name, + std::move(connection)); + } catch (const std::exception& e) { + return IOError("Failed to open SQLite database '{}': {}", config->path_to_database, + e.what()); + } +} + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/catalog_store_sqlpp23_internal.h b/src/iceberg/catalog/sql/catalog_store_sqlpp23_internal.h new file mode 100644 index 000000000..034d9d246 --- /dev/null +++ b/src/iceberg/catalog/sql/catalog_store_sqlpp23_internal.h @@ -0,0 +1,535 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/catalog/sql/catalog_store_sqlpp23_internal.h +/// Generic `CatalogStore` implementation on top of sqlpp23. +/// +/// The query bodies are identical across connectors: sqlpp23 serializes the +/// same typed statements into each SQL dialect automatically. Only two things +/// vary per connector, both supplied by the `Traits` policy: +/// - how driver errors are recognized as unique-constraint violations +/// (`Traits::IsUniqueViolation`). +/// - how driver errors are recognized as duplicate-column migrations +/// (`Traits::IsDuplicateColumn`). +/// +/// This is an internal header that pulls in sqlpp23; it is only included by the +/// per-connector factory translation units (`catalog_store_*.cc`). + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/sql_catalog_tables_internal.h" +#include "iceberg/result.h" + +namespace iceberg::sql { + +template +class SingleConnectionSource { + public: + explicit SingleConnectionSource(Connection connection) + : connection_(std::move(connection)) {} + + template + decltype(auto) WithConnection(Fn&& fn) { + std::lock_guard lock(mutex_); + return std::forward(fn)(connection_); + } + + Status RunInTransaction(const std::function& body) { + std::lock_guard lock(mutex_); + auto transaction = sqlpp::start_transaction(connection_); + try { + Status status = body(); + if (status.has_value()) { + transaction.commit(); + } else { + transaction.rollback(); + } + return status; + } catch (...) { + try { + transaction.rollback(); + } catch (...) { + } + throw; + } + } + + private: + Connection connection_; + std::recursive_mutex mutex_; +}; + +template +class PooledConnectionSource { + public: + using Connection = typename Pool::_pooled_connection_t; + + PooledConnectionSource(Pool pool, int32_t max_connections) + : pool_(std::move(pool)), max_connections_(std::max(1, max_connections)) {} + + template + decltype(auto) WithConnection(Fn&& fn) { + if (auto* connection = ActiveTransactionConnection()) { + return std::forward(fn)(*connection); + } + + ConnectionLease lease(*this); + auto connection = pool_.get(); + return std::forward(fn)(connection); + } + + Status RunInTransaction(const std::function& body) { + if (ActiveTransactionConnection() != nullptr) { + return InvalidArgument("Nested SQL catalog transactions are not supported"); + } + + ConnectionLease lease(*this); + auto connection = pool_.get(); + TransactionContext context{this, &connection}; + ScopedTransactionContext scope(context); + + auto transaction = sqlpp::start_transaction(connection); + try { + Status status = body(); + if (status.has_value()) { + transaction.commit(); + } else { + transaction.rollback(); + } + return status; + } catch (...) { + try { + transaction.rollback(); + } catch (...) { + } + throw; + } + } + + private: + struct TransactionContext { + PooledConnectionSource* owner; + Connection* connection; + }; + + class ScopedTransactionContext { + public: + explicit ScopedTransactionContext(TransactionContext& context) + : previous_(active_context_) { + active_context_ = &context; + } + + ScopedTransactionContext(const ScopedTransactionContext&) = delete; + ScopedTransactionContext& operator=(const ScopedTransactionContext&) = delete; + ScopedTransactionContext(ScopedTransactionContext&&) = delete; + ScopedTransactionContext& operator=(ScopedTransactionContext&&) = delete; + + ~ScopedTransactionContext() { active_context_ = previous_; } + + private: + TransactionContext* previous_; + }; + + class ConnectionLease { + public: + explicit ConnectionLease(PooledConnectionSource& source) : source_(source) { + std::unique_lock lock(source_.mutex_); + source_.available_.wait( + lock, [&] { return source_.active_connections_ < source_.max_connections_; }); + ++source_.active_connections_; + } + + ConnectionLease(const ConnectionLease&) = delete; + ConnectionLease& operator=(const ConnectionLease&) = delete; + ConnectionLease(ConnectionLease&&) = delete; + ConnectionLease& operator=(ConnectionLease&&) = delete; + + ~ConnectionLease() { + { + std::lock_guard lock(source_.mutex_); + --source_.active_connections_; + } + source_.available_.notify_one(); + } + + private: + PooledConnectionSource& source_; + }; + + Connection* ActiveTransactionConnection() { + if (active_context_ != nullptr && active_context_->owner == this) { + return active_context_->connection; + } + return nullptr; + } + + Pool pool_; + const int32_t max_connections_; + std::mutex mutex_; + std::condition_variable available_; + int32_t active_connections_ = 0; + + inline static thread_local TransactionContext* active_context_ = nullptr; +}; + +/// \brief `CatalogStore` backed by a concrete sqlpp23 connection source. +/// +/// \tparam ConnectionSource A single connection or pooled connection source. +/// \tparam Traits A policy type providing +/// `static bool IsUniqueViolation(const std::exception&)` +/// and optionally +/// `static bool IsDuplicateColumn(const std::exception&)`. +template +class Sqlpp23CatalogStore final : public CatalogStore { + public: + template + explicit Sqlpp23CatalogStore(std::string catalog_name, SourceArgs&&... source_args) + : source_(std::forward(source_args)...), + catalog_(std::move(catalog_name)) {} + + Status Initialize() override { + return Guard("initialize catalog tables", [&] { + source_.WithConnection([&](auto& connection) { + connection(std::string(kCreateTablesSql)); + connection(std::string(kCreateNamespacePropertiesSql)); + try { + connection(std::string(kAddRecordTypeSql)); + } catch (const std::exception& e) { + if (!IsDuplicateColumn(e)) { + throw; + } + } + }); + }); + } + + // --- Namespaces -------------------------------------------------------- + + Result> ListNamespaceNames() override { + const IcebergNamespaceProperties namespaces{}; + const IcebergTables tables{}; + std::vector names; + auto status = Guard("list namespaces", [&] { + source_.WithConnection([&](auto& connection) { + for (const auto& row : + connection(sqlpp::select(sqlpp::distinct, namespaces.ns) + .from(namespaces) + .where(namespaces.catalogName == catalog_))) { + names.emplace_back(row.ns); + } + for (const auto& row : + connection(sqlpp::select(sqlpp::distinct, tables.tableNamespace) + .from(tables) + .where(tables.catalogName == catalog_ and + TableRecordFilter(tables)))) { + names.emplace_back(row.tableNamespace); + } + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return names; + } + + Result> GetNamespaceProperties( + std::string_view ns) override { + const IcebergNamespaceProperties t{}; + std::vector properties; + auto status = Guard("get namespace properties", [&] { + source_.WithConnection([&](auto& connection) { + for (const auto& row : connection( + sqlpp::select(t.propertyKey, t.propertyValue) + .from(t) + .where(t.catalogName == catalog_ and t.ns == std::string(ns)))) { + NamespaceProperty property; + property.key = std::string(row.propertyKey); + if (row.propertyValue.has_value()) { + property.value = std::string(*row.propertyValue); + } + properties.push_back(std::move(property)); + } + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return properties; + } + + Status InsertNamespaceProperty(std::string_view ns, std::string_view key, + std::optional value) override { + const IcebergNamespaceProperties t{}; + std::optional value_str; + if (value.has_value()) value_str = std::string(*value); + return Guard("insert namespace property", [&] { + source_.WithConnection([&](auto& connection) { + connection(sqlpp::insert_into(t).set( + t.catalogName = catalog_, t.ns = std::string(ns), + t.propertyKey = std::string(key), t.propertyValue = value_str)); + }); + }); + } + + Status DeleteNamespaceProperty(std::string_view ns, std::string_view key) override { + const IcebergNamespaceProperties t{}; + return Guard("delete namespace property", [&] { + source_.WithConnection([&](auto& connection) { + connection(sqlpp::delete_from(t).where(t.catalogName == catalog_ and + t.ns == std::string(ns) and + t.propertyKey == std::string(key))); + }); + }); + } + + Result DeleteNamespace(std::string_view ns) override { + const IcebergNamespaceProperties t{}; + int64_t affected = 0; + auto status = Guard("delete namespace", [&] { + source_.WithConnection([&](auto& connection) { + affected = static_cast( + connection(sqlpp::delete_from(t).where(t.catalogName == catalog_ and + t.ns == std::string(ns))) + .affected_rows); + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return affected; + } + + // --- Tables ------------------------------------------------------------ + + Result> ListTableNames(std::string_view ns) override { + const IcebergTables t{}; + std::vector names; + auto status = Guard("list tables", [&] { + source_.WithConnection([&](auto& connection) { + for (const auto& row : + connection(sqlpp::select(t.tableName) + .from(t) + .where(t.catalogName == catalog_ and + t.tableNamespace == std::string(ns) and + TableRecordFilter(t)))) { + names.emplace_back(row.tableName); + } + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return names; + } + + Result TableExists(std::string_view ns, std::string_view name) override { + const IcebergTables t{}; + bool exists = false; + auto status = Guard("check table exists", [&] { + source_.WithConnection([&](auto& connection) { + auto result = connection(sqlpp::select(t.tableName) + .from(t) + .where(t.catalogName == catalog_ and + t.tableNamespace == std::string(ns) and + t.tableName == std::string(name) and + TableRecordFilter(t))); + exists = !result.empty(); + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return exists; + } + + Result> GetTableMetadataLocation( + std::string_view ns, std::string_view name) override { + const IcebergTables t{}; + std::optional location; + auto status = Guard("get table metadata location", [&] { + source_.WithConnection([&](auto& connection) { + auto result = connection(sqlpp::select(t.metadataLocation) + .from(t) + .where(t.catalogName == catalog_ and + t.tableNamespace == std::string(ns) and + t.tableName == std::string(name) and + TableRecordFilter(t))); + if (!result.empty()) { + const auto& row = result.front(); + if (row.metadataLocation.has_value()) { + location = std::string(*row.metadataLocation); + } + } + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return location; + } + + Status InsertTable(std::string_view ns, std::string_view name, + std::string_view metadata_location) override { + const IcebergTables t{}; + return Guard("insert table", [&] { + source_.WithConnection([&](auto& connection) { + connection(sqlpp::insert_into(t).set( + t.catalogName = catalog_, t.tableNamespace = std::string(ns), + t.tableName = std::string(name), + t.metadataLocation = std::string(metadata_location), + t.recordType = std::string(kTableRecordType))); + }); + }); + } + + Result UpdateTableMetadataLocation( + std::string_view ns, std::string_view name, std::string_view new_location, + std::string_view new_previous_location, + std::string_view expected_current_location) override { + const IcebergTables t{}; + int64_t affected = 0; + auto status = Guard("update table metadata location", [&] { + source_.WithConnection([&](auto& connection) { + affected = static_cast( + connection( + sqlpp::update(t) + .set(t.metadataLocation = std::string(new_location), + t.previousMetadataLocation = std::string(new_previous_location)) + .where(t.catalogName == catalog_ and + t.tableNamespace == std::string(ns) and + t.tableName == std::string(name) and + t.metadataLocation == + std::string(expected_current_location) and + TableRecordFilter(t))) + .affected_rows); + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return affected; + } + + Result DeleteTable(std::string_view ns, std::string_view name) override { + const IcebergTables t{}; + int64_t affected = 0; + auto status = Guard("delete table", [&] { + source_.WithConnection([&](auto& connection) { + affected = static_cast( + connection(sqlpp::delete_from(t).where(t.catalogName == catalog_ and + t.tableNamespace == std::string(ns) and + t.tableName == std::string(name) and + TableRecordFilter(t))) + .affected_rows); + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return affected; + } + + Result RenameTable(std::string_view from_ns, std::string_view from_name, + std::string_view to_ns, std::string_view to_name) override { + const IcebergTables t{}; + int64_t affected = 0; + auto status = Guard("rename table", [&] { + source_.WithConnection([&](auto& connection) { + affected = static_cast( + connection(sqlpp::update(t) + .set(t.tableNamespace = std::string(to_ns), + t.tableName = std::string(to_name)) + .where(t.catalogName == catalog_ and + t.tableNamespace == std::string(from_ns) and + t.tableName == std::string(from_name) and + TableRecordFilter(t))) + .affected_rows); + }); + }); + if (!status.has_value()) return std::unexpected(status.error()); + return affected; + } + + Status RunInTransaction(const std::function& body) override { + try { + return source_.RunInTransaction(body); + } catch (const std::exception& e) { + return Translate(e, "transaction"); + } + } + + private: + static constexpr std::string_view kTableRecordType = "TABLE"; + + auto TableRecordFilter(const IcebergTables& t) const { + return t.recordType == std::string(kTableRecordType) or t.recordType.is_null(); + } + + // Schema compatible with the Apache Iceberg Java JdbcCatalog. sqlpp23 cannot + // emit DDL, so these run as plain string statements. + static constexpr std::string_view kCreateTablesSql = + "CREATE TABLE IF NOT EXISTS iceberg_tables (" + "catalog_name VARCHAR(255) NOT NULL, " + "table_namespace VARCHAR(255) NOT NULL, " + "table_name VARCHAR(255) NOT NULL, " + "metadata_location VARCHAR(1000), " + "previous_metadata_location VARCHAR(1000), " + "iceberg_type VARCHAR(5), " + "PRIMARY KEY (catalog_name, table_namespace, table_name))"; + + static constexpr std::string_view kAddRecordTypeSql = + "ALTER TABLE iceberg_tables ADD COLUMN iceberg_type VARCHAR(5)"; + + static constexpr std::string_view kCreateNamespacePropertiesSql = + "CREATE TABLE IF NOT EXISTS iceberg_namespace_properties (" + "catalog_name VARCHAR(255) NOT NULL, " + "namespace VARCHAR(255) NOT NULL, " + "property_key VARCHAR(255) NOT NULL, " + "property_value VARCHAR(1000), " + "PRIMARY KEY (catalog_name, namespace, property_key))"; + + /// \brief Run `fn`, translating any thrown exception into a `Status`. + template + Status Guard(std::string_view op, Fn&& fn) { + try { + std::forward(fn)(); + return {}; + } catch (const std::exception& e) { + return Translate(e, op); + } + } + + Status Translate(const std::exception& e, std::string_view op) const { + if (Traits::IsUniqueViolation(e)) { + return AlreadyExists("{}: unique constraint violation: {}", op, e.what()); + } + return IOError("{}: {}", op, e.what()); + } + + bool IsDuplicateColumn(const std::exception& e) const { + if constexpr (requires { Traits::IsDuplicateColumn(e); }) { + return Traits::IsDuplicateColumn(e); + } + return false; + } + + ConnectionSource source_; + std::string catalog_; +}; + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/config.h.in b/src/iceberg/catalog/sql/config.h.in new file mode 100644 index 000000000..99f1f3881 --- /dev/null +++ b/src/iceberg/catalog/sql/config.h.in @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#cmakedefine BUILD_SQLITE3_CONNECTOR +#cmakedefine BUILD_POSTGRESQL_CONNECTOR +#cmakedefine BUILD_MYSQL_CONNECTOR diff --git a/src/iceberg/catalog/sql/connection_uri.cc b/src/iceberg/catalog/sql/connection_uri.cc new file mode 100644 index 000000000..b37844ada --- /dev/null +++ b/src/iceberg/catalog/sql/connection_uri.cc @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include + +#include "iceberg/catalog/sql/connection_uri_internal.h" +#include "iceberg/result.h" +#include "iceberg/util/macros.h" + +namespace iceberg::sql { + +namespace { + +Result ParsePort(std::string_view port_str, std::string_view uri) { + if (port_str.empty()) { + return InvalidArgument("Invalid SQL connection URI '{}': port is empty", uri); + } + + uint32_t port = 0; + const auto* begin = port_str.data(); + const auto* end = begin + port_str.size(); + const auto [ptr, error] = std::from_chars(begin, end, port); + if (error == std::errc::result_out_of_range) { + return InvalidArgument("Invalid SQL connection URI '{}': port is out of range", uri); + } + if (error != std::errc{} || ptr != end) { + return InvalidArgument("Invalid SQL connection URI '{}': port is not numeric", uri); + } + + return port; +} + +} // namespace + +Result ParseConnectionUri(std::string_view uri) { + ConnectionUri result; + const std::string original(uri); + + const bool has_scheme = uri.find("://") != std::string_view::npos; + if (const auto scheme = uri.find("://"); scheme != std::string_view::npos) { + uri.remove_prefix(scheme + 3); + } + + // Split off the path (database) after the first '/'. + std::string_view authority = uri; + if (const auto slash = uri.find('/'); slash != std::string_view::npos) { + authority = uri.substr(0, slash); + result.database = std::string(uri.substr(slash + 1)); + } + if (has_scheme && authority.empty()) { + return InvalidArgument("Invalid SQL connection URI '{}': authority is empty", + original); + } + + // Split userinfo from host at the last '@'. + std::string_view host_port = authority; + if (const auto at = authority.rfind('@'); at != std::string_view::npos) { + std::string_view userinfo = authority.substr(0, at); + host_port = authority.substr(at + 1); + if (const auto colon = userinfo.find(':'); colon != std::string_view::npos) { + result.user = std::string(userinfo.substr(0, colon)); + result.password = std::string(userinfo.substr(colon + 1)); + } else { + result.user = std::string(userinfo); + } + } + + // Split host from port at the last ':'. + if (const auto colon = host_port.rfind(':'); colon != std::string_view::npos) { + result.host = std::string(host_port.substr(0, colon)); + ICEBERG_ASSIGN_OR_RAISE(result.port, + ParsePort(host_port.substr(colon + 1), original)); + } else { + result.host = std::string(host_port); + } + + return result; +} + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/connection_uri_internal.h b/src/iceberg/catalog/sql/connection_uri_internal.h new file mode 100644 index 000000000..775bb52a9 --- /dev/null +++ b/src/iceberg/catalog/sql/connection_uri_internal.h @@ -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. + */ + +#pragma once + +/// \file iceberg/catalog/sql/connection_uri_internal.h +/// Minimal parser for `scheme://[user[:password]@]host[:port][/database]` +/// connection URIs, shared by the PostgreSQL and MySQL built-in stores. + +#include +#include +#include +#include + +#include "iceberg/result.h" + +namespace iceberg::sql { + +struct ConnectionUri { + std::string user; + std::string password; + std::string host; + std::optional port; + std::string database; +}; + +/// \brief Parse a `scheme://[user[:password]@]host[:port][/database]` URI. +/// +/// All components are optional; missing pieces are returned empty/unset. A +/// leading `scheme://` is stripped when present. Malformed syntax that cannot +/// be passed unambiguously to a SQL driver is returned as `InvalidArgument`. +Result ParseConnectionUri(std::string_view uri); + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/iceberg_sql_catalog_export.h b/src/iceberg/catalog/sql/iceberg_sql_catalog_export.h new file mode 100644 index 000000000..88921779b --- /dev/null +++ b/src/iceberg/catalog/sql/iceberg_sql_catalog_export.h @@ -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. + */ + +#pragma once + +#if defined(_WIN32) || defined(__CYGWIN__) +# ifdef ICEBERG_SQL_CATALOG_STATIC +# define ICEBERG_SQL_CATALOG_EXPORT +# elif defined(ICEBERG_SQL_CATALOG_EXPORTING) +# define ICEBERG_SQL_CATALOG_EXPORT __declspec(dllexport) +# else +# define ICEBERG_SQL_CATALOG_EXPORT __declspec(dllimport) +# endif +#else // Not Windows +# ifndef ICEBERG_SQL_CATALOG_EXPORT +# define ICEBERG_SQL_CATALOG_EXPORT __attribute__((visibility("default"))) +# endif +#endif diff --git a/src/iceberg/catalog/sql/sql_catalog.cc b/src/iceberg/catalog/sql/sql_catalog.cc new file mode 100644 index 000000000..eb066bacb --- /dev/null +++ b/src/iceberg/catalog/sql/sql_catalog.cc @@ -0,0 +1,632 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/catalog/sql/sql_catalog.h" + +#include +#include +#include + +#include "iceberg/catalog/sql/config.h" +#include "iceberg/table.h" +#include "iceberg/table_identifier.h" +#include "iceberg/table_metadata.h" +#include "iceberg/table_requirement.h" +#include "iceberg/table_requirements.h" +#include "iceberg/table_update.h" +#include "iceberg/transaction.h" +#include "iceberg/util/checked_cast.h" +#include "iceberg/util/location_util.h" +#include "iceberg/util/macros.h" + +namespace iceberg::sql { + +namespace { + +// Sentinel property guaranteeing a namespace row exists even with no user +// properties. Hidden from callers. +constexpr std::string_view kNamespaceExistsProperty = "exists"; +constexpr std::string_view kNamespaceLocationProperty = "location"; + +std::string NamespaceToString(const Namespace& ns) { return ns.ToString(); } + +std::string NamespaceToPath(const Namespace& ns) { + std::string path; + for (const auto& level : ns.levels) { + if (!path.empty()) { + path += '/'; + } + path += level; + } + return path; +} + +std::string JoinLocation(std::string_view parent, std::string_view child) { + std::string location(LocationUtil::StripTrailingSlash(parent)); + if (location.empty()) { + return std::string(child); + } + if (child.empty()) { + return location; + } + location += '/'; + location += child; + return location; +} + +// Returns true when `candidate` is a strict descendant of `parent` +// (i.e. parent is a non-empty prefix path, or parent is the root). +bool IsDescendant(std::string_view parent, std::string_view candidate) { + if (parent.empty()) { + return !candidate.empty(); + } + return candidate.size() > parent.size() && candidate.starts_with(parent) && + candidate[parent.size()] == '.'; +} + +Status ValidateNamespaceLevels(const Namespace& ns) { + for (const auto& level : ns.levels) { + if (level.empty()) { + return InvalidArgument("SQL catalog namespace levels cannot be empty"); + } + if (level.find('.') != std::string::npos) { + return InvalidArgument("SQL catalog namespace level '{}' cannot contain '.'", + level); + } + } + return {}; +} + +Status ValidateTableIdentifier(const TableIdentifier& identifier) { + ICEBERG_RETURN_UNEXPECTED(identifier.Validate()); + return ValidateNamespaceLevels(identifier.ns); +} + +Result ResolveTableLocation( + const SqlCatalogConfig& config, const TableIdentifier& identifier, + const std::unordered_map& namespace_properties, + std::string_view explicit_location) { + if (!explicit_location.empty()) { + return std::string(explicit_location); + } + + auto location = namespace_properties.find(std::string(kNamespaceLocationProperty)); + const std::string namespace_location = + location != namespace_properties.end() + ? location->second + : JoinLocation(config.warehouse_location, NamespaceToPath(identifier.ns)); + return JoinLocation(namespace_location, identifier.name); +} + +[[maybe_unused]] CatalogStoreOptions ToCatalogStoreOptions( + const SqlCatalogConfig& config) { + CatalogStoreOptions options; + options.catalog_name = config.name; + options.uri = config.uri; + options.max_connections = config.max_connections; + options.properties = config.props; + return options; +} + +} // namespace + +SqlCatalog::SqlCatalog(SqlCatalogConfig config, std::shared_ptr file_io, + std::shared_ptr store) + : config_(std::move(config)), + file_io_(std::move(file_io)), + store_(std::move(store)) {} + +SqlCatalog::~SqlCatalog() = default; + +Result> SqlCatalog::Make( + const SqlCatalogConfig& config, std::shared_ptr file_io, + std::shared_ptr store) { + if (store == nullptr) { + return InvalidArgument("SqlCatalog requires a non-null CatalogStore"); + } + if (file_io == nullptr) { + return InvalidArgument("SqlCatalog requires a non-null FileIO"); + } + auto catalog = std::shared_ptr( + new SqlCatalog(config, std::move(file_io), std::move(store))); + ICEBERG_RETURN_UNEXPECTED(catalog->store_->Initialize()); + return catalog; +} + +std::string_view SqlCatalog::name() const { return config_.name; } + +// -------------------------------------------------------------------------- +// Namespaces +// -------------------------------------------------------------------------- + +Result SqlCatalog::NamespaceExists(const Namespace& ns) const { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + if (ns.levels.empty()) { + // The implicit root namespace always exists. + return true; + } + const std::string ns_str = NamespaceToString(ns); + ICEBERG_ASSIGN_OR_RAISE(auto names, store_->ListNamespaceNames()); + for (const auto& candidate : names) { + if (candidate == ns_str || IsDescendant(ns_str, candidate)) { + return true; + } + } + return false; +} + +Status SqlCatalog::CreateNamespace( + const Namespace& ns, const std::unordered_map& properties) { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + if (ns.levels.empty()) { + return InvalidArgument("Cannot create namespace with empty identifier"); + } + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (exists) { + return AlreadyExists("Namespace already exists: {}", ns.ToString()); + } + if (properties.contains(std::string(kNamespaceExistsProperty))) { + return InvalidArgument("Property '{}' is reserved", kNamespaceExistsProperty); + } + + const std::string ns_str = NamespaceToString(ns); + return store_->RunInTransaction([&]() -> Status { + // Sentinel row so the namespace exists even when it has no user properties. + ICEBERG_RETURN_UNEXPECTED(store_->InsertNamespaceProperty( + ns_str, kNamespaceExistsProperty, std::string_view{"true"})); + for (const auto& [key, value] : properties) { + ICEBERG_RETURN_UNEXPECTED( + store_->InsertNamespaceProperty(ns_str, key, std::string_view{value})); + } + return {}; + }); +} + +Result> SqlCatalog::ListNamespaces(const Namespace& ns) const { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + if (!ns.levels.empty()) { + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (!exists) { + return NoSuchNamespace("Namespace does not exist: {}", ns.ToString()); + } + } + + ICEBERG_ASSIGN_OR_RAISE(auto names, store_->ListNamespaceNames()); + + const std::string parent = NamespaceToString(ns); + std::set children; + for (const auto& candidate : names) { + if (!IsDescendant(parent, candidate)) { + continue; + } + // Extract the immediate child level under `parent`. + const size_t start = parent.empty() ? 0 : parent.size() + 1; + const size_t dot = candidate.find('.', start); + children.insert(candidate.substr( + start, dot == std::string::npos ? std::string::npos : dot - start)); + } + + std::vector result_namespaces; + result_namespaces.reserve(children.size()); + for (const auto& child : children) { + Namespace child_ns = ns; + child_ns.levels.push_back(child); + result_namespaces.push_back(std::move(child_ns)); + } + return result_namespaces; +} + +Result> SqlCatalog::GetNamespaceProperties( + const Namespace& ns) const { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (!exists) { + return NoSuchNamespace("Namespace does not exist: {}", ns.ToString()); + } + + const std::string ns_str = NamespaceToString(ns); + ICEBERG_ASSIGN_OR_RAISE(auto rows, store_->GetNamespaceProperties(ns_str)); + + std::unordered_map properties; + for (const auto& row : rows) { + if (row.key == kNamespaceExistsProperty) { + continue; + } + properties.emplace(row.key, row.value.value_or("")); + } + return properties; +} + +Status SqlCatalog::DropNamespace(const Namespace& ns) { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + if (ns.levels.empty()) { + return InvalidArgument("Cannot drop the root namespace"); + } + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (!exists) { + return NoSuchNamespace("Namespace does not exist: {}", ns.ToString()); + } + + const std::string ns_str = NamespaceToString(ns); + + // Reject if the namespace still contains tables. + { + ICEBERG_ASSIGN_OR_RAISE(auto tables, store_->ListTableNames(ns_str)); + if (!tables.empty()) { + return NamespaceNotEmpty("Namespace {} is not empty: it contains tables", + ns.ToString()); + } + } + + // Reject if the namespace still has child namespaces. + { + ICEBERG_ASSIGN_OR_RAISE(auto names, store_->ListNamespaceNames()); + for (const auto& candidate : names) { + if (IsDescendant(ns_str, candidate)) { + return NamespaceNotEmpty("Namespace {} is not empty: it contains sub-namespaces", + ns.ToString()); + } + } + } + + ICEBERG_RETURN_UNEXPECTED(store_->DeleteNamespace(ns_str)); + return {}; +} + +Status SqlCatalog::UpdateNamespaceProperties( + const Namespace& ns, const std::unordered_map& updates, + const std::unordered_set& removals) { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (!exists) { + return NoSuchNamespace("Namespace does not exist: {}", ns.ToString()); + } + if (updates.contains(std::string(kNamespaceExistsProperty)) || + removals.contains(std::string(kNamespaceExistsProperty))) { + return InvalidArgument("Property '{}' is reserved", kNamespaceExistsProperty); + } + for (const auto& [key, value] : updates) { + if (removals.contains(key)) { + return InvalidArgument("Property '{}' is both updated and removed", key); + } + } + + const std::string ns_str = NamespaceToString(ns); + return store_->RunInTransaction([&]() -> Status { + for (const auto& key : removals) { + ICEBERG_RETURN_UNEXPECTED(store_->DeleteNamespaceProperty(ns_str, key)); + } + for (const auto& [key, value] : updates) { + // Portable upsert: delete then insert. + ICEBERG_RETURN_UNEXPECTED(store_->DeleteNamespaceProperty(ns_str, key)); + ICEBERG_RETURN_UNEXPECTED( + store_->InsertNamespaceProperty(ns_str, key, std::string_view{value})); + } + return {}; + }); +} + +// -------------------------------------------------------------------------- +// Tables +// -------------------------------------------------------------------------- + +Result> SqlCatalog::ListTables(const Namespace& ns) const { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceLevels(ns)); + if (!ns.levels.empty()) { + ICEBERG_ASSIGN_OR_RAISE(auto exists, NamespaceExists(ns)); + if (!exists) { + return NoSuchNamespace("Namespace does not exist: {}", ns.ToString()); + } + } + + const std::string ns_str = NamespaceToString(ns); + ICEBERG_ASSIGN_OR_RAISE(auto names, store_->ListTableNames(ns_str)); + + std::vector identifiers; + identifiers.reserve(names.size()); + for (auto& table_name : names) { + identifiers.push_back(TableIdentifier{.ns = ns, .name = std::move(table_name)}); + } + std::ranges::sort(identifiers, + [](const auto& lhs, const auto& rhs) { return lhs.name < rhs.name; }); + return identifiers; +} + +Result SqlCatalog::TableExists(const TableIdentifier& identifier) const { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + const std::string ns_str = NamespaceToString(identifier.ns); + return store_->TableExists(ns_str, identifier.name); +} + +Result SqlCatalog::GetTableMetadataLocation( + const TableIdentifier& identifier) const { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + const std::string ns_str = NamespaceToString(identifier.ns); + ICEBERG_ASSIGN_OR_RAISE(auto location, + store_->GetTableMetadataLocation(ns_str, identifier.name)); + if (!location.has_value()) { + return NoSuchTable("Table does not exist: {}", identifier.ToString()); + } + return *location; +} + +Result> SqlCatalog::LoadTableFrom( + const TableIdentifier& identifier, const std::string& metadata_location) { + ICEBERG_ASSIGN_OR_RAISE(auto metadata, + TableMetadataUtil::Read(*file_io_, metadata_location)); + return Table::Make(identifier, std::move(metadata), metadata_location, file_io_, + shared_from_this()); +} + +Result> SqlCatalog::LoadTable(const TableIdentifier& identifier) { + ICEBERG_ASSIGN_OR_RAISE(auto metadata_location, GetTableMetadataLocation(identifier)); + return LoadTableFrom(identifier, metadata_location); +} + +Result> SqlCatalog::CreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + ICEBERG_ASSIGN_OR_RAISE(auto ns_exists, NamespaceExists(identifier.ns)); + if (!ns_exists) { + return NoSuchNamespace("Namespace does not exist: {}", identifier.ns.ToString()); + } + ICEBERG_ASSIGN_OR_RAISE(auto table_exists, TableExists(identifier)); + if (table_exists) { + return AlreadyExists("Table already exists: {}", identifier.ToString()); + } + + ICEBERG_ASSIGN_OR_RAISE(auto namespace_properties, + GetNamespaceProperties(identifier.ns)); + ICEBERG_ASSIGN_OR_RAISE( + auto base_location, + ResolveTableLocation(config_, identifier, namespace_properties, location)); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, TableMetadata::Make(*schema, *spec, *order, + base_location, properties)); + ICEBERG_ASSIGN_OR_RAISE(auto metadata_location, + TableMetadataUtil::Write(*file_io_, nullptr, "", *metadata)); + + const std::string ns_str = NamespaceToString(identifier.ns); + ICEBERG_RETURN_UNEXPECTED( + store_->InsertTable(ns_str, identifier.name, metadata_location)); + + return Table::Make(identifier, std::move(metadata), metadata_location, file_io_, + shared_from_this()); +} + +Result> SqlCatalog::UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + ICEBERG_ASSIGN_OR_RAISE(auto is_create, TableRequirements::IsCreate(requirements)); + + std::unique_ptr base; + std::unique_ptr builder; + std::string base_location; + + if (is_create) { + ICEBERG_ASSIGN_OR_RAISE(auto exists, TableExists(identifier)); + if (exists) { + return AlreadyExists("Table already exists: {}", identifier.ToString()); + } + int8_t format_version = TableMetadata::kDefaultTableFormatVersion; + for (const auto& update : updates) { + if (update->kind() == TableUpdate::Kind::kUpgradeFormatVersion) { + format_version = + iceberg::internal::checked_cast(*update) + .format_version(); + } + } + builder = TableMetadataBuilder::BuildFromEmpty(format_version); + } else { + ICEBERG_ASSIGN_OR_RAISE(base_location, GetTableMetadataLocation(identifier)); + ICEBERG_ASSIGN_OR_RAISE(base, TableMetadataUtil::Read(*file_io_, base_location)); + builder = TableMetadataBuilder::BuildFrom(base.get()); + } + + for (const auto& requirement : requirements) { + ICEBERG_RETURN_UNEXPECTED(requirement->Validate(base.get())); + } + for (const auto& update : updates) { + update->ApplyTo(*builder); + } + ICEBERG_ASSIGN_OR_RAISE(auto updated, builder->Build()); + ICEBERG_ASSIGN_OR_RAISE( + auto new_metadata_location, + TableMetadataUtil::Write(*file_io_, base.get(), base_location, *updated)); + + const std::string ns_str = NamespaceToString(identifier.ns); + if (is_create) { + ICEBERG_RETURN_UNEXPECTED( + store_->InsertTable(ns_str, identifier.name, new_metadata_location)); + } else { + // Optimistic concurrency: only succeed if the stored metadata location is + // still the base we read. + ICEBERG_ASSIGN_OR_RAISE( + auto affected, store_->UpdateTableMetadataLocation(ns_str, identifier.name, + new_metadata_location, + base_location, base_location)); + if (affected != 1) { + return CommitFailed( + "Failed to commit to table {}: stale metadata location (concurrent update)", + identifier.ToString()); + } + TableMetadataUtil::DeleteRemovedMetadataFiles(*file_io_, base.get(), *updated); + } + + return Table::Make(identifier, std::move(updated), new_metadata_location, file_io_, + shared_from_this()); +} + +Result> SqlCatalog::StageCreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + ICEBERG_ASSIGN_OR_RAISE(auto ns_exists, NamespaceExists(identifier.ns)); + if (!ns_exists) { + return NoSuchNamespace("Namespace does not exist: {}", identifier.ns.ToString()); + } + ICEBERG_ASSIGN_OR_RAISE(auto table_exists, TableExists(identifier)); + if (table_exists) { + return AlreadyExists("Table already exists: {}", identifier.ToString()); + } + + ICEBERG_ASSIGN_OR_RAISE(auto namespace_properties, + GetNamespaceProperties(identifier.ns)); + ICEBERG_ASSIGN_OR_RAISE( + auto base_location, + ResolveTableLocation(config_, identifier, namespace_properties, location)); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, TableMetadata::Make(*schema, *spec, *order, + base_location, properties)); + ICEBERG_ASSIGN_OR_RAISE(auto table, + StagedTable::Make(identifier, std::move(metadata), "", file_io_, + shared_from_this())); + return Transaction::Make(std::move(table), TransactionKind::kCreate); +} + +Status SqlCatalog::DropTable(const TableIdentifier& identifier, bool purge) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + if (purge) { + // TODO(zhjwpku): Delete the table data and metadata files when purge is requested. + } + + const std::string ns_str = NamespaceToString(identifier.ns); + ICEBERG_ASSIGN_OR_RAISE(auto affected, store_->DeleteTable(ns_str, identifier.name)); + if (affected == 0) { + return NoSuchTable("Table does not exist: {}", identifier.ToString()); + } + return {}; +} + +Status SqlCatalog::RenameTable(const TableIdentifier& from, const TableIdentifier& to) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(from)); + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(to)); + if (from == to) { + return {}; + } + ICEBERG_ASSIGN_OR_RAISE(auto to_ns_exists, NamespaceExists(to.ns)); + if (!to_ns_exists) { + return NoSuchNamespace("Target namespace does not exist: {}", to.ns.ToString()); + } + + const std::string from_ns = NamespaceToString(from.ns); + const std::string to_ns = NamespaceToString(to.ns); + + return store_->RunInTransaction([&]() -> Status { + ICEBERG_ASSIGN_OR_RAISE(auto to_exists, TableExists(to)); + if (to_exists) { + return AlreadyExists("Table already exists: {}", to.ToString()); + } + ICEBERG_ASSIGN_OR_RAISE(auto affected, + store_->RenameTable(from_ns, from.name, to_ns, to.name)); + if (affected == 0) { + return NoSuchTable("Table does not exist: {}", from.ToString()); + } + return {}; + }); +} + +Result> SqlCatalog::RegisterTable( + const TableIdentifier& identifier, const std::string& metadata_file_location) { + ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); + ICEBERG_ASSIGN_OR_RAISE(auto ns_exists, NamespaceExists(identifier.ns)); + if (!ns_exists) { + return NoSuchNamespace("Namespace does not exist: {}", identifier.ns.ToString()); + } + ICEBERG_ASSIGN_OR_RAISE(auto table_exists, TableExists(identifier)); + if (table_exists) { + return AlreadyExists("Table already exists: {}", identifier.ToString()); + } + + ICEBERG_ASSIGN_OR_RAISE(auto metadata, + TableMetadataUtil::Read(*file_io_, metadata_file_location)); + + const std::string ns_str = NamespaceToString(identifier.ns); + ICEBERG_RETURN_UNEXPECTED( + store_->InsertTable(ns_str, identifier.name, metadata_file_location)); + + return Table::Make(identifier, std::move(metadata), metadata_file_location, file_io_, + shared_from_this()); +} + +// -------------------------------------------------------------------------- +// Built-in catalog store factories +// -------------------------------------------------------------------------- + +Result> SqlCatalog::MakeSqliteCatalog( + [[maybe_unused]] const SqlCatalogConfig& config, + [[maybe_unused]] std::shared_ptr file_io) { +#ifdef BUILD_SQLITE3_CONNECTOR + ICEBERG_ASSIGN_OR_RAISE(auto store, + MakeSqliteCatalogStore(ToCatalogStoreOptions(config))); + return Make(config, std::move(file_io), std::move(store)); +#else + return NotSupported("SQLite SQL catalog connector is not built"); +#endif // BUILD_SQLITE3_CONNECTOR +} + +Result> SqlCatalog::MakePostgreSqlCatalog( + [[maybe_unused]] const SqlCatalogConfig& config, + [[maybe_unused]] std::shared_ptr file_io) { +#ifdef BUILD_POSTGRESQL_CONNECTOR + ICEBERG_ASSIGN_OR_RAISE(auto store, + MakePostgreSqlCatalogStore(ToCatalogStoreOptions(config))); + return Make(config, std::move(file_io), std::move(store)); +#else + return NotSupported("PostgreSQL SQL catalog connector is not built"); +#endif // BUILD_POSTGRESQL_CONNECTOR +} + +Result> SqlCatalog::MakeMySqlCatalog( + [[maybe_unused]] const SqlCatalogConfig& config, + [[maybe_unused]] std::shared_ptr file_io) { +#ifdef BUILD_MYSQL_CONNECTOR + ICEBERG_ASSIGN_OR_RAISE(auto store, + MakeMySqlCatalogStore(ToCatalogStoreOptions(config))); + return Make(config, std::move(file_io), std::move(store)); +#else + return NotSupported("MySQL SQL catalog connector is not built"); +#endif // BUILD_MYSQL_CONNECTOR +} + +#ifndef BUILD_SQLITE3_CONNECTOR +Result> MakeSqliteCatalogStore(const CatalogStoreOptions&) { + return NotSupported("SQLite SQL catalog connector is not built"); +} +#endif // BUILD_SQLITE3_CONNECTOR + +#ifndef BUILD_POSTGRESQL_CONNECTOR +Result> MakePostgreSqlCatalogStore( + const CatalogStoreOptions&) { + return NotSupported("PostgreSQL SQL catalog connector is not built"); +} +#endif // BUILD_POSTGRESQL_CONNECTOR + +#ifndef BUILD_MYSQL_CONNECTOR +Result> MakeMySqlCatalogStore(const CatalogStoreOptions&) { + return NotSupported("MySQL SQL catalog connector is not built"); +} +#endif // BUILD_MYSQL_CONNECTOR + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/sql_catalog.h b/src/iceberg/catalog/sql/sql_catalog.h new file mode 100644 index 000000000..35ef107b1 --- /dev/null +++ b/src/iceberg/catalog/sql/sql_catalog.h @@ -0,0 +1,189 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/catalog/sql/sql_catalog.h +/// SQL catalog implementation. +/// +/// `SqlCatalog` implements the Iceberg `Catalog` API on top of a relational +/// database. Database access goes through the `CatalogStore` interface. + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/catalog.h" +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/iceberg_sql_catalog_export.h" +#include "iceberg/result.h" +#include "iceberg/table_identifier.h" +#include "iceberg/type_fwd.h" + +namespace iceberg::sql { + +/// \brief Default maximum number of database connections for built-in SQL stores. +constexpr static int32_t kMaxConnections = 10; + +/// \brief Configuration for the SQL catalog. +struct ICEBERG_SQL_CATALOG_EXPORT SqlCatalogConfig { + /// Logical catalog name. Scopes all rows via the `catalog_name` column so that + /// multiple catalogs can share one database. + std::string name = "sql_catalog"; + /// Database connection string interpreted by the chosen `CatalogStore`. + std::string uri; + /// Base location used to derive table locations when none is supplied. + std::string warehouse_location; + /// Maximum number of database connections. Built-in stores use a single + /// connection when this is 1 and a bounded sqlpp23 connection pool otherwise. + int32_t max_connections = kMaxConnections; + /// Additional connector-specific properties. + std::unordered_map props; +}; + +/// \brief SQL-backed Iceberg catalog. +class ICEBERG_SQL_CATALOG_EXPORT SqlCatalog + : public Catalog, + public std::enable_shared_from_this { + public: + ~SqlCatalog() override; + + SqlCatalog(const SqlCatalog&) = delete; + SqlCatalog& operator=(const SqlCatalog&) = delete; + SqlCatalog(SqlCatalog&&) = delete; + SqlCatalog& operator=(SqlCatalog&&) = delete; + + /// \brief Create a catalog backed by a user-supplied `CatalogStore`. + /// + /// This is the extension point for custom databases/drivers: implement + /// `CatalogStore` and pass it here. The catalog initializes its schema + /// (creating the backing tables if they do not exist) before returning. + /// + /// \param config Catalog configuration (name and warehouse location are used; + /// `uri` is informational because the store is already constructed). + /// \param file_io File IO used to read and write table metadata files. + /// \param store The catalog metadata store. Must not be null. + static Result> Make(const SqlCatalogConfig& config, + std::shared_ptr file_io, + std::shared_ptr store); + + std::string_view name() const override; + + Status CreateNamespace( + const Namespace& ns, + const std::unordered_map& properties) override; + + Result> ListNamespaces(const Namespace& ns) const override; + + Result> GetNamespaceProperties( + const Namespace& ns) const override; + + Status DropNamespace(const Namespace& ns) override; + + Result NamespaceExists(const Namespace& ns) const override; + + Status UpdateNamespaceProperties( + const Namespace& ns, const std::unordered_map& updates, + const std::unordered_set& removals) override; + + Result> ListTables(const Namespace& ns) const override; + + Result> CreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override; + + Result> UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) override; + + Result> StageCreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override; + + Result TableExists(const TableIdentifier& identifier) const override; + + /// \brief Drop a table. + /// + /// SqlCatalog currently removes only the catalog entry. Support for deleting + /// table data and metadata files when `purge` is true is not implemented yet. + Status DropTable(const TableIdentifier& identifier, bool purge) override; + + Status RenameTable(const TableIdentifier& from, const TableIdentifier& to) override; + + Result> LoadTable(const TableIdentifier& identifier) override; + + Result> RegisterTable( + const TableIdentifier& identifier, + const std::string& metadata_file_location) override; + + /// \brief Create a catalog backed by the built-in SQLite client. + /// + /// \param config `uri` is the SQLite database file path (or ":memory:"). + /// \param file_io File IO used to read and write table metadata files. + /// \return A catalog instance, or ErrorKind::kNotSupported if the SQLite + /// connector was not built. + static Result> MakeSqliteCatalog( + const SqlCatalogConfig& config, std::shared_ptr file_io); + + /// \brief Create a catalog backed by the built-in PostgreSQL (libpq) client. + /// + /// \param config `uri` is parsed as + /// `[scheme://][user[:password]@]host[:port][/database]`. + /// \param file_io File IO used to read and write table metadata files. + /// \return A catalog instance, or ErrorKind::kNotSupported if the PostgreSQL + /// connector was not built. + static Result> MakePostgreSqlCatalog( + const SqlCatalogConfig& config, std::shared_ptr file_io); + + /// \brief Create a catalog backed by the built-in MySQL client. + /// + /// \param config `uri` is parsed as + /// `[scheme://][user[:password]@]host[:port][/database]`. + /// \param file_io File IO used to read and write table metadata files. + /// \return A catalog instance, or ErrorKind::kNotSupported if the MySQL + /// connector was not built. + static Result> MakeMySqlCatalog( + const SqlCatalogConfig& config, std::shared_ptr file_io); + + private: + SqlCatalog(SqlCatalogConfig config, std::shared_ptr file_io, + std::shared_ptr store); + + /// \brief Resolve the current metadata location for a table, or NoSuchTable. + Result GetTableMetadataLocation(const TableIdentifier& identifier) const; + + /// \brief Build a Table object from a metadata location. + Result> LoadTableFrom(const TableIdentifier& identifier, + const std::string& metadata_location); + + SqlCatalogConfig config_; + std::shared_ptr file_io_; + std::shared_ptr store_; +}; + +} // namespace iceberg::sql diff --git a/src/iceberg/catalog/sql/sql_catalog_tables_internal.h b/src/iceberg/catalog/sql/sql_catalog_tables_internal.h new file mode 100644 index 000000000..a679dc6a2 --- /dev/null +++ b/src/iceberg/catalog/sql/sql_catalog_tables_internal.h @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/catalog/sql/sql_catalog_tables_internal.h +/// sqlpp23 table models for the SQL catalog's backing tables. +/// +/// These mirror the hand-written shape that sqlpp23's `ddl2cpp` generator would +/// produce. The schema is compatible with the Apache Iceberg Java +/// `JdbcCatalog`: `iceberg_tables` and `iceberg_namespace_properties`, both +/// scoped by a `catalog_name` column. +/// +/// This is an internal header: it pulls in sqlpp23 and is only included by the +/// built-in store implementations, never by public catalog headers. + +#include + +#include +#include +#include +#include + +namespace iceberg::sql { + +// sqlpp23 name tags require a static `const char name[]` member; the +// `SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP` macro provides that required shape. +// NOLINTBEGIN(modernize-avoid-c-arrays) + +struct IcebergTables_ { + struct CatalogName { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(catalog_name, catalogName); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct TableNamespace { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(table_namespace, tableNamespace); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct TableName { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(table_name, tableName); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct MetadataLocation { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(metadata_location, metadataLocation); + using data_type = std::optional<::sqlpp::text>; + using has_default = std::true_type; + }; + struct PreviousMetadataLocation { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(previous_metadata_location, + previousMetadataLocation); + using data_type = std::optional<::sqlpp::text>; + using has_default = std::true_type; + }; + struct RecordType { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(iceberg_type, recordType); + using data_type = std::optional<::sqlpp::text>; + using has_default = std::true_type; + }; + + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(iceberg_tables, icebergTables); + + template + using _table_columns = sqlpp::table_columns; + using _required_insert_columns = sqlpp::detail::type_set< + sqlpp::column_t, CatalogName>, + sqlpp::column_t, TableNamespace>, + sqlpp::column_t, TableName>>; +}; +using IcebergTables = ::sqlpp::table_t; + +struct IcebergNamespaceProperties_ { + struct CatalogName { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(catalog_name, catalogName); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct Namespace { + // SQL column name is `namespace`; the C++ member cannot be a keyword. + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(namespace, ns); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct PropertyKey { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(property_key, propertyKey); + using data_type = ::sqlpp::text; + using has_default = std::false_type; + }; + struct PropertyValue { + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(property_value, propertyValue); + using data_type = std::optional<::sqlpp::text>; + using has_default = std::true_type; + }; + + SQLPP_CREATE_NAME_TAG_FOR_SQL_AND_CPP(iceberg_namespace_properties, + icebergNamespaceProperties); + + template + using _table_columns = sqlpp::table_columns; + using _required_insert_columns = sqlpp::detail::type_set< + sqlpp::column_t, CatalogName>, + sqlpp::column_t, Namespace>, + sqlpp::column_t, PropertyKey>>; +}; +using IcebergNamespaceProperties = ::sqlpp::table_t; + +// NOLINTEND(modernize-avoid-c-arrays) + +} // namespace iceberg::sql diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 7a46cdd1d..0339ee1a9 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -30,6 +30,8 @@ # iceberg::iceberg_bundle_static # iceberg::iceberg_rest_shared # iceberg::iceberg_rest_static +# iceberg::iceberg_catalog_sql_shared +# iceberg::iceberg_catalog_sql_static @PACKAGE_INIT@ diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index cbdd696f1..65afdea32 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -238,6 +238,22 @@ if(ICEBERG_BUILD_BUNDLE) endif() +if(ICEBERG_BUILD_SQL_CATALOG + AND ICEBERG_SQL_SQLITE + AND ICEBERG_BUILD_BUNDLE) + add_executable(sql_catalog_test) + target_include_directories(sql_catalog_test PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/") + target_sources(sql_catalog_test PRIVATE sql_catalog_test.cc) + target_link_libraries(sql_catalog_test + PRIVATE iceberg_sql_catalog_static + "$,iceberg_bundle_static,iceberg_bundle_shared>" + GTest::gmock_main) + if(MSVC_TOOLCHAIN) + target_compile_options(sql_catalog_test PRIVATE /bigobj) + endif() + add_test(NAME sql_catalog_test COMMAND sql_catalog_test) +endif() + if(ICEBERG_BUILD_REST) function(add_rest_iceberg_test test_name) set(options USE_BUNDLE) diff --git a/src/iceberg/test/sql_catalog_test.cc b/src/iceberg/test/sql_catalog_test.cc new file mode 100644 index 000000000..41953b14d --- /dev/null +++ b/src/iceberg/test/sql_catalog_test.cc @@ -0,0 +1,439 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/catalog/sql/sql_catalog.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/catalog/sql/catalog_store.h" +#include "iceberg/catalog/sql/connection_uri_internal.h" +#include "iceberg/partition_spec.h" +#include "iceberg/schema.h" +#include "iceberg/sort_order.h" +#include "iceberg/table.h" +#include "iceberg/table_identifier.h" +#include "iceberg/test/matchers.h" +#include "iceberg/type.h" + +namespace iceberg::sql { + +namespace { + +std::filesystem::path SqliteTestPath(std::string_view name) { + return std::filesystem::temp_directory_path() / + (std::string("iceberg_sql_catalog_") + std::string(name) + ".db"); +} + +void ExecSql(const std::filesystem::path& path, std::string_view sql) { + sqlite3* raw_db = nullptr; + ASSERT_EQ(sqlite3_open(path.string().c_str(), &raw_db), SQLITE_OK); + std::unique_ptr db(raw_db, sqlite3_close); + + char* error_message = nullptr; + const int result = + sqlite3_exec(db.get(), std::string(sql).c_str(), nullptr, nullptr, &error_message); + std::unique_ptr error(error_message, sqlite3_free); + ASSERT_EQ(result, SQLITE_OK) << (error ? error.get() : ""); +} + +std::optional QuerySingleText(const std::filesystem::path& path, + std::string_view sql) { + sqlite3* raw_db = nullptr; + if (sqlite3_open(path.string().c_str(), &raw_db) != SQLITE_OK) { + ADD_FAILURE() << "failed to open sqlite database"; + return std::nullopt; + } + std::unique_ptr db(raw_db, sqlite3_close); + + sqlite3_stmt* raw_stmt = nullptr; + if (sqlite3_prepare_v2(db.get(), std::string(sql).c_str(), -1, &raw_stmt, nullptr) != + SQLITE_OK) { + ADD_FAILURE() << sqlite3_errmsg(db.get()); + return std::nullopt; + } + std::unique_ptr stmt(raw_stmt, + sqlite3_finalize); + + const int step = sqlite3_step(stmt.get()); + if (step != SQLITE_ROW) { + ADD_FAILURE() << "query returned no row"; + return std::nullopt; + } + + const auto* text = sqlite3_column_text(stmt.get(), 0); + if (text == nullptr) { + return std::nullopt; + } + return std::string(reinterpret_cast(text)); +} + +} // namespace + +class SqlCatalogTest : public ::testing::Test { + protected: + void SetUp() override { + file_io_ = arrow::ArrowFileSystemFileIO::MakeLocalFileIO(); + auto store = + MakeSqliteCatalogStore({.catalog_name = "test_catalog", .uri = ":memory:"}); + ASSERT_THAT(store, IsOk()); + + SqlCatalogConfig config{ + .name = "test_catalog", + .uri = ":memory:", + .warehouse_location = WarehouseLocation(), + }; + auto catalog = SqlCatalog::Make(config, file_io_, store.value()); + ASSERT_THAT(catalog, IsOk()); + store_ = store.value(); + catalog_ = catalog.value(); + } + + void TearDown() override { + std::error_code ec; + std::filesystem::remove_all(WarehouseDir(), ec); + } + + std::string WarehouseDir() const { + return (std::filesystem::temp_directory_path() / "iceberg_sql_catalog_test").string(); + } + + std::string WarehouseLocation() const { + return std::filesystem::path(WarehouseDir()).generic_string(); + } + + // Returns a table base location whose metadata directory already exists, since + // the local Arrow FileIO does not create parent directories on write. + std::string MakeTableLocation(const std::string& name) const { + auto location = std::filesystem::path(WarehouseDir()) / name; + std::filesystem::create_directories(location / "metadata"); + return location.string(); + } + + std::shared_ptr MakeSchema() const { + return std::make_shared( + std::vector{SchemaField::MakeRequired(1, "x", int64())}, + /*schema_id=*/1); + } + + std::shared_ptr file_io_; + std::shared_ptr store_; + std::shared_ptr catalog_; +}; + +TEST(ConnectionUriTest, ParsesUserHostPortAndDatabase) { + auto parsed = ParseConnectionUri("postgresql://alice:secret@db.example:5432/prod"); + ASSERT_THAT(parsed, IsOk()); + EXPECT_EQ(parsed->user, "alice"); + EXPECT_EQ(parsed->password, "secret"); + EXPECT_EQ(parsed->host, "db.example"); + EXPECT_EQ(parsed->port, 5432); + EXPECT_EQ(parsed->database, "prod"); +} + +TEST(ConnectionUriTest, RejectsInvalidPort) { + EXPECT_THAT(ParseConnectionUri("mysql://db.example:/prod"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(ParseConnectionUri("mysql://db.example:abc/prod"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(ParseConnectionUri("mysql://db.example:4294967296/prod"), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(SqlCatalogTest, CatalogName) { EXPECT_EQ(catalog_->name(), "test_catalog"); } + +TEST_F(SqlCatalogTest, NamespaceLifecycle) { + Namespace ns{{"db"}}; + EXPECT_THAT(catalog_->NamespaceExists(ns), HasValue(::testing::Eq(false))); + + EXPECT_THAT(catalog_->CreateNamespace(ns, {{"owner", "alice"}}), IsOk()); + EXPECT_THAT(catalog_->NamespaceExists(ns), HasValue(::testing::Eq(true))); + + // Duplicate creation fails. + EXPECT_THAT(catalog_->CreateNamespace(ns, {}), IsError(ErrorKind::kAlreadyExists)); + + // Properties round-trip, sentinel hidden. + auto props = catalog_->GetNamespaceProperties(ns); + ASSERT_THAT(props, IsOk()); + EXPECT_EQ(props->size(), 1); + EXPECT_EQ(props->at("owner"), "alice"); + + // Update + remove. + EXPECT_THAT( + catalog_->UpdateNamespaceProperties(ns, {{"owner", "bob"}, {"team", "x"}}, {}), + IsOk()); + EXPECT_THAT(catalog_->UpdateNamespaceProperties(ns, {}, {"team"}), IsOk()); + props = catalog_->GetNamespaceProperties(ns); + ASSERT_THAT(props, IsOk()); + EXPECT_EQ(props->at("owner"), "bob"); + EXPECT_FALSE(props->contains("team")); + + EXPECT_THAT(catalog_->DropNamespace(ns), IsOk()); + EXPECT_THAT(catalog_->NamespaceExists(ns), HasValue(::testing::Eq(false))); +} + +TEST_F(SqlCatalogTest, ListNamespacesReturnsImmediateChildren) { + ASSERT_THAT(catalog_->CreateNamespace(Namespace{{"a"}}, {}), IsOk()); + ASSERT_THAT(catalog_->CreateNamespace(Namespace{{"a", "b"}}, {}), IsOk()); + ASSERT_THAT(catalog_->CreateNamespace(Namespace{{"a", "c"}}, {}), IsOk()); + + auto children = catalog_->ListNamespaces(Namespace{{"a"}}); + ASSERT_THAT(children, IsOk()); + EXPECT_THAT(*children, ::testing::UnorderedElementsAre(Namespace{{"a", "b"}}, + Namespace{{"a", "c"}})); + + // Parent with children cannot be dropped. + EXPECT_THAT(catalog_->DropNamespace(Namespace{{"a"}}), + IsError(ErrorKind::kNamespaceNotEmpty)); +} + +TEST_F(SqlCatalogTest, TableLifecycle) { + Namespace ns{{"db"}}; + ASSERT_THAT(catalog_->CreateNamespace(ns, {}), IsOk()); + + TableIdentifier ident{.ns = ns, .name = "t1"}; + EXPECT_THAT(catalog_->TableExists(ident), HasValue(::testing::Eq(false))); + + const std::string location = MakeTableLocation("t1"); + auto created = + catalog_->CreateTable(ident, MakeSchema(), PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), location, {}); + ASSERT_THAT(created, IsOk()); + EXPECT_THAT(catalog_->TableExists(ident), HasValue(::testing::Eq(true))); + + // Duplicate create fails. + EXPECT_THAT(catalog_->CreateTable(ident, MakeSchema(), PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), location, {}), + IsError(ErrorKind::kAlreadyExists)); + + // List + load. + auto tables = catalog_->ListTables(ns); + ASSERT_THAT(tables, IsOk()); + ASSERT_EQ(tables->size(), 1); + EXPECT_EQ((*tables)[0].name, "t1"); + + auto loaded = catalog_->LoadTable(ident); + ASSERT_THAT(loaded, IsOk()); + + // Rename. + TableIdentifier renamed{.ns = ns, .name = "t2"}; + EXPECT_THAT(catalog_->RenameTable(ident, renamed), IsOk()); + EXPECT_THAT(catalog_->TableExists(ident), HasValue(::testing::Eq(false))); + EXPECT_THAT(catalog_->TableExists(renamed), HasValue(::testing::Eq(true))); + EXPECT_THAT(catalog_->RenameTable(renamed, renamed), IsOk()); + + // Drop. + EXPECT_THAT(catalog_->DropTable(renamed, /*purge=*/false), IsOk()); + EXPECT_THAT(catalog_->TableExists(renamed), HasValue(::testing::Eq(false))); + EXPECT_THAT(catalog_->DropTable(renamed, false), IsError(ErrorKind::kNoSuchTable)); +} + +TEST_F(SqlCatalogTest, CreateTableRequiresNamespace) { + TableIdentifier ident{.ns = Namespace{{"missing"}}, .name = "t1"}; + EXPECT_THAT(catalog_->CreateTable(ident, MakeSchema(), PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), "", {}), + IsError(ErrorKind::kNoSuchNamespace)); +} + +TEST_F(SqlCatalogTest, CreateTableUsesNamespaceLocationWhenLocationIsMissing) { + Namespace ns{{"db"}}; + const auto namespace_location = std::filesystem::path(WarehouseDir()) / "custom_db"; + ASSERT_THAT( + catalog_->CreateNamespace(ns, {{"location", namespace_location.generic_string()}}), + IsOk()); + + const auto table_location = namespace_location / "t1"; + std::filesystem::create_directories(table_location / "metadata"); + + TableIdentifier ident{.ns = ns, .name = "t1"}; + auto created = catalog_->CreateTable( + ident, MakeSchema(), PartitionSpec::Unpartitioned(), SortOrder::Unsorted(), "", {}); + ASSERT_THAT(created, IsOk()); + EXPECT_EQ((*created)->location(), table_location.generic_string()); +} + +TEST_F(SqlCatalogTest, CreateTableFallsBackToWarehouseNamespacePath) { + Namespace ns{{"a", "b"}}; + ASSERT_THAT(catalog_->CreateNamespace(ns, {}), IsOk()); + + const auto table_location = std::filesystem::path(WarehouseDir()) / "a" / "b" / "t1"; + std::filesystem::create_directories(table_location / "metadata"); + + TableIdentifier ident{.ns = ns, .name = "t1"}; + auto created = catalog_->CreateTable( + ident, MakeSchema(), PartitionSpec::Unpartitioned(), SortOrder::Unsorted(), "", {}); + ASSERT_THAT(created, IsOk()); + EXPECT_EQ((*created)->location(), table_location.generic_string()); +} + +TEST_F(SqlCatalogTest, StageCreateTableRequiresNamespace) { + TableIdentifier ident{.ns = Namespace{{"missing"}}, .name = "t1"}; + EXPECT_THAT( + catalog_->StageCreateTable(ident, MakeSchema(), PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), "", {}), + IsError(ErrorKind::kNoSuchNamespace)); +} + +TEST_F(SqlCatalogTest, NamespaceLevelsCannotContainDots) { + EXPECT_THAT(catalog_->CreateNamespace(Namespace{{"a.b"}}, {}), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(catalog_->ListNamespaces(Namespace{{"a.b"}}), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT( + catalog_->TableExists(TableIdentifier{.ns = Namespace{{"a.b"}}, .name = "t"}), + IsError(ErrorKind::kInvalidArgument)); +} + +TEST_F(SqlCatalogTest, ListNamespacesIncludesTableOnlyNamespaces) { + ASSERT_THAT(store_->InsertTable("orphan", "t", "/loc/v1.metadata.json"), IsOk()); + + auto namespaces = catalog_->ListNamespaces(Namespace{}); + ASSERT_THAT(namespaces, IsOk()); + EXPECT_THAT(*namespaces, ::testing::Contains(Namespace{{"orphan"}})); +} + +TEST_F(SqlCatalogTest, CustomStoreInjection) { + // The same catalog logic works against any CatalogStore; here we just verify the + // injection entry point with the built-in SQLite store. + auto store = MakeSqliteCatalogStore({.catalog_name = "custom", .uri = ":memory:"}); + ASSERT_THAT(store, IsOk()); + SqlCatalogConfig config{.name = "custom", .warehouse_location = WarehouseDir()}; + auto catalog = SqlCatalog::Make(config, file_io_, store.value()); + ASSERT_THAT(catalog, IsOk()); + EXPECT_EQ(catalog.value()->name(), "custom"); + EXPECT_THAT(catalog.value()->CreateNamespace(Namespace{{"db"}}, {}), IsOk()); +} + +TEST(SqliteCatalogStoreTest, DuplicateKeyMapsToAlreadyExists) { + auto store_result = MakeSqliteCatalogStore({.catalog_name = "c", .uri = ":memory:"}); + ASSERT_THAT(store_result, IsOk()); + auto store = store_result.value(); + ASSERT_THAT(store->Initialize(), IsOk()); + + EXPECT_THAT(store->InsertTable("db", "t", "/loc/v1.metadata.json"), IsOk()); + EXPECT_THAT(store->InsertTable("db", "t", "/loc/v2.metadata.json"), + IsError(ErrorKind::kAlreadyExists)); +} + +TEST(SqliteCatalogStoreTest, TableRowsUseRecordTypeAndReadLegacyNullRows) { + const auto db_path = SqliteTestPath("record_type"); + std::error_code ec; + std::filesystem::remove(db_path, ec); + + auto store_result = + MakeSqliteCatalogStore({.catalog_name = "c", .uri = db_path.string()}); + ASSERT_THAT(store_result, IsOk()); + auto store = store_result.value(); + ASSERT_THAT(store->Initialize(), IsOk()); + + ASSERT_THAT(store->InsertTable("db", "t", "/loc/v1.metadata.json"), IsOk()); + auto record_type = QuerySingleText( + db_path, + "SELECT iceberg_type FROM iceberg_tables WHERE catalog_name = 'c' AND " + "table_namespace = 'db' AND table_name = 't'"); + ASSERT_TRUE(record_type.has_value()); + EXPECT_EQ(*record_type, "TABLE"); + + ExecSql(db_path, + "INSERT INTO iceberg_tables (catalog_name, table_namespace, table_name, " + "metadata_location, previous_metadata_location, iceberg_type) " + "VALUES ('c', 'legacy', 't', '/loc/legacy.metadata.json', NULL, NULL)"); + + EXPECT_THAT(store->TableExists("legacy", "t"), HasValue(::testing::Eq(true))); + auto table_names = store->ListTableNames("legacy"); + ASSERT_THAT(table_names, IsOk()); + EXPECT_THAT(*table_names, ::testing::ElementsAre("t")); + + std::filesystem::remove(db_path, ec); +} + +TEST(SqliteCatalogStoreTest, RunInTransactionRollsBackOnError) { + auto store_result = MakeSqliteCatalogStore({.catalog_name = "tx", .uri = ":memory:"}); + ASSERT_THAT(store_result, IsOk()); + auto store = store_result.value(); + ASSERT_THAT(store->Initialize(), IsOk()); + + EXPECT_THAT(store->RunInTransaction([&] { + ICEBERG_RETURN_UNEXPECTED( + store->InsertNamespaceProperty("db", "owner", std::string_view{"alice"})); + return InvalidArgument("abort transaction"); + }), + IsError(ErrorKind::kInvalidArgument)); + + auto props = store->GetNamespaceProperties("db"); + ASSERT_THAT(props, IsOk()); + EXPECT_TRUE(props->empty()); +} + +// SQLite ignores `max_connections` and always uses a single connection; setting +// it greater than 1 must be harmless and transactions must still roll back. +TEST(SqliteCatalogStoreTest, MaxConnectionsIgnoredAndTransactionRollsBack) { + const auto db_path = SqliteTestPath("max_connections"); + std::error_code ec; + std::filesystem::remove(db_path, ec); + + auto store_result = MakeSqliteCatalogStore( + {.catalog_name = "pool", .uri = db_path.string(), .max_connections = 2}); + ASSERT_THAT(store_result, IsOk()); + auto store = store_result.value(); + ASSERT_THAT(store->Initialize(), IsOk()); + + EXPECT_THAT(store->RunInTransaction([&] { + ICEBERG_RETURN_UNEXPECTED( + store->InsertNamespaceProperty("db", "owner", std::string_view{"alice"})); + return InvalidArgument("abort transaction"); + }), + IsError(ErrorKind::kInvalidArgument)); + + auto props = store->GetNamespaceProperties("db"); + ASSERT_THAT(props, IsOk()); + EXPECT_TRUE(props->empty()); + + std::filesystem::remove(db_path, ec); +} + +TEST(SqliteCatalogStoreTest, UpdateTableMetadataLocationReturnsAffectedRows) { + auto store_result = MakeSqliteCatalogStore({.catalog_name = "cas", .uri = ":memory:"}); + ASSERT_THAT(store_result, IsOk()); + auto store = store_result.value(); + ASSERT_THAT(store->Initialize(), IsOk()); + ASSERT_THAT(store->InsertTable("db", "t", "/loc/v1.metadata.json"), IsOk()); + + EXPECT_THAT(store->UpdateTableMetadataLocation("db", "t", "/loc/v2.metadata.json", + "/loc/v1.metadata.json", + "/loc/stale.metadata.json"), + HasValue(::testing::Eq(0))); + EXPECT_THAT(store->UpdateTableMetadataLocation("db", "t", "/loc/v2.metadata.json", + "/loc/v1.metadata.json", + "/loc/v1.metadata.json"), + HasValue(::testing::Eq(1))); +} + +} // namespace iceberg::sql From ec2075275019667bd2cb7866ca1a0c615d92c1e4 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Fri, 5 Jun 2026 12:39:12 +0800 Subject: [PATCH 058/151] feat: support Iceberg v3 unknown type (#662) Closes #665 --- ## Summary - Add Iceberg v3 unknown primitive type and JSON serialization/deserialization support. - Support unknown as null-only data across Arrow, Avro, Parquet, schema projection, and nested fields. - Enforce required-field invariants for unknown/null-only projections and Arrow null imports. ## Validation - ctest --test-dir build --output-on-failure --------- Co-authored-by: Codex --- src/iceberg/avro/avro_data_util.cc | 8 + src/iceberg/avro/avro_direct_decoder.cc | 6 + src/iceberg/avro/avro_direct_encoder.cc | 9 +- src/iceberg/avro/avro_schema_util.cc | 92 ++++--- src/iceberg/avro/avro_schema_util_internal.h | 1 + src/iceberg/json_serde.cc | 6 + src/iceberg/parquet/parquet_data_util.cc | 33 ++- src/iceberg/parquet/parquet_schema_util.cc | 136 +++++++--- .../parquet/parquet_schema_util_internal.h | 4 + src/iceberg/row/arrow_array_wrapper.cc | 2 + src/iceberg/schema.cc | 40 +++ src/iceberg/schema_internal.cc | 8 + src/iceberg/schema_util.cc | 63 ++++- src/iceberg/table_metadata.h | 1 + src/iceberg/test/arrow_test.cc | 125 +++++++++- src/iceberg/test/avro_data_test.cc | 21 ++ src/iceberg/test/avro_schema_test.cc | 217 ++++++++++++++++ src/iceberg/test/avro_test.cc | 183 ++++++++++++++ src/iceberg/test/metadata_serde_test.cc | 53 ++++ src/iceberg/test/parquet_data_test.cc | 44 ++++ src/iceberg/test/parquet_schema_test.cc | 236 ++++++++++++++++++ src/iceberg/test/parquet_test.cc | 209 ++++++++++++++++ src/iceberg/test/schema_json_test.cc | 83 ++++++ src/iceberg/test/schema_test.cc | 32 +++ src/iceberg/test/schema_util_test.cc | 126 ++++++++++ src/iceberg/test/type_test.cc | 9 +- src/iceberg/test/update_schema_test.cc | 35 +++ src/iceberg/test/visit_type_test.cc | 9 +- src/iceberg/type.cc | 7 + src/iceberg/type.h | 17 ++ src/iceberg/type_fwd.h | 4 +- src/iceberg/update/update_schema.cc | 1 + src/iceberg/util/struct_like_set.cc | 2 + src/iceberg/util/type_util.cc | 5 + src/iceberg/util/type_util.h | 1 + src/iceberg/util/visitor_generate.h | 1 + 36 files changed, 1727 insertions(+), 102 deletions(-) diff --git a/src/iceberg/avro/avro_data_util.cc b/src/iceberg/avro/avro_data_util.cc index 17bbb394b..fb2f58bd1 100644 --- a/src/iceberg/avro/avro_data_util.cc +++ b/src/iceberg/avro/avro_data_util.cc @@ -457,6 +457,11 @@ Status AppendFieldToBuilder(const ::avro::NodePtr& avro_node, const SchemaField& projected_field, const arrow::MetadataColumnContext& metadata_context, ::arrow::ArrayBuilder* array_builder) { + if (projection.kind == FieldProjection::Kind::kNull) { + ICEBERG_ARROW_RETURN_NOT_OK(array_builder->AppendNull()); + return {}; + } + if (avro_node->type() == ::avro::AVRO_UNION) { size_t branch = avro_datum.unionBranch(); if (avro_node->leafAt(branch)->type() == ::avro::AVRO_NULL) { @@ -507,6 +512,9 @@ Status ExtractDatumFromArray(const ::arrow::Array& array, int64_t index, } if (array.IsNull(index)) { + if (datum->type() == ::avro::AVRO_NULL) { + return {}; + } if (!datum->isUnion()) [[unlikely]] { return InvalidSchema("Cannot extract null to non-union type: {}", ::avro::toString(datum->type())); diff --git a/src/iceberg/avro/avro_direct_decoder.cc b/src/iceberg/avro/avro_direct_decoder.cc index cb4e869cc..19ce77bbd 100644 --- a/src/iceberg/avro/avro_direct_decoder.cc +++ b/src/iceberg/avro/avro_direct_decoder.cc @@ -588,6 +588,12 @@ Status DecodeFieldToBuilder(const ::avro::NodePtr& avro_node, ::avro::Decoder& d const SchemaField& projected_field, const arrow::MetadataColumnContext& metadata_context, ::arrow::ArrayBuilder* array_builder, DecodeContext& ctx) { + if (projection.kind == FieldProjection::Kind::kNull) { + ICEBERG_RETURN_UNEXPECTED(SkipAvroValue(avro_node, decoder)); + ICEBERG_ARROW_RETURN_NOT_OK(array_builder->AppendNull()); + return {}; + } + if (avro_node->type() == ::avro::AVRO_UNION) { const size_t branch_index = decoder.decodeUnionIndex(); diff --git a/src/iceberg/avro/avro_direct_encoder.cc b/src/iceberg/avro/avro_direct_encoder.cc index caab7f699..5dcfd2511 100644 --- a/src/iceberg/avro/avro_direct_encoder.cc +++ b/src/iceberg/avro/avro_direct_encoder.cc @@ -80,15 +80,16 @@ Status EncodeArrowToAvro(const ::avro::NodePtr& avro_node, ::avro::Encoder& enco return EncodeArrowToAvro(branches.value_node, encoder, type, array, row_index, ctx); } + if (avro_node->type() == ::avro::AVRO_NULL) { + encoder.encodeNull(); + return {}; + } + if (is_null) { return InvalidArgument("Null value in non-nullable field"); } switch (avro_node->type()) { - case ::avro::AVRO_NULL: - encoder.encodeNull(); - return {}; - case ::avro::AVRO_BOOL: { const auto& bool_array = internal::checked_cast(array); diff --git a/src/iceberg/avro/avro_schema_util.cc b/src/iceberg/avro/avro_schema_util.cc index 3d61d283f..4ecd87ebc 100644 --- a/src/iceberg/avro/avro_schema_util.cc +++ b/src/iceberg/avro/avro_schema_util.cc @@ -237,6 +237,11 @@ Status ToAvroNodeVisitor::Visit(const BinaryType& type, ::avro::NodePtr* node) { return {}; } +Status ToAvroNodeVisitor::Visit(const UnknownType&, ::avro::NodePtr* node) { + *node = std::make_shared<::avro::NodePrimitive>(::avro::AVRO_NULL); + return {}; +} + Status ToAvroNodeVisitor::Visit(const StructType& type, ::avro::NodePtr* node) { *node = std::make_shared<::avro::NodeRecord>(); @@ -338,7 +343,7 @@ Status ToAvroNodeVisitor::Visit(const SchemaField& field, ::avro::NodePtr* node) field_ids_.push(field.field_id()); ICEBERG_RETURN_UNEXPECTED(VisitTypeInline(*field.type(), /*visitor=*/this, node)); - if (field.optional()) { + if (field.optional() && (*node)->type() != ::avro::AVRO_NULL) { ::avro::MultiLeaves union_types; union_types.add(std::make_shared<::avro::NodePrimitive>(::avro::AVRO_NULL)); union_types.add(std::move(*node)); @@ -383,8 +388,8 @@ Status HasIdVisitor::Visit(const ::avro::NodePtr& node) { case ::avro::AVRO_STRING: case ::avro::AVRO_BYTES: case ::avro::AVRO_FIXED: - return {}; case ::avro::AVRO_NULL: + return {}; case ::avro::AVRO_ENUM: default: return InvalidSchema("Unsupported Avro type: {}", static_cast(node->type())); @@ -512,6 +517,10 @@ Result GetFieldId(const ::avro::NodePtr& node, size_t field_idx) { Status ValidateAvroSchemaEvolution(const Type& expected_type, const ::avro::NodePtr& avro_node) { + if (avro_node->type() == ::avro::AVRO_NULL) { + return {}; + } + switch (expected_type.type_id()) { case TypeId::kBoolean: if (avro_node->type() == ::avro::AVRO_BOOL) { @@ -615,6 +624,8 @@ Status ValidateAvroSchemaEvolution(const Type& expected_type, return {}; } break; + case TypeId::kUnknown: + return {}; default: break; } @@ -650,6 +661,35 @@ Result ProjectNested(const Type& expected_type, const ::avro::NodePtr& avro_node, bool prune_source); +Result ProjectField(const SchemaField& expected_field, + const ::avro::NodePtr& avro_node, + size_t source_index, bool prune_source) { + const Type& expected_type = *expected_field.type(); + ::avro::NodePtr field_node; + ICEBERG_RETURN_UNEXPECTED(UnwrapUnion(avro_node, &field_node)); + + FieldProjection projection; + if (expected_type.type_id() == TypeId::kUnknown || + field_node->type() == ::avro::AVRO_NULL) { + if (!expected_field.optional()) { + return InvalidSchema("Cannot project required field with ID: {} as null", + expected_field.field_id()); + } + projection.kind = FieldProjection::Kind::kNull; + return projection; + } + + if (expected_type.is_nested()) { + ICEBERG_ASSIGN_OR_RAISE(projection, + ProjectNested(expected_type, field_node, prune_source)); + } else { + ICEBERG_RETURN_UNEXPECTED(ValidateAvroSchemaEvolution(expected_type, field_node)); + } + projection.from = source_index; + projection.kind = FieldProjection::Kind::kProjected; + return projection; +} + Result ProjectStruct(const StructType& struct_type, const ::avro::NodePtr& avro_node, bool prune_source) { @@ -685,18 +725,9 @@ Result ProjectStruct(const StructType& struct_type, FieldProjection child_projection; if (auto iter = node_info_map.find(field_id); iter != node_info_map.cend()) { - ::avro::NodePtr field_node; - ICEBERG_RETURN_UNEXPECTED(UnwrapUnion(iter->second.field_node, &field_node)); - if (expected_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE( - child_projection, - ProjectNested(*expected_field.type(), field_node, prune_source)); - } else { - ICEBERG_RETURN_UNEXPECTED( - ValidateAvroSchemaEvolution(*expected_field.type(), field_node)); - } - child_projection.from = iter->second.local_index; - child_projection.kind = FieldProjection::Kind::kProjected; + ICEBERG_ASSIGN_OR_RAISE(child_projection, + ProjectField(expected_field, iter->second.field_node, + iter->second.local_index, prune_source)); } else if (MetadataColumns::IsMetadataColumn(field_id)) { child_projection.kind = FieldProjection::Kind::kMetadata; } else if (expected_field.optional()) { @@ -733,20 +764,9 @@ Result ProjectList(const ListType& list_type, } FieldProjection element_projection; - ::avro::NodePtr element_node; - ICEBERG_RETURN_UNEXPECTED(UnwrapUnion(avro_node->leafAt(0), &element_node)); - if (expected_element_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE( - element_projection, - ProjectNested(*expected_element_field.type(), element_node, prune_source)); - } else { - ICEBERG_RETURN_UNEXPECTED( - ValidateAvroSchemaEvolution(*expected_element_field.type(), element_node)); - } - - // Set the element projection metadata but preserve its children - element_projection.kind = FieldProjection::Kind::kProjected; - element_projection.from = size_t{0}; + ICEBERG_ASSIGN_OR_RAISE(element_projection, + ProjectField(expected_element_field, avro_node->leafAt(0), + /*source_index*/ size_t{0}, prune_source)); FieldProjection result; result.children.emplace_back(std::move(element_projection)); @@ -802,18 +822,10 @@ Result ProjectMap(const MapType& map_type, for (size_t i = 0; i < map_node->leaves(); ++i) { FieldProjection sub_projection; - ::avro::NodePtr sub_node; - ICEBERG_RETURN_UNEXPECTED(UnwrapUnion(map_node->leafAt(i), &sub_node)); const auto& expected_sub_field = map_type.fields()[i]; - if (expected_sub_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE(sub_projection, ProjectNested(*expected_sub_field.type(), - sub_node, prune_source)); - } else { - ICEBERG_RETURN_UNEXPECTED( - ValidateAvroSchemaEvolution(*expected_sub_field.type(), sub_node)); - } - sub_projection.kind = FieldProjection::Kind::kProjected; - sub_projection.from = i; + ICEBERG_ASSIGN_OR_RAISE( + sub_projection, + ProjectField(expected_sub_field, map_node->leafAt(i), i, prune_source)); result.children.emplace_back(std::move(sub_projection)); } @@ -1049,9 +1061,9 @@ Result<::avro::NodePtr> MakeAvroNodeWithFieldIds(const ::avro::NodePtr& original case ::avro::AVRO_STRING: case ::avro::AVRO_BYTES: case ::avro::AVRO_FIXED: + case ::avro::AVRO_NULL: // For primitive types, just return a copy return original_node; - case ::avro::AVRO_NULL: case ::avro::AVRO_ENUM: default: return InvalidSchema("Unsupported Avro type for field ID application: {}", diff --git a/src/iceberg/avro/avro_schema_util_internal.h b/src/iceberg/avro/avro_schema_util_internal.h index e3b7a7ffd..f5049e5cf 100644 --- a/src/iceberg/avro/avro_schema_util_internal.h +++ b/src/iceberg/avro/avro_schema_util_internal.h @@ -58,6 +58,7 @@ class ToAvroNodeVisitor { Status Visit(const UuidType& type, ::avro::NodePtr* node); Status Visit(const FixedType& type, ::avro::NodePtr* node); Status Visit(const BinaryType& type, ::avro::NodePtr* node); + Status Visit(const UnknownType&, ::avro::NodePtr*); Status Visit(const StructType& type, ::avro::NodePtr* node); Status Visit(const ListType& type, ::avro::NodePtr* node); Status Visit(const MapType& type, ::avro::NodePtr* node); diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index 3944e510c..550d0f07e 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -377,6 +377,8 @@ nlohmann::json ToJson(const Type& type) { } case TypeId::kUuid: return "uuid"; + case TypeId::kUnknown: + return "unknown"; } std::unreachable(); } @@ -502,6 +504,8 @@ Result> TypeFromJson(const nlohmann::json& json) { return std::make_unique(); } else if (type_str == "uuid") { return std::make_unique(); + } else if (type_str == "unknown") { + return std::make_unique(); } else if (type_str.starts_with("fixed")) { std::regex fixed_regex(R"(fixed\[\s*(\d+)\s*\])"); std::smatch match; @@ -949,6 +953,7 @@ Result> ParseSchemas( for (const auto& schema_json : schema_array) { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr schema, SchemaFromJson(schema_json)); + ICEBERG_RETURN_UNEXPECTED(schema->Validate(format_version)); if (schema->schema_id() == current_schema_id) { current_schema = schema; } @@ -965,6 +970,7 @@ Result> ParseSchemas( ICEBERG_ASSIGN_OR_RAISE(auto schema_json, GetJsonValue(json, kSchema)); ICEBERG_ASSIGN_OR_RAISE(current_schema, SchemaFromJson(schema_json)); + ICEBERG_RETURN_UNEXPECTED(current_schema->Validate(format_version)); current_schema_id = current_schema->schema_id(); schemas.push_back(current_schema); } diff --git a/src/iceberg/parquet/parquet_data_util.cc b/src/iceberg/parquet/parquet_data_util.cc index 43efd1cbd..0c7c6c2ca 100644 --- a/src/iceberg/parquet/parquet_data_util.cc +++ b/src/iceberg/parquet/parquet_data_util.cc @@ -140,6 +140,12 @@ Result> ProjectStructArray( projected_arrays.emplace_back(std::move(projected_array)); } + if (projected_arrays.empty()) { + return std::make_shared<::arrow::StructArray>( + output_struct_type, struct_array->length(), projected_arrays, + struct_array->null_bitmap(), struct_array->null_count(), struct_array->offset()); + } + ICEBERG_ARROW_ASSIGN_OR_RETURN( auto output_array, ::arrow::StructArray::Make(projected_arrays, output_struct_type->fields(), @@ -166,7 +172,14 @@ Result> ProjectListArrayImpl( const auto& output_element_type = output_list_type->value_type(); std::shared_ptr<::arrow::Array> projected_values; - if (element_field.type()->is_nested()) { + if (element_projection.kind == FieldProjection::Kind::kNull) { + ICEBERG_ASSIGN_OR_RAISE( + projected_values, + MakeNullArray(output_element_type, list_array->values()->length(), pool)); + } else if (element_projection.kind != FieldProjection::Kind::kProjected) { + return NotImplemented("Unsupported list element projection kind: {}", + ToString(element_projection.kind)); + } else if (element_field.type()->is_nested()) { const auto& nested_type = internal::checked_cast(*element_field.type()); ICEBERG_ASSIGN_OR_RAISE( @@ -219,7 +232,14 @@ Result> ProjectMapArray( // Project keys std::shared_ptr<::arrow::Array> projected_keys; - if (key_type->is_nested()) { + if (key_projection.kind == FieldProjection::Kind::kNull) { + ICEBERG_ASSIGN_OR_RAISE( + projected_keys, + MakeNullArray(output_map_type->key_type(), map_array->keys()->length(), pool)); + } else if (key_projection.kind != FieldProjection::Kind::kProjected) { + return NotImplemented("Unsupported map key projection kind: {}", + ToString(key_projection.kind)); + } else if (key_type->is_nested()) { const auto& nested_type = internal::checked_cast(*key_type); ICEBERG_ASSIGN_OR_RAISE( projected_keys, @@ -233,7 +253,14 @@ Result> ProjectMapArray( // Project values std::shared_ptr<::arrow::Array> projected_items; - if (value_type->is_nested()) { + if (value_projection.kind == FieldProjection::Kind::kNull) { + ICEBERG_ASSIGN_OR_RAISE( + projected_items, + MakeNullArray(output_map_type->item_type(), map_array->items()->length(), pool)); + } else if (value_projection.kind != FieldProjection::Kind::kProjected) { + return NotImplemented("Unsupported map value projection kind: {}", + ToString(value_projection.kind)); + } else if (value_type->is_nested()) { const auto& nested_type = internal::checked_cast(*value_type); ICEBERG_ASSIGN_OR_RAISE( projected_items, diff --git a/src/iceberg/parquet/parquet_schema_util.cc b/src/iceberg/parquet/parquet_schema_util.cc index 849bbd1f8..39e321d9f 100644 --- a/src/iceberg/parquet/parquet_schema_util.cc +++ b/src/iceberg/parquet/parquet_schema_util.cc @@ -59,10 +59,61 @@ std::optional GetFieldId(const ::parquet::arrow::SchemaField& parquet_f return FieldIdFromMetadata(parquet_field.field->metadata()); } -// TODO(gangwu): support v3 unknown type +bool IsNullPhysicalField(const ::parquet::arrow::SchemaField& parquet_field) { + return parquet_field.field->type()->id() == ::arrow::Type::NA; +} + +bool HasSelectedColumn(const FieldProjection& projection) { + if (projection.attributes) { + const auto& attributes = + internal::checked_cast(*projection.attributes); + if (attributes.column_id) { + return true; + } + } + return std::ranges::any_of(projection.children, HasSelectedColumn); +} + +std::optional FirstColumnIndex( + const ::parquet::arrow::SchemaField& parquet_field) { + if (parquet_field.column_index >= 0) { + return parquet_field.column_index; + } + for (const auto& child : parquet_field.children) { + if (auto column_index = FirstColumnIndex(child)) { + return column_index; + } + } + return std::nullopt; +} + +// Pick a physical column as an anchor when all children are null-projected, +// so that Parquet readers can still locate row boundaries. +void SelectAnchorColumnIfEmpty( + FieldProjection* projection, + const std::vector<::parquet::arrow::SchemaField>& parquet_fields) { + if (HasSelectedColumn(*projection)) { + return; + } + for (const auto& parquet_field : parquet_fields) { + if (auto column_index = FirstColumnIndex(parquet_field)) { + projection->attributes = + std::make_shared(column_index.value()); + return; + } + } +} + +} // namespace + Status ValidateParquetSchemaEvolution( const Type& expected_type, const ::parquet::arrow::SchemaField& parquet_field) { const auto& arrow_type = parquet_field.field->type(); + // Some Parquet files may contain null-only physical fields. Allow reading them as + // any optional projected field type. + if (arrow_type->id() == ::arrow::Type::NA) { + return {}; + } switch (expected_type.type_id()) { case TypeId::kBoolean: if (arrow_type->id() == ::arrow::Type::BOOL) { @@ -186,6 +237,8 @@ Status ValidateParquetSchemaEvolution( } } break; + case TypeId::kUnknown: + return {}; case TypeId::kStruct: if (arrow_type->id() == ::arrow::Type::STRUCT) { return {}; @@ -209,11 +262,42 @@ Status ValidateParquetSchemaEvolution( expected_type, arrow_type->ToString()); } +namespace { + // Forward declaration Result ProjectNested( const Type& nested_type, const std::vector<::parquet::arrow::SchemaField>& parquet_fields); +Result ProjectField(const SchemaField& expected_field, + const ::parquet::arrow::SchemaField& parquet_field, + size_t source_index) { + const Type& expected_type = *expected_field.type(); + + FieldProjection projection; + if (expected_type.type_id() == TypeId::kUnknown || IsNullPhysicalField(parquet_field)) { + if (!expected_field.optional()) { + return InvalidSchema("Cannot project required field with id {} as null", + expected_field.field_id()); + } + projection.kind = FieldProjection::Kind::kNull; + return projection; + } + + ICEBERG_RETURN_UNEXPECTED(ValidateParquetSchemaEvolution(expected_type, parquet_field)); + + if (expected_type.is_nested()) { + ICEBERG_ASSIGN_OR_RAISE(projection, + ProjectNested(expected_type, parquet_field.children)); + } else { + projection.attributes = + std::make_shared(parquet_field.column_index); + } + projection.from = source_index; + projection.kind = FieldProjection::Kind::kProjected; + return projection; +} + Result ProjectStruct( const StructType& struct_type, const std::vector<::parquet::arrow::SchemaField>& parquet_fields) { @@ -248,17 +332,8 @@ Result ProjectStruct( if (auto iter = field_context_map.find(field_id); iter != field_context_map.cend()) { const auto& parquet_field = iter->second.parquet_field; - ICEBERG_RETURN_UNEXPECTED( - ValidateParquetSchemaEvolution(*field.type(), parquet_field)); - if (field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE(child_projection, - ProjectNested(*field.type(), parquet_field.children)); - } else { - child_projection.attributes = - std::make_shared(parquet_field.column_index); - } - child_projection.from = iter->second.local_index; - child_projection.kind = FieldProjection::Kind::kProjected; + ICEBERG_ASSIGN_OR_RAISE( + child_projection, ProjectField(field, parquet_field, iter->second.local_index)); } else if (MetadataColumns::IsMetadataColumn(field_id)) { child_projection.kind = FieldProjection::Kind::kMetadata; } else if (field.optional()) { @@ -270,6 +345,7 @@ Result ProjectStruct( result.children.emplace_back(std::move(child_projection)); } + SelectAnchorColumnIfEmpty(&result, parquet_fields); PruneFieldProjection(result); return result; } @@ -294,23 +370,12 @@ Result ProjectList( element_field.field_id(), element_field_id.value()); } - ICEBERG_RETURN_UNEXPECTED( - ValidateParquetSchemaEvolution(*element_field.type(), parquet_field)); - - FieldProjection element_projection; - if (element_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE(element_projection, - ProjectNested(*element_field.type(), parquet_field.children)); - } else { - element_projection.attributes = - std::make_shared(parquet_field.column_index); - } - - element_projection.kind = FieldProjection::Kind::kProjected; - element_projection.from = size_t{0}; + ICEBERG_ASSIGN_OR_RAISE(auto element_projection, + ProjectField(element_field, parquet_field, size_t{0})); FieldProjection result; result.children.emplace_back(std::move(element_projection)); + SelectAnchorColumnIfEmpty(&result, parquet_fields); return result; } @@ -346,23 +411,20 @@ Result ProjectMap( result.children.reserve(2); for (size_t i = 0; i < parquet_fields.size(); ++i) { - FieldProjection sub_projection; const auto& sub_node = parquet_fields[i]; const auto& sub_field = map_type.fields()[i]; - ICEBERG_RETURN_UNEXPECTED( - ValidateParquetSchemaEvolution(*sub_field.type(), sub_node)); - if (sub_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE(sub_projection, - ProjectNested(*sub_field.type(), sub_node.children)); - } else { - sub_projection.attributes = - std::make_shared(sub_node.column_index); + ICEBERG_ASSIGN_OR_RAISE(auto sub_projection, ProjectField(sub_field, sub_node, i)); + if (sub_projection.kind == FieldProjection::Kind::kNull && + !HasSelectedColumn(sub_projection)) { + if (auto column_index = FirstColumnIndex(sub_node)) { + sub_projection.attributes = + std::make_shared(column_index.value()); + } } - sub_projection.kind = FieldProjection::Kind::kProjected; - sub_projection.from = i; result.children.emplace_back(std::move(sub_projection)); } + SelectAnchorColumnIfEmpty(&result, parquet_fields); return result; } diff --git a/src/iceberg/parquet/parquet_schema_util_internal.h b/src/iceberg/parquet/parquet_schema_util_internal.h index 8e06b0bcf..567069291 100644 --- a/src/iceberg/parquet/parquet_schema_util_internal.h +++ b/src/iceberg/parquet/parquet_schema_util_internal.h @@ -62,4 +62,8 @@ std::vector SelectedColumnIndices(const SchemaProjection& projection); /// \return True if the Parquet schema has field IDs, false otherwise. bool HasFieldIds(const ::parquet::schema::NodePtr& root_node); +/// \brief Validate whether a projected Iceberg type is compatible with a Parquet field. +Status ValidateParquetSchemaEvolution(const Type& expected_type, + const ::parquet::arrow::SchemaField& parquet_field); + } // namespace iceberg::parquet diff --git a/src/iceberg/row/arrow_array_wrapper.cc b/src/iceberg/row/arrow_array_wrapper.cc index e97293bcd..0d6d48c15 100644 --- a/src/iceberg/row/arrow_array_wrapper.cc +++ b/src/iceberg/row/arrow_array_wrapper.cc @@ -44,6 +44,8 @@ Result ExtractValue(const ArrowSchema* schema, const ArrowArray* array, } switch (array_view->storage_type) { + case NANOARROW_TYPE_NA: + return std::monostate{}; case NANOARROW_TYPE_BOOL: return static_cast(ArrowArrayViewGetIntUnsafe(array_view, index)); case NANOARROW_TYPE_INT32: diff --git a/src/iceberg/schema.cc b/src/iceberg/schema.cc index 5fdd47998..5e60b551f 100644 --- a/src/iceberg/schema.cc +++ b/src/iceberg/schema.cc @@ -35,6 +35,44 @@ namespace iceberg { +namespace { + +Status ValidateFieldNullability(const Type& type) { + auto validate_field = [&](const SchemaField& field) -> Status { + ICEBERG_PRECHECK(field.optional() || field.type()->type_id() != TypeId::kUnknown, + "Unknown type field '{}' must be optional", field.name()); + return ValidateFieldNullability(*field.type()); + }; + + switch (type.type_id()) { + case TypeId::kStruct: { + const auto& struct_type = static_cast(type); + for (const auto& field : struct_type.fields()) { + ICEBERG_RETURN_UNEXPECTED(validate_field(field)); + } + return {}; + } + case TypeId::kList: { + const auto& list_type = static_cast(type); + const auto& element = list_type.element(); + return validate_field(element); + } + case TypeId::kMap: { + const auto& map_type = static_cast(type); + const auto& key = map_type.key(); + const auto& value = map_type.value(); + ICEBERG_PRECHECK(key.type()->type_id() != TypeId::kUnknown, + "Map 'key' cannot be unknown type"); + ICEBERG_RETURN_UNEXPECTED(ValidateFieldNullability(*key.type())); + return validate_field(value); + } + default: + return {}; + } +} + +} // namespace + Schema::Schema(std::vector fields, int32_t schema_id) : StructType(std::move(fields)), schema_id_(schema_id), @@ -282,6 +320,8 @@ bool Schema::SameSchema(const Schema& other) const { } Status Schema::Validate(int32_t format_version) const { + ICEBERG_RETURN_UNEXPECTED(ValidateFieldNullability(*this)); + // Get all fields including nested ones ICEBERG_ASSIGN_OR_RAISE(auto id_to_field, cache_->GetIdToFieldMap()); diff --git a/src/iceberg/schema_internal.cc b/src/iceberg/schema_internal.cc index bdd5b859f..c32ceb2a6 100644 --- a/src/iceberg/schema_internal.cc +++ b/src/iceberg/schema_internal.cc @@ -150,6 +150,9 @@ ArrowErrorCode ToArrowSchema(const Type& type, bool optional, std::string_view n ArrowMetadataBuilderAppend(&metadata_buffer, ArrowCharView(kArrowExtensionName), ArrowCharView(kArrowUuidExtensionName))); } break; + case TypeId::kUnknown: + NANOARROW_RETURN_NOT_OK(ArrowSchemaSetType(schema, NANOARROW_TYPE_NA)); + break; } if (!name.empty()) { @@ -217,6 +220,9 @@ Result> FromArrowSchema(const ArrowSchema& schema) { auto field_id = GetFieldId(schema); bool is_optional = (schema.flags & ARROW_FLAG_NULLABLE) != 0; + if (field_type->type_id() == TypeId::kUnknown && !is_optional) { + return InvalidSchema("Arrow null field '{}' must be nullable", schema.name); + } return std::make_unique(field_id, schema.name, std::move(field_type), is_optional); }; @@ -312,6 +318,8 @@ Result> FromArrowSchema(const ArrowSchema& schema) { } return iceberg::fixed(schema_view.fixed_size); } + case NANOARROW_TYPE_NA: + return iceberg::unknown(); default: return InvalidSchema("Unsupported Arrow type: {}", ArrowTypeString(schema_view.type)); diff --git a/src/iceberg/schema_util.cc b/src/iceberg/schema_util.cc index 4acdab631..4ff678fc6 100644 --- a/src/iceberg/schema_util.cc +++ b/src/iceberg/schema_util.cc @@ -49,6 +49,9 @@ Status ValidateSchemaEvolution(const Type& expected_type, const Type& source_typ if (expected_type == source_type) { return {}; } + if (source_type.type_id() == TypeId::kUnknown && expected_type.is_primitive()) { + return {}; + } switch (expected_type.type_id()) { case TypeId::kLong: { @@ -79,6 +82,50 @@ Status ValidateSchemaEvolution(const Type& expected_type, const Type& source_typ return NotSupported("Cannot read {} from {}", expected_type, source_type); } +Result ProjectNested(const Type& expected_type, const Type& source_type, + bool prune_source); + +Result ProjectField(const SchemaField& expected_field, + const SchemaField& source_field, size_t source_index, + bool prune_source) { + FieldProjection projection; + + if (expected_field.type()->type_id() == TypeId::kUnknown) { + if (!expected_field.optional()) { + return InvalidSchema("Cannot project required field with id {} as null", + expected_field.field_id()); + } + projection.kind = FieldProjection::Kind::kNull; + return projection; + } + + if (source_field.type()->type_id() == TypeId::kUnknown && !expected_field.optional()) { + return InvalidSchema("Cannot project required field with id {} as null", + expected_field.field_id()); + } + if (source_field.type()->type_id() == TypeId::kUnknown && + expected_field.type()->is_nested()) { + projection.kind = FieldProjection::Kind::kNull; + return projection; + } + + if (expected_field.type()->is_nested()) { + ICEBERG_ASSIGN_OR_RAISE( + projection, + ProjectNested(*expected_field.type(), *source_field.type(), prune_source)); + } else { + ICEBERG_RETURN_UNEXPECTED( + ValidateSchemaEvolution(*expected_field.type(), *source_field.type())); + } + + // If `prune_source` is false, all fields will be read so the local index is exactly + // the position to read data. Otherwise, the local index is computed by pruning all + // non-projected fields. + projection.from = source_index; + projection.kind = FieldProjection::Kind::kProjected; + return projection; +} + Result ProjectNested(const Type& expected_type, const Type& source_type, bool prune_source) { if (!expected_type.is_nested()) { @@ -120,19 +167,9 @@ Result ProjectNested(const Type& expected_type, const Type& sou FieldProjection child_projection; if (auto iter = source_field_map.find(field_id); iter != source_field_map.cend()) { - if (expected_field.type()->is_nested()) { - ICEBERG_ASSIGN_OR_RAISE(child_projection, - ProjectNested(*expected_field.type(), - *iter->second.field->type(), prune_source)); - } else { - ICEBERG_RETURN_UNEXPECTED( - ValidateSchemaEvolution(*expected_field.type(), *iter->second.field->type())); - } - // If `prune_source` is false, all fields will be read so the local index - // is exactly the position to read data. Otherwise, the local index is computed - // by pruning all non-projected fields - child_projection.from = iter->second.local_index; - child_projection.kind = FieldProjection::Kind::kProjected; + ICEBERG_ASSIGN_OR_RAISE(child_projection, + ProjectField(expected_field, *iter->second.field, + iter->second.local_index, prune_source)); } else if (MetadataColumns::IsMetadataColumn(field_id)) { child_projection.kind = FieldProjection::Kind::kMetadata; } else if (expected_field.optional()) { diff --git a/src/iceberg/table_metadata.h b/src/iceberg/table_metadata.h index 2f0c7e181..335fedadc 100644 --- a/src/iceberg/table_metadata.h +++ b/src/iceberg/table_metadata.h @@ -80,6 +80,7 @@ struct ICEBERG_EXPORT TableMetadata { static inline const std::unordered_map kMinFormatVersions = { {TypeId::kTimestampNs, 3}, {TypeId::kTimestampTzNs, 3}, + {TypeId::kUnknown, 3}, }; /// An integer version number for the format diff --git a/src/iceberg/test/arrow_test.cc b/src/iceberg/test/arrow_test.cc index dcfdb6b56..2e2a80096 100644 --- a/src/iceberg/test/arrow_test.cc +++ b/src/iceberg/test/arrow_test.cc @@ -107,7 +107,9 @@ INSTANTIATE_TEST_SUITE_P( ToArrowSchemaParam{.iceberg_type = iceberg::uuid(), .arrow_type = ::arrow::extension::uuid()}, ToArrowSchemaParam{.iceberg_type = iceberg::fixed(20), - .arrow_type = ::arrow::fixed_size_binary(20)})); + .arrow_type = ::arrow::fixed_size_binary(20)}, + ToArrowSchemaParam{.iceberg_type = iceberg::unknown(), + .arrow_type = ::arrow::null()})); namespace { @@ -233,6 +235,81 @@ TEST(ToArrowSchemaTest, MapType) { /*nullable=*/true, kValueFieldId)); } +TEST(ToArrowSchemaTest, NestedUnknownFieldsRoundTrip) { + Schema schema( + { + SchemaField::MakeOptional( + /*field_id=*/1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/2, "mystery", + iceberg::unknown()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "mysteries", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/4, "element", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/5, "properties", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/6, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/7, "value", + iceberg::unknown()))), + }, + /*schema_id=*/0); + + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(schema, &arrow_c_schema), IsOk()); + + auto imported_schema = ::arrow::ImportSchema(&arrow_c_schema).ValueOrDie(); + ASSERT_EQ(imported_schema->num_fields(), 3); + + auto profile_type = + std::static_pointer_cast<::arrow::StructType>(imported_schema->field(0)->type()); + ASSERT_EQ(profile_type->num_fields(), 1); + ASSERT_NO_FATAL_FAILURE(CheckArrowField(*profile_type->field(0), ::arrow::Type::NA, + "mystery", /*nullable=*/true, + /*field_id=*/2)); + + auto mysteries_type = + std::static_pointer_cast<::arrow::ListType>(imported_schema->field(1)->type()); + ASSERT_NO_FATAL_FAILURE(CheckArrowField(*mysteries_type->value_field(), + ::arrow::Type::NA, "element", + /*nullable=*/true, /*field_id=*/4)); + + auto properties_type = + std::static_pointer_cast<::arrow::MapType>(imported_schema->field(2)->type()); + ASSERT_NO_FATAL_FAILURE(CheckArrowField(*properties_type->key_field(), + ::arrow::Type::STRING, "key", + /*nullable=*/false, /*field_id=*/6)); + ASSERT_NO_FATAL_FAILURE(CheckArrowField(*properties_type->item_field(), + ::arrow::Type::NA, "value", + /*nullable=*/true, /*field_id=*/7)); + + ArrowSchema exported_schema; + ASSERT_TRUE(::arrow::ExportSchema(*imported_schema, &exported_schema).ok()); + auto schema_result = FromArrowSchema(exported_schema, /*schema_id=*/0); + ASSERT_THAT(schema_result, IsOk()); + ArrowSchemaRelease(&exported_schema); + + const auto& round_tripped_schema = *schema_result.value(); + ASSERT_EQ(round_tripped_schema.fields().size(), 3); + + const auto* profile = + dynamic_cast(round_tripped_schema.fields()[0].type().get()); + ASSERT_NE(profile, nullptr); + ASSERT_EQ(profile->fields()[0].type()->type_id(), TypeId::kUnknown); + + const auto* mysteries = + dynamic_cast(round_tripped_schema.fields()[1].type().get()); + ASSERT_NE(mysteries, nullptr); + ASSERT_EQ(mysteries->fields()[0].type()->type_id(), TypeId::kUnknown); + + const auto* properties = + dynamic_cast(round_tripped_schema.fields()[2].type().get()); + ASSERT_NE(properties, nullptr); + ASSERT_EQ(properties->value().type()->type_id(), TypeId::kUnknown); +} + struct FromArrowSchemaParam { std::shared_ptr arrow_type; bool optional = true; @@ -307,7 +384,51 @@ INSTANTIATE_TEST_SUITE_P( FromArrowSchemaParam{.arrow_type = ::arrow::extension::uuid(), .iceberg_type = iceberg::uuid()}, FromArrowSchemaParam{.arrow_type = ::arrow::fixed_size_binary(20), - .iceberg_type = iceberg::fixed(20)})); + .iceberg_type = iceberg::fixed(20)}, + FromArrowSchemaParam{.arrow_type = ::arrow::null(), + .iceberg_type = iceberg::unknown()})); + +TEST(FromArrowSchemaTest, RejectRequiredNullFieldAsUnknown) { + auto metadata = + ::arrow::key_value_metadata(std::unordered_map{ + {std::string(kParquetFieldIdKey), "1"}}); + auto arrow_schema = ::arrow::schema({::arrow::field( + "mystery", ::arrow::null(), /*nullable=*/false, std::move(metadata))}); + + ArrowSchema exported_schema; + ASSERT_TRUE(::arrow::ExportSchema(*arrow_schema, &exported_schema).ok()); + + auto schema_result = FromArrowSchema(exported_schema, /*schema_id=*/0); + ArrowSchemaRelease(&exported_schema); + + ASSERT_THAT(schema_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(schema_result, + HasErrorMessage("Arrow null field 'mystery' must be nullable")); +} + +TEST(FromArrowSchemaTest, RejectRequiredNullListElementAsUnknown) { + auto list_metadata = + ::arrow::key_value_metadata(std::unordered_map{ + {std::string(kParquetFieldIdKey), "1"}}); + auto element_metadata = + ::arrow::key_value_metadata(std::unordered_map{ + {std::string(kParquetFieldIdKey), "2"}}); + auto element_field = ::arrow::field("element", ::arrow::null(), /*nullable=*/false, + std::move(element_metadata)); + auto arrow_schema = + ::arrow::schema({::arrow::field("mysteries", ::arrow::list(element_field), + /*nullable=*/true, std::move(list_metadata))}); + + ArrowSchema exported_schema; + ASSERT_TRUE(::arrow::ExportSchema(*arrow_schema, &exported_schema).ok()); + + auto schema_result = FromArrowSchema(exported_schema, /*schema_id=*/0); + ArrowSchemaRelease(&exported_schema); + + ASSERT_THAT(schema_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(schema_result, + HasErrorMessage("Arrow null field 'element' must be nullable")); +} TEST(FromArrowSchemaTest, StructType) { constexpr int32_t kStructFieldId = 1; diff --git a/src/iceberg/test/avro_data_test.cc b/src/iceberg/test/avro_data_test.cc index 2979ad9bd..7731f58d3 100644 --- a/src/iceberg/test/avro_data_test.cc +++ b/src/iceberg/test/avro_data_test.cc @@ -1241,6 +1241,27 @@ TEST(ExtractDatumFromArrayTest, NullHandling) { EXPECT_EQ(record2.fieldAt(0).type(), ::avro::AVRO_NULL); } +TEST(ExtractDatumFromArrayTest, UnknownType) { + Schema iceberg_schema({SchemaField::MakeOptional(1, "a", unknown())}); + ::avro::NodePtr avro_node; + ASSERT_THAT(ToAvroNodeVisitor{}.Visit(iceberg_schema, &avro_node), IsOk()); + + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(iceberg_schema, &arrow_c_schema), IsOk()); + auto arrow_schema = ::arrow::ImportSchema(&arrow_c_schema).ValueOrDie(); + auto arrow_struct_type = std::make_shared<::arrow::StructType>(arrow_schema->fields()); + + auto arrow_array = + ::arrow::json::ArrayFromJSONString(arrow_struct_type, R"([{"a": null}])") + .ValueOrDie(); + + ::avro::GenericDatum datum(avro_node); + ASSERT_THAT(ExtractDatumFromArray(*arrow_array, 0, &datum), IsOk()); + + const auto& record = datum.value<::avro::GenericRecord>(); + EXPECT_EQ(record.fieldAt(0).type(), ::avro::AVRO_NULL); +} + struct RoundTripParam { std::string name; std::shared_ptr iceberg_schema; diff --git a/src/iceberg/test/avro_schema_test.cc b/src/iceberg/test/avro_schema_test.cc index dc2cb0a51..ffb668abc 100644 --- a/src/iceberg/test/avro_schema_test.cc +++ b/src/iceberg/test/avro_schema_test.cc @@ -250,6 +250,12 @@ TEST(ToAvroNodeVisitorTest, BinaryType) { EXPECT_EQ(node->type(), ::avro::AVRO_BYTES); } +TEST(ToAvroNodeVisitorTest, UnknownType) { + ::avro::NodePtr node; + EXPECT_THAT(ToAvroNodeVisitor{}.Visit(UnknownType{}, &node), IsOk()); + EXPECT_EQ(node->type(), ::avro::AVRO_NULL); +} + TEST(ToAvroNodeVisitorTest, StructType) { StructType struct_type{{SchemaField{/*field_id=*/1, "bool_field", iceberg::boolean(), /*optional=*/false}, @@ -276,6 +282,70 @@ TEST(ToAvroNodeVisitorTest, StructType) { EXPECT_EQ(node->leafAt(1)->leafAt(1)->type(), ::avro::AVRO_INT); } +TEST(ToAvroNodeVisitorTest, OptionalUnknownField) { + StructType struct_type{{SchemaField{/*field_id=*/1, "mystery", iceberg::unknown(), + /*optional=*/true}}}; + + ::avro::NodePtr node; + EXPECT_THAT(ToAvroNodeVisitor{}.Visit(struct_type, &node), IsOk()); + + ASSERT_EQ(node->leaves(), 1); + EXPECT_EQ(node->leafAt(0)->type(), ::avro::AVRO_NULL); + ASSERT_EQ(node->customAttributes(), 1); + ASSERT_NO_FATAL_FAILURE(CheckFieldIdAt(node, /*index=*/0, /*field_id=*/1)); +} + +TEST(ToAvroNodeVisitorTest, NestedUnknownFields) { + StructType struct_type{ + {SchemaField::MakeOptional( + /*field_id=*/1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/2, "mystery", iceberg::unknown()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "mysteries", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/4, "element", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/5, "properties", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/6, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/7, "value", iceberg::unknown())))}}; + + ::avro::NodePtr node; + EXPECT_THAT(ToAvroNodeVisitor{}.Visit(struct_type, &node), IsOk()); + + ASSERT_EQ(node->leaves(), 3); + auto profile_union = node->leafAt(0); + ASSERT_EQ(profile_union->type(), ::avro::AVRO_UNION); + auto profile_node = profile_union->leafAt(1); + ASSERT_EQ(profile_node->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(profile_node->leaves(), 1); + EXPECT_EQ(profile_node->leafAt(0)->type(), ::avro::AVRO_NULL); + ASSERT_NO_FATAL_FAILURE(CheckFieldIdAt(profile_node, /*index=*/0, /*field_id=*/2)); + + auto list_union = node->leafAt(1); + ASSERT_EQ(list_union->type(), ::avro::AVRO_UNION); + auto list_node = list_union->leafAt(1); + ASSERT_EQ(list_node->type(), ::avro::AVRO_ARRAY); + ASSERT_EQ(list_node->leaves(), 1); + EXPECT_EQ(list_node->leafAt(0)->type(), ::avro::AVRO_NULL); + ASSERT_NO_FATAL_FAILURE(CheckFieldIdAt(list_node, /*index=*/0, /*field_id=*/4, + /*key=*/"element-id")); + + auto map_union = node->leafAt(2); + ASSERT_EQ(map_union->type(), ::avro::AVRO_UNION); + auto map_node = map_union->leafAt(1); + ASSERT_EQ(map_node->type(), ::avro::AVRO_MAP); + ASSERT_EQ(map_node->leaves(), 2); + EXPECT_EQ(map_node->leafAt(0)->type(), ::avro::AVRO_STRING); + EXPECT_EQ(map_node->leafAt(1)->type(), ::avro::AVRO_NULL); + ASSERT_NO_FATAL_FAILURE(CheckFieldIdAt(map_node, /*index=*/0, /*field_id=*/6, + /*key=*/"key-id")); + ASSERT_NO_FATAL_FAILURE(CheckFieldIdAt(map_node, /*index=*/0, /*field_id=*/7, + /*key=*/"value-id")); +} + TEST(ToAvroNodeVisitorTest, StructTypeWithFieldNames) { StructType struct_type{ {SchemaField{/*field_id=*/1, "user-name", iceberg::string(), @@ -480,6 +550,13 @@ TEST(HasIdVisitorTest, HasNoIds) { EXPECT_FALSE(visitor.AllHaveIds()); } +TEST(HasIdVisitorTest, NullType) { + HasIdVisitor visitor; + EXPECT_THAT(visitor.Visit(::avro::compileJsonSchemaFromString("\"null\"")), IsOk()); + EXPECT_TRUE(visitor.HasNoIds()); + EXPECT_FALSE(visitor.AllHaveIds()); +} + TEST(HasIdVisitorTest, RecordWithFieldIds) { const std::string schema_json = R"({ "type": "record", @@ -899,6 +976,146 @@ TEST(AvroSchemaProjectionTest, ProjectSchemaEvolutionFloatToDouble) { ASSERT_EQ(std::get<1>(projection.fields[0].from), 0); } +TEST(AvroSchemaProjectionTest, ProjectUnknownExpectedFieldAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional(/*field_id=*/1, "mystery", iceberg::unknown()), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "mystery", "type": "int", "field-id": 1} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 1); + ASSERT_EQ(projection.fields[0].kind, FieldProjection::Kind::kNull); +} + +TEST(AvroSchemaProjectionTest, ProjectNestedUnknownExpectedFieldsAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/2, "name", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/3, "mystery", iceberg::unknown()), + })), + SchemaField::MakeOptional( + /*field_id=*/4, "mysteries", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/5, "element", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/6, "properties", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/7, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/8, "value", iceberg::unknown()))), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "profile", "type": ["null", { + "type": "record", + "name": "profile_record", + "fields": [ + {"name": "name", "type": ["null", "string"], "field-id": 2}, + {"name": "mystery", "type": ["null", "int"], "field-id": 3} + ] + }], "field-id": 1}, + {"name": "mysteries", "type": ["null", { + "type": "array", + "items": ["null", "int"], + "element-id": 5 + }], "field-id": 4}, + {"name": "properties", "type": ["null", { + "type": "map", + "values": ["null", "int"], + "key-id": 7, + "value-id": 8 + }], "field-id": 6} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 3); + + ASSERT_EQ(projection.fields[0].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(projection.fields[0].children.size(), 2); + ASSERT_EQ(projection.fields[0].children[0].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(projection.fields[0].children[1].kind, FieldProjection::Kind::kNull); + + ASSERT_EQ(projection.fields[1].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(projection.fields[1].children.size(), 1); + ASSERT_EQ(projection.fields[1].children[0].kind, FieldProjection::Kind::kNull); + + ASSERT_EQ(projection.fields[2].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(projection.fields[2].children.size(), 2); + ASSERT_EQ(projection.fields[2].children[0].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(projection.fields[2].children[1].kind, FieldProjection::Kind::kNull); +} + +TEST(AvroSchemaProjectionTest, RejectNullLeafForRequiredField) { + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "value", iceberg::int32()), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "value", "type": "null", "field-id": 1} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with ID: 1 as null")); +} + +TEST(AvroSchemaProjectionTest, RejectNullListElementForRequiredElement) { + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/1, "numbers", + std::make_shared(SchemaField::MakeRequired( + /*field_id=*/101, "element", iceberg::int32()))), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "numbers", "type": ["null", { + "type": "array", + "items": "null", + "element-id": 101 + }], "field-id": 1} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with ID: 101 as null")); +} + TEST(AvroSchemaProjectionTest, ProjectSchemaEvolutionIncompatibleTypes) { // Create iceberg schema expecting an int Schema expected_schema({ diff --git a/src/iceberg/test/avro_test.cc b/src/iceberg/test/avro_test.cc index b74fe829b..ef86ef9e2 100644 --- a/src/iceberg/test/avro_test.cc +++ b/src/iceberg/test/avro_test.cc @@ -17,7 +17,10 @@ * under the License. */ +#include #include +#include +#include #include #include @@ -30,6 +33,7 @@ #include #include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/avro/avro_constants.h" #include "iceberg/avro/avro_register.h" #include "iceberg/avro/avro_stream_internal.h" #include "iceberg/avro/avro_writer.h" @@ -45,6 +49,35 @@ namespace iceberg::avro { +namespace { + +::avro::NodePtr UnwrapOptional(const ::avro::NodePtr& node) { + if (node->type() != ::avro::AVRO_UNION) { + return node; + } + + for (size_t i = 0; i < node->leaves(); ++i) { + if (node->leafAt(i)->type() != ::avro::AVRO_NULL) { + return node->leafAt(i); + } + } + return node; +} + +std::optional FieldIdAt(const ::avro::NodePtr& node, size_t index) { + if (index >= node->customAttributes()) { + return std::nullopt; + } + + auto field_id = node->customAttributesAt(index).getAttribute(std::string(kFieldIdProp)); + if (!field_id.has_value()) { + return std::nullopt; + } + return std::stoi(field_id.value()); +} + +} // namespace + class AvroReaderTest : public TempFileTestBase { protected: static void SetUpTestSuite() { RegisterAll(); } @@ -740,6 +773,14 @@ class AvroWriterTest : public ::testing::Test, ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); } + ::avro::ValidSchema PhysicalAvroSchema() { + auto& mock_io = internal::checked_cast(*file_io_); + auto input = mock_io.fs()->OpenInputFile(temp_avro_file_).ValueOrDie(); + auto input_stream = std::make_unique(std::move(input), 1024 * 1024); + ::avro::DataFileReader<::avro::GenericDatum> avro_reader(std::move(input_stream)); + return avro_reader.dataSchema(); + } + std::shared_ptr file_io_; std::string temp_avro_file_; bool skip_datum_{true}; @@ -890,6 +931,148 @@ TEST_P(AvroWriterTest, WriteOptionalFields) { VerifyWrittenData(test_data); } +TEST_P(AvroWriterTest, WritesUnknownFieldsAsAvroNull) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "id", int32()), + SchemaField::MakeOptional(2, "mystery", unknown()), + SchemaField::MakeOptional(3, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(4, "name", string()), + SchemaField::MakeOptional(5, "secret", unknown()), + })), + }); + + std::string test_data = R"([ + [1, null, {"name": "Person0", "secret": null}], + [2, null, {"name": "Person1", "secret": null}] + ])"; + + WriteAvroFile(schema, test_data); + + auto avro_schema = PhysicalAvroSchema(); + auto root = avro_schema.root(); + ASSERT_EQ(root->type(), ::avro::AVRO_RECORD); + // Unknown fields are written as AVRO_NULL, not pruned. + ASSERT_EQ(root->leaves(), 3); + EXPECT_EQ(root->nameAt(0), "id"); + EXPECT_EQ(FieldIdAt(root, 0), std::make_optional(1)); + EXPECT_EQ(root->nameAt(1), "mystery"); + EXPECT_EQ(root->leafAt(1)->type(), ::avro::AVRO_NULL); + EXPECT_EQ(FieldIdAt(root, 1), std::make_optional(2)); + EXPECT_EQ(root->nameAt(2), "profile"); + EXPECT_EQ(FieldIdAt(root, 2), std::make_optional(3)); + + auto profile = UnwrapOptional(root->leafAt(2)); + ASSERT_EQ(profile->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(profile->leaves(), 2); + EXPECT_EQ(profile->nameAt(0), "name"); + EXPECT_EQ(FieldIdAt(profile, 0), std::make_optional(4)); + EXPECT_EQ(profile->nameAt(1), "secret"); + EXPECT_EQ(profile->leafAt(1)->type(), ::avro::AVRO_NULL); + EXPECT_EQ(FieldIdAt(profile, 1), std::make_optional(5)); + + VerifyWrittenData(test_data); +} + +TEST_P(AvroWriterTest, WritesUnknownListElementsAndMapValues) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeRequired(2, "mysteries", + std::make_shared(SchemaField::MakeOptional( + 3, ListType::kElementName, unknown()))), + SchemaField::MakeRequired( + 4, "properties", + std::make_shared( + SchemaField::MakeRequired(5, MapType::kKeyName, string()), + SchemaField::MakeOptional(6, MapType::kValueName, unknown()))), + }); + + std::string test_data = R"([ + [1, [null, null], [["a", null], ["b", null]]], + [2, [], []], + [3, [null], [["c", null]]] + ])"; + + WriteAvroFile(schema, test_data); + + auto avro_schema = PhysicalAvroSchema(); + auto root = avro_schema.root(); + ASSERT_EQ(root->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(root->leaves(), 3); + + auto mysteries = root->leafAt(1); + ASSERT_EQ(mysteries->type(), ::avro::AVRO_ARRAY); + ASSERT_EQ(mysteries->leaves(), 1); + EXPECT_EQ(mysteries->leafAt(0)->type(), ::avro::AVRO_NULL); + + auto properties = root->leafAt(2); + ASSERT_EQ(properties->type(), ::avro::AVRO_MAP); + ASSERT_EQ(properties->leaves(), 2); + EXPECT_EQ(properties->leafAt(1)->type(), ::avro::AVRO_NULL); + + VerifyWrittenData(test_data); +} + +TEST_P(AvroWriterTest, WritesUnknownFieldsNestedInsideListOrMapStructs) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "id", int32()), + SchemaField::MakeOptional(2, "events", + std::make_shared(SchemaField::MakeOptional( + 3, ListType::kElementName, + std::make_shared(std::vector{ + SchemaField::MakeOptional(4, "name", string()), + SchemaField::MakeOptional(5, "secret", unknown()), + })))), + SchemaField::MakeOptional( + 6, "properties", + std::make_shared( + SchemaField::MakeRequired(7, MapType::kKeyName, iceberg::string()), + SchemaField::MakeOptional( + 8, MapType::kValueName, + std::make_shared(std::vector{ + SchemaField::MakeOptional(9, "label", string()), + SchemaField::MakeOptional(10, "secret", unknown()), + })))), + }); + + std::string test_data = R"([ + [1, [{"name": "open", "secret": null}, {"name": "close", "secret": null}], [["a", {"label": "A", "secret": null}]]], + [2, [], []] + ])"; + + WriteAvroFile(schema, test_data); + + auto avro_schema = PhysicalAvroSchema(); + auto root = avro_schema.root(); + ASSERT_EQ(root->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(root->leaves(), 3); + + auto events = UnwrapOptional(root->leafAt(1)); + ASSERT_EQ(events->type(), ::avro::AVRO_ARRAY); + auto event = UnwrapOptional(events->leafAt(0)); + ASSERT_EQ(event->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(event->leaves(), 2); + EXPECT_EQ(event->nameAt(0), "name"); + EXPECT_EQ(FieldIdAt(event, 0), std::make_optional(4)); + EXPECT_EQ(event->nameAt(1), "secret"); + EXPECT_EQ(event->leafAt(1)->type(), ::avro::AVRO_NULL); + EXPECT_EQ(FieldIdAt(event, 1), std::make_optional(5)); + + auto properties = UnwrapOptional(root->leafAt(2)); + ASSERT_EQ(properties->type(), ::avro::AVRO_MAP); + ASSERT_EQ(properties->leaves(), 2); + auto value = UnwrapOptional(properties->leafAt(1)); + ASSERT_EQ(value->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(value->leaves(), 2); + EXPECT_EQ(value->nameAt(0), "label"); + EXPECT_EQ(FieldIdAt(value, 0), std::make_optional(9)); + EXPECT_EQ(value->nameAt(1), "secret"); + EXPECT_EQ(value->leafAt(1)->type(), ::avro::AVRO_NULL); + EXPECT_EQ(FieldIdAt(value, 1), std::make_optional(10)); + + VerifyWrittenData(test_data); +} + TEST_P(AvroWriterTest, WriteLargeDataset) { auto schema = std::make_shared(std::vector{ SchemaField::MakeRequired(1, "id", std::make_shared()), diff --git a/src/iceberg/test/metadata_serde_test.cc b/src/iceberg/test/metadata_serde_test.cc index 0d3b5959b..2c2b2bd1e 100644 --- a/src/iceberg/test/metadata_serde_test.cc +++ b/src/iceberg/test/metadata_serde_test.cc @@ -21,7 +21,9 @@ #include #include +#include +#include "iceberg/json_serde_internal.h" #include "iceberg/partition_field.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" @@ -404,6 +406,57 @@ TEST(MetadataSerdeTest, DeserializeUnsupportedVersion) { "Cannot read unsupported version"); } +TEST(MetadataSerdeTest, DeserializeRejectsUnknownSchemaBeforeFormatV3) { + auto v1_metadata_json = nlohmann::json::parse(R"({ + "format-version": 1, + "location": "s3://bucket/test/location", + "last-column-id": 1, + "last-updated-ms": 1602638573874, + "schema": { + "type": "struct", + "schema-id": 0, + "fields": [ + {"id": 1, "name": "mystery", "type": "unknown", "required": false} + ] + }, + "partition-spec": [] + })"); + + auto result = TableMetadataFromJson(v1_metadata_json); + ASSERT_THAT(result, IsError(ErrorKind::kInvalidSchema)); + EXPECT_THAT(result, HasErrorMessage( + "Invalid type for mystery: unknown is not supported until v3")); + + auto v2_metadata_json = nlohmann::json::parse(R"({ + "format-version": 2, + "table-uuid": "9c12d441-03fe-4693-9a96-a0705ddf69c1", + "location": "s3://bucket/test/location", + "last-sequence-number": 0, + "last-column-id": 1, + "last-updated-ms": 1602638573874, + "schemas": [ + { + "type": "struct", + "schema-id": 0, + "fields": [ + {"id": 1, "name": "mystery", "type": "unknown", "required": false} + ] + } + ], + "current-schema-id": 0, + "partition-specs": [{"spec-id": 0, "fields": []}], + "default-spec-id": 0, + "last-partition-id": 999, + "sort-orders": [{"order-id": 0, "fields": []}], + "default-sort-order-id": 0 + })"); + + result = TableMetadataFromJson(v2_metadata_json); + ASSERT_THAT(result, IsError(ErrorKind::kInvalidSchema)); + EXPECT_THAT(result, HasErrorMessage( + "Invalid type for mystery: unknown is not supported until v3")); +} + TEST(MetadataSerdeTest, DeserializeV1MissingSchemaType) { ReadTableMetadataExpectError("TableMetadataV1MissingSchemaType.json", "Missing 'type'"); } diff --git a/src/iceberg/test/parquet_data_test.cc b/src/iceberg/test/parquet_data_test.cc index 9ed28114e..606ad8ca5 100644 --- a/src/iceberg/test/parquet_data_test.cc +++ b/src/iceberg/test/parquet_data_test.cc @@ -316,6 +316,50 @@ TEST(ProjectRecordBatchTest, MapStringToInt) { VerifyProjectRecordBatch(iceberg_schema, iceberg_schema, input_json, input_json)); } +TEST(ProjectRecordBatchTest, NestedUnknownFields) { + Schema projected_schema({ + SchemaField::MakeRequired(1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeRequired(2, "name", string()), + SchemaField::MakeOptional(3, "mystery", unknown()), + })), + SchemaField::MakeRequired( + 4, "mysteries", + std::make_shared(SchemaField::MakeOptional(5, "element", unknown()))), + SchemaField::MakeRequired( + 6, "properties", + std::make_shared(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeOptional(8, "value", unknown()))), + }); + + Schema source_schema({ + SchemaField::MakeRequired(1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeRequired(2, "name", string()), + SchemaField::MakeOptional(3, "mystery", int32()), + })), + SchemaField::MakeRequired( + 4, "mysteries", + std::make_shared(SchemaField::MakeOptional(5, "element", int32()))), + SchemaField::MakeRequired( + 6, "properties", + std::make_shared(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeOptional(8, "value", int32()))), + }); + + const std::string input_json = R"([ + {"profile": {"name": "Person0", "mystery": 10}, "mysteries": [1, 2], "properties": [["a", 100], ["b", 200]]}, + {"profile": {"name": "Person1", "mystery": null}, "mysteries": [], "properties": []} + ])"; + const std::string expected_json = R"([ + {"profile": {"name": "Person0", "mystery": null}, "mysteries": [null, null], "properties": [["a", null], ["b", null]]}, + {"profile": {"name": "Person1", "mystery": null}, "mysteries": [], "properties": []} + ])"; + + ASSERT_NO_FATAL_FAILURE(VerifyProjectRecordBatch(projected_schema, source_schema, + input_json, expected_json)); +} + TEST(ProjectRecordBatchTest, MapStringToStruct) { Schema iceberg_schema({ SchemaField::MakeRequired( diff --git a/src/iceberg/test/parquet_schema_test.cc b/src/iceberg/test/parquet_schema_test.cc index a9da3f9f7..75e99ff12 100644 --- a/src/iceberg/test/parquet_schema_test.cc +++ b/src/iceberg/test/parquet_schema_test.cc @@ -17,7 +17,12 @@ * under the License. */ +#include +#include +#include + #include +#include #include #include #include @@ -123,6 +128,30 @@ ::parquet::arrow::SchemaManifest MakeSchemaManifest( return manifest; } +::parquet::arrow::SchemaField MakeNullSchemaField(const std::string& name, int field_id) { + ::parquet::arrow::SchemaField schema_field; + schema_field.field = + ::arrow::field(name, ::arrow::null()) + ->WithMetadata(::arrow::key_value_metadata({std::string(kParquetFieldIdKey)}, + {std::to_string(field_id)})); + return schema_field; +} + +::parquet::arrow::SchemaField MakeListSchemaFieldWithNullElement(const std::string& name, + int field_id, + int element_field_id) { + ::parquet::arrow::SchemaField element_field = + MakeNullSchemaField("element", element_field_id); + + ::parquet::arrow::SchemaField schema_field; + schema_field.field = + ::arrow::field(name, ::arrow::list(element_field.field)) + ->WithMetadata(::arrow::key_value_metadata({std::string(kParquetFieldIdKey)}, + {std::to_string(field_id)})); + schema_field.children = {std::move(element_field)}; + return schema_field; +} + #define ASSERT_PROJECTED_FIELD(field_projection, index) \ ASSERT_EQ(field_projection.kind, FieldProjection::Kind::kProjected); \ ASSERT_EQ(std::get<1>(field_projection.from), index); @@ -303,6 +332,213 @@ TEST(ParquetSchemaProjectionTest, ProjectSchemaEvolutionFloatToDouble) { ASSERT_PROJECTED_FIELD(projection.fields[0], 0); } +TEST(ParquetSchemaProjectionTest, ValidateSchemaEvolutionAllowsNullPhysicalType) { + ::parquet::arrow::SchemaField parquet_field; + parquet_field.field = ::arrow::field("value", ::arrow::null()); + + auto status = ValidateParquetSchemaEvolution(*iceberg::int32(), parquet_field); + ASSERT_THAT(status, IsOk()); +} + +TEST(ParquetSchemaProjectionTest, ProjectNullPhysicalFieldsAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional(/*field_id=*/1, "age", iceberg::int32()), + SchemaField::MakeOptional( + /*field_id=*/2, "profile", + std::make_shared(std::vector{ + SchemaField::MakeRequired(/*field_id=*/201, "name", iceberg::string()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "numbers", + std::make_shared(SchemaField::MakeRequired( + /*field_id=*/301, "element", iceberg::int32()))), + SchemaField::MakeOptional( + /*field_id=*/4, "counts", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/401, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/402, "value", iceberg::int32()))), + }); + + ::parquet::arrow::SchemaManifest schema_manifest; + schema_manifest.schema_fields = { + MakeNullSchemaField("age", /*field_id=*/1), + MakeNullSchemaField("profile", /*field_id=*/2), + MakeNullSchemaField("numbers", /*field_id=*/3), + MakeNullSchemaField("counts", /*field_id=*/4), + }; + + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 4); + for (const auto& field_projection : projection.fields) { + ASSERT_PROJECTED_NULL_FIELD(field_projection); + ASSERT_TRUE(field_projection.children.empty()); + } + + ASSERT_TRUE(SelectedColumnIndices(projection).empty()); +} + +TEST(ParquetSchemaProjectionTest, RejectNullPhysicalFieldForRequiredField) { + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "age", iceberg::int32()), + }); + + ::parquet::arrow::SchemaManifest schema_manifest; + schema_manifest.schema_fields = { + MakeNullSchemaField("age", /*field_id=*/1), + }; + + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with id 1 as null")); +} + +TEST(ParquetSchemaProjectionTest, RejectNullPhysicalListElementForRequiredElement) { + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/1, "numbers", + std::make_shared(SchemaField::MakeRequired( + /*field_id=*/101, "element", iceberg::int32()))), + }); + + ::parquet::arrow::SchemaManifest schema_manifest; + schema_manifest.schema_fields = { + MakeListSchemaFieldWithNullElement("numbers", /*field_id=*/1, + /*element_field_id=*/101), + }; + + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with id 101 as null")); +} + +TEST(ParquetSchemaProjectionTest, ProjectUnknownExpectedFieldAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional(/*field_id=*/1, "mystery", iceberg::unknown()), + }); + + auto parquet_schema = + MakeGroupNode("iceberg_schema", {MakeInt32Node("mystery", /*field_id=*/1)}); + + auto schema_manifest = MakeSchemaManifest(parquet_schema); + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 1); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[0]); + ASSERT_TRUE(SelectedColumnIndices(projection).empty()); +} + +TEST(ParquetSchemaProjectionTest, ProjectNullPhysicalFieldToNestedAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/2, "name", iceberg::string()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "items", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/4, "element", iceberg::string()))), + SchemaField::MakeOptional( + /*field_id=*/5, "properties", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/6, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/7, "value", iceberg::string()))), + }); + + ::parquet::arrow::SchemaManifest schema_manifest; + schema_manifest.schema_fields = { + MakeNullSchemaField("profile", /*field_id=*/1), + MakeNullSchemaField("items", /*field_id=*/3), + MakeNullSchemaField("properties", /*field_id=*/5), + }; + + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 3); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[0]); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[1]); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[2]); + ASSERT_TRUE(SelectedColumnIndices(projection).empty()); +} + +TEST(ParquetSchemaProjectionTest, ProjectNestedUnknownExpectedFieldsAsNull) { + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/2, "name", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/3, "mystery", iceberg::unknown()), + })), + SchemaField::MakeOptional( + /*field_id=*/4, "mysteries", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/5, "element", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/6, "properties", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/7, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/8, "value", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/9, "wrapper", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/10, "mystery", iceberg::unknown()), + })), + }); + + auto parquet_schema = MakeGroupNode( + "iceberg_schema", + { + MakeGroupNode("profile", + {MakeStringNode("name", /*field_id=*/2), + MakeInt32Node("mystery", /*field_id=*/3)}, + /*field_id=*/1), + MakeListNode("mysteries", MakeInt32Node("element", /*field_id=*/5), + /*field_id=*/4), + MakeMapNode("properties", + MakeStringNode("key", /*field_id=*/7, /*optional=*/false), + MakeInt32Node("value", /*field_id=*/8), + /*field_id=*/6), + MakeGroupNode("wrapper", {MakeInt32Node("mystery", /*field_id=*/10)}, + /*field_id=*/9), + }); + + auto schema_manifest = MakeSchemaManifest(parquet_schema); + auto projection_result = Project(expected_schema, schema_manifest); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 4); + + ASSERT_PROJECTED_FIELD(projection.fields[0], 0); + ASSERT_EQ(projection.fields[0].children.size(), 2); + ASSERT_PROJECTED_FIELD(projection.fields[0].children[0], 0); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[0].children[1]); + + ASSERT_PROJECTED_FIELD(projection.fields[1], 1); + ASSERT_EQ(projection.fields[1].children.size(), 1); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[1].children[0]); + + ASSERT_PROJECTED_FIELD(projection.fields[2], 2); + ASSERT_EQ(projection.fields[2].children.size(), 2); + ASSERT_PROJECTED_FIELD(projection.fields[2].children[0], 0); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[2].children[1]); + + ASSERT_PROJECTED_FIELD(projection.fields[3], 3); + ASSERT_EQ(projection.fields[3].children.size(), 1); + ASSERT_PROJECTED_NULL_FIELD(projection.fields[3].children[0]); + + ASSERT_EQ(SelectedColumnIndices(projection), std::vector({0, 2, 3, 4, 5})); +} + TEST(ParquetSchemaProjectionTest, ProjectSchemaEvolutionIncompatibleTypes) { Schema expected_schema({ SchemaField::MakeRequired(/*field_id=*/1, "value", iceberg::int32()), diff --git a/src/iceberg/test/parquet_test.cc b/src/iceberg/test/parquet_test.cc index 70fb9880f..ee1cbc931 100644 --- a/src/iceberg/test/parquet_test.cc +++ b/src/iceberg/test/parquet_test.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "iceberg/arrow/arrow_io_internal.h" @@ -461,6 +462,78 @@ TEST_F(ParquetReaderTest, ReadMetadataOnlyProjection) { ASSERT_NO_FATAL_FAILURE(VerifyNextBatch(*reader, kExpectedJson)); } +TEST_F(ParquetReaderTest, ReadNestedUnknownProjection) { + temp_parquet_file_ = "nested_unknown.parquet"; + auto write_schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "mystery", int32()), + })), + SchemaField::MakeOptional( + 4, "mysteries", + std::make_shared(SchemaField::MakeOptional(5, "element", int32()))), + SchemaField::MakeOptional( + 6, "properties", + std::make_shared(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeOptional(8, "value", int32()))), + SchemaField::MakeOptional(9, "wrapper", + std::make_shared(std::vector{ + SchemaField::MakeOptional(10, "mystery", int32()), + })), + }); + auto read_schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "mystery", unknown()), + })), + SchemaField::MakeOptional( + 4, "mysteries", + std::make_shared(SchemaField::MakeOptional(5, "element", unknown()))), + SchemaField::MakeOptional( + 6, "properties", + std::make_shared(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeOptional(8, "value", unknown()))), + SchemaField::MakeOptional(9, "wrapper", + std::make_shared(std::vector{ + SchemaField::MakeOptional(10, "mystery", unknown()), + })), + }); + + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(*write_schema, &arrow_c_schema), IsOk()); + auto arrow_type = ::arrow::ImportType(&arrow_c_schema).ValueOrDie(); + auto array = ::arrow::json::ArrayFromJSONString(arrow_type, + R"([ + {"profile": {"name": "Person0", "mystery": 10}, "mysteries": [1, 2], "properties": [["a", 100], ["b", 200]], "wrapper": {"mystery": 300}}, + {"profile": {"name": "Person1", "mystery": null}, "mysteries": [], "properties": [], "wrapper": {"mystery": null}} + ])") + .ValueOrDie(); + + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kParquetCompression, + std::string("uncompressed")); + ASSERT_THAT(WriteArray(array, {.path = temp_parquet_file_, + .schema = write_schema, + .io = file_io_, + .properties = std::move(writer_properties)}), + IsOk()); + + ICEBERG_UNWRAP_OR_FAIL( + auto reader, + ReaderFactoryRegistry::Open( + FileFormatType::kParquet, + {.path = temp_parquet_file_, .io = file_io_, .projection = read_schema})); + + ASSERT_NO_FATAL_FAILURE(VerifyNextBatch(*reader, + R"([ + {"profile": {"name": "Person0", "mystery": null}, "mysteries": [null, null], "properties": [["a", null], ["b", null]], "wrapper": {"mystery": null}}, + {"profile": {"name": "Person1", "mystery": null}, "mysteries": [], "properties": [], "wrapper": {"mystery": null}} + ])")); + ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); +} + class ParquetReadWrite : public ::testing::Test { protected: static void SetUpTestSuite() { parquet::RegisterAll(); } @@ -509,6 +582,142 @@ TEST_F(ParquetReadWrite, RejectsUnavailableCompressionCodec) { " is not available in the current build")); } +TEST_F(ParquetReadWrite, WritesUnknownFieldsNestedInsideListOrMapStructs) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "id", int32()), + SchemaField::MakeOptional(2, "events", + std::make_shared(SchemaField::MakeOptional( + 3, ListType::kElementName, + std::make_shared(std::vector{ + SchemaField::MakeOptional(4, "name", string()), + SchemaField::MakeOptional(5, "secret", unknown()), + })))), + SchemaField::MakeOptional( + 6, "properties", + std::make_shared( + SchemaField::MakeRequired(7, MapType::kKeyName, iceberg::string()), + SchemaField::MakeOptional( + 8, MapType::kValueName, + std::make_shared(std::vector{ + SchemaField::MakeOptional(9, "label", string()), + SchemaField::MakeOptional(10, "secret", unknown()), + })))), + }); + + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(*schema, &arrow_c_schema), IsOk()); + auto arrow_schema = ::arrow::ImportType(&arrow_c_schema).ValueOrDie(); + + auto array = + ::arrow::json::ArrayFromJSONString(::arrow::struct_(arrow_schema->fields()), + R"([ + {"id": 1, "events": [{"name": "open", "secret": null}, {"name": "close", "secret": null}], "properties": [["a", {"label": "A", "secret": null}]]}, + {"id": 2, "events": [], "properties": []} + ])") + .ValueOrDie(); + + std::shared_ptr file_io = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); + const std::string basePath = "nested_unknown_fields.parquet"; + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kParquetCompression, + std::string("uncompressed")); + ASSERT_THAT(WriteArray(array, {.path = basePath, + .schema = schema, + .io = file_io, + .properties = std::move(writer_properties)}), + IsOk()); + + auto& arrow_file_io = internal::checked_cast(*file_io); + auto input_file = arrow_file_io.fs()->OpenInputFile(basePath).ValueOrDie(); + auto parquet_reader = ::parquet::ParquetFileReader::Open(input_file); + auto parquet_schema = parquet_reader->metadata()->schema(); + + std::vector field_ids; + for (int i = 0; i < parquet_schema->num_columns(); ++i) { + field_ids.push_back(parquet_schema->Column(i)->schema_node()->field_id()); + } + // Unknown fields (secret, IDs 5 and 10) are also written as null-type columns. + EXPECT_THAT(field_ids, ::testing::UnorderedElementsAre(1, 4, 5, 7, 9, 10)); + + std::shared_ptr<::arrow::Array> out; + ASSERT_THAT(ReadArray(out, {.path = basePath, .io = file_io, .projection = schema}, + /*metadata=*/nullptr), + IsOk()); + auto expected = + ::arrow::json::ArrayFromJSONString(::arrow::struct_(arrow_schema->fields()), + R"([ + {"id": 1, "events": [{"name": "open", "secret": null}, {"name": "close", "secret": null}], "properties": [["a", {"label": "A", "secret": null}]]}, + {"id": 2, "events": [], "properties": []} + ])") + .ValueOrDie(); + ASSERT_TRUE(out->Equals(*expected)) << "actual:\n" + << out->ToString() << "expected:\n" + << expected->ToString(); +} + +TEST_F(ParquetReadWrite, DoesNotMaterializeUnknownFieldsOnWrite) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeOptional(1, "id", int32()), + SchemaField::MakeOptional(2, "mystery", unknown()), + SchemaField::MakeOptional(3, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(4, "name", string()), + SchemaField::MakeOptional(5, "secret", unknown()), + })), + }); + + ArrowSchema arrow_c_schema; + ASSERT_THAT(ToArrowSchema(*schema, &arrow_c_schema), IsOk()); + auto arrow_schema = ::arrow::ImportType(&arrow_c_schema).ValueOrDie(); + + auto array = + ::arrow::json::ArrayFromJSONString(::arrow::struct_(arrow_schema->fields()), + R"([ + [1, null, {"name": "Person0", "secret": null}], + [2, null, {"name": "Person1", "secret": null}] + ])") + .ValueOrDie(); + + std::shared_ptr file_io = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); + const std::string basePath = "unknown_fields.parquet"; + + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kParquetCompression, + std::string("uncompressed")); + ASSERT_THAT(WriteArray(array, {.path = basePath, + .schema = schema, + .io = file_io, + .properties = std::move(writer_properties)}), + IsOk()); + + auto& arrow_file_io = internal::checked_cast(*file_io); + auto input_file = arrow_file_io.fs()->OpenInputFile(basePath).ValueOrDie(); + auto parquet_reader = ::parquet::ParquetFileReader::Open(input_file); + auto parquet_schema = parquet_reader->metadata()->schema(); + + // Unknown fields (mystery, secret) are also written as null-type columns. + ASSERT_EQ(parquet_schema->num_columns(), 4); + EXPECT_EQ(parquet_schema->Column(0)->schema_node()->field_id(), 1); + EXPECT_EQ(parquet_schema->Column(1)->schema_node()->field_id(), 2); + EXPECT_EQ(parquet_schema->Column(2)->schema_node()->field_id(), 4); + EXPECT_EQ(parquet_schema->Column(3)->schema_node()->field_id(), 5); + + std::shared_ptr<::arrow::Array> out; + ASSERT_THAT(ReadArray(out, {.path = basePath, .io = file_io, .projection = schema}, + /*metadata=*/nullptr), + IsOk()); + auto expected = + ::arrow::json::ArrayFromJSONString(::arrow::struct_(arrow_schema->fields()), + R"([ + [1, null, {"name": "Person0", "secret": null}], + [2, null, {"name": "Person1", "secret": null}] + ])") + .ValueOrDie(); + ASSERT_TRUE(out->Equals(*expected)) << "actual:\n" + << out->ToString() << "expected:\n" + << expected->ToString(); +} + TEST_F(ParquetReadWrite, SimpleStructRoundTrip) { auto schema = std::make_shared(std::vector{ SchemaField::MakeOptional(1, "a", diff --git a/src/iceberg/test/schema_json_test.cc b/src/iceberg/test/schema_json_test.cc index c9532eeb6..08275a45c 100644 --- a/src/iceberg/test/schema_json_test.cc +++ b/src/iceberg/test/schema_json_test.cc @@ -64,6 +64,7 @@ INSTANTIATE_TEST_SUITE_P( SchemaJsonParam{.json = "\"string\"", .type = iceberg::string()}, SchemaJsonParam{.json = "\"binary\"", .type = iceberg::binary()}, SchemaJsonParam{.json = "\"uuid\"", .type = iceberg::uuid()}, + SchemaJsonParam{.json = "\"unknown\"", .type = iceberg::unknown()}, SchemaJsonParam{.json = "\"fixed[8]\"", .type = iceberg::fixed(8)}, SchemaJsonParam{.json = "\"decimal(10,2)\"", .type = iceberg::decimal(10, 2)}, SchemaJsonParam{.json = "\"date\"", .type = iceberg::date()}, @@ -136,6 +137,88 @@ TEST(SchemaJsonTest, RoundTrip) { ASSERT_EQ(dumped_json, json); } +TEST(SchemaJsonTest, UnknownFieldRoundTrip) { + constexpr std::string_view json = + R"({"fields":[{"id":1,"name":"mystery","required":false,"type":"unknown"}],"schema-id":1,"type":"struct"})"; + + ICEBERG_UNWRAP_OR_FAIL(auto schema, SchemaFromJson(nlohmann::json::parse(json))); + ASSERT_EQ(schema->fields().size(), 1); + + const auto& field = schema->fields()[0]; + ASSERT_EQ(field.field_id(), 1); + ASSERT_EQ(field.name(), "mystery"); + ASSERT_EQ(field.type()->type_id(), TypeId::kUnknown); + ASSERT_TRUE(field.optional()); + ASSERT_EQ(ToJson(*schema).dump(), json); +} + +TEST(SchemaJsonTest, NestedUnknownFieldsRoundTrip) { + constexpr std::string_view json = + R"({ + "fields": [ + { + "id": 1, + "name": "profile", + "required": false, + "type": { + "fields": [ + {"id": 2, "name": "mystery", "required": false, "type": "unknown"} + ], + "type": "struct" + } + }, + { + "id": 3, + "name": "mysteries", + "required": false, + "type": { + "element": "unknown", + "element-id": 4, + "element-required": false, + "type": "list" + } + }, + { + "id": 5, + "name": "properties", + "required": false, + "type": { + "key": "string", + "key-id": 6, + "type": "map", + "value": "unknown", + "value-id": 7, + "value-required": false + } + } + ], + "schema-id": 1, + "type": "struct" + })"; + const auto parsed_json = nlohmann::json::parse(json); + + ICEBERG_UNWRAP_OR_FAIL(auto schema, SchemaFromJson(parsed_json)); + ASSERT_EQ(schema->fields().size(), 3); + + const auto* profile = dynamic_cast(schema->fields()[0].type().get()); + ASSERT_NE(profile, nullptr); + ASSERT_EQ(profile->fields().size(), 1); + ASSERT_EQ(profile->fields()[0].type()->type_id(), TypeId::kUnknown); + ASSERT_TRUE(profile->fields()[0].optional()); + + const auto* mysteries = dynamic_cast(schema->fields()[1].type().get()); + ASSERT_NE(mysteries, nullptr); + ASSERT_EQ(mysteries->fields()[0].type()->type_id(), TypeId::kUnknown); + ASSERT_TRUE(mysteries->fields()[0].optional()); + + const auto* properties = dynamic_cast(schema->fields()[2].type().get()); + ASSERT_NE(properties, nullptr); + ASSERT_EQ(properties->value().type()->type_id(), TypeId::kUnknown); + ASSERT_TRUE(properties->value().optional()); + + ASSERT_EQ(ToJson(*schema), parsed_json); +} + TEST(SchemaJsonTest, IdentifierFieldIds) { // Test schema with identifier-field-ids constexpr std::string_view json_with_identifier_str = diff --git a/src/iceberg/test/schema_test.cc b/src/iceberg/test/schema_test.cc index 838b57600..8f1b20035 100644 --- a/src/iceberg/test/schema_test.cc +++ b/src/iceberg/test/schema_test.cc @@ -102,6 +102,8 @@ TEST(SchemaTest, ValidateRejectsV3TypesBeforeFormatV3) { {iceberg::SchemaField(1, "timestamp_ns", iceberg::timestamp_ns(), false)}); iceberg::Schema timestamptz_ns_schema( {iceberg::SchemaField(1, "timestamptz_ns", iceberg::timestamptz_ns(), false)}); + iceberg::Schema unknown_schema( + {iceberg::SchemaField(1, "unknown", iceberg::unknown(), true)}); auto status = timestamp_ns_schema.Validate(2); ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); @@ -115,12 +117,42 @@ TEST(SchemaTest, ValidateRejectsV3TypesBeforeFormatV3) { "Invalid type for timestamptz_ns: timestamptz_ns is not " "supported until v3")); + status = unknown_schema.Validate(2); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage( + "Invalid type for unknown: unknown is not supported until v3")); + EXPECT_THAT( timestamp_ns_schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), iceberg::IsOk()); EXPECT_THAT(timestamptz_ns_schema.Validate( iceberg::TableMetadata::kSupportedTableFormatVersion), iceberg::IsOk()); + EXPECT_THAT( + unknown_schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsOk()); +} + +TEST(SchemaTest, ValidateRejectsInvalidUnknownFields) { + iceberg::Schema required_unknown_schema( + {iceberg::SchemaField(1, "mystery", iceberg::unknown(), false)}); + auto status = required_unknown_schema.Validate( + iceberg::TableMetadata::kSupportedTableFormatVersion); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidArgument)); + EXPECT_THAT(status, + iceberg::HasErrorMessage("Unknown type field 'mystery' must be optional")); + + iceberg::Schema map_key_unknown_schema({iceberg::SchemaField::MakeOptional( + 1, "properties", + std::make_shared( + iceberg::SchemaField::MakeRequired(2, iceberg::MapType::kKeyName, + iceberg::unknown()), + iceberg::SchemaField::MakeOptional(3, iceberg::MapType::kValueName, + iceberg::string())))}); + status = map_key_unknown_schema.Validate( + iceberg::TableMetadata::kSupportedTableFormatVersion); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidArgument)); + EXPECT_THAT(status, iceberg::HasErrorMessage("Map 'key' cannot be unknown type")); } TEST(SchemaTest, IdentifierFields) { diff --git a/src/iceberg/test/schema_util_test.cc b/src/iceberg/test/schema_util_test.cc index fe6579ab3..ee075006f 100644 --- a/src/iceberg/test/schema_util_test.cc +++ b/src/iceberg/test/schema_util_test.cc @@ -226,6 +226,132 @@ TEST(SchemaUtilTest, ProjectSchemaEvolutionFloatToDouble) { AssertProjectedField(projection.fields[0], 0); } +TEST(SchemaUtilTest, ProjectSchemaEvolutionUnknownToPrimitive) { + Schema source_schema( + {SchemaField::MakeOptional(/*field_id=*/2, "value", iceberg::unknown())}); + Schema expected_schema( + {SchemaField::MakeOptional(/*field_id=*/2, "value", iceberg::string())}); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 1); + AssertProjectedField(projection.fields[0], 0); +} + +TEST(SchemaUtilTest, RejectSchemaEvolutionUnknownToRequiredPrimitive) { + Schema source_schema( + {SchemaField::MakeOptional(/*field_id=*/2, "value", iceberg::unknown())}); + Schema expected_schema( + {SchemaField::MakeRequired(/*field_id=*/2, "value", iceberg::string())}); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with id 2 as null")); +} + +TEST(SchemaUtilTest, ProjectSchemaEvolutionNestedFieldsToUnknown) { + Schema source_schema({ + SchemaField::MakeOptional( + /*field_id=*/2, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/201, "mystery", iceberg::int32()), + SchemaField::MakeOptional(/*field_id=*/202, "name", iceberg::string()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "items", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/301, "element", iceberg::int32()))), + SchemaField::MakeOptional( + /*field_id=*/4, "attributes", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/401, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/402, "value", iceberg::int32()))), + }); + Schema expected_schema({ + SchemaField::MakeOptional( + /*field_id=*/2, "profile", + std::make_shared(std::vector{ + SchemaField::MakeOptional(/*field_id=*/201, "mystery", iceberg::unknown()), + SchemaField::MakeOptional(/*field_id=*/202, "name", iceberg::string()), + })), + SchemaField::MakeOptional( + /*field_id=*/3, "items", + std::make_shared(SchemaField::MakeOptional( + /*field_id=*/301, "element", iceberg::unknown()))), + SchemaField::MakeOptional( + /*field_id=*/4, "attributes", + std::make_shared( + SchemaField::MakeRequired(/*field_id=*/401, "key", iceberg::string()), + SchemaField::MakeOptional(/*field_id=*/402, "value", iceberg::unknown()))), + }); + + for (bool prune_source : {false, true}) { + auto projection_result = Project(expected_schema, source_schema, prune_source); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 3); + AssertProjectedField(projection.fields[0], 0); + AssertProjectedField(projection.fields[1], 1); + AssertProjectedField(projection.fields[2], 2); + + ASSERT_EQ(projection.fields[0].children.size(), 2); + ASSERT_EQ(projection.fields[0].children[0].kind, FieldProjection::Kind::kNull); + AssertProjectedField(projection.fields[0].children[1], prune_source ? 0 : 1); + + ASSERT_EQ(projection.fields[1].children.size(), 1); + ASSERT_EQ(projection.fields[1].children[0].kind, FieldProjection::Kind::kNull); + + ASSERT_EQ(projection.fields[2].children.size(), 2); + AssertProjectedField(projection.fields[2].children[0], 0); + ASSERT_EQ(projection.fields[2].children[1].kind, FieldProjection::Kind::kNull); + } +} + +TEST(SchemaUtilTest, ProjectSchemaEvolutionUnknownToNestedAsNull) { + Schema source_schema({ + SchemaField::MakeOptional(/*field_id=*/2, "profile", iceberg::unknown()), + SchemaField::MakeOptional(/*field_id=*/3, "items", iceberg::unknown()), + SchemaField::MakeOptional(/*field_id=*/4, "attributes", iceberg::unknown()), + }); + Schema expected_schema({ + SchemaField::MakeOptional(/*field_id=*/2, "profile", CreateNestedStruct()), + SchemaField::MakeOptional(/*field_id=*/3, "items", CreateListOfStruct()), + SchemaField::MakeOptional(/*field_id=*/4, "attributes", CreateMapWithStructValue()), + }); + + for (bool prune_source : {false, true}) { + auto projection_result = Project(expected_schema, source_schema, prune_source); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 3); + ASSERT_EQ(projection.fields[0].kind, FieldProjection::Kind::kNull); + ASSERT_EQ(projection.fields[1].kind, FieldProjection::Kind::kNull); + ASSERT_EQ(projection.fields[2].kind, FieldProjection::Kind::kNull); + } +} + +TEST(SchemaUtilTest, RejectSchemaEvolutionUnknownToRequiredNested) { + Schema source_schema({ + SchemaField::MakeOptional(/*field_id=*/2, "profile", iceberg::unknown()), + }); + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/2, "profile", CreateNestedStruct()), + }); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsError(ErrorKind::kInvalidSchema)); + ASSERT_THAT(projection_result, + HasErrorMessage("Cannot project required field with id 2 as null")); +} + TEST(SchemaUtilTest, ProjectSchemaEvolutionDecimalCompatible) { Schema source_schema( {SchemaField::MakeOptional(/*field_id=*/2, "value", iceberg::decimal(9, 2))}); diff --git a/src/iceberg/test/type_test.cc b/src/iceberg/test/type_test.cc index e68843be4..d405cccc1 100644 --- a/src/iceberg/test/type_test.cc +++ b/src/iceberg/test/type_test.cc @@ -90,7 +90,7 @@ TEST_P(TypeTest, StdFormat) { ASSERT_EQ(test_case.repr, std::format("{}", *test_case.type)); } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -217,6 +217,13 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "uuid", }, + { + .name = "unknown", + .type = iceberg::unknown(), + .type_id = iceberg::TypeId::kUnknown, + .primitive = true, + .repr = "unknown", + }, }}; const static std::array kNestedTypes = {{ diff --git a/src/iceberg/test/update_schema_test.cc b/src/iceberg/test/update_schema_test.cc index 8550c8b56..07872e69a 100644 --- a/src/iceberg/test/update_schema_test.cc +++ b/src/iceberg/test/update_schema_test.cc @@ -20,6 +20,7 @@ #include "iceberg/update/update_schema.h" #include +#include #include @@ -1054,6 +1055,40 @@ TEST_F(UpdateSchemaTest, UpdateColumnFloatToDouble) { EXPECT_EQ(*field_opt->get().type(), *float64()); } +TEST_F(UpdateSchemaTest, UpdateColumnUnknownToPrimitive) { + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewUpdateSchema()); + update->AddColumn("mystery", unknown(), "A null-only placeholder"); + update->UpdateColumn("mystery", string()); + + ICEBERG_UNWRAP_OR_FAIL(auto result, update->Apply()); + + ICEBERG_UNWRAP_OR_FAIL(auto field_opt, result.schema->FindFieldByName("mystery")); + ASSERT_TRUE(field_opt.has_value()); + EXPECT_EQ(*field_opt->get().type(), *string()); + EXPECT_TRUE(field_opt->get().optional()); + EXPECT_EQ(field_opt->get().doc(), "A null-only placeholder"); +} + +TEST_F(UpdateSchemaTest, AddRequiredUnknownColumnFails) { + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewUpdateSchema()); + update->AllowIncompatibleChanges().AddRequiredColumn("mystery", unknown()); + + auto result = update->Apply(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Unknown type field 'mystery' must be optional")); +} + +TEST_F(UpdateSchemaTest, AddColumnWithRequiredNestedUnknownFails) { + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewUpdateSchema()); + update->AddColumn("profile", struct_({ + SchemaField::MakeRequired(3, "mystery", unknown()), + })); + + auto result = update->Apply(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Unknown type field 'mystery' must be optional")); +} + TEST_F(UpdateSchemaTest, UpdateColumnSameType) { ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewUpdateSchema()); update->AddColumn("id", int32()); diff --git a/src/iceberg/test/visit_type_test.cc b/src/iceberg/test/visit_type_test.cc index 7104581f5..f038f906f 100644 --- a/src/iceberg/test/visit_type_test.cc +++ b/src/iceberg/test/visit_type_test.cc @@ -53,7 +53,7 @@ std::string TypeTestCaseToString(const ::testing::TestParamInfo& i return info.param.name; } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -180,6 +180,13 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "uuid", }, + { + .name = "unknown", + .type = iceberg::unknown(), + .type_id = iceberg::TypeId::kUnknown, + .primitive = true, + .repr = "unknown", + }, }}; const static std::array kNestedTypes = {{ diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc index b5bee37e2..057dcf513 100644 --- a/src/iceberg/type.cc +++ b/src/iceberg/type.cc @@ -350,6 +350,10 @@ TypeId UuidType::type_id() const { return kTypeId; } std::string UuidType::ToString() const { return "uuid"; } bool UuidType::Equals(const Type& other) const { return other.type_id() == kTypeId; } +TypeId UnknownType::type_id() const { return kTypeId; } +std::string UnknownType::ToString() const { return "unknown"; } +bool UnknownType::Equals(const Type& other) const { return other.type_id() == kTypeId; } + FixedType::FixedType(int32_t length) : length_(length) { ICEBERG_CHECK_OR_DIE(length >= 0, "FixedType: length must be >= 0, was {}", length); } @@ -392,6 +396,7 @@ TYPE_FACTORY(timestamptz_ns, TimestampTzNsType) TYPE_FACTORY(binary, BinaryType) TYPE_FACTORY(string, StringType) TYPE_FACTORY(uuid, UuidType) +TYPE_FACTORY(unknown, UnknownType) #undef TYPE_FACTORY @@ -455,6 +460,8 @@ std::string_view ToString(TypeId id) { return "fixed"; case TypeId::kBinary: return "binary"; + case TypeId::kUnknown: + return "unknown"; } std::unreachable(); diff --git a/src/iceberg/type.h b/src/iceberg/type.h index 53237cdb5..c0966759e 100644 --- a/src/iceberg/type.h +++ b/src/iceberg/type.h @@ -503,6 +503,21 @@ class ICEBERG_EXPORT UuidType : public PrimitiveType { bool Equals(const Type& other) const override; }; +/// \brief A null-only placeholder type used when a more specific type is not known. +class ICEBERG_EXPORT UnknownType : public PrimitiveType { + public: + constexpr static const TypeId kTypeId = TypeId::kUnknown; + + UnknownType() = default; + ~UnknownType() override = default; + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; +}; + /// @} /// \defgroup type-factories Factory functions for creating primitive data types @@ -538,6 +553,8 @@ ICEBERG_EXPORT const std::shared_ptr& binary(); ICEBERG_EXPORT const std::shared_ptr& string(); /// \brief Return a UuidType instance. ICEBERG_EXPORT const std::shared_ptr& uuid(); +/// \brief Return an UnknownType instance. +ICEBERG_EXPORT const std::shared_ptr& unknown(); /// \brief Create a DecimalType with the given precision and scale. /// \param precision The number of decimal digits (max 38). diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 064ec285a..745c63acb 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -31,7 +31,7 @@ namespace iceberg { /// This is not a complete data type by itself because some types are nested /// and/or parameterized. /// -/// Iceberg V3 types are not currently supported. +/// Iceberg V3's `unknown` type is supported as a null-only placeholder type. enum class TypeId { kStruct, kList, @@ -52,6 +52,7 @@ enum class TypeId { kUuid, kFixed, kBinary, + kUnknown, }; /// \brief The time unit. In Iceberg V3 nanoseconds are also supported. @@ -83,6 +84,7 @@ class TimestampTzType; class TimestampNsType; class TimestampTzNsType; class Type; +class UnknownType; class UuidType; /// \brief Data values. diff --git a/src/iceberg/update/update_schema.cc b/src/iceberg/update/update_schema.cc index 1f35781fa..0e7f147b0 100644 --- a/src/iceberg/update/update_schema.cc +++ b/src/iceberg/update/update_schema.cc @@ -593,6 +593,7 @@ Result UpdateSchema::Apply() { ICEBERG_ASSIGN_OR_RAISE( auto new_schema, Schema::Make(std::move(new_fields), schema_->schema_id(), fresh_identifier_ids)); + ICEBERG_RETURN_UNEXPECTED(new_schema->Validate(base().format_version)); std::unordered_map updated_props; const auto& base_metadata = base(); diff --git a/src/iceberg/util/struct_like_set.cc b/src/iceberg/util/struct_like_set.cc index 433cfa681..12648ea5e 100644 --- a/src/iceberg/util/struct_like_set.cc +++ b/src/iceberg/util/struct_like_set.cc @@ -263,6 +263,8 @@ Status ValidateScalarAgainstType(const Scalar& scalar, const Type& type) { } switch (type.type_id()) { + case TypeId::kUnknown: + return InvalidArgument("Expected unknown but got {}", ScalarTypeName(scalar)); case TypeId::kBoolean: ICEBERG_PRECHECK(std::holds_alternative(scalar), "Expected boolean but got {}", ScalarTypeName(scalar)); diff --git a/src/iceberg/util/type_util.cc b/src/iceberg/util/type_util.cc index c6b9bb3ed..cb01be08f 100644 --- a/src/iceberg/util/type_util.cc +++ b/src/iceberg/util/type_util.cc @@ -426,6 +426,11 @@ bool IsPromotionAllowed(const std::shared_ptr& from_type, TypeId from_id = from_type->type_id(); TypeId to_id = to_type->type_id(); + // unknown -> any primitive type + if (from_id == TypeId::kUnknown) { + return true; + } + // int -> long if (from_id == TypeId::kInt && to_id == TypeId::kLong) { return true; diff --git a/src/iceberg/util/type_util.h b/src/iceberg/util/type_util.h index ceb5e62ec..8fd5ef19f 100644 --- a/src/iceberg/util/type_util.h +++ b/src/iceberg/util/type_util.h @@ -177,6 +177,7 @@ ICEBERG_EXPORT Result> AssignFreshIds( /// \brief Check if type promotion from one type to another is allowed. /// /// Type promotion rules: +/// - unknown -> any primitive type /// - int -> long /// - float -> double /// - decimal(P,S) -> decimal(P',S) where P' > P diff --git a/src/iceberg/util/visitor_generate.h b/src/iceberg/util/visitor_generate.h index 7a3648546..a5b0c2ced 100644 --- a/src/iceberg/util/visitor_generate.h +++ b/src/iceberg/util/visitor_generate.h @@ -38,6 +38,7 @@ namespace iceberg { ACTION(Uuid); \ ACTION(Fixed); \ ACTION(Binary); \ + ACTION(Unknown); \ ACTION(Struct); \ ACTION(List); \ ACTION(Map); From 171ac5764ec65adee5a25cc7cf9df9d72a6d3ab4 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Fri, 5 Jun 2026 17:33:11 +0800 Subject: [PATCH 059/151] feat: add executor pool support (#687) --- .../IcebergThirdpartyToolchain.cmake | 5 +- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/result.h | 9 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/arrow_test.cc | 81 +++- src/iceberg/test/executor.h | 62 +++ src/iceberg/test/meson.build | 1 + src/iceberg/test/retry.h | 76 ++++ src/iceberg/test/retry_util_test.cc | 336 +++++++--------- src/iceberg/test/task_group_test.cc | 375 ++++++++++++++++++ src/iceberg/util/executor.h | 53 +++ src/iceberg/util/functional.h | 82 ++++ src/iceberg/util/lazy.h | 12 +- src/iceberg/util/meson.build | 3 + src/iceberg/util/retry_util.cc | 45 +-- src/iceberg/util/retry_util.h | 225 ++++++----- src/iceberg/util/task_group.cc | 100 +++++ src/iceberg/util/task_group.h | 108 +++++ 19 files changed, 1204 insertions(+), 372 deletions(-) create mode 100644 src/iceberg/test/executor.h create mode 100644 src/iceberg/test/retry.h create mode 100644 src/iceberg/test/task_group_test.cc create mode 100644 src/iceberg/util/executor.h create mode 100644 src/iceberg/util/functional.h create mode 100644 src/iceberg/util/task_group.cc create mode 100644 src/iceberg/util/task_group.h diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index e8f242f85..3b4340cf5 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -105,6 +105,7 @@ function(resolve_arrow_dependency) set(ARROW_S3 ${ICEBERG_S3}) set(ARROW_JSON ON) set(ARROW_PARQUET ON) + set(ARROW_ENABLE_THREADING ON) set(ARROW_SIMD_LEVEL "NONE") set(ARROW_RUNTIME_SIMD_LEVEL "NONE") set(ARROW_POSITION_INDEPENDENT_CODE ON) @@ -167,8 +168,8 @@ function(resolve_arrow_dependency) endif() # Arrow's exported static target interface may reference system libraries - # (e.g. OpenSSL, CURL, ZLIB) that consumers need to find. - list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB) + # (e.g. Threads, OpenSSL, CURL, ZLIB) that consumers need to find. + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Threads ZLIB) if(ARROW_S3) list(APPEND ICEBERG_SYSTEM_DEPENDENCIES OpenSSL CURL) endif() diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index b8af39bde..935ded941 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -114,6 +114,7 @@ set(ICEBERG_SOURCES util/snapshot_util.cc util/string_util.cc util/struct_like_set.cc + util/task_group.cc util/temporal_util.cc util/timepoint.cc util/transform_util.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 40969e4be..3da8f6e32 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -136,6 +136,7 @@ iceberg_sources = files( 'util/snapshot_util.cc', 'util/string_util.cc', 'util/struct_like_set.cc', + 'util/task_group.cc', 'util/temporal_util.cc', 'util/timepoint.cc', 'util/transform_util.cc', diff --git a/src/iceberg/result.h b/src/iceberg/result.h index 765508705..01d17b299 100644 --- a/src/iceberg/result.h +++ b/src/iceberg/result.h @@ -19,9 +19,11 @@ #pragma once +#include #include #include #include +#include #include "iceberg/iceberg_export.h" @@ -126,4 +128,11 @@ DEFINE_ERROR_FUNCTION(ValidationFailed) #undef DEFINE_ERROR_FUNCTION +template +concept AsResult = std::derived_from, + Result::value_type>>; + +template +using ResultValueT = typename std::remove_cvref_t::value_type; + } // namespace iceberg diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 65afdea32..00b6a964b 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -136,6 +136,7 @@ add_iceberg_test(util_test retry_util_test.cc string_util_test.cc struct_like_set_test.cc + task_group_test.cc temporal_util_test.cc transform_util_test.cc truncate_util_test.cc diff --git a/src/iceberg/test/arrow_test.cc b/src/iceberg/test/arrow_test.cc index 2e2a80096..9f8ce86f5 100644 --- a/src/iceberg/test/arrow_test.cc +++ b/src/iceberg/test/arrow_test.cc @@ -17,28 +17,39 @@ * under the License. */ +#include #include +#include +#include #include +#include +#include #include #include #include #include #include +#include #include +#include #include +#include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/constants.h" +#include "iceberg/result.h" #include "iceberg/schema.h" #include "iceberg/schema_internal.h" #include "iceberg/test/matchers.h" +#include "iceberg/util/executor.h" +#include "iceberg/util/task_group.h" namespace iceberg { struct ToArrowSchemaParam { std::shared_ptr iceberg_type; bool optional = true; - std::shared_ptr arrow_type; + std::shared_ptr<::arrow::DataType> arrow_type; }; class ToArrowSchemaTest : public ::testing::TestWithParam {}; @@ -89,17 +100,17 @@ INSTANTIATE_TEST_SUITE_P( ToArrowSchemaParam{.iceberg_type = iceberg::date(), .arrow_type = ::arrow::date32()}, ToArrowSchemaParam{.iceberg_type = iceberg::time(), - .arrow_type = ::arrow::time64(arrow::TimeUnit::MICRO)}, + .arrow_type = ::arrow::time64(::arrow::TimeUnit::MICRO)}, ToArrowSchemaParam{.iceberg_type = iceberg::timestamp(), - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO)}, + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::MICRO)}, ToArrowSchemaParam{ .iceberg_type = iceberg::timestamp_tz(), - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO, "UTC")}, + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::MICRO, "UTC")}, ToArrowSchemaParam{.iceberg_type = iceberg::timestamp_ns(), - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO)}, + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::NANO)}, ToArrowSchemaParam{ .iceberg_type = iceberg::timestamptz_ns(), - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO, "UTC")}, + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::NANO, "UTC")}, ToArrowSchemaParam{.iceberg_type = iceberg::string(), .arrow_type = ::arrow::utf8()}, ToArrowSchemaParam{.iceberg_type = iceberg::binary(), @@ -311,7 +322,7 @@ TEST(ToArrowSchemaTest, NestedUnknownFieldsRoundTrip) { } struct FromArrowSchemaParam { - std::shared_ptr arrow_type; + std::shared_ptr<::arrow::DataType> arrow_type; bool optional = true; std::shared_ptr iceberg_type; }; @@ -365,17 +376,17 @@ INSTANTIATE_TEST_SUITE_P( .iceberg_type = iceberg::decimal(10, 2)}, FromArrowSchemaParam{.arrow_type = ::arrow::date32(), .iceberg_type = iceberg::date()}, - FromArrowSchemaParam{.arrow_type = ::arrow::time64(arrow::TimeUnit::MICRO), + FromArrowSchemaParam{.arrow_type = ::arrow::time64(::arrow::TimeUnit::MICRO), .iceberg_type = iceberg::time()}, - FromArrowSchemaParam{.arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO), + FromArrowSchemaParam{.arrow_type = ::arrow::timestamp(::arrow::TimeUnit::MICRO), .iceberg_type = iceberg::timestamp()}, FromArrowSchemaParam{ - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::MICRO, "UTC"), + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::MICRO, "UTC"), .iceberg_type = std::make_shared()}, - FromArrowSchemaParam{.arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO), + FromArrowSchemaParam{.arrow_type = ::arrow::timestamp(::arrow::TimeUnit::NANO), .iceberg_type = iceberg::timestamp_ns()}, FromArrowSchemaParam{ - .arrow_type = ::arrow::timestamp(arrow::TimeUnit::NANO, "UTC"), + .arrow_type = ::arrow::timestamp(::arrow::TimeUnit::NANO, "UTC"), .iceberg_type = iceberg::timestamptz_ns()}, FromArrowSchemaParam{.arrow_type = ::arrow::utf8(), .iceberg_type = iceberg::string()}, @@ -588,4 +599,50 @@ TEST(FromArrowSchemaTest, MapType) { ASSERT_EQ(value.type()->type_id(), TypeId::kInt); } +TEST(ArrowExecutorAdapterTest, RunsTaskGroupOnThreadPool) { +#ifndef ARROW_ENABLE_THREADING + GTEST_SKIP() << "Test requires ARROW_ENABLE_THREADING=ON"; +#endif + + class ArrowExecutorAdapter final : public Executor { + public: + explicit ArrowExecutorAdapter(::arrow::internal::Executor& executor) + : executor_(executor) {} + + Status Submit(ExecutorTask task) override { + ICEBERG_ARROW_RETURN_NOT_OK(executor_.Spawn(std::move(task))); + return {}; + } + + private: + ::arrow::internal::Executor& executor_; + }; + + auto thread_pool = ::arrow::internal::ThreadPool::Make(2).ValueOrDie(); + ArrowExecutorAdapter executor(*thread_pool); + + std::mutex mutex; + std::vector thread_ids; + + auto status = TaskGroup<>() + .SetExecutor(std::ref(executor)) + .Submit([&]() -> Status { + std::lock_guard lock(mutex); + thread_ids.push_back(std::this_thread::get_id()); + return {}; + }) + .Submit([&]() -> Status { + std::lock_guard lock(mutex); + thread_ids.push_back(std::this_thread::get_id()); + return {}; + }) + .Run(); + + EXPECT_THAT(status, IsOk()); + EXPECT_EQ(thread_ids.size(), 2); + EXPECT_NE(thread_ids[0], std::this_thread::get_id()); + EXPECT_NE(thread_ids[1], std::this_thread::get_id()); + EXPECT_TRUE(thread_pool->Shutdown().ok()); +} + } // namespace iceberg diff --git a/src/iceberg/test/executor.h b/src/iceberg/test/executor.h new file mode 100644 index 000000000..5b4de65b0 --- /dev/null +++ b/src/iceberg/test/executor.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include + +#include "iceberg/result.h" +#include "iceberg/util/executor.h" + +namespace iceberg::test { + +class ThreadExecutor final : public Executor { + public: + explicit ThreadExecutor(Status submit_status = {}) + : submit_status_(std::move(submit_status)) {} + + ~ThreadExecutor() override { + for (auto& thread : threads_) { + if (thread.joinable()) { + thread.join(); + } + } + } + + Status Submit(ExecutorTask task) override { + submit_count_.fetch_add(1, std::memory_order_relaxed); + if (!submit_status_.has_value()) { + return std::unexpected(submit_status_.error()); + } + threads_.emplace_back(std::move(task)); + return {}; + } + + int submit_count() const { return submit_count_.load(std::memory_order_relaxed); } + + private: + Status submit_status_; + std::atomic submit_count_{0}; + std::vector threads_; +}; + +} // namespace iceberg::test diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 2f812655f..9a61474e0 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -100,6 +100,7 @@ iceberg_tests = { 'roaring_position_bitmap_test.cc', 'string_util_test.cc', 'struct_like_set_test.cc', + 'task_group_test.cc', 'temporal_util_test.cc', 'transform_util_test.cc', 'truncate_util_test.cc', diff --git a/src/iceberg/test/retry.h b/src/iceberg/test/retry.h new file mode 100644 index 000000000..ce96ce163 --- /dev/null +++ b/src/iceberg/test/retry.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/result.h" +#include "iceberg/util/retry_util.h" +#include "iceberg/util/retry_util_internal.h" + +namespace iceberg::test { + +using CommitFailedRetry = retry::OnlyRetryOn; + +using TransientIORetry = + retry::OnlyRetryOn; + +class FakeRetryEnvironment { + public: + using Duration = RetryTestHooks::Duration; + using TimePoint = RetryTestHooks::TimePoint; + + FakeRetryEnvironment() { + hooks_.now = [this]() { return now_; }; + hooks_.sleep_for = [this](Duration duration) { + sleep_durations_.push_back(duration); + now_ += duration; + }; + hooks_.jitter = [this](int32_t base_delay_ms) { + observed_base_delays_ms_.push_back(base_delay_ms); + return base_delay_ms + jitter_offset_ms_; + }; + } + + void Advance(Duration duration) { now_ += duration; } + + void SetJitterOffsetMs(int32_t jitter_offset_ms) { + jitter_offset_ms_ = jitter_offset_ms; + } + + const RetryTestHooks& hooks() const { return hooks_; } + + const std::vector& sleep_durations() const { return sleep_durations_; } + + const std::vector& observed_base_delays_ms() const { + return observed_base_delays_ms_; + } + + private: + RetryTestHooks hooks_; + TimePoint now_{}; + int32_t jitter_offset_ms_ = 0; + std::vector sleep_durations_; + std::vector observed_base_delays_ms_; +}; + +} // namespace iceberg::test diff --git a/src/iceberg/test/retry_util_test.cc b/src/iceberg/test/retry_util_test.cc index ead221910..1b2f35578 100644 --- a/src/iceberg/test/retry_util_test.cc +++ b/src/iceberg/test/retry_util_test.cc @@ -27,6 +27,7 @@ #include "iceberg/result.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/retry.h" #include "iceberg/util/retry_util_internal.h" namespace iceberg { @@ -40,50 +41,16 @@ struct NonResultReturningTask { int operator()() const { return 1; } }; +using test::CommitFailedRetry; +using test::FakeRetryEnvironment; +using test::TransientIORetry; + static_assert(detail::RetryTask); static_assert(!detail::RetryTask); -static_assert(requires(RetryRunner runner, ResultReturningTask task) { +static_assert(requires(RetryRunner runner, ResultReturningTask task) { { runner.Run(task) } -> std::same_as>; }); - -class FakeRetryEnvironment { - public: - using Duration = RetryTestHooks::Duration; - using TimePoint = RetryTestHooks::TimePoint; - - FakeRetryEnvironment() { - hooks_.now = [this]() { return now_; }; - hooks_.sleep_for = [this](Duration duration) { - sleep_durations_.push_back(duration); - now_ += duration; - }; - hooks_.jitter = [this](int32_t base_delay_ms) { - observed_base_delays_ms_.push_back(base_delay_ms); - return base_delay_ms + jitter_offset_ms_; - }; - } - - void Advance(Duration duration) { now_ += duration; } - - void SetJitterOffsetMs(int32_t jitter_offset_ms) { - jitter_offset_ms_ = jitter_offset_ms; - } - - const RetryTestHooks& hooks() const { return hooks_; } - - const std::vector& sleep_durations() const { return sleep_durations_; } - - const std::vector& observed_base_delays_ms() const { - return observed_base_delays_ms_; - } - - private: - RetryTestHooks hooks_; - TimePoint now_{}; - int32_t jitter_offset_ms_ = 0; - std::vector sleep_durations_; - std::vector observed_base_delays_ms_; -}; +static_assert(retry::NoRetry::kMode == retry::RetryPolicyMode::kNoRetry); } // namespace @@ -91,11 +58,10 @@ TEST(RetryRunnerTest, SuccessOnFirstAttempt) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -113,11 +79,10 @@ TEST(RetryRunnerTest, RetryOnceThenSucceed) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -138,11 +103,10 @@ TEST(RetryRunnerTest, MaxAttemptsExhausted) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 2, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -159,11 +123,10 @@ TEST(RetryRunnerTest, OnlyRetryOnFilter) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -180,11 +143,10 @@ TEST(RetryRunnerTest, OnlyRetryOnMatchingError) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 2, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -201,41 +163,15 @@ TEST(RetryRunnerTest, OnlyRetryOnMatchingError) { EXPECT_EQ(attempts, 3); } -TEST(RetryRunnerTest, OnlyRetryOnTakesPrecedenceOverStopRetryOn) { - int call_count = 0; - int32_t attempts = 0; - - auto result = RetryRunner(RetryConfig{.num_retries = 2, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(ErrorKind::kCommitFailed) - .StopRetryOn(ErrorKind::kCommitFailed) - .Run( - [&]() -> Result { - ++call_count; - if (call_count == 1) { - return CommitFailed("transient"); - } - return 100; - }, - &attempts); - - EXPECT_THAT(result, IsOk()); - EXPECT_EQ(*result, 100); - EXPECT_EQ(call_count, 2); - EXPECT_EQ(attempts, 2); -} - TEST(RetryRunnerTest, StopRetryOnMatchingError) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 5, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .StopRetryOn(ErrorKind::kCommitStateUnknown) + auto result = RetryRunner>( + RetryConfig{.num_retries = 5, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -252,11 +188,11 @@ TEST(RetryRunnerTest, StopRetryOnNonMatchingErrorAllowsRetry) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 2, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .StopRetryOn({ErrorKind::kCommitStateUnknown}) + auto result = RetryRunner>( + RetryConfig{.num_retries = 2, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -277,11 +213,11 @@ TEST(RetryRunnerTest, ZeroRetriesAllowsUnsetPolicyAndSkipsBackoffValidation) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 0, - .min_wait_ms = 0, - .max_wait_ms = 0, - .total_timeout_ms = 5000, - .scale_factor = 0.5}) + auto result = RetryRunner(RetryConfig{.num_retries = 0, + .min_wait_ms = 0, + .max_wait_ms = 0, + .total_timeout_ms = 5000, + .scale_factor = 0.5}) .Run( [&]() -> Result { ++call_count; @@ -298,10 +234,10 @@ TEST(RetryRunnerTest, NegativeRetriesFailsBeforeTaskRuns) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = -1, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) + auto result = RetryRunner(RetryConfig{.num_retries = -1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -360,8 +296,7 @@ TEST(RetryRunnerTest, InvalidBackoffConfigFailsBeforeTaskRuns) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(test_case.config) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(test_case.config) .Run( [&]() -> Result { ++call_count; @@ -377,36 +312,14 @@ TEST(RetryRunnerTest, InvalidBackoffConfigFailsBeforeTaskRuns) { } } -TEST(RetryRunnerTest, UnsetRetryPolicyFailsBeforeTaskRuns) { +TEST(RetryRunnerTest, NoRetryWithRetries) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 1, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .Run( - [&]() -> Result { - ++call_count; - return CommitFailed("fail"); - }, - &attempts); - - EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); - EXPECT_THAT(result, HasErrorMessage("Retry policy must be explicitly configured")); - EXPECT_EQ(call_count, 0); - EXPECT_EQ(attempts, 0); -} - -TEST(RetryRunnerTest, EmptyOnlyRetryOnPolicyFailsBeforeTaskRuns) { - int call_count = 0; - int32_t attempts = 0; - - auto result = RetryRunner(RetryConfig{.num_retries = 1, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn(std::initializer_list{}) + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) .Run( [&]() -> Result { ++call_count; @@ -416,30 +329,7 @@ TEST(RetryRunnerTest, EmptyOnlyRetryOnPolicyFailsBeforeTaskRuns) { EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); EXPECT_THAT(result, - HasErrorMessage("Retry policy must include at least one error kind")); - EXPECT_EQ(call_count, 0); - EXPECT_EQ(attempts, 0); -} - -TEST(RetryRunnerTest, EmptyStopRetryOnPolicyFailsBeforeTaskRuns) { - int call_count = 0; - int32_t attempts = 0; - - auto result = RetryRunner(RetryConfig{.num_retries = 1, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .StopRetryOn({}) - .Run( - [&]() -> Result { - ++call_count; - return CommitFailed("fail"); - }, - &attempts); - - EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); - EXPECT_THAT(result, - HasErrorMessage("Retry policy must include at least one error kind")); + HasErrorMessage("Retry policy must be enabled when num_retries > 0")); EXPECT_EQ(call_count, 0); EXPECT_EQ(attempts, 0); } @@ -450,11 +340,10 @@ TEST(RetryRunnerTest, TotalTimeoutStopsBeforeStartingAnotherAttempt) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 20, - .max_wait_ms = 20, - .total_timeout_ms = 15}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 20, + .max_wait_ms = 20, + .total_timeout_ms = 15}) .Run( [&]() -> Result { ++call_count; @@ -478,11 +367,10 @@ TEST(RetryRunnerTest, TotalTimeoutStopsWhenDelayEqualsRemainingBudget) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 3, - .min_wait_ms = 10, - .max_wait_ms = 10, - .total_timeout_ms = 20}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 20}) .Run( [&]() -> Result { ++call_count; @@ -504,11 +392,10 @@ TEST(RetryRunnerTest, NonPositiveTotalTimeoutDisablesDeadline) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 2, - .min_wait_ms = 10, - .max_wait_ms = 10, - .total_timeout_ms = 0}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 2, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 0}) .Run( [&]() -> Result { ++call_count; @@ -537,11 +424,10 @@ TEST(RetryRunnerTest, RetryDelayDoesNotExceedMaxWaitAfterJitter) { int call_count = 0; int32_t attempts = 0; - auto result = RetryRunner(RetryConfig{.num_retries = 1, - .min_wait_ms = 10, - .max_wait_ms = 10, - .total_timeout_ms = 0}) - .OnlyRetryOn(ErrorKind::kCommitFailed) + auto result = RetryRunner(RetryConfig{.num_retries = 1, + .min_wait_ms = 10, + .max_wait_ms = 10, + .total_timeout_ms = 0}) .Run( [&]() -> Result { ++call_count; @@ -603,24 +489,26 @@ TEST(RetryRunnerTest, OnlyRetryOnMultipleErrorKinds) { int call_count = 0; int32_t attempts = 0; - auto result = - RetryRunner(RetryConfig{.num_retries = 5, - .min_wait_ms = 1, - .max_wait_ms = 10, - .total_timeout_ms = 5000}) - .OnlyRetryOn({ErrorKind::kCommitFailed, ErrorKind::kServiceUnavailable}) - .Run( - [&]() -> Result { - ++call_count; - if (call_count == 1) { - return CommitFailed("conflict"); - } - if (call_count == 2) { - return ServiceUnavailable("server busy"); - } - return 77; - }, - &attempts); + using CommitOrUnavailable = + retry::RetryPolicy; + + auto result = RetryRunner(RetryConfig{.num_retries = 5, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Result { + ++call_count; + if (call_count == 1) { + return CommitFailed("conflict"); + } + if (call_count == 2) { + return ServiceUnavailable("server busy"); + } + return 77; + }, + &attempts); EXPECT_THAT(result, IsOk()); EXPECT_EQ(*result, 77); @@ -628,4 +516,50 @@ TEST(RetryRunnerTest, OnlyRetryOnMultipleErrorKinds) { EXPECT_EQ(attempts, 3); } +TEST(RetryRunnerTest, RetriesTransientIO) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Status { + ++call_count; + if (call_count == 1) { + return IOError("read failed"); + } + if (call_count == 2) { + return ServiceUnavailable("server busy"); + } + return {}; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + +TEST(RetryRunnerTest, DoesNotRetryNotFound) { + int call_count = 0; + int32_t attempts = 0; + + auto result = RetryRunner(RetryConfig{.num_retries = 3, + .min_wait_ms = 1, + .max_wait_ms = 10, + .total_timeout_ms = 5000}) + .Run( + [&]() -> Status { + ++call_count; + return NotFound("missing file"); + }, + &attempts); + + EXPECT_THAT(result, IsError(ErrorKind::kNotFound)); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(attempts, 1); +} + } // namespace iceberg diff --git a/src/iceberg/test/task_group_test.cc b/src/iceberg/test/task_group_test.cc new file mode 100644 index 000000000..2f0da3de2 --- /dev/null +++ b/src/iceberg/test/task_group_test.cc @@ -0,0 +1,375 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/util/task_group.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/result.h" +#include "iceberg/test/executor.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/retry.h" +#include "iceberg/util/functional.h" + +namespace iceberg { + +namespace { + +RetryConfig FastRetryConfig(int32_t num_retries = 2) { + return RetryConfig{.num_retries = num_retries, + .min_wait_ms = 1, + .max_wait_ms = 1, + .total_timeout_ms = 0}; +} + +} // namespace + +TEST(TaskGroupCompileTest, TaskConcepts) { + auto move_only_mutable_lambda = [value = std::make_unique(1)]() mutable -> Status { + return *value == 1 ? Status{} : IOError("unexpected value"); + }; + using MoveOnlyMutableLambda = decltype(move_only_mutable_lambda); + + auto move_only_const_lambda = [value = std::make_unique(1)]() -> Status { + return *value == 1 ? Status{} : IOError("unexpected value"); + }; + using MoveOnlyConstLambda = decltype(move_only_const_lambda); + + auto copyable_mutable_lambda = [attempt = 0]() mutable -> Status { + return ++attempt > 0 ? Status{} : Status{}; + }; + using CopyableMutableLambda = decltype(copyable_mutable_lambda); + + static_assert(!std::copy_constructible>); + static_assert(!std::default_initializable>); + static_assert(std::move_constructible>); + + static_assert(internal::OnceStatusTask); + static_assert(!internal::OnceStatusTask); + static_assert(internal::OnceStatusTask); + static_assert(!internal::OnceStatusTask); + static_assert(internal::OnceStatusTask); + static_assert(internal::OnceStatusTask); + + static_assert(!internal::RepeatableStatusTask); + static_assert(internal::RepeatableStatusTask); + static_assert(internal::RepeatableStatusTask); + + static_assert(!internal::RetryableStatusTask); + static_assert(!internal::RetryableStatusTask); + static_assert(internal::RetryableStatusTask); + static_assert(!internal::RetryableStatusTask); + static_assert(internal::RetryableStatusTask); + static_assert(internal::RetryableStatusTask); +} + +TEST(FnOnceTest, SupportsMoveOnlyCapture) { + auto value = std::make_unique(41); + FnOnce task([value = std::move(value)]() { return *value + 1; }); + + EXPECT_EQ(std::move(task)(), 42); +} + +TEST(TaskGroupTest, UsesExecutor) { + test::ThreadExecutor executor; + TaskGroup<> group; + bool ran = false; + + group.SetExecutor(std::ref(executor)); + group.Submit([&]() -> Status { + ran = true; + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_TRUE(ran); + EXPECT_EQ(executor.submit_count(), 1); +} + +TEST(TaskGroupTest, ReturnsSubmitError) { + test::ThreadExecutor executor(ServiceUnavailable("executor busy")); + TaskGroup<> group; + + group.SetExecutor(std::ref(executor)); + group.Submit([]() -> Status { return {}; }); + + EXPECT_THAT(std::move(group).Run(), IsError(ErrorKind::kServiceUnavailable)); + EXPECT_EQ(executor.submit_count(), 1); +} + +TEST(TaskGroupTest, DirectMoveOnlyTask) { + TaskGroup<> group; + auto value = std::make_unique(7); + int observed = 0; + + group.Submit([value = std::move(value), &observed]() mutable -> Status { + observed = *value; + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(observed, 7); +} + +TEST(TaskGroupTest, ClearsExecutor) { + test::ThreadExecutor executor; + TaskGroup<> group; + int call_count = 0; + + group.SetExecutor(std::ref(executor)); + group.SetExecutor(std::nullopt); + group.Submit([&]() -> Status { + ++call_count; + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(call_count, 1); + EXPECT_EQ(executor.submit_count(), 0); +} + +TEST(TaskGroupTest, FluentSubmit) { + int call_count = 0; + + auto status = TaskGroup<>() + .Submit([&]() -> Status { + ++call_count; + return {}; + }) + .Submit([&]() -> Status { + ++call_count; + return {}; + }) + .Run(); + + EXPECT_THAT(status, IsOk()); + EXPECT_EQ(call_count, 2); +} + +TEST(TaskGroupTest, DirectAggregatesErrors) { + TaskGroup<> group; + int call_count = 0; + + group.Submit([&]() -> Status { + ++call_count; + return IOError("first failure"); + }); + group.Submit([&]() -> Status { + ++call_count; + return ValidationFailed("second failure"); + }); + + auto status = std::move(group).Run(); + EXPECT_THAT(status, IsError(ErrorKind::kIOError)); + EXPECT_THAT(status, HasErrorMessage("Task group failed with 2 errors")); + EXPECT_THAT(status, HasErrorMessage("first failure")); + EXPECT_THAT(status, HasErrorMessage("second failure")); + EXPECT_EQ(call_count, 2); +} + +TEST(TaskGroupTest, ParallelSubmitsAll) { + test::ThreadExecutor executor; + TaskGroup<> group; + std::atomic call_count = 0; + + group.SetExecutor(std::ref(executor)); + group.Submit([&]() -> Status { + call_count.fetch_add(1, std::memory_order_relaxed); + return {}; + }); + group.Submit([&]() -> Status { + call_count.fetch_add(1, std::memory_order_relaxed); + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(call_count.load(std::memory_order_relaxed), 2); + EXPECT_EQ(executor.submit_count(), 2); +} + +TEST(TaskGroupTest, ParallelAggregatesErrors) { + test::ThreadExecutor executor; + TaskGroup<> group; + std::atomic call_count = 0; + + group.SetExecutor(std::ref(executor)); + group.Submit([&]() -> Status { + call_count.fetch_add(1, std::memory_order_relaxed); + return IOError("first failure"); + }); + group.Submit([&]() -> Status { + call_count.fetch_add(1, std::memory_order_relaxed); + return ValidationFailed("second failure"); + }); + + auto status = std::move(group).Run(); + EXPECT_THAT(status, IsError(ErrorKind::kIOError)); + EXPECT_THAT(status, HasErrorMessage("Task group failed with 2 errors")); + EXPECT_THAT(status, HasErrorMessage("first failure")); + EXPECT_THAT(status, HasErrorMessage("second failure")); + EXPECT_EQ(call_count.load(std::memory_order_relaxed), 2); + EXPECT_EQ(executor.submit_count(), 2); +} + +TEST(TaskGroupTest, ParallelSubmitErrors) { + test::ThreadExecutor executor(ServiceUnavailable("executor busy")); + TaskGroup<> group; + int call_count = 0; + + group.SetExecutor(std::ref(executor)); + group.Submit([&]() -> Status { + ++call_count; + return {}; + }); + group.Submit([&]() -> Status { + ++call_count; + return {}; + }); + + auto status = std::move(group).Run(); + EXPECT_THAT(status, IsError(ErrorKind::kServiceUnavailable)); + EXPECT_THAT(status, HasErrorMessage("Task group failed with 2 errors")); + EXPECT_THAT(status, HasErrorMessage("executor busy")); + EXPECT_EQ(call_count, 0); + EXPECT_EQ(executor.submit_count(), 2); +} + +TEST(TaskGroupTest, RetriesTasks) { + test::FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks retry_hooks(fake_retry.hooks()); + TaskGroup group{FastRetryConfig()}; + int call_count = 0; + + group.Submit([&]() -> Status { + ++call_count; + if (call_count == 1) { + return IOError("transient read failure"); + } + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(fake_retry.sleep_durations(), + std::vector( + {test::FakeRetryEnvironment::Duration(1)})); +} + +TEST(TaskGroupTest, RetryReusesTaskState) { + test::FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks retry_hooks(fake_retry.hooks()); + TaskGroup group{FastRetryConfig()}; + + group.Submit([attempt = 0]() mutable -> Status { + ++attempt; + if (attempt == 1) { + return IOError("transient read failure"); + } + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(fake_retry.sleep_durations(), + std::vector( + {test::FakeRetryEnvironment::Duration(1)})); +} + +TEST(TaskGroupTest, RetryAcceptsMoveOnlyRepeatableTask) { + test::FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks retry_hooks(fake_retry.hooks()); + TaskGroup group{FastRetryConfig()}; + int call_count = 0; + auto value = std::make_unique(7); + + group.Submit([value = std::move(value), &call_count]() -> Status { + ++call_count; + if (call_count == 1) { + return IOError("transient read failure"); + } + return *value == 7 ? Status{} : IOError("unexpected value"); + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(call_count, 2); + EXPECT_EQ(fake_retry.sleep_durations(), + std::vector( + {test::FakeRetryEnvironment::Duration(1)})); +} + +TEST(TaskGroupTest, DefaultRetryConfig) { + TaskGroup group; + int call_count = 0; + + group.Submit([&]() -> Status { + ++call_count; + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(call_count, 1); +} + +TEST(TaskGroupTest, DoesNotRetryNotFound) { + TaskGroup group{FastRetryConfig()}; + int call_count = 0; + + group.Submit([&]() -> Status { + ++call_count; + return NotFound("missing manifest"); + }); + + EXPECT_THAT(std::move(group).Run(), IsError(ErrorKind::kNotFound)); + EXPECT_EQ(call_count, 1); +} + +TEST(TaskGroupTest, RetryUsesExecutor) { + test::FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks retry_hooks(fake_retry.hooks()); + test::ThreadExecutor executor; + TaskGroup group{FastRetryConfig()}; + std::atomic first_task_calls = 0; + std::atomic second_task_calls = 0; + + group.SetExecutor(std::ref(executor)); + group.Submit([&]() -> Status { + auto call_count = first_task_calls.fetch_add(1, std::memory_order_relaxed) + 1; + if (call_count == 1) { + return ServiceUnavailable("server busy"); + } + return {}; + }); + group.Submit([&]() -> Status { + second_task_calls.fetch_add(1, std::memory_order_relaxed); + return {}; + }); + + EXPECT_THAT(std::move(group).Run(), IsOk()); + EXPECT_EQ(first_task_calls.load(std::memory_order_relaxed), 2); + EXPECT_EQ(second_task_calls.load(std::memory_order_relaxed), 1); + EXPECT_EQ(executor.submit_count(), 2); +} + +} // namespace iceberg diff --git a/src/iceberg/util/executor.h b/src/iceberg/util/executor.h new file mode 100644 index 000000000..01aa83d7a --- /dev/null +++ b/src/iceberg/util/executor.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/util/functional.h" + +namespace iceberg { + +using ExecutorTask = FnOnce; + +/// \brief Schedules iceberg-cpp internal planning tasks. +/// +/// Public APIs that accept an executor remain synchronous: the calling thread may block +/// while waiting for submitted tasks to finish. Callers must ensure the executor can +/// continue making progress while the caller is blocked. Calling those APIs from one of +/// the same bounded executor's worker threads can deadlock unless the executor supports +/// nested blocking work. +/// +/// When an executor is configured, planning callbacks may be called concurrently. Any +/// shared mutable state captured by those callbacks must be synchronized by the caller. +class ICEBERG_EXPORT Executor { + public: + virtual ~Executor() = default; + + /// \brief Schedule a task for execution. + virtual Status Submit(ExecutorTask task) = 0; +}; + +using OptionalExecutor = std::optional>; + +} // namespace iceberg diff --git a/src/iceberg/util/functional.h b/src/iceberg/util/functional.h new file mode 100644 index 000000000..c5ab2164b --- /dev/null +++ b/src/iceberg/util/functional.h @@ -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. + */ + +// Borrowed the file from Apache Arrow: +// https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/functional.h + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" + +namespace iceberg { + +namespace internal { + +template +concept RvalueInvocable = std::constructible_from, Fn> && + std::move_constructible> && + std::is_invocable_r_v&&, Args...>; + +} // namespace internal + +template +class FnOnce; + +template +class ICEBERG_TEMPLATE_CLASS_EXPORT FnOnce { + public: + template + requires(!std::same_as, FnOnce> && + internal::RvalueInvocable) + explicit FnOnce(Fn&& fn) : impl_(std::make_unique>(std::forward(fn))) {} + + FnOnce(FnOnce&&) noexcept = default; + FnOnce& operator=(FnOnce&&) noexcept = default; + FnOnce(const FnOnce&) = delete; + FnOnce& operator=(const FnOnce&) = delete; + + R operator()(Args... args) && { + return std::move(*impl_).Invoke(std::forward(args)...); + } + + private: + struct Impl { + virtual ~Impl() = default; + virtual R Invoke(Args&&... args) && = 0; + }; + + template + struct ImplFor final : Impl { + explicit ImplFor(Fn&& fn) : fn_(std::forward(fn)) {} + R Invoke(Args&&... args) && override { + return std::invoke(std::move(fn_), std::forward(args)...); + } + std::remove_cvref_t fn_; + }; + + std::unique_ptr impl_; +}; + +} // namespace iceberg diff --git a/src/iceberg/util/lazy.h b/src/iceberg/util/lazy.h index be7bcd41d..b31cbc786 100644 --- a/src/iceberg/util/lazy.h +++ b/src/iceberg/util/lazy.h @@ -34,20 +34,14 @@ namespace iceberg { template class Lazy { - template - struct Trait; - template - struct Trait { - using ReturnType = R::value_type; - }; + static R ExtractReturnType(R (*)(Args...)); // only declaration, never defined - using T = Trait::ReturnType; + using T = ResultValueT; public: template - requires std::invocable && - std::same_as, Result> + requires std::invocable Result> Get(Args&&... args) const { std::call_once( flag_, [this, &args...]() { value_ = InitFunc(std::forward(args)...); }); diff --git a/src/iceberg/util/meson.build b/src/iceberg/util/meson.build index 91c183bb6..f9436e7ed 100644 --- a/src/iceberg/util/meson.build +++ b/src/iceberg/util/meson.build @@ -27,8 +27,10 @@ install_headers( 'decimal.h', 'endian.h', 'error_collector.h', + 'executor.h', 'formattable.h', 'formatter.h', + 'functional.h', 'int128.h', 'lazy.h', 'location_util.h', @@ -38,6 +40,7 @@ install_headers( 'retry_util.h', 'string_util.h', 'struct_like_set.h', + 'task_group.h', 'temporal_util.h', 'timepoint.h', 'transform_util.h', diff --git a/src/iceberg/util/retry_util.cc b/src/iceberg/util/retry_util.cc index d6e0d509e..63cfc61ee 100644 --- a/src/iceberg/util/retry_util.cc +++ b/src/iceberg/util/retry_util.cc @@ -31,6 +31,7 @@ #include "iceberg/util/retry_util_internal.h" namespace iceberg { + namespace { const RetryTestHooks*& ActiveRetryTestHooks() { @@ -79,7 +80,7 @@ void SetActiveRetryTestHooks(const RetryTestHooks* hooks) { ActiveRetryTestHooks() = hooks; } -Status RetryRunner::ValidateConfig() const { +Status detail::RetryRunnerBase::ValidateConfig() const { if (config_.num_retries < 0) { return InvalidArgument("num_retries must be non-negative, got {}", config_.num_retries); @@ -103,48 +104,24 @@ Status RetryRunner::ValidateConfig() const { return InvalidArgument("scale_factor must be finite and at least 1.0, got {}", config_.scale_factor); } - if (retry_policy_mode_ == RetryPolicyMode::kUnset) { - return InvalidArgument( - "Retry policy must be explicitly configured with OnlyRetryOn(...) or " - "StopRetryOn(...) when num_retries > 0"); - } - if (retry_error_kinds_.empty()) { - return InvalidArgument("Retry policy must include at least one error kind"); - } - return {}; } -std::optional RetryRunner::ComputeDeadline() const { +std::optional +detail::RetryRunnerBase::ComputeDeadline() const { if (config_.total_timeout_ms <= 0) { return std::nullopt; } return RetryNow() + Duration(config_.total_timeout_ms); } -bool RetryRunner::HasTimedOut(const std::optional& deadline) const { +bool detail::RetryRunnerBase::HasTimedOut( + const std::optional& deadline) const { return deadline.has_value() && RetryNow() >= *deadline; } -bool RetryRunner::ShouldRetry(ErrorKind kind) const { - const bool policy_contains_kind = std::ranges::contains(retry_error_kinds_, kind); - switch (retry_policy_mode_) { - case RetryPolicyMode::kOnlyRetryOn: - return policy_contains_kind; - case RetryPolicyMode::kStopRetryOn: - return !policy_contains_kind; - case RetryPolicyMode::kUnset: - return false; - } - return false; -} - -bool RetryRunner::CanRetry(ErrorKind kind, int32_t attempt, int32_t max_attempts, - const std::optional& deadline) const { - return attempt < max_attempts && !HasTimedOut(deadline) && ShouldRetry(kind); -} - -std::optional RetryRunner::RetryDelayWithinBudget( +std::optional +detail::RetryRunnerBase::RetryDelayWithinBudget( int32_t attempt, const std::optional& deadline) const { const auto delay = Duration(CalculateDelay(attempt)); if (!deadline.has_value()) { @@ -164,8 +141,8 @@ std::optional RetryRunner::RetryDelayWithinBudget( return delay; } -bool RetryRunner::WaitForNextAttempt(int32_t attempt, - const std::optional& deadline) const { +bool detail::RetryRunnerBase::WaitForNextAttempt( + int32_t attempt, const std::optional& deadline) const { const auto delay = RetryDelayWithinBudget(attempt, deadline); if (!delay.has_value()) { return false; @@ -175,7 +152,7 @@ bool RetryRunner::WaitForNextAttempt(int32_t attempt, return !HasTimedOut(deadline); } -int32_t RetryRunner::CalculateDelay(int32_t attempt) const { +int32_t detail::RetryRunnerBase::CalculateDelay(int32_t attempt) const { const double base_delay = config_.min_wait_ms * std::pow(config_.scale_factor, attempt - 1); const int32_t delay_ms = static_cast( diff --git a/src/iceberg/util/retry_util.h b/src/iceberg/util/retry_util.h index 83e2cd5c8..656213976 100644 --- a/src/iceberg/util/retry_util.h +++ b/src/iceberg/util/retry_util.h @@ -20,38 +20,22 @@ #pragma once #include -#include #include #include -#include #include #include #include -#include #include "iceberg/iceberg_export.h" #include "iceberg/result.h" +#include "iceberg/util/macros.h" namespace iceberg { namespace detail { -template -struct IsResult : std::false_type {}; - -template -struct IsResult> : std::true_type {}; - -template -concept ResultType = IsResult>::value; - template -concept RetryTask = requires(F& f) { - { std::invoke(f) } -> ResultType; -}; - -template -using RetryTaskResult = std::remove_cvref_t>; +concept RetryTask = AsResult>; } // namespace detail @@ -69,76 +53,104 @@ struct ICEBERG_EXPORT RetryConfig { double scale_factor = 2.0; }; -/// \brief Utility class for running tasks with retry logic -/// -/// When retries are enabled (`num_retries > 0`), callers must explicitly configure -/// retry policy with `OnlyRetryOn(...)` or `StopRetryOn(...)`. -class ICEBERG_EXPORT RetryRunner { - public: - /// \brief Construct a RetryRunner with the given configuration - explicit RetryRunner(RetryConfig config = {}) : config_(std::move(config)) {} +namespace detail { - /// \brief Specify error types that should trigger a retry. - /// - /// When set, only errors matching one of these kinds will be retried. - /// All other errors will stop retries immediately. - /// - /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, - /// StopRetryOn is ignored. - RetryRunner& OnlyRetryOn(std::initializer_list error_kinds) { - retry_policy_mode_ = RetryPolicyMode::kOnlyRetryOn; - retry_error_kinds_ = std::vector(error_kinds); - return *this; - } +class ICEBERG_EXPORT RetryRunnerBase { + protected: + explicit RetryRunnerBase(RetryConfig config) : config_(std::move(config)) {} - /// \brief Specify a single error type that should trigger a retry. - /// - /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, - /// StopRetryOn is ignored. - RetryRunner& OnlyRetryOn(ErrorKind error_kind) { return OnlyRetryOn({error_kind}); } + using Clock = std::chrono::steady_clock; + using Duration = std::chrono::milliseconds; + using TimePoint = Clock::time_point; - /// \brief Specify error types that should stop retries immediately. - /// - /// When set, errors matching one of these kinds will not be retried. - /// All other errors will be retried. - /// - /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, - /// StopRetryOn is ignored. - RetryRunner& StopRetryOn(std::initializer_list error_kinds) { - if (retry_policy_mode_ == RetryPolicyMode::kOnlyRetryOn) { - return *this; - } + /// \brief Validate retry counts and timing bounds. + Status ValidateConfig() const; + std::optional ComputeDeadline() const; + bool HasTimedOut(const std::optional& deadline) const; + std::optional RetryDelayWithinBudget( + int32_t attempt, const std::optional& deadline) const; + bool WaitForNextAttempt(int32_t attempt, + const std::optional& deadline) const; + /// \brief Calculate delay with exponential backoff and jitter + int32_t CalculateDelay(int32_t attempt) const; + + RetryConfig config_; +}; + +} // namespace detail + +namespace retry { + +enum class RetryPolicyMode { + kNoRetry, + kOnlyRetryOn, + kStopRetryOn, +}; - retry_policy_mode_ = RetryPolicyMode::kStopRetryOn; - retry_error_kinds_ = std::vector(error_kinds); - return *this; +template +struct RetryPolicy { + static_assert(Mode != RetryPolicyMode::kNoRetry || sizeof...(Kinds) == 0, + "NoRetry must not include error kinds"); + static_assert(Mode == RetryPolicyMode::kNoRetry || sizeof...(Kinds) > 0, + "RetryPolicy must include at least one error kind"); + + static constexpr RetryPolicyMode kMode = Mode; + static constexpr bool kEnabled = Mode != RetryPolicyMode::kNoRetry; + + static constexpr bool ShouldRetry(ErrorKind kind) { + if constexpr (Mode == RetryPolicyMode::kNoRetry) { + return false; + } else if constexpr (Mode == RetryPolicyMode::kOnlyRetryOn) { + return ((kind == Kinds) || ...); + } else { + return !((kind == Kinds) || ...); + } } +}; - /// \brief Specify a single error type that should stop retries immediately. - /// - /// \note OnlyRetryOn takes priority over StopRetryOn. If OnlyRetryOn is set, - /// StopRetryOn is ignored. - RetryRunner& StopRetryOn(ErrorKind error_kind) { return StopRetryOn({error_kind}); } +using NoRetry = RetryPolicy; + +template +using OnlyRetryOn = RetryPolicy; + +template +using StopRetryOn = RetryPolicy; + +template +inline constexpr bool kIsRetryPolicy = false; + +template +inline constexpr bool kIsRetryPolicy> = true; + +template +concept Policy = kIsRetryPolicy>; + +} // namespace retry + +/// \brief Utility class for running tasks with retry logic +/// +/// When retries are enabled (`num_retries > 0`), RetryPolicy must be an enabled +/// policy such as `retry::OnlyRetryOn<...>` or `retry::StopRetryOn<...>`. +template +class RetryRunner : private detail::RetryRunnerBase { + public: + /// \brief Construct a RetryRunner with the given configuration + explicit RetryRunner(RetryConfig config = {}) + : detail::RetryRunnerBase(std::move(config)) {} /// \brief Run a task that returns a Result /// - /// When `num_retries > 0`, the retry policy must be configured explicitly via - /// `OnlyRetryOn(...)` or `StopRetryOn(...)`. + /// When `num_retries > 0`, RetryPolicy must allow retrying matching errors. /// /// TODO: Replace attempt_counter with a metrics reporter once it is available. - template - requires detail::RetryTask - auto Run(F&& task, int32_t* attempt_counter = nullptr) -> detail::RetryTaskResult { - using TaskResult = detail::RetryTaskResult; - - const auto validation = ValidateConfig(); - if (!validation.has_value()) { - return TaskResult(std::unexpected(validation.error())); - } + template + auto Run(F&& task, int32_t* attempt_counter = nullptr) + -> std::remove_cvref_t> { + ICEBERG_RETURN_UNEXPECTED(ValidatePolicyConfig()); - const auto deadline = ComputeDeadline(); + const auto deadline = this->ComputeDeadline(); int32_t attempt = 0; - const int32_t max_attempts = config_.num_retries + 1; + const int32_t max_attempts = this->config_.num_retries + 1; while (true) { ++attempt; @@ -155,57 +167,42 @@ class ICEBERG_EXPORT RetryRunner { return result; } - if (!WaitForNextAttempt(attempt, deadline)) { + if (!this->WaitForNextAttempt(attempt, deadline)) { return result; } } } private: - enum class RetryPolicyMode { - // No retry policy was selected; invalid when retries are enabled. - kUnset, - // Retry only errors listed in retry_error_kinds_. - kOnlyRetryOn, - // Retry all errors except those listed in retry_error_kinds_. - kStopRetryOn, - }; + using TimePoint = detail::RetryRunnerBase::TimePoint; - using Clock = std::chrono::steady_clock; - using Duration = std::chrono::milliseconds; - using TimePoint = Clock::time_point; - - /// \brief Validate retry counts, timing bounds, and the selected retry policy. - Status ValidateConfig() const; - std::optional ComputeDeadline() const; - bool HasTimedOut(const std::optional& deadline) const; + Status ValidatePolicyConfig() const { + auto validation = this->ValidateConfig(); + if (!validation.has_value()) { + return validation; + } + if (this->config_.num_retries > 0 && !RetryPolicy::kEnabled) { + return InvalidArgument("Retry policy must be enabled when num_retries > 0"); + } + return {}; + } - /// \brief Check if the given error kind should trigger a retry. - bool ShouldRetry(ErrorKind kind) const; bool CanRetry(ErrorKind kind, int32_t attempt, int32_t max_attempts, - const std::optional& deadline) const; - std::optional RetryDelayWithinBudget( - int32_t attempt, const std::optional& deadline) const; - bool WaitForNextAttempt(int32_t attempt, - const std::optional& deadline) const; - /// \brief Calculate delay with exponential backoff and jitter - int32_t CalculateDelay(int32_t attempt) const; - - RetryConfig config_; - RetryPolicyMode retry_policy_mode_ = RetryPolicyMode::kUnset; - std::vector retry_error_kinds_; + const std::optional& deadline) const { + return attempt < max_attempts && !this->HasTimedOut(deadline) && + RetryPolicy::ShouldRetry(kind); + } }; /// \brief Helper function to create a RetryRunner with table commit configuration -ICEBERG_EXPORT inline RetryRunner MakeCommitRetryRunner(int32_t num_retries, - int32_t min_wait_ms, - int32_t max_wait_ms, - int32_t total_timeout_ms) { - return RetryRunner(RetryConfig{.num_retries = num_retries, - .min_wait_ms = min_wait_ms, - .max_wait_ms = max_wait_ms, - .total_timeout_ms = total_timeout_ms}) - .OnlyRetryOn(ErrorKind::kCommitFailed); +ICEBERG_EXPORT inline auto MakeCommitRetryRunner(int32_t num_retries, int32_t min_wait_ms, + int32_t max_wait_ms, + int32_t total_timeout_ms) { + return RetryRunner>( + RetryConfig{.num_retries = num_retries, + .min_wait_ms = min_wait_ms, + .max_wait_ms = max_wait_ms, + .total_timeout_ms = total_timeout_ms}); } } // namespace iceberg diff --git a/src/iceberg/util/task_group.cc b/src/iceberg/util/task_group.cc new file mode 100644 index 000000000..cbac305fd --- /dev/null +++ b/src/iceberg/util/task_group.cc @@ -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. + */ + +#include "iceberg/util/task_group.h" + +#include +#include +#include +#include + +#include "iceberg/util/macros.h" + +namespace iceberg::internal { + +namespace { + +Status AggregateTaskErrors(std::vector errors) { + if (errors.empty()) { + return {}; + } + if (errors.size() == 1) { + return std::unexpected(std::move(errors.front())); + } + + ErrorKind kind = errors.front().kind; + std::string message = std::format("Task group failed with {} errors:", errors.size()); + for (const auto& error : errors) { + message += std::format("\n - {}", error.message); + } + return std::unexpected(Error{.kind = kind, .message = std::move(message)}); +} + +Result> SubmitTask(Executor& executor, FnOnce task) { + std::promise promise; + auto future = promise.get_future(); + + ExecutorTask executor_task( + [promise = std::move(promise), task = std::move(task)]() mutable { + promise.set_value(std::move(task)()); + }); + + ICEBERG_RETURN_UNEXPECTED(executor.Submit(std::move(executor_task))); + + return future; +} + +} // namespace + +Status RunTasksSingleThreaded(std::vector> tasks) { + std::vector errors; + for (auto& task : tasks) { + auto status = std::move(task)(); + if (!status.has_value()) { + errors.push_back(std::move(status.error())); + } + } + return AggregateTaskErrors(std::move(errors)); +} + +Status RunTasksParallel(Executor& executor, std::vector> tasks) { + std::vector> futures; + futures.reserve(tasks.size()); + + std::vector errors; + for (auto& task : tasks) { + auto future = SubmitTask(executor, std::move(task)); + if (!future.has_value()) { + errors.push_back(std::move(future.error())); + continue; + } + futures.push_back(std::move(future.value())); + } + + for (auto& future : futures) { + auto status = future.get(); + if (!status.has_value()) { + errors.push_back(std::move(status.error())); + } + } + + return AggregateTaskErrors(std::move(errors)); +} + +} // namespace iceberg::internal diff --git a/src/iceberg/util/task_group.h b/src/iceberg/util/task_group.h new file mode 100644 index 000000000..5263816e3 --- /dev/null +++ b/src/iceberg/util/task_group.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/util/executor.h" +#include "iceberg/util/functional.h" +#include "iceberg/util/retry_util.h" + +namespace iceberg { + +namespace internal { + +template +concept OnceStatusTask = RvalueInvocable; + +template +concept RepeatableStatusTask = + std::is_invocable_r_v || + (std::copy_constructible && std::is_invocable_r_v); + +template +concept RetryableStatusTask = std::constructible_from, F> && + RepeatableStatusTask>; + +ICEBERG_EXPORT Status RunTasksSingleThreaded(std::vector> tasks); + +ICEBERG_EXPORT Status RunTasksParallel(Executor& executor, + std::vector> tasks); + +} // namespace internal + +template +class ICEBERG_TEMPLATE_CLASS_EXPORT TaskGroup { + private: + static constexpr bool kRetryEnabled = !std::same_as; + + struct Empty {}; + + using RetryConfigStorage = std::conditional_t; + + public: + TaskGroup() = default; + + explicit TaskGroup(RetryConfig retry_config) + requires(kRetryEnabled) + : retry_config_(std::move(retry_config)) {} + + auto&& SetExecutor(this auto&& self, OptionalExecutor executor) { + self.executor_ = std::move(executor); + return std::forward(self); + } + + template + requires((!kRetryEnabled && internal::OnceStatusTask) || + (kRetryEnabled && internal::RetryableStatusTask)) + auto&& Submit(this auto&& self, F&& task) { + self.tasks_.emplace_back([&] { + if constexpr (!kRetryEnabled) { + return std::forward(task); + } else { + return [retry_config = self.retry_config_, + task = std::forward(task)]() mutable -> Status { + return RetryRunner(retry_config).Run(task); + }; + } + }()); + return std::forward(self); + } + + Status Run() && { + if (!executor_.has_value()) { + return internal::RunTasksSingleThreaded(std::move(tasks_)); + } + return internal::RunTasksParallel(executor_->get(), std::move(tasks_)); + } + + private: + std::vector> tasks_; + OptionalExecutor executor_; + [[no_unique_address]] RetryConfigStorage retry_config_; +}; + +} // namespace iceberg From c21d425461b2a86f87fc2904114d4f6827ee481d Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Fri, 5 Jun 2026 17:41:06 +0800 Subject: [PATCH 060/151] chore: update LICENSE of FnOnce (#698) --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 3fe0ab613..374b7fc58 100644 --- a/LICENSE +++ b/LICENSE @@ -216,6 +216,7 @@ This product includes code from Apache Arrow. * Core utilities: * checked_cast utility in src/iceberg/util/checked_cast.h. + * FnOnce utility in src/iceberg/util/functional.h. * visit_type utility in src/iceberg/util/visit_type.h. * Decimal128 implementation details in src/iceberg/util/decimal files. * Build system modules: From ae29c3d4b497c26a62de47ee7659f6cf7aba60f8 Mon Sep 17 00:00:00 2001 From: Innocent Djiofack Date: Fri, 5 Jun 2026 06:07:40 -0700 Subject: [PATCH 061/151] feat: metrics reporting for scan and commit (#589) Initial commit for addressing https://github.com/apache/iceberg-cpp/issues/533 --------- Co-authored-by: Innocent --- src/iceberg/CMakeLists.txt | 8 + src/iceberg/constants.h | 1 + src/iceberg/meson.build | 8 + src/iceberg/metrics/CMakeLists.txt | 18 + src/iceberg/metrics/commit_report.cc | 111 +++ src/iceberg/metrics/commit_report.h | 159 +++ src/iceberg/metrics/counter.cc | 52 + src/iceberg/metrics/counter.h | 105 ++ src/iceberg/metrics/json_serde.cc | 456 +++++++++ src/iceberg/metrics/json_serde_internal.h | 61 ++ src/iceberg/metrics/meson.build | 30 + src/iceberg/metrics/metrics_context.cc | 64 ++ src/iceberg/metrics/metrics_context.h | 80 ++ src/iceberg/metrics/metrics_reporter.h | 105 ++ src/iceberg/metrics/metrics_reporters.cc | 177 ++++ src/iceberg/metrics/metrics_reporters.h | 118 +++ src/iceberg/metrics/metrics_types.h | 63 ++ src/iceberg/metrics/scan_report.cc | 89 ++ src/iceberg/metrics/scan_report.h | 147 +++ src/iceberg/metrics/timer.cc | 108 ++ src/iceberg/metrics/timer.h | 162 +++ src/iceberg/test/CMakeLists.txt | 2 + src/iceberg/test/meson.build | 2 + src/iceberg/test/metrics_reporter_test.cc | 356 +++++++ src/iceberg/test/metrics_test.cc | 1091 +++++++++++++++++++++ 25 files changed, 3573 insertions(+) create mode 100644 src/iceberg/metrics/CMakeLists.txt create mode 100644 src/iceberg/metrics/commit_report.cc create mode 100644 src/iceberg/metrics/commit_report.h create mode 100644 src/iceberg/metrics/counter.cc create mode 100644 src/iceberg/metrics/counter.h create mode 100644 src/iceberg/metrics/json_serde.cc create mode 100644 src/iceberg/metrics/json_serde_internal.h create mode 100644 src/iceberg/metrics/meson.build create mode 100644 src/iceberg/metrics/metrics_context.cc create mode 100644 src/iceberg/metrics/metrics_context.h create mode 100644 src/iceberg/metrics/metrics_reporter.h create mode 100644 src/iceberg/metrics/metrics_reporters.cc create mode 100644 src/iceberg/metrics/metrics_reporters.h create mode 100644 src/iceberg/metrics/metrics_types.h create mode 100644 src/iceberg/metrics/scan_report.cc create mode 100644 src/iceberg/metrics/scan_report.h create mode 100644 src/iceberg/metrics/timer.cc create mode 100644 src/iceberg/metrics/timer.h create mode 100644 src/iceberg/test/metrics_reporter_test.cc create mode 100644 src/iceberg/test/metrics_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 935ded941..04a73ca4c 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -59,6 +59,13 @@ set(ICEBERG_SOURCES manifest/v3_metadata.cc metadata_columns.cc metrics_config.cc + metrics/commit_report.cc + metrics/counter.cc + metrics/json_serde.cc + metrics/metrics_context.cc + metrics/metrics_reporters.cc + metrics/scan_report.cc + metrics/timer.cc name_mapping.cc partition_field.cc partition_spec.cc @@ -227,6 +234,7 @@ add_subdirectory(puffin) add_subdirectory(row) add_subdirectory(update) add_subdirectory(util) +add_subdirectory(metrics) if(ICEBERG_BUILD_BUNDLE) set(ICEBERG_BUNDLE_SOURCES diff --git a/src/iceberg/constants.h b/src/iceberg/constants.h index 1d5941626..e443b292c 100644 --- a/src/iceberg/constants.h +++ b/src/iceberg/constants.h @@ -33,6 +33,7 @@ namespace iceberg { constexpr std::string_view kParquetFieldIdKey = "PARQUET:field_id"; constexpr int64_t kInvalidSnapshotId = -1; constexpr int64_t kInvalidSequenceNumber = -1; +constexpr int64_t kInvalidSchemaId = -1; /// \brief Stand-in for the current sequence number that will be assigned when the commit /// is successful. This is replaced when writing a manifest list by the ManifestFile /// adapter. diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 3da8f6e32..15fd5d79d 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -80,6 +80,13 @@ iceberg_sources = files( 'manifest/v2_metadata.cc', 'manifest/v3_metadata.cc', 'metadata_columns.cc', + 'metrics/commit_report.cc', + 'metrics/counter.cc', + 'metrics/json_serde.cc', + 'metrics/metrics_context.cc', + 'metrics/metrics_reporters.cc', + 'metrics/scan_report.cc', + 'metrics/timer.cc', 'metrics_config.cc', 'name_mapping.cc', 'partition_field.cc', @@ -282,6 +289,7 @@ subdir('data') subdir('deletes') subdir('expression') subdir('manifest') +subdir('metrics') subdir('puffin') subdir('row') subdir('update') diff --git a/src/iceberg/metrics/CMakeLists.txt b/src/iceberg/metrics/CMakeLists.txt new file mode 100644 index 000000000..c097fb0ed --- /dev/null +++ b/src/iceberg/metrics/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +iceberg_install_all_headers(iceberg/metrics) diff --git a/src/iceberg/metrics/commit_report.cc b/src/iceberg/metrics/commit_report.cc new file mode 100644 index 000000000..e56187edf --- /dev/null +++ b/src/iceberg/metrics/commit_report.cc @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/metrics/commit_report.h" + +#include "iceberg/snapshot.h" +#include "iceberg/util/string_util.h" + +namespace iceberg { + +std::unique_ptr CommitMetrics::Make(MetricsContext& context) { + auto m = std::unique_ptr(new CommitMetrics()); + m->total_duration = context.GetTimer("total-duration", TimerUnit::kNanoseconds); + m->attempts = context.GetCounter("attempts"); + return m; +} + +std::unique_ptr CommitMetrics::Noop() { + return CommitMetrics::Make(*MetricsContext::Noop()); +} + +CommitMetricsResult CommitMetrics::ToResult() const { + CommitMetricsResult result; + if (total_duration && !total_duration->IsNoop()) { + result.total_duration = + TimerResult{.unit = std::string(total_duration->Unit()), + .count = total_duration->Count(), + .total_duration = total_duration->TotalDuration()}; + } + if (attempts && !attempts->IsNoop()) { + result.attempts = CounterResult{.unit = attempts->unit(), .value = attempts->value()}; + } + return result; +} + +CommitMetricsResult CommitMetricsResult::From( + const CommitMetrics& live_metrics, + const std::unordered_map& snapshot_summary) { + auto result = live_metrics.ToResult(); + + auto count_field = + [&snapshot_summary](const std::string& key) -> std::optional { + auto it = snapshot_summary.find(key); + if (it == snapshot_summary.end()) return std::nullopt; + auto parsed = StringUtils::ParseNumber(it->second); + if (!parsed.has_value()) return std::nullopt; + return CounterResult{.unit = CounterUnit::kCount, .value = parsed.value()}; + }; + auto bytes_field = + [&snapshot_summary](const std::string& key) -> std::optional { + auto it = snapshot_summary.find(key); + if (it == snapshot_summary.end()) return std::nullopt; + auto parsed = StringUtils::ParseNumber(it->second); + if (!parsed.has_value()) return std::nullopt; + return CounterResult{.unit = CounterUnit::kBytes, .value = parsed.value()}; + }; + + result.added_data_files = count_field(SnapshotSummaryFields::kAddedDataFiles); + result.removed_data_files = count_field(SnapshotSummaryFields::kDeletedDataFiles); + result.total_data_files = count_field(SnapshotSummaryFields::kTotalDataFiles); + result.added_delete_files = count_field(SnapshotSummaryFields::kAddedDeleteFiles); + result.added_equality_delete_files = + count_field(SnapshotSummaryFields::kAddedEqDeleteFiles); + result.added_positional_delete_files = + count_field(SnapshotSummaryFields::kAddedPosDeleteFiles); + result.added_dvs = count_field(SnapshotSummaryFields::kAddedDVs); + result.removed_delete_files = count_field(SnapshotSummaryFields::kRemovedDeleteFiles); + result.removed_positional_delete_files = + count_field(SnapshotSummaryFields::kRemovedPosDeleteFiles); + result.removed_dvs = count_field(SnapshotSummaryFields::kRemovedDVs); + result.removed_equality_delete_files = + count_field(SnapshotSummaryFields::kRemovedEqDeleteFiles); + result.total_delete_files = count_field(SnapshotSummaryFields::kTotalDeleteFiles); + result.added_records = count_field(SnapshotSummaryFields::kAddedRecords); + result.removed_records = count_field(SnapshotSummaryFields::kDeletedRecords); + result.total_records = count_field(SnapshotSummaryFields::kTotalRecords); + result.added_files_size_bytes = bytes_field(SnapshotSummaryFields::kAddedFileSize); + result.removed_files_size_bytes = bytes_field(SnapshotSummaryFields::kRemovedFileSize); + result.total_files_size_bytes = bytes_field(SnapshotSummaryFields::kTotalFileSize); + result.added_positional_deletes = count_field(SnapshotSummaryFields::kAddedPosDeletes); + result.removed_positional_deletes = + count_field(SnapshotSummaryFields::kRemovedPosDeletes); + result.total_positional_deletes = count_field(SnapshotSummaryFields::kTotalPosDeletes); + result.added_equality_deletes = count_field(SnapshotSummaryFields::kAddedEqDeletes); + result.removed_equality_deletes = count_field(SnapshotSummaryFields::kRemovedEqDeletes); + result.total_equality_deletes = count_field(SnapshotSummaryFields::kTotalEqDeletes); + result.kept_manifest_count = count_field(SnapshotSummaryFields::kManifestsKept); + result.created_manifest_count = count_field(SnapshotSummaryFields::kManifestsCreated); + result.replaced_manifest_count = count_field(SnapshotSummaryFields::kManifestsReplaced); + result.processed_manifest_entries_count = + count_field(SnapshotSummaryFields::kEntriesProcessed); + return result; +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/commit_report.h b/src/iceberg/metrics/commit_report.h new file mode 100644 index 000000000..63867c8e0 --- /dev/null +++ b/src/iceberg/metrics/commit_report.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include + +#include "iceberg/constants.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/metrics_context.h" +#include "iceberg/metrics/metrics_types.h" +#include "iceberg/metrics/timer.h" + +namespace iceberg { + +// Forward declaration: CommitMetrics is defined later in this header. +class CommitMetrics; + +/// \brief Immutable snapshot of commit metrics for use in CommitReport. +/// +/// Populated by CommitMetrics::ToResult() after a commit completes. File and +/// record counts can also be combined from the snapshot summary with From(). +struct ICEBERG_EXPORT CommitMetricsResult { + /// \brief Total wall-clock duration of the commit attempt. + std::optional total_duration; + /// \brief Number of commit attempts (1 on success without retries). + std::optional attempts; + /// \brief Number of data files added in this commit. + std::optional added_data_files; + /// \brief Number of data files removed in this commit. + std::optional removed_data_files; + /// \brief Total live data files after this commit. + std::optional total_data_files; + /// \brief Number of delete files added in this commit. + std::optional added_delete_files; + /// \brief Equality delete files added. + std::optional added_equality_delete_files; + /// \brief Positional delete files added. + std::optional added_positional_delete_files; + /// \brief Deletion vectors added. + std::optional added_dvs; + /// \brief Number of delete files removed in this commit. + std::optional removed_delete_files; + /// \brief Positional delete files removed. + std::optional removed_positional_delete_files; + /// \brief Deletion vectors removed. + std::optional removed_dvs; + /// \brief Equality delete files removed. + std::optional removed_equality_delete_files; + /// \brief Total live delete files after this commit. + std::optional total_delete_files; + /// \brief Number of records added in this commit. + std::optional added_records; + /// \brief Number of records removed in this commit. + std::optional removed_records; + /// \brief Total live records after this commit. + std::optional total_records; + /// \brief Total byte size of files added. + std::optional added_files_size_bytes; + /// \brief Total byte size of files removed. + std::optional removed_files_size_bytes; + /// \brief Total byte size of all live files after this commit. + std::optional total_files_size_bytes; + /// \brief Positional delete records added. + std::optional added_positional_deletes; + /// \brief Positional delete records removed. + std::optional removed_positional_deletes; + /// \brief Total positional delete records after this commit. + std::optional total_positional_deletes; + /// \brief Equality delete records added. + std::optional added_equality_deletes; + /// \brief Equality delete records removed. + std::optional removed_equality_deletes; + /// \brief Total equality delete records after this commit. + std::optional total_equality_deletes; + /// \brief Manifest files kept unchanged in this commit. + std::optional kept_manifest_count; + /// \brief Manifest files created in this commit. + std::optional created_manifest_count; + /// \brief Manifest files replaced in this commit. + std::optional replaced_manifest_count; + /// \brief Manifest entries processed in this commit. + std::optional processed_manifest_entries_count; + + bool operator==(const CommitMetricsResult&) const = default; + + /// \brief Build a CommitMetricsResult from live metrics and a snapshot summary map. + /// + /// Combines timer/retry measurements from \p live_metrics with records parsed + /// from \p snapshot_summary. Missing or unparseable summary keys are omitted. + static CommitMetricsResult From( + const CommitMetrics& live_metrics, + const std::unordered_map& snapshot_summary); +}; + +/// \brief Live commit metrics collected during a table commit operation. +/// +/// Tracks the overall commit duration and retry count. File/record counts come +/// from the snapshot summary after the commit succeeds and are stored separately +/// in CommitMetricsResult. +class ICEBERG_EXPORT CommitMetrics { + public: + /// \brief Create a CommitMetrics instance backed by the given MetricsContext. + static std::unique_ptr Make(MetricsContext& context); + + /// \brief Create a CommitMetrics instance with all-noop timer and counter. + static std::unique_ptr Noop(); + + /// \brief Snapshot current timer and counter values into a CommitMetricsResult. + CommitMetricsResult ToResult() const; + + /// \brief Timer measuring total wall-clock time of the commit call. + std::shared_ptr total_duration; + + /// \brief Counter for the number of commit attempts (including retries). + std::shared_ptr attempts; + + private: + CommitMetrics() = default; +}; + +/// \brief Report generated after a commit operation. +/// +/// Contains metrics about the changes made in a commit. +struct ICEBERG_EXPORT CommitReport { + /// \brief The fully qualified name of the table that was modified. + std::string table_name; + /// \brief The snapshot ID created by this commit. + int64_t snapshot_id = kInvalidSnapshotId; + /// \brief The sequence number assigned to this commit. + int64_t sequence_number = kInvalidSequenceNumber; + /// \brief The operation that was performed (write, delete, etc.). + std::string operation; + /// \brief Metrics collected during the commit operation. + CommitMetricsResult commit_metrics; + /// \brief Additional key-value metadata. + std::unordered_map metadata; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/counter.cc b/src/iceberg/metrics/counter.cc new file mode 100644 index 000000000..cabfcb475 --- /dev/null +++ b/src/iceberg/metrics/counter.cc @@ -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. + */ + +#include "iceberg/metrics/counter.h" + +#include + +namespace iceberg { + +namespace { + +class NoopCounter final : public Counter { + public: + using Counter::Increment; + void Increment(int64_t) override {} + int64_t value() const override { return -1; } + CounterUnit unit() const override { return CounterUnit::kUndefined; } + bool IsNoop() const override { return true; } +}; + +} // namespace + +std::shared_ptr Counter::Noop() { + static std::shared_ptr instance = std::make_shared(); + return instance; +} + +DefaultCounter::DefaultCounter(CounterUnit unit) : unit_(unit) {} + +void DefaultCounter::Increment(int64_t amount) { + count_.fetch_add(amount, std::memory_order_relaxed); +} + +int64_t DefaultCounter::value() const { return count_.load(std::memory_order_relaxed); } + +} // namespace iceberg diff --git a/src/iceberg/metrics/counter.h b/src/iceberg/metrics/counter.h new file mode 100644 index 000000000..4542b90f0 --- /dev/null +++ b/src/iceberg/metrics/counter.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/util/string_util.h" + +namespace iceberg { + +/// \brief Unit for a Counter metric. +enum class CounterUnit { + kCount, + kBytes, + kUndefined, +}; + +/// \brief String representation of a CounterUnit. +ICEBERG_EXPORT constexpr std::string_view ToString(CounterUnit unit) noexcept { + switch (unit) { + case CounterUnit::kCount: + return "count"; + case CounterUnit::kBytes: + return "bytes"; + case CounterUnit::kUndefined: + return "undefined"; + } + std::unreachable(); +} + +/// \brief Parse a CounterUnit from a string. +/// +/// \param s The string to parse ("count", "bytes", or "undefined"). +/// \return The CounterUnit, or an InvalidArgument error if unrecognized. +ICEBERG_EXPORT inline Result CounterUnitFromString(std::string_view s) { + auto unit = StringUtils::ToLower(s); + if (unit == "count") return CounterUnit::kCount; + if (unit == "bytes") return CounterUnit::kBytes; + if (unit == "undefined") return CounterUnit::kUndefined; + return InvalidArgument("Invalid unit: {}", s); +} + +/// \brief Abstract counter for tracking event totals. +class ICEBERG_EXPORT Counter { + public: + virtual ~Counter() = default; + + /// \brief Increment the counter by 1. + virtual void Increment() { Increment(1); } + + /// \brief Increment the counter by the given amount. + virtual void Increment(int64_t amount) = 0; + + /// \brief Return the current count. + virtual int64_t value() const = 0; + + /// \brief Return the unit for this counter. + virtual CounterUnit unit() const { return CounterUnit::kCount; } + + /// \brief Return true if this counter is a no-op. + virtual bool IsNoop() const { return false; } + + /// \brief Return a shared no-op counter singleton. + static std::shared_ptr Noop(); +}; + +/// \brief Thread-safe counter backed by std::atomic. +class ICEBERG_EXPORT DefaultCounter : public Counter { + public: + explicit DefaultCounter(CounterUnit unit = CounterUnit::kCount); + + using Counter::Increment; + void Increment(int64_t amount) override; + int64_t value() const override; + CounterUnit unit() const override { return unit_; } + + private: + std::atomic count_{0}; + CounterUnit unit_; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/json_serde.cc b/src/iceberg/metrics/json_serde.cc new file mode 100644 index 000000000..9e8984df1 --- /dev/null +++ b/src/iceberg/metrics/json_serde.cc @@ -0,0 +1,456 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include + +#include "iceberg/expression/expression.h" +#include "iceberg/expression/json_serde_internal.h" +#include "iceberg/metrics/json_serde_internal.h" +#include "iceberg/util/json_util_internal.h" +#include "iceberg/util/string_util.h" + +namespace iceberg { + +namespace { + +using StringMap = std::unordered_map; + +// JSON key constants (kebab-case, matching Iceberg spec) +constexpr std::string_view kTableName = "table-name"; +constexpr std::string_view kSnapshotId = "snapshot-id"; +constexpr std::string_view kFilter = "filter"; +constexpr std::string_view kSchemaId = "schema-id"; +constexpr std::string_view kProjectedFieldIds = "projected-field-ids"; +constexpr std::string_view kProjectedFieldNames = "projected-field-names"; +constexpr std::string_view kMetrics = "metrics"; +constexpr std::string_view kMetadata = "metadata"; +constexpr std::string_view kSequenceNumber = "sequence-number"; +constexpr std::string_view kOperation = "operation"; + +// CounterResult / TimerResult keys +constexpr std::string_view kUnit = "unit"; +constexpr std::string_view kTimeUnit = "time-unit"; +constexpr std::string_view kValue = "value"; +constexpr std::string_view kCount = "count"; +constexpr std::string_view kTotalDuration = "total-duration"; + +// ScanMetricsResult keys +constexpr std::string_view kTotalPlanningDuration = "total-planning-duration"; +constexpr std::string_view kResultDataFiles = "result-data-files"; +constexpr std::string_view kResultDeleteFiles = "result-delete-files"; +constexpr std::string_view kScannedDataManifests = "scanned-data-manifests"; +constexpr std::string_view kScannedDeleteManifests = "scanned-delete-manifests"; +constexpr std::string_view kTotalDataManifests = "total-data-manifests"; +constexpr std::string_view kTotalDeleteManifests = "total-delete-manifests"; +constexpr std::string_view kTotalFileSizeInBytes = "total-file-size-in-bytes"; +constexpr std::string_view kTotalDeleteFileSizeInBytes = + "total-delete-file-size-in-bytes"; +constexpr std::string_view kSkippedDataManifests = "skipped-data-manifests"; +constexpr std::string_view kSkippedDeleteManifests = "skipped-delete-manifests"; +constexpr std::string_view kSkippedDataFiles = "skipped-data-files"; +constexpr std::string_view kSkippedDeleteFiles = "skipped-delete-files"; +constexpr std::string_view kIndexedDeleteFiles = "indexed-delete-files"; +constexpr std::string_view kEqualityDeleteFiles = "equality-delete-files"; +constexpr std::string_view kPositionalDeleteFiles = "positional-delete-files"; +constexpr std::string_view kDvs = "dvs"; + +// CommitMetricsResult keys +constexpr std::string_view kAttempts = "attempts"; +constexpr std::string_view kAddedDataFiles = "added-data-files"; +constexpr std::string_view kRemovedDataFiles = "removed-data-files"; +constexpr std::string_view kTotalDataFiles = "total-data-files"; +constexpr std::string_view kAddedDeleteFiles = "added-delete-files"; +constexpr std::string_view kAddedEqualityDeleteFiles = "added-equality-delete-files"; +constexpr std::string_view kAddedPositionalDeleteFiles = "added-positional-delete-files"; +constexpr std::string_view kAddedDvs = "added-dvs"; +constexpr std::string_view kRemovedDeleteFiles = "removed-delete-files"; +constexpr std::string_view kRemovedPositionalDeleteFiles = + "removed-positional-delete-files"; +constexpr std::string_view kRemovedDvs = "removed-dvs"; +constexpr std::string_view kRemovedEqualityDeleteFiles = "removed-equality-delete-files"; +constexpr std::string_view kTotalDeleteFiles = "total-delete-files"; +constexpr std::string_view kAddedRecords = "added-records"; +constexpr std::string_view kRemovedRecords = "removed-records"; +constexpr std::string_view kTotalRecords = "total-records"; +constexpr std::string_view kAddedFilesSizeBytes = "added-files-size-bytes"; +constexpr std::string_view kRemovedFilesSizeBytes = "removed-files-size-bytes"; +constexpr std::string_view kTotalFilesSizeBytes = "total-files-size-bytes"; +constexpr std::string_view kAddedPositionalDeletes = "added-positional-deletes"; +constexpr std::string_view kRemovedPositionalDeletes = "removed-positional-deletes"; +constexpr std::string_view kTotalPositionalDeletes = "total-positional-deletes"; +constexpr std::string_view kAddedEqualityDeletes = "added-equality-deletes"; +constexpr std::string_view kRemovedEqualityDeletes = "removed-equality-deletes"; +constexpr std::string_view kTotalEqualityDeletes = "total-equality-deletes"; +constexpr std::string_view kKeptManifestCount = "manifests-kept"; +constexpr std::string_view kCreatedManifestCount = "manifests-created"; +constexpr std::string_view kReplacedManifestCount = "manifests-replaced"; +constexpr std::string_view kProcessedManifestEntriesCount = "manifest-entries-processed"; + +void SetCounterField(nlohmann::json& json, std::string_view key, + const std::optional& counter) { + if (counter) { + json[key] = ToJson(*counter); + } +} + +Result> ParseCounterResult(const nlohmann::json& json, + std::string_view key) { + auto it = json.find(key); + if (it == json.end()) return std::nullopt; + return CounterResultFromJson(*it); +} + +Result> ParseTimerResult(const nlohmann::json& json, + std::string_view key) { + auto it = json.find(key); + if (it == json.end()) return std::nullopt; + return TimerResultFromJson(*it); +} + +Result DurationToNanoseconds(int64_t duration, + std::string_view unit) { + auto normalized = StringUtils::ToLower(unit); + if (normalized == "nanoseconds") return std::chrono::nanoseconds{duration}; + if (normalized == "microseconds") return std::chrono::microseconds{duration}; + if (normalized == "milliseconds") return std::chrono::milliseconds{duration}; + if (normalized == "seconds") return std::chrono::seconds{duration}; + if (normalized == "minutes") return std::chrono::minutes{duration}; + if (normalized == "hours") return std::chrono::hours{duration}; + if (normalized == "days") return std::chrono::days{duration}; + return JsonParseError("Invalid time unit: {}", unit); +} + +Result NanosecondsToDuration(std::chrono::nanoseconds duration, + std::string_view unit) { + auto normalized = StringUtils::ToLower(unit); + if (normalized == "nanoseconds") return duration.count(); + if (normalized == "microseconds") { + return std::chrono::duration_cast(duration).count(); + } + if (normalized == "milliseconds") { + return std::chrono::duration_cast(duration).count(); + } + if (normalized == "seconds") { + return std::chrono::duration_cast(duration).count(); + } + if (normalized == "minutes") { + return std::chrono::duration_cast(duration).count(); + } + if (normalized == "hours") { + return std::chrono::duration_cast(duration).count(); + } + if (normalized == "days") { + return std::chrono::duration_cast(duration).count(); + } + return JsonParseError("Invalid time unit: {}", unit); +} + +} // namespace + +// --------------------------------------------------------------------------- +// CounterResult +// --------------------------------------------------------------------------- + +nlohmann::json ToJson(const CounterResult& counter) { + return {{kUnit, ToString(counter.unit)}, {kValue, counter.value}}; +} + +Result CounterResultFromJson(const nlohmann::json& json) { + ICEBERG_ASSIGN_OR_RAISE(auto unit, GetJsonValue(json, kUnit)); + ICEBERG_ASSIGN_OR_RAISE(auto parsed_unit, CounterUnitFromString(unit)); + ICEBERG_ASSIGN_OR_RAISE(auto value, GetJsonValue(json, kValue)); + return CounterResult{.unit = parsed_unit, .value = value}; +} + +// --------------------------------------------------------------------------- +// TimerResult +// --------------------------------------------------------------------------- + +Result ToJson(const TimerResult& timer) { + ICEBERG_ASSIGN_OR_RAISE(auto duration, + NanosecondsToDuration(timer.total_duration, timer.unit)); + auto unit = StringUtils::ToLower(timer.unit); + nlohmann::json json = { + {kTimeUnit, unit}, {kCount, timer.count}, {kTotalDuration, duration}}; + return json; +} + +Result TimerResultFromJson(const nlohmann::json& json) { + ICEBERG_ASSIGN_OR_RAISE(auto count, GetJsonValue(json, kCount)); + ICEBERG_ASSIGN_OR_RAISE(auto unit, GetJsonValue(json, kTimeUnit)); + ICEBERG_ASSIGN_OR_RAISE(auto total, GetJsonValue(json, kTotalDuration)); + ICEBERG_ASSIGN_OR_RAISE(auto duration, DurationToNanoseconds(total, unit)); + return TimerResult{ + .unit = StringUtils::ToLower(unit), .count = count, .total_duration = duration}; +} + +// --------------------------------------------------------------------------- +// ScanMetricsResult +// --------------------------------------------------------------------------- + +Result ToJson(const ScanMetricsResult& m) { + nlohmann::json json = nlohmann::json::object(); + if (m.total_planning_duration) { + ICEBERG_ASSIGN_OR_RAISE(auto total_planning_duration, + ToJson(*m.total_planning_duration)); + json[std::string(kTotalPlanningDuration)] = std::move(total_planning_duration); + } + SetCounterField(json, kResultDataFiles, m.result_data_files); + SetCounterField(json, kResultDeleteFiles, m.result_delete_files); + SetCounterField(json, kScannedDataManifests, m.scanned_data_manifests); + SetCounterField(json, kScannedDeleteManifests, m.scanned_delete_manifests); + SetCounterField(json, kTotalDataManifests, m.total_data_manifests); + SetCounterField(json, kTotalDeleteManifests, m.total_delete_manifests); + SetCounterField(json, kTotalFileSizeInBytes, m.total_file_size_in_bytes); + SetCounterField(json, kTotalDeleteFileSizeInBytes, m.total_delete_file_size_in_bytes); + SetCounterField(json, kSkippedDataManifests, m.skipped_data_manifests); + SetCounterField(json, kSkippedDeleteManifests, m.skipped_delete_manifests); + SetCounterField(json, kSkippedDataFiles, m.skipped_data_files); + SetCounterField(json, kSkippedDeleteFiles, m.skipped_delete_files); + SetCounterField(json, kIndexedDeleteFiles, m.indexed_delete_files); + SetCounterField(json, kEqualityDeleteFiles, m.equality_delete_files); + SetCounterField(json, kPositionalDeleteFiles, m.positional_delete_files); + SetCounterField(json, kDvs, m.dvs); + return json; +} + +Result ScanMetricsResultFromJson(const nlohmann::json& json) { + if (!json.is_object()) { + return JsonParseError("Cannot parse scan metrics from non-object: {}", + SafeDumpJson(json)); + } + ScanMetricsResult m; + ICEBERG_ASSIGN_OR_RAISE(m.total_planning_duration, + ParseTimerResult(json, kTotalPlanningDuration)); + ICEBERG_ASSIGN_OR_RAISE(m.result_data_files, + ParseCounterResult(json, kResultDataFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.result_delete_files, + ParseCounterResult(json, kResultDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.scanned_data_manifests, + ParseCounterResult(json, kScannedDataManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.scanned_delete_manifests, + ParseCounterResult(json, kScannedDeleteManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.total_data_manifests, + ParseCounterResult(json, kTotalDataManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.total_delete_manifests, + ParseCounterResult(json, kTotalDeleteManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.total_file_size_in_bytes, + ParseCounterResult(json, kTotalFileSizeInBytes)); + ICEBERG_ASSIGN_OR_RAISE(m.total_delete_file_size_in_bytes, + ParseCounterResult(json, kTotalDeleteFileSizeInBytes)); + ICEBERG_ASSIGN_OR_RAISE(m.skipped_data_manifests, + ParseCounterResult(json, kSkippedDataManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.skipped_delete_manifests, + ParseCounterResult(json, kSkippedDeleteManifests)); + ICEBERG_ASSIGN_OR_RAISE(m.skipped_data_files, + ParseCounterResult(json, kSkippedDataFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.skipped_delete_files, + ParseCounterResult(json, kSkippedDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.indexed_delete_files, + ParseCounterResult(json, kIndexedDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.equality_delete_files, + ParseCounterResult(json, kEqualityDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.positional_delete_files, + ParseCounterResult(json, kPositionalDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.dvs, ParseCounterResult(json, kDvs)); + return m; +} + +// --------------------------------------------------------------------------- +// CommitMetricsResult +// --------------------------------------------------------------------------- + +Result ToJson(const CommitMetricsResult& m) { + nlohmann::json json = nlohmann::json::object(); + if (m.total_duration) { + ICEBERG_ASSIGN_OR_RAISE(auto total_duration, ToJson(*m.total_duration)); + json[std::string(kTotalDuration)] = std::move(total_duration); + } + SetCounterField(json, kAttempts, m.attempts); + SetCounterField(json, kAddedDataFiles, m.added_data_files); + SetCounterField(json, kRemovedDataFiles, m.removed_data_files); + SetCounterField(json, kTotalDataFiles, m.total_data_files); + SetCounterField(json, kAddedDeleteFiles, m.added_delete_files); + SetCounterField(json, kAddedEqualityDeleteFiles, m.added_equality_delete_files); + SetCounterField(json, kAddedPositionalDeleteFiles, m.added_positional_delete_files); + SetCounterField(json, kAddedDvs, m.added_dvs); + SetCounterField(json, kRemovedDeleteFiles, m.removed_delete_files); + SetCounterField(json, kRemovedPositionalDeleteFiles, m.removed_positional_delete_files); + SetCounterField(json, kRemovedDvs, m.removed_dvs); + SetCounterField(json, kRemovedEqualityDeleteFiles, m.removed_equality_delete_files); + SetCounterField(json, kTotalDeleteFiles, m.total_delete_files); + SetCounterField(json, kAddedRecords, m.added_records); + SetCounterField(json, kRemovedRecords, m.removed_records); + SetCounterField(json, kTotalRecords, m.total_records); + SetCounterField(json, kAddedFilesSizeBytes, m.added_files_size_bytes); + SetCounterField(json, kRemovedFilesSizeBytes, m.removed_files_size_bytes); + SetCounterField(json, kTotalFilesSizeBytes, m.total_files_size_bytes); + SetCounterField(json, kAddedPositionalDeletes, m.added_positional_deletes); + SetCounterField(json, kRemovedPositionalDeletes, m.removed_positional_deletes); + SetCounterField(json, kTotalPositionalDeletes, m.total_positional_deletes); + SetCounterField(json, kAddedEqualityDeletes, m.added_equality_deletes); + SetCounterField(json, kRemovedEqualityDeletes, m.removed_equality_deletes); + SetCounterField(json, kTotalEqualityDeletes, m.total_equality_deletes); + SetCounterField(json, kKeptManifestCount, m.kept_manifest_count); + SetCounterField(json, kCreatedManifestCount, m.created_manifest_count); + SetCounterField(json, kReplacedManifestCount, m.replaced_manifest_count); + SetCounterField(json, kProcessedManifestEntriesCount, + m.processed_manifest_entries_count); + return json; +} + +Result CommitMetricsResultFromJson(const nlohmann::json& json) { + if (!json.is_object()) { + return JsonParseError("Cannot parse commit metrics from non-object: {}", + SafeDumpJson(json)); + } + CommitMetricsResult m; + ICEBERG_ASSIGN_OR_RAISE(m.total_duration, ParseTimerResult(json, kTotalDuration)); + ICEBERG_ASSIGN_OR_RAISE(m.attempts, ParseCounterResult(json, kAttempts)); + ICEBERG_ASSIGN_OR_RAISE(m.added_data_files, ParseCounterResult(json, kAddedDataFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_data_files, + ParseCounterResult(json, kRemovedDataFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.total_data_files, ParseCounterResult(json, kTotalDataFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.added_delete_files, + ParseCounterResult(json, kAddedDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.added_equality_delete_files, + ParseCounterResult(json, kAddedEqualityDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.added_positional_delete_files, + ParseCounterResult(json, kAddedPositionalDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.added_dvs, ParseCounterResult(json, kAddedDvs)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_delete_files, + ParseCounterResult(json, kRemovedDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_positional_delete_files, + ParseCounterResult(json, kRemovedPositionalDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_dvs, ParseCounterResult(json, kRemovedDvs)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_equality_delete_files, + ParseCounterResult(json, kRemovedEqualityDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.total_delete_files, + ParseCounterResult(json, kTotalDeleteFiles)); + ICEBERG_ASSIGN_OR_RAISE(m.added_records, ParseCounterResult(json, kAddedRecords)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_records, ParseCounterResult(json, kRemovedRecords)); + ICEBERG_ASSIGN_OR_RAISE(m.total_records, ParseCounterResult(json, kTotalRecords)); + ICEBERG_ASSIGN_OR_RAISE(m.added_files_size_bytes, + ParseCounterResult(json, kAddedFilesSizeBytes)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_files_size_bytes, + ParseCounterResult(json, kRemovedFilesSizeBytes)); + ICEBERG_ASSIGN_OR_RAISE(m.total_files_size_bytes, + ParseCounterResult(json, kTotalFilesSizeBytes)); + ICEBERG_ASSIGN_OR_RAISE(m.added_positional_deletes, + ParseCounterResult(json, kAddedPositionalDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_positional_deletes, + ParseCounterResult(json, kRemovedPositionalDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.total_positional_deletes, + ParseCounterResult(json, kTotalPositionalDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.added_equality_deletes, + ParseCounterResult(json, kAddedEqualityDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.removed_equality_deletes, + ParseCounterResult(json, kRemovedEqualityDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.total_equality_deletes, + ParseCounterResult(json, kTotalEqualityDeletes)); + ICEBERG_ASSIGN_OR_RAISE(m.kept_manifest_count, + ParseCounterResult(json, kKeptManifestCount)); + ICEBERG_ASSIGN_OR_RAISE(m.created_manifest_count, + ParseCounterResult(json, kCreatedManifestCount)); + ICEBERG_ASSIGN_OR_RAISE(m.replaced_manifest_count, + ParseCounterResult(json, kReplacedManifestCount)); + ICEBERG_ASSIGN_OR_RAISE(m.processed_manifest_entries_count, + ParseCounterResult(json, kProcessedManifestEntriesCount)); + return m; +} + +// --------------------------------------------------------------------------- +// ScanReport +// --------------------------------------------------------------------------- + +Result ToJson(const ScanReport& report) { + nlohmann::json json; + json[kTableName] = report.table_name; + json[kSnapshotId] = report.snapshot_id; + auto filter = report.filter ? report.filter : True::Instance(); + ICEBERG_ASSIGN_OR_RAISE(auto filter_json, ToJson(*filter)); + json[kFilter] = std::move(filter_json); + json[kSchemaId] = report.schema_id; + json[kProjectedFieldIds] = report.projected_field_ids; + json[kProjectedFieldNames] = report.projected_field_names; + ICEBERG_ASSIGN_OR_RAISE(auto metrics_json, ToJson(report.scan_metrics)); + json[kMetrics] = std::move(metrics_json); + if (!report.metadata.empty()) { + json[kMetadata] = report.metadata; + } + return json; +} + +Result ScanReportFromJson(const nlohmann::json& json) { + ScanReport report; + ICEBERG_ASSIGN_OR_RAISE(report.table_name, GetJsonValue(json, kTableName)); + ICEBERG_ASSIGN_OR_RAISE(report.snapshot_id, GetJsonValue(json, kSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE(auto filter_json, GetJsonValue(json, kFilter)); + ICEBERG_ASSIGN_OR_RAISE(report.filter, ExpressionFromJson(filter_json)); + ICEBERG_ASSIGN_OR_RAISE(report.schema_id, GetJsonValue(json, kSchemaId)); + ICEBERG_ASSIGN_OR_RAISE(report.projected_field_ids, + GetJsonValue>(json, kProjectedFieldIds)); + ICEBERG_ASSIGN_OR_RAISE( + report.projected_field_names, + GetJsonValue>(json, kProjectedFieldNames)); + ICEBERG_ASSIGN_OR_RAISE(auto metrics_json, + GetJsonValue(json, kMetrics)); + ICEBERG_ASSIGN_OR_RAISE(report.scan_metrics, ScanMetricsResultFromJson(metrics_json)); + if (json.contains(kMetadata)) { + ICEBERG_ASSIGN_OR_RAISE(report.metadata, GetJsonValue(json, kMetadata)); + } + return report; +} + +// --------------------------------------------------------------------------- +// CommitReport +// --------------------------------------------------------------------------- + +Result ToJson(const CommitReport& report) { + nlohmann::json json; + json[kTableName] = report.table_name; + json[kSnapshotId] = report.snapshot_id; + json[kSequenceNumber] = report.sequence_number; + json[kOperation] = report.operation; + ICEBERG_ASSIGN_OR_RAISE(auto metrics_json, ToJson(report.commit_metrics)); + json[kMetrics] = std::move(metrics_json); + if (!report.metadata.empty()) { + json[kMetadata] = report.metadata; + } + return json; +} + +Result CommitReportFromJson(const nlohmann::json& json) { + CommitReport report; + ICEBERG_ASSIGN_OR_RAISE(report.table_name, GetJsonValue(json, kTableName)); + ICEBERG_ASSIGN_OR_RAISE(report.snapshot_id, GetJsonValue(json, kSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE(report.sequence_number, + GetJsonValue(json, kSequenceNumber)); + ICEBERG_ASSIGN_OR_RAISE(report.operation, GetJsonValue(json, kOperation)); + ICEBERG_ASSIGN_OR_RAISE(auto metrics_json, + GetJsonValue(json, kMetrics)); + ICEBERG_ASSIGN_OR_RAISE(report.commit_metrics, + CommitMetricsResultFromJson(metrics_json)); + if (json.contains(kMetadata)) { + ICEBERG_ASSIGN_OR_RAISE(report.metadata, GetJsonValue(json, kMetadata)); + } + return report; +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/json_serde_internal.h b/src/iceberg/metrics/json_serde_internal.h new file mode 100644 index 000000000..e62a00da4 --- /dev/null +++ b/src/iceberg/metrics/json_serde_internal.h @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/metrics/json_serde.h +/// \brief JSON serialization and deserialization for metrics report types. + +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/commit_report.h" +#include "iceberg/metrics/scan_report.h" +#include "iceberg/result.h" + +namespace iceberg { + +ICEBERG_EXPORT nlohmann::json ToJson(const CounterResult& counter); +ICEBERG_EXPORT Result CounterResultFromJson(const nlohmann::json& json); + +ICEBERG_EXPORT Result ToJson(const TimerResult& timer); +ICEBERG_EXPORT Result TimerResultFromJson(const nlohmann::json& json); + +ICEBERG_EXPORT Result ToJson(const ScanMetricsResult& metrics); +ICEBERG_EXPORT Result ScanMetricsResultFromJson( + const nlohmann::json& json); + +ICEBERG_EXPORT Result ToJson(const CommitMetricsResult& metrics); +ICEBERG_EXPORT Result CommitMetricsResultFromJson( + const nlohmann::json& json); + +/// \brief Serialize a ScanReport to JSON. +/// +/// Returns Result because ScanReport.filter is an Expression whose serialization +/// is fallible. Returns an error if the filter cannot be serialized. +ICEBERG_EXPORT Result ToJson(const ScanReport& report); +ICEBERG_EXPORT Result ScanReportFromJson(const nlohmann::json& json); + +/// \brief Serialize a CommitReport to JSON. +/// +/// Returns Result because commit metrics serialization validates timer units. +ICEBERG_EXPORT Result ToJson(const CommitReport& report); +ICEBERG_EXPORT Result CommitReportFromJson(const nlohmann::json& json); + +} // namespace iceberg diff --git a/src/iceberg/metrics/meson.build b/src/iceberg/metrics/meson.build new file mode 100644 index 000000000..91aa4dab0 --- /dev/null +++ b/src/iceberg/metrics/meson.build @@ -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. + +install_headers( + [ + 'commit_report.h', + 'counter.h', + 'metrics_context.h', + 'metrics_reporter.h', + 'metrics_reporters.h', + 'metrics_types.h', + 'scan_report.h', + 'timer.h', + ], + subdir: 'iceberg/metrics', +) diff --git a/src/iceberg/metrics/metrics_context.cc b/src/iceberg/metrics/metrics_context.cc new file mode 100644 index 000000000..8bd5f6814 --- /dev/null +++ b/src/iceberg/metrics/metrics_context.cc @@ -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. + */ + +#include "iceberg/metrics/metrics_context.h" + +#include + +namespace iceberg { + +namespace { + +class NoopMetricsContext final : public MetricsContext { + public: + using MetricsContext::GetCounter; // expose the one-arg base overload + using MetricsContext::GetTimer; // expose the one-arg base overload + + std::shared_ptr GetCounter(std::string_view, CounterUnit) override { + return Counter::Noop(); + } + + std::shared_ptr GetTimer(std::string_view, TimerUnit) override { + return Timer::Noop(); + } +}; + +} // namespace + +const std::shared_ptr& MetricsContext::Noop() { + static std::shared_ptr instance = + std::make_shared(); + return instance; +} + +std::unique_ptr MetricsContext::Default() { + return std::make_unique(); +} + +std::shared_ptr DefaultMetricsContext::GetCounter( + [[maybe_unused]] std::string_view name, CounterUnit unit) { + return std::make_shared(unit); +} + +std::shared_ptr DefaultMetricsContext::GetTimer( + [[maybe_unused]] std::string_view name, TimerUnit unit) { + return std::make_shared(unit); +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/metrics_context.h b/src/iceberg/metrics/metrics_context.h new file mode 100644 index 000000000..76fe474f2 --- /dev/null +++ b/src/iceberg/metrics/metrics_context.h @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/metrics/metrics_context.h +/// \brief Factory interface for creating named Counter and Timer instances. + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/counter.h" +#include "iceberg/metrics/timer.h" + +namespace iceberg { + +/// \brief Factory for creating named Counter and Timer instances. +class ICEBERG_EXPORT MetricsContext { + public: + virtual ~MetricsContext() = default; + + /// \brief Get or create a named Counter with an explicit unit. + virtual std::shared_ptr GetCounter(std::string_view name, + CounterUnit unit) = 0; + + /// \brief Get or create a count-unit Counter by name. + /// + /// Convenience overload defaulting to CounterUnit::kCount. + std::shared_ptr GetCounter(std::string_view name) { + return GetCounter(name, CounterUnit::kCount); + } + + /// \brief Get or create a named Timer with an explicit unit. + virtual std::shared_ptr GetTimer(std::string_view name, TimerUnit unit) = 0; + + /// \brief Get or create a nanosecond-precision Timer by name. + /// + /// Convenience overload defaulting to TimerUnit::kNanoseconds. + std::shared_ptr GetTimer(std::string_view name) { + return GetTimer(name, TimerUnit::kNanoseconds); + } + + /// \brief Return the no-op MetricsContext singleton. + /// + /// All metrics returned by the no-op context are noop; nothing is allocated. + static const std::shared_ptr& Noop(); + + /// \brief Create a new DefaultMetricsContext. + static std::unique_ptr Default(); +}; + +/// \brief MetricsContext backed by DefaultCounter and DefaultTimer instances. +class ICEBERG_EXPORT DefaultMetricsContext : public MetricsContext { + public: + using MetricsContext::GetCounter; // expose the one-arg base overload + using MetricsContext::GetTimer; // expose the one-arg base overload + + std::shared_ptr GetCounter(std::string_view name, CounterUnit unit) override; + + std::shared_ptr GetTimer(std::string_view name, TimerUnit unit) override; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/metrics_reporter.h b/src/iceberg/metrics/metrics_reporter.h new file mode 100644 index 000000000..b255a95e8 --- /dev/null +++ b/src/iceberg/metrics/metrics_reporter.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/commit_report.h" +#include "iceberg/metrics/scan_report.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief The type of a metrics report. +enum class MetricsReportType { + kScanReport, + kCommitReport, +}; + +/// \brief Get the string representation of a metrics report type. +ICEBERG_EXPORT constexpr std::string_view ToString(MetricsReportType type) noexcept { + switch (type) { + case MetricsReportType::kScanReport: + return "scan"; + case MetricsReportType::kCommitReport: + return "commit"; + } + std::unreachable(); +} + +/// \brief A metrics report, which can be either a ScanReport or CommitReport. +/// +/// This variant type allows handling both report types uniformly through +/// the MetricsReporter interface. +using MetricsReport = std::variant; + +/// \brief Get the type of a metrics report. +/// +/// \param report The metrics report to get the type of. +/// \return The type of the metrics report. +ICEBERG_EXPORT inline MetricsReportType GetReportType(const MetricsReport& report) { + return std::visit( + [](const auto& r) -> MetricsReportType { + using T = std::decay_t; + if constexpr (std::is_same_v) { + return MetricsReportType::kScanReport; + } else { + return MetricsReportType::kCommitReport; + } + }, + report); +} + +/// \brief Interface for reporting metrics from Iceberg operations. +/// +/// Implementations of this interface can be used to collect and report +/// metrics about scan and commit operations. Common implementations include +/// logging reporters, metrics collectors, and the noop reporter for testing. +/// +/// Implementations must not throw. Return an error Status instead. +class ICEBERG_EXPORT MetricsReporter { + public: + virtual ~MetricsReporter() = default; + + /// \brief Initialize the reporter with catalog properties after construction. + /// + /// Called by MetricsReporters::Load() before the first Report() invocation. + /// The default implementation is a no-op. Override to perform property-based + /// setup (e.g., configure endpoints, credentials, sampling rates). + virtual Status Initialize( + [[maybe_unused]] const std::unordered_map& properties) { + return {}; + } + + /// \brief Report a metrics report. + /// + /// Implementations should handle the report according to their purpose + /// (e.g., logging, sending to a metrics service, etc.). + /// + /// \param report The metrics report to process. + virtual Status Report(const MetricsReport& report) = 0; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/metrics_reporters.cc b/src/iceberg/metrics/metrics_reporters.cc new file mode 100644 index 000000000..74653b021 --- /dev/null +++ b/src/iceberg/metrics/metrics_reporters.cc @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/metrics/metrics_reporters.h" + +#include +#include +#include + +namespace iceberg { + +namespace { + +/// \brief Extract the reporter type identifier from properties. +/// +/// Returns the value of "metrics-reporter-impl" verbatim (case-preserved), or +/// kMetricsReporterTypeNoop if the property is absent or empty. +std::string InferReporterType( + const std::unordered_map& properties) { + auto it = properties.find(std::string(kMetricsReporterImpl)); + if (it != properties.end() && !it->second.empty()) { + return it->second; + } + return std::string(kMetricsReporterTypeNoop); +} + +/// \brief Metrics reporter that does nothing. +class NoopMetricsReporter : public MetricsReporter { + public: + static Result> Make( + [[maybe_unused]] const std::unordered_map& properties) { + return std::make_unique(); + } + + Status Report([[maybe_unused]] const MetricsReport& report) override { return {}; } +}; + +template +MetricsReporterFactory MakeReporterFactory() { + return [](const std::unordered_map& props) + -> Result> { return T::Make(props); }; +} + +struct MetricsReporterRegistryState { + std::shared_mutex mtx; + std::unordered_map map; +}; + +MetricsReporterRegistryState& GetRegistry() { + static MetricsReporterRegistryState state{ + .map = {{std::string(kMetricsReporterTypeNoop), + MakeReporterFactory()}}}; + return state; +} + +} // namespace + +// --- CompositeMetricsReporter --- + +CompositeMetricsReporter::CompositeMetricsReporter( + std::unordered_set> reporters) + : reporters_(std::move(reporters)) {} + +Status CompositeMetricsReporter::Report(const MetricsReport& report) { + Status result; + for (const auto& reporter : reporters_) { + try { + if (auto s = reporter->Report(report); !s && result.has_value()) { + result = std::move(s); + } + } catch (const std::exception& ex) { + if (result.has_value()) { + result = InvalidArgument("Metrics reporter failed: {}", ex.what()); + } + } catch (...) { + if (result.has_value()) { + result = InvalidArgument("Metrics reporter failed with unknown exception"); + } + } + } + return result; +} + +const std::unordered_set>& +CompositeMetricsReporter::Reporters() const { + return reporters_; +} + +// --- MetricsReporters --- + +Status MetricsReporters::Register(std::string_view reporter_type, + MetricsReporterFactory factory) { + if (!factory) { + return InvalidArgument("Metrics reporter factory for '{}' must not be empty", + reporter_type); + } + auto& registry = GetRegistry(); + std::unique_lock lock(registry.mtx); + registry.map[std::string(reporter_type)] = std::move(factory); + return {}; +} + +Result> MetricsReporters::Load( + const std::unordered_map& properties) { + std::string reporter_type = InferReporterType(properties); + + MetricsReporterFactory factory; + { + auto& registry = GetRegistry(); + std::shared_lock lock(registry.mtx); + auto it = registry.map.find(reporter_type); + if (it == registry.map.end()) { + return InvalidArgument( + "Unknown metrics reporter type '{}'. Register a factory with " + "MetricsReporters::Register() before using this type.", + reporter_type); + } + factory = it->second; + } + + try { + ICEBERG_ASSIGN_OR_RAISE(auto reporter, factory(properties)); + if (!reporter) { + return InvalidArgument("Metrics reporter factory for '{}' returned null", + reporter_type); + } + ICEBERG_RETURN_UNEXPECTED(reporter->Initialize(properties)); + return reporter; + } catch (const std::exception& ex) { + return InvalidArgument("Metrics reporter factory for '{}' failed: {}", reporter_type, + ex.what()); + } catch (...) { + return InvalidArgument( + "Metrics reporter factory for '{}' failed with unknown exception", reporter_type); + } +} + +std::shared_ptr MetricsReporters::Combine( + std::shared_ptr first, std::shared_ptr second) { + if (!first) return second; + if (!second || first.get() == second.get()) return first; + + std::unordered_set> reporters; + + auto collect = [&reporters](const std::shared_ptr& r) { + if (auto* composite = dynamic_cast(r.get())) { + for (const auto& inner : composite->Reporters()) { + reporters.insert(inner); + } + } else { + reporters.insert(r); + } + }; + + collect(first); + collect(second); + + return std::make_shared(std::move(reporters)); +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/metrics_reporters.h b/src/iceberg/metrics/metrics_reporters.h new file mode 100644 index 000000000..a17c6a754 --- /dev/null +++ b/src/iceberg/metrics/metrics_reporters.h @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/metrics/metrics_reporters.h +/// \brief Factory for creating MetricsReporter instances. + +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/metrics_reporter.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief Property key for configuring the metrics reporter implementation. +/// +/// Set this property in catalog properties to specify which metrics reporter +/// implementation to use. The value should match a registered reporter type. +constexpr std::string_view kMetricsReporterImpl = "metrics-reporter-impl"; + +/// \brief Property value for the noop metrics reporter. +constexpr std::string_view kMetricsReporterTypeNoop = "noop"; + +/// \brief Function type for creating MetricsReporter instances. +/// +/// \param properties Configuration properties for the reporter. +/// \return A new MetricsReporter instance or an error. +using MetricsReporterFactory = std::function>( + const std::unordered_map& properties)>; + +/// \brief A MetricsReporter that delegates to multiple reporters. +/// +/// Combines several reporters so that every report is delivered to each of them. +/// Implementations must not throw; return an error Status instead. All reporters +/// receive the report regardless of individual failures. If any reporters fail, +/// the first error Status is returned. +/// +/// Use MetricsReporters::Combine() to create instances — that helper flattens +/// nested composites and deduplicates reporters by identity. +class ICEBERG_EXPORT CompositeMetricsReporter : public MetricsReporter { + public: + explicit CompositeMetricsReporter( + std::unordered_set> reporters); + + Status Report(const MetricsReport& report) override; + + /// \brief The reporters contained in this composite. + /// + /// Used by MetricsReporters::Combine() for flattening. + const std::unordered_set>& Reporters() const; + + private: + std::unordered_set> reporters_; +}; + +/// \brief Factory class for creating and managing MetricsReporter instances. +/// +/// This class provides a registry-based factory for creating MetricsReporter +/// implementations. Custom reporter implementations can be registered using +/// the Register() method. +class ICEBERG_EXPORT MetricsReporters { + public: + /// \brief Load a metrics reporter based on properties. + /// + /// This method looks up the "metrics-reporter-impl" property to determine + /// which reporter implementation to create. If not specified, returns a + /// NoopMetricsReporter. + /// + /// \param properties Configuration properties containing reporter type. + /// \return A new MetricsReporter instance or an error. + static Result> Load( + const std::unordered_map& properties); + + /// \brief Register a factory for a metrics reporter type. + /// + /// Thread-safe. Registrations can be performed at any time, including + /// concurrently with Load(). + /// + /// \param reporter_type Type identifier matched case-sensitively against the + /// value of "metrics-reporter-impl" in catalog properties, mirroring + /// Java's fully-qualified class-name lookup (e.g., "noop"). + /// \param factory Factory function that produces the reporter. + /// \return OK if the registration succeeded, or an error if the factory is invalid. + static Status Register(std::string_view reporter_type, MetricsReporterFactory factory); + + /// \brief Combine two reporters into one. + /// + /// \param first First reporter, may be nullptr. + /// \param second Second reporter, may be nullptr. + /// \return Combined reporter, or nullptr if both inputs are nullptr. + static std::shared_ptr Combine( + std::shared_ptr first, std::shared_ptr second); +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/metrics_types.h b/src/iceberg/metrics/metrics_types.h new file mode 100644 index 000000000..88fa412c4 --- /dev/null +++ b/src/iceberg/metrics/metrics_types.h @@ -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. + */ + +#pragma once + +/// \file iceberg/metrics/metrics_types.h +/// \brief Serialisable snapshot types shared across scan and commit metrics. +/// +/// CounterResult, TimerResult, and DurationNs are primitive result types used by +/// ScanMetricsResult, CommitMetricsResult, and the JSON serde layer. Defining +/// them here keeps ScanReport and CommitReport headers independent of each other. + +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/counter.h" // CounterUnit + +namespace iceberg { + +/// \brief Duration type for metrics reporting (nanosecond precision). +using DurationNs = std::chrono::nanoseconds; + +/// \brief Serialisable snapshot of a single Counter measurement. +/// +/// Carries both the unit and value. +struct ICEBERG_EXPORT CounterResult { + CounterUnit unit = CounterUnit::kCount; + int64_t value = 0; + + bool operator==(const CounterResult&) const = default; +}; + +/// \brief Serialisable snapshot of a single Timer measurement. +/// +/// Carries the unit name, recording count, and total accumulated duration. +struct ICEBERG_EXPORT TimerResult { + // Time unit name; defaults to "nanoseconds" for built-in metrics. + std::string unit{"nanoseconds"}; + int64_t count = 0; + std::chrono::nanoseconds total_duration{0}; + + bool operator==(const TimerResult&) const = default; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/scan_report.cc b/src/iceberg/metrics/scan_report.cc new file mode 100644 index 000000000..da2272234 --- /dev/null +++ b/src/iceberg/metrics/scan_report.cc @@ -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. + */ + +#include "iceberg/metrics/scan_report.h" + +namespace iceberg { + +std::unique_ptr ScanMetrics::Make(MetricsContext& context) { + auto m = std::unique_ptr(new ScanMetrics()); + m->total_planning_duration = + context.GetTimer("total-planning-duration", TimerUnit::kNanoseconds); + m->result_data_files = context.GetCounter("result-data-files"); + m->result_delete_files = context.GetCounter("result-delete-files"); + m->scanned_data_manifests = context.GetCounter("scanned-data-manifests"); + m->scanned_delete_manifests = context.GetCounter("scanned-delete-manifests"); + m->total_data_manifests = context.GetCounter("total-data-manifests"); + m->total_delete_manifests = context.GetCounter("total-delete-manifests"); + m->total_file_size_in_bytes = + context.GetCounter("total-file-size-in-bytes", CounterUnit::kBytes); + m->total_delete_file_size_in_bytes = + context.GetCounter("total-delete-file-size-in-bytes", CounterUnit::kBytes); + m->skipped_data_manifests = context.GetCounter("skipped-data-manifests"); + m->skipped_delete_manifests = context.GetCounter("skipped-delete-manifests"); + m->skipped_data_files = context.GetCounter("skipped-data-files"); + m->skipped_delete_files = context.GetCounter("skipped-delete-files"); + m->indexed_delete_files = context.GetCounter("indexed-delete-files"); + m->equality_delete_files = context.GetCounter("equality-delete-files"); + m->positional_delete_files = context.GetCounter("positional-delete-files"); + m->dvs = context.GetCounter("dvs"); + return m; +} + +std::unique_ptr ScanMetrics::Noop() { + return ScanMetrics::Make(*MetricsContext::Noop()); +} + +ScanMetricsResult ScanMetrics::ToResult() const { + ScanMetricsResult r; + auto snap = [](const std::shared_ptr& c) -> std::optional { + if (!c || c->IsNoop()) return std::nullopt; + return CounterResult{.unit = c->unit(), .value = c->value()}; + }; + + if (total_planning_duration && !total_planning_duration->IsNoop()) { + r.total_planning_duration = + TimerResult{.unit = std::string(total_planning_duration->Unit()), + .count = total_planning_duration->Count(), + .total_duration = total_planning_duration->TotalDuration()}; + } + r.result_data_files = snap(result_data_files); + r.result_delete_files = snap(result_delete_files); + r.scanned_data_manifests = snap(scanned_data_manifests); + r.scanned_delete_manifests = snap(scanned_delete_manifests); + r.total_data_manifests = snap(total_data_manifests); + r.total_delete_manifests = snap(total_delete_manifests); + r.total_file_size_in_bytes = snap(total_file_size_in_bytes); + r.total_delete_file_size_in_bytes = snap(total_delete_file_size_in_bytes); + r.skipped_data_manifests = snap(skipped_data_manifests); + r.skipped_delete_manifests = snap(skipped_delete_manifests); + r.skipped_data_files = snap(skipped_data_files); + r.skipped_delete_files = snap(skipped_delete_files); + r.indexed_delete_files = snap(indexed_delete_files); + r.equality_delete_files = snap(equality_delete_files); + r.positional_delete_files = snap(positional_delete_files); + r.dvs = snap(dvs); + return r; +} + +ScanMetricsResult ScanMetricsResult::From(const ScanMetrics& scan_metrics) { + return scan_metrics.ToResult(); +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/scan_report.h b/src/iceberg/metrics/scan_report.h new file mode 100644 index 000000000..2d81e7e8f --- /dev/null +++ b/src/iceberg/metrics/scan_report.h @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/constants.h" +#include "iceberg/expression/expression.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/metrics/metrics_context.h" +#include "iceberg/metrics/metrics_types.h" +#include "iceberg/metrics/timer.h" + +namespace iceberg { + +// Forward declaration: ScanMetrics is defined later in this header. +class ScanMetrics; + +/// \brief Immutable snapshot of scan metrics for use in ScanReport. +/// +/// Populated by ScanMetrics::ToResult() after a scan completes. +struct ICEBERG_EXPORT ScanMetricsResult { + /// \brief Total planning duration (count of recordings + accumulated nanoseconds). + std::optional total_planning_duration; + /// \brief Number of data files included in the scan result. + std::optional result_data_files; + /// \brief Number of delete files included in the scan result. + std::optional result_delete_files; + /// \brief Number of data manifests whose files were read (not skipped). + std::optional scanned_data_manifests; + /// \brief Number of delete manifests whose files were read (not skipped). + std::optional scanned_delete_manifests; + /// \brief Total number of data manifests in the snapshot. + std::optional total_data_manifests; + /// \brief Total number of delete manifests in the snapshot. + std::optional total_delete_manifests; + /// \brief Total byte size of all result data files. + std::optional total_file_size_in_bytes; + /// \brief Total byte size of all result delete files. + std::optional total_delete_file_size_in_bytes; + /// \brief Number of data manifests skipped by partition/stats pruning. + std::optional skipped_data_manifests; + /// \brief Number of delete manifests skipped by partition/stats pruning. + std::optional skipped_delete_manifests; + /// \brief Number of individual data files skipped by stats pruning. + std::optional skipped_data_files; + /// \brief Number of individual delete files skipped by stats pruning. + std::optional skipped_delete_files; + /// \brief Number of indexed delete files (positional or DV) in the result. + std::optional indexed_delete_files; + /// \brief Number of equality delete files in the result. + std::optional equality_delete_files; + /// \brief Number of positional delete files in the result. + std::optional positional_delete_files; + /// \brief Number of deletion vectors in the result. + std::optional dvs; + + bool operator==(const ScanMetricsResult&) const = default; + + /// \brief Build a ScanMetricsResult from live scan metrics. + static ScanMetricsResult From(const ScanMetrics& scan_metrics); +}; + +/// \brief Live scan metrics collected during a table scan operation. +/// +/// Holds named Counter and Timer instances obtained from a MetricsContext. +/// Call Make() at the start of a scan to obtain an instrumented instance, then +/// increment counters and start/stop the planning timer as the scan proceeds. +/// Call ToResult() at the end to obtain the serialisable ScanMetricsResult. +class ICEBERG_EXPORT ScanMetrics { + public: + /// \brief Create a ScanMetrics instance backed by the given MetricsContext. + static std::unique_ptr Make(MetricsContext& context); + + /// \brief Create a ScanMetrics instance with all-noop counters and timer. + static std::unique_ptr Noop(); + + /// \brief Snapshot current counter/timer values into a ScanMetricsResult. + ScanMetricsResult ToResult() const; + + std::shared_ptr total_planning_duration; + std::shared_ptr result_data_files; + std::shared_ptr result_delete_files; + std::shared_ptr scanned_data_manifests; + std::shared_ptr scanned_delete_manifests; + std::shared_ptr total_data_manifests; + std::shared_ptr total_delete_manifests; + std::shared_ptr total_file_size_in_bytes; + std::shared_ptr total_delete_file_size_in_bytes; + std::shared_ptr skipped_data_manifests; + std::shared_ptr skipped_delete_manifests; + std::shared_ptr skipped_data_files; + std::shared_ptr skipped_delete_files; + std::shared_ptr indexed_delete_files; + std::shared_ptr equality_delete_files; + std::shared_ptr positional_delete_files; + std::shared_ptr dvs; + + private: + ScanMetrics() = default; +}; + +/// \brief Report generated after a table scan operation. +/// +/// Contains metrics about the planning and execution of a table scan, +/// including information about manifests and data files processed. +struct ICEBERG_EXPORT ScanReport { + /// \brief The fully qualified name of the table that was scanned. + std::string table_name; + /// \brief Snapshot ID that was scanned, if available. + int64_t snapshot_id = kInvalidSnapshotId; + /// \brief Filter expression used in the scan, if any. + std::shared_ptr filter; + /// \brief Schema ID. + int32_t schema_id = kInvalidSchemaId; + /// \brief Projected field IDs from the scan schema. + std::vector projected_field_ids; + /// \brief Projected field names from the scan schema. + std::vector projected_field_names; + /// \brief Metrics collected during the scan operation. + ScanMetricsResult scan_metrics; + /// \brief Additional key-value metadata. + std::unordered_map metadata; +}; + +} // namespace iceberg diff --git a/src/iceberg/metrics/timer.cc b/src/iceberg/metrics/timer.cc new file mode 100644 index 000000000..2f45d6701 --- /dev/null +++ b/src/iceberg/metrics/timer.cc @@ -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. + */ + +#include "iceberg/metrics/timer.h" + +#include + +namespace iceberg { + +namespace { + +class NoopTimer final : public Timer { + public: + int64_t Count() const override { return -1; } + std::chrono::nanoseconds TotalDuration() const override { + return std::chrono::nanoseconds{-1}; + } + void Record(std::chrono::nanoseconds) override {} + std::string_view Unit() const override { return "undefined"; } + bool IsNoop() const override { return true; } +}; + +void RecordElapsedIfRunning(Timer* timer, std::chrono::steady_clock::time_point start, + bool& stopped) { + if (stopped) return; + stopped = true; + if (!timer) return; + auto end = std::chrono::steady_clock::now(); + timer->Record(std::chrono::duration_cast(end - start)); +} + +} // namespace + +// --- Timer::Timed --- + +Timer::Timed::Timed(Timer& timer) + : timer_(&timer), start_(std::chrono::steady_clock::now()) {} + +Timer::Timed::~Timed() { RecordElapsedIfRunning(timer_, start_, stopped_); } + +Timer::Timed::Timed(Timed&& other) noexcept + : timer_(other.timer_), start_(other.start_), stopped_(other.stopped_) { + other.timer_ = nullptr; + other.stopped_ = true; // transfer recording responsibility +} + +Timer::Timed& Timer::Timed::operator=(Timed&& other) noexcept { + if (this != &other) { + RecordElapsedIfRunning(timer_, start_, stopped_); + timer_ = other.timer_; + start_ = other.start_; + stopped_ = other.stopped_; + other.timer_ = nullptr; + other.stopped_ = true; + } + return *this; +} + +void Timer::Timed::Stop() { + if (stopped_) return; + stopped_ = true; + if (!timer_) return; + auto end = std::chrono::steady_clock::now(); + timer_->Record(std::chrono::duration_cast(end - start_)); +} + +// --- Timer --- + +Timer::Timed Timer::Start() { return Timed(*this); } + +std::shared_ptr Timer::Noop() { + static std::shared_ptr instance = std::make_shared(); + return instance; +} + +// --- DefaultTimer --- + +DefaultTimer::DefaultTimer(TimerUnit unit) : unit_(unit) {} + +int64_t DefaultTimer::Count() const { return count_.load(std::memory_order_relaxed); } + +std::chrono::nanoseconds DefaultTimer::TotalDuration() const { + return std::chrono::nanoseconds{total_nanos_.load(std::memory_order_relaxed)}; +} + +void DefaultTimer::Record(std::chrono::nanoseconds duration) { + if (duration.count() < 0) return; + count_.fetch_add(1, std::memory_order_relaxed); + total_nanos_.fetch_add(duration.count(), std::memory_order_relaxed); +} + +} // namespace iceberg diff --git a/src/iceberg/metrics/timer.h b/src/iceberg/metrics/timer.h new file mode 100644 index 000000000..08bbf8e34 --- /dev/null +++ b/src/iceberg/metrics/timer.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" + +namespace iceberg { + +/// \brief Time units supported by Timer. +enum class TimerUnit { + kNanoseconds, + kMicroseconds, + kMilliseconds, + kSeconds, + kMinutes, + kHours, + kDays, +}; + +/// \brief String representation of a TimerUnit. +ICEBERG_EXPORT constexpr std::string_view ToString(TimerUnit unit) noexcept { + switch (unit) { + case TimerUnit::kNanoseconds: + return "nanoseconds"; + case TimerUnit::kMicroseconds: + return "microseconds"; + case TimerUnit::kMilliseconds: + return "milliseconds"; + case TimerUnit::kSeconds: + return "seconds"; + case TimerUnit::kMinutes: + return "minutes"; + case TimerUnit::kHours: + return "hours"; + case TimerUnit::kDays: + return "days"; + } + std::unreachable(); +} + +/// \brief Abstract timer for measuring operation durations. +/// +/// Use Start() to obtain a Timed RAII guard that records the elapsed duration when it +/// goes out of scope. +class ICEBERG_EXPORT Timer { + public: + /// \brief RAII guard that records elapsed time into a non-owning Timer on destruction. + class ICEBERG_EXPORT Timed { + public: + explicit Timed(Timer& timer); + ~Timed(); + + Timed(const Timed&) = delete; + Timed& operator=(const Timed&) = delete; + Timed(Timed&& other) noexcept; + Timed& operator=(Timed&& other) noexcept; + + /// \brief Explicitly stop timing and record the duration. + /// + /// Subsequent calls (including the destructor) are no-ops. + void Stop(); + + private: + Timer* timer_; + std::chrono::steady_clock::time_point start_; + bool stopped_ = false; + }; + + virtual ~Timer() = default; + + /// \brief Number of timing recordings made so far. + virtual int64_t Count() const = 0; + + /// \brief Total accumulated duration across all recordings. + virtual std::chrono::nanoseconds TotalDuration() const = 0; + + /// \brief Record a nanosecond duration directly. + /// + /// Use the template overload below to record + /// any std::chrono duration type with automatic unit conversion. + virtual void Record(std::chrono::nanoseconds duration) = 0; + + /// \brief Record a duration of any chrono type, converting to nanoseconds. + template + void Record(std::chrono::duration duration) { + Record(std::chrono::duration_cast(duration)); + } + + /// \brief Return the time unit used by this timer. + virtual std::string_view Unit() const { return "nanoseconds"; } + + /// \brief Return true if this timer is a no-op. + virtual bool IsNoop() const { return false; } + + /// \brief Start timing and return a RAII Timed guard. + /// + /// The elapsed duration is recorded into this timer when the Timed guard is + /// destroyed or Stop() is called. The caller must ensure this timer outlives + /// the returned guard. + Timed Start(); + + /// \brief Execute a callable, record its wall-clock duration, and return its result. + template + decltype(auto) Time(Callable&& fn) { + auto timed = Start(); + using ResultType = std::invoke_result_t; + if constexpr (std::is_void_v) { + std::invoke(std::forward(fn)); + } else if constexpr (std::is_reference_v) { + return std::invoke(std::forward(fn)); + } else { + return std::invoke(std::forward(fn)); + } + } + + /// \brief Return a shared no-op timer singleton. + static std::shared_ptr Noop(); +}; + +/// \brief Thread-safe timer backed by std::atomic. +class ICEBERG_EXPORT DefaultTimer : public Timer { + public: + explicit DefaultTimer(TimerUnit unit = TimerUnit::kNanoseconds); + + int64_t Count() const override; + std::chrono::nanoseconds TotalDuration() const override; + void Record(std::chrono::nanoseconds duration) override; + std::string_view Unit() const override { return ToString(unit_); } + + private: + std::atomic count_{0}; + std::atomic total_nanos_{0}; + TimerUnit unit_; +}; + +} // namespace iceberg diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 00b6a964b..e18b63d5c 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -86,6 +86,8 @@ add_iceberg_test(table_test SOURCES location_provider_test.cc metrics_config_test.cc + metrics_reporter_test.cc + metrics_test.cc snapshot_summary_builder_test.cc snapshot_test.cc snapshot_util_test.cc diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 9a61474e0..8d2805900 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -49,6 +49,8 @@ iceberg_tests = { 'sources': files( 'location_provider_test.cc', 'metrics_config_test.cc', + 'metrics_reporter_test.cc', + 'metrics_test.cc', 'snapshot_test.cc', 'snapshot_util_test.cc', 'table_metadata_builder_test.cc', diff --git a/src/iceberg/test/metrics_reporter_test.cc b/src/iceberg/test/metrics_reporter_test.cc new file mode 100644 index 000000000..385e20c23 --- /dev/null +++ b/src/iceberg/test/metrics_reporter_test.cc @@ -0,0 +1,356 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/metrics/metrics_reporter.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/metrics/counter.h" +#include "iceberg/metrics/metrics_reporters.h" + +namespace iceberg { + +class CollectingMetricsReporter : public MetricsReporter { + public: + static Result> Make( + [[maybe_unused]] const std::unordered_map& properties) { + return std::make_unique(); + } + + Status Report(const MetricsReport& report) override { + reports_.push_back(report); + return {}; + } + + const std::vector& reports() const { return reports_; } + + private: + std::vector reports_; +}; + +TEST(CustomMetricsReporterTest, RegisterAndLoad) { + // Register custom reporter + auto status = MetricsReporters::Register( + "collecting", + [](const std::unordered_map& props) + -> Result> { + return CollectingMetricsReporter::Make(props); + }); + ASSERT_TRUE(status.has_value()); + + // Load the custom reporter + std::unordered_map properties = { + {std::string(kMetricsReporterImpl), "collecting"}}; + auto result = MetricsReporters::Load(properties); + + ASSERT_TRUE(result.has_value()); + ASSERT_NE(result.value(), nullptr); + + // Report and verify + auto* reporter = dynamic_cast(result.value().get()); + ASSERT_NE(reporter, nullptr); + + ScanReport scan_report{.table_name = "test.table"}; + reporter->Report(scan_report); + + EXPECT_EQ(reporter->reports().size(), 1); + EXPECT_EQ(GetReportType(reporter->reports()[0]), MetricsReportType::kScanReport); +} + +struct ReporterRegistrationParam { + std::string test_name; + std::string register_name; + std::string load_name; + bool expect_success; +}; + +class ReporterRegistrationTest + : public ::testing::TestWithParam {}; + +TEST_P(ReporterRegistrationTest, LoadsRegisteredReporter) { + const auto& param = GetParam(); + auto status = + MetricsReporters::Register(param.register_name, + [](const std::unordered_map&) + -> Result> { + return std::make_unique(); + }); + ASSERT_TRUE(status.has_value()); + + std::unordered_map props = { + {std::string(kMetricsReporterImpl), param.load_name}}; + auto result = MetricsReporters::Load(props); + EXPECT_EQ(result.has_value(), param.expect_success); +} + +INSTANTIATE_TEST_SUITE_P( + MetricsReporterRegistration, ReporterRegistrationTest, + ::testing::Values(ReporterRegistrationParam{.test_name = "ExactMatch", + .register_name = "custom1", + .load_name = "custom1", + .expect_success = true}, + ReporterRegistrationParam{.test_name = "ExactCaseMatch", + .register_name = "UPPER1", + .load_name = "UPPER1", + .expect_success = true}, + ReporterRegistrationParam{.test_name = "CaseMismatch", + .register_name = "UPPER2", + .load_name = "upper2", + .expect_success = false}, + ReporterRegistrationParam{.test_name = "UnregisteredType", + .register_name = "registered1", + .load_name = "nonexistent1", + .expect_success = false}), + [](const auto& info) { return info.param.test_name; }); + +struct VariantDispatchParam { + std::string test_name; + MetricsReport report; + MetricsReportType expected_type; +}; + +class VariantDispatchTest : public ::testing::TestWithParam {}; + +TEST_P(VariantDispatchTest, CorrectTypeDispatch) { + const auto& param = GetParam(); + EXPECT_EQ(GetReportType(param.report), param.expected_type); +} + +INSTANTIATE_TEST_SUITE_P( + MetricsReportVariant, VariantDispatchTest, + ::testing::Values( + VariantDispatchParam{.test_name = "ScanReportDefault", + .report = ScanReport{}, + .expected_type = MetricsReportType::kScanReport}, + VariantDispatchParam{.test_name = "CommitReportDefault", + .report = CommitReport{}, + .expected_type = MetricsReportType::kCommitReport}), + [](const auto& info) { return info.param.test_name; }); + +struct CollectorParam { + std::string test_name; + MetricsReport report; + MetricsReportType expected_type; + std::string expected_table_name; +}; + +class CollectorTest : public ::testing::TestWithParam {}; + +TEST_P(CollectorTest, CollectsAndPreservesReport) { + const auto& param = GetParam(); + CollectingMetricsReporter reporter; + reporter.Report(param.report); + + ASSERT_EQ(reporter.reports().size(), 1); + EXPECT_EQ(GetReportType(reporter.reports()[0]), param.expected_type); + + std::visit([&](const auto& r) { EXPECT_EQ(r.table_name, param.expected_table_name); }, + reporter.reports()[0]); +} + +INSTANTIATE_TEST_SUITE_P( + MetricsCollector, CollectorTest, + ::testing::Values( + CollectorParam{ + .test_name = "ScanWithFields", + .report = ScanReport{.table_name = "db.t1", + .snapshot_id = 1, + .scan_metrics = + ScanMetricsResult{ + .total_file_size_in_bytes = + CounterResult{.unit = CounterUnit::kBytes, + .value = 99999}}}, + .expected_type = MetricsReportType::kScanReport, + .expected_table_name = "db.t1"}, + CollectorParam{.test_name = "CommitWithFields", + .report = CommitReport{.table_name = "db.t2", + .snapshot_id = 2, + .operation = "append"}, + .expected_type = MetricsReportType::kCommitReport, + .expected_table_name = "db.t2"}), + [](const auto& info) { return info.param.test_name; }); + +// --------------------------------------------------------------------------- +// CompositeMetricsReporter / MetricsReporters::Combine tests +// --------------------------------------------------------------------------- + +class FailingMetricsReporter : public MetricsReporter { + public: + Status Report([[maybe_unused]] const MetricsReport&) override { + return InvalidArgument("reporter failed"); + } +}; + +class ThrowingMetricsReporter : public MetricsReporter { + public: + Status Report([[maybe_unused]] const MetricsReport&) override { + throw std::runtime_error("reporter threw"); + } +}; + +TEST(CombineTest, FlattenNestedComposite) { + auto a = std::make_shared(); + auto b = std::make_shared(); + auto c = std::make_shared(); + + auto ab = MetricsReporters::Combine(a, b); + auto abc = MetricsReporters::Combine(ab, c); + + // Result must be a flat composite — not a composite-of-composites. + auto* composite = dynamic_cast(abc.get()); + ASSERT_NE(composite, nullptr); + EXPECT_EQ(composite->Reporters().size(), 3u); + for (const auto& r : composite->Reporters()) { + EXPECT_EQ(dynamic_cast(r.get()), nullptr); + } + + abc->Report(CommitReport{.table_name = "db.t2"}); + EXPECT_EQ(a->reports().size(), 1u); + EXPECT_EQ(b->reports().size(), 1u); + EXPECT_EQ(c->reports().size(), 1u); +} + +TEST(CombineTest, DeduplicateByIdentity) { + auto a = std::make_shared(); + auto b = std::make_shared(); + + // ab already contains a and b; combining with b again must not add b twice. + auto ab = MetricsReporters::Combine(a, b); + auto result = MetricsReporters::Combine(ab, b); + + auto* composite = dynamic_cast(result.get()); + ASSERT_NE(composite, nullptr); + EXPECT_EQ(composite->Reporters().size(), 2u); + + result->Report(ScanReport{}); + EXPECT_EQ(a->reports().size(), 1u); + EXPECT_EQ(b->reports().size(), 1u); // delivered once, not twice +} + +TEST(CombineTest, ErrorInOneReporterDoesNotBlockOthers) { + auto failing = std::make_shared(); + auto collecting = std::make_shared(); + auto combined = MetricsReporters::Combine(failing, collecting); + + auto s = combined->Report(ScanReport{}); + EXPECT_FALSE(s.has_value()); + EXPECT_EQ(collecting->reports().size(), 1); +} + +TEST(CombineTest, ExceptionInOneReporterDoesNotBlockOthers) { + auto throwing = std::make_shared(); + auto collecting = std::make_shared(); + auto combined = MetricsReporters::Combine(throwing, collecting); + + auto s = combined->Report(ScanReport{}); + EXPECT_FALSE(s.has_value()); + EXPECT_EQ(collecting->reports().size(), 1); +} + +TEST(MetricsReportersTest, LoadDefaultReporter) { + auto result = MetricsReporters::Load({}); + ASSERT_TRUE(result.has_value()); + ASSERT_NE(result.value(), nullptr); + EXPECT_TRUE(result.value()->Report(ScanReport{}).has_value()); +} + +TEST(MetricsReportersTest, LoadExplicitNoopReporter) { + auto result = MetricsReporters::Load( + {{std::string(kMetricsReporterImpl), std::string(kMetricsReporterTypeNoop)}}); + ASSERT_TRUE(result.has_value()); + ASSERT_NE(result.value(), nullptr); + EXPECT_TRUE(result.value()->Report(ScanReport{}).has_value()); +} + +TEST(MetricsReportersTest, + EmptyFactoryReturnsErrorAndDoesNotOverrideExistingRegistration) { + auto status = MetricsReporters::Register( + "empty-factory", [](const auto&) -> Result> { + return std::make_unique(); + }); + ASSERT_TRUE(status.has_value()); + auto invalid_status = MetricsReporters::Register("empty-factory", {}); + EXPECT_FALSE(invalid_status.has_value()); + auto result = + MetricsReporters::Load({{std::string(kMetricsReporterImpl), "empty-factory"}}); + ASSERT_TRUE(result.has_value()); + EXPECT_NE(dynamic_cast(result.value().get()), nullptr); +} + +TEST(MetricsReportersTest, NullReporterFactoryReturnsError) { + auto status = MetricsReporters::Register( + "null-reporter", + [](const auto&) -> Result> { return nullptr; }); + ASSERT_TRUE(status.has_value()); + auto result = + MetricsReporters::Load({{std::string(kMetricsReporterImpl), "null-reporter"}}); + EXPECT_FALSE(result.has_value()); +} + +// Verify that Load() calls Initialize() on the created reporter. +class InitializingReporter : public MetricsReporter { + public: + static Result> Make( + [[maybe_unused]] const std::unordered_map&) { + return std::make_unique(); + } + Status Initialize(const std::unordered_map& props) override { + initialized_ = true; + init_props_ = props; + return {}; + } + Status Report([[maybe_unused]] const MetricsReport&) override { return {}; } + bool initialized() const { return initialized_; } + const std::unordered_map& init_props() const { + return init_props_; + } + + private: + bool initialized_ = false; + std::unordered_map init_props_; +}; + +TEST(MetricsReportersTest, LoadCallsInitialize) { + auto status = MetricsReporters::Register("initializing", [](const auto& props) { + return InitializingReporter::Make(props); + }); + ASSERT_TRUE(status.has_value()); + + std::unordered_map props = { + {std::string(kMetricsReporterImpl), "initializing"}, + {"custom-key", "custom-value"}, + }; + auto result = MetricsReporters::Load(props); + ASSERT_TRUE(result.has_value()); + + auto* reporter = dynamic_cast(result.value().get()); + ASSERT_NE(reporter, nullptr); + EXPECT_TRUE(reporter->initialized()); + EXPECT_EQ(reporter->init_props().at("custom-key"), "custom-value"); +} + +} // namespace iceberg diff --git a/src/iceberg/test/metrics_test.cc b/src/iceberg/test/metrics_test.cc new file mode 100644 index 000000000..43b24938b --- /dev/null +++ b/src/iceberg/test/metrics_test.cc @@ -0,0 +1,1091 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "iceberg/expression/expression.h" +#include "iceberg/metrics/commit_report.h" +#include "iceberg/metrics/counter.h" +#include "iceberg/metrics/json_serde_internal.h" +#include "iceberg/metrics/metrics_context.h" +#include "iceberg/metrics/metrics_reporter.h" +#include "iceberg/metrics/scan_report.h" +#include "iceberg/metrics/timer.h" + +namespace iceberg { + +namespace { + +int64_t DurationInUnit(std::chrono::nanoseconds duration, std::string_view unit) { + if (unit == "nanoseconds") return duration.count(); + if (unit == "microseconds") { + return std::chrono::duration_cast(duration).count(); + } + if (unit == "milliseconds") { + return std::chrono::duration_cast(duration).count(); + } + if (unit == "seconds") { + return std::chrono::duration_cast(duration).count(); + } + if (unit == "minutes") { + return std::chrono::duration_cast(duration).count(); + } + if (unit == "hours") { + return std::chrono::duration_cast(duration).count(); + } + if (unit == "days") { + return std::chrono::duration_cast(duration).count(); + } + return duration.count(); +} + +} // namespace + +// --------------------------------------------------------------------------- +// Counter +// --------------------------------------------------------------------------- + +TEST(DefaultCounterTest, IncrementByOne) { + DefaultCounter c; + EXPECT_EQ(c.value(), 0); + c.Increment(); + EXPECT_EQ(c.value(), 1); +} + +TEST(DefaultCounterTest, IncrementByAmount) { + DefaultCounter c; + c.Increment(42); + EXPECT_EQ(c.value(), 42); + c.Increment(8); + EXPECT_EQ(c.value(), 50); +} + +class DefaultCounterUnitTest : public ::testing::TestWithParam {}; + +TEST_P(DefaultCounterUnitTest, UnitRoundTrips) { + DefaultCounter c(GetParam()); + EXPECT_EQ(c.unit(), GetParam()); + EXPECT_FALSE(c.IsNoop()); + auto parsed = CounterUnitFromString(ToString(GetParam())); + ASSERT_TRUE(parsed.has_value()); + EXPECT_EQ(parsed.value(), GetParam()); +} + +INSTANTIATE_TEST_SUITE_P(Units, DefaultCounterUnitTest, + ::testing::Values(CounterUnit::kCount, CounterUnit::kBytes), + [](const auto& info) { + return info.param == CounterUnit::kCount ? "Count" : "Bytes"; + }); + +TEST(DefaultCounterUnitTest, UnknownUnitReturnsError) { + auto result = CounterUnitFromString("rows"); + EXPECT_FALSE(result.has_value()); +} + +TEST(DefaultCounterUnitTest, ParsesUnitsCaseInsensitively) { + auto count = CounterUnitFromString("COUNT"); + ASSERT_TRUE(count.has_value()); + EXPECT_EQ(count.value(), CounterUnit::kCount); + + auto bytes = CounterUnitFromString("Bytes"); + ASSERT_TRUE(bytes.has_value()); + EXPECT_EQ(bytes.value(), CounterUnit::kBytes); +} + +TEST(NoopCounterTest, IncrementIsNoop) { + auto noop = Counter::Noop(); + EXPECT_TRUE(noop->IsNoop()); + noop->Increment(); + noop->Increment(100); +} + +TEST(NoopCounterTest, AccessorsReturnSentinel) { + auto noop = Counter::Noop(); + EXPECT_EQ(noop->value(), -1); + EXPECT_EQ(noop->unit(), CounterUnit::kUndefined); +} + +// --------------------------------------------------------------------------- +// Timer +// --------------------------------------------------------------------------- + +TEST(DefaultTimerTest, RaiiRecordsOnce) { + DefaultTimer t; + EXPECT_EQ(t.Count(), 0); + { + auto timed = t.Start(); + } + EXPECT_EQ(t.Count(), 1); // RAII guard called Record() exactly once +} + +TEST(DefaultTimerTest, ExplicitStopRecordsOnce) { + DefaultTimer t; + auto timed = t.Start(); + timed.Stop(); + EXPECT_EQ(t.Count(), 1); + // Destructor must not double-record. +} + +TEST(DefaultTimerTest, RecordDirect) { + DefaultTimer t; + t.Record(std::chrono::nanoseconds{1000}); + t.Record(std::chrono::nanoseconds{500}); + EXPECT_EQ(t.Count(), 2); + EXPECT_EQ(t.TotalDuration(), std::chrono::nanoseconds{1500}); +} + +TEST(DefaultTimerTest, RejectsNegativeDuration) { + DefaultTimer t; + t.Record(std::chrono::nanoseconds{1000}); + EXPECT_NO_THROW(t.Record(std::chrono::nanoseconds{-1})); + EXPECT_EQ(t.Count(), 1); + EXPECT_EQ(t.TotalDuration(), std::chrono::nanoseconds{1000}); +} + +TEST(DefaultTimerTest, MoveDoesNotDoubleRecord) { + DefaultTimer t; + { + auto a = t.Start(); + auto b = std::move(a); // a is moved-from; destructor must not record + } // b records exactly once on destruction + EXPECT_EQ(t.Count(), 1); +} + +TEST(DefaultTimerTest, MultipleStopsAreNoop) { + DefaultTimer t; + auto timed = t.Start(); + timed.Stop(); + EXPECT_NO_THROW(timed.Stop()); + EXPECT_EQ(t.Count(), 1); +} + +TEST(NoopTimerTest, TimingIsNoop) { + auto noop = Timer::Noop(); + EXPECT_TRUE(noop->IsNoop()); + { + auto timed = noop->Start(); + } +} + +TEST(NoopTimerTest, AccessorsReturnSentinels) { + auto noop = Timer::Noop(); + EXPECT_EQ(noop->Count(), -1); + EXPECT_EQ(noop->TotalDuration(), std::chrono::nanoseconds{-1}); + EXPECT_EQ(noop->Unit(), "undefined"); +} + +TEST(DefaultTimerTest, UnitIsNanoseconds) { + DefaultTimer t; + EXPECT_EQ(t.Unit(), "nanoseconds"); +} + +TEST(DefaultTimerTest, UnitCanBeSpecified) { + DefaultTimer t(TimerUnit::kMilliseconds); + EXPECT_EQ(t.Unit(), "milliseconds"); +} + +struct DurationConversionParam { + std::string name; + std::chrono::nanoseconds input; + std::chrono::nanoseconds expected; +}; + +class DefaultTimerDurationConversionTest + : public ::testing::TestWithParam {}; + +TEST_P(DefaultTimerDurationConversionTest, RecordsAndConverts) { + DefaultTimer t; + t.Record(GetParam().input); + EXPECT_EQ(t.TotalDuration(), GetParam().expected); + EXPECT_EQ(t.Count(), 1); +} + +INSTANTIATE_TEST_SUITE_P( + DurationConversion, DefaultTimerDurationConversionTest, + ::testing::Values( + DurationConversionParam{"Microseconds", + std::chrono::duration_cast( + std::chrono::microseconds{5}), + std::chrono::nanoseconds{5000}}, + DurationConversionParam{"Milliseconds", + std::chrono::duration_cast( + std::chrono::milliseconds{2}), + std::chrono::nanoseconds{2000000}}), + [](const auto& info) { return info.param.name; }); + +TEST(DefaultTimerTest, TimeVoidCallableRecordsOnce) { + DefaultTimer t; + t.Time([&] { /* intentional no-op */ }); + // Verify the count was incremented; duration is not checked because a + // no-op body may measure as 0 ns depending on clock resolution. + EXPECT_EQ(t.Count(), 1); +} + +TEST(DefaultTimerTest, TimeNonVoidCallableReturnsResult) { + DefaultTimer t; + int result = t.Time([&] { return 42; }); + EXPECT_EQ(result, 42); + EXPECT_EQ(t.Count(), 1); + // Even for Noop callable is still invoked. + int called = 0; + Timer::Noop()->Time([&] { ++called; }); + EXPECT_EQ(called, 1); +} + +TEST(DefaultTimerTest, TimePreservesReferenceReturn) { + DefaultTimer t; + int value = 42; + int& result = t.Time([&]() -> int& { return value; }); + EXPECT_EQ(&result, &value); + result = 43; + EXPECT_EQ(value, 43); + EXPECT_EQ(t.Count(), 1); +} + +// --------------------------------------------------------------------------- +// MetricsContext +// --------------------------------------------------------------------------- + +TEST(DefaultMetricsContextTest, SameNameReturnsFreshObjects) { + DefaultMetricsContext ctx; + auto c1 = ctx.GetCounter("foo", CounterUnit::kCount); + auto c2 = ctx.GetCounter("foo", CounterUnit::kCount); + EXPECT_NE(c1.get(), c2.get()); + + auto t1 = ctx.GetTimer("dur"); + auto t2 = ctx.GetTimer("dur"); + EXPECT_NE(t1.get(), t2.get()); +} + +TEST(DefaultMetricsContextTest, DifferentNamesReturnDifferentObjects) { + DefaultMetricsContext ctx; + auto c1 = ctx.GetCounter("a", CounterUnit::kCount); + auto c2 = ctx.GetCounter("b", CounterUnit::kCount); + EXPECT_NE(c1.get(), c2.get()); +} + +TEST(DefaultMetricsContextTest, GetTimerUsesRequestedUnit) { + DefaultMetricsContext ctx; + auto timer = ctx.GetTimer("latency", TimerUnit::kSeconds); + ASSERT_NE(timer, nullptr); + EXPECT_EQ(timer->Unit(), "seconds"); +} + +TEST(NoopMetricsContextTest, ReturnsNoopInstances) { + auto noop_ctx = MetricsContext::Noop(); + EXPECT_TRUE(noop_ctx->GetCounter("x", CounterUnit::kCount)->IsNoop()); + EXPECT_TRUE(noop_ctx->GetTimer("y")->IsNoop()); +} + +TEST(NoopMetricsContextTest, ReturnsSameSharedPtrEachCall) { + // Verify the static-shared_ptr fix: no new control block per call. + auto noop_ctx = MetricsContext::Noop(); + auto c1 = noop_ctx->GetCounter("a", CounterUnit::kCount); + auto c2 = noop_ctx->GetCounter("b", CounterUnit::kCount); + EXPECT_EQ(c1.get(), c2.get()); // same noop singleton + auto t1 = noop_ctx->GetTimer("x"); + auto t2 = noop_ctx->GetTimer("y"); + EXPECT_EQ(t1.get(), t2.get()); +} + +TEST(DefaultMetricsContextTest, OneArgGetCounterDefaultsToCount) { + DefaultMetricsContext ctx; + auto c = ctx.GetCounter("hits"); + EXPECT_NE(c, nullptr); + EXPECT_EQ(c->unit(), CounterUnit::kCount); + EXPECT_NE(ctx.GetCounter("hits").get(), c.get()); +} + +TEST(DefaultMetricsContextTest, RepeatedScanMetricsDoNotShareCounters) { + DefaultMetricsContext ctx; + auto first = ScanMetrics::Make(ctx); + first->result_data_files->Increment(5); + + auto second = ScanMetrics::Make(ctx); + auto result = second->ToResult(); + ASSERT_TRUE(result.result_data_files.has_value()); + EXPECT_EQ(result.result_data_files->value, 0); +} + +// --------------------------------------------------------------------------- +// ScanMetrics +// --------------------------------------------------------------------------- + +TEST(ScanMetricsTest, MakePopulatesResult) { + DefaultMetricsContext ctx; + auto m = ScanMetrics::Make(ctx); + m->result_data_files->Increment(5); + m->total_file_size_in_bytes->Increment(1024); + m->total_planning_duration->Record(std::chrono::nanoseconds{500}); + + auto r = m->ToResult(); + ASSERT_TRUE(r.result_data_files.has_value()); + EXPECT_EQ(r.result_data_files->value, 5); + EXPECT_EQ(r.result_data_files->unit, CounterUnit::kCount); + ASSERT_TRUE(r.total_file_size_in_bytes.has_value()); + EXPECT_EQ(r.total_file_size_in_bytes->value, 1024); + EXPECT_EQ(r.total_file_size_in_bytes->unit, CounterUnit::kBytes); + ASSERT_TRUE(r.total_planning_duration.has_value()); + EXPECT_EQ(r.total_planning_duration->count, 1); + EXPECT_EQ(r.total_planning_duration->total_duration, std::chrono::nanoseconds{500}); +} + +TEST(ScanMetricsTest, ToResultForwardsTimerUnit) { + DefaultMetricsContext ctx; + auto m = ScanMetrics::Make(ctx); + m->total_planning_duration->Record(std::chrono::nanoseconds{100}); + auto r = m->ToResult(); + ASSERT_TRUE(r.total_planning_duration.has_value()); + EXPECT_EQ(r.total_planning_duration->unit, "nanoseconds"); +} + +// --------------------------------------------------------------------------- +// CommitMetrics +// --------------------------------------------------------------------------- + +TEST(CommitMetricsTest, NoopProducesMissingMetrics) { + auto m = CommitMetrics::Noop(); + auto result = m->ToResult(); + EXPECT_FALSE(result.total_duration.has_value()); + EXPECT_FALSE(result.attempts.has_value()); +} + +TEST(CommitMetricsTest, TimerAndAttemptsPopulated) { + DefaultMetricsContext ctx; + auto m = CommitMetrics::Make(ctx); + m->total_duration->Record(std::chrono::nanoseconds{2000}); + m->attempts->Increment(3); + + auto result = m->ToResult(); + ASSERT_TRUE(result.total_duration.has_value()); + EXPECT_EQ(result.total_duration->count, 1); + EXPECT_EQ(result.total_duration->total_duration, std::chrono::nanoseconds{2000}); + ASSERT_TRUE(result.attempts.has_value()); + EXPECT_EQ(result.attempts->value, 3); + EXPECT_EQ(result.attempts->unit, CounterUnit::kCount); +} + +// --------------------------------------------------------------------------- +// JSON serde — CounterResult / TimerResult +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +// CounterResult serde — parameterized round-trip +// --------------------------------------------------------------------------- + +class CounterResultRoundTripTest : public ::testing::TestWithParam {}; + +TEST_P(CounterResultRoundTripTest, RoundTrip) { + const CounterResult original = GetParam(); + auto json = ToJson(original); + auto result = CounterResultFromJson(json); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value(), original); +} + +INSTANTIATE_TEST_SUITE_P( + CounterResultSerde, CounterResultRoundTripTest, + ::testing::Values(CounterResult{.unit = CounterUnit::kBytes, .value = 1024}, + CounterResult{.unit = CounterUnit::kCount, .value = 42}), + [](const auto& info) { + return info.param.unit == CounterUnit::kBytes ? "BytesUnit" : "CountUnit"; + }); + +class TimerResultRoundTripTest : public ::testing::TestWithParam {}; + +TEST_P(TimerResultRoundTripTest, RoundTrip) { + const auto& input = GetParam(); + auto json = ToJson(input); + ASSERT_TRUE(json.has_value()); + EXPECT_EQ(json.value()["time-unit"], input.unit); + EXPECT_EQ(json.value()["count"], input.count); + EXPECT_EQ(json.value()["total-duration"], + DurationInUnit(input.total_duration, input.unit)); + auto result = TimerResultFromJson(json.value()); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value(), input); +} + +TEST(TimerResultSerdeTest, ParsesJavaTimeUnits) { + nlohmann::json json = { + {"count", 3}, + {"time-unit", "hours"}, + {"total-duration", 10}, + }; + auto result = TimerResultFromJson(json); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value().unit, "hours"); + EXPECT_EQ(result.value().count, 3); + EXPECT_EQ(result.value().total_duration, std::chrono::hours{10}); +} + +TEST(TimerResultSerdeTest, SerializesDurationInDeclaredTimeUnit) { + TimerResult input{ + .unit = "hours", .count = 44, .total_duration = std::chrono::hours{23}}; + auto json = ToJson(input); + ASSERT_TRUE(json.has_value()); + EXPECT_EQ(json.value()["time-unit"], "hours"); + EXPECT_EQ(json.value()["count"], 44); + EXPECT_EQ(json.value()["total-duration"], 23); +} + +TEST(TimerResultSerdeTest, InvalidUnitToJsonReturnsError) { + TimerResult input{ + .unit = "fortnights", .count = 1, .total_duration = std::chrono::nanoseconds{1}}; + auto json = ToJson(input); + EXPECT_FALSE(json.has_value()); +} + +TEST(TimerResultSerdeTest, ParsesTimeUnitCaseInsensitively) { + nlohmann::json json = { + {"count", 3}, + {"time-unit", "HOURS"}, + {"total-duration", 10}, + }; + auto result = TimerResultFromJson(json); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value().unit, "hours"); + EXPECT_EQ(result.value().total_duration, std::chrono::hours{10}); +} + +INSTANTIATE_TEST_SUITE_P( + TimerResultSerde, TimerResultRoundTripTest, + ::testing::Values( + TimerResult{.count = 3, .total_duration = std::chrono::nanoseconds{9876}}, + TimerResult{.count = 2, .total_duration = std::chrono::nanoseconds{5000}}, + TimerResult{.unit = "nanoseconds", + .count = 1, + .total_duration = std::chrono::nanoseconds{999}}), + [](const auto& info) { return "Count" + std::to_string(info.param.count); }); + +// --------------------------------------------------------------------------- +// JSON serde — ScanReport / CommitReport +// --------------------------------------------------------------------------- + +TEST(ScanReportSerdeTest, RoundTrip) { + ScanReport report; + report.table_name = "cat.db.t"; + report.snapshot_id = 42; + report.schema_id = 1; + report.filter = True::Instance(); + report.scan_metrics.result_data_files = CounterResult{.value = 7}; + report.scan_metrics.total_file_size_in_bytes = + CounterResult{.unit = CounterUnit::kBytes, .value = 8192}; + report.scan_metrics.total_planning_duration = + TimerResult{.count = 1, .total_duration = std::chrono::nanoseconds{100000}}; + report.projected_field_ids = {1, 2}; + report.projected_field_names = {"id", "name"}; + + auto json_result = ToJson(report); + ASSERT_TRUE(json_result.has_value()); + EXPECT_TRUE(json_result.value().contains("filter")); + EXPECT_TRUE(json_result.value().contains("metrics")); + EXPECT_FALSE(json_result.value().contains("scan-metrics")); + auto result = ScanReportFromJson(json_result.value()); + ASSERT_TRUE(result.has_value()); + const auto& r = result.value(); + EXPECT_EQ(r.table_name, "cat.db.t"); + EXPECT_EQ(r.snapshot_id, 42); + ASSERT_TRUE(r.scan_metrics.result_data_files.has_value()); + EXPECT_EQ(r.scan_metrics.result_data_files->value, 7); + EXPECT_EQ(r.scan_metrics.result_data_files->unit, CounterUnit::kCount); + ASSERT_TRUE(r.scan_metrics.total_file_size_in_bytes.has_value()); + EXPECT_EQ(r.scan_metrics.total_file_size_in_bytes->value, 8192); + EXPECT_EQ(r.scan_metrics.total_file_size_in_bytes->unit, CounterUnit::kBytes); + ASSERT_TRUE(r.scan_metrics.total_planning_duration.has_value()); + EXPECT_EQ(r.scan_metrics.total_planning_duration->count, 1); + EXPECT_EQ(r.scan_metrics.total_planning_duration->total_duration, + std::chrono::nanoseconds{100000}); + EXPECT_EQ(r.projected_field_ids, (std::vector{1, 2})); +} + +TEST(ScanReportSerdeTest, RoundTripWithAlwaysTrueFilter) { + ScanReport report; + report.table_name = "db.t"; + report.snapshot_id = 1; + report.filter = True::Instance(); + report.schema_id = 4; + + auto json_result = ToJson(report); + ASSERT_TRUE(json_result.has_value()); + EXPECT_TRUE(json_result.value().contains("projected-field-ids")); + EXPECT_TRUE(json_result.value().contains("projected-field-names")); + auto result = ScanReportFromJson(json_result.value()); + ASSERT_TRUE(result.has_value()); + ASSERT_NE(result.value().filter, nullptr); + EXPECT_EQ(result.value().filter->op(), Expression::Operation::kTrue); +} + +TEST(ScanReportSerdeTest, DefaultsMissingFilterToAlwaysTrueOnWrite) { + ScanReport report; + report.table_name = "db.t"; + report.snapshot_id = 1; + report.schema_id = 4; + + auto json_result = ToJson(report); + ASSERT_TRUE(json_result.has_value()); + ASSERT_TRUE(json_result.value().contains("filter")); + EXPECT_TRUE(json_result.value()["filter"].is_boolean()); + EXPECT_TRUE(json_result.value()["filter"].get()); + + auto result = ScanReportFromJson(json_result.value()); + ASSERT_TRUE(result.has_value()); + ASSERT_NE(result.value().filter, nullptr); + EXPECT_EQ(result.value().filter->op(), Expression::Operation::kTrue); +} + +TEST(ScanReportSerdeTest, ParsesJavaMetricsFieldName) { + nlohmann::json json = { + {"table-name", "db.t"}, + {"snapshot-id", 1}, + {"filter", true}, + {"schema-id", 4}, + {"projected-field-ids", nlohmann::json::array()}, + {"projected-field-names", nlohmann::json::array()}, + {"metrics", nlohmann::json{{"total-planning-duration", + nlohmann::json{{"count", 1}, + {"time-unit", "nanoseconds"}, + {"total-duration", 600}}}}}, + }; + auto result = ScanReportFromJson(json); + ASSERT_TRUE(result.has_value()); + ASSERT_TRUE(result.value().scan_metrics.total_planning_duration.has_value()); + EXPECT_EQ(result.value().scan_metrics.total_planning_duration->total_duration, + std::chrono::nanoseconds{600}); +} + +TEST(ScanReportSerdeTest, MalformedProjectionReturnsError) { + nlohmann::json json = { + {"table-name", "db.t"}, + {"snapshot-id", 1}, + {"filter", true}, + {"schema-id", 4}, + {"projected-field-ids", nlohmann::json::array({"1"})}, + {"projected-field-names", nlohmann::json::array()}, + {"metrics", nlohmann::json::object()}, + }; + auto result = ScanReportFromJson(json); + EXPECT_FALSE(result.has_value()); +} + +TEST(CommitReportSerdeTest, RoundTrip) { + CommitReport report; + report.table_name = "cat.db.t"; + report.snapshot_id = 99; + report.sequence_number = 5; + report.operation = "append"; + report.commit_metrics.total_duration = + TimerResult{.count = 1, .total_duration = std::chrono::nanoseconds{200000}}; + report.commit_metrics.attempts = CounterResult{.value = 1}; + report.commit_metrics.added_data_files = CounterResult{.value = 3}; + report.commit_metrics.added_records = CounterResult{.value = 1000}; + + auto json_result = ToJson(report); + ASSERT_TRUE(json_result.has_value()); + EXPECT_TRUE(json_result.value().contains("metrics")); + EXPECT_FALSE(json_result.value().contains("commit-metrics")); + auto result = CommitReportFromJson(json_result.value()); + ASSERT_TRUE(result.has_value()); + const auto& r = result.value(); + EXPECT_EQ(r.table_name, "cat.db.t"); + EXPECT_EQ(r.snapshot_id, 99); + EXPECT_EQ(r.sequence_number, 5); + EXPECT_EQ(r.operation, "append"); + ASSERT_TRUE(r.commit_metrics.total_duration.has_value()); + EXPECT_EQ(r.commit_metrics.total_duration->count, 1); + EXPECT_EQ(r.commit_metrics.total_duration->total_duration, + std::chrono::nanoseconds{200000}); + ASSERT_TRUE(r.commit_metrics.added_data_files.has_value()); + EXPECT_EQ(r.commit_metrics.added_data_files->value, 3); + ASSERT_TRUE(r.commit_metrics.added_records.has_value()); + EXPECT_EQ(r.commit_metrics.added_records->value, 1000); +} + +// --------------------------------------------------------------------------- +// ScanMetricsResult::From +// --------------------------------------------------------------------------- + +TEST(ScanMetricsResultTest, FromDelegatesToToResult) { + DefaultMetricsContext ctx; + auto m = ScanMetrics::Make(ctx); + m->result_data_files->Increment(7); + m->total_planning_duration->Record(std::chrono::nanoseconds{12345}); + + auto via_from = ScanMetricsResult::From(*m); + auto via_to_result = m->ToResult(); + + EXPECT_EQ(via_from.result_data_files, via_to_result.result_data_files); + ASSERT_TRUE(via_from.total_planning_duration.has_value()); + ASSERT_TRUE(via_to_result.total_planning_duration.has_value()); + EXPECT_EQ(via_from.total_planning_duration->count, + via_to_result.total_planning_duration->count); + EXPECT_EQ(via_from.total_planning_duration->total_duration, + via_to_result.total_planning_duration->total_duration); +} + +// --------------------------------------------------------------------------- +// CommitMetricsResult::From +// --------------------------------------------------------------------------- + +TEST(CommitMetricsResultTest, FromWithEmptySummaryYieldsMissingFileCounts) { + DefaultMetricsContext ctx; + auto live = CommitMetrics::Make(ctx); + live->total_duration->Record(std::chrono::nanoseconds{5000}); + live->attempts->Increment(); + + auto result = CommitMetricsResult::From(*live, {}); + + ASSERT_TRUE(result.total_duration.has_value()); + EXPECT_EQ(result.total_duration->count, 1); + EXPECT_EQ(result.total_duration->total_duration, std::chrono::nanoseconds{5000}); + ASSERT_TRUE(result.attempts.has_value()); + EXPECT_EQ(result.attempts->value, 1); + EXPECT_EQ(result.attempts->unit, CounterUnit::kCount); + EXPECT_FALSE(result.added_data_files.has_value()); + EXPECT_FALSE(result.removed_data_files.has_value()); + EXPECT_FALSE(result.total_data_files.has_value()); + EXPECT_FALSE(result.added_records.has_value()); + EXPECT_FALSE(result.total_records.has_value()); + EXPECT_FALSE(result.kept_manifest_count.has_value()); + EXPECT_FALSE(result.created_manifest_count.has_value()); +} + +TEST(CommitMetricsResultTest, FromParsesSnapshotSummary) { + DefaultMetricsContext ctx; + auto live = CommitMetrics::Make(ctx); + live->total_duration->Record(std::chrono::nanoseconds{8000}); + live->attempts->Increment(2); + + std::unordered_map summary = { + {"added-data-files", "3"}, {"deleted-data-files", "1"}, + {"total-data-files", "10"}, {"added-records", "1000"}, + {"deleted-records", "200"}, {"total-records", "5000"}, + {"added-files-size", "4096"}, {"removed-files-size", "1024"}, + {"total-files-size", "20480"}, {"manifests-created", "2"}, + {"manifests-kept", "5"}, {"manifests-replaced", "1"}, + {"entries-processed", "8"}, + }; + + auto result = CommitMetricsResult::From(*live, summary); + + // Live metrics. + ASSERT_TRUE(result.total_duration.has_value()); + EXPECT_EQ(result.total_duration->count, 1); + EXPECT_EQ(result.total_duration->total_duration, std::chrono::nanoseconds{8000}); + ASSERT_TRUE(result.attempts.has_value()); + EXPECT_EQ(result.attempts->value, 2); + EXPECT_EQ(result.attempts->unit, CounterUnit::kCount); + + // Snapshot-summary fields — verify both value and unit. + ASSERT_TRUE(result.added_data_files.has_value()); + EXPECT_EQ(result.added_data_files->value, 3); + EXPECT_EQ(result.added_data_files->unit, CounterUnit::kCount); + ASSERT_TRUE(result.removed_data_files.has_value()); + EXPECT_EQ(result.removed_data_files->value, 1); + ASSERT_TRUE(result.total_data_files.has_value()); + EXPECT_EQ(result.total_data_files->value, 10); + ASSERT_TRUE(result.added_records.has_value()); + EXPECT_EQ(result.added_records->value, 1000); + ASSERT_TRUE(result.removed_records.has_value()); + EXPECT_EQ(result.removed_records->value, 200); + ASSERT_TRUE(result.total_records.has_value()); + EXPECT_EQ(result.total_records->value, 5000); + ASSERT_TRUE(result.added_files_size_bytes.has_value()); + EXPECT_EQ(result.added_files_size_bytes->value, 4096); + EXPECT_EQ(result.added_files_size_bytes->unit, CounterUnit::kBytes); + ASSERT_TRUE(result.removed_files_size_bytes.has_value()); + EXPECT_EQ(result.removed_files_size_bytes->value, 1024); + EXPECT_EQ(result.removed_files_size_bytes->unit, CounterUnit::kBytes); + ASSERT_TRUE(result.total_files_size_bytes.has_value()); + EXPECT_EQ(result.total_files_size_bytes->value, 20480); + EXPECT_EQ(result.total_files_size_bytes->unit, CounterUnit::kBytes); + ASSERT_TRUE(result.created_manifest_count.has_value()); + EXPECT_EQ(result.created_manifest_count->value, 2); + ASSERT_TRUE(result.kept_manifest_count.has_value()); + EXPECT_EQ(result.kept_manifest_count->value, 5); + ASSERT_TRUE(result.replaced_manifest_count.has_value()); + EXPECT_EQ(result.replaced_manifest_count->value, 1); + ASSERT_TRUE(result.processed_manifest_entries_count.has_value()); + EXPECT_EQ(result.processed_manifest_entries_count->value, 8); +} + +TEST(CommitMetricsResultTest, FromHandlesMissingAndUnparseableKeys) { + std::unordered_map summary = { + {"added-data-files", "not-a-number"}, + // "deleted-data-files" intentionally absent + }; + auto result = CommitMetricsResult::From(*CommitMetrics::Noop(), summary); + EXPECT_FALSE(result.added_data_files.has_value()); + EXPECT_FALSE(result.removed_data_files.has_value()); +} + +// --------------------------------------------------------------------------- +// Metrics JSON serde — CounterResult (additional cases) +// --------------------------------------------------------------------------- + +TEST(CounterResultSerdeTest, MissingUnitReturnsError) { + nlohmann::json json; + json["value"] = 7; + auto result = CounterResultFromJson(json); + EXPECT_FALSE(result.has_value()); +} + +TEST(CounterResultSerdeTest, UnknownUnitReturnsError) { + nlohmann::json json; + json["unit"] = "rows"; + json["value"] = 7; + auto result = CounterResultFromJson(json); + EXPECT_FALSE(result.has_value()); +} + +TEST(CounterResultSerdeTest, MissingValueReturnsError) { + nlohmann::json json; + json["unit"] = "count"; + // Missing "value" key — must return an error. + auto result = CounterResultFromJson(json); + EXPECT_FALSE(result.has_value()); +} + +TEST(CounterResultSerdeTest, ParsesUnitCaseInsensitively) { + nlohmann::json json; + json["unit"] = "COUNT"; + json["value"] = 7; + auto result = CounterResultFromJson(json); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value().unit, CounterUnit::kCount); +} + +// --------------------------------------------------------------------------- +// Metrics JSON serde — ScanMetricsResult +// --------------------------------------------------------------------------- + +TEST(ScanMetricsResultSerdeTest, AllFieldsRoundTrip) { + ScanMetricsResult m; + m.total_planning_duration = + TimerResult{.count = 2, .total_duration = std::chrono::nanoseconds{50000}}; + m.result_data_files = CounterResult{.unit = CounterUnit::kCount, .value = 10}; + m.result_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.scanned_data_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 5}; + m.scanned_delete_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.total_data_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 8}; + m.total_delete_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 3}; + m.total_file_size_in_bytes = + CounterResult{.unit = CounterUnit::kBytes, .value = 131072}; + m.total_delete_file_size_in_bytes = + CounterResult{.unit = CounterUnit::kBytes, .value = 4096}; + m.skipped_data_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 3}; + m.skipped_delete_manifests = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.skipped_data_files = CounterResult{.unit = CounterUnit::kCount, .value = 7}; + m.skipped_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.indexed_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 4}; + m.equality_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.positional_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.dvs = CounterResult{.unit = CounterUnit::kCount, .value = 3}; + + auto json = ToJson(m); + ASSERT_TRUE(json.has_value()); + auto result = ScanMetricsResultFromJson(json.value()); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value(), m); +} + +TEST(ScanMetricsResultSerdeTest, MissingFieldsRemainUnset) { + // JSON with only one field set; all others remain missing. + nlohmann::json json = nlohmann::json::object(); + json["result-data-files"] = nlohmann::json{{"unit", "count"}, {"value", 5}}; + + auto result = ScanMetricsResultFromJson(json); + ASSERT_TRUE(result.has_value()); + ASSERT_TRUE(result.value().result_data_files.has_value()); + EXPECT_EQ(result.value().result_data_files->value, 5); + EXPECT_FALSE(result.value().result_delete_files.has_value()); + EXPECT_FALSE(result.value().total_file_size_in_bytes.has_value()); +} + +TEST(ScanMetricsResultSerdeTest, NonObjectReturnsError) { + EXPECT_FALSE(ScanMetricsResultFromJson(nlohmann::json::array()).has_value()); + EXPECT_FALSE(ScanMetricsResultFromJson(nlohmann::json{5}).has_value()); +} + +TEST(ScanMetricsResultSerdeTest, NullMetricFieldReturnsError) { + nlohmann::json json = nlohmann::json::object(); + json["result-data-files"] = nullptr; + EXPECT_FALSE(ScanMetricsResultFromJson(json).has_value()); + + json = nlohmann::json::object(); + json["total-planning-duration"] = nullptr; + EXPECT_FALSE(ScanMetricsResultFromJson(json).has_value()); +} + +TEST(ScanMetricsResultSerdeTest, JsonKeyNamesAreKebabCase) { + ScanMetricsResult m; + m.result_data_files = CounterResult{.value = 1}; + m.total_file_size_in_bytes = CounterResult{.unit = CounterUnit::kBytes, .value = 1}; + m.total_planning_duration = + TimerResult{.count = 1, .total_duration = std::chrono::nanoseconds{1}}; + + auto json = ToJson(m); + ASSERT_TRUE(json.has_value()); + EXPECT_TRUE(json.value().contains("result-data-files")); + EXPECT_TRUE(json.value().contains("total-file-size-in-bytes")); + EXPECT_TRUE(json.value().contains("total-planning-duration")); + // Spot-check that no camelCase or snake_case keys leaked in. + EXPECT_FALSE(json.value().contains("resultDataFiles")); + EXPECT_FALSE(json.value().contains("result_data_files")); +} + +TEST(ScanMetricsResultSerdeTest, InvalidTimerUnitToJsonReturnsError) { + ScanMetricsResult m; + m.total_planning_duration = TimerResult{ + .unit = "fortnights", .count = 1, .total_duration = std::chrono::nanoseconds{1}}; + + auto json = ToJson(m); + EXPECT_FALSE(json.has_value()); +} + +// --------------------------------------------------------------------------- +// Metrics JSON serde — CommitMetricsResult +// --------------------------------------------------------------------------- + +TEST(CommitMetricsResultSerdeTest, EmptyResultProducesEmptyJsonObject) { + CommitMetricsResult empty{}; + auto json = ToJson(empty); + ASSERT_TRUE(json.has_value()); + EXPECT_TRUE(json.value().is_object()); + EXPECT_TRUE(json.value().empty()); +} + +TEST(CommitMetricsResultSerdeTest, AllFieldsRoundTrip) { + CommitMetricsResult m; + m.total_duration = + TimerResult{.count = 1, .total_duration = std::chrono::nanoseconds{1000}}; + m.attempts = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.added_data_files = CounterResult{.unit = CounterUnit::kCount, .value = 3}; + m.removed_data_files = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.total_data_files = CounterResult{.unit = CounterUnit::kCount, .value = 10}; + m.added_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.added_equality_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.added_positional_delete_files = + CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.added_dvs = CounterResult{.unit = CounterUnit::kCount, .value = 4}; + m.removed_positional_delete_files = + CounterResult{.unit = CounterUnit::kCount, .value = 0}; + m.removed_dvs = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.removed_equality_delete_files = + CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.removed_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.total_delete_files = CounterResult{.unit = CounterUnit::kCount, .value = 5}; + m.added_records = CounterResult{.unit = CounterUnit::kCount, .value = 500}; + m.removed_records = CounterResult{.unit = CounterUnit::kCount, .value = 100}; + m.total_records = CounterResult{.unit = CounterUnit::kCount, .value = 2000}; + m.added_files_size_bytes = CounterResult{.unit = CounterUnit::kBytes, .value = 8192}; + m.removed_files_size_bytes = CounterResult{.unit = CounterUnit::kBytes, .value = 1024}; + m.total_files_size_bytes = CounterResult{.unit = CounterUnit::kBytes, .value = 65536}; + m.added_positional_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 20}; + m.removed_positional_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 5}; + m.total_positional_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 50}; + m.added_equality_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 10}; + m.removed_equality_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 3}; + m.total_equality_deletes = CounterResult{.unit = CounterUnit::kCount, .value = 30}; + m.kept_manifest_count = CounterResult{.unit = CounterUnit::kCount, .value = 4}; + m.created_manifest_count = CounterResult{.unit = CounterUnit::kCount, .value = 2}; + m.replaced_manifest_count = CounterResult{.unit = CounterUnit::kCount, .value = 1}; + m.processed_manifest_entries_count = + CounterResult{.unit = CounterUnit::kCount, .value = 12}; + + auto json = ToJson(m); + ASSERT_TRUE(json.has_value()); + EXPECT_TRUE(json.value().contains("manifests-kept")); + EXPECT_TRUE(json.value().contains("manifests-created")); + EXPECT_TRUE(json.value().contains("manifests-replaced")); + EXPECT_TRUE(json.value().contains("manifest-entries-processed")); + EXPECT_FALSE(json.value().contains("kept-manifest-count")); + EXPECT_FALSE(json.value().contains("created-manifest-count")); + EXPECT_FALSE(json.value().contains("replaced-manifest-count")); + EXPECT_FALSE(json.value().contains("processed-manifest-entries-count")); + auto result = CommitMetricsResultFromJson(json.value()); + ASSERT_TRUE(result.has_value()); + EXPECT_EQ(result.value(), m); +} + +TEST(CommitMetricsResultSerdeTest, ParsesJavaManifestMetricFieldNames) { + nlohmann::json json = { + {"manifests-kept", nlohmann::json{{"unit", "count"}, {"value", 6}}}, + {"manifests-created", nlohmann::json{{"unit", "count"}, {"value", 10}}}, + {"manifests-replaced", nlohmann::json{{"unit", "count"}, {"value", 5}}}, + {"manifest-entries-processed", nlohmann::json{{"unit", "count"}, {"value", 20}}}, + }; + auto result = CommitMetricsResultFromJson(json); + ASSERT_TRUE(result.has_value()); + ASSERT_TRUE(result.value().kept_manifest_count.has_value()); + EXPECT_EQ(result.value().kept_manifest_count->value, 6); + ASSERT_TRUE(result.value().created_manifest_count.has_value()); + EXPECT_EQ(result.value().created_manifest_count->value, 10); + ASSERT_TRUE(result.value().replaced_manifest_count.has_value()); + EXPECT_EQ(result.value().replaced_manifest_count->value, 5); + ASSERT_TRUE(result.value().processed_manifest_entries_count.has_value()); + EXPECT_EQ(result.value().processed_manifest_entries_count->value, 20); +} + +TEST(CommitMetricsResultSerdeTest, ExplicitZeroValueFieldsAreSerialized) { + CommitMetricsResult m; + m.added_data_files = CounterResult{.value = 5}; + m.removed_data_files = CounterResult{.value = 0}; + auto json = ToJson(m); + ASSERT_TRUE(json.has_value()); + EXPECT_TRUE(json.value().contains("added-data-files")); + EXPECT_TRUE(json.value().contains("removed-data-files")); + EXPECT_EQ(json.value()["removed-data-files"]["value"], 0); + EXPECT_FALSE(json.value().contains("total-duration")); + EXPECT_FALSE(json.value().contains("attempts")); +} + +TEST(CommitMetricsResultSerdeTest, MissingFieldsRemainUnset) { + nlohmann::json json = nlohmann::json::object(); + json["added-data-files"] = nlohmann::json{{"unit", "count"}, {"value", 9}}; + + auto result = CommitMetricsResultFromJson(json); + ASSERT_TRUE(result.has_value()); + ASSERT_TRUE(result.value().added_data_files.has_value()); + EXPECT_EQ(result.value().added_data_files->value, 9); + EXPECT_FALSE(result.value().removed_data_files.has_value()); + EXPECT_FALSE(result.value().total_duration.has_value()); +} + +TEST(CommitMetricsResultSerdeTest, NonObjectReturnsError) { + EXPECT_FALSE(CommitMetricsResultFromJson(nlohmann::json::array()).has_value()); + EXPECT_FALSE(CommitMetricsResultFromJson(nlohmann::json{5}).has_value()); +} + +TEST(CommitMetricsResultSerdeTest, NullMetricFieldReturnsError) { + nlohmann::json json = nlohmann::json::object(); + json["added-data-files"] = nullptr; + EXPECT_FALSE(CommitMetricsResultFromJson(json).has_value()); + + json = nlohmann::json::object(); + json["total-duration"] = nullptr; + EXPECT_FALSE(CommitMetricsResultFromJson(json).has_value()); +} + +// --------------------------------------------------------------------------- +// Metrics JSON serde — CommitReport (additional cases) +// --------------------------------------------------------------------------- + +TEST(CommitReportSerdeTest, EmptyMetricsSerializedAsEmptyObject) { + CommitReport report; + report.table_name = "db.t"; + report.snapshot_id = 1; + report.sequence_number = 1; + report.operation = "append"; + auto json = ToJson(report); + ASSERT_TRUE(json.has_value()); + EXPECT_TRUE(json.value().contains("metrics")); + EXPECT_TRUE(json.value()["metrics"].empty()); +} + +TEST(CommitReportSerdeTest, InvalidTimerUnitToJsonReturnsError) { + CommitReport report; + report.table_name = "db.t"; + report.snapshot_id = 1; + report.sequence_number = 1; + report.operation = "append"; + report.commit_metrics.total_duration = TimerResult{ + .unit = "fortnights", .count = 1, .total_duration = std::chrono::nanoseconds{1}}; + + auto json = ToJson(report); + EXPECT_FALSE(json.has_value()); +} + +TEST(ScanReportSerdeTest, MetadataNullReturnsError) { + nlohmann::json json = { + {"table-name", "db.t"}, + {"snapshot-id", 1}, + {"filter", "true"}, + {"schema-id", 1}, + {"projected-field-ids", nlohmann::json::array()}, + {"projected-field-names", nlohmann::json::array()}, + {"metrics", nlohmann::json::object()}, + {"metadata", nullptr}, + }; + + EXPECT_FALSE(ScanReportFromJson(json).has_value()); +} + +TEST(CommitReportSerdeTest, MetadataNullReturnsError) { + nlohmann::json json = { + {"table-name", "db.t"}, + {"snapshot-id", 1}, + {"sequence-number", 1}, + {"operation", "append"}, + {"metrics", nlohmann::json::object()}, + {"metadata", nullptr}, + }; + + EXPECT_FALSE(CommitReportFromJson(json).has_value()); +} + +struct ReportRequiredFieldParam { + std::string name; + nlohmann::json json; + std::function has_value; +}; + +class ReportRequiredFieldTest + : public ::testing::TestWithParam {}; + +TEST_P(ReportRequiredFieldTest, MissingRequiredFieldReturnsError) { + EXPECT_FALSE(GetParam().has_value(GetParam().json)); +} + +INSTANTIATE_TEST_SUITE_P( + RequiredFields, ReportRequiredFieldTest, + ::testing::Values( + ReportRequiredFieldParam{ + "ScanMissingSnapshotId", nlohmann::json{{"table-name", "t"}}, + [](const nlohmann::json& j) { return ScanReportFromJson(j).has_value(); }}, + ReportRequiredFieldParam{ + "ScanMissingFilter", + nlohmann::json{{"table-name", "t"}, + {"snapshot-id", 1}, + {"schema-id", 1}, + {"projected-field-ids", nlohmann::json::array()}, + {"projected-field-names", nlohmann::json::array()}, + {"metrics", nlohmann::json::object()}}, + [](const nlohmann::json& j) { return ScanReportFromJson(j).has_value(); }}, + ReportRequiredFieldParam{ + "CommitMissingTableName", + nlohmann::json{{"snapshot-id", 1}, {"sequence-number", 1}}, + [](const nlohmann::json& j) { return CommitReportFromJson(j).has_value(); }}, + ReportRequiredFieldParam{ + "CommitMissingOperation", + nlohmann::json{{"table-name", "t"}, + {"snapshot-id", 1}, + {"sequence-number", 1}, + {"metrics", nlohmann::json::object()}}, + [](const nlohmann::json& j) { return CommitReportFromJson(j).has_value(); }}), + [](const auto& info) { return info.param.name; }); + +} // namespace iceberg From 945599d92e2be1e11a5f27da5ebe887e408e22d9 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Mon, 8 Jun 2026 17:37:44 +0800 Subject: [PATCH 062/151] chore: upgrade avro and remove fmt in ci script (#704) This reverts commit e97a8e84d9fa31ea15f793a009769c9d6d65e9af. --- .github/workflows/rc.yml | 7 ------- .github/workflows/s3_test.yml | 6 ------ .github/workflows/sql_catalog_test.yml | 6 ------ .github/workflows/test.yml | 5 ----- cmake_modules/IcebergThirdpartyToolchain.cmake | 2 +- 5 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index a2a85604e..fa27c99ce 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -105,13 +105,6 @@ jobs: shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev - - name: Install fmt on macOS - if: ${{ startsWith(matrix.os, 'macos') }} - shell: bash - run: | - brew install fmt - echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - - name: Verify run: | tar_gz=$(echo apache-iceberg-cpp-*.tar.gz) diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml index 415477b2f..0cf8e8b1e 100644 --- a/.github/workflows/s3_test.yml +++ b/.github/workflows/s3_test.yml @@ -75,12 +75,6 @@ jobs: run: | echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV - - name: Install fmt on macOS - if: ${{ startsWith(matrix.runs-on, 'macos') }} - shell: bash - run: | - brew install fmt - echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - name: Start MinIO shell: bash run: bash ci/scripts/start_minio.sh diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index be0837745..7d93e984d 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -80,12 +80,6 @@ jobs: run: | echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV - - name: Install dependencies on macOS - if: ${{ startsWith(matrix.runs-on, 'macos') }} - shell: bash - run: | - brew install fmt - echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - name: Install dependencies on Windows if: ${{ startsWith(matrix.runs-on, 'windows') }} shell: pwsh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea0c94204..41bdd4b97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,11 +77,6 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Install fmt - shell: bash - run: | - brew install fmt - echo "CMAKE_PREFIX_PATH=$(brew --prefix fmt):${CMAKE_PREFIX_PATH:-}" >> "${GITHUB_ENV}" - name: Build Iceberg shell: bash run: ci/scripts/build_iceberg.sh $(pwd) diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 3b4340cf5..9b5d95a7e 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -226,7 +226,7 @@ function(resolve_avro_dependency) fetchcontent_declare(avro-cpp ${FC_DECLARE_COMMON_OPTIONS} GIT_REPOSITORY ${AVRO_GIT_REPOSITORY} - GIT_TAG 11fb55500bed9fbe9af53b85112cd13887f0ce80 + GIT_TAG 997d50d312613e921598aaed30b082f9bcf9c6ea SOURCE_SUBDIR lang/c++ FIND_PACKAGE_ARGS From 9dbad3139df6fcdfc8d3f0bf6127dff9611ca9cd Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 8 Jun 2026 17:38:24 +0800 Subject: [PATCH 063/151] chore: release candidate version string (#705) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7a755ce8..b03e586b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ project(Iceberg DESCRIPTION "Iceberg C++ Project" LANGUAGES CXX) -set(ICEBERG_VERSION_SUFFIX "-SNAPSHOT") +set(ICEBERG_VERSION_SUFFIX "") set(ICEBERG_VERSION_STRING "${PROJECT_VERSION}${ICEBERG_VERSION_SUFFIX}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/iceberg/version.h.in" "${CMAKE_BINARY_DIR}/src/iceberg/version.h") From 3ca8842a4733f6513d38138c55f841b9f05f25ed Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Tue, 9 Jun 2026 16:35:26 +0800 Subject: [PATCH 064/151] build: install generated version header (#710) Install the generated iceberg/version.h with the rest of the public headers so installed packages expose the version macros. Co-authored-by: Codex --- src/iceberg/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 04a73ca4c..b641bb75e 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -224,6 +224,8 @@ add_iceberg_lib(iceberg_data ${ICEBERG_DATA_SHARED_INSTALL_INTERFACE_LIBS}) iceberg_install_all_headers(iceberg) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/version.h" + DESTINATION "${ICEBERG_INSTALL_INCLUDEDIR}/iceberg") add_subdirectory(catalog) add_subdirectory(data) From ad9b8fcf8e8717cc2a0296b70d33d786ea5a6cc4 Mon Sep 17 00:00:00 2001 From: liuxiaoyu <45345701+MisterRaindrop@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:36:59 +0800 Subject: [PATCH 065/151] feat(hive): vendor Hive 3.1 metastore + fb303 Thrift IDL (#694) Vendor the Apache Hive 3.1 standalone-metastore IDL and the fb303 helper IDL it includes into thirdparty/hive_metastore/. These files are the input for the C++ HMS client bindings, generated by a follow-up commit that invokes `thrift --gen cpp` at build time. Provenance: * hive_metastore.thrift - apache/hive @ branch-3.1, standalone-metastore * share/fb303/if/fb303.thrift - apache/thrift @ master, contrib/fb303 Both upstream files retain their Apache 2.0 license headers; only trailing whitespace and final newlines were normalized by the repository's pre-commit hooks. .github/.licenserc.yaml gains thirdparty/** to paths-ignore so the license-eye check skips the vendored tree. --- .github/.licenserc.yaml | 1 + thirdparty/hive_metastore/README.md | 49 + .../hive_metastore/hive_metastore.thrift | 2244 +++++++++++++++++ .../share/fb303/if/fb303.thrift | 113 + 4 files changed, 2407 insertions(+) create mode 100644 thirdparty/hive_metastore/README.md create mode 100644 thirdparty/hive_metastore/hive_metastore.thrift create mode 100644 thirdparty/hive_metastore/share/fb303/if/fb303.thrift diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml index dd12a876c..aeaa2f556 100644 --- a/.github/.licenserc.yaml +++ b/.github/.licenserc.yaml @@ -31,5 +31,6 @@ header: - 'requirements.txt' - 'src/iceberg/util/murmurhash3_internal.*' - 'src/iceberg/test/resources/**' + - 'thirdparty/**' comment: on-failure diff --git a/thirdparty/hive_metastore/README.md b/thirdparty/hive_metastore/README.md new file mode 100644 index 000000000..9865e4655 --- /dev/null +++ b/thirdparty/hive_metastore/README.md @@ -0,0 +1,49 @@ + + +# Vendored Hive Metastore Thrift IDL + +This directory contains vendored Thrift interface definitions used to generate +the C++ Hive Metastore (HMS) client consumed by the `iceberg_hive` library. The +files are copied verbatim from upstream Apache projects and remain under the +Apache License, Version 2.0 (see `LICENSE` in the repository root). The only +modification is the repository's pre-commit normalization (trailing whitespace +stripped, single final newline); each file retains its original upstream license +header in place. + +## Vendored sources + +Sources are pinned to immutable upstream tags and commit SHAs so the provenance +is reproducible and future updates are deterministic. + +| File | Upstream | Tag | Commit | +| --- | --- | --- | --- | +| `hive_metastore.thrift` | [apache/hive](https://github.com/apache/hive) — `standalone-metastore/src/main/thrift/hive_metastore.thrift` | `rel/release-3.1.3` | [`04c1b307d1bbd1ae268ad47dc36ca4f50c6d9cd8`](https://github.com/apache/hive/blob/04c1b307d1bbd1ae268ad47dc36ca4f50c6d9cd8/standalone-metastore/src/main/thrift/hive_metastore.thrift) | +| `share/fb303/if/fb303.thrift` | [apache/thrift](https://github.com/apache/thrift) — `contrib/fb303/if/fb303.thrift` | `v0.14.0` | [`8411e189b0af09e5baad34031555870cf692c1ad`](https://github.com/apache/thrift/blob/8411e189b0af09e5baad34031555870cf692c1ad/contrib/fb303/if/fb303.thrift) | + +`fb303.thrift` is the Facebook fb303 management service IDL, transitively +included by `hive_metastore.thrift`. It was originally developed at Facebook, +Inc. and contributed to the Apache Software Foundation under the Apache License, +Version 2.0. + +## Updating + +Keep a single vendored IDL pinned to an immutable Hive release tag or commit. +To update, re-fetch the file at the new upstream ref, refresh the table above +with the new tag and commit SHA, and re-run the pre-commit hooks. diff --git a/thirdparty/hive_metastore/hive_metastore.thrift b/thirdparty/hive_metastore/hive_metastore.thrift new file mode 100644 index 000000000..97344d9e1 --- /dev/null +++ b/thirdparty/hive_metastore/hive_metastore.thrift @@ -0,0 +1,2244 @@ +#!/usr/local/bin/thrift -java + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +# +# Thrift Service that the MetaStore is built on +# + +include "share/fb303/if/fb303.thrift" + +namespace java org.apache.hadoop.hive.metastore.api +namespace php metastore +namespace cpp Apache.Hadoop.Hive + +const string DDL_TIME = "transient_lastDdlTime" + +struct Version { + 1: string version, + 2: string comments +} + +struct FieldSchema { + 1: string name, // name of the field + 2: string type, // type of the field. primitive types defined above, specify list, map for lists & maps + 3: string comment +} + +struct SQLPrimaryKey { + 1: string table_db, // table schema + 2: string table_name, // table name + 3: string column_name, // column name + 4: i32 key_seq, // sequence number within primary key + 5: string pk_name, // primary key name + 6: bool enable_cstr, // Enable/Disable + 7: bool validate_cstr, // Validate/No validate + 8: bool rely_cstr, // Rely/No Rely + 9: optional string catName +} + +struct SQLForeignKey { + 1: string pktable_db, // primary key table schema + 2: string pktable_name, // primary key table name + 3: string pkcolumn_name, // primary key column name + 4: string fktable_db, // foreign key table schema + 5: string fktable_name, // foreign key table name + 6: string fkcolumn_name, // foreign key column name + 7: i32 key_seq, // sequence within foreign key + 8: i32 update_rule, // what happens to foreign key when parent key is updated + 9: i32 delete_rule, // what happens to foreign key when parent key is deleted + 10: string fk_name, // foreign key name + 11: string pk_name, // primary key name + 12: bool enable_cstr, // Enable/Disable + 13: bool validate_cstr, // Validate/No validate + 14: bool rely_cstr, // Rely/No Rely + 15: optional string catName +} + +struct SQLUniqueConstraint { + 1: string catName, // table catalog + 2: string table_db, // table schema + 3: string table_name, // table name + 4: string column_name, // column name + 5: i32 key_seq, // sequence number within unique constraint + 6: string uk_name, // unique key name + 7: bool enable_cstr, // Enable/Disable + 8: bool validate_cstr, // Validate/No validate + 9: bool rely_cstr, // Rely/No Rely +} + +struct SQLNotNullConstraint { + 1: string catName, // table catalog + 2: string table_db, // table schema + 3: string table_name, // table name + 4: string column_name, // column name + 5: string nn_name, // not null name + 6: bool enable_cstr, // Enable/Disable + 7: bool validate_cstr, // Validate/No validate + 8: bool rely_cstr, // Rely/No Rely +} + +struct SQLDefaultConstraint { + 1: string catName, // catalog name + 2: string table_db, // table schema + 3: string table_name, // table name + 4: string column_name, // column name + 5: string default_value,// default value + 6: string dc_name, // default name + 7: bool enable_cstr, // Enable/Disable + 8: bool validate_cstr, // Validate/No validate + 9: bool rely_cstr // Rely/No Rely +} + +struct SQLCheckConstraint { + 1: string catName, // catalog name + 2: string table_db, // table schema + 3: string table_name, // table name + 4: string column_name, // column name + 5: string check_expression,// check expression + 6: string dc_name, // default name + 7: bool enable_cstr, // Enable/Disable + 8: bool validate_cstr, // Validate/No validate + 9: bool rely_cstr // Rely/No Rely +} + +struct Type { + 1: string name, // one of the types in PrimitiveTypes or CollectionTypes or User defined types + 2: optional string type1, // object type if the name is 'list' (LIST_TYPE), key type if the name is 'map' (MAP_TYPE) + 3: optional string type2, // val type if the name is 'map' (MAP_TYPE) + 4: optional list fields // if the name is one of the user defined types +} + +enum HiveObjectType { + GLOBAL = 1, + DATABASE = 2, + TABLE = 3, + PARTITION = 4, + COLUMN = 5, +} + +enum PrincipalType { + USER = 1, + ROLE = 2, + GROUP = 3, +} + +const string HIVE_FILTER_FIELD_OWNER = "hive_filter_field_owner__" +const string HIVE_FILTER_FIELD_PARAMS = "hive_filter_field_params__" +const string HIVE_FILTER_FIELD_LAST_ACCESS = "hive_filter_field_last_access__" + +enum PartitionEventType { + LOAD_DONE = 1, +} + +// Enums for transaction and lock management +enum TxnState { + COMMITTED = 1, + ABORTED = 2, + OPEN = 3, +} + +enum LockLevel { + DB = 1, + TABLE = 2, + PARTITION = 3, +} + +enum LockState { + ACQUIRED = 1, // requester has the lock + WAITING = 2, // requester is waiting for the lock and should call checklock at a later point to see if the lock has been obtained. + ABORT = 3, // the lock has been aborted, most likely due to timeout + NOT_ACQUIRED = 4, // returned only with lockNoWait, indicates the lock was not available and was not acquired +} + +enum LockType { + SHARED_READ = 1, + SHARED_WRITE = 2, + EXCLUSIVE = 3, +} + +enum CompactionType { + MINOR = 1, + MAJOR = 2, +} + +enum GrantRevokeType { + GRANT = 1, + REVOKE = 2, +} + +enum DataOperationType { + SELECT = 1, + INSERT = 2 + UPDATE = 3, + DELETE = 4, + UNSET = 5,//this is the default to distinguish from NULL from old clients + NO_TXN = 6,//drop table, insert overwrite, etc - something non-transactional +} + +// Types of events the client can request that the metastore fire. For now just support DML operations, as the metastore knows +// about DDL operations and there's no reason for the client to request such an event. +enum EventRequestType { + INSERT = 1, + UPDATE = 2, + DELETE = 3, +} + +enum SerdeType { + HIVE = 1, + SCHEMA_REGISTRY = 2, +} + +enum SchemaType { + HIVE = 1, + AVRO = 2, +} + +enum SchemaCompatibility { + NONE = 1, + BACKWARD = 2, + FORWARD = 3, + BOTH = 4 +} + +enum SchemaValidation { + LATEST = 1, + ALL = 2 +} + +enum SchemaVersionState { + INITIATED = 1, + START_REVIEW = 2, + CHANGES_REQUIRED = 3, + REVIEWED = 4, + ENABLED = 5, + DISABLED = 6, + ARCHIVED = 7, + DELETED = 8 +} + +struct HiveObjectRef{ + 1: HiveObjectType objectType, + 2: string dbName, + 3: string objectName, + 4: list partValues, + 5: string columnName, + 6: optional string catName +} + +struct PrivilegeGrantInfo { + 1: string privilege, + 2: i32 createTime, + 3: string grantor, + 4: PrincipalType grantorType, + 5: bool grantOption, +} + +struct HiveObjectPrivilege { + 1: HiveObjectRef hiveObject, + 2: string principalName, + 3: PrincipalType principalType, + 4: PrivilegeGrantInfo grantInfo, + 5: string authorizer, +} + +struct PrivilegeBag { + 1: list privileges, +} + +struct PrincipalPrivilegeSet { + 1: map> userPrivileges, // user name -> privilege grant info + 2: map> groupPrivileges, // group name -> privilege grant info + 3: map> rolePrivileges, //role name -> privilege grant info +} + +struct GrantRevokePrivilegeRequest { + 1: GrantRevokeType requestType; + 2: PrivilegeBag privileges; + 3: optional bool revokeGrantOption; // Only for revoke request +} + +struct GrantRevokePrivilegeResponse { + 1: optional bool success; +} + +struct Role { + 1: string roleName, + 2: i32 createTime, + 3: string ownerName, +} + +// Representation of a grant for a principal to a role +struct RolePrincipalGrant { + 1: string roleName, + 2: string principalName, + 3: PrincipalType principalType, + 4: bool grantOption, + 5: i32 grantTime, + 6: string grantorName, + 7: PrincipalType grantorPrincipalType +} + +struct GetRoleGrantsForPrincipalRequest { + 1: required string principal_name, + 2: required PrincipalType principal_type +} + +struct GetRoleGrantsForPrincipalResponse { + 1: required list principalGrants; +} + +struct GetPrincipalsInRoleRequest { + 1: required string roleName; +} + +struct GetPrincipalsInRoleResponse { + 1: required list principalGrants; +} + +struct GrantRevokeRoleRequest { + 1: GrantRevokeType requestType; + 2: string roleName; + 3: string principalName; + 4: PrincipalType principalType; + 5: optional string grantor; // Needed for grant + 6: optional PrincipalType grantorType; // Needed for grant + 7: optional bool grantOption; +} + +struct GrantRevokeRoleResponse { + 1: optional bool success; +} + +struct Catalog { + 1: string name, // Name of the catalog + 2: optional string description, // description of the catalog + 3: string locationUri // default storage location. When databases are created in + // this catalog, if they do not specify a location, they will + // be placed in this location. +} + +struct CreateCatalogRequest { + 1: Catalog catalog +} + +struct AlterCatalogRequest { + 1: string name, + 2: Catalog newCat +} + +struct GetCatalogRequest { + 1: string name +} + +struct GetCatalogResponse { + 1: Catalog catalog +} + +struct GetCatalogsResponse { + 1: list names +} + +struct DropCatalogRequest { + 1: string name +} + +// namespace for tables +struct Database { + 1: string name, + 2: string description, + 3: string locationUri, + 4: map parameters, // properties associated with the database + 5: optional PrincipalPrivilegeSet privileges, + 6: optional string ownerName, + 7: optional PrincipalType ownerType, + 8: optional string catalogName +} + +// This object holds the information needed by SerDes +struct SerDeInfo { + 1: string name, // name of the serde, table name by default + 2: string serializationLib, // usually the class that implements the extractor & loader + 3: map parameters, // initialization parameters + 4: optional string description, + 5: optional string serializerClass, + 6: optional string deserializerClass, + 7: optional SerdeType serdeType +} + +// sort order of a column (column name along with asc(1)/desc(0)) +struct Order { + 1: string col, // sort column name + 2: i32 order // asc(1) or desc(0) +} + +// this object holds all the information about skewed table +struct SkewedInfo { + 1: list skewedColNames, // skewed column names + 2: list> skewedColValues, //skewed values + 3: map, string> skewedColValueLocationMaps, //skewed value to location mappings +} + +// this object holds all the information about physical storage of the data belonging to a table +struct StorageDescriptor { + 1: list cols, // required (refer to types defined above) + 2: string location, // defaults to //tablename + 3: string inputFormat, // SequenceFileInputFormat (binary) or TextInputFormat` or custom format + 4: string outputFormat, // SequenceFileOutputFormat (binary) or IgnoreKeyTextOutputFormat or custom format + 5: bool compressed, // compressed or not + 6: i32 numBuckets, // this must be specified if there are any dimension columns + 7: SerDeInfo serdeInfo, // serialization and deserialization information + 8: list bucketCols, // reducer grouping columns and clustering columns and bucketing columns` + 9: list sortCols, // sort order of the data in each bucket + 10: map parameters, // any user supplied key value hash + 11: optional SkewedInfo skewedInfo, // skewed information + 12: optional bool storedAsSubDirectories // stored as subdirectories or not +} + +// table information +struct Table { + 1: string tableName, // name of the table + 2: string dbName, // database name ('default') + 3: string owner, // owner of this table + 4: i32 createTime, // creation time of the table + 5: i32 lastAccessTime, // last access time (usually this will be filled from HDFS and shouldn't be relied on) + 6: i32 retention, // retention time + 7: StorageDescriptor sd, // storage descriptor of the table + 8: list partitionKeys, // partition keys of the table. only primitive types are supported + 9: map parameters, // to store comments or any other user level parameters + 10: string viewOriginalText, // original view text, null for non-view + 11: string viewExpandedText, // expanded view text, null for non-view + 12: string tableType, // table type enum, e.g. EXTERNAL_TABLE + 13: optional PrincipalPrivilegeSet privileges, + 14: optional bool temporary=false, + 15: optional bool rewriteEnabled, // rewrite enabled or not + 16: optional CreationMetadata creationMetadata, // only for MVs, it stores table names used and txn list at MV creation + 17: optional string catName, // Name of the catalog the table is in + 18: optional PrincipalType ownerType = PrincipalType.USER // owner type of this table (default to USER for backward compatibility) +} + +struct Partition { + 1: list values // string value is converted to appropriate partition key type + 2: string dbName, + 3: string tableName, + 4: i32 createTime, + 5: i32 lastAccessTime, + 6: StorageDescriptor sd, + 7: map parameters, + 8: optional PrincipalPrivilegeSet privileges, + 9: optional string catName +} + +struct PartitionWithoutSD { + 1: list values // string value is converted to appropriate partition key type + 2: i32 createTime, + 3: i32 lastAccessTime, + 4: string relativePath, + 5: map parameters, + 6: optional PrincipalPrivilegeSet privileges +} + +struct PartitionSpecWithSharedSD { + 1: list partitions, + 2: StorageDescriptor sd, +} + +struct PartitionListComposingSpec { + 1: list partitions +} + +struct PartitionSpec { + 1: string dbName, + 2: string tableName, + 3: string rootPath, + 4: optional PartitionSpecWithSharedSD sharedSDPartitionSpec, + 5: optional PartitionListComposingSpec partitionList, + 6: optional string catName +} + +// column statistics +struct BooleanColumnStatsData { +1: required i64 numTrues, +2: required i64 numFalses, +3: required i64 numNulls, +4: optional binary bitVectors +} + +struct DoubleColumnStatsData { +1: optional double lowValue, +2: optional double highValue, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors +} + +struct LongColumnStatsData { +1: optional i64 lowValue, +2: optional i64 highValue, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors +} + +struct StringColumnStatsData { +1: required i64 maxColLen, +2: required double avgColLen, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors +} + +struct BinaryColumnStatsData { +1: required i64 maxColLen, +2: required double avgColLen, +3: required i64 numNulls, +4: optional binary bitVectors +} + + +struct Decimal { +3: required i16 scale, // force using scale first in Decimal.compareTo +1: required binary unscaled +} + +struct DecimalColumnStatsData { +1: optional Decimal lowValue, +2: optional Decimal highValue, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors +} + +struct Date { +1: required i64 daysSinceEpoch +} + +struct DateColumnStatsData { +1: optional Date lowValue, +2: optional Date highValue, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors +} + +union ColumnStatisticsData { +1: BooleanColumnStatsData booleanStats, +2: LongColumnStatsData longStats, +3: DoubleColumnStatsData doubleStats, +4: StringColumnStatsData stringStats, +5: BinaryColumnStatsData binaryStats, +6: DecimalColumnStatsData decimalStats, +7: DateColumnStatsData dateStats +} + +struct ColumnStatisticsObj { +1: required string colName, +2: required string colType, +3: required ColumnStatisticsData statsData +} + +struct ColumnStatisticsDesc { +1: required bool isTblLevel, +2: required string dbName, +3: required string tableName, +4: optional string partName, +5: optional i64 lastAnalyzed, +6: optional string catName +} + +struct ColumnStatistics { +1: required ColumnStatisticsDesc statsDesc, +2: required list statsObj; +} + +struct AggrStats { +1: required list colStats, +2: required i64 partsFound // number of partitions for which stats were found +} + +struct SetPartitionsStatsRequest { +1: required list colStats, +2: optional bool needMerge //stats need to be merged with the existing stats +} + +// schema of the table/query results etc. +struct Schema { + // column names, types, comments + 1: list fieldSchemas, // delimiters etc + 2: map properties +} + +// Key-value store to be used with selected +// Metastore APIs (create, alter methods). +// The client can pass environment properties / configs that can be +// accessed in hooks. +struct EnvironmentContext { + 1: map properties +} + +struct PrimaryKeysRequest { + 1: required string db_name, + 2: required string tbl_name, + 3: optional string catName +} + +struct PrimaryKeysResponse { + 1: required list primaryKeys +} + +struct ForeignKeysRequest { + 1: string parent_db_name, + 2: string parent_tbl_name, + 3: string foreign_db_name, + 4: string foreign_tbl_name + 5: optional string catName // No cross catalog constraints +} + +struct ForeignKeysResponse { + 1: required list foreignKeys +} + +struct UniqueConstraintsRequest { + 1: required string catName, + 2: required string db_name, + 3: required string tbl_name, +} + +struct UniqueConstraintsResponse { + 1: required list uniqueConstraints +} + +struct NotNullConstraintsRequest { + 1: required string catName, + 2: required string db_name, + 3: required string tbl_name, +} + +struct NotNullConstraintsResponse { + 1: required list notNullConstraints +} + +struct DefaultConstraintsRequest { + 1: required string catName, + 2: required string db_name, + 3: required string tbl_name +} + +struct DefaultConstraintsResponse { + 1: required list defaultConstraints +} + +struct CheckConstraintsRequest { + 1: required string catName, + 2: required string db_name, + 3: required string tbl_name +} + +struct CheckConstraintsResponse { + 1: required list checkConstraints +} + + +struct DropConstraintRequest { + 1: required string dbname, + 2: required string tablename, + 3: required string constraintname, + 4: optional string catName +} + +struct AddPrimaryKeyRequest { + 1: required list primaryKeyCols +} + +struct AddForeignKeyRequest { + 1: required list foreignKeyCols +} + +struct AddUniqueConstraintRequest { + 1: required list uniqueConstraintCols +} + +struct AddNotNullConstraintRequest { + 1: required list notNullConstraintCols +} + +struct AddDefaultConstraintRequest { + 1: required list defaultConstraintCols +} + +struct AddCheckConstraintRequest { + 1: required list checkConstraintCols +} + +// Return type for get_partitions_by_expr +struct PartitionsByExprResult { + 1: required list partitions, + // Whether the results has any (currently, all) partitions which may or may not match + 2: required bool hasUnknownPartitions +} + +struct PartitionsByExprRequest { + 1: required string dbName, + 2: required string tblName, + 3: required binary expr, + 4: optional string defaultPartitionName, + 5: optional i16 maxParts=-1 + 6: optional string catName +} + +struct TableStatsResult { + 1: required list tableStats +} + +struct PartitionsStatsResult { + 1: required map> partStats +} + +struct TableStatsRequest { + 1: required string dbName, + 2: required string tblName, + 3: required list colNames + 4: optional string catName +} + +struct PartitionsStatsRequest { + 1: required string dbName, + 2: required string tblName, + 3: required list colNames, + 4: required list partNames, + 5: optional string catName +} + +// Return type for add_partitions_req +struct AddPartitionsResult { + 1: optional list partitions, +} + +// Request type for add_partitions_req +struct AddPartitionsRequest { + 1: required string dbName, + 2: required string tblName, + 3: required list parts, + 4: required bool ifNotExists, + 5: optional bool needResult=true, + 6: optional string catName +} + +// Return type for drop_partitions_req +struct DropPartitionsResult { + 1: optional list partitions, +} + +struct DropPartitionsExpr { + 1: required binary expr; + 2: optional i32 partArchiveLevel; +} + +union RequestPartsSpec { + 1: list names; + 2: list exprs; +} + +// Request type for drop_partitions_req +// TODO: we might want to add "bestEffort" flag; where a subset can fail +struct DropPartitionsRequest { + 1: required string dbName, + 2: required string tblName, + 3: required RequestPartsSpec parts, + 4: optional bool deleteData, + 5: optional bool ifExists=true, // currently verified on client + 6: optional bool ignoreProtection, + 7: optional EnvironmentContext environmentContext, + 8: optional bool needResult=true, + 9: optional string catName +} + +struct PartitionValuesRequest { + 1: required string dbName, + 2: required string tblName, + 3: required list partitionKeys; + 4: optional bool applyDistinct = true; + 5: optional string filter; + 6: optional list partitionOrder; + 7: optional bool ascending = true; + 8: optional i64 maxParts = -1; + 9: optional string catName +} + +struct PartitionValuesRow { + 1: required list row; +} + +struct PartitionValuesResponse { + 1: required list partitionValues; +} + +enum FunctionType { + JAVA = 1, +} + +enum ResourceType { + JAR = 1, + FILE = 2, + ARCHIVE = 3, +} + +struct ResourceUri { + 1: ResourceType resourceType, + 2: string uri, +} + +// User-defined function +struct Function { + 1: string functionName, + 2: string dbName, + 3: string className, + 4: string ownerName, + 5: PrincipalType ownerType, + 6: i32 createTime, + 7: FunctionType functionType, + 8: list resourceUris, + 9: optional string catName +} + +// Structs for transaction and locks +struct TxnInfo { + 1: required i64 id, + 2: required TxnState state, + 3: required string user, // used in 'show transactions' to help admins find who has open transactions + 4: required string hostname, // used in 'show transactions' to help admins find who has open transactions + 5: optional string agentInfo = "Unknown", + 6: optional i32 heartbeatCount=0, + 7: optional string metaInfo, + 8: optional i64 startedTime, + 9: optional i64 lastHeartbeatTime, +} + +struct GetOpenTxnsInfoResponse { + 1: required i64 txn_high_water_mark, + 2: required list open_txns, +} + +struct GetOpenTxnsResponse { + 1: required i64 txn_high_water_mark, + 2: required list open_txns, // set changed to list since 3.0 + 3: optional i64 min_open_txn, //since 1.3,2.2 + 4: required binary abortedBits, // since 3.0 +} + +struct OpenTxnRequest { + 1: required i32 num_txns, + 2: required string user, + 3: required string hostname, + 4: optional string agentInfo = "Unknown", + 5: optional string replPolicy, + 6: optional list replSrcTxnIds, +} + +struct OpenTxnsResponse { + 1: required list txn_ids, +} + +struct AbortTxnRequest { + 1: required i64 txnid, + 2: optional string replPolicy, +} + +struct AbortTxnsRequest { + 1: required list txn_ids, +} + +struct CommitTxnRequest { + 1: required i64 txnid, + 2: optional string replPolicy, +} + +struct ReplTblWriteIdStateRequest { + 1: required string validWriteIdlist, + 2: required string user, + 3: required string hostName, + 4: required string dbName, + 5: required string tableName, + 6: optional list partNames, +} + +// Request msg to get the valid write ids list for the given list of tables wrt to input validTxnList +struct GetValidWriteIdsRequest { + 1: required list fullTableNames, // Full table names of format . + 2: required string validTxnList, // Valid txn list string wrt the current txn of the caller +} + +// Valid Write ID list of one table wrt to current txn +struct TableValidWriteIds { + 1: required string fullTableName, // Full table name of format . + 2: required i64 writeIdHighWaterMark, // The highest write id valid for this table wrt given txn + 3: required list invalidWriteIds, // List of open and aborted writes ids in the table + 4: optional i64 minOpenWriteId, // Minimum write id which maps to a opened txn + 5: required binary abortedBits, // Bit array to identify the aborted write ids in invalidWriteIds list +} + +// Valid Write ID list for all the input tables wrt to current txn +struct GetValidWriteIdsResponse { + 1: required list tblValidWriteIds, +} + +// Request msg to allocate table write ids for the given list of txns +struct AllocateTableWriteIdsRequest { + 1: required string dbName, + 2: required string tableName, + // Either txnIds or replPolicy+srcTxnToWriteIdList can exist in a call. txnIds is used by normal flow and + // replPolicy+srcTxnToWriteIdList is used by replication task. + 3: optional list txnIds, + 4: optional string replPolicy, + // The list is assumed to be sorted by both txnids and write ids. The write id list is assumed to be contiguous. + 5: optional list srcTxnToWriteIdList, +} + +// Map for allocated write id against the txn for which it is allocated +struct TxnToWriteId { + 1: required i64 txnId, + 2: required i64 writeId, +} + +struct AllocateTableWriteIdsResponse { + 1: required list txnToWriteIds, +} + +struct LockComponent { + 1: required LockType type, + 2: required LockLevel level, + 3: required string dbname, + 4: optional string tablename, + 5: optional string partitionname, + 6: optional DataOperationType operationType = DataOperationType.UNSET, + 7: optional bool isTransactional = false, + 8: optional bool isDynamicPartitionWrite = false +} + +struct LockRequest { + 1: required list component, + 2: optional i64 txnid, + 3: required string user, // used in 'show locks' to help admins find who has open locks + 4: required string hostname, // used in 'show locks' to help admins find who has open locks + 5: optional string agentInfo = "Unknown", +} + +struct LockResponse { + 1: required i64 lockid, + 2: required LockState state, +} + +struct CheckLockRequest { + 1: required i64 lockid, + 2: optional i64 txnid, + 3: optional i64 elapsed_ms, +} + +struct UnlockRequest { + 1: required i64 lockid, +} + +struct ShowLocksRequest { + 1: optional string dbname, + 2: optional string tablename, + 3: optional string partname, + 4: optional bool isExtended=false, +} + +struct ShowLocksResponseElement { + 1: required i64 lockid, + 2: required string dbname, + 3: optional string tablename, + 4: optional string partname, + 5: required LockState state, + 6: required LockType type, + 7: optional i64 txnid, + 8: required i64 lastheartbeat, + 9: optional i64 acquiredat, + 10: required string user, + 11: required string hostname, + 12: optional i32 heartbeatCount = 0, + 13: optional string agentInfo, + 14: optional i64 blockedByExtId, + 15: optional i64 blockedByIntId, + 16: optional i64 lockIdInternal, +} + +struct ShowLocksResponse { + 1: list locks, +} + +struct HeartbeatRequest { + 1: optional i64 lockid, + 2: optional i64 txnid +} + +struct HeartbeatTxnRangeRequest { + 1: required i64 min, + 2: required i64 max +} + +struct HeartbeatTxnRangeResponse { + 1: required set aborted, + 2: required set nosuch +} + +struct CompactionRequest { + 1: required string dbname, + 2: required string tablename, + 3: optional string partitionname, + 4: required CompactionType type, + 5: optional string runas, + 6: optional map properties +} + +struct CompactionResponse { + 1: required i64 id, + 2: required string state, + 3: required bool accepted +} + +struct ShowCompactRequest { +} + +struct ShowCompactResponseElement { + 1: required string dbname, + 2: required string tablename, + 3: optional string partitionname, + 4: required CompactionType type, + 5: required string state, + 6: optional string workerid, + 7: optional i64 start, + 8: optional string runAs, + 9: optional i64 hightestTxnId, // Highest Txn ID handled by this compaction + 10: optional string metaInfo, + 11: optional i64 endTime, + 12: optional string hadoopJobId = "None", + 13: optional i64 id, +} + +struct ShowCompactResponse { + 1: required list compacts, +} + +struct AddDynamicPartitions { + 1: required i64 txnid, + 2: required i64 writeid, + 3: required string dbname, + 4: required string tablename, + 5: required list partitionnames, + 6: optional DataOperationType operationType = DataOperationType.UNSET +} + +struct BasicTxnInfo { + 1: required bool isnull, + 2: optional i64 time, + 3: optional i64 txnid, + 4: optional string dbname, + 5: optional string tablename, + 6: optional string partitionname +} + +struct CreationMetadata { + 1: required string catName + 2: required string dbName, + 3: required string tblName, + 4: required set tablesUsed, + 5: optional string validTxnList, + 6: optional i64 materializationTime +} + +struct NotificationEventRequest { + 1: required i64 lastEvent, + 2: optional i32 maxEvents, +} + +struct NotificationEvent { + 1: required i64 eventId, + 2: required i32 eventTime, + 3: required string eventType, + 4: optional string dbName, + 5: optional string tableName, + 6: required string message, + 7: optional string messageFormat, + 8: optional string catName +} + +struct NotificationEventResponse { + 1: required list events, +} + +struct CurrentNotificationEventId { + 1: required i64 eventId, +} + +struct NotificationEventsCountRequest { + 1: required i64 fromEventId, + 2: required string dbName, + 3: optional string catName +} + +struct NotificationEventsCountResponse { + 1: required i64 eventsCount, +} + +struct InsertEventRequestData { + 1: optional bool replace, + 2: required list filesAdded, + // Checksum of files (hex string of checksum byte payload) + 3: optional list filesAddedChecksum, +} + +union FireEventRequestData { + 1: InsertEventRequestData insertData +} + +struct FireEventRequest { + 1: required bool successful, + 2: required FireEventRequestData data + // dbname, tablename, and partition vals are included as optional in the top level event rather than placed in each type of + // subevent as I assume they'll be used across most event types. + 3: optional string dbName, + 4: optional string tableName, + 5: optional list partitionVals, + 6: optional string catName, +} + +struct FireEventResponse { + // NOP for now, this is just a place holder for future responses +} + +struct MetadataPpdResult { + 1: optional binary metadata, + 2: optional binary includeBitset +} + +// Return type for get_file_metadata_by_expr +struct GetFileMetadataByExprResult { + 1: required map metadata, + 2: required bool isSupported +} + +enum FileMetadataExprType { + ORC_SARG = 1 +} + + +// Request type for get_file_metadata_by_expr +struct GetFileMetadataByExprRequest { + 1: required list fileIds, + 2: required binary expr, + 3: optional bool doGetFooters, + 4: optional FileMetadataExprType type +} + +// Return type for get_file_metadata +struct GetFileMetadataResult { + 1: required map metadata, + 2: required bool isSupported +} + +// Request type for get_file_metadata +struct GetFileMetadataRequest { + 1: required list fileIds +} + +// Return type for put_file_metadata +struct PutFileMetadataResult { +} + +// Request type for put_file_metadata +struct PutFileMetadataRequest { + 1: required list fileIds, + 2: required list metadata, + 3: optional FileMetadataExprType type +} + +// Return type for clear_file_metadata +struct ClearFileMetadataResult { +} + +// Request type for clear_file_metadata +struct ClearFileMetadataRequest { + 1: required list fileIds +} + +// Return type for cache_file_metadata +struct CacheFileMetadataResult { + 1: required bool isSupported +} + +// Request type for cache_file_metadata +struct CacheFileMetadataRequest { + 1: required string dbName, + 2: required string tblName, + 3: optional string partName, + 4: optional bool isAllParts +} + +struct GetAllFunctionsResponse { + 1: optional list functions +} + +enum ClientCapability { + TEST_CAPABILITY = 1, + INSERT_ONLY_TABLES = 2 +} + + +struct ClientCapabilities { + 1: required list values +} + +struct GetTableRequest { + 1: required string dbName, + 2: required string tblName, + 3: optional ClientCapabilities capabilities, + 4: optional string catName +} + +struct GetTableResult { + 1: required Table table +} + +struct GetTablesRequest { + 1: required string dbName, + 2: optional list tblNames, + 3: optional ClientCapabilities capabilities, + 4: optional string catName +} + +struct GetTablesResult { + 1: required list
tables +} + +// Request type for cm_recycle +struct CmRecycleRequest { + 1: required string dataPath, + 2: required bool purge +} + +// Response type for cm_recycle +struct CmRecycleResponse { +} + +struct TableMeta { + 1: required string dbName; + 2: required string tableName; + 3: required string tableType; + 4: optional string comments; + 5: optional string catName; +} + +struct Materialization { + 1: required bool sourceTablesUpdateDeleteModified; +} + +// Data types for workload management. + +enum WMResourcePlanStatus { + ACTIVE = 1, + ENABLED = 2, + DISABLED = 3 +} + +enum WMPoolSchedulingPolicy { + FAIR = 1, + FIFO = 2 +} + +struct WMResourcePlan { + 1: required string name; + 2: optional WMResourcePlanStatus status; + 3: optional i32 queryParallelism; + 4: optional string defaultPoolPath; +} + +struct WMNullableResourcePlan { + 1: optional string name; + 2: optional WMResourcePlanStatus status; + 4: optional i32 queryParallelism; + 5: optional bool isSetQueryParallelism; + 6: optional string defaultPoolPath; + 7: optional bool isSetDefaultPoolPath; +} + +struct WMPool { + 1: required string resourcePlanName; + 2: required string poolPath; + 3: optional double allocFraction; + 4: optional i32 queryParallelism; + 5: optional string schedulingPolicy; +} + + +struct WMNullablePool { + 1: required string resourcePlanName; + 2: required string poolPath; + 3: optional double allocFraction; + 4: optional i32 queryParallelism; + 5: optional string schedulingPolicy; + 6: optional bool isSetSchedulingPolicy; +} + +struct WMTrigger { + 1: required string resourcePlanName; + 2: required string triggerName; + 3: optional string triggerExpression; + 4: optional string actionExpression; + 5: optional bool isInUnmanaged; +} + +struct WMMapping { + 1: required string resourcePlanName; + 2: required string entityType; + 3: required string entityName; + 4: optional string poolPath; + 5: optional i32 ordering; +} + +struct WMPoolTrigger { + 1: required string pool; + 2: required string trigger; +} + +struct WMFullResourcePlan { + 1: required WMResourcePlan plan; + 2: required list pools; + 3: optional list mappings; + 4: optional list triggers; + 5: optional list poolTriggers; +} + +// Request response for workload management API's. + +struct WMCreateResourcePlanRequest { + 1: optional WMResourcePlan resourcePlan; + 2: optional string copyFrom; +} + +struct WMCreateResourcePlanResponse { +} + +struct WMGetActiveResourcePlanRequest { +} + +struct WMGetActiveResourcePlanResponse { + 1: optional WMFullResourcePlan resourcePlan; +} + +struct WMGetResourcePlanRequest { + 1: optional string resourcePlanName; +} + +struct WMGetResourcePlanResponse { + 1: optional WMFullResourcePlan resourcePlan; +} + +struct WMGetAllResourcePlanRequest { +} + +struct WMGetAllResourcePlanResponse { + 1: optional list resourcePlans; +} + +struct WMAlterResourcePlanRequest { + 1: optional string resourcePlanName; + 2: optional WMNullableResourcePlan resourcePlan; + 3: optional bool isEnableAndActivate; + 4: optional bool isForceDeactivate; + 5: optional bool isReplace; +} + +struct WMAlterResourcePlanResponse { + 1: optional WMFullResourcePlan fullResourcePlan; +} + +struct WMValidateResourcePlanRequest { + 1: optional string resourcePlanName; +} + +struct WMValidateResourcePlanResponse { + 1: optional list errors; + 2: optional list warnings; +} + +struct WMDropResourcePlanRequest { + 1: optional string resourcePlanName; +} + +struct WMDropResourcePlanResponse { +} + +struct WMCreateTriggerRequest { + 1: optional WMTrigger trigger; +} + +struct WMCreateTriggerResponse { +} + +struct WMAlterTriggerRequest { + 1: optional WMTrigger trigger; +} + +struct WMAlterTriggerResponse { +} + +struct WMDropTriggerRequest { + 1: optional string resourcePlanName; + 2: optional string triggerName; +} + +struct WMDropTriggerResponse { +} + +struct WMGetTriggersForResourePlanRequest { + 1: optional string resourcePlanName; +} + +struct WMGetTriggersForResourePlanResponse { + 1: optional list triggers; +} + +struct WMCreatePoolRequest { + 1: optional WMPool pool; +} + +struct WMCreatePoolResponse { +} + +struct WMAlterPoolRequest { + 1: optional WMNullablePool pool; + 2: optional string poolPath; +} + +struct WMAlterPoolResponse { +} + +struct WMDropPoolRequest { + 1: optional string resourcePlanName; + 2: optional string poolPath; +} + +struct WMDropPoolResponse { +} + +struct WMCreateOrUpdateMappingRequest { + 1: optional WMMapping mapping; + 2: optional bool update; +} + +struct WMCreateOrUpdateMappingResponse { +} + +struct WMDropMappingRequest { + 1: optional WMMapping mapping; +} + +struct WMDropMappingResponse { +} + +struct WMCreateOrDropTriggerToPoolMappingRequest { + 1: optional string resourcePlanName; + 2: optional string triggerName; + 3: optional string poolPath; + 4: optional bool drop; +} + +struct WMCreateOrDropTriggerToPoolMappingResponse { +} + +// Schema objects +// Schema is already taken, so for the moment I'm calling it an ISchema for Independent Schema +struct ISchema { + 1: SchemaType schemaType, + 2: string name, + 3: string catName, + 4: string dbName, + 5: SchemaCompatibility compatibility, + 6: SchemaValidation validationLevel, + 7: bool canEvolve, + 8: optional string schemaGroup, + 9: optional string description +} + +struct ISchemaName { + 1: string catName, + 2: string dbName, + 3: string schemaName +} + +struct AlterISchemaRequest { + 1: ISchemaName name, + 3: ISchema newSchema +} + +struct SchemaVersion { + 1: ISchemaName schema, + 2: i32 version, + 3: i64 createdAt, + 4: list cols, + 5: optional SchemaVersionState state, + 6: optional string description, + 7: optional string schemaText, + 8: optional string fingerprint, + 9: optional string name, + 10: optional SerDeInfo serDe +} + +struct SchemaVersionDescriptor { + 1: ISchemaName schema, + 2: i32 version +} + +struct FindSchemasByColsRqst { + 1: optional string colName, + 2: optional string colNamespace, + 3: optional string type +} + +struct FindSchemasByColsResp { + 1: list schemaVersions +} + +struct MapSchemaVersionToSerdeRequest { + 1: SchemaVersionDescriptor schemaVersion, + 2: string serdeName +} + +struct SetSchemaVersionStateRequest { + 1: SchemaVersionDescriptor schemaVersion, + 2: SchemaVersionState state +} + +struct GetSerdeRequest { + 1: string serdeName +} + +struct RuntimeStat { + 1: optional i32 createTime, + 2: required i32 weight, + 3: required binary payload +} + +struct GetRuntimeStatsRequest { + 1: required i32 maxWeight, + 2: required i32 maxCreateTime +} + +// Exceptions. + +exception MetaException { + 1: string message +} + +exception UnknownTableException { + 1: string message +} + +exception UnknownDBException { + 1: string message +} + +exception AlreadyExistsException { + 1: string message +} + +exception InvalidPartitionException { + 1: string message +} + +exception UnknownPartitionException { + 1: string message +} + +exception InvalidObjectException { + 1: string message +} + +exception NoSuchObjectException { + 1: string message +} + +exception InvalidOperationException { + 1: string message +} + +exception ConfigValSecurityException { + 1: string message +} + +exception InvalidInputException { + 1: string message +} + +// Transaction and lock exceptions +exception NoSuchTxnException { + 1: string message +} + +exception TxnAbortedException { + 1: string message +} + +exception TxnOpenException { + 1: string message +} + +exception NoSuchLockException { + 1: string message +} + +/** +* This interface is live. +*/ +service ThriftHiveMetastore extends fb303.FacebookService +{ + string getMetaConf(1:string key) throws(1:MetaException o1) + void setMetaConf(1:string key, 2:string value) throws(1:MetaException o1) + + void create_catalog(1: CreateCatalogRequest catalog) throws (1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3: MetaException o3) + void alter_catalog(1: AlterCatalogRequest rqst) throws (1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + GetCatalogResponse get_catalog(1: GetCatalogRequest catName) throws (1:NoSuchObjectException o1, 2:MetaException o2) + GetCatalogsResponse get_catalogs() throws (1:MetaException o1) + void drop_catalog(1: DropCatalogRequest catName) throws (1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) + Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2) + void drop_database(1:string name, 2:bool deleteData, 3:bool cascade) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + list get_databases(1:string pattern) throws(1:MetaException o1) + list get_all_databases() throws(1:MetaException o1) + void alter_database(1:string dbname, 2:Database db) throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // returns the type with given name (make seperate calls for the dependent types if needed) + Type get_type(1:string name) throws(1:MetaException o1, 2:NoSuchObjectException o2) + bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) + bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2) + map get_type_all(1:string name) + throws(1:MetaException o2) + + // Gets a list of FieldSchemas describing the columns of a particular table + list get_fields(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3), + list get_fields_with_environment_context(1: string db_name, 2: string table_name, 3:EnvironmentContext environment_context) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + + // Gets a list of FieldSchemas describing both the columns and the partition keys of a particular table + list get_schema(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + list get_schema_with_environment_context(1: string db_name, 2: string table_name, 3:EnvironmentContext environment_context) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + + // create a Hive table. Following fields must be set + // tableName + // database (only 'default' for now until Hive QL supports databases) + // owner (not needed, but good to have for tracking purposes) + // sd.cols (list of field schemas) + // sd.inputFormat (SequenceFileInputFormat (binary like falcon tables or u_full) or TextInputFormat) + // sd.outputFormat (SequenceFileInputFormat (binary) or TextInputFormat) + // sd.serdeInfo.serializationLib (SerDe class name eg org.apache.hadoop.hive.serde.simple_meta.MetadataTypedColumnsetSerDe + // * See notes on DDL_TIME + void create_table(1:Table tbl) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) + void create_table_with_environment_context(1:Table tbl, + 2:EnvironmentContext environment_context) + throws (1:AlreadyExistsException o1, + 2:InvalidObjectException o2, 3:MetaException o3, + 4:NoSuchObjectException o4) + void create_table_with_constraints(1:Table tbl, 2: list primaryKeys, 3: list foreignKeys, + 4: list uniqueConstraints, 5: list notNullConstraints, + 6: list defaultConstraints, 7: list checkConstraints) + throws (1:AlreadyExistsException o1, + 2:InvalidObjectException o2, 3:MetaException o3, + 4:NoSuchObjectException o4) + void drop_constraint(1:DropConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o3) + void add_primary_key(1:AddPrimaryKeyRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void add_foreign_key(1:AddForeignKeyRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void add_unique_constraint(1:AddUniqueConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void add_not_null_constraint(1:AddNotNullConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void add_default_constraint(1:AddDefaultConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void add_check_constraint(1:AddCheckConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + // drops the table and all the partitions associated with it if the table has partitions + // delete data (including partitions) if deleteData is set to true + void drop_table(1:string dbname, 2:string name, 3:bool deleteData) + throws(1:NoSuchObjectException o1, 2:MetaException o3) + void drop_table_with_environment_context(1:string dbname, 2:string name, 3:bool deleteData, + 4:EnvironmentContext environment_context) + throws(1:NoSuchObjectException o1, 2:MetaException o3) + void truncate_table(1:string dbName, 2:string tableName, 3:list partNames) + throws(1:MetaException o1) + list get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1) + list get_tables_by_type(1: string db_name, 2: string pattern, 3: string tableType) throws (1: MetaException o1) + list get_materialized_views_for_rewriting(1: string db_name) throws (1: MetaException o1) + list get_table_meta(1: string db_patterns, 2: string tbl_patterns, 3: list tbl_types) + throws (1: MetaException o1) + list get_all_tables(1: string db_name) throws (1: MetaException o1) + + Table get_table(1:string dbname, 2:string tbl_name) + throws (1:MetaException o1, 2:NoSuchObjectException o2) + list
get_table_objects_by_name(1:string dbname, 2:list tbl_names) + GetTableResult get_table_req(1:GetTableRequest req) throws (1:MetaException o1, 2:NoSuchObjectException o2) + GetTablesResult get_table_objects_by_name_req(1:GetTablesRequest req) + throws (1:MetaException o1, 2:InvalidOperationException o2, 3:UnknownDBException o3) + Materialization get_materialization_invalidation_info(1:CreationMetadata creation_metadata, 2:string validTxnList) + throws (1:MetaException o1, 2:InvalidOperationException o2, 3:UnknownDBException o3) + void update_creation_metadata(1: string catName, 2:string dbname, 3:string tbl_name, 4:CreationMetadata creation_metadata) + throws (1:MetaException o1, 2:InvalidOperationException o2, 3:UnknownDBException o3) + + // Get a list of table names that match a filter. + // The filter operators are LIKE, <, <=, >, >=, =, <> + // + // In the filter statement, values interpreted as strings must be enclosed in quotes, + // while values interpreted as integers should not be. Strings and integers are the only + // supported value types. + // + // The currently supported key names in the filter are: + // Constants.HIVE_FILTER_FIELD_OWNER, which filters on the tables' owner's name + // and supports all filter operators + // Constants.HIVE_FILTER_FIELD_LAST_ACCESS, which filters on the last access times + // and supports all filter operators except LIKE + // Constants.HIVE_FILTER_FIELD_PARAMS, which filters on the tables' parameter keys and values + // and only supports the filter operators = and <>. + // Append the parameter key name to HIVE_FILTER_FIELD_PARAMS in the filter statement. + // For example, to filter on parameter keys called "retention", the key name in the filter + // statement should be Constants.HIVE_FILTER_FIELD_PARAMS + "retention" + // Also, = and <> only work for keys that exist + // in the tables. E.g., if you are looking for tables where key1 <> value, it will only + // look at tables that have a value for the parameter key1. + // Some example filter statements include: + // filter = Constants.HIVE_FILTER_FIELD_OWNER + " like \".*test.*\" and " + + // Constants.HIVE_FILTER_FIELD_LAST_ACCESS + " = 0"; + // filter = Constants.HIVE_FILTER_FIELD_PARAMS + "retention = \"30\" or " + + // Constants.HIVE_FILTER_FIELD_PARAMS + "retention = \"90\"" + // @param dbName + // The name of the database from which you will retrieve the table names + // @param filterType + // The type of filter + // @param filter + // The filter string + // @param max_tables + // The maximum number of tables returned + // @return A list of table names that match the desired filter + list get_table_names_by_filter(1:string dbname, 2:string filter, 3:i16 max_tables=-1) + throws (1:MetaException o1, 2:InvalidOperationException o2, 3:UnknownDBException o3) + + // alter table applies to only future partitions not for existing partitions + // * See notes on DDL_TIME + void alter_table(1:string dbname, 2:string tbl_name, 3:Table new_tbl) + throws (1:InvalidOperationException o1, 2:MetaException o2) + void alter_table_with_environment_context(1:string dbname, 2:string tbl_name, + 3:Table new_tbl, 4:EnvironmentContext environment_context) + throws (1:InvalidOperationException o1, 2:MetaException o2) + // alter table not only applies to future partitions but also cascade to existing partitions + void alter_table_with_cascade(1:string dbname, 2:string tbl_name, 3:Table new_tbl, 4:bool cascade) + throws (1:InvalidOperationException o1, 2:MetaException o2) + // the following applies to only tables that have partitions + // * See notes on DDL_TIME + Partition add_partition(1:Partition new_part) + throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition add_partition_with_environment_context(1:Partition new_part, + 2:EnvironmentContext environment_context) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, + 3:MetaException o3) + i32 add_partitions(1:list new_parts) + throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + i32 add_partitions_pspec(1:list new_parts) + throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition append_partition(1:string db_name, 2:string tbl_name, 3:list part_vals) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + AddPartitionsResult add_partitions_req(1:AddPartitionsRequest request) + throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition append_partition_with_environment_context(1:string db_name, 2:string tbl_name, + 3:list part_vals, 4:EnvironmentContext environment_context) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition append_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition append_partition_by_name_with_environment_context(1:string db_name, 2:string tbl_name, + 3:string part_name, 4:EnvironmentContext environment_context) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + bool drop_partition(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:bool deleteData) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + bool drop_partition_with_environment_context(1:string db_name, 2:string tbl_name, + 3:list part_vals, 4:bool deleteData, 5:EnvironmentContext environment_context) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + bool drop_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name, 4:bool deleteData) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + bool drop_partition_by_name_with_environment_context(1:string db_name, 2:string tbl_name, + 3:string part_name, 4:bool deleteData, 5:EnvironmentContext environment_context) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + DropPartitionsResult drop_partitions_req(1: DropPartitionsRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + Partition get_partition(1:string db_name, 2:string tbl_name, 3:list part_vals) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + Partition exchange_partition(1:map partitionSpecs, 2:string source_db, + 3:string source_table_name, 4:string dest_db, 5:string dest_table_name) + throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, + 4:InvalidInputException o4) + + list exchange_partitions(1:map partitionSpecs, 2:string source_db, + 3:string source_table_name, 4:string dest_db, 5:string dest_table_name) + throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, + 4:InvalidInputException o4) + + Partition get_partition_with_auth(1:string db_name, 2:string tbl_name, 3:list part_vals, + 4: string user_name, 5: list group_names) throws(1:MetaException o1, 2:NoSuchObjectException o2) + + Partition get_partition_by_name(1:string db_name 2:string tbl_name, 3:string part_name) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // returns all the partitions for this table in reverse chronological order. + // If max parts is given then it will return only that many. + list get_partitions(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + list get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1, + 4: string user_name, 5: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2) + + list get_partitions_pspec(1:string db_name, 2:string tbl_name, 3:i32 max_parts=-1) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + list get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + PartitionValuesResponse get_partition_values(1:PartitionValuesRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2); + + // get_partition*_ps methods allow filtering by a partial partition specification, + // as needed for dynamic partitions. The values that are not restricted should + // be empty strings. Nulls were considered (instead of "") but caused errors in + // generated Python code. The size of part_vals may be smaller than the + // number of partition columns - the unspecified values are considered the same + // as "". + list get_partitions_ps(1:string db_name 2:string tbl_name + 3:list part_vals, 4:i16 max_parts=-1) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + list get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1, + 5: string user_name, 6: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2) + + list get_partition_names_ps(1:string db_name, + 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // get the partitions matching the given partition filter + list get_partitions_by_filter(1:string db_name 2:string tbl_name + 3:string filter, 4:i16 max_parts=-1) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // List partitions as PartitionSpec instances. + list get_part_specs_by_filter(1:string db_name 2:string tbl_name + 3:string filter, 4:i32 max_parts=-1) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // get the partitions matching the given partition filter + // unlike get_partitions_by_filter, takes serialized hive expression, and with that can work + // with any filter (get_partitions_by_filter only works if the filter can be pushed down to JDOQL. + PartitionsByExprResult get_partitions_by_expr(1:PartitionsByExprRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // get the partitions matching the given partition filter + i32 get_num_partitions_by_filter(1:string db_name 2:string tbl_name 3:string filter) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // get partitions give a list of partition names + list get_partitions_by_names(1:string db_name 2:string tbl_name 3:list names) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // changes the partition to the new partition object. partition is identified from the part values + // in the new_part + // * See notes on DDL_TIME + void alter_partition(1:string db_name, 2:string tbl_name, 3:Partition new_part) + throws (1:InvalidOperationException o1, 2:MetaException o2) + + // change a list of partitions. All partitions are altered atomically and all + // prehooks are fired together followed by all post hooks + void alter_partitions(1:string db_name, 2:string tbl_name, 3:list new_parts) + throws (1:InvalidOperationException o1, 2:MetaException o2) + void alter_partitions_with_environment_context(1:string db_name, 2:string tbl_name, 3:list new_parts, 4:EnvironmentContext environment_context) throws (1:InvalidOperationException o1, 2:MetaException o2) + + void alter_partition_with_environment_context(1:string db_name, + 2:string tbl_name, 3:Partition new_part, + 4:EnvironmentContext environment_context) + throws (1:InvalidOperationException o1, 2:MetaException o2) + + // rename the old partition to the new partition object by changing old part values to the part values + // in the new_part. old partition is identified from part_vals. + // partition keys in new_part should be the same as those in old partition. + void rename_partition(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:Partition new_part) + throws (1:InvalidOperationException o1, 2:MetaException o2) + + // returns whether or not the partition name is valid based on the value of the config + // hive.metastore.partition.name.whitelist.pattern + bool partition_name_has_valid_characters(1:list part_vals, 2:bool throw_exception) + throws(1: MetaException o1) + + // gets the value of the configuration key in the metastore server. returns + // defaultValue if the key does not exist. if the configuration key does not + // begin with "hive", "mapred", or "hdfs", a ConfigValSecurityException is + // thrown. + string get_config_value(1:string name, 2:string defaultValue) + throws(1:ConfigValSecurityException o1) + + // converts a partition name into a partition values array + list partition_name_to_vals(1: string part_name) + throws(1: MetaException o1) + // converts a partition name into a partition specification (a mapping from + // the partition cols to the values) + map partition_name_to_spec(1: string part_name) + throws(1: MetaException o1) + + void markPartitionForEvent(1:string db_name, 2:string tbl_name, 3:map part_vals, + 4:PartitionEventType eventType) throws (1: MetaException o1, 2: NoSuchObjectException o2, + 3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5, + 6: InvalidPartitionException o6) + bool isPartitionMarkedForEvent(1:string db_name, 2:string tbl_name, 3:map part_vals, + 4: PartitionEventType eventType) throws (1: MetaException o1, 2:NoSuchObjectException o2, + 3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5, + 6: InvalidPartitionException o6) + + //primary keys and foreign keys + PrimaryKeysResponse get_primary_keys(1:PrimaryKeysRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + ForeignKeysResponse get_foreign_keys(1:ForeignKeysRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + // other constraints + UniqueConstraintsResponse get_unique_constraints(1:UniqueConstraintsRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + NotNullConstraintsResponse get_not_null_constraints(1:NotNullConstraintsRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + DefaultConstraintsResponse get_default_constraints(1:DefaultConstraintsRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + CheckConstraintsResponse get_check_constraints(1:CheckConstraintsRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // column statistics interfaces + + // update APIs persist the column statistics object(s) that are passed in. If statistics already + // exists for one or more columns, the existing statistics will be overwritten. The update APIs + // validate that the dbName, tableName, partName, colName[] passed in as part of the ColumnStatistics + // struct are valid, throws InvalidInputException/NoSuchObjectException if found to be invalid + bool update_table_column_statistics(1:ColumnStatistics stats_obj) throws (1:NoSuchObjectException o1, + 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + bool update_partition_column_statistics(1:ColumnStatistics stats_obj) throws (1:NoSuchObjectException o1, + 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + + // get APIs return the column statistics corresponding to db_name, tbl_name, [part_name], col_name if + // such statistics exists. If the required statistics doesn't exist, get APIs throw NoSuchObjectException + // For instance, if get_table_column_statistics is called on a partitioned table for which only + // partition level column stats exist, get_table_column_statistics will throw NoSuchObjectException + ColumnStatistics get_table_column_statistics(1:string db_name, 2:string tbl_name, 3:string col_name) throws + (1:NoSuchObjectException o1, 2:MetaException o2, 3:InvalidInputException o3, 4:InvalidObjectException o4) + ColumnStatistics get_partition_column_statistics(1:string db_name, 2:string tbl_name, 3:string part_name, + 4:string col_name) throws (1:NoSuchObjectException o1, 2:MetaException o2, + 3:InvalidInputException o3, 4:InvalidObjectException o4) + TableStatsResult get_table_statistics_req(1:TableStatsRequest request) throws + (1:NoSuchObjectException o1, 2:MetaException o2) + PartitionsStatsResult get_partitions_statistics_req(1:PartitionsStatsRequest request) throws + (1:NoSuchObjectException o1, 2:MetaException o2) + AggrStats get_aggr_stats_for(1:PartitionsStatsRequest request) throws + (1:NoSuchObjectException o1, 2:MetaException o2) + bool set_aggr_stats_for(1:SetPartitionsStatsRequest request) throws + (1:NoSuchObjectException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + + + // delete APIs attempt to delete column statistics, if found, associated with a given db_name, tbl_name, [part_name] + // and col_name. If the delete API doesn't find the statistics record in the metastore, throws NoSuchObjectException + // Delete API validates the input and if the input is invalid throws InvalidInputException/InvalidObjectException. + bool delete_partition_column_statistics(1:string db_name, 2:string tbl_name, 3:string part_name, 4:string col_name) throws + (1:NoSuchObjectException o1, 2:MetaException o2, 3:InvalidObjectException o3, + 4:InvalidInputException o4) + bool delete_table_column_statistics(1:string db_name, 2:string tbl_name, 3:string col_name) throws + (1:NoSuchObjectException o1, 2:MetaException o2, 3:InvalidObjectException o3, + 4:InvalidInputException o4) + + // + // user-defined functions + // + + void create_function(1:Function func) + throws (1:AlreadyExistsException o1, + 2:InvalidObjectException o2, + 3:MetaException o3, + 4:NoSuchObjectException o4) + + void drop_function(1:string dbName, 2:string funcName) + throws (1:NoSuchObjectException o1, 2:MetaException o3) + + void alter_function(1:string dbName, 2:string funcName, 3:Function newFunc) + throws (1:InvalidOperationException o1, 2:MetaException o2) + + list get_functions(1:string dbName, 2:string pattern) + throws (1:MetaException o1) + Function get_function(1:string dbName, 2:string funcName) + throws (1:MetaException o1, 2:NoSuchObjectException o2) + + GetAllFunctionsResponse get_all_functions() throws (1:MetaException o1) + + //authorization privileges + + bool create_role(1:Role role) throws(1:MetaException o1) + bool drop_role(1:string role_name) throws(1:MetaException o1) + list get_role_names() throws(1:MetaException o1) + // Deprecated, use grant_revoke_role() + bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type, + 4:string grantor, 5:PrincipalType grantorType, 6:bool grant_option) throws(1:MetaException o1) + // Deprecated, use grant_revoke_role() + bool revoke_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type) + throws(1:MetaException o1) + list list_roles(1:string principal_name, 2:PrincipalType principal_type) throws(1:MetaException o1) + GrantRevokeRoleResponse grant_revoke_role(1:GrantRevokeRoleRequest request) throws(1:MetaException o1) + + // get all role-grants for users/roles that have been granted the given role + // Note that in the returned list of RolePrincipalGrants, the roleName is + // redundant as it would match the role_name argument of this function + GetPrincipalsInRoleResponse get_principals_in_role(1: GetPrincipalsInRoleRequest request) throws(1:MetaException o1) + + // get grant information of all roles granted to the given principal + // Note that in the returned list of RolePrincipalGrants, the principal name,type is + // redundant as it would match the principal name,type arguments of this function + GetRoleGrantsForPrincipalResponse get_role_grants_for_principal(1: GetRoleGrantsForPrincipalRequest request) throws(1:MetaException o1) + + PrincipalPrivilegeSet get_privilege_set(1:HiveObjectRef hiveObject, 2:string user_name, + 3: list group_names) throws(1:MetaException o1) + list list_privileges(1:string principal_name, 2:PrincipalType principal_type, + 3: HiveObjectRef hiveObject) throws(1:MetaException o1) + + // Deprecated, use grant_revoke_privileges() + bool grant_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1) + // Deprecated, use grant_revoke_privileges() + bool revoke_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1) + GrantRevokePrivilegeResponse grant_revoke_privileges(1:GrantRevokePrivilegeRequest request) throws(1:MetaException o1); + // Revokes all privileges for the object and adds the newly granted privileges for it. + GrantRevokePrivilegeResponse refresh_privileges(1:HiveObjectRef objToRefresh, 2:string authorizer, 3:GrantRevokePrivilegeRequest grantRequest) throws(1:MetaException o1); + + // this is used by metastore client to send UGI information to metastore server immediately + // after setting up a connection. + list set_ugi(1:string user_name, 2:list group_names) throws (1:MetaException o1) + + //Authentication (delegation token) interfaces + + // get metastore server delegation token for use from the map/reduce tasks to authenticate + // to metastore server + string get_delegation_token(1:string token_owner, 2:string renewer_kerberos_principal_name) + throws (1:MetaException o1) + + // method to renew delegation token obtained from metastore server + i64 renew_delegation_token(1:string token_str_form) throws (1:MetaException o1) + + // method to cancel delegation token obtained from metastore server + void cancel_delegation_token(1:string token_str_form) throws (1:MetaException o1) + + // add a delegation token + bool add_token(1:string token_identifier, 2:string delegation_token) + + // remove a delegation token + bool remove_token(1:string token_identifier) + + // get a delegation token by identifier + string get_token(1:string token_identifier) + + // get all delegation token identifiers + list get_all_token_identifiers() + + // add master key + i32 add_master_key(1:string key) throws (1:MetaException o1) + + // update master key + void update_master_key(1:i32 seq_number, 2:string key) throws (1:NoSuchObjectException o1, 2:MetaException o2) + + // remove master key + bool remove_master_key(1:i32 key_seq) + + // get master keys + list get_master_keys() + + // Transaction and lock management calls + // Get just list of open transactions + GetOpenTxnsResponse get_open_txns() + // Get list of open transactions with state (open, aborted) + GetOpenTxnsInfoResponse get_open_txns_info() + OpenTxnsResponse open_txns(1:OpenTxnRequest rqst) + void abort_txn(1:AbortTxnRequest rqst) throws (1:NoSuchTxnException o1) + void abort_txns(1:AbortTxnsRequest rqst) throws (1:NoSuchTxnException o1) + void commit_txn(1:CommitTxnRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + void repl_tbl_writeid_state(1: ReplTblWriteIdStateRequest rqst) + GetValidWriteIdsResponse get_valid_write_ids(1:GetValidWriteIdsRequest rqst) + throws (1:NoSuchTxnException o1, 2:MetaException o2) + AllocateTableWriteIdsResponse allocate_table_write_ids(1:AllocateTableWriteIdsRequest rqst) + throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2, 3:MetaException o3) + LockResponse lock(1:LockRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + LockResponse check_lock(1:CheckLockRequest rqst) + throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2, 3:NoSuchLockException o3) + void unlock(1:UnlockRequest rqst) throws (1:NoSuchLockException o1, 2:TxnOpenException o2) + ShowLocksResponse show_locks(1:ShowLocksRequest rqst) + void heartbeat(1:HeartbeatRequest ids) throws (1:NoSuchLockException o1, 2:NoSuchTxnException o2, 3:TxnAbortedException o3) + HeartbeatTxnRangeResponse heartbeat_txn_range(1:HeartbeatTxnRangeRequest txns) + void compact(1:CompactionRequest rqst) + CompactionResponse compact2(1:CompactionRequest rqst) + ShowCompactResponse show_compact(1:ShowCompactRequest rqst) + void add_dynamic_partitions(1:AddDynamicPartitions rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + + // Notification logging calls + NotificationEventResponse get_next_notification(1:NotificationEventRequest rqst) + CurrentNotificationEventId get_current_notificationEventId() + NotificationEventsCountResponse get_notification_events_count(1:NotificationEventsCountRequest rqst) + FireEventResponse fire_listener_event(1:FireEventRequest rqst) + void flushCache() + + // Repl Change Management api + CmRecycleResponse cm_recycle(1:CmRecycleRequest request) throws(1:MetaException o1) + + GetFileMetadataByExprResult get_file_metadata_by_expr(1:GetFileMetadataByExprRequest req) + GetFileMetadataResult get_file_metadata(1:GetFileMetadataRequest req) + PutFileMetadataResult put_file_metadata(1:PutFileMetadataRequest req) + ClearFileMetadataResult clear_file_metadata(1:ClearFileMetadataRequest req) + CacheFileMetadataResult cache_file_metadata(1:CacheFileMetadataRequest req) + + // Metastore DB properties + string get_metastore_db_uuid() throws (1:MetaException o1) + + // Workload management API's + WMCreateResourcePlanResponse create_resource_plan(1:WMCreateResourcePlanRequest request) + throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) + + WMGetResourcePlanResponse get_resource_plan(1:WMGetResourcePlanRequest request) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + WMGetActiveResourcePlanResponse get_active_resource_plan(1:WMGetActiveResourcePlanRequest request) + throws(1:MetaException o2) + + WMGetAllResourcePlanResponse get_all_resource_plans(1:WMGetAllResourcePlanRequest request) + throws(1:MetaException o1) + + WMAlterResourcePlanResponse alter_resource_plan(1:WMAlterResourcePlanRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + WMValidateResourcePlanResponse validate_resource_plan(1:WMValidateResourcePlanRequest request) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + WMDropResourcePlanResponse drop_resource_plan(1:WMDropResourcePlanRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + WMCreateTriggerResponse create_wm_trigger(1:WMCreateTriggerRequest request) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, 4:MetaException o4) + + WMAlterTriggerResponse alter_wm_trigger(1:WMAlterTriggerRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidObjectException o2, 3:MetaException o3) + + WMDropTriggerResponse drop_wm_trigger(1:WMDropTriggerRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + WMGetTriggersForResourePlanResponse get_triggers_for_resourceplan(1:WMGetTriggersForResourePlanRequest request) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + + WMCreatePoolResponse create_wm_pool(1:WMCreatePoolRequest request) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, 4:MetaException o4) + + WMAlterPoolResponse alter_wm_pool(1:WMAlterPoolRequest request) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, 4:MetaException o4) + + WMDropPoolResponse drop_wm_pool(1:WMDropPoolRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + WMCreateOrUpdateMappingResponse create_or_update_wm_mapping(1:WMCreateOrUpdateMappingRequest request) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, 4:MetaException o4) + + WMDropMappingResponse drop_wm_mapping(1:WMDropMappingRequest request) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + WMCreateOrDropTriggerToPoolMappingResponse create_or_drop_wm_trigger_to_pool_mapping(1:WMCreateOrDropTriggerToPoolMappingRequest request) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, 4:MetaException o4) + + // Schema calls + void create_ischema(1:ISchema schema) throws(1:AlreadyExistsException o1, + NoSuchObjectException o2, 3:MetaException o3) + void alter_ischema(1:AlterISchemaRequest rqst) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + ISchema get_ischema(1:ISchemaName name) throws (1:NoSuchObjectException o1, 2:MetaException o2) + void drop_ischema(1:ISchemaName name) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + void add_schema_version(1:SchemaVersion schemaVersion) + throws(1:AlreadyExistsException o1, 2:NoSuchObjectException o2, 3:MetaException o3) + SchemaVersion get_schema_version(1: SchemaVersionDescriptor schemaVersion) + throws (1:NoSuchObjectException o1, 2:MetaException o2) + SchemaVersion get_schema_latest_version(1: ISchemaName schemaName) + throws (1:NoSuchObjectException o1, 2:MetaException o2) + list get_schema_all_versions(1: ISchemaName schemaName) + throws (1:NoSuchObjectException o1, 2:MetaException o2) + void drop_schema_version(1: SchemaVersionDescriptor schemaVersion) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + FindSchemasByColsResp get_schemas_by_cols(1: FindSchemasByColsRqst rqst) + throws(1:MetaException o1) + // There is no blanket update of SchemaVersion since it is (mostly) immutable. The only + // updates are the specific ones to associate a version with a serde and to change its state + void map_schema_version_to_serde(1: MapSchemaVersionToSerdeRequest rqst) + throws(1:NoSuchObjectException o1, 2:MetaException o2) + void set_schema_version_state(1: SetSchemaVersionStateRequest rqst) + throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + + void add_serde(1: SerDeInfo serde) throws(1:AlreadyExistsException o1, 2:MetaException o2) + SerDeInfo get_serde(1: GetSerdeRequest rqst) throws(1:NoSuchObjectException o1, 2:MetaException o2) + + LockResponse get_lock_materialization_rebuild(1: string dbName, 2: string tableName, 3: i64 txnId) + bool heartbeat_lock_materialization_rebuild(1: string dbName, 2: string tableName, 3: i64 txnId) + + void add_runtime_stats(1: RuntimeStat stat) throws(1:MetaException o1) + list get_runtime_stats(1: GetRuntimeStatsRequest rqst) throws(1:MetaException o1) +} + +// * Note about the DDL_TIME: When creating or altering a table or a partition, +// if the DDL_TIME is not set, the current time will be used. + +// For storing info about archived partitions in parameters + +// Whether the partition is archived +const string IS_ARCHIVED = "is_archived", +// The original location of the partition, before archiving. After archiving, +// this directory will contain the archive. When the partition +// is dropped, this directory will be deleted +const string ORIGINAL_LOCATION = "original_location", + +// Whether or not the table is considered immutable - immutable tables can only be +// overwritten or created if unpartitioned, or if partitioned, partitions inside them +// can only be overwritten or created. Immutability supports write-once and replace +// semantics, but not append. +const string IS_IMMUTABLE = "immutable", + +// these should be needed only for backward compatibility with filestore +const string META_TABLE_COLUMNS = "columns", +const string META_TABLE_COLUMN_TYPES = "columns.types", +const string BUCKET_FIELD_NAME = "bucket_field_name", +const string BUCKET_COUNT = "bucket_count", +const string FIELD_TO_DIMENSION = "field_to_dimension", +const string META_TABLE_NAME = "name", +const string META_TABLE_DB = "db", +const string META_TABLE_LOCATION = "location", +const string META_TABLE_SERDE = "serde", +const string META_TABLE_PARTITION_COLUMNS = "partition_columns", +const string META_TABLE_PARTITION_COLUMN_TYPES = "partition_columns.types", +const string FILE_INPUT_FORMAT = "file.inputformat", +const string FILE_OUTPUT_FORMAT = "file.outputformat", +const string META_TABLE_STORAGE = "storage_handler", +const string TABLE_IS_TRANSACTIONAL = "transactional", +const string TABLE_NO_AUTO_COMPACT = "no_auto_compaction", +const string TABLE_TRANSACTIONAL_PROPERTIES = "transactional_properties", +const string TABLE_BUCKETING_VERSION = "bucketing_version", diff --git a/thirdparty/hive_metastore/share/fb303/if/fb303.thrift b/thirdparty/hive_metastore/share/fb303/if/fb303.thrift new file mode 100644 index 000000000..f1ca982b8 --- /dev/null +++ b/thirdparty/hive_metastore/share/fb303/if/fb303.thrift @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * fb303.thrift + */ + +namespace java com.facebook.fb303 +namespace cpp facebook.fb303 +namespace perl Facebook.FB303 +namespace netstd Facebook.FB303.Test + +/** + * Common status reporting mechanism across all services + */ +enum fb_status { + DEAD = 0, + STARTING = 1, + ALIVE = 2, + STOPPING = 3, + STOPPED = 4, + WARNING = 5, +} + +/** + * Standard base service + */ +service FacebookService { + + /** + * Returns a descriptive name of the service + */ + string getName(), + + /** + * Returns the version of the service + */ + string getVersion(), + + /** + * Gets the status of this service + */ + fb_status getStatus(), + + /** + * User friendly description of status, such as why the service is in + * the dead or warning state, or what is being started or stopped. + */ + string getStatusDetails(), + + /** + * Gets the counters for this service + */ + map getCounters(), + + /** + * Gets the value of a single counter + */ + i64 getCounter(1: string key), + + /** + * Sets an option + */ + void setOption(1: string key, 2: string value), + + /** + * Gets an option + */ + string getOption(1: string key), + + /** + * Gets all options + */ + map getOptions(), + + /** + * Returns a CPU profile over the given time interval (client and server + * must agree on the profile format). + */ + string getCpuProfile(1: i32 profileDurationInSec), + + /** + * Returns the unix time that the server has been running since + */ + i64 aliveSince(), + + /** + * Tell the server to reload its configuration, reopen log files, etc + */ + oneway void reinitialize(), + + /** + * Suggest a shutdown to the server + */ + oneway void shutdown(), + +} From b6508226cb944e36267685d29c3a23c8422d8cad Mon Sep 17 00:00:00 2001 From: Sandeep Gottimukkala Date: Tue, 9 Jun 2026 01:38:29 -0700 Subject: [PATCH 066/151] feat(rest): add scan plan endpoints to REST catalog client (#614) * Introduced 4 endpoints: planning table scan, fetching a scan result, cancelling a scan plan and fetching scan planning tasks (endpoint.h) * Introduced corresponding request and response objects (types.h) * Implemented handlers (catalog.h). The handlers construct a request object and return a response object - Handlers use newly introduced helper methods to serialize and deserialize request response json objects * Added unit tests for all the above helper methods and handler methods * Added integration tests for the handlers --- src/iceberg/catalog/rest/endpoint.h | 20 + src/iceberg/catalog/rest/error_handlers.cc | 51 + src/iceberg/catalog/rest/error_handlers.h | 22 + src/iceberg/catalog/rest/json_serde.cc | 635 +++++++++ .../catalog/rest/json_serde_internal.h | 70 + src/iceberg/catalog/rest/resource_paths.cc | 23 + src/iceberg/catalog/rest/resource_paths.h | 10 + src/iceberg/catalog/rest/types.cc | 223 ++++ src/iceberg/catalog/rest/types.h | 81 +- src/iceberg/expression/aggregate.h | 2 +- src/iceberg/expression/expression.h | 2 +- src/iceberg/expression/predicate.cc | 48 +- src/iceberg/expression/predicate.h | 6 +- src/iceberg/expression/term.h | 6 +- src/iceberg/result.h | 4 + src/iceberg/test/predicate_test.cc | 36 +- src/iceberg/test/rest_json_serde_test.cc | 1166 +++++++++++++++++ 17 files changed, 2395 insertions(+), 10 deletions(-) diff --git a/src/iceberg/catalog/rest/endpoint.h b/src/iceberg/catalog/rest/endpoint.h index 7382955ce..fdcd2108e 100644 --- a/src/iceberg/catalog/rest/endpoint.h +++ b/src/iceberg/catalog/rest/endpoint.h @@ -128,6 +128,26 @@ class ICEBERG_REST_EXPORT Endpoint { return {HttpMethod::kPost, "/v1/{prefix}/transactions/commit"}; } + // Scan planning endpoints + static Endpoint PlanTableScan() { + return {HttpMethod::kPost, "/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan"}; + } + + static Endpoint FetchPlanningResult() { + return {HttpMethod::kGet, + "/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"}; + } + + static Endpoint CancelPlanning() { + return {HttpMethod::kDelete, + "/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{plan-id}"}; + } + + static Endpoint FetchScanTasks() { + return {HttpMethod::kPost, + "/v1/{prefix}/namespaces/{namespace}/tables/{table}/tasks"}; + } + private: Endpoint(HttpMethod method, std::string_view path) : method_(method), path_(path) {} diff --git a/src/iceberg/catalog/rest/error_handlers.cc b/src/iceberg/catalog/rest/error_handlers.cc index f3e5b8fb3..67146e745 100644 --- a/src/iceberg/catalog/rest/error_handlers.cc +++ b/src/iceberg/catalog/rest/error_handlers.cc @@ -30,6 +30,9 @@ namespace { constexpr std::string_view kIllegalArgumentException = "IllegalArgumentException"; constexpr std::string_view kNoSuchNamespaceException = "NoSuchNamespaceException"; constexpr std::string_view kNamespaceNotEmptyException = "NamespaceNotEmptyException"; +constexpr std::string_view kNoSuchTableException = "NoSuchTableException"; +constexpr std::string_view kNoSuchPlanIdException = "NoSuchPlanIdException"; +constexpr std::string_view kNoSuchPlanTaskException = "NoSuchPlanTaskException"; } // namespace @@ -183,4 +186,52 @@ Status ViewCommitErrorHandler::Accept(const ErrorResponse& error) const { return DefaultErrorHandler::Accept(error); } +const std::shared_ptr& PlanErrorHandler::Instance() { + static const std::shared_ptr instance{new PlanErrorHandler()}; + return instance; +} + +Status PlanErrorHandler::Accept(const ErrorResponse& error) const { + switch (error.code) { + case 404: + if (error.type == kNoSuchNamespaceException) { + return NoSuchNamespace(error.message); + } + if (error.type == kNoSuchTableException) { + return NoSuchTable(error.message); + } + if (error.type == kNoSuchPlanIdException) { + return NoSuchPlanId(error.message); + } + return NotFound(error.message); + case 406: + return NotSupported(error.message); + } + + return DefaultErrorHandler::Accept(error); +} + +const std::shared_ptr& PlanTaskErrorHandler::Instance() { + static const std::shared_ptr instance{new PlanTaskErrorHandler()}; + return instance; +} + +Status PlanTaskErrorHandler::Accept(const ErrorResponse& error) const { + switch (error.code) { + case 404: + if (error.type == kNoSuchNamespaceException) { + return NoSuchNamespace(error.message); + } + if (error.type == kNoSuchTableException) { + return NoSuchTable(error.message); + } + if (error.type == kNoSuchPlanTaskException) { + return NoSuchPlanTask(error.message); + } + return NotFound(error.message); + } + + return DefaultErrorHandler::Accept(error); +} + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/error_handlers.h b/src/iceberg/catalog/rest/error_handlers.h index eae2c9b7f..ee338fb3e 100644 --- a/src/iceberg/catalog/rest/error_handlers.h +++ b/src/iceberg/catalog/rest/error_handlers.h @@ -127,4 +127,26 @@ class ICEBERG_REST_EXPORT ViewCommitErrorHandler final : public DefaultErrorHand constexpr ViewCommitErrorHandler() = default; }; +/// \brief Plan operation error handler. +class ICEBERG_REST_EXPORT PlanErrorHandler final : public DefaultErrorHandler { + public: + static const std::shared_ptr& Instance(); + + Status Accept(const ErrorResponse& error) const override; + + private: + constexpr PlanErrorHandler() = default; +}; + +/// \brief Fetch scan tasks operation error handler. +class ICEBERG_REST_EXPORT PlanTaskErrorHandler final : public DefaultErrorHandler { + public: + static const std::shared_ptr& Instance(); + + Status Accept(const ErrorResponse& error) const override; + + private: + constexpr PlanTaskErrorHandler() = default; +}; + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/json_serde.cc b/src/iceberg/catalog/rest/json_serde.cc index eebdc1969..2eb0d19de 100644 --- a/src/iceberg/catalog/rest/json_serde.cc +++ b/src/iceberg/catalog/rest/json_serde.cc @@ -17,8 +17,12 @@ * under the License. */ +#include +#include #include +#include #include +#include #include #include @@ -26,12 +30,18 @@ #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/types.h" +#include "iceberg/expression/json_serde_internal.h" +#include "iceberg/file_format.h" #include "iceberg/json_serde_internal.h" +#include "iceberg/manifest/manifest_entry.h" #include "iceberg/partition_spec.h" +#include "iceberg/schema.h" #include "iceberg/sort_order.h" #include "iceberg/table_identifier.h" #include "iceberg/table_requirement.h" +#include "iceberg/table_scan.h" #include "iceberg/table_update.h" +#include "iceberg/util/data_file_set.h" #include "iceberg/util/json_util_internal.h" #include "iceberg/util/macros.h" @@ -78,6 +88,468 @@ constexpr std::string_view kExpiresIn = "expires_in"; constexpr std::string_view kIssuedTokenType = "issued_token_type"; constexpr std::string_view kRefreshToken = "refresh_token"; constexpr std::string_view kOAuthScope = "scope"; +constexpr std::string_view kPlanStatus = "status"; +constexpr std::string_view kPlanId = "plan-id"; +constexpr std::string_view kPlanTasks = "plan-tasks"; +constexpr std::string_view kFileScanTasks = "file-scan-tasks"; +constexpr std::string_view kDeleteFiles = "delete-files"; +constexpr std::string_view kSnapshotId = "snapshot-id"; +constexpr std::string_view kSelect = "select"; +constexpr std::string_view kFilter = "filter"; +constexpr std::string_view kCaseSensitive = "case-sensitive"; +constexpr std::string_view kUseSnapshotSchema = "use-snapshot-schema"; +constexpr std::string_view kStartSnapshotId = "start-snapshot-id"; +constexpr std::string_view kEndSnapshotId = "end-snapshot-id"; +constexpr std::string_view kStatsFields = "stats-fields"; +constexpr std::string_view kMinRowsRequested = "min-rows-requested"; +constexpr std::string_view kPlanTask = "plan-task"; +constexpr std::string_view kContent = "content"; +constexpr std::string_view kContentData = "data"; +constexpr std::string_view kContentPositionDeletes = "position-deletes"; +constexpr std::string_view kContentEqualityDeletes = "equality-deletes"; +constexpr std::string_view kFilePath = "file-path"; +constexpr std::string_view kFileFormat = "file-format"; +constexpr std::string_view kSpecId = "spec-id"; +constexpr std::string_view kPartition = "partition"; +constexpr std::string_view kRecordCount = "record-count"; +constexpr std::string_view kFileSizeInBytes = "file-size-in-bytes"; +constexpr std::string_view kColumnSizes = "column-sizes"; +constexpr std::string_view kValueCounts = "value-counts"; +constexpr std::string_view kNullValueCounts = "null-value-counts"; +constexpr std::string_view kNanValueCounts = "nan-value-counts"; +constexpr std::string_view kLowerBounds = "lower-bounds"; +constexpr std::string_view kUpperBounds = "upper-bounds"; +constexpr std::string_view kKeyMetadata = "key-metadata"; +constexpr std::string_view kSplitOffsets = "split-offsets"; +constexpr std::string_view kEqualityIds = "equality-ids"; +constexpr std::string_view kSortOrderId = "sort-order-id"; +constexpr std::string_view kFirstRowId = "first-row-id"; +constexpr std::string_view kReferencedDataFile = "referenced-data-file"; +constexpr std::string_view kContentOffset = "content-offset"; +constexpr std::string_view kContentSizeInBytes = "content-size-in-bytes"; +constexpr std::string_view kDataFile = "data-file"; +constexpr std::string_view kDeleteFileReferences = "delete-file-references"; +constexpr std::string_view kResidualFilter = "residual-filter"; +constexpr std::string_view kMapKeys = "keys"; +constexpr std::string_view kMapValues = "values"; + +template +Result> KeyValueMapFromJson(const nlohmann::json& json, + std::string_view key) { + std::map result; + if (!json.contains(key) || json.at(key).is_null()) { + return result; + } + + ICEBERG_ASSIGN_OR_RAISE(auto map_json, GetJsonValue(json, key)); + ICEBERG_ASSIGN_OR_RAISE(auto keys, + GetJsonValue>(map_json, kMapKeys)); + ICEBERG_ASSIGN_OR_RAISE(auto values, + GetJsonValue>(map_json, kMapValues)); + if (keys.size() != values.size()) { + return JsonParseError("'{}' map keys and values have different lengths", key); + } + + for (size_t i = 0; i < keys.size(); ++i) { + result[keys[i]] = std::move(values[i]); + } + return result; +} + +template +void SetKeyValueMap(nlohmann::json& json, std::string_view key, + const std::map& map) { + if (map.empty()) { + return; + } + + std::vector keys; + std::vector values; + keys.reserve(map.size()); + values.reserve(map.size()); + for (const auto& [field_id, value] : map) { + keys.push_back(field_id); + values.push_back(value); + } + json[key] = {{kMapKeys, std::move(keys)}, {kMapValues, std::move(values)}}; +} + +} // namespace + +Result DataFileFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_spec_by_id, + const Schema& schema) { + if (!json.is_object()) { + return JsonParseError("DataFile must be a JSON object: {}", SafeDumpJson(json)); + } + DataFile data_file; + + ICEBERG_ASSIGN_OR_RAISE(auto content_str, GetJsonValue(json, kContent)); + if (content_str == kContentData) { + data_file.content = DataFile::Content::kData; + } else if (content_str == kContentPositionDeletes) { + data_file.content = DataFile::Content::kPositionDeletes; + } else if (content_str == kContentEqualityDeletes) { + data_file.content = DataFile::Content::kEqualityDeletes; + } else { + return JsonParseError("Unknown data file content: {}", content_str); + } + + ICEBERG_ASSIGN_OR_RAISE(data_file.file_path, + GetJsonValue(json, kFilePath)); + ICEBERG_ASSIGN_OR_RAISE(auto format_str, GetJsonValue(json, kFileFormat)); + ICEBERG_ASSIGN_OR_RAISE(data_file.file_format, FileFormatTypeFromString(format_str)); + + ICEBERG_ASSIGN_OR_RAISE(auto spec_id, GetJsonValue(json, kSpecId)); + data_file.partition_spec_id = spec_id; + + ICEBERG_ASSIGN_OR_RAISE(auto partition_vals, + GetJsonValue(json, kPartition)); + if (!partition_vals.is_array()) { + return JsonParseError("PartitionValues must be a JSON array: {}", + SafeDumpJson(partition_vals)); + } + std::vector literals; + auto it = partition_spec_by_id.find(spec_id); + if (it == partition_spec_by_id.end()) { + return JsonParseError("Invalid partition spec id: {}", spec_id); + } + ICEBERG_ASSIGN_OR_RAISE(auto struct_type, it->second->PartitionType(schema)); + auto fields = struct_type->fields(); + if (partition_vals.size() != fields.size()) { + return JsonParseError("Invalid partition data size: expected = {}, actual = {}", + fields.size(), partition_vals.size()); + } + for (size_t pos = 0; pos < fields.size(); ++pos) { + ICEBERG_ASSIGN_OR_RAISE( + auto literal, LiteralFromJson(partition_vals[pos], fields[pos].type().get())); + literals.push_back(std::move(literal)); + } + data_file.partition = PartitionValues(std::move(literals)); + + ICEBERG_ASSIGN_OR_RAISE(data_file.record_count, + GetJsonValue(json, kRecordCount)); + ICEBERG_ASSIGN_OR_RAISE(data_file.file_size_in_bytes, + GetJsonValue(json, kFileSizeInBytes)); + + ICEBERG_ASSIGN_OR_RAISE(data_file.column_sizes, + KeyValueMapFromJson(json, kColumnSizes)); + ICEBERG_ASSIGN_OR_RAISE(data_file.value_counts, + KeyValueMapFromJson(json, kValueCounts)); + ICEBERG_ASSIGN_OR_RAISE(data_file.null_value_counts, + KeyValueMapFromJson(json, kNullValueCounts)); + ICEBERG_ASSIGN_OR_RAISE(data_file.nan_value_counts, + KeyValueMapFromJson(json, kNanValueCounts)); + ICEBERG_ASSIGN_OR_RAISE(data_file.lower_bounds, + KeyValueMapFromJson>(json, kLowerBounds)); + ICEBERG_ASSIGN_OR_RAISE(data_file.upper_bounds, + KeyValueMapFromJson>(json, kUpperBounds)); + + if (json.contains(kKeyMetadata) && !json.at(kKeyMetadata).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.key_metadata, + GetJsonValue>(json, kKeyMetadata)); + } + if (json.contains(kSplitOffsets) && !json.at(kSplitOffsets).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.split_offsets, + GetJsonValue>(json, kSplitOffsets)); + } + if (json.contains(kEqualityIds) && !json.at(kEqualityIds).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.equality_ids, + GetJsonValue>(json, kEqualityIds)); + } + if (json.contains(kSortOrderId) && !json.at(kSortOrderId).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.sort_order_id, + GetJsonValue(json, kSortOrderId)); + } + if (json.contains(kFirstRowId) && !json.at(kFirstRowId).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.first_row_id, + GetJsonValue(json, kFirstRowId)); + } + if (json.contains(kReferencedDataFile) && !json.at(kReferencedDataFile).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.referenced_data_file, + GetJsonValue(json, kReferencedDataFile)); + } + if (json.contains(kContentOffset) && !json.at(kContentOffset).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.content_offset, + GetJsonValue(json, kContentOffset)); + } + if (json.contains(kContentSizeInBytes) && !json.at(kContentSizeInBytes).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(data_file.content_size_in_bytes, + GetJsonValue(json, kContentSizeInBytes)); + } + + return data_file; +} + +Result>> FileScanTasksFromJson( + const nlohmann::json& json, + const std::vector>& delete_files, + const std::unordered_map>& + partition_spec_by_id, + const Schema& schema) { + if (!json.is_array()) { + return JsonParseError("Cannot parse file scan tasks from non-array: {}", + SafeDumpJson(json)); + } + std::vector> file_scan_tasks; + for (const auto& task_json : json) { + if (!task_json.is_object()) { + return JsonParseError("Cannot parse file scan task from a non-object: {}", + SafeDumpJson(task_json)); + } + + ICEBERG_ASSIGN_OR_RAISE(auto data_file_json, + GetJsonValue(task_json, kDataFile)); + ICEBERG_ASSIGN_OR_RAISE( + auto data_file, DataFileFromJson(data_file_json, partition_spec_by_id, schema)); + + std::vector> task_delete_files; + if (task_json.contains(kDeleteFileReferences) && + !task_json.at(kDeleteFileReferences).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(auto refs, GetJsonValue>( + task_json, kDeleteFileReferences)); + for (int32_t ref : refs) { + if (ref < 0 || static_cast(ref) >= delete_files.size()) { + return JsonParseError( + "delete-file-references index {} is out of range (delete_files size: {})", + ref, delete_files.size()); + } + task_delete_files.push_back(delete_files[ref]); + } + } + + std::shared_ptr residual_filter; + if (task_json.contains(kResidualFilter) && !task_json.at(kResidualFilter).is_null()) { + ICEBERG_ASSIGN_OR_RAISE(auto filter_json, + GetJsonValue(task_json, kResidualFilter)); + ICEBERG_ASSIGN_OR_RAISE(residual_filter, ExpressionFromJson(filter_json)); + } + + file_scan_tasks.push_back(std::make_shared( + std::make_shared(std::move(data_file)), std::move(task_delete_files), + std::move(residual_filter))); + } + return file_scan_tasks; +} + +Result DataFileToJsonUnchecked(const DataFile& data_file) { + nlohmann::json json; + switch (data_file.content) { + case DataFile::Content::kData: + json[kContent] = kContentData; + break; + case DataFile::Content::kPositionDeletes: + json[kContent] = kContentPositionDeletes; + break; + case DataFile::Content::kEqualityDeletes: + json[kContent] = kContentEqualityDeletes; + break; + } + json[kFilePath] = data_file.file_path; + json[kFileFormat] = ToString(data_file.file_format); + + if (!data_file.partition_spec_id.has_value()) { + return ValidationFailed("Cannot serialize REST content file without 'spec-id'"); + } + json[kSpecId] = data_file.partition_spec_id.value(); + + nlohmann::json partition_json = nlohmann::json::array(); + for (const auto& literal : data_file.partition.values()) { + ICEBERG_ASSIGN_OR_RAISE(auto lit_json, iceberg::ToJson(literal)); + partition_json.push_back(std::move(lit_json)); + } + json[kPartition] = std::move(partition_json); + + json[kRecordCount] = data_file.record_count; + json[kFileSizeInBytes] = data_file.file_size_in_bytes; + + SetKeyValueMap(json, kColumnSizes, data_file.column_sizes); + SetKeyValueMap(json, kValueCounts, data_file.value_counts); + SetKeyValueMap(json, kNullValueCounts, data_file.null_value_counts); + SetKeyValueMap(json, kNanValueCounts, data_file.nan_value_counts); + SetKeyValueMap(json, kLowerBounds, data_file.lower_bounds); + SetKeyValueMap(json, kUpperBounds, data_file.upper_bounds); + + if (!data_file.key_metadata.empty()) { + json[kKeyMetadata] = data_file.key_metadata; + } + if (!data_file.split_offsets.empty()) { + json[kSplitOffsets] = data_file.split_offsets; + } + if (!data_file.equality_ids.empty()) { + json[kEqualityIds] = data_file.equality_ids; + } + if (data_file.sort_order_id.has_value()) { + json[kSortOrderId] = data_file.sort_order_id.value(); + } + if (data_file.first_row_id.has_value()) { + json[kFirstRowId] = data_file.first_row_id.value(); + } + if (data_file.referenced_data_file.has_value()) { + json[kReferencedDataFile] = data_file.referenced_data_file.value(); + } + if (data_file.content_offset.has_value()) { + json[kContentOffset] = data_file.content_offset.value(); + } + if (data_file.content_size_in_bytes.has_value()) { + json[kContentSizeInBytes] = data_file.content_size_in_bytes.value(); + } + + return json; +} + +Result ToJson( + const DataFile& data_file, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + if (!data_file.partition_spec_id.has_value()) { + return ValidationFailed("Invalid partition spec id from content file: null"); + } + auto it = partition_specs_by_id.find(data_file.partition_spec_id.value()); + if (it == partition_specs_by_id.end() || !it->second) { + return ValidationFailed("Invalid partition spec: null"); + } + if (data_file.partition_spec_id.value() != it->second->spec_id()) { + return ValidationFailed( + "Invalid partition spec id from content file: expected = {}, actual = {}", + it->second->spec_id(), data_file.partition_spec_id.value()); + } + ICEBERG_ASSIGN_OR_RAISE(auto partition_type, it->second->PartitionType(schema)); + if (data_file.partition.num_fields() != partition_type->fields().size()) { + return ValidationFailed( + "Invalid partition data from content file: expected = {}, actual = {}", + partition_type->fields().empty() ? "unpartitioned" : "partitioned", + data_file.partition.num_fields() == 0 ? "unpartitioned" : "partitioned"); + } + return DataFileToJsonUnchecked(data_file); +} + +namespace { + +template +Result ScanTaskFieldsToJson( + const Response& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + nlohmann::json json; + + if (response.plan_tasks.has_value()) { + json[kPlanTasks] = *response.plan_tasks; + } + + DeleteFileSet response_delete_files; + for (const auto& file : response.delete_files) { + response_delete_files.insert(file); + } + + DeleteFileSet delete_files; + auto add_delete_file = [&](const std::shared_ptr& task_file) { + if (!task_file) { + return; + } + auto [response_file, inserted_response_file] = + response_delete_files.insert(task_file); + delete_files.insert(inserted_response_file ? task_file : *response_file); + }; + if (response.file_scan_tasks.has_value()) { + for (const auto& task : *response.file_scan_tasks) { + if (!task) continue; + for (const auto& file : task->delete_files()) { + add_delete_file(file); + } + } + } + + nlohmann::json tasks_json = nlohmann::json::array(); + if (response.file_scan_tasks.has_value()) { + for (const auto& task : *response.file_scan_tasks) { + if (!task) continue; + nlohmann::json task_json; + if (task->data_file()) { + ICEBERG_ASSIGN_OR_RAISE( + auto data_file_json, + ToJson(*task->data_file(), partition_specs_by_id, schema)); + task_json[kDataFile] = std::move(data_file_json); + } + if (!task->delete_files().empty()) { + std::vector refs; + for (const auto& delete_file : task->delete_files()) { + if (delete_file) { + auto [file, _] = delete_files.insert(delete_file); + refs.push_back( + static_cast(std::distance(delete_files.begin(), file))); + } + } + if (!refs.empty()) { + task_json[kDeleteFileReferences] = std::move(refs); + } + } + if (task->residual_filter()) { + ICEBERG_ASSIGN_OR_RAISE(auto residual_json, + iceberg::ToJson(*task->residual_filter())); + task_json[kResidualFilter] = std::move(residual_json); + } + tasks_json.push_back(std::move(task_json)); + } + } + nlohmann::json delete_files_json = nlohmann::json::array(); + for (const auto& file : delete_files) { + ICEBERG_ASSIGN_OR_RAISE(auto df_json, ToJson(*file, partition_specs_by_id, schema)); + delete_files_json.push_back(std::move(df_json)); + } + if (!delete_files_json.empty()) { + json[kDeleteFiles] = std::move(delete_files_json); + } + if (response.file_scan_tasks.has_value()) { + json[kFileScanTasks] = std::move(tasks_json); + } + + return json; +} + +template +Status ScanTaskFieldsFromJson( + const nlohmann::json& json, Response& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + // 1. plan_tasks + if (json.contains(kPlanTasks)) { + ICEBERG_ASSIGN_OR_RAISE(response.plan_tasks, + GetJsonValue>(json, kPlanTasks)); + } + + // 2. delete_files + nlohmann::json delete_files_json = nlohmann::json::array(); + if (json.contains(kDeleteFiles)) { + ICEBERG_ASSIGN_OR_RAISE(delete_files_json, + GetJsonValue(json, kDeleteFiles)); + } + if (!delete_files_json.is_array()) { + return JsonParseError("Cannot parse delete files from non-array: {}", + SafeDumpJson(delete_files_json)); + } + for (const auto& entry_json : delete_files_json) { + ICEBERG_ASSIGN_OR_RAISE(auto delete_file, + DataFileFromJson(entry_json, partition_specs_by_id, schema)); + response.delete_files.push_back(std::make_shared(std::move(delete_file))); + } + + // 3. file_scan_tasks + if (json.contains(kFileScanTasks)) { + ICEBERG_ASSIGN_OR_RAISE(auto file_scan_tasks_json, + GetJsonValue(json, kFileScanTasks)); + ICEBERG_ASSIGN_OR_RAISE( + response.file_scan_tasks, + FileScanTasksFromJson(file_scan_tasks_json, response.delete_files, + partition_specs_by_id, schema)); + } + return {}; +} } // namespace @@ -506,6 +978,167 @@ Result OAuthTokenResponseFromJson(const nlohmann::json& json return response; } +Result PlanTableScanRequestFromJson(const nlohmann::json& json) { + PlanTableScanRequest request; + ICEBERG_ASSIGN_OR_RAISE(request.snapshot_id, + GetJsonValueOptional(json, kSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE(request.select, + GetJsonValueOrDefault>(json, kSelect)); + if (json.contains(kFilter)) { + ICEBERG_ASSIGN_OR_RAISE(request.filter, ExpressionFromJson(json.at(kFilter))); + } + ICEBERG_ASSIGN_OR_RAISE(request.case_sensitive, + GetJsonValueOrDefault(json, kCaseSensitive, true)); + ICEBERG_ASSIGN_OR_RAISE(request.use_snapshot_schema, + GetJsonValueOrDefault(json, kUseSnapshotSchema, false)); + ICEBERG_ASSIGN_OR_RAISE(request.start_snapshot_id, + GetJsonValueOptional(json, kStartSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE(request.end_snapshot_id, + GetJsonValueOptional(json, kEndSnapshotId)); + ICEBERG_ASSIGN_OR_RAISE( + request.stats_fields, + GetJsonValueOrDefault>(json, kStatsFields)); + ICEBERG_ASSIGN_OR_RAISE(request.min_rows_requested, + GetJsonValueOptional(json, kMinRowsRequested)); + ICEBERG_RETURN_UNEXPECTED(request.Validate()); + return request; +} + +Result ToJson(const PlanTableScanRequest& request) { + nlohmann::json json; + if (request.snapshot_id.has_value()) { + json[kSnapshotId] = request.snapshot_id.value(); + } + if (!request.select.empty()) { + json[kSelect] = request.select; + } + if (request.filter) { + ICEBERG_ASSIGN_OR_RAISE(auto filter_json, iceberg::ToJson(*request.filter)); + json[kFilter] = std::move(filter_json); + } + json[kCaseSensitive] = request.case_sensitive; + json[kUseSnapshotSchema] = request.use_snapshot_schema; + if (request.start_snapshot_id.has_value()) { + json[kStartSnapshotId] = request.start_snapshot_id.value(); + } + if (request.end_snapshot_id.has_value()) { + json[kEndSnapshotId] = request.end_snapshot_id.value(); + } + if (!request.stats_fields.empty()) { + json[kStatsFields] = request.stats_fields; + } + if (request.min_rows_requested.has_value()) { + json[kMinRowsRequested] = request.min_rows_requested.value(); + } + return json; +} + +Result FetchScanTasksRequestFromJson(const nlohmann::json& json) { + FetchScanTasksRequest request; + ICEBERG_ASSIGN_OR_RAISE(request.planTask, GetJsonValue(json, kPlanTask)); + ICEBERG_RETURN_UNEXPECTED(request.Validate()); + return request; +} + +nlohmann::json ToJson(const FetchScanTasksRequest& request) { + nlohmann::json json; + json[kPlanTask] = request.planTask; + return json; +} + +Result PlanTableScanResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + PlanTableScanResponse response; + ICEBERG_ASSIGN_OR_RAISE(auto plan_status_str, + GetJsonValue(json, kPlanStatus)); + ICEBERG_ASSIGN_OR_RAISE(response.plan_status, PlanStatusFromString(plan_status_str)); + ICEBERG_ASSIGN_OR_RAISE(response.plan_id, + GetJsonValueOrDefault(json, kPlanId)); + if (response.plan_status == PlanStatus::kFailed) { + ICEBERG_ASSIGN_OR_RAISE(response.error, ErrorResponseFromJson(json)); + } else if (json.contains(kError)) { + return ValidationFailed("error can only be present when status is 'failed'"); + } + ICEBERG_RETURN_UNEXPECTED( + ScanTaskFieldsFromJson(json, response, partition_specs_by_id, schema)); + ICEBERG_RETURN_UNEXPECTED(response.Validate()); + return response; +} + +Result ToJson( + const PlanTableScanResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + ICEBERG_ASSIGN_OR_RAISE(nlohmann::json json, + ScanTaskFieldsToJson(response, partition_specs_by_id, schema)); + json[kPlanStatus] = ToString(response.plan_status); + if (!response.plan_id.empty()) { + json[kPlanId] = response.plan_id; + } + if (response.error.has_value()) { + json[kError] = ToJson(*response.error)[kError]; + } + return json; +} + +Result FetchPlanningResultResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + FetchPlanningResultResponse response; + ICEBERG_ASSIGN_OR_RAISE(auto plan_status_str, + GetJsonValue(json, kPlanStatus)); + ICEBERG_ASSIGN_OR_RAISE(response.plan_status, PlanStatusFromString(plan_status_str)); + if (response.plan_status == PlanStatus::kFailed) { + ICEBERG_ASSIGN_OR_RAISE(response.error, ErrorResponseFromJson(json)); + } else if (json.contains(kError)) { + return ValidationFailed("error can only be present when status is 'failed'"); + } + ICEBERG_RETURN_UNEXPECTED( + ScanTaskFieldsFromJson(json, response, partition_specs_by_id, schema)); + ICEBERG_RETURN_UNEXPECTED(response.Validate()); + return response; +} + +Result ToJson( + const FetchPlanningResultResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + ICEBERG_ASSIGN_OR_RAISE(nlohmann::json json, + ScanTaskFieldsToJson(response, partition_specs_by_id, schema)); + json[kPlanStatus] = ToString(response.plan_status); + if (response.error.has_value()) { + json[kError] = ToJson(*response.error)[kError]; + } + return json; +} + +Result FetchScanTasksResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + FetchScanTasksResponse response; + ICEBERG_RETURN_UNEXPECTED( + ScanTaskFieldsFromJson(json, response, partition_specs_by_id, schema)); + ICEBERG_RETURN_UNEXPECTED(response.Validate()); + return response; +} + +Result ToJson( + const FetchScanTasksResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema) { + return ScanTaskFieldsToJson(response, partition_specs_by_id, schema); +} + #define ICEBERG_DEFINE_FROM_JSON(Model) \ template <> \ Result FromJson(const nlohmann::json& json) { \ @@ -528,5 +1161,7 @@ ICEBERG_DEFINE_FROM_JSON(CreateTableRequest) ICEBERG_DEFINE_FROM_JSON(CommitTableRequest) ICEBERG_DEFINE_FROM_JSON(CommitTableResponse) ICEBERG_DEFINE_FROM_JSON(OAuthTokenResponse) +ICEBERG_DEFINE_FROM_JSON(PlanTableScanRequest) +ICEBERG_DEFINE_FROM_JSON(FetchScanTasksRequest) } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/json_serde_internal.h b/src/iceberg/catalog/rest/json_serde_internal.h index 820e077d7..61d2eb6e0 100644 --- a/src/iceberg/catalog/rest/json_serde_internal.h +++ b/src/iceberg/catalog/rest/json_serde_internal.h @@ -19,11 +19,16 @@ #pragma once +#include +#include +#include + #include #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/catalog/rest/types.h" #include "iceberg/result.h" +#include "iceberg/type_fwd.h" /// \file iceberg/catalog/rest/json_serde_internal.h /// JSON serialization and deserialization for Iceberg REST Catalog API types. @@ -62,4 +67,69 @@ ICEBERG_DECLARE_JSON_SERDE(OAuthTokenResponse) #undef ICEBERG_DECLARE_JSON_SERDE +ICEBERG_REST_EXPORT Result PlanTableScanResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); +ICEBERG_REST_EXPORT Result ToJson( + const PlanTableScanResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); + +ICEBERG_REST_EXPORT Result +FetchPlanningResultResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); +ICEBERG_REST_EXPORT Result ToJson( + const FetchPlanningResultResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); + +ICEBERG_REST_EXPORT Result FetchScanTasksResponseFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); +ICEBERG_REST_EXPORT Result ToJson( + const FetchScanTasksResponse& response, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); + +ICEBERG_REST_EXPORT Result PlanTableScanRequestFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT Result ToJson(const PlanTableScanRequest& request); + +ICEBERG_REST_EXPORT Result FetchScanTasksRequestFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT nlohmann::json ToJson(const FetchScanTasksRequest& request); + +ICEBERG_REST_EXPORT Result ToJson( + const DataFile& df, + const std::unordered_map>& + partition_specs_by_id, + const Schema& schema); + +ICEBERG_REST_EXPORT Result DataFileFromJson( + const nlohmann::json& json, + const std::unordered_map>& + partition_spec_by_id, + const Schema& schema); + +ICEBERG_REST_EXPORT Result>> +FileScanTasksFromJson(const nlohmann::json& json, + const std::vector>& delete_files, + const std::unordered_map>& + partition_spec_by_id, + const Schema& schema); + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/resource_paths.cc b/src/iceberg/catalog/rest/resource_paths.cc index 7bdde7f04..354400c4d 100644 --- a/src/iceberg/catalog/rest/resource_paths.cc +++ b/src/iceberg/catalog/rest/resource_paths.cc @@ -20,6 +20,7 @@ #include "iceberg/catalog/rest/resource_paths.h" #include +#include #include "iceberg/catalog/rest/rest_util.h" #include "iceberg/table_identifier.h" @@ -114,4 +115,26 @@ Result ResourcePaths::CommitTransaction() const { return std::format("{}/v1/{}transactions/commit", base_uri_, prefix_); } +Result ResourcePaths::Plan(const TableIdentifier& ident, + std::optional plan_id) const { + ICEBERG_ASSIGN_OR_RAISE(std::string encoded_namespace, + EncodeNamespace(ident.ns, namespace_separator_)); + ICEBERG_ASSIGN_OR_RAISE(std::string encoded_table_name, EncodeString(ident.name)); + if (plan_id.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(std::string encoded_plan_id, EncodeString(plan_id.value())); + return std::format("{}/v1/{}namespaces/{}/tables/{}/plan/{}", base_uri_, prefix_, + encoded_namespace, encoded_table_name, encoded_plan_id); + } + return std::format("{}/v1/{}namespaces/{}/tables/{}/plan", base_uri_, prefix_, + encoded_namespace, encoded_table_name); +} + +Result ResourcePaths::FetchScanTasks(const TableIdentifier& ident) const { + ICEBERG_ASSIGN_OR_RAISE(std::string encoded_namespace, + EncodeNamespace(ident.ns, namespace_separator_)); + ICEBERG_ASSIGN_OR_RAISE(std::string encoded_table_name, EncodeString(ident.name)); + return std::format("{}/v1/{}namespaces/{}/tables/{}/tasks", base_uri_, prefix_, + encoded_namespace, encoded_table_name); +} + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/resource_paths.h b/src/iceberg/catalog/rest/resource_paths.h index db326b133..27135bb22 100644 --- a/src/iceberg/catalog/rest/resource_paths.h +++ b/src/iceberg/catalog/rest/resource_paths.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include "iceberg/catalog/rest/iceberg_rest_export.h" @@ -83,6 +84,15 @@ class ICEBERG_REST_EXPORT ResourcePaths { /// \brief Get the /v1/{prefix}/transactions/commit endpoint path. Result CommitTransaction() const; + /// \brief Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan endpoint + /// path, or /plan/{plan_id} if plan_id is provided. + Result Plan(const TableIdentifier& ident, + std::optional plan_id = std::nullopt) const; + + /// \brief Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/tasks endpoint + /// path. + Result FetchScanTasks(const TableIdentifier& ident) const; + private: ResourcePaths(std::string base_uri, const std::string& prefix, std::string namespace_separator); diff --git a/src/iceberg/catalog/rest/types.cc b/src/iceberg/catalog/rest/types.cc index 3abfb1406..8d96bccb2 100644 --- a/src/iceberg/catalog/rest/types.cc +++ b/src/iceberg/catalog/rest/types.cc @@ -20,16 +20,42 @@ #include "iceberg/catalog/rest/types.h" #include +#include +#include "iceberg/expression/expression.h" +#include "iceberg/manifest/manifest_entry.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" #include "iceberg/sort_order.h" #include "iceberg/table_metadata.h" #include "iceberg/table_requirement.h" +#include "iceberg/table_scan.h" #include "iceberg/table_update.h" namespace iceberg::rest { +std::string_view ToString(PlanStatus status) { + switch (status) { + case PlanStatus::kSubmitted: + return "submitted"; + case PlanStatus::kCompleted: + return "completed"; + case PlanStatus::kCancelled: + return "cancelled"; + case PlanStatus::kFailed: + return "failed"; + } + return "unknown"; +} + +Result PlanStatusFromString(std::string_view status_str) { + if (status_str == "submitted") return PlanStatus::kSubmitted; + if (status_str == "completed") return PlanStatus::kCompleted; + if (status_str == "cancelled") return PlanStatus::kCancelled; + if (status_str == "failed") return PlanStatus::kFailed; + return JsonParseError("Unknown plan status: {}", status_str); +} + bool CreateTableRequest::operator==(const CreateTableRequest& other) const { if (name != other.name || location != other.location || stage_create != other.stage_create || properties != other.properties) { @@ -118,6 +144,107 @@ bool CommitTableResponse::operator==(const CommitTableResponse& other) const { return true; } +namespace { + +bool ExpressionPtrEqual(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) { + if (lhs == rhs) { + return true; + } + return lhs && rhs && lhs->Equals(*rhs); +} + +} // namespace + +bool PlanTableScanRequest::operator==(const PlanTableScanRequest& other) const { + return snapshot_id == other.snapshot_id && select == other.select && + ExpressionPtrEqual(filter, other.filter) && + case_sensitive == other.case_sensitive && + use_snapshot_schema == other.use_snapshot_schema && + start_snapshot_id == other.start_snapshot_id && + end_snapshot_id == other.end_snapshot_id && stats_fields == other.stats_fields && + min_rows_requested == other.min_rows_requested; +} + +namespace { + +template +bool SharedPtrEqual(const std::shared_ptr& lhs, const std::shared_ptr& rhs) { + if (lhs == rhs) { + return true; + } + return lhs && rhs && *lhs == *rhs; +} + +template +bool SharedPtrVectorEqual(const std::vector>& lhs, + const std::vector>& rhs) { + return std::ranges::equal(lhs, rhs, SharedPtrEqual); +} + +bool FileScanTaskEqual(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) { + if (lhs == rhs) { + return true; + } + if (!lhs || !rhs) { + return false; + } + return SharedPtrEqual(lhs->data_file(), rhs->data_file()) && + SharedPtrVectorEqual(lhs->delete_files(), rhs->delete_files()) && + ExpressionPtrEqual(lhs->residual_filter(), rhs->residual_filter()); +} + +template +bool OptionalSharedPtrVectorEqual( + const std::optional>>& lhs, + const std::optional>>& rhs, + bool (*eq)(const std::shared_ptr&, const std::shared_ptr&)) { + if (lhs.has_value() != rhs.has_value()) { + return false; + } + return !lhs.has_value() || std::ranges::equal(*lhs, *rhs, eq); +} + +template +bool ScanTaskFieldsEqual(const Response& lhs, const Response& rhs) { + return lhs.plan_tasks == rhs.plan_tasks && + SharedPtrVectorEqual(lhs.delete_files, rhs.delete_files) && + OptionalSharedPtrVectorEqual(lhs.file_scan_tasks, rhs.file_scan_tasks, + FileScanTaskEqual); +} + +template +bool HasTaskFields(const Response& response) { + return response.plan_tasks.has_value() || response.file_scan_tasks.has_value(); +} + +template +bool HasNonEmptyFileScanTasks(const Response& response) { + return response.file_scan_tasks.has_value() && !response.file_scan_tasks->empty(); +} + +} // namespace + +bool PlanTableScanResponse::operator==(const PlanTableScanResponse& other) const { + return ScanTaskFieldsEqual(*this, other) && plan_status == other.plan_status && + plan_id == other.plan_id && error == other.error; +} + +bool FetchPlanningResultResponse::operator==( + const FetchPlanningResultResponse& other) const { + return ScanTaskFieldsEqual(*this, other) && plan_status == other.plan_status && + error == other.error; +} + +bool FetchScanTasksRequest::operator==(const FetchScanTasksRequest& other) const { + return planTask == other.planTask; +} + +bool FetchScanTasksResponse::operator==(const FetchScanTasksResponse& other) const { + return ScanTaskFieldsEqual(*this, other); +} + Status OAuthTokenResponse::Validate() const { if (access_token.empty()) { return ValidationFailed("OAuth2 token response missing required 'access_token'"); @@ -135,4 +262,100 @@ Status OAuthTokenResponse::Validate() const { return {}; } +Status PlanTableScanRequest::Validate() const { + if (snapshot_id.has_value()) { + if (start_snapshot_id.has_value() || end_snapshot_id.has_value()) { + return ValidationFailed( + "Invalid scan: cannot provide both snapshotId and " + "startSnapshotId/endSnapshotId"); + } + } + if (start_snapshot_id.has_value() || end_snapshot_id.has_value()) { + if (!start_snapshot_id.has_value() || !end_snapshot_id.has_value()) { + return ValidationFailed( + "Invalid incremental scan: startSnapshotId and endSnapshotId is required"); + } + } + if (min_rows_requested.has_value() && min_rows_requested.value() < 0) { + return ValidationFailed("Invalid scan: minRowsRequested is negative"); + } + return {}; +} + +Status PlanTableScanResponse::Validate() const { + if (plan_status == PlanStatus::kSubmitted && plan_id.empty()) { + return ValidationFailed( + "Invalid response: plan id should be defined when status is 'submitted'"); + } + if (plan_status == PlanStatus::kCancelled) { + return ValidationFailed( + "Invalid response: 'cancelled' is not a valid status for planTableScan"); + } + if (plan_status != PlanStatus::kCompleted && HasTaskFields(*this)) { + return ValidationFailed( + "Invalid response: tasks can only be defined when status is 'completed'"); + } + if (!plan_id.empty() && plan_status != PlanStatus::kSubmitted && + plan_status != PlanStatus::kCompleted) { + return ValidationFailed( + "Invalid response: plan id can only be defined when status is 'submitted' or " + "'completed'"); + } + if (!HasNonEmptyFileScanTasks(*this) && !delete_files.empty()) { + return ValidationFailed( + "Invalid response: deleteFiles should only be returned with fileScanTasks that " + "reference them"); + } + if (plan_status == PlanStatus::kFailed && !error.has_value()) { + return ValidationFailed( + "Invalid response: error must be present when status is 'failed'"); + } + if (plan_status != PlanStatus::kFailed && error.has_value()) { + return ValidationFailed( + "Invalid response: error can only be present when status is 'failed'"); + } + return {}; +} + +Status FetchPlanningResultResponse::Validate() const { + if (plan_status != PlanStatus::kCompleted && HasTaskFields(*this)) { + return ValidationFailed( + "Invalid response: tasks can only be returned in a 'completed' status"); + } + if (!HasNonEmptyFileScanTasks(*this) && !delete_files.empty()) { + return ValidationFailed( + "Invalid response: deleteFiles should only be returned with fileScanTasks that " + "reference them"); + } + if (plan_status == PlanStatus::kFailed && !error.has_value()) { + return ValidationFailed( + "Invalid response: error must be present when status is 'failed'"); + } + if (plan_status != PlanStatus::kFailed && error.has_value()) { + return ValidationFailed( + "Invalid response: error can only be present when status is 'failed'"); + } + return {}; +} + +Status FetchScanTasksRequest::Validate() const { + if (planTask.empty()) { + return ValidationFailed("Invalid planTask: null"); + } + return {}; +} + +Status FetchScanTasksResponse::Validate() const { + if (!HasNonEmptyFileScanTasks(*this) && !delete_files.empty()) { + return ValidationFailed( + "Invalid response: deleteFiles should only be returned with fileScanTasks that " + "reference them"); + } + if (!HasTaskFields(*this)) { + return ValidationFailed( + "Invalid response: planTasks and fileScanTask cannot both be null"); + } + return {}; +} + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/types.h b/src/iceberg/catalog/rest/types.h index 6495a6517..7849b366b 100644 --- a/src/iceberg/catalog/rest/types.h +++ b/src/iceberg/catalog/rest/types.h @@ -23,13 +23,13 @@ #include #include #include +#include #include #include #include "iceberg/catalog/rest/endpoint.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/result.h" -#include "iceberg/schema.h" #include "iceberg/table_identifier.h" #include "iceberg/type_fwd.h" #include "iceberg/util/macros.h" @@ -39,6 +39,17 @@ namespace iceberg::rest { +/// \brief Status of a REST server-side scan planning operation. +enum class PlanStatus { + kSubmitted, + kCompleted, + kCancelled, + kFailed, +}; + +ICEBERG_REST_EXPORT std::string_view ToString(PlanStatus status); +ICEBERG_REST_EXPORT Result PlanStatusFromString(std::string_view status_str); + /// \brief Server-provided configuration for the catalog. struct ICEBERG_REST_EXPORT CatalogConfig { std::unordered_map defaults; // required @@ -295,4 +306,72 @@ struct ICEBERG_REST_EXPORT OAuthTokenResponse { bool operator==(const OAuthTokenResponse&) const = default; }; +/// \brief Request to initiate a server-side scan planning operation. +struct ICEBERG_REST_EXPORT PlanTableScanRequest { + std::optional snapshot_id; + std::vector select; + std::shared_ptr filter; + bool case_sensitive = true; + bool use_snapshot_schema = false; + std::optional start_snapshot_id; + std::optional end_snapshot_id; + std::vector stats_fields; + std::optional min_rows_requested; + + Status Validate() const; + + bool operator==(const PlanTableScanRequest&) const; +}; + +/// \brief Response from initiating a scan planning operation, including plan status and +/// initial scan tasks. +struct ICEBERG_REST_EXPORT PlanTableScanResponse { + std::optional> plan_tasks; + std::optional>> file_scan_tasks; + std::vector> delete_files; + PlanStatus plan_status = PlanStatus::kCompleted; + std::string plan_id; + std::optional error; + // TODO(sandeepg): Add credentials. + + Status Validate() const; + + bool operator==(const PlanTableScanResponse&) const; +}; + +/// \brief Response from polling an asynchronous scan plan, including current status and +/// available scan tasks. +struct ICEBERG_REST_EXPORT FetchPlanningResultResponse { + std::optional> plan_tasks; + std::optional>> file_scan_tasks; + std::vector> delete_files; + PlanStatus plan_status = PlanStatus::kCompleted; + std::optional error; + // TODO(sandeepg): Add credentials. + + Status Validate() const; + + bool operator==(const FetchPlanningResultResponse&) const; +}; + +/// \brief Request to fetch the scan tasks for a given plan task token. +struct ICEBERG_REST_EXPORT FetchScanTasksRequest { + std::string planTask; + + Status Validate() const; + + bool operator==(const FetchScanTasksRequest&) const; +}; + +/// \brief Response containing the file scan tasks for a given plan task token. +struct ICEBERG_REST_EXPORT FetchScanTasksResponse { + std::optional> plan_tasks; + std::optional>> file_scan_tasks; + std::vector> delete_files; + + Status Validate() const; + + bool operator==(const FetchScanTasksResponse&) const; +}; + } // namespace iceberg::rest diff --git a/src/iceberg/expression/aggregate.h b/src/iceberg/expression/aggregate.h index 6cf659d6f..bbb01a4ab 100644 --- a/src/iceberg/expression/aggregate.h +++ b/src/iceberg/expression/aggregate.h @@ -80,7 +80,7 @@ class ICEBERG_EXPORT UnboundAggregateImpl : public UnboundAggregate, static Result>> Make( Expression::Operation op, std::shared_ptr> term); - std::shared_ptr reference() override { + std::shared_ptr reference() const override { return BASE::term() ? BASE::term()->reference() : nullptr; } diff --git a/src/iceberg/expression/expression.h b/src/iceberg/expression/expression.h index 35ffbfdfe..1663c69f8 100644 --- a/src/iceberg/expression/expression.h +++ b/src/iceberg/expression/expression.h @@ -350,7 +350,7 @@ class ICEBERG_EXPORT Unbound { Result> Bind(const Schema& schema) const; /// \brief Returns the underlying named reference for this unbound term. - virtual std::shared_ptr reference() = 0; + virtual std::shared_ptr reference() const = 0; }; /// \brief Interface for bound expressions that can be evaluated. diff --git a/src/iceberg/expression/predicate.cc b/src/iceberg/expression/predicate.cc index 307c3c609..44c4a3a70 100644 --- a/src/iceberg/expression/predicate.cc +++ b/src/iceberg/expression/predicate.cc @@ -25,6 +25,7 @@ #include "iceberg/expression/expressions.h" #include "iceberg/expression/literal.h" #include "iceberg/result.h" +#include "iceberg/transform.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/formatter_internal.h" @@ -121,7 +122,32 @@ UnboundPredicateImpl::UnboundPredicateImpl(Expression::Operation op, template UnboundPredicateImpl::~UnboundPredicateImpl() = default; -namespace {} +namespace { + +bool UnboundTermEqual(const Term& lhs, const Term& rhs) { + if (!lhs.is_unbound() || !rhs.is_unbound() || lhs.kind() != rhs.kind()) { + return false; + } + + switch (lhs.kind()) { + case Term::Kind::kReference: { + const auto& lhs_ref = internal::checked_cast(lhs); + const auto& rhs_ref = internal::checked_cast(rhs); + return lhs_ref.name() == rhs_ref.name(); + } + case Term::Kind::kTransform: { + const auto& lhs_transform = internal::checked_cast(lhs); + const auto& rhs_transform = internal::checked_cast(rhs); + return lhs_transform.reference()->name() == rhs_transform.reference()->name() && + *lhs_transform.transform() == *rhs_transform.transform(); + } + case Term::Kind::kExtract: + return false; + } + std::unreachable(); +} + +} // namespace template std::string UnboundPredicateImpl::ToString() const { @@ -174,6 +200,24 @@ std::string UnboundPredicateImpl::ToString() const { } } +template +bool UnboundPredicateImpl::Equals(const Expression& other) const { + if (!other.is_unbound_predicate()) { + return false; + } + + if (BASE::op() != other.op()) { + return false; + } + + const auto* other_pred = dynamic_cast(&other); + if (other_pred == nullptr) { + return false; + } + return UnboundTermEqual(unbound_term(), other_pred->unbound_term()) && + std::ranges::equal(literals(), other_pred->literals()); +} + template Result> UnboundPredicateImpl::Negate() const { ICEBERG_ASSIGN_OR_RAISE(auto negated_op, ::iceberg::Negate(BASE::op())); @@ -626,7 +670,7 @@ bool BoundSetPredicate::Equals(const Expression& other) const { if (const auto* other_pred = dynamic_cast(&other); other_pred) { - return value_set_ == other_pred->value_set_; + return term_->Equals(*other_pred->term()) && value_set_ == other_pred->value_set_; } return false; diff --git a/src/iceberg/expression/predicate.h b/src/iceberg/expression/predicate.h index 6df0de1a6..af883fe19 100644 --- a/src/iceberg/expression/predicate.h +++ b/src/iceberg/expression/predicate.h @@ -65,7 +65,7 @@ class ICEBERG_EXPORT UnboundPredicate : public virtual Expression, ~UnboundPredicate() override = default; /// \brief Returns the reference of this UnboundPredicate. - std::shared_ptr reference() override = 0; + std::shared_ptr reference() const override = 0; /// \brief Bind this UnboundPredicate. Result> Bind(const Schema& schema, @@ -125,12 +125,14 @@ class ICEBERG_EXPORT UnboundPredicateImpl : public UnboundPredicate, ~UnboundPredicateImpl() override; - std::shared_ptr reference() override { + std::shared_ptr reference() const override { return BASE::term()->reference(); } std::string ToString() const override; + bool Equals(const Expression& other) const override; + Result> Bind(const Schema& schema, bool case_sensitive) const override; diff --git a/src/iceberg/expression/term.h b/src/iceberg/expression/term.h index b50ea9242..4d5f09795 100644 --- a/src/iceberg/expression/term.h +++ b/src/iceberg/expression/term.h @@ -113,7 +113,9 @@ class ICEBERG_EXPORT NamedReference Result> Bind(const Schema& schema, bool case_sensitive) const override; - std::shared_ptr reference() override { return shared_from_this(); } + std::shared_ptr reference() const override { + return shared_from_this(); + } std::string ToString() const override; @@ -185,7 +187,7 @@ class ICEBERG_EXPORT UnboundTransform : public UnboundTerm Result> Bind(const Schema& schema, bool case_sensitive) const override; - std::shared_ptr reference() override { return ref_; } + std::shared_ptr reference() const override { return ref_; } const std::shared_ptr& transform() const { return transform_; } diff --git a/src/iceberg/result.h b/src/iceberg/result.h index 01d17b299..70155db6a 100644 --- a/src/iceberg/result.h +++ b/src/iceberg/result.h @@ -50,6 +50,8 @@ enum class ErrorKind { kJsonParseError, kNamespaceNotEmpty, kNoSuchNamespace, + kNoSuchPlanId, + kNoSuchPlanTask, kNoSuchTable, kNoSuchView, kNotAllowed, @@ -113,6 +115,8 @@ DEFINE_ERROR_FUNCTION(IOError) DEFINE_ERROR_FUNCTION(JsonParseError) DEFINE_ERROR_FUNCTION(NamespaceNotEmpty) DEFINE_ERROR_FUNCTION(NoSuchNamespace) +DEFINE_ERROR_FUNCTION(NoSuchPlanId) +DEFINE_ERROR_FUNCTION(NoSuchPlanTask) DEFINE_ERROR_FUNCTION(NoSuchTable) DEFINE_ERROR_FUNCTION(NoSuchView) DEFINE_ERROR_FUNCTION(NotAllowed) diff --git a/src/iceberg/test/predicate_test.cc b/src/iceberg/test/predicate_test.cc index fab0b5617..6b990462a 100644 --- a/src/iceberg/test/predicate_test.cc +++ b/src/iceberg/test/predicate_test.cc @@ -38,7 +38,8 @@ class PredicateTest : public ::testing::Test { SchemaField::MakeOptional(2, "name", string()), SchemaField::MakeRequired(3, "age", int32()), SchemaField::MakeOptional(4, "salary", float64()), - SchemaField::MakeRequired(5, "active", boolean())}, + SchemaField::MakeRequired(5, "active", boolean()), + SchemaField::MakeRequired(6, "age2", int32())}, /*schema_id=*/0); } @@ -288,6 +289,34 @@ TEST_F(PredicateTest, UnboundPredicateToString) { EXPECT_EQ(starts_with_pred->ToString(), "ref(name=\"name\") startsWith \"John\""); } +TEST_F(PredicateTest, UnboundPredicateEquality) { + auto pred = Expressions::GreaterThan("age", Literal::Int(25)); + auto same = Expressions::GreaterThan("age", Literal::Int(25)); + auto different_op = Expressions::GreaterThanOrEqual("age", Literal::Int(25)); + auto different_ref = Expressions::GreaterThan("id", Literal::Int(25)); + auto different_literal = Expressions::GreaterThan("age", Literal::Int(26)); + + EXPECT_TRUE(pred->Equals(*same)); + EXPECT_TRUE(same->Equals(*pred)); + EXPECT_FALSE(pred->Equals(*different_op)); + EXPECT_FALSE(pred->Equals(*different_ref)); + EXPECT_FALSE(pred->Equals(*different_literal)); + + auto bucket = [](std::string name, + int32_t num_buckets) -> std::shared_ptr> { + return Expressions::Bucket(std::move(name), num_buckets); + }; + + auto transformed = Expressions::Equal(bucket("id", 16), Literal::Int(3)); + auto same_transformed = Expressions::Equal(bucket("id", 16), Literal::Int(3)); + auto different_transform = Expressions::Equal(bucket("id", 32), Literal::Int(3)); + auto different_transform_ref = Expressions::Equal(bucket("age", 16), Literal::Int(3)); + + EXPECT_TRUE(transformed->Equals(*same_transformed)); + EXPECT_FALSE(transformed->Equals(*different_transform)); + EXPECT_FALSE(transformed->Equals(*different_transform_ref)); +} + TEST_F(PredicateTest, UnboundPredicateNegate) { auto equal_pred = Expressions::Equal("age", Literal::Int(25)); auto negated_result = equal_pred->Negate(); @@ -581,10 +610,12 @@ TEST_F(PredicateTest, BoundSetPredicateEquals) { Expressions::In("age", {Literal::Int(20), Literal::Int(10)}); // Different order auto in3 = Expressions::In("age", {Literal::Int(10), Literal::Int(30)}); // Different values + auto in4 = Expressions::In("age2", {Literal::Int(10), Literal::Int(20)}); auto bound_in1 = in1->Bind(*schema_, /*case_sensitive=*/true).value(); auto bound_in2 = in2->Bind(*schema_, /*case_sensitive=*/true).value(); auto bound_in3 = in3->Bind(*schema_, /*case_sensitive=*/true).value(); + auto bound_in4 = in4->Bind(*schema_, /*case_sensitive=*/true).value(); // Same values in different order should be equal (unordered_set) EXPECT_TRUE(bound_in1->Equals(*bound_in2)); @@ -592,6 +623,9 @@ TEST_F(PredicateTest, BoundSetPredicateEquals) { // Different values should not be equal EXPECT_FALSE(bound_in1->Equals(*bound_in3)); + + // Same values on a different term should not be equal + EXPECT_FALSE(bound_in1->Equals(*bound_in4)); } namespace { diff --git a/src/iceberg/test/rest_json_serde_test.cc b/src/iceberg/test/rest_json_serde_test.cc index 9da052e6a..86c852a1a 100644 --- a/src/iceberg/test/rest_json_serde_test.cc +++ b/src/iceberg/test/rest_json_serde_test.cc @@ -17,7 +17,10 @@ * under the License. */ +#include #include +#include +#include #include #include @@ -25,14 +28,20 @@ #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/types.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/file_format.h" +#include "iceberg/manifest/manifest_entry.h" #include "iceberg/partition_spec.h" #include "iceberg/result.h" +#include "iceberg/schema.h" #include "iceberg/sort_order.h" #include "iceberg/table_identifier.h" #include "iceberg/table_metadata.h" #include "iceberg/table_requirement.h" +#include "iceberg/table_scan.h" #include "iceberg/table_update.h" #include "iceberg/test/matchers.h" +#include "iceberg/transform.h" namespace iceberg::rest { @@ -1380,4 +1389,1161 @@ INSTANTIATE_TEST_SUITE_P( return info.param.test_name; }); +// Helper: empty schema and specs for scan response tests that don't need content-file +// partition parsing. +static Schema EmptySchema() { return Schema({}, 0); } +static std::unordered_map> EmptySpecs() { + return {}; +} +static std::unordered_map> UnpartitionedSpecs() { + return {{PartitionSpec::kInitialSpecId, PartitionSpec::Unpartitioned()}}; +} +static Schema PartitionedSchema() { + return Schema({SchemaField::MakeRequired(1, "id", int32())}, 0); +} +static std::unordered_map> PartitionedSpecs( + const Schema& schema) { + auto spec_result = PartitionSpec::Make( + schema, /*spec_id=*/1, {PartitionField(1, 1000, "id", Transform::Identity())}, + /*allow_missing_fields=*/false); + if (!spec_result.has_value()) { + ADD_FAILURE() << spec_result.error().message; + return {}; + } + auto spec = std::move(spec_result.value()); + return {{spec->spec_id(), std::shared_ptr(std::move(spec))}}; +} + +// --- PlanTableScanResponse --- + +TEST(PlanTableScanResponseFromJsonTest, SubmittedStatusMissingOptionalFields) { + auto json = nlohmann::json::parse(R"({"status":"submitted","plan-id":"abc-123"})"); + auto result = PlanTableScanResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kSubmitted); + EXPECT_EQ(result->plan_id, "abc-123"); + EXPECT_FALSE(result->plan_tasks.has_value()); + EXPECT_FALSE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->delete_files.empty()); +} + +TEST(PlanTableScanResponseFromJsonTest, CompletedStatusWithPlanTasks) { + auto json = nlohmann::json::parse( + R"({"status":"completed","plan-id":"abc-123","plan-tasks":["task-1","task-2"],"delete-files":[],"file-scan-tasks":[]})"); + auto result = PlanTableScanResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kCompleted); + EXPECT_EQ(result->plan_id, "abc-123"); + ASSERT_TRUE(result->plan_tasks.has_value()); + ASSERT_EQ(result->plan_tasks->size(), 2); + EXPECT_EQ(result->plan_tasks->at(0), "task-1"); + EXPECT_EQ(result->plan_tasks->at(1), "task-2"); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->file_scan_tasks->empty()); +} + +TEST(PlanTableScanResponseFromJsonTest, FailedStatusWithError) { + auto json = nlohmann::json::parse( + R"({"status":"failed","error":{"message":"Planning failed","type":"PlanningException","code":500}})"); + auto result = PlanTableScanResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kFailed); + EXPECT_TRUE(result->plan_id.empty()); + ASSERT_TRUE(result->error.has_value()); + EXPECT_EQ(result->error->message, "Planning failed"); + EXPECT_EQ(result->error->type, "PlanningException"); + EXPECT_EQ(result->error->code, 500); +} + +struct PlanTableScanResponseInvalidParam { + std::string test_name; + std::string json_str; + ErrorKind expected_error_kind; + std::string expected_error_msg; +}; + +class PlanTableScanResponseInvalidTest + : public ::testing::TestWithParam {}; + +TEST_P(PlanTableScanResponseInvalidTest, InvalidInput) { + const auto& param = GetParam(); + auto result = PlanTableScanResponseFromJson(nlohmann::json::parse(param.json_str), + UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsError(param.expected_error_kind)); + if (!param.expected_error_msg.empty()) { + EXPECT_THAT(result, HasErrorMessage(param.expected_error_msg)); + } +} + +INSTANTIATE_TEST_SUITE_P( + PlanTableScanResponseInvalidCases, PlanTableScanResponseInvalidTest, + ::testing::Values( + PlanTableScanResponseInvalidParam{ + .test_name = "EmptyJson", + .json_str = R"({})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'status'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "UnknownStatus", + .json_str = R"({"status":"someStatus"})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Unknown plan status"}, + PlanTableScanResponseInvalidParam{ + .test_name = "SubmittedWithoutPlanId", + .json_str = R"({"status":"submitted"})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "plan id should be defined when status is 'submitted'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "CancelledStatus", + .json_str = R"({"status":"cancelled"})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "'cancelled' is not a valid status for planTableScan"}, + PlanTableScanResponseInvalidParam{ + .test_name = "SubmittedWithTasks", + .json_str = + R"({"status":"submitted","plan-id":"somePlanId","plan-tasks":["task1","task2"]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "tasks can only be defined when status is 'completed'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "SubmittedWithEmptyTasks", + .json_str = + R"({"status":"submitted","plan-id":"somePlanId","plan-tasks":[]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "tasks can only be defined when status is 'completed'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "FailedWithPlanId", + .json_str = + R"({"status":"failed","plan-id":"somePlanId","error":{"message":"x","type":"y","code":500}})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = + "plan id can only be defined when status is 'submitted' or 'completed'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "FailedWithoutError", + .json_str = R"({"status":"failed"})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'error'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "CompletedWithError", + .json_str = + R"({"status":"completed","error":{"message":"x","type":"y","code":500}})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "error can only be present when status is 'failed'"}, + PlanTableScanResponseInvalidParam{ + .test_name = "DeleteFilesWithoutFileScanTasks", + .json_str = + R"({"status":"completed","delete-files":[{"content":"position-deletes","file-path":"s3://bucket/d.parquet","file-format":"PARQUET","spec-id":0,"partition":[],"file-size-in-bytes":512,"record-count":5}],"file-scan-tasks":[]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = + "deleteFiles should only be returned with fileScanTasks"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +// --- FetchPlanningResultResponse --- + +TEST(FetchPlanningResultResponseFromJsonTest, SubmittedStatusNoTasks) { + auto json = nlohmann::json::parse(R"({"status":"submitted"})"); + auto result = FetchPlanningResultResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kSubmitted); + EXPECT_FALSE(result->plan_tasks.has_value()); + EXPECT_FALSE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->delete_files.empty()); +} + +TEST(FetchPlanningResultResponseFromJsonTest, CompletedStatusWithPlanTasks) { + auto json = nlohmann::json::parse( + R"({"status":"completed","plan-tasks":["task-1"],"delete-files":[],"file-scan-tasks":[]})"); + auto result = FetchPlanningResultResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kCompleted); + ASSERT_TRUE(result->plan_tasks.has_value()); + ASSERT_EQ(result->plan_tasks->size(), 1); + EXPECT_EQ(result->plan_tasks->at(0), "task-1"); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->file_scan_tasks->empty()); +} + +TEST(FetchPlanningResultResponseFromJsonTest, FailedStatusWithError) { + auto json = nlohmann::json::parse( + R"({"status":"failed","error":{"message":"Planning failed","type":"PlanningException","code":500}})"); + auto result = FetchPlanningResultResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->plan_status, PlanStatus::kFailed); + ASSERT_TRUE(result->error.has_value()); + EXPECT_EQ(result->error->message, "Planning failed"); + EXPECT_EQ(result->error->type, "PlanningException"); + EXPECT_EQ(result->error->code, 500); +} + +struct FetchPlanningResultResponseInvalidParam { + std::string test_name; + std::string json_str; + ErrorKind expected_error_kind; + std::string expected_error_msg; +}; + +class FetchPlanningResultResponseInvalidTest + : public ::testing::TestWithParam {}; + +TEST_P(FetchPlanningResultResponseInvalidTest, InvalidInput) { + const auto& param = GetParam(); + auto result = FetchPlanningResultResponseFromJson(nlohmann::json::parse(param.json_str), + UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsError(param.expected_error_kind)); + if (!param.expected_error_msg.empty()) { + EXPECT_THAT(result, HasErrorMessage(param.expected_error_msg)); + } +} + +INSTANTIATE_TEST_SUITE_P( + FetchPlanningResultResponseInvalidCases, FetchPlanningResultResponseInvalidTest, + ::testing::Values( + FetchPlanningResultResponseInvalidParam{ + .test_name = "EmptyJson", + .json_str = R"({})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'status'"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "UnknownStatus", + .json_str = R"({"status":"someStatus"})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Unknown plan status"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "SubmittedWithTasks", + .json_str = R"({"status":"submitted","plan-tasks":["task1","task2"]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "tasks can only be returned in a 'completed' status"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "SubmittedWithEmptyTasks", + .json_str = R"({"status":"submitted","plan-tasks":[]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "tasks can only be returned in a 'completed' status"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "DeleteFilesWithoutFileScanTasks", + .json_str = + R"({"status":"submitted","delete-files":[{"content":"position-deletes","file-path":"s3://bucket/d.parquet","file-format":"PARQUET","spec-id":0,"partition":[],"file-size-in-bytes":512,"record-count":5}]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = + "deleteFiles should only be returned with fileScanTasks"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "FailedWithoutError", + .json_str = R"({"status":"failed"})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'error'"}, + FetchPlanningResultResponseInvalidParam{ + .test_name = "CompletedWithError", + .json_str = + R"({"status":"completed","error":{"message":"x","type":"y","code":500}})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "error can only be present when status is 'failed'"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +// --- FetchScanTasksResponse --- + +TEST(FetchScanTasksResponseFromJsonTest, WithFileScanTasks) { + auto json = nlohmann::json::parse(R"({ + "plan-tasks": [], + "delete-files": [ + { + "content": "position-deletes", + "file-path": "s3://bucket/deletes/delete.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 512, + "record-count": 5 + } + ], + "file-scan-tasks": [ + { + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + }, + "delete-file-references": [0] + } + ] + })"); + auto result = FetchScanTasksResponseFromJson(json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->plan_tasks.has_value()); + EXPECT_TRUE(result->plan_tasks->empty()); + ASSERT_EQ(result->delete_files.size(), 1); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + ASSERT_EQ(result->file_scan_tasks->size(), 1); + EXPECT_EQ(result->file_scan_tasks->at(0)->data_file()->file_path, + "s3://bucket/data/file.parquet"); + ASSERT_EQ(result->file_scan_tasks->at(0)->delete_files().size(), 1); + EXPECT_EQ(result->file_scan_tasks->at(0)->delete_files()[0]->file_path, + "s3://bucket/deletes/delete.parquet"); +} + +TEST(FetchScanTasksResponseFromJsonTest, WithPlanTasksOnly) { + auto json = nlohmann::json::parse( + R"({"plan-tasks":["task-1","task-2"],"delete-files":[],"file-scan-tasks":[]})"); + auto result = FetchScanTasksResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->plan_tasks.has_value()); + ASSERT_EQ(result->plan_tasks->size(), 2); + EXPECT_EQ(result->plan_tasks->at(0), "task-1"); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->file_scan_tasks->empty()); +} + +TEST(FetchScanTasksResponseFromJsonTest, AllowsPresentEmptyTaskFields) { + auto json = nlohmann::json::parse( + R"({"plan-tasks":[],"delete-files":[],"file-scan-tasks":[]})"); + auto result = FetchScanTasksResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->plan_tasks.has_value()); + EXPECT_TRUE(result->plan_tasks->empty()); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + EXPECT_TRUE(result->file_scan_tasks->empty()); +} + +struct FetchScanTasksResponseInvalidParam { + std::string test_name; + std::string json_str; + ErrorKind expected_error_kind; + std::string expected_error_msg; +}; + +class FetchScanTasksResponseInvalidTest + : public ::testing::TestWithParam {}; + +TEST_P(FetchScanTasksResponseInvalidTest, InvalidInput) { + const auto& param = GetParam(); + auto result = FetchScanTasksResponseFromJson(nlohmann::json::parse(param.json_str), + UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsError(param.expected_error_kind)); + if (!param.expected_error_msg.empty()) { + EXPECT_THAT(result, HasErrorMessage(param.expected_error_msg)); + } +} + +INSTANTIATE_TEST_SUITE_P( + FetchScanTasksResponseInvalidCases, FetchScanTasksResponseInvalidTest, + ::testing::Values( + FetchScanTasksResponseInvalidParam{ + .test_name = "EmptyJson", + .json_str = R"({})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "planTasks and fileScanTask cannot both be null"}, + FetchScanTasksResponseInvalidParam{ + .test_name = "NullPlanTasks", + .json_str = R"({"plan-tasks":null})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'plan-tasks'"}, + FetchScanTasksResponseInvalidParam{ + .test_name = "NullFileScanTasks", + .json_str = R"({"file-scan-tasks":null})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'file-scan-tasks'"}, + FetchScanTasksResponseInvalidParam{ + .test_name = "NullDeleteFiles", + .json_str = R"({"plan-tasks":[],"delete-files":null})", + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "Missing 'delete-files'"}, + FetchScanTasksResponseInvalidParam{ + .test_name = "DeleteFilesWithoutFileScanTasks", + .json_str = + R"({"plan-tasks":["task1","task2"],"delete-files":[{"content":"position-deletes","file-path":"s3://bucket/d.parquet","file-format":"PARQUET","spec-id":0,"partition":[],"file-size-in-bytes":512,"record-count":5}],"file-scan-tasks":[]})", + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = + "deleteFiles should only be returned with fileScanTasks"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +// --- PlanTableScanRequest validation --- + +struct PlanTableScanRequestValidationParam { + std::string test_name; + PlanTableScanRequest request; + std::string expected_error_msg; +}; + +class PlanTableScanRequestValidationTest + : public ::testing::TestWithParam {}; + +TEST_P(PlanTableScanRequestValidationTest, ValidationFailed) { + const auto& param = GetParam(); + auto status = param.request.Validate(); + ASSERT_THAT(status, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(status, HasErrorMessage(param.expected_error_msg)); +} + +INSTANTIATE_TEST_SUITE_P( + PlanTableScanRequestValidationCases, PlanTableScanRequestValidationTest, + ::testing::Values( + PlanTableScanRequestValidationParam{ + .test_name = "SnapshotIdWithStartSnapshotId", + .request = {.snapshot_id = 1, .start_snapshot_id = 2, .end_snapshot_id = 5}, + .expected_error_msg = + "cannot provide both snapshotId and startSnapshotId/endSnapshotId"}, + PlanTableScanRequestValidationParam{ + .test_name = "SnapshotIdWithEndSnapshotId", + .request = {.snapshot_id = 1, .end_snapshot_id = 5}, + .expected_error_msg = + "cannot provide both snapshotId and startSnapshotId/endSnapshotId"}, + PlanTableScanRequestValidationParam{ + .test_name = "StartSnapshotIdWithoutEnd", + .request = {.start_snapshot_id = 1}, + .expected_error_msg = "startSnapshotId and endSnapshotId is required"}, + PlanTableScanRequestValidationParam{ + .test_name = "EndSnapshotIdWithoutStart", + .request = {.end_snapshot_id = 5}, + .expected_error_msg = "startSnapshotId and endSnapshotId is required"}, + PlanTableScanRequestValidationParam{ + .test_name = "NegativeMinRowsRequested", + .request = {.min_rows_requested = -1}, + .expected_error_msg = "minRowsRequested is negative"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +TEST(PlanTableScanRequestEqualityTest, ComparesFilterByExpressionContent) { + PlanTableScanRequest lhs; + lhs.filter = Expressions::GreaterThan("id", Literal::Int(10)); + + PlanTableScanRequest rhs; + rhs.filter = Expressions::GreaterThan("id", Literal::Int(10)); + + ASSERT_NE(lhs.filter, rhs.filter); + EXPECT_EQ(lhs, rhs); +} + +TEST(PlanTableScanRequestJsonSerdeTest, RoundtripAndDefaults) { + PlanTableScanRequest request; + request.snapshot_id = 123; + request.select = {"id", "data"}; + request.filter = Expressions::GreaterThan("id", Literal::Long(10)); + request.case_sensitive = false; + request.use_snapshot_schema = true; + request.stats_fields = {"id"}; + request.min_rows_requested = 100; + + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(request)); + auto result = PlanTableScanRequestFromJson(json); + + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(*result, request); + + auto defaults_result = PlanTableScanRequestFromJson(R"({"select":["id"]})"_json); + + ASSERT_THAT(defaults_result, IsOk()); + EXPECT_EQ(defaults_result->select, std::vector{"id"}); + EXPECT_TRUE(defaults_result->case_sensitive); + EXPECT_FALSE(defaults_result->use_snapshot_schema); +} + +TEST(FetchScanTasksRequestJsonSerdeTest, Roundtrip) { + FetchScanTasksRequest request{.planTask = "task-token"}; + + auto json = ToJson(request); + auto result = FetchScanTasksRequestFromJson(json); + + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(*result, request); +} + +struct ScanRequestFromJsonInvalidParam { + std::string test_name; + nlohmann::json json; + std::function(const nlohmann::json&)> parse; + ErrorKind expected_error_kind; + std::string expected_error_msg; +}; + +class ScanRequestFromJsonInvalidTest + : public ::testing::TestWithParam {}; + +TEST_P(ScanRequestFromJsonInvalidTest, InvalidInput) { + const auto& param = GetParam(); + auto result = param.parse(param.json); + ASSERT_THAT(result, IsError(param.expected_error_kind)); + EXPECT_THAT(result, HasErrorMessage(param.expected_error_msg)); +} + +INSTANTIATE_TEST_SUITE_P( + ScanRequestFromJsonInvalidCases, ScanRequestFromJsonInvalidTest, + ::testing::Values( + ScanRequestFromJsonInvalidParam{ + .test_name = "PlanTableScanMissingEndSnapshotId", + .json = R"({"start-snapshot-id":1})"_json, + .parse = [](const nlohmann::json& json) -> Result { + ICEBERG_ASSIGN_OR_RAISE(auto request, PlanTableScanRequestFromJson(json)); + return {}; + }, + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_msg = "startSnapshotId and endSnapshotId is required"}, + ScanRequestFromJsonInvalidParam{ + .test_name = "FetchScanTasksMissingPlanTask", + .json = nlohmann::json::object(), + .parse = [](const nlohmann::json& json) -> Result { + ICEBERG_ASSIGN_OR_RAISE(auto request, FetchScanTasksRequestFromJson(json)); + return {}; + }, + .expected_error_kind = ErrorKind::kJsonParseError, + .expected_error_msg = "plan-task"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +// --- DataFileFromJson --- + +TEST(DataFileFromJsonTest, RequiredFieldsOnly) { + auto json = R"({ + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + const auto& df = result.value(); + EXPECT_EQ(df.content, DataFile::Content::kData); + EXPECT_EQ(df.file_path, "s3://bucket/data/file.parquet"); + EXPECT_EQ(df.file_format, FileFormatType::kParquet); + EXPECT_EQ(df.file_size_in_bytes, 12345); + EXPECT_EQ(df.record_count, 100); + EXPECT_TRUE(df.column_sizes.empty()); + EXPECT_FALSE(df.sort_order_id.has_value()); + EXPECT_EQ(df.partition_spec_id, PartitionSpec::kInitialSpecId); + EXPECT_EQ(df.partition.num_fields(), 0); +} + +TEST(DataFileFromJsonTest, LowercaseFormat) { + auto json = R"({ + "content": "data", + "file-path": "s3://bucket/data/file.avro", + "file-format": "avro", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 500, + "record-count": 10 + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result.value().content, DataFile::Content::kData); + EXPECT_EQ(result.value().file_format, FileFormatType::kAvro); +} + +TEST(DataFileFromJsonTest, WithOptionalFields) { + auto json = R"({ + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100, + "column-sizes": {"keys": [1, 2], "values": [1000, 2000]}, + "value-counts": {"keys": [1, 2], "values": [100, 100]}, + "null-value-counts": {"keys": [1], "values": [0]}, + "nan-value-counts": {"keys": [2], "values": [5]}, + "split-offsets": [0, 4096], + "sort-order-id": 0 + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + const auto& df = result.value(); + EXPECT_EQ(df.partition_spec_id, PartitionSpec::kInitialSpecId); + ASSERT_EQ(df.column_sizes.size(), 2U); + EXPECT_EQ(df.column_sizes.at(1), 1000); + EXPECT_EQ(df.column_sizes.at(2), 2000); + ASSERT_EQ(df.value_counts.size(), 2U); + EXPECT_EQ(df.value_counts.at(1), 100); + ASSERT_EQ(df.null_value_counts.size(), 1U); + EXPECT_EQ(df.null_value_counts.at(1), 0); + ASSERT_EQ(df.nan_value_counts.size(), 1U); + EXPECT_EQ(df.nan_value_counts.at(2), 5); + ASSERT_EQ(df.split_offsets.size(), 2U); + EXPECT_EQ(df.split_offsets[0], 0); + EXPECT_EQ(df.split_offsets[1], 4096); + EXPECT_EQ(df.sort_order_id, 0); +} + +TEST(DataFileFromJsonTest, EqualityDeleteFile) { + auto json = R"({ + "content": "equality-deletes", + "file-path": "s3://bucket/deletes/eq_delete.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 5000, + "record-count": 50, + "equality-ids": [1, 2] + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + const auto& df = result.value(); + EXPECT_EQ(df.content, DataFile::Content::kEqualityDeletes); + ASSERT_EQ(df.equality_ids.size(), 2U); + EXPECT_EQ(df.equality_ids[0], 1); + EXPECT_EQ(df.equality_ids[1], 2); +} + +TEST(DataFileFromJsonTest, PositionDeleteFileWithReferencedDataFile) { + auto json = R"({ + "content": "position-deletes", + "file-path": "s3://bucket/deletes/pos_delete.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 3000, + "record-count": 20, + "referenced-data-file": "s3://bucket/data/file.parquet" + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + const auto& df = result.value(); + EXPECT_EQ(df.content, DataFile::Content::kPositionDeletes); + ASSERT_TRUE(df.referenced_data_file.has_value()); + EXPECT_EQ(df.referenced_data_file.value(), "s3://bucket/data/file.parquet"); +} + +TEST(DataFileFromJsonTest, InvalidContentType) { + auto json = R"({ + "content": "UNKNOWN", + "file-path": "s3://bucket/file.parquet", + "file-format": "PARQUET", + "file-size-in-bytes": 100, + "record-count": 10 + })"_json; + + auto result = DataFileFromJson(json, {}, Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("Unknown data file content")); +} + +TEST(DataFileFromJsonTest, MissingRequiredField) { + auto json = R"({ + "content": "data", + "file-format": "PARQUET", + "file-size-in-bytes": 100, + "record-count": 10 + })"_json; + + auto result = DataFileFromJson(json, {}, Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); +} + +TEST(DataFileFromJsonTest, MissingSpecId) { + auto json = R"({ + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "partition": [], + "file-size-in-bytes": 100, + "record-count": 10 + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("Missing 'spec-id'")); +} + +TEST(DataFileFromJsonTest, MissingPartition) { + auto json = R"({ + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "file-size-in-bytes": 100, + "record-count": 10 + })"_json; + + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("Missing 'partition'")); +} + +TEST(DataFileFromJsonTest, NotAnObject) { + auto result = DataFileFromJson(nlohmann::json::array(), {}, Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("DataFile must be a JSON object")); +} + +TEST(DataFileRoundtripTest, PartitionedFileRequiresMatchingSpecForSerialization) { + auto schema = PartitionedSchema(); + auto specs = PartitionedSpecs(schema); + + DataFile df; + df.content = DataFile::Content::kData; + df.file_path = "s3://bucket/data/file.parquet"; + df.file_format = FileFormatType::kParquet; + df.partition_spec_id = 1; + df.partition = PartitionValues({Literal::Int(34)}); + df.file_size_in_bytes = 12345; + df.record_count = 100; + + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(df, specs, schema)); + EXPECT_EQ(json["partition"], nlohmann::json::array({34})); + + auto parsed = DataFileFromJson(json, specs, schema); + ASSERT_THAT(parsed, IsOk()); + EXPECT_EQ(parsed->partition_spec_id, 1); + ASSERT_EQ(parsed->partition.num_fields(), 1); + EXPECT_EQ(parsed->partition.values()[0], Literal::Int(34)); +} + +DataFile MakeDataFileForSerializationTest(std::optional spec_id, + PartitionValues partition) { + DataFile df; + df.content = DataFile::Content::kData; + df.file_path = "s3://bucket/data/file.parquet"; + df.file_format = FileFormatType::kParquet; + df.partition_spec_id = spec_id; + df.partition = std::move(partition); + df.file_size_in_bytes = 12345; + df.record_count = 100; + return df; +} + +enum class DataFileToJsonInvalidCase { + kPartitionedSpecWithoutPartitionData, + kUnknownSpec, + kMismatchedSpecId, + kMissingSpecId, +}; + +struct DataFileToJsonInvalidParam { + std::string test_name; + DataFileToJsonInvalidCase test_case; + std::string expected_error_msg; +}; + +class DataFileToJsonInvalidTest + : public ::testing::TestWithParam {}; + +TEST_P(DataFileToJsonInvalidTest, InvalidInput) { + const auto& param = GetParam(); + Result result = JsonParseError("uninitialized"); + switch (param.test_case) { + case DataFileToJsonInvalidCase::kPartitionedSpecWithoutPartitionData: { + auto schema = PartitionedSchema(); + result = ToJson(MakeDataFileForSerializationTest(1, PartitionValues{}), + PartitionedSpecs(schema), schema); + break; + } + case DataFileToJsonInvalidCase::kUnknownSpec: { + auto schema = PartitionedSchema(); + result = + ToJson(MakeDataFileForSerializationTest(2, PartitionValues({Literal::Int(34)})), + PartitionedSpecs(schema), schema); + break; + } + case DataFileToJsonInvalidCase::kMismatchedSpecId: { + auto schema = PartitionedSchema(); + auto partitioned_specs = PartitionedSpecs(schema); + auto specs = std::unordered_map>{ + {2, partitioned_specs.at(1)}}; + result = + ToJson(MakeDataFileForSerializationTest(2, PartitionValues({Literal::Int(34)})), + specs, schema); + break; + } + case DataFileToJsonInvalidCase::kMissingSpecId: { + auto schema = PartitionedSchema(); + result = ToJson(MakeDataFileForSerializationTest(std::nullopt, PartitionValues{}), + PartitionedSpecs(schema), schema); + break; + } + } + + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage(param.expected_error_msg)); +} + +INSTANTIATE_TEST_SUITE_P( + DataFileToJsonInvalidCases, DataFileToJsonInvalidTest, + ::testing::Values( + DataFileToJsonInvalidParam{ + .test_name = "PartitionedSpecWithoutPartitionData", + .test_case = DataFileToJsonInvalidCase::kPartitionedSpecWithoutPartitionData, + .expected_error_msg = "Invalid partition data from content file"}, + DataFileToJsonInvalidParam{.test_name = "UnknownSpec", + .test_case = DataFileToJsonInvalidCase::kUnknownSpec, + .expected_error_msg = "Invalid partition spec: null"}, + DataFileToJsonInvalidParam{ + .test_name = "MismatchedSpecId", + .test_case = DataFileToJsonInvalidCase::kMismatchedSpecId, + .expected_error_msg = "Invalid partition spec id from content file"}, + DataFileToJsonInvalidParam{ + .test_name = "MissingSpecId", + .test_case = DataFileToJsonInvalidCase::kMissingSpecId, + .expected_error_msg = "Invalid partition spec id from content file"}), + [](const ::testing::TestParamInfo& info) { + return info.param.test_name; + }); + +// --- FileScanTasksFromJson --- + +TEST(FileScanTasksFromJsonTest, EmptyArray) { + auto result = FileScanTasksFromJson(nlohmann::json::array(), {}, {}, Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + EXPECT_TRUE(result.value().empty()); +} + +TEST(FileScanTasksFromJsonTest, SingleTaskNoDeleteFiles) { + auto json = R"([{ + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + } + }])"_json; + + auto result = FileScanTasksFromJson(json, {}, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + ASSERT_EQ(result.value().size(), 1U); + const auto& task = result.value()[0]; + ASSERT_NE(task->data_file(), nullptr); + EXPECT_EQ(task->data_file()->file_path, "s3://bucket/data/file.parquet"); + EXPECT_TRUE(task->delete_files().empty()); + EXPECT_EQ(task->residual_filter(), nullptr); +} + +TEST(FileScanTasksFromJsonTest, TaskWithDeleteFileReferences) { + DataFile delete_file; + delete_file.content = DataFile::Content::kPositionDeletes; + delete_file.file_path = "s3://bucket/deletes/pos_delete.parquet"; + delete_file.file_format = FileFormatType::kParquet; + delete_file.partition_spec_id = PartitionSpec::kInitialSpecId; + delete_file.partition = PartitionValues{}; + delete_file.file_size_in_bytes = 1000; + delete_file.record_count = 5; + + auto json = R"([{ + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + }, + "delete-file-references": [0] + }])"_json; + + auto result = FileScanTasksFromJson(json, {std::make_shared(delete_file)}, + UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + ASSERT_EQ(result.value().size(), 1U); + const auto& task = result.value()[0]; + ASSERT_EQ(task->delete_files().size(), 1U); + EXPECT_EQ(task->delete_files()[0]->file_path, "s3://bucket/deletes/pos_delete.parquet"); +} + +TEST(FileScanTasksFromJsonTest, DeleteFileReferenceOutOfRange) { + auto json = R"([{ + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 100, + "record-count": 10 + }, + "delete-file-references": [5] + }])"_json; + + auto result = FileScanTasksFromJson(json, {}, UnpartitionedSpecs(), Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("out of range")); +} + +TEST(FileScanTasksFromJsonTest, NotAnArray) { + auto result = FileScanTasksFromJson(nlohmann::json::object(), {}, {}, Schema({}, 0)); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("non-array")); +} + +// --- Roundtrip tests --- + +TEST(DataFileRoundtripTest, RequiredFieldsOnly) { + DataFile df; + df.content = DataFile::Content::kData; + df.file_path = "s3://bucket/data/file.parquet"; + df.file_format = FileFormatType::kParquet; + df.partition_spec_id = PartitionSpec::kInitialSpecId; + df.partition = PartitionValues{}; + df.file_size_in_bytes = 12345; + df.record_count = 100; + + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(df, UnpartitionedSpecs(), Schema({}, 0))); + EXPECT_TRUE(json.contains("partition")); + EXPECT_EQ(json["partition"], nlohmann::json::array()); + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result.value(), df); +} + +TEST(DataFileRoundtripTest, WithOptionalFields) { + DataFile df; + df.content = DataFile::Content::kPositionDeletes; + df.file_path = "s3://bucket/deletes/pos.parquet"; + df.file_format = FileFormatType::kParquet; + df.file_size_in_bytes = 5000; + df.record_count = 50; + df.partition_spec_id = PartitionSpec::kInitialSpecId; + df.partition = PartitionValues{}; + df.column_sizes = {{1, 1000}, {2, 2000}}; + df.value_counts = {{1, 100}, {2, 100}}; + df.null_value_counts = {{1, 0}}; + df.nan_value_counts = {{2, 5}}; + df.split_offsets = {0, 4096}; + df.sort_order_id = 0; + df.referenced_data_file = "s3://bucket/data/file.parquet"; + + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(df, UnpartitionedSpecs(), Schema({}, 0))); + auto result = DataFileFromJson(json, UnpartitionedSpecs(), Schema({}, 0)); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result.value(), df); +} + +TEST(FetchScanTasksResponseRoundtripTest, WithFileScanTasksAndDeleteFiles) { + auto json = nlohmann::json::parse(R"({ + "plan-tasks": [], + "delete-files": [ + { + "content": "position-deletes", + "file-path": "s3://bucket/deletes/delete.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 512, + "record-count": 5 + } + ], + "file-scan-tasks": [ + { + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + }, + "delete-file-references": [0] + } + ] + })"); + + auto result = FetchScanTasksResponseFromJson(json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, UnpartitionedSpecs(), EmptySchema())); + auto result2 = + FetchScanTasksResponseFromJson(roundtrip_json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + +TEST(FetchScanTasksResponseRoundtripTest, PreservesResidualFilter) { + auto json = nlohmann::json::parse(R"({ + "file-scan-tasks": [ + { + "data-file": { + "content": "data", + "file-path": "s3://bucket/data/file.parquet", + "file-format": "PARQUET", + "spec-id": 0, + "partition": [], + "file-size-in-bytes": 12345, + "record-count": 100 + }, + "residual-filter": {"type": "gt", "term": "id", "value": 21} + } + ] + })"); + + auto result = FetchScanTasksResponseFromJson(json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + ASSERT_EQ(result->file_scan_tasks->size(), 1); + ASSERT_NE(result->file_scan_tasks->at(0)->residual_filter(), nullptr); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, UnpartitionedSpecs(), EmptySchema())); + ASSERT_EQ(roundtrip_json["file-scan-tasks"].size(), 1); + ASSERT_TRUE(roundtrip_json["file-scan-tasks"][0].contains("residual-filter")); + EXPECT_EQ(roundtrip_json["file-scan-tasks"][0]["residual-filter"], + json["file-scan-tasks"][0]["residual-filter"]); + + auto result2 = + FetchScanTasksResponseFromJson(roundtrip_json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + +TEST(FetchScanTasksResponseRoundtripTest, ToJsonDerivesDeleteFilesFromTasks) { + auto data_file = std::make_shared(); + data_file->content = DataFile::Content::kData; + data_file->file_path = "s3://bucket/data/file.parquet"; + data_file->file_format = FileFormatType::kParquet; + data_file->partition_spec_id = PartitionSpec::kInitialSpecId; + data_file->partition = PartitionValues{}; + data_file->file_size_in_bytes = 12345; + data_file->record_count = 100; + + auto delete_file = std::make_shared(); + delete_file->content = DataFile::Content::kPositionDeletes; + delete_file->file_path = "s3://bucket/deletes/delete.parquet"; + delete_file->file_format = FileFormatType::kParquet; + delete_file->partition_spec_id = PartitionSpec::kInitialSpecId; + delete_file->partition = PartitionValues{}; + delete_file->file_size_in_bytes = 512; + delete_file->record_count = 5; + + FetchScanTasksResponse response; + response.file_scan_tasks = std::vector>{}; + response.file_scan_tasks->push_back( + std::make_shared(data_file, std::vector{delete_file})); + + ICEBERG_UNWRAP_OR_FAIL(auto json, + ToJson(response, UnpartitionedSpecs(), EmptySchema())); + ASSERT_TRUE(json.contains("delete-files")); + ASSERT_TRUE(json.contains("file-scan-tasks")); + ASSERT_EQ(json["delete-files"].size(), 1); + EXPECT_EQ(json["delete-files"][0]["file-path"], delete_file->file_path); + ASSERT_EQ(json["file-scan-tasks"].size(), 1); + ASSERT_TRUE(json["file-scan-tasks"][0].contains("delete-file-references")); + EXPECT_EQ(json["file-scan-tasks"][0]["delete-file-references"], + nlohmann::json::array({0})); + + auto result = FetchScanTasksResponseFromJson(json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + ASSERT_EQ(result->file_scan_tasks->size(), 1); + ASSERT_EQ(result->file_scan_tasks->at(0)->delete_files().size(), 1); + EXPECT_EQ(result->file_scan_tasks->at(0)->delete_files()[0]->file_path, + delete_file->file_path); +} + +TEST(FetchScanTasksResponseRoundtripTest, ToJsonKeepsDeleteFilesWithSamePath) { + auto data_file = std::make_shared(); + data_file->content = DataFile::Content::kData; + data_file->file_path = "s3://bucket/data/file.parquet"; + data_file->file_format = FileFormatType::kParquet; + data_file->partition_spec_id = PartitionSpec::kInitialSpecId; + data_file->partition = PartitionValues{}; + data_file->file_size_in_bytes = 12345; + data_file->record_count = 100; + + auto delete_file_a = std::make_shared(); + delete_file_a->content = DataFile::Content::kPositionDeletes; + delete_file_a->file_path = "s3://bucket/deletes/dv.puffin"; + delete_file_a->file_format = FileFormatType::kPuffin; + delete_file_a->partition_spec_id = PartitionSpec::kInitialSpecId; + delete_file_a->partition = PartitionValues{}; + delete_file_a->file_size_in_bytes = 1024; + delete_file_a->record_count = 5; + delete_file_a->content_offset = 10; + delete_file_a->content_size_in_bytes = 100; + + auto delete_file_b = std::make_shared(*delete_file_a); + delete_file_b->content_offset = 110; + delete_file_b->content_size_in_bytes = 120; + + FetchScanTasksResponse response; + response.file_scan_tasks = std::vector>{}; + response.file_scan_tasks->push_back(std::make_shared( + data_file, std::vector{delete_file_a, delete_file_b})); + + ICEBERG_UNWRAP_OR_FAIL(auto json, + ToJson(response, UnpartitionedSpecs(), EmptySchema())); + ASSERT_EQ(json["delete-files"].size(), 2); + EXPECT_EQ(json["file-scan-tasks"][0]["delete-file-references"], + nlohmann::json::array({0, 1})); + + auto result = FetchScanTasksResponseFromJson(json, UnpartitionedSpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + ASSERT_TRUE(result->file_scan_tasks.has_value()); + ASSERT_EQ(result->file_scan_tasks->at(0)->delete_files().size(), 2); + EXPECT_EQ(result->file_scan_tasks->at(0)->delete_files()[0]->content_offset, 10); + EXPECT_EQ(result->file_scan_tasks->at(0)->delete_files()[1]->content_offset, 110); +} + +TEST(PlanTableScanResponseRoundtripTest, SubmittedStatus) { + auto json = nlohmann::json::parse(R"({"status": "submitted", "plan-id": "abc-123"})"); + auto result = PlanTableScanResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, EmptySpecs(), EmptySchema())); + auto result2 = + PlanTableScanResponseFromJson(roundtrip_json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + +TEST(PlanTableScanResponseRoundtripTest, FailedWithError) { + auto json = nlohmann::json::parse( + R"({"status":"failed","error":{"message":"Planning failed","type":"PlanningException","code":500}})"); + auto result = PlanTableScanResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, EmptySpecs(), EmptySchema())); + auto result2 = + PlanTableScanResponseFromJson(roundtrip_json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + +TEST(FetchPlanningResultResponseRoundtripTest, CompletedWithPlanTasks) { + auto json = nlohmann::json::parse( + R"({"status": "completed", "plan-tasks": ["task-1", "task-2"]})"); + auto result = FetchPlanningResultResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, EmptySpecs(), EmptySchema())); + auto result2 = + FetchPlanningResultResponseFromJson(roundtrip_json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + +TEST(FetchPlanningResultResponseRoundtripTest, FailedWithError) { + auto json = nlohmann::json::parse( + R"({"status":"failed","error":{"message":"Planning failed","type":"PlanningException","code":500}})"); + auto result = FetchPlanningResultResponseFromJson(json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result, IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto roundtrip_json, + ToJson(*result, EmptySpecs(), EmptySchema())); + auto result2 = + FetchPlanningResultResponseFromJson(roundtrip_json, EmptySpecs(), EmptySchema()); + ASSERT_THAT(result2, IsOk()); + EXPECT_EQ(*result, *result2); +} + } // namespace iceberg::rest From c0e6e86dd2614fdb1cb0d19dbaed324c3868930f Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 9 Jun 2026 22:54:55 +0800 Subject: [PATCH 067/151] chore: disable installing googletest libs (#711) --- src/iceberg/test/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index e18b63d5c..2d56d7f35 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -17,6 +17,10 @@ set(CMAKE_COMPILE_WARNING_AS_ERROR FALSE) +set(INSTALL_GTEST + OFF + CACHE BOOL "" FORCE) + fetchcontent_declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG b514bdc898e2951020cbdca1304b75f5950d1f59 # release-1.15.2 From f9949ac2445d836a61d45d5cdaf07395c7665b7c Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 10 Jun 2026 09:40:37 +0800 Subject: [PATCH 068/151] fix: avoid stale gh run watch in RC release script (#712) Allow release_rc.sh to resume from an existing GitHub Actions run by setting RELEASE_RUN_ID, and add RELEASE_WATCH=0 to poll run/job status with plain gh run view output instead of gh run watch. This avoids getting stuck on stale gh run watch terminal output while keeping the default release flow unchanged. --- dev/release/release_rc.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index 021f64a11..1e13e5260 100755 --- a/dev/release/release_rc.sh +++ b/dev/release/release_rc.sh @@ -44,6 +44,8 @@ rc=$2 : "${RELEASE_PUSH_TAG:=${RELEASE_DEFAULT}}" : "${RELEASE_SIGN:=${RELEASE_DEFAULT}}" : "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}" +: "${RELEASE_WATCH:=${RELEASE_DEFAULT}}" +: "${RELEASE_WATCH_INTERVAL:=30}" cd "${SOURCE_TOP_DIR}" @@ -81,7 +83,7 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then repository="${repository%.git}" echo "Looking for GitHub Actions workflow on ${repository}:${rc_tag}" - run_id="" + run_id="${RELEASE_RUN_ID:-}" while [ -z "${run_id}" ]; do echo "Waiting for run to start..." run_id=$(gh run list \ @@ -93,7 +95,33 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then done echo "Found GitHub Actions workflow with ID: ${run_id}" - gh run watch --repo "${repository}" --exit-status "${run_id}" + if [ "${RELEASE_WATCH}" -gt 0 ]; then + gh run watch --repo "${repository}" --exit-status "${run_id}" + else + while true; do + run_status=$(gh run view \ + --repo "${repository}" \ + --json 'status,conclusion' \ + --jq '.status + " " + (.conclusion // "")' \ + "${run_id}") + echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" + gh run view \ + --repo "${repository}" \ + --json jobs \ + --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ + "${run_id}" + case "${run_status}" in + "completed success") + break + ;; + completed\ *) + echo "GitHub Actions workflow did not complete successfully: ${run_status}" + exit 1 + ;; + esac + sleep "${RELEASE_WATCH_INTERVAL}" + done + fi mkdir -p "${rc_id}" From 50aee7e3fd3ef2aa82dcb930b8ad60c2fa872e8a Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 10 Jun 2026 09:41:28 +0800 Subject: [PATCH 069/151] fix: align manifest partition reads with reassigned IDs (#700) Use unknown types for missing partition source fields when building manifest partition schemas. Add Java-style schema ID reassignment maps and use them to map raw manifest partition field IDs back to their original IDs. Also add transform result type support so unbound partition specs can derive partition field types consistently with Java. --- src/iceberg/manifest/manifest_reader.cc | 2 +- src/iceberg/partition_spec.cc | 43 +++++--- src/iceberg/partition_spec.h | 3 + src/iceberg/schema.cc | 121 ++++++++++++++++++++- src/iceberg/schema.h | 25 ++++- src/iceberg/test/assign_id_visitor_test.cc | 51 +++++++++ src/iceberg/test/expire_snapshots_test.cc | 6 +- src/iceberg/test/manifest_reader_test.cc | 20 ++++ src/iceberg/test/partition_spec_test.cc | 53 +++++++++ src/iceberg/test/transform_test.cc | 12 +- src/iceberg/transform.cc | 20 ++++ src/iceberg/transform.h | 3 + src/iceberg/update/expire_snapshots.cc | 4 - 13 files changed, 328 insertions(+), 35 deletions(-) diff --git a/src/iceberg/manifest/manifest_reader.cc b/src/iceberg/manifest/manifest_reader.cc index 6c166df53..bc7572591 100644 --- a/src/iceberg/manifest/manifest_reader.cc +++ b/src/iceberg/manifest/manifest_reader.cc @@ -861,7 +861,7 @@ Result> ManifestReaderImpl::LiveEntries() { } Result> ManifestReaderImpl::ReadEntries(bool only_live) { - ICEBERG_ASSIGN_OR_RAISE(auto partition_type, spec_->PartitionType(*schema_)); + ICEBERG_ASSIGN_OR_RAISE(auto partition_type, spec_->RawPartitionType(*schema_)); auto data_file_schema = DataFile::Type(std::move(partition_type))->ToSchema(); std::shared_ptr projected_data_file_schema; diff --git a/src/iceberg/partition_spec.cc b/src/iceberg/partition_spec.cc index c00eab7d2..ed5aa831a 100644 --- a/src/iceberg/partition_spec.cc +++ b/src/iceberg/partition_spec.cc @@ -74,24 +74,16 @@ Result> PartitionSpec::PartitionType( std::vector partition_fields; for (const auto& partition_field : fields_) { - // Get the source field from the original schema by source_id ICEBERG_ASSIGN_OR_RAISE(auto source_field, schema.FindFieldById(partition_field.source_id())); - if (!source_field.has_value()) { - // TODO(xiao.dong) when source field is missing, - // should return an error or just use UNKNOWN type - return InvalidSchema("Cannot find source field for partition field:{}", - partition_field.field_id()); + std::shared_ptr result_type; + if (source_field.has_value()) { + auto source_field_type = source_field.value().get().type(); + result_type = partition_field.transform()->ResultType(std::move(source_field_type)); + } else { + result_type = unknown(); } - auto source_field_type = source_field.value().get().type(); - // Bind the transform to the source field type to get the result type - ICEBERG_ASSIGN_OR_RAISE(auto transform_function, - partition_field.transform()->Bind(source_field_type)); - - auto result_type = transform_function->ResultType(); - // Create the partition field with the transform result type - // Partition fields are always optional (can be null) partition_fields.emplace_back(partition_field.field_id(), std::string(partition_field.name()), std::move(result_type), @@ -101,6 +93,29 @@ Result> PartitionSpec::PartitionType( return std::make_unique(std::move(partition_fields)); } +Result> PartitionSpec::RawPartitionType( + const Schema& schema) const { + const auto& ids_to_original = schema.IdsToOriginal(); + if (ids_to_original.empty()) { + return PartitionType(schema); + } + + ICEBERG_ASSIGN_OR_RAISE(auto partition_type, PartitionType(schema)); + std::vector raw_partition_fields; + raw_partition_fields.reserve(partition_type->fields().size()); + for (const auto& field : partition_type->fields()) { + auto original_id = ids_to_original.find(field.field_id()); + if (original_id == ids_to_original.end()) { + return InvalidSchema("Cannot find original field ID for reassigned field ID: {}", + field.field_id()); + } + raw_partition_fields.emplace_back(original_id->second, std::string(field.name()), + field.type(), field.optional(), + std::string(field.doc())); + } + return std::make_unique(std::move(raw_partition_fields)); +} + Result PartitionSpec::PartitionPath(const PartitionValues& data) const { ICEBERG_PRECHECK(fields_.size() == data.num_fields(), "Partition spec and data mismatch, expected field num {}, got {}", diff --git a/src/iceberg/partition_spec.h b/src/iceberg/partition_spec.h index 0fb8814b8..2ed0ddc8a 100644 --- a/src/iceberg/partition_spec.h +++ b/src/iceberg/partition_spec.h @@ -64,6 +64,9 @@ class ICEBERG_EXPORT PartitionSpec : public util::Formattable { /// \brief Get the partition type binding to the input schema. Result> PartitionType(const Schema& schema) const; + /// \brief Get the partition type as physically written in manifest files. + Result> RawPartitionType(const Schema& schema) const; + /// \brief Get the partition path for the given partition data. Result PartitionPath(const PartitionValues& data) const; diff --git a/src/iceberg/schema.cc b/src/iceberg/schema.cc index 5e60b551f..fcac43c78 100644 --- a/src/iceberg/schema.cc +++ b/src/iceberg/schema.cc @@ -35,8 +35,103 @@ namespace iceberg { +struct SchemaReassignIdContext { + Schema::IdMap ids_to_reassigned; + Schema::IdMap ids_to_original; +}; + namespace { +const Schema::IdMap& EmptyIdMap() { + static const Schema::IdMap kEmpty; + return kEmpty; +} + +void RecordIdReassignment(int32_t old_id, int32_t new_id, + Schema::IdMap& ids_to_reassigned, + Schema::IdMap& ids_to_original) { + if (new_id != old_id) { + ids_to_reassigned[old_id] = new_id; + ids_to_original[new_id] = old_id; + } +} + +SchemaField ReassignField(const SchemaField& field, int32_t new_id, + const Schema::GetId& get_id, Schema::IdMap& ids_to_reassigned, + Schema::IdMap& ids_to_original); + +std::shared_ptr ReassignTypeIds(const std::shared_ptr& type, + const Schema::GetId& get_id, + Schema::IdMap& ids_to_reassigned, + Schema::IdMap& ids_to_original) { + switch (type->type_id()) { + case TypeId::kStruct: { + const auto& struct_type = static_cast(*type); + const auto& fields = struct_type.fields(); + std::vector new_ids; + new_ids.reserve(fields.size()); + for (const auto& field : fields) { + const auto new_id = get_id(field.field_id()); + RecordIdReassignment(field.field_id(), new_id, ids_to_reassigned, + ids_to_original); + new_ids.push_back(new_id); + } + + std::vector reassigned_fields; + reassigned_fields.reserve(fields.size()); + for (size_t i = 0; i < fields.size(); ++i) { + reassigned_fields.emplace_back(ReassignField(fields[i], new_ids[i], get_id, + ids_to_reassigned, ids_to_original)); + } + return std::make_shared(std::move(reassigned_fields)); + } + case TypeId::kList: { + const auto& list_type = static_cast(*type); + const auto& element = list_type.element(); + const auto new_id = get_id(element.field_id()); + RecordIdReassignment(element.field_id(), new_id, ids_to_reassigned, + ids_to_original); + return std::make_shared( + ReassignField(element, new_id, get_id, ids_to_reassigned, ids_to_original)); + } + case TypeId::kMap: { + const auto& map_type = static_cast(*type); + const auto& key = map_type.key(); + const auto& value = map_type.value(); + const auto new_key_id = get_id(key.field_id()); + const auto new_value_id = get_id(value.field_id()); + RecordIdReassignment(key.field_id(), new_key_id, ids_to_reassigned, + ids_to_original); + RecordIdReassignment(value.field_id(), new_value_id, ids_to_reassigned, + ids_to_original); + return std::make_shared( + ReassignField(key, new_key_id, get_id, ids_to_reassigned, ids_to_original), + ReassignField(value, new_value_id, get_id, ids_to_reassigned, ids_to_original)); + } + default: + return type; + } +} + +SchemaField ReassignField(const SchemaField& field, int32_t new_id, + const Schema::GetId& get_id, Schema::IdMap& ids_to_reassigned, + Schema::IdMap& ids_to_original) { + return {new_id, std::string(field.name()), + ReassignTypeIds(field.type(), get_id, ids_to_reassigned, ids_to_original), + field.optional(), std::string(field.doc())}; +} + +std::vector ReassignIds(std::vector fields, + const Schema::GetId& get_id, + SchemaReassignIdContext& reassign_id_context) { + auto reassigned_type = ReassignTypeIds(std::make_shared(std::move(fields)), + get_id, reassign_id_context.ids_to_reassigned, + reassign_id_context.ids_to_original); + const auto& reassigned_fields = + internal::checked_cast(*reassigned_type).fields(); + return {reassigned_fields.begin(), reassigned_fields.end()}; +} + Status ValidateFieldNullability(const Type& type) { auto validate_field = [&](const SchemaField& field) -> Status { ICEBERG_PRECHECK(field.optional() || field.type()->type_id() != TypeId::kUnknown, @@ -73,17 +168,23 @@ Status ValidateFieldNullability(const Type& type) { } // namespace -Schema::Schema(std::vector fields, int32_t schema_id) +Schema::Schema(std::vector fields, int32_t schema_id, GetId get_id) : StructType(std::move(fields)), schema_id_(schema_id), - cache_(std::make_unique(this)) {} + cache_(std::make_unique(this)) { + if (get_id) { + reassign_id_context_ = std::make_unique(); + fields_ = ReassignIds(std::move(fields_), get_id, *reassign_id_context_); + } +} Schema::~Schema() = default; Result> Schema::Make(std::vector fields, int32_t schema_id, - std::vector identifier_field_ids) { - auto schema = std::make_unique(std::move(fields), schema_id); + std::vector identifier_field_ids, + GetId get_id) { + auto schema = std::make_unique(std::move(fields), schema_id, std::move(get_id)); if (!identifier_field_ids.empty()) { auto id_to_parent = IndexParents(*schema); @@ -99,8 +200,8 @@ Result> Schema::Make(std::vector fields, Result> Schema::Make( std::vector fields, int32_t schema_id, - const std::vector& identifier_field_names) { - auto schema = std::make_unique(std::move(fields), schema_id); + const std::vector& identifier_field_names, GetId get_id) { + auto schema = std::make_unique(std::move(fields), schema_id, std::move(get_id)); std::vector fresh_identifier_ids; for (const auto& name : identifier_field_names) { @@ -181,6 +282,14 @@ const std::shared_ptr& Schema::EmptySchema() { int32_t Schema::schema_id() const { return schema_id_; } +const Schema::IdMap& Schema::IdsToReassigned() const { + return reassign_id_context_ ? reassign_id_context_->ids_to_reassigned : EmptyIdMap(); +} + +const Schema::IdMap& Schema::IdsToOriginal() const { + return reassign_id_context_ ? reassign_id_context_->ids_to_original : EmptyIdMap(); +} + std::string Schema::ToString() const { std::string repr = "schema<"; for (const auto& field : fields_) { diff --git a/src/iceberg/schema.h b/src/iceberg/schema.h index 791ed5c8f..9245be02e 100644 --- a/src/iceberg/schema.h +++ b/src/iceberg/schema.h @@ -24,6 +24,7 @@ /// and any utility functions. See iceberg/type.h and iceberg/field.h as well. #include +#include #include #include #include @@ -40,6 +41,7 @@ namespace iceberg { class SchemaCache; +struct SchemaReassignIdContext; /// \brief A schema for a Table. /// @@ -55,7 +57,14 @@ class ICEBERG_EXPORT Schema : public StructType { /// \brief Special value to select all columns from manifest files. static constexpr std::string_view kAllColumns = "*"; - explicit Schema(std::vector fields, int32_t schema_id = kInitialSchemaId); + /// \brief Maps an original field ID to its reassigned ID. + /// + /// The mapping is total: return the original ID when no reassignment is needed. + using GetId = std::function; + using IdMap = std::unordered_map; + + explicit Schema(std::vector fields, int32_t schema_id = kInitialSchemaId, + GetId get_id = {}); ~Schema() override; @@ -64,10 +73,12 @@ class ICEBERG_EXPORT Schema : public StructType { /// \param fields The fields that make up the schema. /// \param schema_id The unique identifier for this schema (default:kInitialSchemaId). /// \param identifier_field_ids Field IDs that uniquely identify rows in the table. + /// \param get_id Function mapping each original field ID to its reassigned ID. /// \return A new Schema instance or Status if failed. static Result> Make(std::vector fields, int32_t schema_id, - std::vector identifier_field_ids); + std::vector identifier_field_ids, + GetId get_id = {}); /// \brief Create a schema. /// @@ -75,10 +86,11 @@ class ICEBERG_EXPORT Schema : public StructType { /// \param schema_id The unique identifier for this schema (default: kInitialSchemaId). /// \param identifier_field_names Canonical names of fields that uniquely identify rows /// in the table. + /// \param get_id Function mapping each original field ID to its reassigned ID. /// \return A new Schema instance or Status if failed. static Result> Make( std::vector fields, int32_t schema_id, - const std::vector& identifier_field_names); + const std::vector& identifier_field_names, GetId get_id = {}); /// \brief Validate that the identifier field with the given ID is valid for the schema /// @@ -166,6 +178,12 @@ class ICEBERG_EXPORT Schema : public StructType { /// \brief Return the field IDs of the identifier fields. const std::vector& IdentifierFieldIds() const; + /// \brief Return a map of original field IDs to reassigned field IDs. + const IdMap& IdsToReassigned() const; + + /// \brief Return a map of reassigned field IDs to original field IDs. + const IdMap& IdsToOriginal() const; + /// \brief Return the canonical field names of the identifier fields. Result> IdentifierFieldNames() const; @@ -196,6 +214,7 @@ class ICEBERG_EXPORT Schema : public StructType { const int32_t schema_id_; // Field IDs that uniquely identify rows in the table. std::vector identifier_field_ids_; + std::unique_ptr reassign_id_context_; // Cache for schema mappings to facilitate fast lookups. std::unique_ptr cache_; }; diff --git a/src/iceberg/test/assign_id_visitor_test.cc b/src/iceberg/test/assign_id_visitor_test.cc index 8bec0ad53..4830e4803 100644 --- a/src/iceberg/test/assign_id_visitor_test.cc +++ b/src/iceberg/test/assign_id_visitor_test.cc @@ -106,6 +106,8 @@ TEST(AssignFreshIdVisitorTest, FlatSchema) { }, Schema::kInitialSchemaId), *fresh_schema); + EXPECT_TRUE(fresh_schema->IdsToReassigned().empty()); + EXPECT_TRUE(fresh_schema->IdsToOriginal().empty()); } TEST(AssignFreshIdVisitorTest, NestedSchema) { @@ -169,6 +171,55 @@ TEST(AssignFreshIdVisitorTest, NestedSchema) { EXPECT_EQ(*expect_nested_struct_type, *nested_struct_type); } +TEST(AssignFreshIdVisitorTest, GetIdMaps) { + ICEBERG_UNWRAP_OR_FAIL(auto schema, CreateNestedSchema()); + std::vector fields(schema->fields().begin(), schema->fields().end()); + auto reassign_id = [](int32_t old_id) { return old_id + 1000; }; + + Schema reassigned_schema(std::move(fields), Schema::kInitialSchemaId, reassign_id); + + EXPECT_EQ(reassigned_schema.fields()[0].field_id(), 1010); + EXPECT_EQ(reassigned_schema.fields()[1].field_id(), 1020); + auto list_type = + std::dynamic_pointer_cast(reassigned_schema.fields()[1].type()); + ASSERT_TRUE(list_type); + EXPECT_EQ(list_type->element().field_id(), 1101); + + EXPECT_EQ(reassigned_schema.IdsToReassigned().size(), 15U); + EXPECT_THAT( + reassigned_schema.IdsToReassigned(), + testing::UnorderedElementsAre( + testing::Pair(10, 1010), testing::Pair(20, 1020), testing::Pair(30, 1030), + testing::Pair(40, 1040), testing::Pair(101, 1101), testing::Pair(102, 1102), + testing::Pair(103, 1103), testing::Pair(201, 1201), testing::Pair(202, 1202), + testing::Pair(203, 1203), testing::Pair(204, 1204), testing::Pair(301, 1301), + testing::Pair(302, 1302), testing::Pair(303, 1303), testing::Pair(304, 1304))); + EXPECT_THAT( + reassigned_schema.IdsToOriginal(), + testing::UnorderedElementsAre( + testing::Pair(1010, 10), testing::Pair(1020, 20), testing::Pair(1030, 30), + testing::Pair(1040, 40), testing::Pair(1101, 101), testing::Pair(1102, 102), + testing::Pair(1103, 103), testing::Pair(1201, 201), testing::Pair(1202, 202), + testing::Pair(1203, 203), testing::Pair(1204, 204), testing::Pair(1301, 301), + testing::Pair(1302, 302), testing::Pair(1303, 303), testing::Pair(1304, 304))); +} + +TEST(AssignFreshIdVisitorTest, GetIdIdentifierNames) { + ICEBERG_UNWRAP_OR_FAIL(auto schema, CreateNestedSchema()); + std::vector fields(schema->fields().begin(), schema->fields().end()); + auto reassign_id = [](int32_t old_id) { return old_id + 1000; }; + + ICEBERG_UNWRAP_OR_FAIL( + auto reassigned_schema, + Schema::Make(std::move(fields), Schema::kInitialSchemaId, + std::vector{"id", "struct.outer_id"}, reassign_id)); + + EXPECT_THAT(reassigned_schema->IdentifierFieldIds(), testing::ElementsAre(1010, 1301)); + ICEBERG_UNWRAP_OR_FAIL(auto identifier_field_names, + reassigned_schema->IdentifierFieldNames()); + EXPECT_THAT(identifier_field_names, testing::ElementsAre("id", "struct.outer_id")); +} + TEST(AssignFreshIdVisitorTest, RefreshIdentifierId) { int32_t id = 0; auto next_id = [&id]() { return ++id; }; diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index 3a99b0009..274a8cb44 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -752,7 +752,7 @@ TEST_F(ExpireSnapshotsCleanupTest, IncrementalSkipsCherryPickedSnapshotCleanup) EXPECT_EQ(committed_metadata->snapshots.at(0)->snapshot_id, kCurrentSnapshotId); } -TEST_F(ExpireSnapshotsCleanupTest, ReachableCleanupFailsClosedOnUnbindableExpiredSpec) { +TEST_F(ExpireSnapshotsCleanupTest, ReachableCleanupReadsExpiredSpecWithMissingSource) { const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; const auto expired_manifest_list_path = @@ -796,9 +796,9 @@ TEST_F(ExpireSnapshotsCleanupTest, ReachableCleanupFailsClosedOnUnbindableExpire [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); EXPECT_THAT(update->Commit(), IsOk()); - EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_manifest_path, + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, expired_manifest_list_path)); - EXPECT_THAT(deleted_files, testing::Not(testing::Contains(expired_data_file_path))); } TEST_F(ExpireSnapshotsCleanupTest, CommitIgnoresMalformedSourceSnapshotIdCleanup) { diff --git a/src/iceberg/test/manifest_reader_test.cc b/src/iceberg/test/manifest_reader_test.cc index f2c4ef406..4a17eacaa 100644 --- a/src/iceberg/test/manifest_reader_test.cc +++ b/src/iceberg/test/manifest_reader_test.cc @@ -288,6 +288,26 @@ TEST_P(TestManifestReader, TestManifestReaderWithPartitionMetadata) { EXPECT_EQ(read_entry.data_file->partition.values()[0], Literal::Int(0)); } +TEST_P(TestManifestReader, ReadsEntriesWhenPartitionSourceFieldIsMissing) { + auto version = GetParam(); + auto file = MakeDataFile("/path/to/historical-data.parquet", + PartitionValues({Literal::Int(7)})); + auto manifest = + WriteManifest(version, /*snapshot_id=*/1000L, + {MakeEntry(ManifestStatus::kAdded, 1000L, std::move(file))}); + + auto current_schema = std::make_shared( + std::vector{SchemaField::MakeRequired(/*field_id=*/3, "id", int32())}); + + ICEBERG_UNWRAP_OR_FAIL(auto reader, + ManifestReader::Make(manifest, file_io_, current_schema, spec_)); + ICEBERG_UNWRAP_OR_FAIL(auto read_entries, reader->Entries()); + + ASSERT_EQ(read_entries.size(), 1U); + EXPECT_EQ(read_entries[0].data_file->file_path, "/path/to/historical-data.parquet"); + EXPECT_EQ(read_entries[0].data_file->record_count, 1); +} + TEST_P(TestManifestReader, TestDeleteFilesWithReferences) { auto version = GetParam(); if (version < 2) { diff --git a/src/iceberg/test/partition_spec_test.cc b/src/iceberg/test/partition_spec_test.cc index 89c4cdc83..e3b86e274 100644 --- a/src/iceberg/test/partition_spec_test.cc +++ b/src/iceberg/test/partition_spec_test.cc @@ -149,6 +149,59 @@ TEST(PartitionSpecTest, PartitionTypeTest) { EXPECT_EQ(pt_field3, partition_type->fields()[2]); } +TEST(PartitionSpecTest, PartitionTypeMissingSource) { + Schema schema({SchemaField::MakeRequired(2, "ts", timestamp())}, + Schema::kInitialSchemaId); + ICEBERG_UNWRAP_OR_FAIL( + auto spec, + PartitionSpec::Make( + 1, {PartitionField(1, 1000, "dropped_identity", Transform::Identity()), + PartitionField(3, 1001, "dropped_bucket", Transform::Bucket(16)), + PartitionField(2, 1002, "ts_day", Transform::Day())})); + + ICEBERG_UNWRAP_OR_FAIL(auto partition_type, spec->PartitionType(schema)); + + ASSERT_EQ(partition_type->fields().size(), 3U); + EXPECT_EQ(partition_type->fields()[0], + SchemaField::MakeOptional(1000, "dropped_identity", unknown())); + EXPECT_EQ(partition_type->fields()[1], + SchemaField::MakeOptional(1001, "dropped_bucket", unknown())); + EXPECT_EQ(partition_type->fields()[2], + SchemaField::MakeOptional(1002, "ts_day", date())); +} + +TEST(PartitionSpecTest, RawPartitionTypeNoReassign) { + Schema schema({SchemaField::MakeRequired(2, "ts", timestamp())}, + Schema::kInitialSchemaId); + ICEBERG_UNWRAP_OR_FAIL( + auto spec, PartitionSpec::Make( + 1, {PartitionField(1, 1000, "dropped", Transform::Identity())})); + + ICEBERG_UNWRAP_OR_FAIL(auto partition_type, spec->PartitionType(schema)); + ICEBERG_UNWRAP_OR_FAIL(auto raw_partition_type, spec->RawPartitionType(schema)); + + EXPECT_EQ(*raw_partition_type, *partition_type); +} + +TEST(PartitionSpecTest, RawPartitionTypeReassignIds) { + auto reassign_id = [](int32_t old_id) { return old_id == 1000 ? 2000 : old_id; }; + Schema schema({SchemaField::MakeOptional(1000, "partition_col", int32())}, + Schema::kInitialSchemaId, reassign_id); + ICEBERG_UNWRAP_OR_FAIL( + auto spec, PartitionSpec::Make(1, {PartitionField(2000, 2000, "partition_col", + Transform::Identity())})); + + ICEBERG_UNWRAP_OR_FAIL(auto partition_type, spec->PartitionType(schema)); + ICEBERG_UNWRAP_OR_FAIL(auto raw_partition_type, spec->RawPartitionType(schema)); + + ASSERT_EQ(partition_type->fields().size(), 1U); + EXPECT_EQ(partition_type->fields()[0], + SchemaField::MakeOptional(2000, "partition_col", int32())); + ASSERT_EQ(raw_partition_type->fields().size(), 1U); + EXPECT_EQ(raw_partition_type->fields()[0], + SchemaField::MakeOptional(1000, "partition_col", int32())); +} + TEST(PartitionSpecTest, InvalidTransformForType) { // Test Day transform on string type (should fail) auto field_string = SchemaField::MakeRequired(6, "s", string()); diff --git a/src/iceberg/test/transform_test.cc b/src/iceberg/test/transform_test.cc index 47a1e87e6..943b2fb52 100644 --- a/src/iceberg/test/transform_test.cc +++ b/src/iceberg/test/transform_test.cc @@ -159,12 +159,16 @@ TEST(TransformResultTypeTest, PositiveCases) { ASSERT_TRUE(result.has_value()) << "Failed to parse: " << c.str; const auto& transform = result.value(); - const auto transformPtr = transform->Bind(c.source_type); - ASSERT_TRUE(transformPtr.has_value()) << "Failed to bind: " << c.str; - - auto result_type = transformPtr.value()->ResultType(); + auto result_type = transform->ResultType(c.source_type); + ASSERT_NE(result_type, nullptr) << "Missing result type for: " << c.str; EXPECT_EQ(result_type->type_id(), c.expected_result_type->type_id()) << "Unexpected result type for: " << c.str; + + const auto transform_func = transform->Bind(c.source_type); + ASSERT_TRUE(transform_func.has_value()) << "Failed to bind: " << c.str; + EXPECT_EQ(transform_func.value()->ResultType()->type_id(), + c.expected_result_type->type_id()) + << "Unexpected bound result type for: " << c.str; } } diff --git a/src/iceberg/transform.cc b/src/iceberg/transform.cc index c915ec067..453941c95 100644 --- a/src/iceberg/transform.cc +++ b/src/iceberg/transform.cc @@ -135,6 +135,26 @@ Result> Transform::Bind( } } +std::shared_ptr Transform::ResultType( + const std::shared_ptr& source_type) const { + switch (transform_type_) { + case TransformType::kIdentity: + case TransformType::kTruncate: + case TransformType::kVoid: + return source_type; + case TransformType::kBucket: + case TransformType::kYear: + case TransformType::kMonth: + case TransformType::kHour: + return int32(); + case TransformType::kDay: + return date(); + case TransformType::kUnknown: + return string(); + } + std::unreachable(); +} + bool Transform::CanTransform(const Type& source_type) const { switch (transform_type_) { case TransformType::kIdentity: diff --git a/src/iceberg/transform.h b/src/iceberg/transform.h index 873b3ca6e..6b855a74d 100644 --- a/src/iceberg/transform.h +++ b/src/iceberg/transform.h @@ -151,6 +151,9 @@ class ICEBERG_EXPORT Transform : public util::Formattable { Result> Bind( const std::shared_ptr& source_type) const; + /// \brief Return the type produced by this transform for a source type. + std::shared_ptr ResultType(const std::shared_ptr& source_type) const; + /// \brief Checks whether this function can be applied to the given Type. /// \param source_type The source type to check. /// \return true if this transform can be applied to the type, false otherwise diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index c9ac9e4cd..7c056fab2 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -51,10 +51,6 @@ namespace { Result> MakeManifestReader( const ManifestFile& manifest, const std::shared_ptr& file_io, const TableMetadata& metadata) { - // TODO(gangwu): Build manifest file schemas from PartitionSpec::RawPartitionType - // with UnknownType for dropped source fields instead of requiring the table schema - // to bind every partition source field. Until then, cleanup fails closed when - // historical specs cannot bind to the metadata schema. ICEBERG_ASSIGN_OR_RAISE(auto schema, metadata.Schema()); TableMetadataCache metadata_cache(&metadata); ICEBERG_ASSIGN_OR_RAISE(auto specs_by_id, metadata_cache.GetPartitionSpecsById()); From 701d39ca6b4f077039b37417b4ad992a24f1d4d6 Mon Sep 17 00:00:00 2001 From: Jiajia Li Date: Wed, 10 Jun 2026 10:16:29 +0800 Subject: [PATCH 070/151] fix(rest): use "ref" field name for AssertRefSnapshotId requirement (#702) The `AssertRefSnapshotId` table requirement was serialized and deserialized with the JSON field name `ref-name`. Per the Iceberg REST OpenAPI spec (`rest-catalog-open-api.yaml`), this requirement's field is named `ref`. Only the `SetSnapshotRef` / `RemoveSnapshotRef` *updates* use `ref-name` --- src/iceberg/json_serde.cc | 6 ++++-- src/iceberg/test/json_serde_test.cc | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index 550d0f07e..c72b7da57 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -207,6 +207,7 @@ constexpr std::string_view kSortOrderId = "sort-order-id"; constexpr std::string_view kSnapshot = "snapshot"; constexpr std::string_view kSnapshotIds = "snapshot-ids"; constexpr std::string_view kRefName = "ref-name"; +constexpr std::string_view kRef = "ref"; constexpr std::string_view kUpdates = "updates"; constexpr std::string_view kRemovals = "removals"; @@ -1505,7 +1506,8 @@ nlohmann::json ToJson(const TableRequirement& requirement) { const auto& r = internal::checked_cast(requirement); json[kType] = kRequirementAssertRefSnapshotID; - json[kRefName] = r.ref_name(); + // REST spec names this field "ref", not "ref-name". + json[kRef] = r.ref_name(); if (r.snapshot_id().has_value()) { json[kSnapshotId] = r.snapshot_id().value(); } else { @@ -1702,7 +1704,7 @@ Result> TableRequirementFromJson( return std::make_unique(std::move(uuid)); } if (type == kRequirementAssertRefSnapshotID) { - ICEBERG_ASSIGN_OR_RAISE(auto ref_name, GetJsonValue(json, kRefName)); + ICEBERG_ASSIGN_OR_RAISE(auto ref_name, GetJsonValue(json, kRef)); ICEBERG_ASSIGN_OR_RAISE(auto snapshot_id_opt, GetJsonValueOptional(json, kSnapshotId)); return std::make_unique(std::move(ref_name), diff --git a/src/iceberg/test/json_serde_test.cc b/src/iceberg/test/json_serde_test.cc index f019375d3..0dac226e9 100644 --- a/src/iceberg/test/json_serde_test.cc +++ b/src/iceberg/test/json_serde_test.cc @@ -681,7 +681,7 @@ TEST(TableRequirementJsonTest, TableRequirementAssertUUID) { TEST(TableRequirementJsonTest, TableRequirementAssertRefSnapshotID) { table::AssertRefSnapshotID req("main", 123456789); nlohmann::json expected = - R"({"type":"assert-ref-snapshot-id","ref-name":"main","snapshot-id":123456789})"_json; + R"({"type":"assert-ref-snapshot-id","ref":"main","snapshot-id":123456789})"_json; EXPECT_EQ(ToJson(req), expected); auto parsed = TableRequirementFromJson(expected); @@ -693,7 +693,7 @@ TEST(TableRequirementJsonTest, TableRequirementAssertRefSnapshotID) { TEST(TableRequirementJsonTest, TableRequirementAssertRefSnapshotIDWithNull) { table::AssertRefSnapshotID req("main", std::nullopt); nlohmann::json expected = - R"({"type":"assert-ref-snapshot-id","ref-name":"main","snapshot-id":null})"_json; + R"({"type":"assert-ref-snapshot-id","ref":"main","snapshot-id":null})"_json; EXPECT_EQ(ToJson(req), expected); auto parsed = TableRequirementFromJson(expected); @@ -702,6 +702,14 @@ TEST(TableRequirementJsonTest, TableRequirementAssertRefSnapshotIDWithNull) { req); } +TEST(TableRequirementJsonTest, TableRequirementAssertRefSnapshotIDRejectsRefName) { + nlohmann::json legacy = + R"({"type":"assert-ref-snapshot-id","ref-name":"main","snapshot-id":123456789})"_json; + auto result = TableRequirementFromJson(legacy); + EXPECT_THAT(result, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(result, HasErrorMessage("Missing 'ref'")); +} + TEST(TableRequirementJsonTest, TableRequirementAssertLastAssignedFieldId) { table::AssertLastAssignedFieldId req(100); nlohmann::json expected = From 30c312083cd9a8a073e22c981fe3adafc6dc1307 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Wed, 10 Jun 2026 10:16:52 +0800 Subject: [PATCH 071/151] fix: Assign UUID when creating table metadata (#713) --- src/iceberg/table_metadata.cc | 3 ++- src/iceberg/test/table_metadata_builder_test.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index 658681573..30f99f259 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -224,7 +224,8 @@ Result> TableMetadata::Make( ICEBERG_RETURN_UNEXPECTED(PropertyUtil::ValidateCommitProperties(properties)); return TableMetadataBuilder::BuildFromEmpty(format_version) - ->SetLocation(location) + ->AssignUUID() + .SetLocation(location) .SetCurrentSchema(std::move(fresh_schema), last_column_id) .SetDefaultPartitionSpec(std::move(fresh_spec)) .SetDefaultSortOrder(std::move(fresh_order)) diff --git a/src/iceberg/test/table_metadata_builder_test.cc b/src/iceberg/test/table_metadata_builder_test.cc index 4146cb01f..68a980b9a 100644 --- a/src/iceberg/test/table_metadata_builder_test.cc +++ b/src/iceberg/test/table_metadata_builder_test.cc @@ -36,6 +36,7 @@ #include "iceberg/test/matchers.h" #include "iceberg/transform.h" #include "iceberg/type.h" +#include "iceberg/util/uuid.h" namespace iceberg { @@ -102,6 +103,7 @@ TEST(TableMetadataTest, Make) { ICEBERG_UNWRAP_OR_FAIL( auto metadata, TableMetadata::Make(*Schema, *spec, *order, "s3://bucket/test", {})); + EXPECT_THAT(Uuid::FromString(metadata->table_uuid), IsOk()); // Check schema fields ASSERT_EQ(1, metadata->schemas.size()); auto fields = metadata->schemas[0]->fields() | std::ranges::to(); From 3fd8a49ee5cbc2afdcb243275f1915e4fe9a6aef Mon Sep 17 00:00:00 2001 From: wzhuo Date: Wed, 10 Jun 2026 14:04:25 +0800 Subject: [PATCH 072/151] fix: YearTransform passes wrong TransformType kTruncate instead of kYear (#715) ## Summary **Bug:** YearTransform constructor passed TransformType::kTruncate to the TransformFunction base class instead of TransformType::kYear. This caused transform_type() to return kTruncate on a bound YearTransform, affecting code paths that dispatch based on transform_type() (e.g., Transform::Project, Transform::ProjectStrict, Transform::SatisfiesOrderOf). **Fix:** Changed kTruncate to kYear in the YearTransform constructor. **Tests:** Added TransformFunctionTest cases for Year, Month, Day, Hour, and Void transforms to verify transform_type() after Bind(). The existing suite only tested Identity, Bucket, and Truncate. --- src/iceberg/test/transform_test.cc | 50 ++++++++++++++++++++++++++++++ src/iceberg/transform_function.cc | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/iceberg/test/transform_test.cc b/src/iceberg/test/transform_test.cc index 943b2fb52..8d7cd880d 100644 --- a/src/iceberg/test/transform_test.cc +++ b/src/iceberg/test/transform_test.cc @@ -71,6 +71,56 @@ TEST(TransformFunctionTest, CreateTruncateTransform) { EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kTruncate); } +TEST(TransformFunctionTest, CreateYearTransform) { + auto transform = Transform::Year(); + EXPECT_EQ("year", transform->ToString()); + EXPECT_EQ("year", std::format("{}", *transform)); + + auto transformPtr = transform->Bind(iceberg::timestamp()); + ASSERT_TRUE(transformPtr); + EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kYear); +} + +TEST(TransformFunctionTest, CreateMonthTransform) { + auto transform = Transform::Month(); + EXPECT_EQ("month", transform->ToString()); + EXPECT_EQ("month", std::format("{}", *transform)); + + auto transformPtr = transform->Bind(iceberg::timestamp()); + ASSERT_TRUE(transformPtr); + EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kMonth); +} + +TEST(TransformFunctionTest, CreateDayTransform) { + auto transform = Transform::Day(); + EXPECT_EQ("day", transform->ToString()); + EXPECT_EQ("day", std::format("{}", *transform)); + + auto transformPtr = transform->Bind(iceberg::timestamp_tz()); + ASSERT_TRUE(transformPtr); + EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kDay); +} + +TEST(TransformFunctionTest, CreateHourTransform) { + auto transform = Transform::Hour(); + EXPECT_EQ("hour", transform->ToString()); + EXPECT_EQ("hour", std::format("{}", *transform)); + + auto transformPtr = transform->Bind(iceberg::timestamp()); + ASSERT_TRUE(transformPtr); + EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kHour); +} + +TEST(TransformFunctionTest, CreateVoidTransform) { + auto transform = Transform::Void(); + EXPECT_EQ("void", transform->ToString()); + EXPECT_EQ("void", std::format("{}", *transform)); + + auto transformPtr = transform->Bind(iceberg::int32()); + ASSERT_TRUE(transformPtr); + EXPECT_EQ(transformPtr.value()->transform_type(), TransformType::kVoid); +} + TEST(TransformFromStringTest, PositiveCases) { struct Case { std::string str; diff --git a/src/iceberg/transform_function.cc b/src/iceberg/transform_function.cc index d7c18555d..4325c53d1 100644 --- a/src/iceberg/transform_function.cc +++ b/src/iceberg/transform_function.cc @@ -131,7 +131,7 @@ Result> TruncateTransform::Make( } YearTransform::YearTransform(std::shared_ptr const& source_type) - : TransformFunction(TransformType::kTruncate, source_type) {} + : TransformFunction(TransformType::kYear, source_type) {} Result YearTransform::Transform(const Literal& literal) { ICEBERG_DCHECK(*literal.type() == *source_type(), From 0284683f7e1dd5742913d5f0a7c4b48e445df7a4 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 10 Jun 2026 16:51:54 +0800 Subject: [PATCH 073/151] fix: make release script more robust (#717) --- ci/scripts/build_example.sh | 11 ++++ ci/scripts/build_iceberg.sh | 14 ++++- .../IcebergThirdpartyToolchain.cmake | 5 ++ dev/release/release_rc.sh | 54 +++++++++---------- dev/release/verify_rc.sh | 26 +++++++++ 5 files changed, 80 insertions(+), 30 deletions(-) diff --git a/ci/scripts/build_example.sh b/ci/scripts/build_example.sh index ff98ae6a7..77abbc310 100755 --- a/ci/scripts/build_example.sh +++ b/ci/scripts/build_example.sh @@ -21,6 +21,7 @@ set -eux source_dir=${1} build_dir=${1}/build +run_example=${ICEBERG_RUN_EXAMPLE:-OFF} mkdir ${build_dir} pushd ${build_dir} @@ -44,8 +45,18 @@ fi cmake "${CMAKE_ARGS[@]}" ${source_dir} if is_windows; then cmake --build . --config Release + if [[ "${run_example}" == "ON" ]]; then + if [[ -x ./demo_example.exe ]]; then + ./demo_example.exe + else + ./Release/demo_example.exe + fi + fi else cmake --build . + if [[ "${run_example}" == "ON" ]]; then + ./demo_example + fi fi popd diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 4c88427e3..406ef56a7 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -26,6 +26,7 @@ build_dir=${1}/build build_rest_integration_test=${2:-OFF} build_enable_sccache=${3:-OFF} build_enable_s3=${4:-OFF} +run_tests=${ICEBERG_RUN_TESTS:-ON} mkdir ${build_dir} pushd ${build_dir} @@ -60,13 +61,22 @@ if [[ "${build_enable_sccache}" == "ON" ]]; then CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache") fi +if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then + read -r -a EXTRA_CMAKE_ARGS <<< "${ICEBERG_EXTRA_CMAKE_ARGS}" + CMAKE_ARGS+=("${EXTRA_CMAKE_ARGS[@]}") +fi + cmake "${CMAKE_ARGS[@]}" ${source_dir} if is_windows; then cmake --build . --config Release --target install - ctest --output-on-failure -C Release + if [[ "${run_tests}" == "ON" ]]; then + ctest --output-on-failure -C Release + fi else cmake --build . --target install - ctest --output-on-failure + if [[ "${run_tests}" == "ON" ]]; then + ctest --output-on-failure + fi fi popd diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 9b5d95a7e..152af0cb9 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -464,6 +464,7 @@ function(resolve_cpr_dependency) set(CPR_ENABLE_CURL_HTTP_ONLY ON) set(CPR_ENABLE_SSL ON) set(CPR_USE_SYSTEM_CURL ON) + set(CPR_USE_EXISTING_CURL_TARGET ON) if(DEFINED ENV{ICEBERG_CPR_URL}) set(CPR_URL "$ENV{ICEBERG_CPR_URL}") @@ -471,6 +472,10 @@ function(resolve_cpr_dependency) set(CPR_URL "https://github.com/libcpr/cpr/archive/refs/tags/1.14.1.tar.gz") endif() + if(NOT TARGET CURL::libcurl) + find_package(CURL REQUIRED) + endif() + fetchcontent_declare(cpr ${FC_DECLARE_COMMON_OPTIONS} URL ${CPR_URL} diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index 1e13e5260..fe919f2f2 100755 --- a/dev/release/release_rc.sh +++ b/dev/release/release_rc.sh @@ -44,7 +44,6 @@ rc=$2 : "${RELEASE_PUSH_TAG:=${RELEASE_DEFAULT}}" : "${RELEASE_SIGN:=${RELEASE_DEFAULT}}" : "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}" -: "${RELEASE_WATCH:=${RELEASE_DEFAULT}}" : "${RELEASE_WATCH_INTERVAL:=30}" cd "${SOURCE_TOP_DIR}" @@ -83,6 +82,9 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then repository="${repository%.git}" echo "Looking for GitHub Actions workflow on ${repository}:${rc_tag}" + # If this script is interrupted or times out after the RC tag is pushed, + # resume from the existing GitHub Actions run without creating the tag again: + # RELEASE_PULL=0 RELEASE_PUSH_TAG=0 RELEASE_RUN_ID= ./dev/release/release_rc.sh run_id="${RELEASE_RUN_ID:-}" while [ -z "${run_id}" ]; do echo "Waiting for run to start..." @@ -95,33 +97,29 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then done echo "Found GitHub Actions workflow with ID: ${run_id}" - if [ "${RELEASE_WATCH}" -gt 0 ]; then - gh run watch --repo "${repository}" --exit-status "${run_id}" - else - while true; do - run_status=$(gh run view \ - --repo "${repository}" \ - --json 'status,conclusion' \ - --jq '.status + " " + (.conclusion // "")' \ - "${run_id}") - echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" - gh run view \ - --repo "${repository}" \ - --json jobs \ - --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ - "${run_id}" - case "${run_status}" in - "completed success") - break - ;; - completed\ *) - echo "GitHub Actions workflow did not complete successfully: ${run_status}" - exit 1 - ;; - esac - sleep "${RELEASE_WATCH_INTERVAL}" - done - fi + while true; do + run_status=$(gh run view \ + --repo "${repository}" \ + --json 'status,conclusion' \ + --jq '.status + " " + (.conclusion // "")' \ + "${run_id}") + echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" + gh run view \ + --repo "${repository}" \ + --json jobs \ + --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ + "${run_id}" + case "${run_status}" in + "completed success") + break + ;; + completed\ *) + echo "GitHub Actions workflow did not complete successfully: ${run_status}" + exit 1 + ;; + esac + sleep "${RELEASE_WATCH_INTERVAL}" + done mkdir -p "${rc_id}" diff --git a/dev/release/verify_rc.sh b/dev/release/verify_rc.sh index c1db2950a..5928fd54e 100755 --- a/dev/release/verify_rc.sh +++ b/dev/release/verify_rc.sh @@ -48,6 +48,9 @@ ARCHIVE_BASE_NAME="apache-iceberg-cpp-${VERSION}" : "${VERIFY_DEFAULT:=1}" : "${VERIFY_DOWNLOAD:=${VERIFY_DEFAULT}}" : "${VERIFY_SIGN:=${VERIFY_DEFAULT}}" +: "${VERIFY_REST:=${VERIFY_DEFAULT}}" +: "${VERIFY_SQL:=0}" +: "${VERIFY_INSTALL_SMOKE:=0}" VERIFY_SUCCESS=no @@ -116,12 +119,27 @@ ensure_source_directory() { test_source_distribution() { echo "Building and testing Apache Iceberg C++..." + if [ "${VERIFY_REST}" -gt 0 ]; then + verify_rest=ON + else + verify_rest=OFF + fi + + if [ "${VERIFY_SQL}" -gt 0 ]; then + verify_sql=ON + else + verify_sql=OFF + fi + # Configure build cmake -S . -B build \ -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \ -DCMAKE_BUILD_TYPE=Release \ -DICEBERG_BUILD_STATIC=ON \ -DICEBERG_BUILD_SHARED=ON \ + -DICEBERG_BUILD_REST="${verify_rest}" \ + -DICEBERG_BUILD_SQL_CATALOG="${verify_sql}" \ + -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER \ --compile-no-warning-as-error # Build @@ -134,6 +152,14 @@ test_source_distribution() { mkdir -p ./install_test cmake --install build --prefix ./install_test + if [ "${VERIFY_INSTALL_SMOKE}" -gt 0 ]; then + cmake -S example -B example_build \ + -DCMAKE_PREFIX_PATH="${PWD}/install_test" \ + -DCMAKE_BUILD_TYPE=Release + cmake --build example_build --parallel $(nproc || sysctl -n hw.ncpu || echo 4) + ./example_build/demo_example + fi + echo "Build, test and install completed successfully!" } From c0c6b01393070b0813f49b0d6220c98256379cef Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 10 Jun 2026 20:55:07 +0800 Subject: [PATCH 074/151] fix: make git run watch optional in release_rc.sh (#720) --- dev/release/release_rc.sh | 51 +++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/dev/release/release_rc.sh b/dev/release/release_rc.sh index fe919f2f2..5f4595f21 100755 --- a/dev/release/release_rc.sh +++ b/dev/release/release_rc.sh @@ -44,6 +44,7 @@ rc=$2 : "${RELEASE_PUSH_TAG:=${RELEASE_DEFAULT}}" : "${RELEASE_SIGN:=${RELEASE_DEFAULT}}" : "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}" +: "${RELEASE_WATCH:=${RELEASE_DEFAULT}}" : "${RELEASE_WATCH_INTERVAL:=30}" cd "${SOURCE_TOP_DIR}" @@ -97,29 +98,33 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then done echo "Found GitHub Actions workflow with ID: ${run_id}" - while true; do - run_status=$(gh run view \ - --repo "${repository}" \ - --json 'status,conclusion' \ - --jq '.status + " " + (.conclusion // "")' \ - "${run_id}") - echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" - gh run view \ - --repo "${repository}" \ - --json jobs \ - --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ - "${run_id}" - case "${run_status}" in - "completed success") - break - ;; - completed\ *) - echo "GitHub Actions workflow did not complete successfully: ${run_status}" - exit 1 - ;; - esac - sleep "${RELEASE_WATCH_INTERVAL}" - done + if [ "${RELEASE_WATCH}" -gt 0 ]; then + gh run watch --repo "${repository}" --exit-status "${run_id}" + else + while true; do + run_status=$(gh run view \ + --repo "${repository}" \ + --json 'status,conclusion' \ + --jq '.status + " " + (.conclusion // "")' \ + "${run_id}") + echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" + gh run view \ + --repo "${repository}" \ + --json jobs \ + --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ + "${run_id}" + case "${run_status}" in + "completed success") + break + ;; + completed\ *) + echo "GitHub Actions workflow did not complete successfully: ${run_status}" + exit 1 + ;; + esac + sleep "${RELEASE_WATCH_INTERVAL}" + done + fi mkdir -p "${rc_id}" From 577c8e4e3fdcf02a55cfe89faaec8641cc950889 Mon Sep 17 00:00:00 2001 From: Jiajia Li Date: Sun, 14 Jun 2026 12:02:35 +0800 Subject: [PATCH 075/151] feat(auth): implement SigV4 authentication for REST catalog (#616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement AWS SigV4 authentication for the REST catalog client, following Java's `RESTSigV4AuthManager` and `RESTSigV4AuthSession`. - Extend `AuthSession::Authenticate()` with `HTTPRequest` (method, url, body) for SigV4 request signing - Add `SigV4AuthSession`: delegate-first auth → relocate conflicting Authorization header → sign with AWS SDK - Add `SigV4AuthManager`: wraps delegate AuthManager (default OAuth2), resolves credentials from properties or default chain - Body hash matches Java's `SignerChecksumParams` output: empty body → hex `EMPTY_BODY_SHA256`; non-empty body → `Base64(SHA256(body))` --------- Co-authored-by: Gang Wu --- .github/workflows/aws_test.yml | 174 ++++++ .github/workflows/s3_test.yml | 83 --- CMakeLists.txt | 8 +- ci/scripts/build_iceberg.sh | 20 +- .../IcebergThirdpartyToolchain.cmake | 52 ++ meson.options | 7 + src/iceberg/catalog/rest/CMakeLists.txt | 22 + .../catalog/rest/auth/auth_manager_internal.h | 6 + .../catalog/rest/auth/auth_managers.cc | 16 +- .../catalog/rest/auth/auth_properties.h | 15 +- src/iceberg/catalog/rest/auth/auth_session.cc | 12 +- src/iceberg/catalog/rest/auth/auth_session.h | 14 +- .../rest/auth/sigv4_auth_manager_internal.h | 149 +++++ .../catalog/rest/auth/sigv4_manager.cc | 520 ++++++++++++++++++ src/iceberg/catalog/rest/endpoint.cc | 16 - src/iceberg/catalog/rest/endpoint.h | 7 +- src/iceberg/catalog/rest/http_client.cc | 112 ++-- src/iceberg/catalog/rest/http_request.h | 93 ++++ src/iceberg/catalog/rest/meson.build | 26 +- src/iceberg/catalog/rest/rest_catalog.cc | 11 +- src/iceberg/iceberg-config.cmake.in | 5 +- src/iceberg/test/CMakeLists.txt | 5 + src/iceberg/test/auth_manager_test.cc | 82 ++- src/iceberg/test/meson.build | 8 + src/iceberg/test/sigv4_auth_test.cc | 512 +++++++++++++++++ 25 files changed, 1774 insertions(+), 201 deletions(-) create mode 100644 .github/workflows/aws_test.yml delete mode 100644 .github/workflows/s3_test.yml create mode 100644 src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h create mode 100644 src/iceberg/catalog/rest/auth/sigv4_manager.cc create mode 100644 src/iceberg/catalog/rest/http_request.h create mode 100644 src/iceberg/test/sigv4_auth_test.cc diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml new file mode 100644 index 000000000..a8d455006 --- /dev/null +++ b/.github/workflows/aws_test.yml @@ -0,0 +1,174 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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: AWS Tests + +on: + push: + branches: + - '**' + - '!dependabot/**' + tags: + - '**' + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: read + +env: + ICEBERG_HOME: /tmp/iceberg + +jobs: + aws: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + name: AWS (${{ matrix.title }}) + runs-on: ${{ matrix.runs-on }} + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + include: + - title: Ubuntu 24.04, S3 + SigV4, bundled AWS SDK + runs-on: ubuntu-24.04 + CC: gcc-14 + CXX: g++-14 + s3: "ON" + sigv4: "ON" + bundle_awssdk: "ON" + - title: Ubuntu 24.04, S3 + SigV4, system AWS SDK + runs-on: ubuntu-24.04 + CC: gcc-14 + CXX: g++-14 + s3: "ON" + sigv4: "ON" + bundle_awssdk: "OFF" + aws-sdk-features: core,config,s3,identity-management,sts,transfer + - title: macOS 26 ARM64, S3, bundled AWS SDK + runs-on: macos-26 + s3: "ON" + sigv4: "OFF" + bundle_awssdk: "ON" + env: + ICEBERG_TEST_S3_URI: s3://iceberg-test + AWS_ACCESS_KEY_ID: minio + AWS_SECRET_ACCESS_KEY: minio123 + AWS_DEFAULT_REGION: us-east-1 + AWS_ENDPOINT_URL: http://127.0.0.1:9000 + AWS_EC2_METADATA_DISABLED: "TRUE" + steps: + - name: Checkout iceberg-cpp + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Install dependencies on Ubuntu + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + shell: bash + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Cache vcpkg packages + if: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' }} + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: vcpkg-cache + with: + path: /usr/local/share/vcpkg/installed + key: vcpkg-x64-linux-aws-sdk-cpp-s3-${{ matrix.s3 }}-sigv4-${{ matrix.sigv4 }}-${{ hashFiles('.github/workflows/aws_test.yml') }} + - name: Install AWS SDK via vcpkg + if: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' && steps.vcpkg-cache.outputs.cache-hit != 'true' }} + shell: bash + # Retry to ride out transient GitHub/mirror download failures (504s). + run: | + for attempt in 1 2 3; do + if vcpkg install "aws-sdk-cpp[${{ matrix.aws-sdk-features }}]:x64-linux"; then + exit 0 + fi + echo "::warning::vcpkg install failed (attempt ${attempt}/3), retrying in 30s" + sleep 30 + done + echo "::error::vcpkg install failed after 3 attempts" + exit 1 + - name: Set Ubuntu Compilers + if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} + run: | + echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV + echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Start MinIO + if: ${{ matrix.s3 == 'ON' }} + shell: bash + run: bash ci/scripts/start_minio.sh + - name: Build and test Iceberg + shell: bash + env: + CMAKE_TOOLCHAIN_FILE: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' && '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }} + run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ${{ matrix.s3 }} ${{ matrix.sigv4 }} ${{ matrix.bundle_awssdk }} + + # Exercise the Meson build with SigV4 enabled (resolves aws-cpp-sdk-core via + # its CMake config, not pkg-config whose Cflags force -std=c++11). + meson-sigv4: + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + name: Meson SigV4 (AMD64 Ubuntu 24.04) + runs-on: ubuntu-24.04 + timeout-minutes: 45 + steps: + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: '3.x' + - name: Checkout iceberg-cpp + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Install build dependencies + shell: bash + run: | + sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements.txt + - name: Cache vcpkg packages + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + id: vcpkg-cache + with: + path: /usr/local/share/vcpkg/installed + key: vcpkg-x64-linux-aws-sdk-cpp-core-${{ hashFiles('.github/workflows/aws_test.yml') }} + - name: Install AWS SDK via vcpkg + if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }} + shell: bash + # Retry to ride out transient GitHub/mirror download failures (504s). + run: | + for attempt in 1 2 3; do + if vcpkg install aws-sdk-cpp[core]:x64-linux; then + exit 0 + fi + echo "::warning::vcpkg install failed (attempt ${attempt}/3), retrying in 30s" + sleep 30 + done + echo "::error::vcpkg install failed after 3 attempts" + exit 1 + - name: Set Ubuntu Compilers + run: | + echo "CC=gcc-14" >> $GITHUB_ENV + echo "CXX=g++-14" >> $GITHUB_ENV + - name: Build and test Iceberg + shell: bash + env: + CMAKE_PREFIX_PATH: /usr/local/share/vcpkg/installed/x64-linux + run: | + meson setup builddir -Dsigv4=enabled + meson compile -C builddir + meson test -C builddir --timeout-multiplier 0 --print-errorlogs diff --git a/.github/workflows/s3_test.yml b/.github/workflows/s3_test.yml deleted file mode 100644 index 0cf8e8b1e..000000000 --- a/.github/workflows/s3_test.yml +++ /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. - -# S3-backed tests against MinIO (Linux and macOS only). -name: S3 Tests - -on: - push: - branches: - - '**' - - '!dependabot/**' - tags: - - '**' - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - -concurrency: - group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - -permissions: - contents: read - -env: - ICEBERG_HOME: /tmp/iceberg - -jobs: - s3-minio: - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - name: S3 (${{ matrix.title }}) - runs-on: ${{ matrix.runs-on }} - timeout-minutes: 35 - strategy: - fail-fast: false - matrix: - include: - - title: AMD64 Ubuntu 24.04 - runs-on: ubuntu-24.04 - CC: gcc-14 - CXX: g++-14 - - title: AArch64 macOS 26 - runs-on: macos-26 - env: - ICEBERG_TEST_S3_URI: s3://iceberg-test - AWS_ACCESS_KEY_ID: minio - AWS_SECRET_ACCESS_KEY: minio123 - AWS_DEFAULT_REGION: us-east-1 - AWS_ENDPOINT_URL: http://127.0.0.1:9000 - AWS_EC2_METADATA_DISABLED: "TRUE" - steps: - - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Install dependencies on Ubuntu - if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} - shell: bash - run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev - - name: Set Ubuntu Compilers - if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} - run: | - echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV - echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV - - name: Start MinIO - shell: bash - run: bash ci/scripts/start_minio.sh - - name: Build and test Iceberg with S3 - shell: bash - run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ON diff --git a/CMakeLists.txt b/CMakeLists.txt index b03e586b0..69f90b54a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,8 @@ option(ICEBERG_SQL_SQLITE "Build the SQLite connector for the SQL catalog" OFF) option(ICEBERG_SQL_POSTGRESQL "Build the PostgreSQL connector for the SQL catalog" OFF) option(ICEBERG_SQL_MYSQL "Build the MySQL connector for the SQL catalog" OFF) option(ICEBERG_S3 "Build with S3 support" OFF) +option(ICEBERG_SIGV4 "Build with SigV4 support" OFF) +option(ICEBERG_BUNDLE_AWSSDK "Bundle AWS SDK for S3/SigV4 support" ON) option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) @@ -76,12 +78,6 @@ if(ICEBERG_BUILD_REST_INTEGRATION_TESTS AND WIN32) message(WARNING "Cannot build rest integration test on Windows, turning it off.") endif() -# ICEBERG_S3 requires ICEBERG_BUILD_BUNDLE -if(NOT ICEBERG_BUILD_BUNDLE AND ICEBERG_S3) - set(ICEBERG_S3 OFF) - message(STATUS "ICEBERG_S3 is disabled because ICEBERG_BUILD_BUNDLE is OFF") -endif() - include(CMakeParseArguments) include(IcebergBuildUtils) include(IcebergSanitizer) diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 406ef56a7..6af0802f6 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. # -# Usage: build_iceberg.sh [rest_integration_tests=OFF] [sccache=OFF] [s3=OFF] +# Usage: build_iceberg.sh [rest_integration_tests=OFF] [sccache=OFF] [s3=OFF] [sigv4=OFF] [bundle_awssdk=ON] set -eux @@ -26,6 +26,8 @@ build_dir=${1}/build build_rest_integration_test=${2:-OFF} build_enable_sccache=${3:-OFF} build_enable_s3=${4:-OFF} +build_enable_sigv4=${5:-OFF} +build_bundle_awssdk=${6:-ON} run_tests=${ICEBERG_RUN_TESTS:-ON} mkdir ${build_dir} @@ -49,10 +51,26 @@ else CMAKE_ARGS+=("-DICEBERG_S3=OFF") fi +if [[ "${build_enable_sigv4}" == "ON" ]]; then + CMAKE_ARGS+=("-DICEBERG_SIGV4=ON") +else + CMAKE_ARGS+=("-DICEBERG_SIGV4=OFF") +fi + +if [[ "${build_bundle_awssdk}" == "ON" ]]; then + CMAKE_ARGS+=("-DICEBERG_BUNDLE_AWSSDK=ON") +else + CMAKE_ARGS+=("-DICEBERG_BUNDLE_AWSSDK=OFF") +fi + if is_windows; then CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake") CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release") else + # Pass an externally provided toolchain (e.g. vcpkg for the SigV4 job) + if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then + CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") + fi CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug") fi diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 152af0cb9..1430bb9cd 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -19,6 +19,48 @@ # third party libraries. set(ICEBERG_SYSTEM_DEPENDENCIES) set(ICEBERG_ARROW_INSTALL_INTERFACE_LIBS) +set(ICEBERG_AWSSDK_BUNDLED FALSE) +if(ICEBERG_S3 AND ICEBERG_BUNDLE_AWSSDK) + if(NOT ICEBERG_BUILD_BUNDLE) + message(FATAL_ERROR "ICEBERG_BUNDLE_AWSSDK requires ICEBERG_BUILD_BUNDLE to be ON") + endif() + set(ICEBERG_AWSSDK_BUNDLED TRUE) +endif() + +set(ICEBERG_AWSSDK_COMPONENTS) +if(NOT ICEBERG_AWSSDK_BUNDLED) + if(ICEBERG_S3) + list(APPEND + ICEBERG_AWSSDK_COMPONENTS + core + config + s3 + transfer + identity-management + sts) + elseif(ICEBERG_SIGV4) + list(APPEND ICEBERG_AWSSDK_COMPONENTS core) + endif() +endif() + +# ---------------------------------------------------------------------- +# AWS SDK for C++ + +function(resolve_aws_sdk_dependency) + if(NOT ICEBERG_AWSSDK_COMPONENTS) + return() + endif() + find_package(AWSSDK REQUIRED COMPONENTS ${ICEBERG_AWSSDK_COMPONENTS}) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES AWSSDK) + set(ICEBERG_SYSTEM_DEPENDENCIES + ${ICEBERG_SYSTEM_DEPENDENCIES} + PARENT_SCOPE) + # Forwarded to find_dependency(AWSSDK ...) in iceberg-config.cmake.in so + # downstream installed builds load the same AWS SDK targets. + set(ICEBERG_FIND_EXTRA_ARGS_AWSSDK + "COMPONENTS;${ICEBERG_AWSSDK_COMPONENTS}" + PARENT_SCOPE) +endfunction() # ---------------------------------------------------------------------- # Versions and URLs for toolchain builds @@ -111,6 +153,9 @@ function(resolve_arrow_dependency) set(ARROW_POSITION_INDEPENDENT_CODE ON) set(ARROW_DEPENDENCY_SOURCE "BUNDLED") set(ARROW_WITH_ZLIB ON) + if(ICEBERG_S3 AND NOT ICEBERG_AWSSDK_BUNDLED) + set(AWSSDK_SOURCE "SYSTEM") + endif() set(ZLIB_SOURCE "SYSTEM") set(ARROW_VERBOSE_THIRDPARTY_BUILD OFF) set(CMAKE_CXX_STANDARD 20) @@ -620,6 +665,13 @@ resolve_nanoarrow_dependency() resolve_croaring_dependency() resolve_nlohmann_json_dependency() +if(ICEBERG_S3 OR ICEBERG_SIGV4) + if(ICEBERG_SIGV4 AND NOT ICEBERG_BUILD_REST) + message(FATAL_ERROR "ICEBERG_SIGV4 requires ICEBERG_BUILD_REST to be ON") + endif() + resolve_aws_sdk_dependency() +endif() + if(ICEBERG_BUILD_BUNDLE) resolve_arrow_dependency() resolve_avro_dependency() diff --git a/meson.options b/meson.options index 9152af34d..c53574889 100644 --- a/meson.options +++ b/meson.options @@ -44,4 +44,11 @@ option( value: 'disabled', ) +option( + 'sigv4', + type: 'feature', + description: 'Build AWS SigV4 authentication support for rest catalog', + value: 'disabled', +) + option('tests', type: 'feature', description: 'Build tests', value: 'enabled') diff --git a/src/iceberg/catalog/rest/CMakeLists.txt b/src/iceberg/catalog/rest/CMakeLists.txt index 8fb2e93c0..b6438486a 100644 --- a/src/iceberg/catalog/rest/CMakeLists.txt +++ b/src/iceberg/catalog/rest/CMakeLists.txt @@ -23,6 +23,7 @@ set(ICEBERG_REST_SOURCES auth/auth_properties.cc auth/auth_session.cc auth/oauth2_util.cc + auth/sigv4_manager.cc auth/token_refresh_scheduler.cc catalog_properties.cc endpoint.cc @@ -53,6 +54,15 @@ list(APPEND "$,iceberg::iceberg_shared,iceberg::iceberg_static>" "$,iceberg::cpr,cpr::cpr>") +if(ICEBERG_SIGV4) + list(APPEND ICEBERG_REST_STATIC_BUILD_INTERFACE_LIBS aws-cpp-sdk-core) + list(APPEND ICEBERG_REST_SHARED_BUILD_INTERFACE_LIBS aws-cpp-sdk-core) + if(NOT ICEBERG_AWSSDK_BUNDLED) + list(APPEND ICEBERG_REST_STATIC_INSTALL_INTERFACE_LIBS aws-cpp-sdk-core) + list(APPEND ICEBERG_REST_SHARED_INSTALL_INTERFACE_LIBS aws-cpp-sdk-core) + endif() +endif() + add_iceberg_lib(iceberg_rest SOURCES ${ICEBERG_REST_SOURCES} @@ -65,4 +75,16 @@ add_iceberg_lib(iceberg_rest SHARED_INSTALL_INTERFACE_LIBS ${ICEBERG_REST_SHARED_INSTALL_INTERFACE_LIBS}) +foreach(LIB iceberg_rest_static iceberg_rest_shared) + if(TARGET ${LIB}) + if(ICEBERG_SIGV4) + target_compile_definitions(${LIB} + PUBLIC "$") + else() + target_compile_definitions(${LIB} + PUBLIC "$") + endif() + endif() +endforeach() + iceberg_install_all_headers(iceberg/catalog/rest) diff --git a/src/iceberg/catalog/rest/auth/auth_manager_internal.h b/src/iceberg/catalog/rest/auth/auth_manager_internal.h index 051d05505..36671a39f 100644 --- a/src/iceberg/catalog/rest/auth/auth_manager_internal.h +++ b/src/iceberg/catalog/rest/auth/auth_manager_internal.h @@ -47,4 +47,10 @@ Result> MakeOAuth2Manager( std::string_view name, const std::unordered_map& properties); +/// \brief Create a SigV4 authentication manager with a delegate. Returns +/// NotSupported when the library was built without ICEBERG_SIGV4. +Result> MakeSigV4AuthManager( + std::string_view name, + const std::unordered_map& properties); + } // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/auth_managers.cc b/src/iceberg/catalog/rest/auth/auth_managers.cc index f55885d75..6ee2637b3 100644 --- a/src/iceberg/catalog/rest/auth/auth_managers.cc +++ b/src/iceberg/catalog/rest/auth/auth_managers.cc @@ -46,6 +46,12 @@ const std::unordered_set& KnownAuthTypes() // Infer the authentication type from properties. std::string InferAuthType( const std::unordered_map& properties) { + // Deprecated alias: rest.sigv4-enabled=true forces SigV4. + if (auto it = properties.find(AuthProperties::kSigV4Enabled); + it != properties.end() && StringUtils::EqualsIgnoreCase(it->second, "true")) { + return AuthProperties::kAuthTypeSigV4; + } + auto it = properties.find(AuthProperties::kAuthType); if (it != properties.end() && !it->second.empty()) { return StringUtils::ToLower(it->second); @@ -61,17 +67,13 @@ std::string InferAuthType( return AuthProperties::kAuthTypeNone; } -AuthManagerRegistry CreateDefaultRegistry() { - return { +AuthManagerRegistry& GetRegistry() { + static AuthManagerRegistry registry = { {AuthProperties::kAuthTypeNone, MakeNoopAuthManager}, {AuthProperties::kAuthTypeBasic, MakeBasicAuthManager}, {AuthProperties::kAuthTypeOAuth2, MakeOAuth2Manager}, + {AuthProperties::kAuthTypeSigV4, MakeSigV4AuthManager}, }; -} - -// Get the global registry of auth manager factories. -AuthManagerRegistry& GetRegistry() { - static AuthManagerRegistry registry = CreateDefaultRegistry(); return registry; } diff --git a/src/iceberg/catalog/rest/auth/auth_properties.h b/src/iceberg/catalog/rest/auth/auth_properties.h index 05a7ea2c6..a699569c1 100644 --- a/src/iceberg/catalog/rest/auth/auth_properties.h +++ b/src/iceberg/catalog/rest/auth/auth_properties.h @@ -54,11 +54,22 @@ class ICEBERG_REST_EXPORT AuthProperties : public ConfigBase { // ---- SigV4 entries ---- - inline static const std::string kSigV4Region = "rest.auth.sigv4.region"; - inline static const std::string kSigV4Service = "rest.auth.sigv4.service"; + /// Deprecated: `rest.sigv4-enabled=true` selects SigV4 regardless of + /// `rest.auth.type`. + inline static const std::string kSigV4Enabled = "rest.sigv4-enabled"; inline static const std::string kSigV4DelegateAuthType = "rest.auth.sigv4.delegate-auth-type"; + /// SigV4 signing region. If unset, SigV4 resolves the signing region from + /// AWS environment/profile configuration and fails if no region can be + /// resolved. + inline static const std::string kSigV4SigningRegion = "rest.signing-region"; + inline static const std::string kSigV4SigningName = "rest.signing-name"; + inline static const std::string kSigV4SigningNameDefault = "execute-api"; + inline static const std::string kSigV4AccessKeyId = "rest.access-key-id"; + inline static const std::string kSigV4SecretAccessKey = "rest.secret-access-key"; + inline static const std::string kSigV4SessionToken = "rest.session-token"; + // ---- OAuth2 entries ---- inline static Entry kToken{"token", ""}; diff --git a/src/iceberg/catalog/rest/auth/auth_session.cc b/src/iceberg/catalog/rest/auth/auth_session.cc index 31688eedf..545ee00b1 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.cc +++ b/src/iceberg/catalog/rest/auth/auth_session.cc @@ -43,11 +43,11 @@ class DefaultAuthSession : public AuthSession { explicit DefaultAuthSession(std::unordered_map headers) : headers_(std::move(headers)) {} - Status Authenticate(std::unordered_map& headers) override { + Result Authenticate(HttpRequest request) override { for (const auto& [key, value] : headers_) { - headers.try_emplace(key, value); + request.headers.try_emplace(key, value); } - return {}; + return request; } private: @@ -77,12 +77,12 @@ class OAuth2AuthSession : public AuthSession, return session; } - Status Authenticate(std::unordered_map& headers) override { + Result Authenticate(HttpRequest request) override { std::shared_lock lock(mutex_); for (const auto& [key, value] : headers_) { - headers.try_emplace(key, value); + request.headers.try_emplace(key, value); } - return {}; + return request; } Status Close() override { return CloseImpl(); } diff --git a/src/iceberg/catalog/rest/auth/auth_session.h b/src/iceberg/catalog/rest/auth/auth_session.h index 5cccacec9..3d0063a04 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.h +++ b/src/iceberg/catalog/rest/auth/auth_session.h @@ -23,6 +23,7 @@ #include #include +#include "iceberg/catalog/rest/http_request.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/catalog/rest/type_fwd.h" #include "iceberg/result.h" @@ -37,20 +38,21 @@ class ICEBERG_REST_EXPORT AuthSession { public: virtual ~AuthSession() = default; - /// \brief Authenticate the given request headers. + /// \brief Authenticate an outgoing HTTP request. /// - /// This method adds authentication information (e.g., Authorization header) - /// to the provided headers map. The implementation should be idempotent. + /// Returns a request with authentication information (e.g., an Authorization + /// header) added. Implementations must be idempotent. The request is passed + /// by value so callers can move request bodies into the authentication path. /// - /// \param[in,out] headers The headers map to add authentication information to. - /// \return Status indicating success or one of the following errors: + /// \param request The request to authenticate. + /// \return The authenticated request on success, or one of: /// - AuthenticationFailed: General authentication failure (invalid credentials, /// etc.) /// - TokenExpired: Authentication token has expired and needs refresh /// - NotAuthorized: Not authenticated (401) /// - IOError: Network or connection errors when reaching auth server /// - RestError: HTTP errors from authentication service - virtual Status Authenticate(std::unordered_map& headers) = 0; + virtual Result Authenticate(HttpRequest request) = 0; /// \brief Close the session and release any resources. /// diff --git a/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h b/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h new file mode 100644 index 000000000..a4f42875d --- /dev/null +++ b/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h @@ -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. + */ + +#pragma once + +#include +#include +#include + +#include "iceberg/catalog/rest/auth/auth_manager.h" +#include "iceberg/catalog/rest/auth/auth_session.h" +#include "iceberg/catalog/rest/iceberg_rest_export.h" +#include "iceberg/result.h" + +namespace Aws::Auth { +class AWSCredentialsProvider; +} // namespace Aws::Auth + +namespace Aws::Client { +class AWSAuthV4Signer; +} // namespace Aws::Client + +namespace iceberg::rest::auth { + +/// \brief Initialize the AWS SDK for SigV4 use. Idempotent. +/// +/// Normal REST SigV4 users do not need to call this. SigV4 sessions lazily +/// initialize the SDK when needed. This hook exists for tests and for explicit +/// process-shutdown sequencing when an embedding application needs it. +ICEBERG_REST_EXPORT Status InitializeAwsSdk(); + +/// \brief Shut down the SigV4-owned AWS SDK lifecycle. +/// +/// Refuses if any SigV4 sessions are alive. +ICEBERG_REST_EXPORT Status FinalizeAwsSdk(); + +ICEBERG_REST_EXPORT bool IsAwsSdkInitialized(); +ICEBERG_REST_EXPORT bool IsAwsSdkFinalized(); + +/// \brief An AuthSession that signs requests with AWS SigV4. +/// +/// The request is first authenticated by the delegate AuthSession (e.g., OAuth2), +/// then signed with SigV4. In case of conflicting headers, the Authorization header +/// set by the delegate is relocated with an "Original-" prefix, then included in +/// the canonical headers to sign. +/// +/// See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html +/// +/// Thread safety: Authenticate() is thread-safe as long as the delegate +/// session is. +class ICEBERG_REST_EXPORT SigV4AuthSession : public AuthSession { + public: + /// SHA-256 hash of empty string, used for requests with no body. + static constexpr std::string_view kEmptyBodySha256 = + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + + /// Prefix prepended to relocated headers that conflict with SigV4-signed headers. + static constexpr std::string_view kRelocatedHeaderPrefix = "Original-"; + + /// \brief Creates a session registered with the AWS SDK lifecycle. + /// + /// Fails if the SDK is not initialized. Every session owns its lifecycle + /// registration and unregisters on destruction. + static Result> Make( + std::shared_ptr delegate, std::string signing_region, + std::string signing_name, + std::shared_ptr credentials_provider); + + ~SigV4AuthSession() override; + + Result Authenticate(HttpRequest request) override; + + Status Close() override; + + const std::shared_ptr& delegate() const { return delegate_; } + + /// Exposed so derived sessions can reuse the chain instead of constructing + /// a fresh DefaultAWSCredentialsProviderChain per derivation. + const std::shared_ptr& credentials_provider() const { + return credentials_provider_; + } + + private: + SigV4AuthSession( + std::shared_ptr delegate, std::string signing_region, + std::string signing_name, + std::shared_ptr credentials_provider); + + std::shared_ptr delegate_; + std::string signing_region_; + std::string signing_name_; + std::shared_ptr credentials_provider_; + std::unique_ptr signer_; +}; + +/// \brief An AuthManager that produces SigV4AuthSession instances. +/// +/// Wraps a delegate AuthManager to handle double authentication (e.g., OAuth2 + SigV4). +class ICEBERG_REST_EXPORT SigV4AuthManager : public AuthManager { + public: + explicit SigV4AuthManager(std::unique_ptr delegate); + ~SigV4AuthManager() override; + + Result> InitSession( + HttpClient& init_client, + const std::unordered_map& properties) override; + + Result> CatalogSession( + HttpClient& shared_client, + const std::unordered_map& properties) override; + + Result> ContextualSession( + const std::unordered_map& context, + std::shared_ptr parent) override; + + Result> TableSession( + const TableIdentifier& table, + const std::unordered_map& properties, + std::shared_ptr parent) override; + + Status Close() override; + + private: + Result> WrapSession( + std::shared_ptr delegate_session, + const std::unordered_map& properties, + std::shared_ptr credentials_provider); + + std::unique_ptr delegate_; + std::unordered_map catalog_properties_; +}; + +} // namespace iceberg::rest::auth diff --git a/src/iceberg/catalog/rest/auth/sigv4_manager.cc b/src/iceberg/catalog/rest/auth/sigv4_manager.cc new file mode 100644 index 000000000..b3cb4dbd4 --- /dev/null +++ b/src/iceberg/catalog/rest/auth/sigv4_manager.cc @@ -0,0 +1,520 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/catalog/rest/auth/auth_manager_internal.h" +#include "iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h" +#include "iceberg/result.h" + +#if ICEBERG_SIGV4_ENABLED + +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "iceberg/catalog/rest/auth/auth_managers.h" +# include "iceberg/catalog/rest/auth/auth_properties.h" +# include "iceberg/catalog/rest/auth/oauth2_util.h" +# include "iceberg/util/macros.h" +# include "iceberg/util/string_util.h" + +namespace iceberg::rest::auth { + +namespace { + +constexpr std::string_view kAmzContentSha256Header = "x-amz-content-sha256"; + +class AwsSdkLifecycle { + public: + static AwsSdkLifecycle& Instance() { + static AwsSdkLifecycle instance; + return instance; + } + + Status Initialize() { + std::lock_guard lock(mutex_); + auto s = state_.load(); + if (s == State::kInitialized) return {}; + if (s == State::kFinalized) { + return InvalidArgument("AWS SDK has already been finalized; cannot reinitialize"); + } + Aws::InitAPI(options_); + state_.store(State::kInitialized); + return {}; + } + + Status Finalize() { + std::lock_guard lock(mutex_); + if (state_.load() != State::kInitialized) return {}; + if (active_session_count_ != 0) { + return Invalid( + "Cannot finalize AWS SDK while {} SigV4 auth session(s) are still alive", + active_session_count_); + } + Aws::ShutdownAPI(options_); + state_.store(State::kFinalized); + return {}; + } + + Status EnsureInitialized() { + if (state_.load() == State::kInitialized) return {}; + return Initialize(); + } + + bool IsInitialized() const { return state_.load() == State::kInitialized; } + bool IsFinalized() const { return state_.load() == State::kFinalized; } + + // Holds the mutex while incrementing, so Finalize() can never observe a + // stale 0 between its count check and Aws::ShutdownAPI. + Status RegisterSession() { + std::lock_guard lock(mutex_); + if (state_.load() != State::kInitialized) { + return InvalidArgument( + "AWS SDK is not initialized; cannot create a SigV4AuthSession"); + } + ++active_session_count_; + return {}; + } + + void UnregisterSession() { + std::lock_guard lock(mutex_); + --active_session_count_; + } + + private: + enum class State : uint8_t { kUninitialized, kInitialized, kFinalized }; + + AwsSdkLifecycle() = default; + + std::atomic state_{State::kUninitialized}; + std::mutex mutex_; + Aws::SDKOptions options_; + size_t active_session_count_{0}; // guarded by mutex_ +}; + +Aws::Http::HttpMethod ToAwsMethod(HttpMethod method) { + switch (method) { + case HttpMethod::kGet: + return Aws::Http::HttpMethod::HTTP_GET; + case HttpMethod::kPost: + return Aws::Http::HttpMethod::HTTP_POST; + case HttpMethod::kPut: + return Aws::Http::HttpMethod::HTTP_PUT; + case HttpMethod::kDelete: + return Aws::Http::HttpMethod::HTTP_DELETE; + case HttpMethod::kHead: + return Aws::Http::HttpMethod::HTTP_HEAD; + } + return Aws::Http::HttpMethod::HTTP_GET; +} + +std::unordered_map MergeProperties( + const std::unordered_map& base, + const std::unordered_map& overrides) { + auto merged = base; + for (const auto& [key, value] : overrides) { + merged.insert_or_assign(key, value); + } + return merged; +} + +/// Matches Java RESTSigV4AuthSession: canonical headers carry +/// Base64(SHA256(body)), canonical request trailer uses hex. +class RestSigV4Signer : public Aws::Client::AWSAuthV4Signer { + public: + RestSigV4Signer(const std::shared_ptr& creds, + const char* service_name, const Aws::String& region) + : Aws::Client::AWSAuthV4Signer(creds, service_name, region, + PayloadSigningPolicy::Always, + /*urlEscapePath=*/false) { + // Skip the signer's hex overwrite of x-amz-content-sha256 so canonical + // headers see the caller's Base64; ComputePayloadHash still feeds hex + // into the canonical request trailer. + m_includeSha256HashHeader = false; + } +}; + +// TODO(sigv4): support loading a custom AWSCredentialsProvider via a class +// name property, matching Java's AwsProperties.restCredentialsProvider(). +Result> MakeCredentialsProvider( + const std::unordered_map& properties) { + auto access_key_it = properties.find(AuthProperties::kSigV4AccessKeyId); + auto secret_key_it = properties.find(AuthProperties::kSigV4SecretAccessKey); + auto session_token_it = properties.find(AuthProperties::kSigV4SessionToken); + bool has_ak = access_key_it != properties.end() && !access_key_it->second.empty(); + bool has_sk = secret_key_it != properties.end() && !secret_key_it->second.empty(); + bool has_token = + session_token_it != properties.end() && !session_token_it->second.empty(); + + ICEBERG_PRECHECK( + has_ak == has_sk, "Both '{}' and '{}' must be set together, or neither", + AuthProperties::kSigV4AccessKeyId, AuthProperties::kSigV4SecretAccessKey); + ICEBERG_PRECHECK(!has_token || (has_ak && has_sk), + "'{}' requires both '{}' and '{}' to be set", + AuthProperties::kSigV4SessionToken, AuthProperties::kSigV4AccessKeyId, + AuthProperties::kSigV4SecretAccessKey); + + if (has_ak) { + Aws::Auth::AWSCredentials credentials(access_key_it->second.c_str(), + secret_key_it->second.c_str()); + if (has_token) { + credentials.SetSessionToken(session_token_it->second.c_str()); + } + return std::make_shared(credentials); + } + + return std::make_shared(); +} + +Result ResolveSigningRegion( + const std::unordered_map& properties) { + if (auto it = properties.find(AuthProperties::kSigV4SigningRegion); + it != properties.end() && !it->second.empty()) { + return it->second; + } + // Resolve from env then the shared config profile, otherwise fail. + // If this becomes expensive, cache it at the catalog/AuthManager scope or + // introduce an AwsProperties-like object as Java does. + Aws::String region = Aws::Environment::GetEnv("AWS_REGION"); + if (region.empty()) { + region = Aws::Environment::GetEnv("AWS_DEFAULT_REGION"); + } + if (region.empty()) { + const auto& profiles = Aws::Config::GetCachedConfigProfiles(); + if (auto it = profiles.find(Aws::Auth::GetConfigProfileName()); + it != profiles.end()) { + region = it->second.GetRegion(); + } + } + if (region.empty()) { + return InvalidArgument( + "SigV4: could not resolve a signing region; set the '{}' property or the " + "AWS_REGION environment variable", + AuthProperties::kSigV4SigningRegion); + } + return std::string(region.c_str()); +} + +std::string ResolveSigningName( + const std::unordered_map& properties) { + if (auto it = properties.find(AuthProperties::kSigV4SigningName); + it != properties.end() && !it->second.empty()) { + return it->second; + } + return AuthProperties::kSigV4SigningNameDefault; +} + +bool HasSigV4CredentialOverride( + const std::unordered_map& properties) { + return properties.contains(AuthProperties::kSigV4AccessKeyId) || + properties.contains(AuthProperties::kSigV4SecretAccessKey) || + properties.contains(AuthProperties::kSigV4SessionToken); +} + +Result> ResolveCredentialsProvider( + const std::unordered_map& properties, + std::shared_ptr reuse_credentials = nullptr) { + if (reuse_credentials && !HasSigV4CredentialOverride(properties)) { + return reuse_credentials; + } + return MakeCredentialsProvider(properties); +} + +template +class ScopeExit { + public: + explicit ScopeExit(Fn fn) : fn_(std::move(fn)) {} + ScopeExit(ScopeExit&& other) noexcept + : fn_(std::move(other.fn_)), active_(other.active_) { + other.active_ = false; + } + ScopeExit(const ScopeExit&) = delete; + ScopeExit& operator=(const ScopeExit&) = delete; + ScopeExit& operator=(ScopeExit&&) = delete; + ~ScopeExit() { + if (active_) fn_(); + } + void Cancel() noexcept { active_ = false; } + + private: + Fn fn_; + bool active_ = true; +}; + +} // namespace + +// ---- SigV4AuthSession ---- + +SigV4AuthSession::SigV4AuthSession( + std::shared_ptr delegate, std::string signing_region, + std::string signing_name, + std::shared_ptr credentials_provider) + : delegate_(std::move(delegate)), + signing_region_(std::move(signing_region)), + signing_name_(std::move(signing_name)), + credentials_provider_(std::move(credentials_provider)), + signer_(std::make_unique( + credentials_provider_, signing_name_.c_str(), signing_region_.c_str())) {} + +SigV4AuthSession::~SigV4AuthSession() { AwsSdkLifecycle::Instance().UnregisterSession(); } + +Result SigV4AuthSession::Authenticate(HttpRequest request) { + ICEBERG_ASSIGN_OR_RAISE(auto delegate_request, + delegate_->Authenticate(std::move(request))); + const auto& original_headers = delegate_request.headers; + + std::unordered_map signing_headers; + for (const auto& [name, value] : original_headers) { + if (StringUtils::EqualsIgnoreCase(name, kAuthorizationHeader)) { + signing_headers[std::string(kRelocatedHeaderPrefix) + name] = value; + } else { + signing_headers[name] = value; + } + } + + Aws::Http::URI aws_uri(delegate_request.url.c_str()); + auto aws_request = std::make_shared( + aws_uri, ToAwsMethod(delegate_request.method)); + for (const auto& [name, value] : signing_headers) { + aws_request->SetHeaderValue(Aws::String(name.c_str()), Aws::String(value.c_str())); + } + + // Empty bodies use the hex SHA256 constant; non-empty bodies use + // Base64(SHA256(body)). This matches Java RESTSigV4AuthSession behavior. + if (delegate_request.body.empty()) { + aws_request->SetHeaderValue(Aws::String(kAmzContentSha256Header), + Aws::String(kEmptyBodySha256)); + } else { + auto body_stream = + Aws::MakeShared("SigV4Body", delegate_request.body); + aws_request->AddContentBody(body_stream); + auto sha256 = Aws::Utils::HashingUtils::CalculateSHA256( + Aws::String(delegate_request.body.data(), delegate_request.body.size())); + aws_request->SetHeaderValue(Aws::String(kAmzContentSha256Header), + Aws::Utils::HashingUtils::Base64Encode(sha256)); + } + + if (!signer_->SignRequest(*aws_request)) { + return AuthenticationFailed("AWS SigV4 request signing failed"); + } + + // Build a case-insensitive view of original headers so signer-added headers + // can be compared without lowercasing or copying the originals. + std::map + originals_by_name; + for (const auto& [orig_name, orig_value] : original_headers) { + originals_by_name.emplace(orig_name, orig_value); + } + + HttpRequest signed_request{.method = delegate_request.method, + .url = std::move(delegate_request.url), + .headers = {}, + .body = std::move(delegate_request.body)}; + for (const auto& [aws_name, aws_value] : aws_request->GetHeaders()) { + std::string name(aws_name.c_str(), aws_name.size()); + std::string value(aws_value.c_str(), aws_value.size()); + if (auto it = originals_by_name.find(std::string_view(name)); + it != originals_by_name.end()) { + // Preserve the original value when the signer overwrites a header. + if (it->second != std::string_view(value)) { + signed_request.headers.try_emplace(std::string(kRelocatedHeaderPrefix) + name, + std::string(it->second)); + } + } + signed_request.headers.insert_or_assign(std::move(name), std::move(value)); + } + + return signed_request; +} + +Status SigV4AuthSession::Close() { return delegate_->Close(); } + +// ---- SigV4AuthManager ---- + +SigV4AuthManager::SigV4AuthManager(std::unique_ptr delegate) + : delegate_(std::move(delegate)) {} + +SigV4AuthManager::~SigV4AuthManager() = default; + +Result> SigV4AuthManager::InitSession( + HttpClient& init_client, + const std::unordered_map& properties) { + ICEBERG_RETURN_UNEXPECTED(AwsSdkLifecycle::Instance().EnsureInitialized()); + ICEBERG_ASSIGN_OR_RAISE(auto delegate_session, + delegate_->InitSession(init_client, properties)); + ICEBERG_ASSIGN_OR_RAISE(auto credentials, ResolveCredentialsProvider(properties)); + return WrapSession(std::move(delegate_session), properties, std::move(credentials)); +} + +Result> SigV4AuthManager::CatalogSession( + HttpClient& shared_client, + const std::unordered_map& properties) { + ICEBERG_RETURN_UNEXPECTED(AwsSdkLifecycle::Instance().EnsureInitialized()); + catalog_properties_ = properties; + ICEBERG_ASSIGN_OR_RAISE(auto delegate_session, + delegate_->CatalogSession(shared_client, properties)); + ICEBERG_ASSIGN_OR_RAISE(auto credentials, ResolveCredentialsProvider(properties)); + return WrapSession(std::move(delegate_session), properties, std::move(credentials)); +} + +Result> SigV4AuthManager::ContextualSession( + const std::unordered_map& context, + std::shared_ptr parent) { + auto sigv4_parent = std::dynamic_pointer_cast(std::move(parent)); + ICEBERG_PRECHECK(sigv4_parent != nullptr, + "SigV4AuthManager parent must be a SigV4AuthSession"); + + ICEBERG_ASSIGN_OR_RAISE(auto delegate_session, delegate_->ContextualSession( + context, sigv4_parent->delegate())); + + auto merged = MergeProperties(catalog_properties_, context); + ICEBERG_ASSIGN_OR_RAISE( + auto credentials, + ResolveCredentialsProvider(context, sigv4_parent->credentials_provider())); + return WrapSession(std::move(delegate_session), merged, std::move(credentials)); +} + +Result> SigV4AuthManager::TableSession( + const TableIdentifier& table, + const std::unordered_map& properties, + std::shared_ptr parent) { + auto sigv4_parent = std::dynamic_pointer_cast(std::move(parent)); + ICEBERG_PRECHECK(sigv4_parent != nullptr, + "SigV4AuthManager parent must be a SigV4AuthSession"); + + ICEBERG_ASSIGN_OR_RAISE( + auto delegate_session, + delegate_->TableSession(table, properties, sigv4_parent->delegate())); + + auto merged = MergeProperties(catalog_properties_, properties); + ICEBERG_ASSIGN_OR_RAISE( + auto credentials, + ResolveCredentialsProvider(properties, sigv4_parent->credentials_provider())); + return WrapSession(std::move(delegate_session), merged, std::move(credentials)); +} + +Status SigV4AuthManager::Close() { return delegate_->Close(); } + +Result> SigV4AuthSession::Make( + std::shared_ptr delegate, std::string signing_region, + std::string signing_name, + std::shared_ptr credentials_provider) { + ICEBERG_RETURN_UNEXPECTED(AwsSdkLifecycle::Instance().RegisterSession()); + ScopeExit unregister_on_failure( + [] { AwsSdkLifecycle::Instance().UnregisterSession(); }); + auto session = std::shared_ptr( + new SigV4AuthSession(std::move(delegate), std::move(signing_region), + std::move(signing_name), std::move(credentials_provider))); + // The session's destructor now owns the unregister. + unregister_on_failure.Cancel(); + return session; +} + +Result> SigV4AuthManager::WrapSession( + std::shared_ptr delegate_session, + const std::unordered_map& properties, + std::shared_ptr credentials) { + ICEBERG_ASSIGN_OR_RAISE(auto region, ResolveSigningRegion(properties)); + auto service = ResolveSigningName(properties); + + // Fail fast when the provider cannot resolve credentials (e.g. an empty + // default chain) instead of sending an effectively unsigned request later. + if (credentials->GetAWSCredentials().IsEmpty()) { + return AuthenticationFailed( + "SigV4: AWS credentials provider returned empty credentials; set '{}' and '{}' " + "or configure the AWS credentials chain", + AuthProperties::kSigV4AccessKeyId, AuthProperties::kSigV4SecretAccessKey); + } + ICEBERG_ASSIGN_OR_RAISE( + auto session, SigV4AuthSession::Make(std::move(delegate_session), std::move(region), + std::move(service), std::move(credentials))); + return session; +} + +Result> MakeSigV4AuthManager( + std::string_view name, + const std::unordered_map& properties) { + // Default to OAuth2 when delegate type is not specified. + std::string delegate_type = AuthProperties::kAuthTypeOAuth2; + if (auto it = properties.find(AuthProperties::kSigV4DelegateAuthType); + it != properties.end() && !it->second.empty()) { + delegate_type = StringUtils::ToLower(it->second); + } + + // Prevent circular delegation (sigv4 -> sigv4 -> ...). + ICEBERG_PRECHECK(delegate_type != AuthProperties::kAuthTypeSigV4, + "Cannot delegate a SigV4 auth manager to another SigV4 auth " + "manager (delegate_type='{}')", + delegate_type); + + auto delegate_props = properties; + delegate_props[AuthProperties::kAuthType] = delegate_type; + // Strip the legacy flag so the recursive Load doesn't bounce back to SigV4. + delegate_props.erase(AuthProperties::kSigV4Enabled); + ICEBERG_ASSIGN_OR_RAISE(auto delegate, AuthManagers::Load(name, delegate_props)); + return std::make_unique(std::move(delegate)); +} + +Status InitializeAwsSdk() { return AwsSdkLifecycle::Instance().Initialize(); } + +Status FinalizeAwsSdk() { return AwsSdkLifecycle::Instance().Finalize(); } + +bool IsAwsSdkInitialized() { return AwsSdkLifecycle::Instance().IsInitialized(); } + +bool IsAwsSdkFinalized() { return AwsSdkLifecycle::Instance().IsFinalized(); } + +} // namespace iceberg::rest::auth + +#else // !ICEBERG_SIGV4_ENABLED + +namespace iceberg::rest::auth { + +Result> MakeSigV4AuthManager( + std::string_view /*name*/, + const std::unordered_map& /*properties*/) { + return NotSupported( + "SigV4 authentication is not built; configure with -DICEBERG_SIGV4=ON"); +} + +Status InitializeAwsSdk() { + return NotSupported( + "SigV4 authentication is not built; configure with -DICEBERG_SIGV4=ON"); +} + +Status FinalizeAwsSdk() { return {}; } + +bool IsAwsSdkInitialized() { return false; } + +bool IsAwsSdkFinalized() { return false; } + +} // namespace iceberg::rest::auth + +#endif // ICEBERG_SIGV4_ENABLED diff --git a/src/iceberg/catalog/rest/endpoint.cc b/src/iceberg/catalog/rest/endpoint.cc index bf457c879..953a7f03f 100644 --- a/src/iceberg/catalog/rest/endpoint.cc +++ b/src/iceberg/catalog/rest/endpoint.cc @@ -24,22 +24,6 @@ namespace iceberg::rest { -constexpr std::string_view ToString(HttpMethod method) { - switch (method) { - case HttpMethod::kGet: - return "GET"; - case HttpMethod::kPost: - return "POST"; - case HttpMethod::kPut: - return "PUT"; - case HttpMethod::kDelete: - return "DELETE"; - case HttpMethod::kHead: - return "HEAD"; - } - return "UNKNOWN"; -} - Result Endpoint::Make(HttpMethod method, std::string_view path) { if (path.empty()) { return InvalidArgument("Endpoint cannot have empty path"); diff --git a/src/iceberg/catalog/rest/endpoint.h b/src/iceberg/catalog/rest/endpoint.h index fdcd2108e..9f51b43d4 100644 --- a/src/iceberg/catalog/rest/endpoint.h +++ b/src/iceberg/catalog/rest/endpoint.h @@ -22,6 +22,7 @@ #include #include +#include "iceberg/catalog/rest/http_request.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/result.h" @@ -30,12 +31,6 @@ namespace iceberg::rest { -/// \brief HTTP method enumeration. -enum class HttpMethod : uint8_t { kGet, kPost, kPut, kDelete, kHead }; - -/// \brief Convert HttpMethod to string representation. -constexpr std::string_view ToString(HttpMethod method); - /// \brief An Endpoint is an immutable value object identifying a specific REST API /// operation. It consists of: /// - HTTP method (GET, POST, DELETE, etc.) diff --git a/src/iceberg/catalog/rest/http_client.cc b/src/iceberg/catalog/rest/http_client.cc index 2e383b0ae..609116eb8 100644 --- a/src/iceberg/catalog/rest/http_client.cc +++ b/src/iceberg/catalog/rest/http_client.cc @@ -19,6 +19,8 @@ #include "iceberg/catalog/rest/http_client.h" +#include + #include #include @@ -68,27 +70,57 @@ namespace { /// \brief Default error type for unparseable REST responses. constexpr std::string_view kRestExceptionType = "RESTException"; -/// \brief Prepare headers for an HTTP request. -Result BuildHeaders( - const std::unordered_map& request_headers, +/// \brief Merge default headers with per-request headers (per-request wins). +HttpHeaders MergeHeaders( const std::unordered_map& default_headers, - auth::AuthSession& session) { - std::unordered_map headers(default_headers); + const std::unordered_map& request_headers) { + HttpHeaders merged; + for (const auto& [key, val] : default_headers) { + merged.try_emplace(key, val); + } for (const auto& [key, val] : request_headers) { - headers.insert_or_assign(key, val); + merged[key] = val; } - ICEBERG_RETURN_UNEXPECTED(session.Authenticate(headers)); - return cpr::Header(headers.begin(), headers.end()); + return merged; } -/// \brief Converts a map of string key-value pairs to cpr::Parameters. -cpr::Parameters GetParameters( +cpr::Header ToCprHeader(const HttpRequest& request) { + return {request.headers.begin(), request.headers.end()}; +} + +/// \brief Append URL-encoded query parameters to a URL, sorted by key. +/// \param base_url must not already contain a query string. Callers pass query +/// parameters separately so authentication signs one unambiguous final URL. +Result AppendQueryString( + const std::string& base_url, const std::unordered_map& params) { - cpr::Parameters cpr_params; - for (const auto& [key, val] : params) { - cpr_params.Add({key, val}); + if (params.empty()) return base_url; + if (base_url.find('?') != std::string::npos) { + return InvalidArgument( + "HttpClient base URL must not contain a query string when query parameters " + "are passed separately: {}", + base_url); + } + std::map sorted(params.begin(), params.end()); + std::string url = base_url + "?"; + bool first = true; + for (const auto& [k, v] : sorted) { + if (!first) url += "&"; + ICEBERG_ASSIGN_OR_RAISE(auto ek, EncodeString(k)); + ICEBERG_ASSIGN_OR_RAISE(auto ev, EncodeString(v)); + url += ek + "=" + ev; + first = false; } - return cpr_params; + return url; +} + +Result AuthenticateRequest(auth::AuthSession& session, HttpMethod method, + std::string url, HttpHeaders headers, + std::string body = "") { + return session.Authenticate({.method = method, + .url = std::move(url), + .headers = std::move(headers), + .body = std::move(body)}); } /// \brief Checks if the HTTP status code indicates a successful response. @@ -149,10 +181,12 @@ Result HttpClient::Get( const std::string& path, const std::unordered_map& params, const std::unordered_map& headers, const ErrorHandler& error_handler, auth::AuthSession& session) { - ICEBERG_ASSIGN_OR_RAISE(auto all_headers, - BuildHeaders(headers, default_headers_, session)); - cpr::Response response = - cpr::Get(cpr::Url{path}, GetParameters(params), all_headers, *connection_pool_); + ICEBERG_ASSIGN_OR_RAISE(auto url, AppendQueryString(path, params)); + ICEBERG_ASSIGN_OR_RAISE(auto authenticated, + AuthenticateRequest(session, HttpMethod::kGet, std::move(url), + MergeHeaders(default_headers_, headers))); + cpr::Response response = cpr::Get(cpr::Url{authenticated.url}, + ToCprHeader(authenticated), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -164,10 +198,13 @@ Result HttpClient::Post( const std::string& path, const std::string& body, const std::unordered_map& headers, const ErrorHandler& error_handler, auth::AuthSession& session) { - ICEBERG_ASSIGN_OR_RAISE(auto all_headers, - BuildHeaders(headers, default_headers_, session)); + ICEBERG_ASSIGN_OR_RAISE( + auto authenticated, + AuthenticateRequest(session, HttpMethod::kPost, path, + MergeHeaders(default_headers_, headers), body)); cpr::Response response = - cpr::Post(cpr::Url{path}, cpr::Body{body}, all_headers, *connection_pool_); + cpr::Post(cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, + ToCprHeader(authenticated), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -182,16 +219,22 @@ Result HttpClient::PostForm( const ErrorHandler& error_handler, auth::AuthSession& session) { std::unordered_map form_headers(headers); form_headers.insert_or_assign(kHeaderContentType, kMimeTypeFormUrlEncoded); - ICEBERG_ASSIGN_OR_RAISE(auto all_headers, - BuildHeaders(form_headers, default_headers_, session)); std::vector pair_list; pair_list.reserve(form_data.size()); for (const auto& [key, val] : form_data) { pair_list.emplace_back(key, val); } + // Sign the exact bytes cpr will put on the wire. + std::string encoded_body = + cpr::Payload(pair_list.begin(), pair_list.end()).GetContent(); + ICEBERG_ASSIGN_OR_RAISE( + auto authenticated, + AuthenticateRequest(session, HttpMethod::kPost, path, + MergeHeaders(default_headers_, form_headers), + std::move(encoded_body))); cpr::Response response = - cpr::Post(cpr::Url{path}, cpr::Payload(pair_list.begin(), pair_list.end()), - all_headers, *connection_pool_); + cpr::Post(cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, + ToCprHeader(authenticated), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -202,9 +245,11 @@ Result HttpClient::PostForm( Result HttpClient::Head( const std::string& path, const std::unordered_map& headers, const ErrorHandler& error_handler, auth::AuthSession& session) { - ICEBERG_ASSIGN_OR_RAISE(auto all_headers, - BuildHeaders(headers, default_headers_, session)); - cpr::Response response = cpr::Head(cpr::Url{path}, all_headers, *connection_pool_); + ICEBERG_ASSIGN_OR_RAISE(auto authenticated, + AuthenticateRequest(session, HttpMethod::kHead, path, + MergeHeaders(default_headers_, headers))); + cpr::Response response = cpr::Head(cpr::Url{authenticated.url}, + ToCprHeader(authenticated), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -216,10 +261,13 @@ Result HttpClient::Delete( const std::string& path, const std::unordered_map& params, const std::unordered_map& headers, const ErrorHandler& error_handler, auth::AuthSession& session) { - ICEBERG_ASSIGN_OR_RAISE(auto all_headers, - BuildHeaders(headers, default_headers_, session)); - cpr::Response response = - cpr::Delete(cpr::Url{path}, GetParameters(params), all_headers, *connection_pool_); + ICEBERG_ASSIGN_OR_RAISE(auto url, AppendQueryString(path, params)); + ICEBERG_ASSIGN_OR_RAISE( + auto authenticated, + AuthenticateRequest(session, HttpMethod::kDelete, std::move(url), + MergeHeaders(default_headers_, headers))); + cpr::Response response = cpr::Delete(cpr::Url{authenticated.url}, + ToCprHeader(authenticated), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; diff --git a/src/iceberg/catalog/rest/http_request.h b/src/iceberg/catalog/rest/http_request.h new file mode 100644 index 000000000..47419c361 --- /dev/null +++ b/src/iceberg/catalog/rest/http_request.h @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/catalog/rest/iceberg_rest_export.h" + +namespace iceberg::rest { + +/// \brief HTTP method enumeration. +enum class HttpMethod : uint8_t { kGet, kPost, kPut, kDelete, kHead }; + +/// \brief Convert HttpMethod to string representation. +constexpr std::string_view ToString(HttpMethod method) { + switch (method) { + case HttpMethod::kGet: + return "GET"; + case HttpMethod::kPost: + return "POST"; + case HttpMethod::kPut: + return "PUT"; + case HttpMethod::kDelete: + return "DELETE"; + case HttpMethod::kHead: + return "HEAD"; + } + return "UNKNOWN"; +} + +/// \brief Case-insensitive ordering for HTTP header names. +/// +/// HTTP header names are case-insensitive. This comparator also matches +/// cpr::Header's single-value map model. +struct CaseInsensitiveHeaderLess { + using is_transparent = void; + + bool operator()(std::string_view lhs, std::string_view rhs) const noexcept { + const auto min_size = lhs.size() < rhs.size() ? lhs.size() : rhs.size(); + for (std::size_t i = 0; i < min_size; ++i) { + auto left = static_cast(lhs[i]); + auto right = static_cast(rhs[i]); + const int lower_left = std::tolower(left); + const int lower_right = std::tolower(right); + if (lower_left < lower_right) return true; + if (lower_left > lower_right) return false; + } + return lhs.size() < rhs.size(); + } +}; + +/// \brief Single-value HTTP headers with case-insensitive names. +/// +/// Repeated outgoing headers are intentionally not represented here. The +/// SigV4 path signs headers through the AWS SDK request model, and the final +/// transport uses cpr::Header; both are single-value, map-like containers that +/// fold duplicate names. Keeping the REST request model single-value avoids +/// exposing repeated-header behavior that cannot survive signing or transport. +using HttpHeaders = std::map; + +/// \brief An outgoing HTTP request. Mirrors Java's HttpRequest so signing +/// implementations like SigV4 see method, url, headers, and body together. +struct ICEBERG_REST_EXPORT HttpRequest { + HttpMethod method = HttpMethod::kGet; + std::string url; + HttpHeaders headers; + std::string body; +}; + +} // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/meson.build b/src/iceberg/catalog/rest/meson.build index f3eae6d45..48254614f 100644 --- a/src/iceberg/catalog/rest/meson.build +++ b/src/iceberg/catalog/rest/meson.build @@ -41,17 +41,36 @@ cpr_needs_static = ( ) cpr_dep = dependency('cpr', static: cpr_needs_static) +iceberg_rest_sources += files('auth/sigv4_manager.cc') iceberg_rest_build_deps = [iceberg_dep, cpr_dep] +iceberg_rest_compile_defs = [] + +sigv4_opt = get_option('sigv4') +# Use the CMake config, not pkg-config: aws-cpp-sdk-core.pc Cflags force +# -std=c++11 -fno-exceptions, which would override the project's C++23 build. +aws_sdk_core_dep = dependency( + 'aws-cpp-sdk-core', + method: 'cmake', + modules: ['aws-cpp-sdk-core'], + required: sigv4_opt, +) +if aws_sdk_core_dep.found() + iceberg_rest_build_deps += aws_sdk_core_dep + iceberg_rest_compile_defs += '-DICEBERG_SIGV4_ENABLED=1' +else + iceberg_rest_compile_defs += '-DICEBERG_SIGV4_ENABLED=0' +endif + iceberg_rest_lib = library( 'iceberg_rest', sources: iceberg_rest_sources, dependencies: iceberg_rest_build_deps, gnu_symbol_visibility: 'hidden', - cpp_shared_args: ['-DICEBERG_REST_EXPORTING'], - cpp_static_args: ['-DICEBERG_REST_STATIC'], + cpp_shared_args: ['-DICEBERG_REST_EXPORTING'] + iceberg_rest_compile_defs, + cpp_static_args: ['-DICEBERG_REST_STATIC'] + iceberg_rest_compile_defs, ) -iceberg_rest_compile_args = [] +iceberg_rest_compile_args = iceberg_rest_compile_defs if get_option('default_library') == 'static' iceberg_rest_compile_args += ['-DICEBERG_REST_STATIC'] endif @@ -70,6 +89,7 @@ install_headers( 'endpoint.h', 'error_handlers.h', 'http_client.h', + 'http_request.h', 'iceberg_rest_export.h', 'resource_paths.h', 'rest_catalog.h', diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index f04f5fb55..6472adc4b 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -355,7 +355,11 @@ Result RestCatalog::CreateTableInternal( *catalog_session_)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); - return LoadTableResultFromJson(json); + ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); + // TODO: Wire table-specific auth config from LoadTableResponse once C++ has + // table-scoped REST operations or a table-scoped catalog wrapper. The current + // Table implementation routes refresh and commit back through Catalog. + return load_result; } Result> RestCatalog::CreateTable( @@ -479,7 +483,8 @@ Result> RestCatalog::LoadTable(const TableIdentifier& ide ICEBERG_ASSIGN_OR_RAISE(const auto body, LoadTableInternal(identifier)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(body)); ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); - /// FIXME: support per-table FileIO creation + // TODO: Support table-specific auth config and per-table FileIO from the REST + // load response when table-scoped REST operations are introduced. return Table::Make(identifier, std::move(load_result.metadata), std::move(load_result.metadata_location), file_io_, shared_from_this()); @@ -503,6 +508,8 @@ Result> RestCatalog::RegisterTable( ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); + // TODO: Support table-specific auth config and per-table FileIO from the REST + // register response when table-scoped REST operations are introduced. return Table::Make(identifier, std::move(load_result.metadata), std::move(load_result.metadata_location), file_io_, shared_from_this()); diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 0339ee1a9..dfb0e1dbc 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -38,6 +38,9 @@ set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@") set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@") +# Extra args forwarded to find_dependency() for specific dependencies. +set(ICEBERG_FIND_EXTRA_ARGS_AWSSDK "@ICEBERG_FIND_EXTRA_ARGS_AWSSDK@") + include(CMakeFindDependencyMacro) macro(iceberg_find_dependencies dependencies) @@ -49,7 +52,7 @@ macro(iceberg_find_dependencies dependencies) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") foreach(dependency ${dependencies}) - find_dependency(${dependency}) + find_dependency(${dependency} ${ICEBERG_FIND_EXTRA_ARGS_${dependency}}) endforeach() if(DEFINED ICEBERG_CMAKE_MODULE_PATH_OLD) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 2d56d7f35..0e8f03150 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -290,6 +290,11 @@ if(ICEBERG_BUILD_REST) rest_json_serde_test.cc rest_util_test.cc) + if(ICEBERG_SIGV4) + add_rest_iceberg_test(sigv4_auth_test SOURCES sigv4_auth_test.cc) + target_link_libraries(sigv4_auth_test PRIVATE aws-cpp-sdk-core) + endif() + if(ICEBERG_BUILD_REST_INTEGRATION_TESTS) add_rest_iceberg_test(rest_catalog_integration_test SOURCES diff --git a/src/iceberg/test/auth_manager_test.cc b/src/iceberg/test/auth_manager_test.cc index 40c0f8607..22ecef864 100644 --- a/src/iceberg/test/auth_manager_test.cc +++ b/src/iceberg/test/auth_manager_test.cc @@ -37,6 +37,7 @@ #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/auth/oauth2_util.h" #include "iceberg/catalog/rest/auth/token_refresh_scheduler.h" +#include "iceberg/catalog/rest/error_handlers.h" #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/json_serde_internal.h" @@ -78,9 +79,9 @@ TEST_F(AuthManagerTest, LoadNoopAuthManagerExplicit) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); - EXPECT_TRUE(headers.empty()); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_TRUE(auth_result.value().headers.empty()); } // Verifies that NoopAuthManager is inferred when no auth properties are set @@ -89,6 +90,25 @@ TEST_F(AuthManagerTest, LoadNoopAuthManagerInferred) { ASSERT_THAT(manager_result, IsOk()); } +TEST_F(AuthManagerTest, HttpHeadersAreCaseInsensitiveSingleValueMap) { + HttpHeaders headers; + headers.emplace("Authorization", "Bearer first"); + headers.emplace("authorization", "Bearer second"); + + EXPECT_EQ(headers.size(), 1); + EXPECT_EQ(headers.at("AUTHORIZATION"), "Bearer first"); +} + +TEST_F(AuthManagerTest, HttpClientRejectsParamsWhenUrlAlreadyHasQuery) { + auto session = AuthSession::MakeDefault({}); + auto result = + client_.Get("http://127.0.0.1/v1/config?existing=true", {{"warehouse", "prod"}}, + /*headers=*/{}, *rest::DefaultErrorHandler::Instance(), *session); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("must not contain a query string")); +} + // Verifies that auth type is case-insensitive TEST_F(AuthManagerTest, AuthTypeCaseInsensitive) { for (const auto& auth_type : {"NONE", "None", "NoNe"}) { @@ -122,10 +142,10 @@ TEST_F(AuthManagerTest, LoadBasicAuthManager) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); // base64("admin:secret") == "YWRtaW46c2VjcmV0" - EXPECT_EQ(headers["Authorization"], "Basic YWRtaW46c2VjcmV0"); + EXPECT_EQ(auth_result.value().headers["Authorization"], "Basic YWRtaW46c2VjcmV0"); } // Verifies BasicAuthManager is case-insensitive for auth type @@ -141,10 +161,10 @@ TEST_F(AuthManagerTest, BasicAuthTypeCaseInsensitive) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()) << "Failed for auth type: " << auth_type; - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()) << "Failed for auth type: " << auth_type; // base64("user:pass") == "dXNlcjpwYXNz" - EXPECT_EQ(headers["Authorization"], "Basic dXNlcjpwYXNz"); + EXPECT_EQ(auth_result.value().headers["Authorization"], "Basic dXNlcjpwYXNz"); } } @@ -187,10 +207,11 @@ TEST_F(AuthManagerTest, BasicAuthSpecialCharacters) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); // base64("user@domain.com:p@ss:w0rd!") == "dXNlckBkb21haW4uY29tOnBAc3M6dzByZCE=" - EXPECT_EQ(headers["Authorization"], "Basic dXNlckBkb21haW4uY29tOnBAc3M6dzByZCE="); + EXPECT_EQ(auth_result.value().headers["Authorization"], + "Basic dXNlckBkb21haW4uY29tOnBAc3M6dzByZCE="); } // Verifies custom auth manager registration @@ -219,9 +240,9 @@ TEST_F(AuthManagerTest, RegisterCustomAuthManager) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); - EXPECT_EQ(headers["X-Custom-Auth"], "custom-value"); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_EQ(auth_result.value().headers["X-Custom-Auth"], "custom-value"); } // Verifies OAuth2 with static token @@ -237,9 +258,9 @@ TEST_F(AuthManagerTest, OAuth2StaticToken) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); - EXPECT_EQ(headers["Authorization"], "Bearer my-static-token"); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_EQ(auth_result.value().headers["Authorization"], "Bearer my-static-token"); } // Verifies OAuth2 type is inferred from token property @@ -254,9 +275,9 @@ TEST_F(AuthManagerTest, OAuth2InferredFromToken) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - EXPECT_THAT(session_result.value()->Authenticate(headers), IsOk()); - EXPECT_EQ(headers["Authorization"], "Bearer inferred-token"); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_EQ(auth_result.value().headers["Authorization"], "Bearer inferred-token"); } // Verifies OAuth2 returns unauthenticated session when neither token nor credential is @@ -273,9 +294,10 @@ TEST_F(AuthManagerTest, OAuth2MissingCredentials) { ASSERT_THAT(session_result, IsOk()); // Session should have no auth headers - std::unordered_map headers; - ASSERT_TRUE(session_result.value()->Authenticate(headers).has_value()); - EXPECT_EQ(headers.find("Authorization"), headers.end()); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_TRUE(auth_result.has_value()); + EXPECT_EQ(auth_result.value().headers.find("Authorization"), + auth_result.value().headers.end()); } // Verifies that when both token and credential are provided, token takes priority @@ -294,9 +316,9 @@ TEST_F(AuthManagerTest, OAuth2TokenTakesPriorityOverCredential) { auto session_result = manager_result.value()->CatalogSession(client_, properties); ASSERT_THAT(session_result, IsOk()); - std::unordered_map headers; - ASSERT_THAT(session_result.value()->Authenticate(headers), IsOk()); - EXPECT_EQ(headers["Authorization"], "Bearer my-static-token"); + auto auth_result = session_result.value()->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_EQ(auth_result.value().headers["Authorization"], "Bearer my-static-token"); } // Verifies OAuthTokenResponse JSON parsing @@ -494,9 +516,9 @@ TEST(OAuth2AuthSessionTest, InitialTokenIsUsed) { ASSERT_THAT(session_result, IsOk()); auto session = session_result.value(); - std::unordered_map headers; - ASSERT_THAT(session->Authenticate(headers), IsOk()); - EXPECT_EQ(headers["Authorization"], "Bearer initial-token-123"); + auto auth_result = session->Authenticate({}); + ASSERT_THAT(auth_result, IsOk()); + EXPECT_EQ(auth_result.value().headers.at("Authorization"), "Bearer initial-token-123"); session->Close(); } diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 8d2805900..03d9e1f6c 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -135,6 +135,14 @@ if get_option('rest').enabled() 'dependencies': [iceberg_rest_dep], }, } + if aws_sdk_core_dep.found() + iceberg_tests += { + 'sigv4_auth_test': { + 'sources': files('sigv4_auth_test.cc'), + 'dependencies': [iceberg_rest_dep, aws_sdk_core_dep], + }, + } + endif if get_option('rest_integration_test').enabled() if host_machine.system() == 'windows' warning('Cannot build rest integration test on Windows, skipping.') diff --git a/src/iceberg/test/sigv4_auth_test.cc b/src/iceberg/test/sigv4_auth_test.cc new file mode 100644 index 000000000..ac8c36b63 --- /dev/null +++ b/src/iceberg/test/sigv4_auth_test.cc @@ -0,0 +1,512 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#if ICEBERG_SIGV4_ENABLED + +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include +# include + +# include "iceberg/catalog/rest/auth/auth_managers.h" +# include "iceberg/catalog/rest/auth/auth_properties.h" +# include "iceberg/catalog/rest/auth/auth_session.h" +# include "iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h" +# include "iceberg/catalog/rest/http_client.h" +# include "iceberg/table_identifier.h" +# include "iceberg/test/matchers.h" + +namespace iceberg::rest::auth { + +namespace { + +using ::testing::HasSubstr; +using ::testing::StartsWith; + +constexpr std::string_view kAccessKey = "AKIAIOSFODNN7EXAMPLE"; +constexpr std::string_view kSecretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"; +constexpr std::string_view kAmzContentSha256Header = "x-amz-content-sha256"; + +std::string HexEncode(const Aws::Utils::ByteBuffer& buffer) { + static constexpr char kHex[] = "0123456789abcdef"; + std::string hex; + hex.reserve(buffer.GetLength() * 2); + for (size_t i = 0; i < buffer.GetLength(); ++i) { + auto byte = buffer.GetUnderlyingData()[i]; + hex.push_back(kHex[byte >> 4]); + hex.push_back(kHex[byte & 0x0F]); + } + return hex; +} + +Aws::Utils::ByteBuffer BufferFromString(std::string_view value) { + return Aws::Utils::ByteBuffer(reinterpret_cast(value.data()), + value.size()); +} + +Aws::Utils::ByteBuffer HmacSha256(const Aws::Utils::ByteBuffer& key, + std::string_view value) { + Aws::Utils::Crypto::Sha256HMAC hmac; + auto result = hmac.Calculate(BufferFromString(value), key); + EXPECT_TRUE(result.IsSuccess()); + return result.GetResult(); +} + +std::string Sha256Hex(std::string_view value) { + auto digest = + Aws::Utils::HashingUtils::CalculateSHA256(Aws::String(value.data(), value.size())); + return Aws::Utils::HashingUtils::HexEncode(digest).c_str(); +} + +std::string ExtractAuthField(std::string_view authorization, std::string_view prefix) { + auto pos = authorization.find(prefix); + EXPECT_NE(pos, std::string_view::npos) << authorization; + if (pos == std::string_view::npos) return {}; + pos += prefix.size(); + auto end = authorization.find(',', pos); + return std::string(authorization.substr(pos, end - pos)); +} + +std::string HeaderValue(const HttpHeaders& headers, std::string_view name) { + auto it = headers.find(name); + EXPECT_NE(it, headers.end()) << "Missing header: " << name; + if (it == headers.end()) return {}; + return it->second; +} + +std::string PathFromUrl(const std::string& url) { + auto scheme = url.find("://"); + auto path_start = + scheme == std::string::npos ? url.find('/') : url.find('/', scheme + 3); + if (path_start == std::string::npos) return "/"; + auto query_start = url.find('?', path_start); + return url.substr(path_start, query_start - path_start); +} + +std::string CanonicalQueryFromUrl(const std::string& url) { + auto query_start = url.find('?'); + if (query_start == std::string::npos) return {}; + std::vector params; + size_t start = query_start + 1; + while (start <= url.size()) { + auto end = url.find('&', start); + params.emplace_back(url.substr(start, end - start)); + if (end == std::string::npos) break; + start = end + 1; + } + std::sort(params.begin(), params.end()); + + std::string canonical; + for (const auto& param : params) { + if (!canonical.empty()) canonical += '&'; + canonical += param; + } + return canonical; +} + +std::string ExpectedSigV4Signature(const HttpRequest& request, + std::string_view signing_region, + std::string_view signing_name) { + const auto authorization = HeaderValue(request.headers, "authorization"); + const auto x_amz_date = HeaderValue(request.headers, "x-amz-date"); + const auto credential_scope = + ExtractAuthField(authorization, std::string(kAccessKey) + "/"); + const auto signed_headers = ExtractAuthField(authorization, "SignedHeaders="); + const auto date = x_amz_date.substr(0, 8); + + std::string canonical_headers; + size_t start = 0; + while (start <= signed_headers.size()) { + auto end = signed_headers.find(';', start); + auto header_name = signed_headers.substr(start, end - start); + canonical_headers += header_name; + canonical_headers += ':'; + canonical_headers += HeaderValue(request.headers, header_name); + canonical_headers += '\n'; + if (end == std::string::npos) break; + start = end + 1; + } + + auto payload_hash = request.body.empty() + ? std::string(SigV4AuthSession::kEmptyBodySha256) + : Sha256Hex(request.body); + const auto canonical_request = + std::string(ToString(request.method)) + "\n" + PathFromUrl(request.url) + "\n" + + CanonicalQueryFromUrl(request.url) + "\n" + canonical_headers + "\n" + + signed_headers + "\n" + payload_hash; + const auto string_to_sign = "AWS4-HMAC-SHA256\n" + x_amz_date + "\n" + + credential_scope + "\n" + Sha256Hex(canonical_request); + + auto date_key = HmacSha256(BufferFromString("AWS4" + std::string(kSecretKey)), date); + auto region_key = HmacSha256(date_key, signing_region); + auto service_key = HmacSha256(region_key, signing_name); + auto signing_key = HmacSha256(service_key, "aws4_request"); + return HexEncode(HmacSha256(signing_key, string_to_sign)); +} + +} // namespace + +class SigV4AuthTest : public ::testing::Test { + protected: + static void SetUpTestSuite() { ASSERT_THAT(InitializeAwsSdk(), IsOk()); } + + static void TearDownTestSuite() { EXPECT_THAT(FinalizeAwsSdk(), IsOk()); } + + std::unordered_map MakeSigV4Properties() { + return { + {AuthProperties::kAuthType, "sigv4"}, + {AuthProperties::kSigV4SigningRegion, "us-east-1"}, + {AuthProperties::kSigV4SigningName, "execute-api"}, + {AuthProperties::kSigV4AccessKeyId, std::string(kAccessKey)}, + {AuthProperties::kSigV4SecretAccessKey, std::string(kSecretKey)}, + }; + } + + Result> MakeCatalogSession( + const std::unordered_map& properties) { + ICEBERG_ASSIGN_OR_RAISE(auto manager, AuthManagers::Load("test-catalog", properties)); + return manager->CatalogSession(client_, properties); + } + + Result SignRequest( + const std::unordered_map& properties, + HttpRequest request) { + ICEBERG_ASSIGN_OR_RAISE(auto session, MakeCatalogSession(properties)); + return session->Authenticate(std::move(request)); + } + + HttpClient client_{{}}; +}; + +TEST_F(SigV4AuthTest, LifecycleInitializeIsIdempotent) { + EXPECT_THAT(InitializeAwsSdk(), IsOk()); + EXPECT_TRUE(IsAwsSdkInitialized()); + EXPECT_FALSE(IsAwsSdkFinalized()); +} + +TEST_F(SigV4AuthTest, LifecycleFinalizeRefusesWhileSessionsAlive) { + ICEBERG_UNWRAP_OR_FAIL(auto session, MakeCatalogSession(MakeSigV4Properties())); + + EXPECT_THAT(FinalizeAwsSdk(), IsError(ErrorKind::kInvalid)); + EXPECT_TRUE(IsAwsSdkInitialized()); +} + +TEST_F(SigV4AuthTest, AuthenticateWithoutBodyDetailedHeaders) { + ICEBERG_UNWRAP_OR_FAIL(auto signed_request, + SignRequest(MakeSigV4Properties(), + {.method = HttpMethod::kGet, + .url = "http://localhost:8080/path", + .headers = {{"Content-Type", "application/json"}, + {"Content-Encoding", "gzip"}}})); + + EXPECT_EQ(HeaderValue(signed_request.headers, "content-type"), "application/json"); + EXPECT_EQ(HeaderValue(signed_request.headers, "content-encoding"), "gzip"); + EXPECT_EQ(HeaderValue(signed_request.headers, "host"), "localhost:8080"); + EXPECT_EQ(HeaderValue(signed_request.headers, kAmzContentSha256Header), + SigV4AuthSession::kEmptyBodySha256); + EXPECT_NE(signed_request.headers.find("x-amz-date"), signed_request.headers.end()); + + auto authorization = HeaderValue(signed_request.headers, "authorization"); + EXPECT_THAT(authorization, StartsWith("AWS4-HMAC-SHA256 Credential=")); + EXPECT_THAT(authorization, HasSubstr("SignedHeaders=content-encoding;content-type;host;" + "x-amz-content-sha256;x-amz-date")); + EXPECT_EQ(ExtractAuthField(authorization, "Signature="), + ExpectedSigV4Signature(signed_request, "us-east-1", "execute-api")); +} + +TEST_F(SigV4AuthTest, AuthenticateWithBodyDetailedHeaders) { + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(MakeSigV4Properties(), + {.method = HttpMethod::kPost, + .url = "http://localhost:8080/path", + .headers = {{"Content-Type", "application/x-www-form-urlencoded"}, + {"Content-Encoding", "gzip"}}, + .body = R"({"namespace":["ns"]})"})); + + auto authorization = HeaderValue(signed_request.headers, "authorization"); + EXPECT_THAT(authorization, StartsWith("AWS4-HMAC-SHA256 Credential=")); + EXPECT_THAT(authorization, HasSubstr("SignedHeaders=content-encoding;content-type;host;" + "x-amz-content-sha256;x-amz-date")); + EXPECT_EQ(HeaderValue(signed_request.headers, kAmzContentSha256Header), + "LL0/LbCIE/WzVCHsfA3ASGOx9vJNPeTL0jBro8scPfA="); + EXPECT_EQ(ExtractAuthField(authorization, "Signature="), + ExpectedSigV4Signature(signed_request, "us-east-1", "execute-api")); +} + +TEST_F(SigV4AuthTest, QueryStringIsIncludedInSignature) { + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(MakeSigV4Properties(), + {.method = HttpMethod::kGet, + .url = "http://localhost:8080/path?warehouse=prod&prefix=a"})); + + auto authorization = HeaderValue(signed_request.headers, "authorization"); + EXPECT_THAT(authorization, StartsWith("AWS4-HMAC-SHA256 Credential=")); + EXPECT_EQ(ExtractAuthField(authorization, "Signature="), + ExpectedSigV4Signature(signed_request, "us-east-1", "execute-api")); +} + +TEST_F(SigV4AuthTest, DelegateAuthorizationHeaderIsRelocatedAndSigned) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kToken.key()] = "my-oauth-token"; + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(properties, {.method = HttpMethod::kGet, + .url = "http://localhost:8080/path", + .headers = {{"Content-Type", "application/json"}}})); + + EXPECT_EQ(HeaderValue(signed_request.headers, "original-authorization"), + "Bearer my-oauth-token"); + auto authorization = HeaderValue(signed_request.headers, "authorization"); + EXPECT_THAT(authorization, + HasSubstr("SignedHeaders=content-type;host;original-authorization;" + "x-amz-content-sha256;x-amz-date")); + EXPECT_EQ(ExtractAuthField(authorization, "Signature="), + ExpectedSigV4Signature(signed_request, "us-east-1", "execute-api")); +} + +TEST_F(SigV4AuthTest, ConflictingSigV4HeadersRelocated) { + auto delegate = AuthSession::MakeDefault({ + {"x-amz-content-sha256", "fake-sha256"}, + {"X-Amz-Date", "fake-date"}, + {"Content-Type", "application/json"}, + }); + auto credentials = + std::make_shared(Aws::Auth::AWSCredentials( + std::string(kAccessKey).c_str(), std::string(kSecretKey).c_str())); + ICEBERG_UNWRAP_OR_FAIL( + auto session, + SigV4AuthSession::Make(delegate, "us-east-1", "execute-api", credentials)); + + ICEBERG_UNWRAP_OR_FAIL(auto signed_request, + session->Authenticate({.method = HttpMethod::kGet, + .url = "http://localhost:8080/path"})); + + EXPECT_EQ(HeaderValue(signed_request.headers, kAmzContentSha256Header), + SigV4AuthSession::kEmptyBodySha256); + EXPECT_EQ(HeaderValue(signed_request.headers, "Original-x-amz-content-sha256"), + "fake-sha256"); + EXPECT_EQ(HeaderValue(signed_request.headers, "Original-X-Amz-Date"), "fake-date"); + EXPECT_NE(signed_request.headers.find("authorization"), signed_request.headers.end()); +} + +TEST_F(SigV4AuthTest, AuthenticateWithSessionToken) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4SessionToken] = "FwoGZXIvYXdzEBYaDHqa0"; + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(properties, + {.method = HttpMethod::kGet, .url = "https://example.com/v1/config"})); + + EXPECT_EQ(HeaderValue(signed_request.headers, "x-amz-security-token"), + "FwoGZXIvYXdzEBYaDHqa0"); + EXPECT_THAT(HeaderValue(signed_request.headers, "authorization"), + HasSubstr("SignedHeaders=host;x-amz-content-sha256;x-amz-date;" + "x-amz-security-token")); +} + +TEST_F(SigV4AuthTest, CustomSigningNameAndRegion) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4SigningRegion] = "eu-west-1"; + properties[AuthProperties::kSigV4SigningName] = "custom-service"; + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(properties, + {.method = HttpMethod::kGet, .url = "https://example.com/v1/config"})); + + auto authorization = HeaderValue(signed_request.headers, "authorization"); + EXPECT_THAT(authorization, HasSubstr("eu-west-1")); + EXPECT_THAT(authorization, HasSubstr("custom-service")); +} + +TEST_F(SigV4AuthTest, LegacySigV4EnabledFlagSelectsSigV4) { + auto properties = MakeSigV4Properties(); + properties.erase(AuthProperties::kAuthType); + properties[AuthProperties::kSigV4Enabled] = "true"; + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(properties, + {.method = HttpMethod::kGet, .url = "https://example.com/v1/config"})); + + EXPECT_THAT(HeaderValue(signed_request.headers, "authorization"), + StartsWith("AWS4-HMAC-SHA256")); +} + +TEST_F(SigV4AuthTest, AuthTypeCaseInsensitive) { + for (const auto& auth_type : {"SIGV4", "SigV4", "sigV4"}) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kAuthType] = auth_type; + EXPECT_THAT(AuthManagers::Load("test-catalog", properties), IsOk()) + << "Failed for auth type: " << auth_type; + } +} + +TEST_F(SigV4AuthTest, MissingStaticCredentialsAreRejected) { + for (auto missing_property : + {AuthProperties::kSigV4AccessKeyId, AuthProperties::kSigV4SecretAccessKey}) { + auto properties = MakeSigV4Properties(); + properties.erase(missing_property); + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + + auto session_result = manager->CatalogSession(client_, properties); + EXPECT_THAT(session_result, IsError(ErrorKind::kInvalidArgument)) + << "Missing property: " << missing_property; + EXPECT_THAT(session_result, HasErrorMessage("must be set together")); + } + + auto session_token_only = MakeSigV4Properties(); + session_token_only.erase(AuthProperties::kSigV4AccessKeyId); + session_token_only.erase(AuthProperties::kSigV4SecretAccessKey); + session_token_only[AuthProperties::kSigV4SessionToken] = "token"; + ICEBERG_UNWRAP_OR_FAIL(auto manager, + AuthManagers::Load("test-catalog", session_token_only)); + + auto session_result = manager->CatalogSession(client_, session_token_only); + EXPECT_THAT(session_result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(session_result, HasErrorMessage("requires")); +} + +TEST_F(SigV4AuthTest, DerivedCredentialOverridesMustBeComplete) { + auto properties = MakeSigV4Properties(); + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog_session, + manager->CatalogSession(client_, properties)); + + auto context_result = manager->ContextualSession( + {{AuthProperties::kSigV4SecretAccessKey, "context-secret"}}, catalog_session); + EXPECT_THAT(context_result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(context_result, HasErrorMessage("must be set together")); + + iceberg::TableIdentifier table_id{.ns = iceberg::Namespace{{"db1"}}, .name = "table1"}; + auto table_result = manager->TableSession( + table_id, {{AuthProperties::kSigV4SessionToken, "table-token"}}, catalog_session); + EXPECT_THAT(table_result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(table_result, HasErrorMessage("requires")); +} + +TEST_F(SigV4AuthTest, CreateCustomDelegateNone) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4DelegateAuthType] = "none"; + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + SignRequest(properties, + {.method = HttpMethod::kGet, .url = "https://example.com/v1/config"})); + + EXPECT_NE(signed_request.headers.find("authorization"), signed_request.headers.end()); + EXPECT_EQ(signed_request.headers.find("original-authorization"), + signed_request.headers.end()); +} + +TEST_F(SigV4AuthTest, CreateInvalidCustomDelegateSigV4Circular) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4DelegateAuthType] = "sigv4"; + + auto result = AuthManagers::Load("test-catalog", properties); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, + HasErrorMessage("Cannot delegate a SigV4 auth manager to another SigV4")); +} + +TEST_F(SigV4AuthTest, ContextualSessionOverridesProperties) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4SigningRegion] = "us-west-2"; + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog_session, + manager->CatalogSession(client_, properties)); + + ICEBERG_UNWRAP_OR_FAIL( + auto ctx_session, + manager->ContextualSession({{AuthProperties::kSigV4AccessKeyId, "id2"}, + {AuthProperties::kSigV4SecretAccessKey, "secret2"}, + {AuthProperties::kSigV4SigningRegion, "eu-west-1"}}, + catalog_session)); + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + ctx_session->Authenticate( + {.method = HttpMethod::kGet, .url = "https://example.com/v1/config"})); + EXPECT_THAT(HeaderValue(signed_request.headers, "authorization"), + HasSubstr("eu-west-1")); +} + +TEST_F(SigV4AuthTest, TableSessionOverridesProperties) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4SigningRegion] = "us-west-2"; + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog_session, + manager->CatalogSession(client_, properties)); + + iceberg::TableIdentifier table_id{.ns = iceberg::Namespace{{"db1"}}, .name = "table1"}; + ICEBERG_UNWRAP_OR_FAIL( + auto table_session, + manager->TableSession(table_id, + {{AuthProperties::kSigV4AccessKeyId, "table-key-id"}, + {AuthProperties::kSigV4SecretAccessKey, "table-secret"}, + {AuthProperties::kSigV4SigningRegion, "ap-southeast-1"}}, + catalog_session)); + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + table_session->Authenticate({.method = HttpMethod::kGet, + .url = "https://example.com/v1/db1/tables/table1"})); + EXPECT_THAT(HeaderValue(signed_request.headers, "authorization"), + HasSubstr("ap-southeast-1")); +} + +TEST_F(SigV4AuthTest, TableSessionIgnoresContextualOverrides) { + auto properties = MakeSigV4Properties(); + properties[AuthProperties::kSigV4SigningRegion] = "us-west-2"; + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog_session, + manager->CatalogSession(client_, properties)); + ICEBERG_UNWRAP_OR_FAIL( + auto ctx_session, + manager->ContextualSession({{AuthProperties::kSigV4SigningRegion, "eu-west-1"}}, + catalog_session)); + + iceberg::TableIdentifier table_id{.ns = iceberg::Namespace{{"db1"}}, .name = "table1"}; + ICEBERG_UNWRAP_OR_FAIL(auto table_session, + manager->TableSession(table_id, {}, ctx_session)); + + ICEBERG_UNWRAP_OR_FAIL( + auto signed_request, + table_session->Authenticate({.method = HttpMethod::kGet, + .url = "https://example.com/v1/db1/tables/table1"})); + EXPECT_THAT(HeaderValue(signed_request.headers, "authorization"), + HasSubstr("us-west-2")); +} + +} // namespace iceberg::rest::auth + +#endif // ICEBERG_SIGV4_ENABLED From d3b02bbbed0790d0bfa153549c077e831e2b1b8f Mon Sep 17 00:00:00 2001 From: kamcheungting-db <91572897+kamcheungting-db@users.noreply.github.com> Date: Sat, 13 Jun 2026 21:03:38 -0700 Subject: [PATCH 076/151] Revert "chore: remove spdlog dependency (#459)" (#718) ## What Re-adds spdlog (v1.15.3, configured with SPDLOG_USE_STD_FORMAT) as a build dependency, reverting #459. ## Why #459 removed spdlog because nothing used it at the time, with the note that it could be added back "when it is actually needed." It is now needed: this is the foundation for the upcoming logging system for iceberg-cpp. Restoring the dependency wiring in its own change keeps that follow-up focused purely on the logger itself. --- README.md | 1 + .../IcebergThirdpartyToolchain.cmake | 57 +++++++++++++++++++ src/iceberg/CMakeLists.txt | 6 +- src/iceberg/meson.build | 3 +- subprojects/spdlog.wrap | 30 ++++++++++ 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 subprojects/spdlog.wrap diff --git a/README.md b/README.md index 9dfdbcf7e..7c9a343ec 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ If you experience network issues when downloading dependencies, you can customiz - `ICEBERG_NANOARROW_URL`: Nanoarrow tarball URL - `ICEBERG_CROARING_URL`: CRoaring tarball URL - `ICEBERG_NLOHMANN_JSON_URL`: nlohmann-json tarball URL +- `ICEBERG_SPDLOG_URL`: spdlog tarball URL - `ICEBERG_CPR_URL`: cpr tarball URL Example: diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 1430bb9cd..8e10fd8ec 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -73,6 +73,7 @@ endfunction() # ICEBERG_NANOARROW_URL - Nanoarrow tarball URL # ICEBERG_CROARING_URL - CRoaring tarball URL # ICEBERG_NLOHMANN_JSON_URL - nlohmann-json tarball URL +# ICEBERG_SPDLOG_URL - spdlog tarball URL # ICEBERG_CPR_URL - cpr tarball URL # # Example usage: @@ -482,6 +483,61 @@ function(resolve_nlohmann_json_dependency) PARENT_SCOPE) endfunction() +# ---------------------------------------------------------------------- +# spdlog + +function(resolve_spdlog_dependency) + prepare_fetchcontent() + + find_package(Threads REQUIRED) + + set(SPDLOG_USE_STD_FORMAT + ON + CACHE BOOL "" FORCE) + set(SPDLOG_BUILD_PIC + ON + CACHE BOOL "" FORCE) + + if(DEFINED ENV{ICEBERG_SPDLOG_URL}) + set(SPDLOG_URL "$ENV{ICEBERG_SPDLOG_URL}") + else() + set(SPDLOG_URL "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz") + endif() + + fetchcontent_declare(spdlog + ${FC_DECLARE_COMMON_OPTIONS} + URL ${SPDLOG_URL} + FIND_PACKAGE_ARGS + NAMES + spdlog + CONFIG) + fetchcontent_makeavailable(spdlog) + + if(spdlog_SOURCE_DIR) + set_target_properties(spdlog PROPERTIES OUTPUT_NAME "iceberg_vendored_spdlog" + POSITION_INDEPENDENT_CODE ON) + target_link_libraries(spdlog INTERFACE Threads::Threads) + install(TARGETS spdlog + EXPORT iceberg_targets + RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}") + set(SPDLOG_VENDORED TRUE) + else() + set(SPDLOG_VENDORED FALSE) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES spdlog) + endif() + + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Threads) + + set(ICEBERG_SYSTEM_DEPENDENCIES + ${ICEBERG_SYSTEM_DEPENDENCIES} + PARENT_SCOPE) + set(SPDLOG_VENDORED + ${SPDLOG_VENDORED} + PARENT_SCOPE) +endfunction() + # ---------------------------------------------------------------------- # zlib @@ -664,6 +720,7 @@ resolve_zlib_dependency() resolve_nanoarrow_dependency() resolve_croaring_dependency() resolve_nlohmann_json_dependency() +resolve_spdlog_dependency() if(ICEBERG_S3 OR ICEBERG_SIGV4) if(ICEBERG_SIGV4 AND NOT ICEBERG_BUILD_REST) diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index b641bb75e..0fe418d48 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -139,22 +139,24 @@ list(APPEND ICEBERG_STATIC_BUILD_INTERFACE_LIBS "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>" nlohmann_json::nlohmann_json + spdlog::spdlog ZLIB::ZLIB) list(APPEND ICEBERG_SHARED_BUILD_INTERFACE_LIBS "$,nanoarrow::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" nlohmann_json::nlohmann_json + spdlog::spdlog ZLIB::ZLIB) list(APPEND ICEBERG_STATIC_INSTALL_INTERFACE_LIBS "$,iceberg::nanoarrow_static,$,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>" "$,iceberg::nlohmann_json,$,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>" -) + "$,iceberg::spdlog,spdlog::spdlog>") list(APPEND ICEBERG_SHARED_INSTALL_INTERFACE_LIBS "$,iceberg::nanoarrow_static,$,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>" "$,iceberg::nlohmann_json,$,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>" -) + "$,iceberg::spdlog,spdlog::spdlog>") add_iceberg_lib(iceberg SOURCES diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 15fd5d79d..8c4b49e9b 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -180,9 +180,10 @@ croaring_needs_static = ( croaring_dep = dependency('croaring', static: croaring_needs_static) nanoarrow_dep = dependency('nanoarrow') nlohmann_json_dep = dependency('nlohmann_json') +spdlog_dep = dependency('spdlog') zlib_dep = dependency('zlib') -iceberg_deps = [nanoarrow_dep, nlohmann_json_dep, zlib_dep] +iceberg_deps = [nanoarrow_dep, nlohmann_json_dep, spdlog_dep, zlib_dep] iceberg_lib = library( 'iceberg', diff --git a/subprojects/spdlog.wrap b/subprojects/spdlog.wrap new file mode 100644 index 000000000..f17351f9b --- /dev/null +++ b/subprojects/spdlog.wrap @@ -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. + +[wrap-file] +directory = spdlog-1.15.3 +source_url = https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz +source_filename = spdlog-1.15.3.tar.gz +source_hash = 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67 +patch_filename = spdlog_1.15.3-4_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.15.3-4/get_patch +patch_hash = ccdc72f3d965980d5edd1a56129a9b7fa5f7c86f31e4ecf2dba6a6068829d4e2 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/spdlog_1.15.3-4/spdlog-1.15.3.tar.gz +wrapdb_version = 1.15.3-4 + +[provide] +spdlog = spdlog_dep From ca392061f463a51b9ff08f3c3b54f85d4d99ea4d Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sun, 14 Jun 2026 17:01:04 +0800 Subject: [PATCH 077/151] chore: bump version to 0.4.0-SNAPSHOT (#733) --- CMakeLists.txt | 4 ++-- meson.build | 2 +- src/iceberg/meson.build | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69f90b54a..cb0b2ae2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,11 +24,11 @@ endif() list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") project(Iceberg - VERSION 0.3.0 + VERSION 0.4.0 DESCRIPTION "Iceberg C++ Project" LANGUAGES CXX) -set(ICEBERG_VERSION_SUFFIX "") +set(ICEBERG_VERSION_SUFFIX "-SNAPSHOT") set(ICEBERG_VERSION_STRING "${PROJECT_VERSION}${ICEBERG_VERSION_SUFFIX}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/iceberg/version.h.in" "${CMAKE_BINARY_DIR}/src/iceberg/version.h") diff --git a/meson.build b/meson.build index 69ef47a25..46446cd8d 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ project( 'iceberg', 'cpp', - version: '0.3.0', + version: '0.4.0', license: 'Apache-2.0', meson_version: '>=1.3.0', default_options: [ diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 8c4b49e9b..b6792f993 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -17,6 +17,7 @@ conf_data = configuration_data() version = meson.project_version() +version_suffix = '-SNAPSHOT' components = version.split('.') assert( components.length() >= 3, @@ -28,7 +29,7 @@ ver_patch = components[2] conf_data.set('PROJECT_VERSION_MAJOR', ver_major) conf_data.set('PROJECT_VERSION_MINOR', ver_minor) conf_data.set('PROJECT_VERSION_PATCH', ver_patch) -conf_data.set('PROJECT_VERSION', version) +conf_data.set('ICEBERG_VERSION_STRING', version + version_suffix) conf_data.set('PROJECT_NAME', meson.project_name()) configure_file( input: 'version.h.in', From 399af1bfb007d254ada9d1c4c4b9a5540878e95c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jun 2026 17:01:48 +0800 Subject: [PATCH 078/151] chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
Release notes

Sourced from actions/checkout's releases.

v6.0.3

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v6...v6.0.3

Changelog

Sourced from actions/checkout's changelog.

Changelog

v6.0.3

v6.0.2

v6.0.1

v6.0.0

v5.0.1

v5.0.0

v4.3.1

v4.3.0

v4.2.2

v4.2.1

v4.2.0

v4.1.7

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=6.0.2&new-version=6.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/asf-allowlist-check.yml | 2 +- .github/workflows/aws_test.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/cpp-linter.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/license_check.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/rc.yml | 6 +++--- .github/workflows/sanitizer_test.yml | 2 +- .github/workflows/sql_catalog_test.yml | 2 +- .github/workflows/test.yml | 8 ++++---- .github/workflows/zizmor.yml | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 5c91ccf9d..85ee0f463 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -42,7 +42,7 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml index a8d455006..12c56854f 100644 --- a/.github/workflows/aws_test.yml +++ b/.github/workflows/aws_test.yml @@ -76,7 +76,7 @@ jobs: AWS_EC2_METADATA_DISABLED: "TRUE" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install dependencies on Ubuntu @@ -131,7 +131,7 @@ jobs: with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install build dependencies diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d565a0a75..d1c94f538 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 4225d662e..5af67dd2c 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -36,7 +36,7 @@ jobs: pull-requests: write steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a0d16384b..e13cab7d1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-slim steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 1 persist-credentials: false diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 47f974e82..361314812 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-slim steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Check license header diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 15e34082b..d8a06a108 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -33,7 +33,7 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-slim steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index fa27c99ce..91d630814 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -34,7 +34,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false @@ -86,7 +86,7 @@ jobs: CXX: g++-14 steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false @@ -134,7 +134,7 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index faac265e8..f4edecfec 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index 7d93e984d..cc95169af 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -63,7 +63,7 @@ jobs: cmake_extra_args: -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Set up MSVC Developer Command Prompt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41bdd4b97..04b43986f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install dependencies @@ -74,7 +74,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Build Iceberg @@ -92,7 +92,7 @@ jobs: fail-fast: false steps: - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Set up MSVC Developer Command Prompt @@ -144,7 +144,7 @@ jobs: with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Install build dependencies diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 904f4726a..5265d6f04 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -36,7 +36,7 @@ jobs: permissions: {} steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false From 04e0ce3565c52b0ad97c9a08e5f040950c901686 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jun 2026 17:02:10 +0800 Subject: [PATCH 079/151] chore(deps): bump actions/cache from 4.3.0 to 5.0.5 (#735) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/cache](https://github.com/actions/cache) from 4.3.0 to 5.0.5.
Release notes

Sourced from actions/cache's releases.

v5.0.5

What's Changed

Full Changelog: https://github.com/actions/cache/compare/v5...v5.0.5

v5.0.4

What's Changed

New Contributors

Full Changelog: https://github.com/actions/cache/compare/v5...v5.0.4

v5.0.3

What's Changed

Full Changelog: https://github.com/actions/cache/compare/v5...v5.0.3

v.5.0.2

v5.0.2

What's Changed

When creating cache entries, 429s returned from the cache service will not be retried.

v5.0.1

[!IMPORTANT] actions/cache@v5 runs on the Node.js 24 runtime and requires a minimum Actions Runner version of 2.327.1.

If you are using self-hosted runners, ensure they are updated before upgrading.


v5.0.1

... (truncated)

Changelog

Sourced from actions/cache's changelog.

Releases

How to prepare a release

[!NOTE]
Relevant for maintainers with write access only.

  1. Switch to a new branch from main.
  2. Run npm test to ensure all tests are passing.
  3. Update the version in https://github.com/actions/cache/blob/main/package.json.
  4. Run npm run build to update the compiled files.
  5. Update this https://github.com/actions/cache/blob/main/RELEASES.md with the new version and changes in the ## Changelog section.
  6. Run licensed cache to update the license report.
  7. Run licensed status and resolve any warnings by updating the https://github.com/actions/cache/blob/main/.licensed.yml file with the exceptions.
  8. Commit your changes and push your branch upstream.
  9. Open a pull request against main and get it reviewed and merged.
  10. Draft a new release https://github.com/actions/cache/releases use the same version number used in package.json
    1. Create a new tag with the version number.
    2. Auto generate release notes and update them to match the changes you made in RELEASES.md.
    3. Toggle the set as the latest release option.
    4. Publish the release.
  11. Navigate to https://github.com/actions/cache/actions/workflows/release-new-action-version.yml
    1. There should be a workflow run queued with the same version number.
    2. Approve the run to publish the new version and update the major tags for this action.

Changelog

5.0.4

  • Bump minimatch to v3.1.5 (fixes ReDoS via globstar patterns)
  • Bump undici to v6.24.1 (WebSocket decompression bomb protection, header validation fixes)
  • Bump fast-xml-parser to v5.5.6

5.0.3

5.0.2

  • Bump @actions/cache to v5.0.3 #1692

5.0.1

  • Update @azure/storage-blob to ^12.29.1 via @actions/cache@5.0.1 #1685

5.0.0

[!IMPORTANT] actions/cache@v5 runs on the Node.js 24 runtime and requires a minimum Actions Runner version of 2.327.1.

... (truncated)

Commits
  • 27d5ce7 Merge pull request #1747 from actions/yacaovsnc/update-dependency
  • f280785 licensed changes
  • 619aeb1 npm run build generated dist files
  • bcf16c2 Update ts-http-runtime to 0.3.5
  • 6682284 Merge pull request #1738 from actions/prepare-v5.0.4
  • e340396 Update RELEASES
  • 8a67110 Add licenses
  • 1865903 Update dependencies & patch security vulnerabilities
  • 5656298 Merge pull request #1722 from RyPeck/patch-1
  • 4e380d1 Fix cache key in examples.md for bun.lock
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=4.3.0&new-version=5.0.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/aws_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml index 12c56854f..4d58edddb 100644 --- a/.github/workflows/aws_test.yml +++ b/.github/workflows/aws_test.yml @@ -85,7 +85,7 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev - name: Cache vcpkg packages if: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' }} - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: vcpkg-cache with: path: /usr/local/share/vcpkg/installed @@ -141,7 +141,7 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install -r requirements.txt - name: Cache vcpkg packages - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: vcpkg-cache with: path: /usr/local/share/vcpkg/installed From cf50b12ba4df2e6540a652e1e4343dbbb6beb791 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jun 2026 17:02:40 +0800 Subject: [PATCH 080/151] chore(deps): bump github/codeql-action from 4.36.0 to 4.36.2 (#736) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.2.
Release notes

Sourced from github/codeql-action's releases.

v4.36.2

  • Cache CodeQL CLI version information across Actions steps. #3943
  • Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. #3937
  • Update default CodeQL bundle version to 2.25.6. #3948

v4.36.1

No user facing changes.

Changelog

Sourced from github/codeql-action's changelog.

CodeQL Action Changelog

See the releases page for the relevant changes to the CodeQL CLI and language packs.

[UNRELEASED]

No user facing changes.

4.36.2 - 04 Jun 2026

  • Cache CodeQL CLI version information across Actions steps. #3943
  • Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. #3937
  • Update default CodeQL bundle version to 2.25.6. #3948

4.36.1 - 02 Jun 2026

No user facing changes.

4.36.0 - 22 May 2026

  • Breaking change: Bump the minimum required CodeQL bundle version to 2.19.4. #3894
  • Add support for SHA-256 Git object IDs. #3893
  • Update default CodeQL bundle version to 2.25.5. #3926

4.35.5 - 15 May 2026

  • We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. #3899
  • For performance and accuracy reasons, improved incremental analysis will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. #3791
  • If multiple inputs are provided for the GitHub-internal analysis-kinds input, only code-scanning will be enabled. The analysis-kinds input is experimental, for GitHub-internal use only, and may change without notice at any time. #3892
  • Added an experimental change which, when running a Code Scanning analysis for a PR with improved incremental analysis enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. #3880

4.35.4 - 07 May 2026

  • Update default CodeQL bundle version to 2.25.4. #3881

4.35.3 - 01 May 2026

  • Upcoming breaking change: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. #3837
  • Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. #3850
  • Best-effort connection tests for private registries now use GET requests instead of HEAD for better compatibility with various registry implementations. For NuGet feeds, the test is now always performed against the service index. #3853
  • Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. #3852
  • Update default CodeQL bundle version to 2.25.3. #3865

4.35.2 - 15 Apr 2026

  • The undocumented TRAP cache cleanup feature that could be enabled using the CODEQL_ACTION_CLEANUP_TRAP_CACHES environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the trap-caching: false input to the init Action. #3795
  • The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. #3789
  • Python analysis on GHES no longer extracts the standard library, relying instead on models of the standard library. This should result in significantly faster extraction and analysis times, while the effect on alerts should be minimal. #3794
  • Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. #3807
  • Update default CodeQL bundle version to 2.25.2. #3823

... (truncated)

Commits
  • 8aad20d Merge pull request #3949 from github/update-v4.36.2-dcb947ce1
  • f521b08 Add additional changelog notes
  • 8aeff0f Update changelog for v4.36.2
  • dcb947c Merge pull request #3948 from github/update-bundle/codeql-bundle-v2.25.6
  • c251bce Add changelog note
  • 62953c1 Update default bundle to codeql-bundle-v2.25.6
  • 423b570 Merge pull request #3946 from github/dependabot/npm_and_yarn/npm-minor-5d507a...
  • c35d1b1 Merge pull request #3947 from github/dependabot/github_actions/dot-github/wor...
  • cb1a588 Merge pull request #3937 from github/robertbrignull/waitForProcessing_backoff
  • ba47406 Merge pull request #3943 from github/henrymercer/cache-cli-version-info
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=4.36.0&new-version=4.36.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d1c94f538..98090e34d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,11 +48,11 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: languages: actions - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: category: "/language:actions" From a68602cfe49e45ae252450d4bc09fe83cbf3dd34 Mon Sep 17 00:00:00 2001 From: Jiajia Li Date: Sun, 14 Jun 2026 17:39:34 +0800 Subject: [PATCH 081/151] feat(arrow): resolve S3-compatible schemes in ArrowFileSystemFileIO (#703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ArrowFileSystemFileIO::ResolvePath` passed the full URI to the wrapped FileSystem's `PathFromUri`, which only accepts that FileSystem's native scheme(`s3://` for `S3FileSystem`). S3-compatible object stores are commonly addressed with other schemes — `s3a`/`s3n`, or vendor schemes such as `gs://` (GCS) and`oss://` (Alibaba OSS) — served by an `arrow::fs::S3FileSystem` configured with an `endpoint_override`. Every read and write of such a location failed with: ``` expected a URI with one of the schemes (s3) but received ://... ``` --- src/iceberg/arrow/arrow_io.cc | 24 ++++++++++++++--- src/iceberg/catalog/rest/rest_file_io.cc | 2 +- src/iceberg/test/arrow_io_test.cc | 34 ++++++++++++++++++++++++ src/iceberg/test/rest_file_io_test.cc | 4 +++ 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/src/iceberg/arrow/arrow_io.cc b/src/iceberg/arrow/arrow_io.cc index 45ad4259e..6b159ca89 100644 --- a/src/iceberg/arrow/arrow_io.cc +++ b/src/iceberg/arrow/arrow_io.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include "iceberg/arrow/arrow_io_internal.h" #include "iceberg/arrow/arrow_io_util.h" @@ -473,11 +474,26 @@ class ArrowOutputFile : public OutputFile { } // namespace Result ArrowFileSystemFileIO::ResolvePath(const std::string& file_location) { - if (file_location.find("://") != std::string::npos) { - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto path, arrow_fs_->PathFromUri(file_location)); - return path; + const auto pos = file_location.find("://"); + if (pos == std::string::npos) { + return file_location; } - return file_location; + + auto path = arrow_fs_->PathFromUri(file_location); + if (path.ok()) { + return std::move(path).ValueOrDie(); + } + + // Foreign alias (s3a/s3n): validate via Arrow's parser, then percent-decode the + // scheme-less key (substring keeps a Windows drive letter's ':' that host() drops). + if (auto parsed = ::arrow::util::Uri::FromString(file_location); !parsed.ok()) { + const auto& status = parsed.status(); + return std::unexpected{ + {.kind = ToErrorKind(status), .message = status.ToString()}}; + } + std::string bucket_key = file_location.substr(pos + 3); + bucket_key = bucket_key.substr(0, bucket_key.find_first_of("?#")); + return ::arrow::util::UriUnescape(bucket_key); } Result> OpenArrowInputStream( diff --git a/src/iceberg/catalog/rest/rest_file_io.cc b/src/iceberg/catalog/rest/rest_file_io.cc index f08a03353..5fadca1ac 100644 --- a/src/iceberg/catalog/rest/rest_file_io.cc +++ b/src/iceberg/catalog/rest/rest_file_io.cc @@ -45,7 +45,7 @@ Result DetectBuiltinFileIO(std::string_view location) { if (scheme == "file") { return BuiltinFileIOKind::kArrowLocal; } - if (scheme == "s3") { + if (scheme == "s3" || scheme == "s3a" || scheme == "s3n") { return BuiltinFileIOKind::kArrowS3; } diff --git a/src/iceberg/test/arrow_io_test.cc b/src/iceberg/test/arrow_io_test.cc index 7edaf0756..4ac83469c 100644 --- a/src/iceberg/test/arrow_io_test.cc +++ b/src/iceberg/test/arrow_io_test.cc @@ -37,6 +37,11 @@ namespace iceberg { namespace { +std::string ForeignSchemeUri(std::string local_path) { + std::ranges::replace(local_path, '\\', '/'); + return "x-store://" + local_path; +} + struct CloseState { bool closed = false; }; @@ -405,6 +410,35 @@ TEST_F(LocalFileIOTest, StdReadKeepsPositionAvailableAtEof) { EXPECT_THAT(stream->Position(), HasValue(::testing::Eq(3))); } +TEST_F(LocalFileIOTest, ResolvesForeignSchemeToUnderlyingPath) { + ASSERT_THAT(file_io_->WriteFile(temp_filepath_, "hello world"), IsOk()); + + auto read_res = file_io_->ReadFile(ForeignSchemeUri(temp_filepath_), std::nullopt); + EXPECT_THAT(read_res, IsOk()); + EXPECT_THAT(read_res, HasValue(::testing::Eq("hello world"))); + + auto with_query = file_io_->ReadFile(ForeignSchemeUri(temp_filepath_) + "?versionId=42", + std::nullopt); + EXPECT_THAT(with_query, IsOk()); + EXPECT_THAT(with_query, HasValue(::testing::Eq("hello world"))); +} + +TEST_F(LocalFileIOTest, PropagatesNonSchemeMismatchUriError) { + auto read_res = file_io_->ReadFile("file:///tmp/%ZZ", std::nullopt); + EXPECT_THAT(read_res, IsError(ErrorKind::kUnknownError)); + EXPECT_THAT(read_res, HasErrorMessage("Cannot parse URI")); +} + +TEST_F(LocalFileIOTest, FallbackDecodesPercentEncodingInKey) { + std::string decoded_path = temp_filepath_ + " x"; + ASSERT_THAT(file_io_->WriteFile(decoded_path, "raw"), IsOk()); + + auto read_res = + file_io_->ReadFile(ForeignSchemeUri(temp_filepath_ + "%20x"), std::nullopt); + EXPECT_THAT(read_res, IsOk()); + EXPECT_THAT(read_res, HasValue(::testing::Eq("raw"))); +} + TEST(FileIOAdapterTest, InputAdapterRejectsReadsAfterClose) { auto state = std::make_shared(); state->data = "abc"; diff --git a/src/iceberg/test/rest_file_io_test.cc b/src/iceberg/test/rest_file_io_test.cc index c86df2753..b1193d9f8 100644 --- a/src/iceberg/test/rest_file_io_test.cc +++ b/src/iceberg/test/rest_file_io_test.cc @@ -49,6 +49,10 @@ class MockFileIO : public FileIO { TEST(RestFileIOTest, DetectBuiltinKindFromScheme) { EXPECT_THAT(DetectBuiltinFileIO("s3://bucket/path"), HasValue(::testing::Eq(BuiltinFileIOKind::kArrowS3))); + EXPECT_THAT(DetectBuiltinFileIO("s3a://bucket/path"), + HasValue(::testing::Eq(BuiltinFileIOKind::kArrowS3))); + EXPECT_THAT(DetectBuiltinFileIO("s3n://bucket/path"), + HasValue(::testing::Eq(BuiltinFileIOKind::kArrowS3))); EXPECT_THAT(DetectBuiltinFileIO("/tmp/warehouse"), HasValue(::testing::Eq(BuiltinFileIOKind::kArrowLocal))); EXPECT_THAT(DetectBuiltinFileIO("file:///tmp/warehouse"), From 5eb32df030fdd0fe735fcf824046c66e0ddb1f0e Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Mon, 15 Jun 2026 05:23:45 +0200 Subject: [PATCH 082/151] Fix URL encoding for non-ASCII bytes (#738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Treat URL encoder input bytes as unsigned before splitting them into hex nibbles. - Add UTF-8 regression coverage for `café` encoding to `caf%C3%A9`. ## Why On platforms where `char` is signed, bytes >= 0x80 can become negative before the hex lookup. That can lead to undefined behavior or incorrect percent encoding for non-ASCII strings. ## Testing - `cmake -S . -B build -G Ninja -DICEBERG_BUILD_BUNDLE=OFF -DICEBERG_BUILD_REST=OFF -DICEBERG_BUILD_HIVE=OFF -DICEBERG_BUILD_SQL_CATALOG=OFF` - `cmake --build build --target util_test` - `ctest --test-dir build -R util_test --output-on-failure` --- src/iceberg/test/url_encoder_test.cc | 2 ++ src/iceberg/util/url_encoder.cc | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/iceberg/test/url_encoder_test.cc b/src/iceberg/test/url_encoder_test.cc index fe22a9bb0..59f75a8e4 100644 --- a/src/iceberg/test/url_encoder_test.cc +++ b/src/iceberg/test/url_encoder_test.cc @@ -40,6 +40,7 @@ TEST(UrlEncoderTest, Encode) { ::testing::Eq("key%3Dvalue%26foo%3Dbar")); EXPECT_THAT(UrlEncoder::Encode("100%"), ::testing::Eq("100%25")); EXPECT_THAT(UrlEncoder::Encode("hello\x1fworld"), ::testing::Eq("hello%1Fworld")); + EXPECT_THAT(UrlEncoder::Encode("caf\xC3\xA9"), ::testing::Eq("caf%C3%A9")); EXPECT_THAT(UrlEncoder::Encode(""), ::testing::Eq("")); } @@ -69,6 +70,7 @@ TEST(UrlEncoderTest, EncodeDecodeRoundTrip) { "key=value&foo=bar", "100%", "hello\x1Fworld", + "caf\xC3\xA9", "special!@#$%^&*()chars", "mixed-123_test.file~ok", ""}; diff --git a/src/iceberg/util/url_encoder.cc b/src/iceberg/util/url_encoder.cc index a6ae4fd86..5f2469f07 100644 --- a/src/iceberg/util/url_encoder.cc +++ b/src/iceberg/util/url_encoder.cc @@ -46,12 +46,13 @@ std::string UrlEncoder::Encode(std::string_view str_to_encode) { result.reserve(str_to_encode.size() * 3 / 2 /* Heuristic reservation */); for (char c : str_to_encode) { - if (IsUnreserved(c)) { + auto b = static_cast(c); + if (IsUnreserved(b)) { result += c; } else { result += '%'; - result += kHexChars[c >> 4]; - result += kHexChars[c & 0xF]; + result += kHexChars[b >> 4]; + result += kHexChars[b & 0xF]; } } From 8d88bef10676c052afe0b171df697deaf420ac16 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 15 Jun 2026 11:26:03 +0800 Subject: [PATCH 083/151] fix: allow avro date reads from plain int (#728) per https://github.com/apache/iceberg/pull/16446/changes --- src/iceberg/avro/avro_data_util.cc | 6 ++--- src/iceberg/avro/avro_direct_decoder.cc | 6 ++--- src/iceberg/avro/avro_schema_util.cc | 9 ++++++-- src/iceberg/avro/avro_schema_util_internal.h | 8 +++++++ src/iceberg/test/avro_schema_test.cc | 24 ++++++++++++++++++++ 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/iceberg/avro/avro_data_util.cc b/src/iceberg/avro/avro_data_util.cc index fb2f58bd1..f2bcc29f8 100644 --- a/src/iceberg/avro/avro_data_util.cc +++ b/src/iceberg/avro/avro_data_util.cc @@ -395,10 +395,10 @@ Status AppendPrimitiveValueToBuilder(const ::avro::NodePtr& avro_node, } case TypeId::kDate: { - if (avro_node->type() != ::avro::AVRO_INT || - avro_node->logicalType().type() != ::avro::LogicalType::DATE) { + if (!IsAvroDateOrPlainInt(avro_node)) { return InvalidArgument( - "Expected Avro int with DATE logical type for date field, got: {}", + "Expected Avro int with DATE logical type or plain int for date field, got: " + "{}", ToString(avro_node)); } auto* builder = internal::checked_cast<::arrow::Date32Builder*>(array_builder); diff --git a/src/iceberg/avro/avro_direct_decoder.cc b/src/iceberg/avro/avro_direct_decoder.cc index 19ce77bbd..583b9ac5c 100644 --- a/src/iceberg/avro/avro_direct_decoder.cc +++ b/src/iceberg/avro/avro_direct_decoder.cc @@ -523,10 +523,10 @@ Status DecodePrimitiveValueToBuilder(const ::avro::NodePtr& avro_node, } case TypeId::kDate: { - if (avro_node->type() != ::avro::AVRO_INT || - avro_node->logicalType().type() != ::avro::LogicalType::DATE) { + if (!IsAvroDateOrPlainInt(avro_node)) { return InvalidArgument( - "Expected Avro int with DATE logical type for date field, got: {}", + "Expected Avro int with DATE logical type or plain int for date field, got: " + "{}", ToString(avro_node)); } auto* builder = internal::checked_cast<::arrow::Date32Builder*>(array_builder); diff --git a/src/iceberg/avro/avro_schema_util.cc b/src/iceberg/avro/avro_schema_util.cc index 4ecd87ebc..c26e2bbc9 100644 --- a/src/iceberg/avro/avro_schema_util.cc +++ b/src/iceberg/avro/avro_schema_util.cc @@ -125,6 +125,12 @@ std::string ToString(const ::avro::LogicalType::Type& logical_type) { return ToString(::avro::LogicalType(logical_type)); } +bool IsAvroDateOrPlainInt(const ::avro::NodePtr& node) { + return node->type() == ::avro::AVRO_INT && + (node->logicalType().type() == ::avro::LogicalType::DATE || + node->logicalType().type() == ::avro::LogicalType::NONE); +} + Status ToAvroNodeVisitor::Visit(const BooleanType& type, ::avro::NodePtr* node) { *node = std::make_shared<::avro::NodePrimitive>(::avro::AVRO_BOOL); return {}; @@ -550,8 +556,7 @@ Status ValidateAvroSchemaEvolution(const Type& expected_type, } break; case TypeId::kDate: - if (avro_node->type() == ::avro::AVRO_INT && - HasLogicalType(avro_node, ::avro::LogicalType::DATE)) { + if (IsAvroDateOrPlainInt(avro_node)) { return {}; } break; diff --git a/src/iceberg/avro/avro_schema_util_internal.h b/src/iceberg/avro/avro_schema_util_internal.h index f5049e5cf..a5bfb989e 100644 --- a/src/iceberg/avro/avro_schema_util_internal.h +++ b/src/iceberg/avro/avro_schema_util_internal.h @@ -147,6 +147,14 @@ std::string ToString(const ::avro::NodePtr& node); std::string ToString(const ::avro::LogicalType& logical_type); std::string ToString(const ::avro::LogicalType::Type& logical_type); +/// \brief Check if an Avro node can be read as an Iceberg date. +/// +/// Iceberg dates are encoded as Avro ints with the date logical type. Readers +/// also accept plain ints where the expected Iceberg type is date. +/// \param node The Avro node to check. +/// \return True if the node is an Avro date or a plain Avro int. +bool IsAvroDateOrPlainInt(const ::avro::NodePtr& node); + /// \brief Check if an Avro node has a map logical type. /// \param node The Avro node to check. /// \return True if the node has a map logical type, false otherwise. diff --git a/src/iceberg/test/avro_schema_test.cc b/src/iceberg/test/avro_schema_test.cc index ffb668abc..169eff64c 100644 --- a/src/iceberg/test/avro_schema_test.cc +++ b/src/iceberg/test/avro_schema_test.cc @@ -950,6 +950,30 @@ TEST(AvroSchemaProjectionTest, ProjectSchemaEvolutionIntToLong) { ASSERT_EQ(std::get<1>(projection.fields[0].from), 0); } +TEST(AvroSchemaProjectionTest, ProjectDateFromPlainInt) { + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "day", iceberg::date()), + }); + + std::string avro_schema_json = R"({ + "type": "record", + "name": "iceberg_schema", + "fields": [ + {"name": "day", "type": "int", "field-id": 1} + ] + })"; + auto avro_schema = ::avro::compileJsonSchemaFromString(avro_schema_json); + + auto projection_result = + Project(expected_schema, avro_schema.root(), /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 1); + ASSERT_EQ(projection.fields[0].kind, FieldProjection::Kind::kProjected); + ASSERT_EQ(std::get<1>(projection.fields[0].from), 0); +} + TEST(AvroSchemaProjectionTest, ProjectSchemaEvolutionFloatToDouble) { // Create iceberg schema expecting a double Schema expected_schema({ From cc4d35f25d7f3f6d7eab9a432a337cb6886ee9f2 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Mon, 15 Jun 2026 12:50:23 +0800 Subject: [PATCH 084/151] doc: add release history for release v0.3.0 (#743) Co-authored-by: Gang Wu --- mkdocs/docs/releases.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mkdocs/docs/releases.md b/mkdocs/docs/releases.md index 9a9793f8b..9dc324ea7 100644 --- a/mkdocs/docs/releases.md +++ b/mkdocs/docs/releases.md @@ -21,11 +21,27 @@ | Version | Date | Links | |---------|------|-------| +| 0.3.0 | June 14, 2026 | [Release Notes](https://github.com/apache/iceberg-cpp/releases/tag/v0.3.0) · [Source](https://dist.apache.org/repos/dist/release/iceberg/apache-iceberg-cpp-0.3.0/) · [Blog Post](https://iceberg.apache.org/blog/apache-iceberg-cpp-0.3.0-release/) | | 0.2.0 | January 26, 2026 | [Release Notes](https://github.com/apache/iceberg-cpp/releases/tag/v0.2.0) · [Source](https://dist.apache.org/repos/dist/release/iceberg/apache-iceberg-cpp-0.2.0/) · [Blog Post](https://iceberg.apache.org/blog/apache-iceberg-cpp-0.2.0-release/) | | 0.1.0 | September 10, 2025 | [Release Notes](https://github.com/apache/iceberg-cpp/releases/tag/v0.1.0) · [Source](https://archive.apache.org/dist/iceberg/apache-iceberg-cpp-0.1.0/) | For the full changelog of each release, see the [GitHub Releases page](https://github.com/apache/iceberg-cpp/releases). +## 0.3.0 + +- Extend table scan planning with v2 delete support, manifest filtering, and projection +- Incremental scan planning with append-only and basic changelog scan support +- REST catalog improvements including initial OAuth2 support with auto-refresh, basic authentication, snapshot loading mode, namespace separators, and server-side scan planning +- New table metadata update including partition statistics, schema update, and expire snapshots with file cleanup support +- Transaction with retry, and scaffolding work on MergingSnapshotUpdate for update, delete, overwrite, etc. +- SQL catalog support backed by SQLite, PostgreSQL, and MySQL stores +- File scan task reader with v2 deletes support +- V2 data writer support and writer metrics collection +- Groundwork for scan and commit metrics reporting +- Puffin metadata and reader/writer support +- Initial v3 support with the unknown and nanosecond timestamp types +- FileIO enrichment including new InputFile and OutputFile interfaces, bulk delete and S3 integration + ## 0.2.0 - Table scan planning with V2 delete and filtering support From 7324142d373d836ab068d94eb52fae7ff948dda1 Mon Sep 17 00:00:00 2001 From: Huangshi Tian Date: Mon, 15 Jun 2026 00:55:29 -0400 Subject: [PATCH 085/151] feat(inspect): add base metadata table interface (#607) This PR kicks off the implementation of table inspection support. - Add `MetadataTable` class (without scan support for now). - Add `SnapshotsTable` and `HistoryTable` as example impl. --- src/iceberg/CMakeLists.txt | 4 + src/iceberg/inspect/CMakeLists.txt | 18 ++++ src/iceberg/inspect/history_table.cc | 62 ++++++++++++ src/iceberg/inspect/history_table.h | 44 +++++++++ src/iceberg/inspect/meson.build | 21 +++++ src/iceberg/inspect/metadata_table.cc | 54 +++++++++++ src/iceberg/inspect/metadata_table.h | 62 ++++++++++++ src/iceberg/inspect/snapshots_table.cc | 68 ++++++++++++++ src/iceberg/inspect/snapshots_table.h | 44 +++++++++ src/iceberg/meson.build | 4 + src/iceberg/table.cc | 33 +++++++ src/iceberg/table.h | 19 +++- src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/meson.build | 1 + src/iceberg/test/metadata_table_test.cc | 120 ++++++++++++++++++++++++ src/iceberg/test/table_test.cc | 16 ++++ src/iceberg/type_fwd.h | 5 + 17 files changed, 575 insertions(+), 1 deletion(-) create mode 100644 src/iceberg/inspect/CMakeLists.txt create mode 100644 src/iceberg/inspect/history_table.cc create mode 100644 src/iceberg/inspect/history_table.h create mode 100644 src/iceberg/inspect/meson.build create mode 100644 src/iceberg/inspect/metadata_table.cc create mode 100644 src/iceberg/inspect/metadata_table.h create mode 100644 src/iceberg/inspect/snapshots_table.cc create mode 100644 src/iceberg/inspect/snapshots_table.h create mode 100644 src/iceberg/test/metadata_table_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 0fe418d48..ffa3f2f08 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -41,6 +41,9 @@ set(ICEBERG_SOURCES file_io_registry.cc file_reader.cc file_writer.cc + inspect/history_table.cc + inspect/metadata_table.cc + inspect/snapshots_table.cc inheritable_metadata.cc json_serde.cc location_provider.cc @@ -238,6 +241,7 @@ add_subdirectory(puffin) add_subdirectory(row) add_subdirectory(update) add_subdirectory(util) +add_subdirectory(inspect) add_subdirectory(metrics) if(ICEBERG_BUILD_BUNDLE) diff --git a/src/iceberg/inspect/CMakeLists.txt b/src/iceberg/inspect/CMakeLists.txt new file mode 100644 index 000000000..2df844359 --- /dev/null +++ b/src/iceberg/inspect/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +iceberg_install_all_headers(iceberg/inspect) diff --git a/src/iceberg/inspect/history_table.cc b/src/iceberg/inspect/history_table.cc new file mode 100644 index 000000000..7fa840043 --- /dev/null +++ b/src/iceberg/inspect/history_table.cc @@ -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. + */ + +#include "iceberg/inspect/history_table.h" + +#include +#include +#include + +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/table.h" +#include "iceberg/table_identifier.h" +#include "iceberg/type.h" + +namespace iceberg { +namespace { + +std::shared_ptr MakeHistoryTableSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "made_current_at", timestamp_tz()), + SchemaField::MakeRequired(2, "snapshot_id", int64()), + SchemaField::MakeOptional(3, "parent_id", int64()), + SchemaField::MakeRequired(4, "is_current_ancestor", boolean())}); +} + +TableIdentifier MakeHistoryTableName(const TableIdentifier& source_name) { + return TableIdentifier{.ns = source_name.ns, .name = source_name.name + ".history"}; +} + +} // namespace + +HistoryTable::HistoryTable(std::shared_ptr
table) + : MetadataTable(table, MakeHistoryTableName(table->name()), + MakeHistoryTableSchema()) {} + +HistoryTable::~HistoryTable() = default; + +Result> HistoryTable::Make(std::shared_ptr
table) { + if (table == nullptr) [[unlikely]] { + return InvalidArgument("Table cannot be null"); + } + return std::unique_ptr(new HistoryTable(std::move(table))); +} + +} // namespace iceberg diff --git a/src/iceberg/inspect/history_table.h b/src/iceberg/inspect/history_table.h new file mode 100644 index 000000000..94a26368f --- /dev/null +++ b/src/iceberg/inspect/history_table.h @@ -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. + */ + +#pragma once + +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/inspect/metadata_table.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief History metadata table. +class ICEBERG_EXPORT HistoryTable : public MetadataTable { + public: + static Result> Make(std::shared_ptr
table); + + ~HistoryTable() override; + + Kind kind() const noexcept override { return Kind::kHistory; } + + private: + explicit HistoryTable(std::shared_ptr
table); +}; + +} // namespace iceberg diff --git a/src/iceberg/inspect/meson.build b/src/iceberg/inspect/meson.build new file mode 100644 index 000000000..5c738008a --- /dev/null +++ b/src/iceberg/inspect/meson.build @@ -0,0 +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. + +install_headers( + ['history_table.h', 'metadata_table.h', 'snapshots_table.h'], + subdir: 'iceberg/inspect', +) diff --git a/src/iceberg/inspect/metadata_table.cc b/src/iceberg/inspect/metadata_table.cc new file mode 100644 index 000000000..5e9504003 --- /dev/null +++ b/src/iceberg/inspect/metadata_table.cc @@ -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. + */ + +#include "iceberg/inspect/metadata_table.h" + +#include +#include + +#include "iceberg/inspect/history_table.h" +#include "iceberg/inspect/snapshots_table.h" + +namespace iceberg { + +MetadataTable::MetadataTable(std::shared_ptr
source_table, + TableIdentifier identifier, std::shared_ptr schema) + : identifier_(std::move(identifier)), + schema_(std::move(schema)), + source_table_(std::move(source_table)) {} + +MetadataTable::~MetadataTable() = default; + +Result> MetadataTable::Make(std::shared_ptr
table, + Kind kind) { + if (table == nullptr) [[unlikely]] { + return InvalidArgument("Table cannot be null"); + } + + switch (kind) { + case Kind::kSnapshots: + return SnapshotsTable::Make(table); + case Kind::kHistory: + return HistoryTable::Make(table); + } + + return NotSupported("Unsupported metadata table type"); +} + +} // namespace iceberg diff --git a/src/iceberg/inspect/metadata_table.h b/src/iceberg/inspect/metadata_table.h new file mode 100644 index 000000000..7d0ac22da --- /dev/null +++ b/src/iceberg/inspect/metadata_table.h @@ -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. + */ + +#pragma once + +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/table_identifier.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Base class for Iceberg metadata tables. +class ICEBERG_EXPORT MetadataTable { + public: + enum class Kind { + kSnapshots, + kHistory, + }; + + static Result> Make(std::shared_ptr
table, + Kind kind); + + virtual ~MetadataTable(); + + virtual Kind kind() const noexcept = 0; + + const TableIdentifier& name() const { return identifier_; } + + const std::shared_ptr& schema() const { return schema_; } + + const std::shared_ptr
& source_table() const { return source_table_; } + + protected: + explicit MetadataTable(std::shared_ptr
source_table, TableIdentifier identifier, + std::shared_ptr schema); + + private: + TableIdentifier identifier_; + std::shared_ptr schema_; + std::shared_ptr
source_table_; +}; + +} // namespace iceberg diff --git a/src/iceberg/inspect/snapshots_table.cc b/src/iceberg/inspect/snapshots_table.cc new file mode 100644 index 000000000..4b0c3ce9f --- /dev/null +++ b/src/iceberg/inspect/snapshots_table.cc @@ -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. + */ + +#include "iceberg/inspect/snapshots_table.h" + +#include +#include +#include + +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/table.h" +#include "iceberg/table_identifier.h" +#include "iceberg/type.h" + +namespace iceberg { +namespace { + +std::shared_ptr MakeSnapshotsTableSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "committed_at", timestamp_tz()), + SchemaField::MakeRequired(2, "snapshot_id", int64()), + SchemaField::MakeOptional(3, "parent_id", int64()), + SchemaField::MakeOptional(4, "operation", string()), + SchemaField::MakeOptional(5, "manifest_list", string()), + SchemaField::MakeOptional(6, "summary", + std::make_shared( + SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeRequired(8, "value", string())))}); +} + +TableIdentifier MakeSnapshotsTableName(const TableIdentifier& source_name) { + return TableIdentifier{.ns = source_name.ns, .name = source_name.name + ".snapshots"}; +} + +} // namespace + +SnapshotsTable::SnapshotsTable(std::shared_ptr
table) + : MetadataTable(table, MakeSnapshotsTableName(table->name()), + MakeSnapshotsTableSchema()) {} + +SnapshotsTable::~SnapshotsTable() = default; + +Result> SnapshotsTable::Make( + std::shared_ptr
table) { + if (table == nullptr) [[unlikely]] { + return InvalidArgument("Table cannot be null"); + } + return std::unique_ptr(new SnapshotsTable(std::move(table))); +} + +} // namespace iceberg diff --git a/src/iceberg/inspect/snapshots_table.h b/src/iceberg/inspect/snapshots_table.h new file mode 100644 index 000000000..50017796f --- /dev/null +++ b/src/iceberg/inspect/snapshots_table.h @@ -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. + */ + +#pragma once + +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/inspect/metadata_table.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Snapshots metadata table. +class ICEBERG_EXPORT SnapshotsTable : public MetadataTable { + public: + static Result> Make(std::shared_ptr
table); + + ~SnapshotsTable() override; + + Kind kind() const noexcept override { return Kind::kSnapshots; } + + private: + explicit SnapshotsTable(std::shared_ptr
table); +}; + +} // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index b6792f993..75fae754e 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -65,6 +65,9 @@ iceberg_sources = files( 'file_reader.cc', 'file_writer.cc', 'inheritable_metadata.cc', + 'inspect/history_table.cc', + 'inspect/metadata_table.cc', + 'inspect/snapshots_table.cc', 'json_serde.cc', 'location_provider.cc', 'manifest/manifest_adapter.cc', @@ -296,6 +299,7 @@ subdir('puffin') subdir('row') subdir('update') subdir('util') +subdir('inspect') if get_option('tests').enabled() subdir('test') diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index 1255871c3..ba83de123 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -287,4 +287,37 @@ Result> StaticTable::NewUpdateSchema() { return NotSupported("Cannot create an update schema for a static table"); } +Result> StaticTable::NewUpdateLocation() { + return NotSupported("Cannot create an update location for a static table"); +} + +Result> StaticTable::NewUpdatePartitionSpec() { + return NotSupported("Cannot create an update partition spec for a static table"); +} + +Result> StaticTable::NewUpdateSortOrder() { + return NotSupported("Cannot create an update sort order for a static table"); +} + +Result> StaticTable::NewExpireSnapshots() { + return NotSupported("Cannot create an expire snapshots for a static table"); +} + +Result> StaticTable::NewUpdateStatistics() { + return NotSupported("Cannot create an update statistics for a static table"); +} + +Result> +StaticTable::NewUpdatePartitionStatistics() { + return NotSupported("Cannot create an update partition statistics for a static table"); +} + +Result> StaticTable::NewFastAppend() { + return NotSupported("Cannot create a fast append for a static table"); +} + +Result> StaticTable::NewSnapshotManager() { + return NotSupported("Cannot create a snapshot manager for a static table"); +} + } // namespace iceberg diff --git a/src/iceberg/table.h b/src/iceberg/table.h index 8d8849f37..a5e102686 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -212,7 +212,7 @@ class ICEBERG_EXPORT StagedTable final : public Table { /// \brief A read-only table. -class ICEBERG_EXPORT StaticTable final : public Table { +class ICEBERG_EXPORT StaticTable : public Table { public: static Result> Make( TableIdentifier identifier, std::shared_ptr metadata, @@ -228,6 +228,23 @@ class ICEBERG_EXPORT StaticTable final : public Table { Result> NewUpdateSchema() override; + Result> NewUpdateLocation() override; + + Result> NewUpdatePartitionSpec() override; + + Result> NewUpdateSortOrder() override; + + Result> NewExpireSnapshots() override; + + Result> NewUpdateStatistics() override; + + Result> NewUpdatePartitionStatistics() + override; + + Result> NewFastAppend() override; + + Result> NewSnapshotManager() override; + private: using Table::Table; }; diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 0e8f03150..9dd3d238e 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -89,6 +89,7 @@ add_iceberg_test(schema_test add_iceberg_test(table_test SOURCES location_provider_test.cc + metadata_table_test.cc metrics_config_test.cc metrics_reporter_test.cc metrics_test.cc diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 03d9e1f6c..c2093ed14 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -48,6 +48,7 @@ iceberg_tests = { 'table_test': { 'sources': files( 'location_provider_test.cc', + 'metadata_table_test.cc', 'metrics_config_test.cc', 'metrics_reporter_test.cc', 'metrics_test.cc', diff --git a/src/iceberg/test/metadata_table_test.cc b/src/iceberg/test/metadata_table_test.cc new file mode 100644 index 000000000..1e0a664c3 --- /dev/null +++ b/src/iceberg/test/metadata_table_test.cc @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/inspect/metadata_table.h" + +#include +#include + +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/table.h" +#include "iceberg/table_identifier.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/mock_catalog.h" +#include "iceberg/test/mock_io.h" +#include "iceberg/type.h" + +namespace iceberg { +namespace { + +std::shared_ptr MakeSnapshotsSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "committed_at", timestamp_tz()), + SchemaField::MakeRequired(2, "snapshot_id", int64()), + SchemaField::MakeOptional(3, "parent_id", int64()), + SchemaField::MakeOptional(4, "operation", string()), + SchemaField::MakeOptional(5, "manifest_list", string()), + SchemaField::MakeOptional( + 6, "summary", + std::make_shared(SchemaField::MakeRequired(7, "key", string()), + SchemaField::MakeRequired(8, "value", string())))}); +} + +std::shared_ptr MakeHistorySchema() { + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "made_current_at", timestamp_tz()), + SchemaField::MakeRequired(2, "snapshot_id", int64()), + SchemaField::MakeOptional(3, "parent_id", int64()), + SchemaField::MakeRequired(4, "is_current_ancestor", boolean())}); +} + +} // namespace + +class MetadataTableTest : public ::testing::Test { + protected: + void SetUp() override { + io_ = std::make_shared(); + catalog_ = std::make_shared(); + + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int64()), + SchemaField::MakeOptional(2, "name", string())}, + 1); + metadata_ = std::make_shared( + TableMetadata{.format_version = 2, .schemas = {schema}, .current_schema_id = 1}); + + TableIdentifier source_ident{.ns = Namespace{.levels = {"db"}}, + .name = "source_table"}; + auto source_table_result = + Table::Make(source_ident, metadata_, "s3://bucket/meta.json", io_, catalog_); + EXPECT_THAT(source_table_result, IsOk()); + source_table_ = *source_table_result; + + auto snapshots_table_result = + MetadataTable::Make(source_table_, MetadataTable::Kind::kSnapshots); + EXPECT_THAT(snapshots_table_result, IsOk()); + snapshots_table_ = std::move(*snapshots_table_result); + } + + std::shared_ptr io_; + std::shared_ptr catalog_; + std::shared_ptr metadata_; + std::shared_ptr
source_table_; + std::unique_ptr snapshots_table_; +}; + +TEST_F(MetadataTableTest, Constructor) { + EXPECT_EQ(snapshots_table_->kind(), MetadataTable::Kind::kSnapshots); + EXPECT_EQ(snapshots_table_->source_table(), source_table_); + EXPECT_EQ(snapshots_table_->name().name, "source_table.snapshots"); + EXPECT_EQ(snapshots_table_->name().ns.levels, (std::vector{"db"})); + EXPECT_NE(snapshots_table_->schema(), nullptr); +} + +TEST_F(MetadataTableTest, SnapshotsSchemaMatchesIcebergSchema) { + EXPECT_TRUE(*snapshots_table_->schema() == *MakeSnapshotsSchema()); +} + +TEST_F(MetadataTableTest, HistorySchemaMatchesIcebergSchema) { + auto history_table_result = + MetadataTable::Make(source_table_, MetadataTable::Kind::kHistory); + ASSERT_THAT(history_table_result, IsOk()); + + EXPECT_TRUE(*(*history_table_result)->schema() == *MakeHistorySchema()); +} + +TEST_F(MetadataTableTest, FactoryRejectsNullSourceTable) { + auto result = MetadataTable::Make(nullptr, MetadataTable::Kind::kSnapshots); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Table cannot be null")); +} + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index 0ad8e8ced..9cfe9063e 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -147,4 +147,20 @@ TYPED_TEST(TypedTableTest, NewTransaction) { } } +TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) { + auto io = std::make_shared(); + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "id", int64())}, 1); + auto metadata = std::make_shared( + TableMetadata{.format_version = 2, .schemas = {schema}, .current_schema_id = 1}); + TableIdentifier ident{.ns = Namespace{.levels = {"db"}}, .name = "test_table"}; + ICEBERG_UNWRAP_OR_FAIL(auto table, StaticTable::Make(ident, std::move(metadata), + "s3://bucket/meta.json", io)); + + EXPECT_THAT(table->NewUpdateStatistics(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewUpdatePartitionStatistics(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewFastAppend(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported)); +} + } // namespace iceberg diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 745c63acb..6b4160037 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -240,6 +240,11 @@ class UpdateStatistics; class DeleteLoader; class PositionDeleteIndex; +/// \brief Metadata tables. +class HistoryTable; +class MetadataTable; +class SnapshotsTable; + /// ---------------------------------------------------------------------------- /// TODO: Forward declarations below are not added yet. /// ---------------------------------------------------------------------------- From 8d576ed93afccf5a7334d01f814ce56c5acc4273 Mon Sep 17 00:00:00 2001 From: Xinli Shang Date: Mon, 15 Jun 2026 02:36:23 -0700 Subject: [PATCH 086/151] refactor: harden FileCleanupStrategy with retry and parallel deletes (#649) ### What * `FileCleanupStrategy` now takes an `OptionalExecutor` in its constructor. When `DeleteWith()` is configured, per-path deletes fan out through `TaskGroup<>` -- uses the supplied executor when set, otherwise runs the callbacks serially on the calling thread via `RunTasksSingleThreaded`. Preserves prior single-threaded behavior by default. * The `FileIO::DeleteFiles` bulk path is wrapped in `RetryRunner>` with a tight budget (2 retries, 100ms-1s backoff, 5s total). Mirrors Java's `Tasks.foreach(...).stopRetryOn(NotFoundException.class).retry(N)`. The retry primarily helps atomic-bulk FileIO impls (e.g. an S3 `DeleteObjects`-backed FileIO) ride out transient throttles -- best-effort, see code comment for the fail-fast-iterative caveat. * New public builder `ExpireSnapshots::ExecuteDeleteWith(OptionalExecutor)` (named after Java's `executeDeleteWith(ExecutorService)`) so callers opt in to parallel deletion; threaded through both `IncrementalFileCleanup` and `ReachableFileCleanup`. * `DeleteWith()` doc note clarifies that the user-supplied callback may be invoked concurrently from worker threads and must be thread-safe. * Drops the `std::async` / `std::thread` / `std::span` machinery and the ad-hoc retry loop -- replaced by `util/task_group.h` and `util/retry_util.h` from #687. ### Test coverage Existing 25 `ExpireSnapshots*` tests continue to pass unchanged (they hit the default no-executor path). Adds `ExpireSnapshotsCleanupTest.ExecutorDispatchesDeletesConcurrently` -- wires a `test::ThreadExecutor` through `ExecuteDeleteWith()`, runs an `ExpireSnapshotId` cleanup with a custom `DeleteWith` callback, and asserts the executor received one submission per file (data + manifest + manifest-list = 3) and that all paths show up in the mutex-guarded sink. --- src/iceberg/test/expire_snapshots_test.cc | 114 ++++++++++++++++++++++ src/iceberg/update/expire_snapshots.cc | 71 +++++++++++--- src/iceberg/update/expire_snapshots.h | 13 +++ 3 files changed, 182 insertions(+), 16 deletions(-) diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index 274a8cb44..91a49bbbd 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -19,8 +19,12 @@ #include "iceberg/update/expire_snapshots.h" +#include +#include #include +#include #include +#include #include #include @@ -33,6 +37,7 @@ #include "iceberg/snapshot.h" #include "iceberg/statistics_file.h" #include "iceberg/table_metadata.h" +#include "iceberg/test/executor.h" #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" @@ -444,6 +449,115 @@ TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredFiles) { expired_manifest_list_path)); } +TEST_F(ExpireSnapshotsCleanupTest, ExecutorDispatchesDeletesConcurrently) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + test::ThreadExecutor executor; + std::mutex deleted_files_mu; + std::vector deleted_files; + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->ExecuteDeleteWith(std::ref(executor)); + update->DeleteWith([&deleted_files, &deleted_files_mu](const std::string& path) { + std::lock_guard lock(deleted_files_mu); + deleted_files.push_back(path); + }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, + expired_manifest_list_path)); + EXPECT_EQ(executor.submit_count(), 3); +} + +TEST_F(ExpireSnapshotsCleanupTest, ExecuteDeleteWithWithoutDeleteWithDoesNotUseExecutor) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + test::ThreadExecutor executor(ServiceUnavailable("executor should be unused")); + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->ExecuteDeleteWith(std::ref(executor)); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_EQ(executor.submit_count(), 0); +} + +TEST_F(ExpireSnapshotsCleanupTest, DeleteWithRetriesTransientFailures) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + std::unordered_map attempts_by_path; + std::vector deleted_files; + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->DeleteWith([&attempts_by_path, &deleted_files](const std::string& path) { + auto& attempts = attempts_by_path[path]; + ++attempts; + if (attempts == 1) { + throw std::runtime_error("transient delete failure"); + } + deleted_files.push_back(path); + }); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, + expired_data_manifest_path, + expired_manifest_list_path)); + EXPECT_EQ(attempts_by_path[expired_data_file_path], 2); + EXPECT_EQ(attempts_by_path[expired_data_manifest_path], 2); + EXPECT_EQ(attempts_by_path[expired_manifest_list_path], 2); +} + TEST_F(ExpireSnapshotsCleanupTest, MetadataOnlySkipsDataDeletion) { const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; const auto expired_delete_manifest_path = diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index 7c056fab2..4de2c50b5 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -41,8 +42,10 @@ #include "iceberg/transaction.h" #include "iceberg/util/error_collector.h" #include "iceberg/util/macros.h" +#include "iceberg/util/retry_util.h" #include "iceberg/util/snapshot_util_internal.h" #include "iceberg/util/string_util.h" +#include "iceberg/util/task_group.h" namespace iceberg { @@ -61,8 +64,11 @@ Result> MakeManifestReader( class FileCleanupStrategy { public: FileCleanupStrategy(std::shared_ptr file_io, - std::function delete_func) - : file_io_(std::move(file_io)), delete_func_(std::move(delete_func)) {} + std::function delete_func, + OptionalExecutor executor) + : file_io_(std::move(file_io)), + delete_func_(std::move(delete_func)), + executor_(std::move(executor)) {} virtual ~FileCleanupStrategy() = default; @@ -94,20 +100,36 @@ class FileCleanupStrategy { return expired; } - /// \brief Delete files at the given locations. + /// \brief Best-effort delete with bounded retry. void DeleteFiles(const std::unordered_set& paths) { - try { - if (delete_func_) { - for (const auto& path : paths) { + if (paths.empty()) return; + + if (!delete_func_) { + std::vector path_list(paths.begin(), paths.end()); + + TaskGroup> group(kDeleteRetryConfig); + group.Submit([this, paths = std::move(path_list)]() -> Status { + return file_io_->DeleteFiles(paths); + }); + std::ignore = std::move(group).Run(); + return; + } + + TaskGroup> group(kDeleteRetryConfig); + group.SetExecutor(executor_); + for (const auto& path : paths) { + group.Submit([this, path]() -> Status { + try { delete_func_(path); + return {}; + } catch (const std::exception& e) { + return IOError("Delete callback failed for {}: {}", path, e.what()); + } catch (...) { + return IOError("Delete callback failed for {}", path); } - } else { - std::vector path_list(paths.begin(), paths.end()); - std::ignore = file_io_->DeleteFiles(path_list); - } - } catch (...) { - // TODO(shangxinli): add retry + }); } + std::ignore = std::move(group).Run(); } bool HasAnyStatisticsFiles(const TableMetadata& metadata) const { @@ -149,6 +171,18 @@ class FileCleanupStrategy { std::shared_ptr file_io_; std::function delete_func_; + OptionalExecutor executor_; + + private: + /// Retry budget for the FileIO bulk `DeleteFiles` path. Tight on purpose: file + /// cleanup is best-effort and runs after a successful commit, so we'd rather give + /// up than block the caller for minutes on a flaky storage layer. + static constexpr RetryConfig kDeleteRetryConfig{ + .num_retries = 2, + .min_wait_ms = 100, + .max_wait_ms = 1000, + .total_timeout_ms = 5000, + }; }; /// \brief File cleanup strategy that determines safe deletions via full reachability. @@ -157,7 +191,7 @@ class FileCleanupStrategy { /// still referenced by retained snapshots, then deletes orphaned manifests, data /// files, and manifest lists. /// -/// TODO(shangxinli): Add multi-threaded manifest reading and file deletion support. +/// TODO(shangxinli): Add multi-threaded manifest reading support. class ReachableFileCleanup : public FileCleanupStrategy { public: using FileCleanupStrategy::FileCleanupStrategy; @@ -362,7 +396,7 @@ class ReachableFileCleanup : public FileCleanupStrategy { /// logically introduced by a snapshot whose changes are still present in the /// current state under a different id. /// -/// TODO(shangxinli): Add multi-threaded manifest reading and file deletion support. +/// TODO(shangxinli): Add multi-threaded manifest reading support. class IncrementalFileCleanup : public FileCleanupStrategy { public: using FileCleanupStrategy::FileCleanupStrategy; @@ -699,6 +733,11 @@ ExpireSnapshots& ExpireSnapshots::CleanExpiredMetadata(bool clean) { return *this; } +ExpireSnapshots& ExpireSnapshots::ExecuteDeleteWith(OptionalExecutor executor) { + executor_ = std::move(executor); + return *this; +} + Result> ExpireSnapshots::ComputeBranchSnapshotsToRetain( int64_t snapshot_id, TimePointMs expire_snapshot_older_than, int32_t min_snapshots_to_keep) const { @@ -930,11 +969,11 @@ Status ExpireSnapshots::Finalize(Result commit_result) { !HasNonMainSnapshots(metadata_after_expiration); if (can_use_incremental) { - return IncrementalFileCleanup(ctx_->table->io(), delete_func_) + return IncrementalFileCleanup(ctx_->table->io(), delete_func_, executor_) .CleanFiles(metadata_before_expiration, metadata_after_expiration, cleanup_level_); } - return ReachableFileCleanup(ctx_->table->io(), delete_func_) + return ReachableFileCleanup(ctx_->table->io(), delete_func_, executor_) .CleanFiles(metadata_before_expiration, metadata_after_expiration, cleanup_level_); } diff --git a/src/iceberg/update/expire_snapshots.h b/src/iceberg/update/expire_snapshots.h index a5b6e3b32..bb28b5a58 100644 --- a/src/iceberg/update/expire_snapshots.h +++ b/src/iceberg/update/expire_snapshots.h @@ -32,6 +32,7 @@ #include "iceberg/result.h" #include "iceberg/type_fwd.h" #include "iceberg/update/pending_update.h" +#include "iceberg/util/executor.h" #include "iceberg/util/timepoint.h" /// \file iceberg/update/expire_snapshots.h @@ -115,6 +116,8 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { /// If this method is not called, unnecessary manifests and data files will still be /// deleted. /// + /// \note With ExecuteDeleteWith(), callbacks may run concurrently. + /// /// \param delete_func A function that will be called to delete manifests and data files /// \return Reference to this for method chaining. ExpireSnapshots& DeleteWith(std::function delete_func); @@ -140,6 +143,15 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { /// \return Reference to this for method chaining. ExpireSnapshots& CleanExpiredMetadata(bool clean); + /// \brief Configure an executor for DeleteWith() callbacks. + /// + /// Only used with DeleteWith(). The caller must keep the executor alive until + /// Finalize() returns. + /// + /// \param executor An executor reference, or std::nullopt for serial deletion. + /// \return Reference to this for method chaining. + ExpireSnapshots& ExecuteDeleteWith(OptionalExecutor executor); + Kind kind() const final { return Kind::kExpireSnapshots; } bool IsRetryable() const override { return true; } @@ -184,6 +196,7 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { enum CleanupLevel cleanup_level_ { CleanupLevel::kAll }; bool clean_expired_metadata_{false}; bool specified_snapshot_id_{false}; + OptionalExecutor executor_; /// Cached result from Apply(), consumed by Finalize() and cleared after use. std::optional apply_result_; From cb79f2983575c1ea7f4526b1926a81ac0d7b5826 Mon Sep 17 00:00:00 2001 From: kamcheungting-db <91572897+kamcheungting-db@users.noreply.github.com> Date: Mon, 15 Jun 2026 19:02:04 -0700 Subject: [PATCH 087/151] feat(logging): add LogLevel severity enum (#722) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What First of PR that adds a logging system to iceberg-cpp. This PR adds LogLevel — the severity scale every later piece builds on — and nothing else. - enum class LogLevel { kTrace, kDebug, kInfo, kWarn, kError, kCritical, kFatal, kOff }, ordered most-to-least verbose so "should this log?" is a plain level >= threshold check. kOff is the max sentinel for disabling logging. - constexpr ToString(LogLevel) and a case-insensitive LogLevelFromString returning Result — same idiom as CounterUnit in metrics/counter.h. Header-only: this PR adds src/iceberg/logging/log_level.h, wires the new src/iceberg/logging/ directory into CMake, and adds log_level_test.cc (ToString/FromString round-trip, case-insensitivity, unknown-input error, ordering). ## Why iceberg-cpp has no logging today — only error-as-value Result. This stack introduces a pluggable logger; levels are the foundational vocabulary, landed on their own so the rest reviews cleanly. ## Testing compiled and run with clang++ -std=c++23 -stdlib=libc++ (clang 18). The logging module builds clean and a behavior driver passes (levels round-trip, macro formatting + source location, gate filtering, disabled-arg elision, never-throws fallback, FATAL emit-then-abort, compile-time stripping). Full ctest -R logging_test + the spdlog-ON build still want a C++23 toolchain with network (gtest/spdlog via FetchContent) in CI. --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/logging/CMakeLists.txt | 18 ++++++ src/iceberg/logging/log_level.h | 90 +++++++++++++++++++++++++++++ src/iceberg/logging/meson.build | 18 ++++++ src/iceberg/meson.build | 2 + src/iceberg/test/.meson.build.swp | Bin 0 -> 20480 bytes src/iceberg/test/CMakeLists.txt | 2 + src/iceberg/test/log_level_test.cc | 78 +++++++++++++++++++++++++ src/iceberg/test/meson.build | 1 + 9 files changed, 210 insertions(+) create mode 100644 src/iceberg/logging/CMakeLists.txt create mode 100644 src/iceberg/logging/log_level.h create mode 100644 src/iceberg/logging/meson.build create mode 100644 src/iceberg/test/.meson.build.swp create mode 100644 src/iceberg/test/log_level_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index ffa3f2f08..18615c202 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -243,6 +243,7 @@ add_subdirectory(update) add_subdirectory(util) add_subdirectory(inspect) add_subdirectory(metrics) +add_subdirectory(logging) if(ICEBERG_BUILD_BUNDLE) set(ICEBERG_BUNDLE_SOURCES diff --git a/src/iceberg/logging/CMakeLists.txt b/src/iceberg/logging/CMakeLists.txt new file mode 100644 index 000000000..75b869908 --- /dev/null +++ b/src/iceberg/logging/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +iceberg_install_all_headers(iceberg/logging) diff --git a/src/iceberg/logging/log_level.h b/src/iceberg/logging/log_level.h new file mode 100644 index 000000000..d06916af0 --- /dev/null +++ b/src/iceberg/logging/log_level.h @@ -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. + */ + +#pragma once + +/// \file iceberg/logging/log_level.h +/// \brief Severity levels for the logging system. + +#include +#include + +#include "iceberg/result.h" +#include "iceberg/util/string_util.h" + +namespace iceberg { + +/// \brief Logging severity level, ordered from most to least verbose. +/// +/// Levels are ordered so that `level >= threshold` is the enabled test. +/// `kOff` is the maximum sentinel: as a threshold it disables all emission +/// (it is never the level of an actual message). +enum class LogLevel { + kTrace, + kDebug, + kInfo, + kWarn, + kError, + kCritical, + kFatal, + kOff, +}; + +/// \brief String representation of a LogLevel. +constexpr std::string_view ToString(LogLevel level) noexcept { + switch (level) { + case LogLevel::kTrace: + return "trace"; + case LogLevel::kDebug: + return "debug"; + case LogLevel::kInfo: + return "info"; + case LogLevel::kWarn: + return "warn"; + case LogLevel::kError: + return "error"; + case LogLevel::kCritical: + return "critical"; + case LogLevel::kFatal: + return "fatal"; + case LogLevel::kOff: + return "off"; + } + std::unreachable(); +} + +/// \brief Parse a LogLevel from a string (case-insensitive). +/// +/// \param s The string to parse ("trace", "debug", "info", "warn", "error", +/// "critical", "fatal", or "off"). +/// \return The LogLevel, or an InvalidArgument error if unrecognized. +inline Result LogLevelFromString(std::string_view s) { + auto level = StringUtils::ToLower(s); + if (level == "trace") return LogLevel::kTrace; + if (level == "debug") return LogLevel::kDebug; + if (level == "info") return LogLevel::kInfo; + if (level == "warn") return LogLevel::kWarn; + if (level == "error") return LogLevel::kError; + if (level == "critical") return LogLevel::kCritical; + if (level == "fatal") return LogLevel::kFatal; + if (level == "off") return LogLevel::kOff; + return InvalidArgument("Invalid log level: {}", s); +} + +} // namespace iceberg diff --git a/src/iceberg/logging/meson.build b/src/iceberg/logging/meson.build new file mode 100644 index 000000000..3c286a196 --- /dev/null +++ b/src/iceberg/logging/meson.build @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +install_headers(['log_level.h'], subdir: 'iceberg/logging') diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 75fae754e..7a6ba4f8b 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -39,6 +39,8 @@ configure_file( install_dir: get_option('includedir') / 'iceberg', ) +subdir('logging') + iceberg_include_dir = include_directories('..') iceberg_sources = files( 'arrow_c_data_guard_internal.cc', diff --git a/src/iceberg/test/.meson.build.swp b/src/iceberg/test/.meson.build.swp new file mode 100644 index 0000000000000000000000000000000000000000..58638fe24ea751df85d651a182f4d1b25ae5c16e GIT binary patch literal 20480 zcmeI2Z-^Xc9mhwT#@HsUsMQw=K20LCYwz|hX{yOdqL=j29!c-Q?WHjd>GZjoXZN1m z?96nYncG}zDwSHqz9+|{pjI$TPwWf zE{im1))E;sDZ%iMjK+6Oj_;cs-?e*u@9-r0>I3}+PDocQiMToLM$v?d-OlfcM5tt< zB~%#HmQv|^BZ@S)i~>f1D^Va#8smGnSvT+AHA%^LY`>Ac?XAbJB&SJZ6fg=H1&jhl z0i%FXz$jo8Fbe#iD3C-~Ssz1R-kA62L;3d`2EI4tzpMH8^uYbA^4~}D@7BQm{HOUc z3K#{90!9I&fKk9GU=%P47zK<1MggOMQQ&`|0LRny1Dh>t;Z3L<&;L9A|FhRy)J2W?A0?_kjao6S%z9vi=O71J8n|z%lS)a3k0RUb)t?E`ra3 zPlLz7$3Y9!!TZ2w@Vjg9P69X&0&onBgKNR1H(S>C!RNsPKmi|o1RMZ2fXiDf>nGr= z;FG`ww}7qS_vrJF!IR)K;88$2+yU+a`#=rY;5zVE=yVZW0G|T)fN}8Z)t2=FcnUlS z?go3nCh!jgPF@2qfggY`fHqhJv)~|@05^cw5k&bF_%?V9#9$HJ0^Sb(jv&oN@HOyJ za2V_ae?ze5#ZJJ+Vm%*QB{5#zaMDEj4!u@Ub6tC^KS>;NohAyEOk@~1OEPKks5H4q z;)hC9cH#_Y5h(R$&^uLfKP{8lfuMa_nwdxPHIBbgrQHwig@HWqo z8g!DDNVx8)60s-BQt1-PQk1lGAkP)G7c<699JC4F$`PyFPk9oS4u33^^imArhAE>s zJR@8(Mpf3wC>EZC!Ip~9;(=^n9&cQmFJZIgmL&t%PnBF1Lweelm|Y2`ts>(uYwM^I zN|qXN79CWI7MWFv)uvq4o|GGxHOjVlvl)x#a79auW}xmXF&aN?I=)!d)~x^FLX#F= zYCILNt|~jvB8ru(n$MyUlPTd#SPRk!v!&ETvNR>CWjAASZz^Na5nB1r&tqvco@;tUye?JApKc3y&hZ#F;O z<$0%A5~m{Dkuxh#V|^T&V)WCYT{pWMrb(10Q_QBpqQe@F6t(4UX+!SSWPsb9QiVRI zRP=9MYz-%tiamR1=HSf2ZO-CMebHH%sm~u@I5bnY$5{4yubaj(79l4)XHZWox<}Y0 z@{>okC=uFpYRisv)cQ)*vYM^XUBQUS!0|+cWcZ6?mk8Xoie22ak#q-3aU*8QvS3G{ zTcAV@7s+a5L%PhzSvBQN!J6SJ&XuqL7Kyke^`@m54?O0}mP~X56mlM!ox6363GA3C zHQzZ{7&F<5d?~ydV|5{Vt7F(x={NFjpRTjn`gV43x;|SUV<%=8Z=XND$WBZzEKJWW z&d$`?`~o{PKX>cw;_Un!ejR4hb0?{}VIyhtSTIl0JYPx^;jQl&ld3O47@+;geLTQX zPO*Fw@YvECgR%QKcVKgY0&QwP$F_+=laR@PwPVb|pgCskKz7EKlO&p&m}s}#H6C%y z;#wFtCr|*%sV0tM(C6wiqk*eq+9ZVs-E24y&>V_md4_p!$t*1Q2kWcI8c1C`T-6>)^jW9Ho zRkA^$(?aagz*C!I*<4Oo*bb0zSw?93A}nXRei&wub+>2*D(oGPyxVAEJB(NKuyfDT ziy8OP)XcF!?Z^kgTOr01_MMFzb49{HSmgijfDhY*e@p)Vkvsg9ID}6<~p1BPQ@PcoN(T8sHv4F@yI4iW$6s zc)-J;4Jc0Ff*P>E(})Lr2|NT&f}6qX@c*9&kArhy2J8kq!8^cKuo+wpUPe6N36Owk zuoqkdEbuRAa|!$gJOdsBkAN7EZVg~QMggOMQNSo*6d0laj-%M`1rAI4Xitaiiau$R zvw`#DSvNcLXMf3g?4DtzP&mfZsT`M75nanq$Wu&vM(R}8-8fyODXP%bq8glz#aZE| z+BL0M*=2+%8~Q)gTU3Rlr*hYVsy@wbD(+?Zd?hx>M)Av`d1WJScMYCR#l~??dkydm z8XU!DI&^zYO(_oYof5N-X9e`ig+fl9u3EX^S)((Zvm9)Sb^1j$D9fTCZKgo+A8FD5 zi>{or=x^_*CtTBe+3su6R3RmN8$Fag!_=E^Ab#3=O9x&jJUBb>+v%ViLN)Tg*E^`| zv$-wrO491qAp*%MK1IRxX67)K_|%{j+gVOqr$)+NXMA|Ksx=XiJLSPYr7HRjso#i(7|@2sGsbvZ zIm%ms9mJSAn4ZO~rwZw_ZcuClEmrq9Jf-+9WFos6u(!b^eFIc7I8bD;HMIu09C_!9 z?hbTy!)^|AYM`yUk6Ql`L8v0pz{7yylO{7${m7;CnT{?JBN~M;v#yXs^w&Zo8i#MggOM zQNSo*6fg=H1&jj!9R=u!-uV=79d@qJcX5^8MJ&IQ`=z}J*8ksMSe|9zq;6hpw9Si+ Y=EcT*^5_|3UTickHtN?eyHS*X1Nv>_5C8xG literal 0 HcmV?d00001 diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 9dd3d238e..0a7db5ed2 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -102,6 +102,8 @@ add_iceberg_test(table_test table_test.cc table_update_test.cc) +add_iceberg_test(logging_test SOURCES log_level_test.cc) + add_iceberg_test(expression_test SOURCES aggregate_test.cc diff --git a/src/iceberg/test/log_level_test.cc b/src/iceberg/test/log_level_test.cc new file mode 100644 index 000000000..e4c25bf67 --- /dev/null +++ b/src/iceberg/test/log_level_test.cc @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/logging/log_level.h" + +#include +#include + +#include + +namespace iceberg { + +namespace { + +constexpr std::array kAllLevels = { + LogLevel::kTrace, LogLevel::kDebug, LogLevel::kInfo, LogLevel::kWarn, + LogLevel::kError, LogLevel::kCritical, LogLevel::kFatal, LogLevel::kOff}; + +} // namespace + +TEST(LogLevelTest, ToStringCoversEveryLevel) { + EXPECT_EQ(ToString(LogLevel::kTrace), "trace"); + EXPECT_EQ(ToString(LogLevel::kDebug), "debug"); + EXPECT_EQ(ToString(LogLevel::kInfo), "info"); + EXPECT_EQ(ToString(LogLevel::kWarn), "warn"); + EXPECT_EQ(ToString(LogLevel::kError), "error"); + EXPECT_EQ(ToString(LogLevel::kCritical), "critical"); + EXPECT_EQ(ToString(LogLevel::kFatal), "fatal"); + EXPECT_EQ(ToString(LogLevel::kOff), "off"); +} + +TEST(LogLevelTest, FromStringRoundTrips) { + for (LogLevel level : kAllLevels) { + auto parsed = LogLevelFromString(ToString(level)); + ASSERT_TRUE(parsed.has_value()) << "failed to parse " << ToString(level); + EXPECT_EQ(parsed.value(), level); + } +} + +TEST(LogLevelTest, FromStringIsCaseInsensitive) { + EXPECT_EQ(LogLevelFromString("WARN").value(), LogLevel::kWarn); + EXPECT_EQ(LogLevelFromString("Warn").value(), LogLevel::kWarn); + EXPECT_EQ(LogLevelFromString("CRITICAL").value(), LogLevel::kCritical); +} + +TEST(LogLevelTest, FromStringRejectsUnknown) { + auto parsed = LogLevelFromString("verbose"); + ASSERT_FALSE(parsed.has_value()); + EXPECT_EQ(parsed.error().kind, ErrorKind::kInvalidArgument); +} + +TEST(LogLevelTest, OrderingIsMonotonicWithOffAsMaximum) { + EXPECT_LT(LogLevel::kTrace, LogLevel::kDebug); + EXPECT_LT(LogLevel::kDebug, LogLevel::kInfo); + EXPECT_LT(LogLevel::kInfo, LogLevel::kWarn); + EXPECT_LT(LogLevel::kWarn, LogLevel::kError); + EXPECT_LT(LogLevel::kError, LogLevel::kCritical); + EXPECT_LT(LogLevel::kCritical, LogLevel::kFatal); + EXPECT_LT(LogLevel::kFatal, LogLevel::kOff); +} + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index c2093ed14..a76a15553 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -61,6 +61,7 @@ iceberg_tests = { 'table_update_test.cc', ), }, + 'logging_test': {'sources': files('log_level_test.cc')}, 'expression_test': { 'sources': files( 'aggregate_test.cc', From bb83edec9cb766be750e2191ec5cc8152cb44314 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Tue, 16 Jun 2026 13:13:18 +0800 Subject: [PATCH 088/151] feat: Collect Parquet NaN metrics during writes (#727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Collects NaN value counts for float and double columns during Parquet writes, since the Parquet footer statistics do not track NaN counts. ## Changes - **Write-side NaN metric collection** (`FieldMetricsCollector`): A visitor that walks each record batch before writing, accumulating value counts, null counts, NaN counts, and NaN-excluding lower/upper bounds for float/double fields. - **MetricsConfig-aware skipping**: Fields whose `MetricsMode` is `kNone` are skipped entirely, avoiding wasted work. - **Integration with existing footer metrics**: Write-side `FieldMetrics` take precedence over footer statistics in `ParquetMetrics::GetMetrics`, so NaN counts are populated while counts/bounds still fall back to footer stats when write-side data isn't available. - **Tests**: `ParquetMetricsTest` now overrides `ReportsNanCounts()` to `true`, and existing NaN test cases verify NaN counts alongside existing value/null count assertions. ## Behavior alignment with Java - Fields nested inside lists/maps do not get NaN metrics (both Java and C++ agree — Java collects then discards; C++ skips collection entirely). - NaN values are excluded from lower/upper bounds in both implementations. - Float/double fields with all-NaN values correctly set `nan_value_count` without setting bounds. --- src/iceberg/parquet/parquet_writer.cc | 157 ++++++++++++++++++++++- src/iceberg/test/metrics_test_base.cc | 20 +-- src/iceberg/test/metrics_test_base.h | 3 + src/iceberg/test/parquet_metrics_test.cc | 1 + 4 files changed, 171 insertions(+), 10 deletions(-) diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index da794cc3e..c50fb26b1 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -19,10 +19,16 @@ #include "iceberg/parquet/parquet_writer.h" +#include +#include #include +#include #include +#include +#include #include +#include #include #include #include @@ -36,7 +42,9 @@ #include "iceberg/arrow/arrow_status_internal.h" #include "iceberg/parquet/parquet_metrics_internal.h" #include "iceberg/schema_internal.h" +#include "iceberg/type.h" #include "iceberg/util/macros.h" +#include "iceberg/util/visit_type.h" namespace iceberg::parquet { @@ -74,6 +82,144 @@ Status CheckCompressionAvailable(std::string_view compression_name, return {}; } +template +Status UpdateFloatingFieldMetrics(int32_t field_id, const ::arrow::Array& arrow_array, + const std::vector* valid_rows, + std::unordered_map& metrics) { + constexpr auto expected_type_id = + std::is_same_v ? ::arrow::Type::FLOAT : ::arrow::Type::DOUBLE; + ICEBERG_PRECHECK(arrow_array.type_id() == expected_type_id, + "Expected Arrow floating-point array for field metrics collection"); + const auto& array = static_cast(arrow_array); + auto& field_metrics = metrics[field_id]; + field_metrics.field_id = field_id; + if (field_metrics.value_count < 0) { + field_metrics.value_count = 0; + } + if (field_metrics.null_value_count < 0) { + field_metrics.null_value_count = 0; + } + if (field_metrics.nan_value_count < 0) { + field_metrics.nan_value_count = 0; + } + + field_metrics.value_count += array.length(); + + for (int64_t i = 0; i < array.length(); ++i) { + if ((valid_rows != nullptr && (*valid_rows)[i] == 0) || array.IsNull(i)) { + ++field_metrics.null_value_count; + continue; + } + + ValueType value = array.Value(i); + if (std::isnan(value)) { + ++field_metrics.nan_value_count; + continue; + } + + auto literal = [&]() { + if constexpr (std::is_same_v) { + return Literal::Float(value); + } else { + return Literal::Double(value); + } + }(); + if (!field_metrics.lower_bound.has_value() || + literal < field_metrics.lower_bound.value()) { + field_metrics.lower_bound = literal; + } + if (!field_metrics.upper_bound.has_value() || + literal > field_metrics.upper_bound.value()) { + field_metrics.upper_bound = std::move(literal); + } + } + + return {}; +} + +std::optional> BuildValidRows(const ::arrow::Array& array, + const std::vector* parent) { + if (parent == nullptr && array.null_count() == 0) { + return std::nullopt; + } + + std::vector valid_rows(array.length(), 1); + for (int64_t i = 0; i < array.length(); ++i) { + if ((parent != nullptr && (*parent)[i] == 0) || array.IsNull(i)) { + valid_rows[i] = 0; + } + } + return valid_rows; +} + +class FieldMetricsCollector { + public: + FieldMetricsCollector(std::unordered_map& metrics, + const MetricsConfig& metrics_config, const Schema& schema) + : metrics_(metrics), metrics_config_(metrics_config), schema_(schema) {} + + Status VisitStruct(const StructType& type, const ::arrow::Array& array) { + ICEBERG_PRECHECK(array.type_id() == ::arrow::Type::STRUCT, + "Expected Arrow struct array for Iceberg struct metrics collection"); + const auto& struct_array = static_cast(array); + ICEBERG_PRECHECK( + struct_array.num_fields() == type.fields().size(), + "Arrow struct field count does not match Iceberg struct field count"); + + for (int i = 0; i < struct_array.num_fields(); ++i) { + ICEBERG_RETURN_UNEXPECTED(VisitField(type.fields()[i], *struct_array.field(i))); + } + return {}; + } + + Status VisitList(const ListType& /*type*/, const ::arrow::Array& /*array*/) { + return {}; + } + + Status VisitMap(const MapType& /*type*/, const ::arrow::Array& /*array*/) { return {}; } + + Status VisitPrimitive(const PrimitiveType& type, const ::arrow::Array& array) { + switch (type.type_id()) { + case TypeId::kFloat: + return UpdateFloatingFieldMetrics<::arrow::FloatArray, float>( + field_id_, array, valid_rows_, metrics_); + case TypeId::kDouble: + return UpdateFloatingFieldMetrics<::arrow::DoubleArray, double>( + field_id_, array, valid_rows_, metrics_); + default: + return {}; + } + } + + private: + Status VisitField(const SchemaField& field, const ::arrow::Array& array) { + // Skip metrics collection for fields whose mode is kNone in MetricsConfig. + ICEBERG_ASSIGN_OR_RAISE(auto column_name, + schema_.FindColumnNameById(field.field_id())); + if (column_name.has_value() && metrics_config_.ColumnMode(column_name.value()).kind == + MetricsMode::Kind::kNone) { + return {}; + } + + auto previous_valid_rows = valid_rows_; + auto field_valid_rows = BuildValidRows(array, previous_valid_rows); + if (field_valid_rows.has_value()) { + valid_rows_ = &field_valid_rows.value(); + } + + field_id_ = field.field_id(); + auto status = VisitTypeCategory(*field.type(), this, array); + valid_rows_ = previous_valid_rows; + return status; + } + + std::unordered_map& metrics_; + const MetricsConfig& metrics_config_; + const Schema& schema_; + const std::vector* valid_rows_ = nullptr; + int32_t field_id_ = -1; +}; + Result> ParseCodecLevel(const WriterProperties& properties) { auto level_str = properties.Get(WriterProperties::kParquetCompressionLevel); if (level_str.empty()) { @@ -136,6 +282,12 @@ class ParquetWriter::Impl { ICEBERG_ARROW_ASSIGN_OR_RETURN(auto batch, ::arrow::ImportRecordBatch(array, arrow_schema_)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto struct_array, batch->ToStructArray()); + FieldMetricsCollector field_metrics_collector(field_metrics_, *metrics_config_, + *schema_); + ICEBERG_RETURN_UNEXPECTED( + field_metrics_collector.VisitStruct(*schema_, *struct_array)); + ICEBERG_ARROW_RETURN_NOT_OK(writer_->WriteRecordBatch(*batch)); return {}; @@ -179,9 +331,8 @@ class ParquetWriter::Impl { ICEBERG_PRECHECK(writer_ == nullptr, "Cannot return metrics for unclosed writer"); ICEBERG_PRECHECK(metadata_ != nullptr, "Cannot return metrics because Parquet metadata is not available"); - // TODO(WZhuo): collect write-side FieldMetrics to support NaN value counts. return ParquetMetrics::GetMetrics(*schema_, *parquet_schema_, *metrics_config_, - *metadata_); + *metadata_, field_metrics_); } private: @@ -205,6 +356,8 @@ class ParquetWriter::Impl { int64_t total_bytes_{0}; // Row group start offsets in the Parquet file. std::vector split_offsets_; + // Write-side metrics for fields whose Parquet footer metrics are incomplete. + std::unordered_map field_metrics_; }; ParquetWriter::~ParquetWriter() = default; diff --git a/src/iceberg/test/metrics_test_base.cc b/src/iceberg/test/metrics_test_base.cc index 7913a7207..92e89e8e4 100644 --- a/src/iceberg/test/metrics_test_base.cc +++ b/src/iceberg/test/metrics_test_base.cc @@ -541,8 +541,9 @@ void MetricsTestBase::MetricsForNaNColumns() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 2); - AssertCounts(1, 2, 0, metrics); - AssertCounts(2, 2, 0, metrics); + auto expected_nan_count = ReportsNanCounts() ? std::optional(2) : std::nullopt; + AssertCounts(1, 2, 0, expected_nan_count, metrics); + AssertCounts(2, 2, 0, expected_nan_count, metrics); // When all values are NaN, bounds should not be set AssertBounds(1, float32(), std::nullopt, std::nullopt, metrics); @@ -579,8 +580,9 @@ void MetricsTestBase::ColumnBoundsWithNaNValueAtFront() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 3); - AssertCounts(1, 3, 0, metrics); - AssertCounts(2, 3, 0, metrics); + auto expected_nan_count = ReportsNanCounts() ? std::optional(1) : std::nullopt; + AssertCounts(1, 3, 0, expected_nan_count, metrics); + AssertCounts(2, 3, 0, expected_nan_count, metrics); // Bounds should be computed from non-NaN values if (metrics.lower_bounds.contains(1)) { @@ -619,8 +621,9 @@ void MetricsTestBase::ColumnBoundsWithNaNValueInMiddle() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 3); - AssertCounts(1, 3, 0, metrics); - AssertCounts(2, 3, 0, metrics); + auto expected_nan_count = ReportsNanCounts() ? std::optional(1) : std::nullopt; + AssertCounts(1, 3, 0, expected_nan_count, metrics); + AssertCounts(2, 3, 0, expected_nan_count, metrics); if (metrics.lower_bounds.contains(1)) { AssertBounds(1, float32(), 1.2F, 5.6F, metrics); @@ -658,8 +661,9 @@ void MetricsTestBase::ColumnBoundsWithNaNValueAtEnd() { ASSERT_TRUE(metrics.row_count.has_value()) << "row_count should be set"; EXPECT_EQ(*metrics.row_count, 3); - AssertCounts(1, 3, 0, metrics); - AssertCounts(2, 3, 0, metrics); + auto expected_nan_count = ReportsNanCounts() ? std::optional(1) : std::nullopt; + AssertCounts(1, 3, 0, expected_nan_count, metrics); + AssertCounts(2, 3, 0, expected_nan_count, metrics); if (metrics.lower_bounds.contains(1)) { AssertBounds(1, float32(), 1.2F, 5.6F, metrics); diff --git a/src/iceberg/test/metrics_test_base.h b/src/iceberg/test/metrics_test_base.h index 07b3b62f3..530ef3b5e 100644 --- a/src/iceberg/test/metrics_test_base.h +++ b/src/iceberg/test/metrics_test_base.h @@ -60,6 +60,9 @@ class MetricsTestBase { /// \brief Whether the format supports small row groups for testing virtual bool SupportsSmallRowGroups() const { return false; } + /// \brief Whether the format reports NaN counts for floating-point fields + virtual bool ReportsNanCounts() const { return false; } + // Helper methods for assertions void AssertCounts(int field_id, std::optional expected_value_count, std::optional expected_null_count, const Metrics& metrics); diff --git a/src/iceberg/test/parquet_metrics_test.cc b/src/iceberg/test/parquet_metrics_test.cc index 8286efe08..6afe6f9c8 100644 --- a/src/iceberg/test/parquet_metrics_test.cc +++ b/src/iceberg/test/parquet_metrics_test.cc @@ -106,6 +106,7 @@ class ParquetMetricsTest : public MetricsTestBase, public ::testing::Test { } bool SupportsSmallRowGroups() const override { return true; } + bool ReportsNanCounts() const override { return true; } private: std::string temp_parquet_file_; From 796efb35dbb5036689d6bae91d18aaa5a8c4daf0 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Tue, 16 Jun 2026 13:13:48 +0800 Subject: [PATCH 089/151] fix: align rest table update serde with java/spec (#716) --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/catalog/rest/json_serde.cc | 28 ++++-- src/iceberg/encryption/CMakeLists.txt | 18 ++++ src/iceberg/encryption/encrypted_key.h | 43 +++++++++ src/iceberg/encryption/meson.build | 18 ++++ src/iceberg/json_serde.cc | 89 ++++++++++++++++- src/iceberg/json_serde_internal.h | 13 +++ src/iceberg/meson.build | 1 + src/iceberg/table_metadata.cc | 45 ++++++++- src/iceberg/table_metadata.h | 5 +- src/iceberg/table_update.cc | 44 +++++++++ src/iceberg/table_update.h | 45 +++++++++ src/iceberg/test/json_serde_test.cc | 96 +++++++++++++++++++ src/iceberg/test/metadata_serde_test.cc | 53 ++++++++++ src/iceberg/test/rest_json_serde_test.cc | 47 ++++++--- .../test/table_metadata_builder_test.cc | 34 +++++++ src/iceberg/type_fwd.h | 7 +- 17 files changed, 549 insertions(+), 38 deletions(-) create mode 100644 src/iceberg/encryption/CMakeLists.txt create mode 100644 src/iceberg/encryption/encrypted_key.h create mode 100644 src/iceberg/encryption/meson.build diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 18615c202..23e20dc59 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -235,6 +235,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/version.h" add_subdirectory(catalog) add_subdirectory(data) add_subdirectory(deletes) +add_subdirectory(encryption) add_subdirectory(expression) add_subdirectory(manifest) add_subdirectory(puffin) diff --git a/src/iceberg/catalog/rest/json_serde.cc b/src/iceberg/catalog/rest/json_serde.cc index 2eb0d19de..ac80e9f08 100644 --- a/src/iceberg/catalog/rest/json_serde.cc +++ b/src/iceberg/catalog/rest/json_serde.cc @@ -902,17 +902,29 @@ Result CommitTableRequestFromJson(const nlohmann::json& json } ICEBERG_ASSIGN_OR_RAISE(auto requirements_json, - GetJsonValue(json, kRequirements)); - for (const auto& req_json : requirements_json) { - ICEBERG_ASSIGN_OR_RAISE(auto requirement, TableRequirementFromJson(req_json)); - request.requirements.push_back(std::move(requirement)); + GetJsonValueOptional(json, kRequirements)); + if (requirements_json.has_value()) { + if (!requirements_json->is_array()) { + return JsonParseError("Expected '{}' to be an array, got {}", kRequirements, + SafeDumpJson(*requirements_json)); + } + for (const auto& req_json : *requirements_json) { + ICEBERG_ASSIGN_OR_RAISE(auto requirement, TableRequirementFromJson(req_json)); + request.requirements.push_back(std::move(requirement)); + } } ICEBERG_ASSIGN_OR_RAISE(auto updates_json, - GetJsonValue(json, kUpdates)); - for (const auto& update_json : updates_json) { - ICEBERG_ASSIGN_OR_RAISE(auto update, TableUpdateFromJson(update_json)); - request.updates.push_back(std::move(update)); + GetJsonValueOptional(json, kUpdates)); + if (updates_json.has_value()) { + if (!updates_json->is_array()) { + return JsonParseError("Expected '{}' to be an array, got {}", kUpdates, + SafeDumpJson(*updates_json)); + } + for (const auto& update_json : *updates_json) { + ICEBERG_ASSIGN_OR_RAISE(auto update, TableUpdateFromJson(update_json)); + request.updates.push_back(std::move(update)); + } } ICEBERG_RETURN_UNEXPECTED(request.Validate()); diff --git a/src/iceberg/encryption/CMakeLists.txt b/src/iceberg/encryption/CMakeLists.txt new file mode 100644 index 000000000..c493ee250 --- /dev/null +++ b/src/iceberg/encryption/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +iceberg_install_all_headers(iceberg/encryption) diff --git a/src/iceberg/encryption/encrypted_key.h b/src/iceberg/encryption/encrypted_key.h new file mode 100644 index 000000000..b65255bf5 --- /dev/null +++ b/src/iceberg/encryption/encrypted_key.h @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/encryption/encrypted_key.h +/// Encrypted table key metadata. + +#include +#include +#include + +#include "iceberg/iceberg_export.h" + +namespace iceberg { + +/// \brief Represents an encrypted table key entry. +struct ICEBERG_EXPORT EncryptedKey { + std::string key_id; + std::string encrypted_key_metadata; + std::optional encrypted_by_id = std::nullopt; + std::unordered_map properties; + + friend bool operator==(const EncryptedKey&, const EncryptedKey&) = default; +}; + +} // namespace iceberg diff --git a/src/iceberg/encryption/meson.build b/src/iceberg/encryption/meson.build new file mode 100644 index 000000000..ad6e142c2 --- /dev/null +++ b/src/iceberg/encryption/meson.build @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +install_headers(['encrypted_key.h'], subdir: 'iceberg/encryption') diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index c72b7da57..1f2b8f45c 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -43,6 +43,7 @@ #include "iceberg/table_update.h" #include "iceberg/transform.h" #include "iceberg/type.h" +#include "iceberg/util/base64.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep #include "iceberg/util/json_util_internal.h" @@ -90,6 +91,8 @@ constexpr std::string_view kValueId = "value-id"; constexpr std::string_view kRequired = "required"; constexpr std::string_view kElementRequired = "element-required"; constexpr std::string_view kValueRequired = "value-required"; +constexpr std::string_view kEncryptedKeyMetadata = "encrypted-key-metadata"; +constexpr std::string_view kEncryptedById = "encrypted-by-id"; // Snapshot constants constexpr std::string_view kSpecId = "spec-id"; @@ -166,6 +169,7 @@ constexpr std::string_view kRefs = "refs"; constexpr std::string_view kStatistics = "statistics"; constexpr std::string_view kPartitionStatistics = "partition-statistics"; constexpr std::string_view kNextRowId = "next-row-id"; +constexpr std::string_view kEncryptionKeys = "encryption-keys"; constexpr std::string_view kMetadataFile = "metadata-file"; constexpr std::string_view kStatisticsPath = "statistics-path"; constexpr std::string_view kFileSizeInBytes = "file-size-in-bytes"; @@ -196,6 +200,8 @@ constexpr std::string_view kActionRemoveStatistics = "remove-statistics"; constexpr std::string_view kActionSetPartitionStatistics = "set-partition-statistics"; constexpr std::string_view kActionRemovePartitionStatistics = "remove-partition-statistics"; +constexpr std::string_view kActionAddEncryptionKey = "add-encryption-key"; +constexpr std::string_view kActionRemoveEncryptionKey = "remove-encryption-key"; // TableUpdate field constants constexpr std::string_view kUUID = "uuid"; @@ -210,6 +216,9 @@ constexpr std::string_view kRefName = "ref-name"; constexpr std::string_view kRef = "ref"; constexpr std::string_view kUpdates = "updates"; constexpr std::string_view kRemovals = "removals"; +constexpr std::string_view kUpdated = "updated"; +constexpr std::string_view kRemoved = "removed"; +constexpr std::string_view kEncryptionKey = "encryption-key"; // TableRequirement type constants constexpr std::string_view kRequirementAssertDoesNotExist = "assert-create"; @@ -851,6 +860,41 @@ Result MetadataLogEntryFromJson(const nlohmann::json& json) { return metadata_log_entry; } +nlohmann::json ToJson(const EncryptedKey& encrypted_key) { + nlohmann::json json; + json[kKeyId] = encrypted_key.key_id; + json[kEncryptedKeyMetadata] = Base64::Encode(encrypted_key.encrypted_key_metadata); + SetOptionalField(json, kEncryptedById, encrypted_key.encrypted_by_id); + if (!encrypted_key.properties.empty()) { + json[kProperties] = encrypted_key.properties; + } + return json; +} + +Result EncryptedKeyFromJson(const nlohmann::json& json) { + using StringMap = std::unordered_map; + + if (!json.is_object()) { + return JsonParseError("Invalid encryption key, must be non-null object: {}", + SafeDumpJson(json)); + } + + ICEBERG_ASSIGN_OR_RAISE(auto key_id, GetJsonValue(json, kKeyId)); + ICEBERG_ASSIGN_OR_RAISE(auto encoded_metadata, + GetJsonValue(json, kEncryptedKeyMetadata)); + ICEBERG_ASSIGN_OR_RAISE(auto encrypted_key_metadata, Base64::Decode(encoded_metadata)); + ICEBERG_ASSIGN_OR_RAISE(auto encrypted_by_id, + GetJsonValueOptional(json, kEncryptedById)); + ICEBERG_ASSIGN_OR_RAISE(auto properties, + GetJsonValueOrDefault(json, kProperties)); + return EncryptedKey{ + .key_id = std::move(key_id), + .encrypted_key_metadata = std::move(encrypted_key_metadata), + .encrypted_by_id = std::move(encrypted_by_id), + .properties = std::move(properties), + }; +} + nlohmann::json ToJson(const TableMetadata& table_metadata) { nlohmann::json json; @@ -917,6 +961,9 @@ nlohmann::json ToJson(const TableMetadata& table_metadata) { json[kSnapshots] = ToJsonList(table_metadata.snapshots); json[kStatistics] = ToJsonList(table_metadata.statistics); json[kPartitionStatistics] = ToJsonList(table_metadata.partition_statistics); + if (!table_metadata.encryption_keys.empty()) { + json[kEncryptionKeys] = ToJsonList(table_metadata.encryption_keys); + } json[kSnapshotLog] = ToJsonList(table_metadata.snapshot_log); json[kMetadataLog] = ToJsonList(table_metadata.metadata_log); @@ -1182,6 +1229,9 @@ Result> TableMetadataFromJson(const nlohmann::jso table_metadata->partition_statistics, FromJsonList(json, kPartitionStatistics, PartitionStatisticsFileFromJson)); + ICEBERG_ASSIGN_OR_RAISE( + table_metadata->encryption_keys, + FromJsonList(json, kEncryptionKeys, EncryptedKeyFromJson)); ICEBERG_ASSIGN_OR_RAISE( table_metadata->snapshot_log, FromJsonList(json, kSnapshotLog, SnapshotLogEntryFromJson)); @@ -1486,6 +1536,18 @@ nlohmann::json ToJson(const TableUpdate& update) { json[kSnapshotId] = u.snapshot_id(); break; } + case TableUpdate::Kind::kAddEncryptionKey: { + const auto& u = internal::checked_cast(update); + json[kAction] = kActionAddEncryptionKey; + json[kEncryptionKey] = ToJson(u.key()); + break; + } + case TableUpdate::Kind::kRemoveEncryptionKey: { + const auto& u = internal::checked_cast(update); + json[kAction] = kActionRemoveEncryptionKey; + json[kKeyId] = u.key_id(); + break; + } } return json; } @@ -1506,7 +1568,6 @@ nlohmann::json ToJson(const TableRequirement& requirement) { const auto& r = internal::checked_cast(requirement); json[kType] = kRequirementAssertRefSnapshotID; - // REST spec names this field "ref", not "ref-name". json[kRef] = r.ref_name(); if (r.snapshot_id().has_value()) { json[kSnapshotId] = r.snapshot_id().value(); @@ -1570,8 +1631,10 @@ Result> TableUpdateFromJson(const nlohmann::json& j ICEBERG_ASSIGN_OR_RAISE(auto schema_json, GetJsonValue(json, kSchema)); ICEBERG_ASSIGN_OR_RAISE(auto parsed_schema, SchemaFromJson(schema_json)); - ICEBERG_ASSIGN_OR_RAISE(auto last_column_id, - GetJsonValue(json, kLastColumnId)); + ICEBERG_ASSIGN_OR_RAISE(auto highest_field_id, parsed_schema->HighestFieldId()); + ICEBERG_ASSIGN_OR_RAISE( + auto last_column_id, + GetJsonValueOrDefault(json, kLastColumnId, highest_field_id)); return std::make_unique(std::move(parsed_schema), last_column_id); } if (action == kActionSetCurrentSchema) { @@ -1650,12 +1713,17 @@ Result> TableUpdateFromJson(const nlohmann::json& j } if (action == kActionSetProperties) { using StringMap = std::unordered_map; - ICEBERG_ASSIGN_OR_RAISE(auto updates, GetJsonValue(json, kUpdates)); + ICEBERG_ASSIGN_OR_RAISE(auto updates, + json.contains(kUpdates) || !json.contains(kUpdated) + ? GetJsonValue(json, kUpdates) + : GetJsonValue(json, kUpdated)); return std::make_unique(std::move(updates)); } if (action == kActionRemoveProperties) { ICEBERG_ASSIGN_OR_RAISE(auto removals_vec, - GetJsonValue>(json, kRemovals)); + json.contains(kRemovals) || !json.contains(kRemoved) + ? GetJsonValue>(json, kRemovals) + : GetJsonValue>(json, kRemoved)); std::unordered_set removals( std::make_move_iterator(removals_vec.begin()), std::make_move_iterator(removals_vec.end())); @@ -1688,6 +1756,17 @@ Result> TableUpdateFromJson(const nlohmann::json& j ICEBERG_ASSIGN_OR_RAISE(auto snapshot_id, GetJsonValue(json, kSnapshotId)); return std::make_unique(snapshot_id); } + if (action == kActionAddEncryptionKey) { + if (!json.contains(kEncryptionKey)) { + return JsonParseError("Invalid encryption key, must be non-null object: null"); + } + ICEBERG_ASSIGN_OR_RAISE(auto key, EncryptedKeyFromJson(json.at(kEncryptionKey))); + return std::make_unique(std::move(key)); + } + if (action == kActionRemoveEncryptionKey) { + ICEBERG_ASSIGN_OR_RAISE(auto key_id, GetJsonValue(json, kKeyId)); + return std::make_unique(std::move(key_id)); + } return JsonParseError("Unknown table update action: {}", action); } diff --git a/src/iceberg/json_serde_internal.h b/src/iceberg/json_serde_internal.h index 8699e3dd1..351b41086 100644 --- a/src/iceberg/json_serde_internal.h +++ b/src/iceberg/json_serde_internal.h @@ -28,6 +28,7 @@ #include +#include "iceberg/encryption/encrypted_key.h" #include "iceberg/result.h" #include "iceberg/statistics_file.h" #include "iceberg/table_metadata.h" @@ -283,6 +284,18 @@ ICEBERG_EXPORT nlohmann::json ToJson(const MetadataLogEntry& metadata_log_entry) ICEBERG_EXPORT Result MetadataLogEntryFromJson( const nlohmann::json& json); +/// \brief Serializes an `EncryptedKey` object to JSON. +/// +/// \param encrypted_key The `EncryptedKey` object to be serialized. +/// \return A JSON object representing the `EncryptedKey`. +ICEBERG_EXPORT nlohmann::json ToJson(const EncryptedKey& encrypted_key); + +/// \brief Deserializes a JSON object into an `EncryptedKey` object. +/// +/// \param json The JSON object representing an `EncryptedKey`. +/// \return An `EncryptedKey` object or an error if the conversion fails. +ICEBERG_EXPORT Result EncryptedKeyFromJson(const nlohmann::json& json); + /// \brief Serializes a `TableMetadata` object to JSON. /// /// \param table_metadata The `TableMetadata` object to be serialized. diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 7a6ba4f8b..d0e7d07c2 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -294,6 +294,7 @@ install_headers( subdir('catalog') subdir('data') subdir('deletes') +subdir('encryption') subdir('expression') subdir('manifest') subdir('metrics') diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index 30f99f259..88bde4d50 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -176,6 +176,10 @@ std::vector> ChangesForCreate( std::make_unique(metadata.properties.configs())); } + for (const auto& key : metadata.encryption_keys) { + changes.push_back(std::make_unique(key)); + } + return changes; } } // namespace @@ -353,7 +357,7 @@ bool operator==(const TableMetadata& lhs, const TableMetadata& rhs) { SnapshotRefEquals(lhs.refs, rhs.refs) && SharedPtrVectorEquals(lhs.statistics, rhs.statistics) && SharedPtrVectorEquals(lhs.partition_statistics, rhs.partition_statistics) && - lhs.next_row_id == rhs.next_row_id; + lhs.next_row_id == rhs.next_row_id && lhs.encryption_keys == rhs.encryption_keys; } // TableMetadataCache implementation @@ -579,6 +583,10 @@ class TableMetadataBuilder::Impl { snapshots_by_id_.emplace(snapshot->snapshot_id, snapshot); } + for (const auto& key : metadata_.encryption_keys) { + keys_by_id_.emplace(key.key_id); + } + metadata_.last_updated_ms = kInvalidLastUpdatedMs; } @@ -627,6 +635,8 @@ class TableMetadataBuilder::Impl { Status SetPartitionStatistics( std::shared_ptr partition_statistics_file); Status RemovePartitionStatistics(int64_t snapshot_id); + Status AddEncryptionKey(EncryptedKey key); + Status RemoveEncryptionKey(std::string_view key_id); Result> Build(); @@ -699,6 +709,7 @@ class TableMetadataBuilder::Impl { std::unordered_map> specs_by_id_; std::unordered_map> sort_orders_by_id_; std::unordered_map> snapshots_by_id_; + std::unordered_set keys_by_id_; }; Status TableMetadataBuilder::Impl::AssignUUID(std::string_view uuid) { @@ -1247,6 +1258,29 @@ Status TableMetadataBuilder::Impl::RemovePartitionStatistics(int64_t snapshot_id return {}; } +Status TableMetadataBuilder::Impl::AddEncryptionKey(EncryptedKey key) { + if (keys_by_id_.contains(key.key_id)) { + return {}; + } + + keys_by_id_.emplace(key.key_id); + changes_.push_back(std::make_unique(key)); + metadata_.encryption_keys.push_back(std::move(key)); + return {}; +} + +Status TableMetadataBuilder::Impl::RemoveEncryptionKey(std::string_view key_id) { + std::string key_id_str(key_id); + if (keys_by_id_.erase(key_id_str) == 0) { + return {}; + } + + std::erase_if(metadata_.encryption_keys, + [&key_id_str](const auto& key) { return key.key_id == key_id_str; }); + changes_.push_back(std::make_unique(std::move(key_id_str))); + return {}; +} + std::unordered_set TableMetadataBuilder::Impl::IntermediateSnapshotIdSet( int64_t current_snapshot_id) const { std::unordered_set added_snapshot_ids; @@ -1702,13 +1736,14 @@ TableMetadataBuilder& TableMetadataBuilder::SetLocation(std::string_view locatio return *this; } -TableMetadataBuilder& TableMetadataBuilder::AddEncryptionKey( - std::shared_ptr key) { - throw IcebergError(std::format("{} not implemented", __FUNCTION__)); +TableMetadataBuilder& TableMetadataBuilder::AddEncryptionKey(EncryptedKey key) { + ICEBERG_BUILDER_RETURN_IF_ERROR(impl_->AddEncryptionKey(std::move(key))); + return *this; } TableMetadataBuilder& TableMetadataBuilder::RemoveEncryptionKey(std::string_view key_id) { - throw IcebergError(std::format("{} not implemented", __FUNCTION__)); + ICEBERG_BUILDER_RETURN_IF_ERROR(impl_->RemoveEncryptionKey(key_id)); + return *this; } Result> TableMetadataBuilder::Build() { diff --git a/src/iceberg/table_metadata.h b/src/iceberg/table_metadata.h index 335fedadc..06d636ef5 100644 --- a/src/iceberg/table_metadata.h +++ b/src/iceberg/table_metadata.h @@ -28,6 +28,7 @@ #include #include +#include "iceberg/encryption/encrypted_key.h" #include "iceberg/iceberg_export.h" #include "iceberg/table_properties.h" #include "iceberg/type_fwd.h" @@ -129,6 +130,8 @@ struct ICEBERG_EXPORT TableMetadata { std::vector> partition_statistics; /// A `long` higher than all assigned row IDs int64_t next_row_id; + /// A list of encrypted table key entries + std::vector encryption_keys; static Result> Make( const iceberg::Schema& schema, const iceberg::PartitionSpec& spec, @@ -446,7 +449,7 @@ class ICEBERG_EXPORT TableMetadataBuilder : public ErrorCollector { /// /// \param key The encryption key to add /// \return Reference to this builder for method chaining - TableMetadataBuilder& AddEncryptionKey(std::shared_ptr key); + TableMetadataBuilder& AddEncryptionKey(EncryptedKey key); /// \brief Remove an encryption key from the table by key ID /// diff --git a/src/iceberg/table_update.cc b/src/iceberg/table_update.cc index 01612d765..505bb517c 100644 --- a/src/iceberg/table_update.cc +++ b/src/iceberg/table_update.cc @@ -565,4 +565,48 @@ std::unique_ptr RemovePartitionStatistics::Clone() const { return std::make_unique(snapshot_id_); } +// AddEncryptionKey + +void AddEncryptionKey::ApplyTo(TableMetadataBuilder& builder) const { + builder.AddEncryptionKey(key_); +} + +void AddEncryptionKey::GenerateRequirements(TableUpdateContext& context) const { + // AddEncryptionKey doesn't generate any requirements +} + +bool AddEncryptionKey::Equals(const TableUpdate& other) const { + if (other.kind() != Kind::kAddEncryptionKey) { + return false; + } + const auto& other_add = internal::checked_cast(other); + return key_ == other_add.key_; +} + +std::unique_ptr AddEncryptionKey::Clone() const { + return std::make_unique(key_); +} + +// RemoveEncryptionKey + +void RemoveEncryptionKey::ApplyTo(TableMetadataBuilder& builder) const { + builder.RemoveEncryptionKey(key_id_); +} + +void RemoveEncryptionKey::GenerateRequirements(TableUpdateContext& context) const { + // RemoveEncryptionKey doesn't generate any requirements +} + +bool RemoveEncryptionKey::Equals(const TableUpdate& other) const { + if (other.kind() != Kind::kRemoveEncryptionKey) { + return false; + } + const auto& other_remove = internal::checked_cast(other); + return key_id_ == other_remove.key_id_; +} + +std::unique_ptr RemoveEncryptionKey::Clone() const { + return std::make_unique(key_id_); +} + } // namespace iceberg::table diff --git a/src/iceberg/table_update.h b/src/iceberg/table_update.h index c75c3fa6a..837134e2b 100644 --- a/src/iceberg/table_update.h +++ b/src/iceberg/table_update.h @@ -29,6 +29,7 @@ #include #include +#include "iceberg/encryption/encrypted_key.h" #include "iceberg/iceberg_export.h" #include "iceberg/snapshot.h" #include "iceberg/type_fwd.h" @@ -63,6 +64,8 @@ class ICEBERG_EXPORT TableUpdate { kRemoveStatistics, kSetPartitionStatistics, kRemovePartitionStatistics, + kAddEncryptionKey, + kRemoveEncryptionKey, }; virtual ~TableUpdate(); @@ -608,6 +611,48 @@ class ICEBERG_EXPORT RemovePartitionStatistics : public TableUpdate { int64_t snapshot_id_; }; +/// \brief Represents adding an encryption key to the table. +class ICEBERG_EXPORT AddEncryptionKey : public TableUpdate { + public: + explicit AddEncryptionKey(EncryptedKey key) : key_(std::move(key)) {} + + const EncryptedKey& key() const { return key_; } + + void ApplyTo(TableMetadataBuilder& builder) const override; + + void GenerateRequirements(TableUpdateContext& context) const override; + + Kind kind() const override { return Kind::kAddEncryptionKey; } + + bool Equals(const TableUpdate& other) const override; + + std::unique_ptr Clone() const override; + + private: + EncryptedKey key_; +}; + +/// \brief Represents removing an encryption key from the table. +class ICEBERG_EXPORT RemoveEncryptionKey : public TableUpdate { + public: + explicit RemoveEncryptionKey(std::string key_id) : key_id_(std::move(key_id)) {} + + const std::string& key_id() const { return key_id_; } + + void ApplyTo(TableMetadataBuilder& builder) const override; + + void GenerateRequirements(TableUpdateContext& context) const override; + + Kind kind() const override { return Kind::kRemoveEncryptionKey; } + + bool Equals(const TableUpdate& other) const override; + + std::unique_ptr Clone() const override; + + private: + std::string key_id_; +}; + } // namespace table } // namespace iceberg diff --git a/src/iceberg/test/json_serde_test.cc b/src/iceberg/test/json_serde_test.cc index 0dac226e9..88b44e3ab 100644 --- a/src/iceberg/test/json_serde_test.cc +++ b/src/iceberg/test/json_serde_test.cc @@ -35,6 +35,7 @@ #include "iceberg/table_update.h" #include "iceberg/test/matchers.h" #include "iceberg/transform.h" +#include "iceberg/util/base64.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep #include "iceberg/util/macros.h" // IWYU pragma: keep #include "iceberg/util/timepoint.h" @@ -361,6 +362,23 @@ TEST(JsonInternalTest, TableUpdateAddSchema) { EXPECT_EQ(*actual->schema(), *update.schema()); } +TEST(JsonInternalTest, TableUpdateAddSchemaWithoutDeprecatedLastColumnId) { + auto schema = std::make_shared( + std::vector{SchemaField(1, "id", int64(), false), + SchemaField(3, "name", string(), true)}, + /*schema_id=*/1); + nlohmann::json json = { + {"action", "add-schema"}, + {"schema", ToJson(*schema)}, + }; + + auto parsed = TableUpdateFromJson(json); + ASSERT_THAT(parsed, IsOk()); + auto* actual = internal::checked_cast(parsed.value().get()); + EXPECT_EQ(*actual->schema(), *schema); + EXPECT_EQ(actual->last_column_id(), 3); +} + TEST(JsonInternalTest, TableUpdateSetCurrentSchema) { table::SetCurrentSchema update(1); nlohmann::json expected = R"({"action":"set-current-schema","schema-id":1})"_json; @@ -540,6 +558,23 @@ TEST(JsonInternalTest, TableUpdateSetProperties) { EXPECT_EQ(*internal::checked_cast(parsed.value().get()), update); } +TEST(JsonInternalTest, TableUpdateSetPropertiesLegacyUpdatedField) { + nlohmann::json json = + R"({"action":"set-properties","updated":{"key1":"value1","key2":"value2"}})"_json; + + auto parsed = TableUpdateFromJson(json); + ASSERT_THAT(parsed, IsOk()); + table::SetProperties expected({{"key1", "value1"}, {"key2", "value2"}}); + EXPECT_EQ(*internal::checked_cast(parsed.value().get()), + expected); +} + +TEST(JsonInternalTest, TableUpdateSetPropertiesMissingCanonicalField) { + auto parsed = TableUpdateFromJson(R"({"action":"set-properties"})"_json); + EXPECT_THAT(parsed, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(parsed, HasErrorMessage("Missing 'updates'")); +} + TEST(JsonInternalTest, TableUpdateRemoveProperties) { table::RemoveProperties update({"key1", "key2"}); @@ -553,6 +588,23 @@ TEST(JsonInternalTest, TableUpdateRemoveProperties) { update); } +TEST(JsonInternalTest, TableUpdateRemovePropertiesLegacyRemovedField) { + nlohmann::json json = + R"({"action":"remove-properties","removed":["key1","key2"]})"_json; + + auto parsed = TableUpdateFromJson(json); + ASSERT_THAT(parsed, IsOk()); + table::RemoveProperties expected({"key1", "key2"}); + EXPECT_EQ(*internal::checked_cast(parsed.value().get()), + expected); +} + +TEST(JsonInternalTest, TableUpdateRemovePropertiesMissingCanonicalField) { + auto parsed = TableUpdateFromJson(R"({"action":"remove-properties"})"_json); + EXPECT_THAT(parsed, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(parsed, HasErrorMessage("Missing 'removals'")); +} + TEST(JsonInternalTest, TableUpdateSetLocation) { table::SetLocation update("s3://bucket/warehouse/table"); nlohmann::json expected = @@ -649,6 +701,50 @@ TEST(JsonInternalTest, TableUpdateRemovePartitionStatistics) { update); } +TEST(JsonInternalTest, TableUpdateAddEncryptionKey) { + EncryptedKey key{ + .key_id = "key-1", + .encrypted_key_metadata = "secret-key-metadata", + .encrypted_by_id = "kek-1", + .properties = {{"scope", "table"}}, + }; + table::AddEncryptionKey update(key); + + nlohmann::json expected = { + {"action", "add-encryption-key"}, + {"encryption-key", + {{"key-id", "key-1"}, + {"encrypted-key-metadata", Base64::Encode("secret-key-metadata")}, + {"encrypted-by-id", "kek-1"}, + {"properties", {{"scope", "table"}}}}}, + }; + + EXPECT_EQ(ToJson(update), expected); + auto parsed = TableUpdateFromJson(expected); + ASSERT_THAT(parsed, IsOk()); + EXPECT_EQ(*internal::checked_cast(parsed.value().get()), + update); +} + +TEST(JsonInternalTest, TableUpdateAddEncryptionKeyRejectsNonObjectKey) { + nlohmann::json json = R"({"action":"add-encryption-key","encryption-key":null})"_json; + + auto parsed = TableUpdateFromJson(json); + EXPECT_THAT(parsed, IsError(ErrorKind::kJsonParseError)); + EXPECT_THAT(parsed, HasErrorMessage("Invalid encryption key")); +} + +TEST(JsonInternalTest, TableUpdateRemoveEncryptionKey) { + table::RemoveEncryptionKey update("key-1"); + nlohmann::json expected = R"({"action":"remove-encryption-key","key-id":"key-1"})"_json; + + EXPECT_EQ(ToJson(update), expected); + auto parsed = TableUpdateFromJson(expected); + ASSERT_THAT(parsed, IsOk()); + EXPECT_EQ(*internal::checked_cast(parsed.value().get()), + update); +} + TEST(JsonInternalTest, TableUpdateUnknownAction) { nlohmann::json json = R"({"action":"unknown-action"})"_json; auto result = TableUpdateFromJson(json); diff --git a/src/iceberg/test/metadata_serde_test.cc b/src/iceberg/test/metadata_serde_test.cc index 2c2b2bd1e..48f88f2bc 100644 --- a/src/iceberg/test/metadata_serde_test.cc +++ b/src/iceberg/test/metadata_serde_test.cc @@ -486,4 +486,57 @@ TEST(MetadataSerdeTest, DeserializeV2MissingSortOrder) { "sort-orders must exist"); } +TEST(MetadataSerdeTest, EncryptionKeysRoundTrip) { + nlohmann::json metadata_json = R"({ + "format-version": 2, + "table-uuid": "test-uuid-1234", + "location": "s3://bucket/test", + "last-sequence-number": 0, + "last-updated-ms": 0, + "last-column-id": 1, + "schemas": [ + { + "type": "struct", + "schema-id": 0, + "fields": [ + {"id": 1, "name": "id", "type": "int", "required": true} + ] + } + ], + "current-schema-id": 0, + "partition-specs": [{"spec-id": 0, "fields": []}], + "default-spec-id": 0, + "last-partition-id": 999, + "sort-orders": [{"order-id": 0, "fields": []}], + "default-sort-order-id": 0, + "properties": {}, + "current-snapshot-id": null, + "refs": {}, + "snapshots": [], + "statistics": [], + "partition-statistics": [], + "snapshot-log": [], + "metadata-log": [], + "encryption-keys": [ + { + "key-id": "key-1", + "encrypted-key-metadata": "c2VjcmV0LWtleS1tZXRhZGF0YQ==", + "encrypted-by-id": "kek-1", + "properties": {"scope": "table"} + } + ] + })"_json; + + auto metadata = TableMetadataFromJson(metadata_json); + ASSERT_THAT(metadata, IsOk()); + ASSERT_EQ(metadata.value()->encryption_keys.size(), 1); + EXPECT_EQ(metadata.value()->encryption_keys[0].key_id, "key-1"); + EXPECT_EQ(metadata.value()->encryption_keys[0].encrypted_key_metadata, + "secret-key-metadata"); + + auto serialized = ToJson(*metadata.value()); + ASSERT_TRUE(serialized.contains("encryption-keys")); + EXPECT_EQ(serialized["encryption-keys"], metadata_json["encryption-keys"]); +} + } // namespace iceberg diff --git a/src/iceberg/test/rest_json_serde_test.cc b/src/iceberg/test/rest_json_serde_test.cc index 86c852a1a..7304831c6 100644 --- a/src/iceberg/test/rest_json_serde_test.cc +++ b/src/iceberg/test/rest_json_serde_test.cc @@ -1236,7 +1236,31 @@ INSTANTIATE_TEST_SUITE_P( CommitTableRequestDeserializeParam{ .test_name = "MissingIdentifier", .json_str = R"({"requirements":[],"updates":[]})", - .expected_model = {}}), + .expected_model = {}}, + // Requirements field is missing (should deserialize to empty requirements) + CommitTableRequestDeserializeParam{ + .test_name = "MissingRequirements", + .json_str = + R"({"identifier":{"namespace":["ns1"],"name":"table1"},"updates":[]})", + .expected_model = {.identifier = TableIdentifier{Namespace{{"ns1"}}, + "table1"}}}, + // Updates field is missing (should deserialize to empty updates) + CommitTableRequestDeserializeParam{ + .test_name = "MissingUpdates", + .json_str = + R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":[]})", + .expected_model = {.identifier = TableIdentifier{Namespace{{"ns1"}}, + "table1"}}}, + // Null requirements and updates are treated as absent + CommitTableRequestDeserializeParam{ + .test_name = "NullRequirementsAndUpdates", + .json_str = + R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":null,"updates":null})", + .expected_model = {.identifier = TableIdentifier{Namespace{{"ns1"}}, + "table1"}}}, + // Empty JSON object + CommitTableRequestDeserializeParam{ + .test_name = "EmptyJson", .json_str = R"({})", .expected_model = {}}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); @@ -1293,23 +1317,18 @@ INSTANTIATE_TEST_SUITE_P( .invalid_json_str = R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":[],"updates":[{"action":"assign-uuid"}]})", .expected_error_message = "Missing 'uuid'"}, - // Missing required requirements field + // Invalid requirements - must be an array CommitTableRequestInvalidParam{ - .test_name = "MissingRequirements", + .test_name = "InvalidRequirementsNotArray", .invalid_json_str = - R"({"identifier":{"namespace":["ns1"],"name":"table1"},"updates":[]})", - .expected_error_message = "Missing 'requirements'"}, - // Missing required updates field + R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":{"type":"assert-create"},"updates":[]})", + .expected_error_message = "Expected 'requirements' to be an array"}, + // Invalid updates - must be an array CommitTableRequestInvalidParam{ - .test_name = "MissingUpdates", + .test_name = "InvalidUpdatesNotArray", .invalid_json_str = - R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":[]})", - .expected_error_message = "Missing 'updates'"}, - // Empty JSON object - CommitTableRequestInvalidParam{ - .test_name = "EmptyJson", - .invalid_json_str = R"({})", - .expected_error_message = "Missing 'requirements'"}), + R"({"identifier":{"namespace":["ns1"],"name":"table1"},"requirements":[],"updates":{"action":"assign-uuid","uuid":"2cc52516-5e73-41f2-b139-545d41a4e151"}})", + .expected_error_message = "Expected 'updates' to be an array"}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); diff --git a/src/iceberg/test/table_metadata_builder_test.cc b/src/iceberg/test/table_metadata_builder_test.cc index 68a980b9a..f3994f397 100644 --- a/src/iceberg/test/table_metadata_builder_test.cc +++ b/src/iceberg/test/table_metadata_builder_test.cc @@ -364,6 +364,40 @@ TEST(TableMetadataBuilderTest, RemoveProperties) { EXPECT_EQ(metadata->properties.configs().at("key3"), "value3"); } +TEST(TableMetadataBuilderTest, AddAndRemoveEncryptionKey) { + auto base = CreateBaseMetadata(); + EncryptedKey key{ + .key_id = "key-1", + .encrypted_key_metadata = "secret-key-metadata", + .encrypted_by_id = "kek-1", + .properties = {{"scope", "table"}}, + }; + + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + builder->AddEncryptionKey(key); + builder->AddEncryptionKey(key); + + ICEBERG_UNWRAP_OR_FAIL(auto metadata, builder->Build()); + ASSERT_EQ(metadata->encryption_keys.size(), 1); + EXPECT_EQ(metadata->encryption_keys[0], key); + ASSERT_EQ(builder->changes().size(), 1); + EXPECT_EQ(builder->changes()[0]->kind(), TableUpdate::Kind::kAddEncryptionKey); + + builder = TableMetadataBuilder::BuildFrom(metadata.get()); + builder->RemoveEncryptionKey("missing-key"); + ICEBERG_UNWRAP_OR_FAIL(auto unchanged, builder->Build()); + ASSERT_EQ(unchanged->encryption_keys.size(), 1); + EXPECT_EQ(unchanged->encryption_keys[0], key); + EXPECT_TRUE(builder->changes().empty()); + + builder = TableMetadataBuilder::BuildFrom(metadata.get()); + builder->RemoveEncryptionKey("key-1"); + ICEBERG_UNWRAP_OR_FAIL(auto removed, builder->Build()); + EXPECT_TRUE(removed->encryption_keys.empty()); + ASSERT_EQ(builder->changes().size(), 1); + EXPECT_EQ(builder->changes()[0]->kind(), TableUpdate::Kind::kRemoveEncryptionKey); +} + TEST(TableMetadataBuilderTest, UpgradeFormatVersion) { auto builder = TableMetadataBuilder::BuildFromEmpty(1); auto schema = CreateTestSchema(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 6b4160037..2ed2835a7 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -245,10 +245,7 @@ class HistoryTable; class MetadataTable; class SnapshotsTable; -/// ---------------------------------------------------------------------------- -/// TODO: Forward declarations below are not added yet. -/// ---------------------------------------------------------------------------- - -class EncryptedKey; +/// \brief Table encryption +struct EncryptedKey; } // namespace iceberg From f71f485394caf75b7f3db2f705882c3e8341d825 Mon Sep 17 00:00:00 2001 From: Rahul Goel Date: Tue, 16 Jun 2026 02:13:14 -0400 Subject: [PATCH 090/151] fix: Handle unknown record_count better (#747) Fixes #732 Only special-case ```record_count == 0;``` Let negative/unknown counts fall through to normal strict metrics evaluation. --- .../expression/strict_metrics_evaluator.cc | 9 ++++- .../test/strict_metrics_evaluator_test.cc | 35 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/iceberg/expression/strict_metrics_evaluator.cc b/src/iceberg/expression/strict_metrics_evaluator.cc index a9b5ded46..8f6d27876 100644 --- a/src/iceberg/expression/strict_metrics_evaluator.cc +++ b/src/iceberg/expression/strict_metrics_evaluator.cc @@ -532,9 +532,16 @@ Result> StrictMetricsEvaluator::Make( } Result StrictMetricsEvaluator::Evaluate(const DataFile& data_file) const { - if (data_file.record_count <= 0) { + if (data_file.record_count == 0) { return kRowsMustMatch; } + // Only -1 is a valid sentinel for an unknown row count (set when writer metrics omit + // the count); any value below -1 is invalid metadata. + if (data_file.record_count < -1) { + return InvalidArgument("Invalid record count: {}", data_file.record_count); + } + // For -1, fall through to normal strict metrics evaluation rather than + // assuming all rows must match. StrictMetricsVisitor visitor(data_file, *schema_); return Visit(expr_, visitor); } diff --git a/src/iceberg/test/strict_metrics_evaluator_test.cc b/src/iceberg/test/strict_metrics_evaluator_test.cc index fcb997929..f9a285660 100644 --- a/src/iceberg/test/strict_metrics_evaluator_test.cc +++ b/src/iceberg/test/strict_metrics_evaluator_test.cc @@ -536,6 +536,24 @@ class StrictMetricsEvaluatorMigratedTest : public StrictMetricsEvaluatorTest { return data_file; } + std::shared_ptr MakeUnknownRecordCountFile() { + auto data_file = std::make_shared(); + data_file->file_path = "unknown.parquet"; + data_file->file_format = FileFormatType::kParquet; + // -1 is the sentinel for an unknown row count. + data_file->record_count = -1; + return data_file; + } + + std::shared_ptr MakeInvalidRecordCountFile() { + auto data_file = std::make_shared(); + data_file->file_path = "invalid.parquet"; + data_file->file_format = FileFormatType::kParquet; + // Anything below the -1 sentinel is invalid metadata. + data_file->record_count = -2; + return data_file; + } + void ExpectShouldRead(const std::shared_ptr& expr, bool expected, std::shared_ptr file = nullptr, bool case_sensitive = true) { @@ -650,6 +668,23 @@ TEST_F(StrictMetricsEvaluatorMigratedTest, ZeroRecordFile) { } } +TEST_F(StrictMetricsEvaluatorMigratedTest, UnknownRecordCountFile) { + // A file with an unknown row count (record_count == -1) must not be treated as if + // every row matches the predicate. AlwaysFalse can never match all rows. + auto unknown_record_count_file = MakeUnknownRecordCountFile(); + ExpectShouldRead(Expressions::AlwaysFalse(), false, unknown_record_count_file); +} + +TEST_F(StrictMetricsEvaluatorMigratedTest, InvalidRecordCountFile) { + // A record count below the -1 unknown sentinel is invalid and must error out. + auto invalid_record_count_file = MakeInvalidRecordCountFile(); + ICEBERG_UNWRAP_OR_FAIL(auto evaluator, StrictMetricsEvaluator::Make( + Expressions::AlwaysFalse(), schema_, true)); + auto result = evaluator->Evaluate(*invalid_record_count_file); + ASSERT_FALSE(result.has_value()); + EXPECT_EQ(result.error().kind, ErrorKind::kInvalidArgument); +} + TEST_F(StrictMetricsEvaluatorMigratedTest, Not) { ExpectShouldRead( Expressions::Not(Expressions::LessThan("id", Literal::Long(kIntMinValue - 25))), From 64691e4bf408fc1161b09a4d551ed29cfb5e06f4 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 16 Jun 2026 14:41:19 +0800 Subject: [PATCH 091/151] fix: reject tag refs for main snapshot ref (#745) Validate that the reserved main snapshot ref is always a branch, and preserve snapshot log timestamps for newly added snapshots without overwriting table metadata update time. This behavior is aligned with Java's TableMetadata.Builder.setRef --- src/iceberg/table_metadata.cc | 25 ++++++++------ src/iceberg/test/snapshot_manager_test.cc | 19 +++++++++++ .../test/table_metadata_builder_test.cc | 34 +++++++++++++++++++ src/iceberg/test/table_update_test.cc | 20 +++++++++++ src/iceberg/transaction.cc | 11 ++++++ 5 files changed, 98 insertions(+), 11 deletions(-) diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index 88bde4d50..53e3c231d 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -1078,7 +1078,6 @@ Status TableMetadataBuilder::Impl::AddSnapshot(std::shared_ptr snapsho "Cannot add snapshot with sequence number {} older than last sequence number {}", snapshot->sequence_number, metadata_.last_sequence_number); - metadata_.last_updated_ms = snapshot->timestamp_ms; metadata_.last_sequence_number = snapshot->sequence_number; metadata_.snapshots.push_back(snapshot); snapshots_by_id_.emplace(snapshot->snapshot_id, snapshot); @@ -1167,22 +1166,26 @@ Status TableMetadataBuilder::Impl::SetRef(const std::string& name, "Cannot set {} to unknown snapshot: {}", name, snapshot_id); const auto& snapshot = snapshot_it->second; - // If snapshot was added in this set of changes, update last_updated_ms - if (std::ranges::any_of(changes_, [snapshot_id](const auto& change) { - return change->kind() == TableUpdate::Kind::kAddSnapshot && - internal::checked_cast(*change) - .snapshot() - ->snapshot_id == snapshot_id; - })) { - metadata_.last_updated_ms = snapshot->timestamp_ms; - } + ICEBERG_CHECK( + name != SnapshotRef::kMainBranch || ref->type() == SnapshotRefType::kBranch, + "Cannot set {} to a tag, it must be a branch", SnapshotRef::kMainBranch); if (name == SnapshotRef::kMainBranch) { + const bool is_added_snapshot = + std::ranges::any_of(changes_, [snapshot_id](const auto& change) { + return change->kind() == TableUpdate::Kind::kAddSnapshot && + internal::checked_cast(*change) + .snapshot() + ->snapshot_id == snapshot_id; + }); metadata_.current_snapshot_id = ref->snapshot_id; if (metadata_.last_updated_ms == kInvalidLastUpdatedMs) { metadata_.last_updated_ms = CurrentTimePointMs(); } - metadata_.snapshot_log.emplace_back(metadata_.last_updated_ms, ref->snapshot_id); + + auto time_of_change = + is_added_snapshot ? snapshot->timestamp_ms : metadata_.last_updated_ms; + metadata_.snapshot_log.emplace_back(time_of_change, ref->snapshot_id); } changes_.push_back(std::make_unique(name, *ref)); diff --git a/src/iceberg/test/snapshot_manager_test.cc b/src/iceberg/test/snapshot_manager_test.cc index bc00db39b..f4fe68958 100644 --- a/src/iceberg/test/snapshot_manager_test.cc +++ b/src/iceberg/test/snapshot_manager_test.cc @@ -421,6 +421,25 @@ TEST_F(SnapshotManagerMinimalTableTest, CreateBranchOnEmptyTable) { EXPECT_EQ(it->second->type(), SnapshotRefType::kBranch); } +TEST_F(SnapshotManagerMinimalTableTest, CreateTagNamedMainFails) { + ICEBERG_UNWRAP_OR_FAIL(auto manager, table_->NewSnapshotManager()); + manager->CreateBranch("branch1"); + ExpectCommitOk(manager->Commit()); + + auto metadata = ReloadMetadata(); + auto branch_it = metadata->refs.find("branch1"); + ASSERT_NE(branch_it, metadata->refs.end()); + ASSERT_EQ(branch_it->second->type(), SnapshotRefType::kBranch); + + ICEBERG_UNWRAP_OR_FAIL(auto table_with_branch, catalog_->LoadTable(table_ident_)); + ICEBERG_UNWRAP_OR_FAIL(auto new_manager, table_with_branch->NewSnapshotManager()); + new_manager->CreateTag(std::string(SnapshotRef::kMainBranch), + branch_it->second->snapshot_id); + ExpectCommitError(new_manager->Commit(), ErrorKind::kValidationFailed, + "Cannot set main to a tag, it must be a branch"); + ExpectNoRef(std::string(SnapshotRef::kMainBranch)); +} + TEST_F(SnapshotManagerMinimalTableTest, CreateBranchOnEmptyTableFailsWhenRefAlreadyExists) { ICEBERG_UNWRAP_OR_FAIL(auto manager, table_->NewSnapshotManager()); diff --git a/src/iceberg/test/table_metadata_builder_test.cc b/src/iceberg/test/table_metadata_builder_test.cc index f3994f397..f9080e0f2 100644 --- a/src/iceberg/test/table_metadata_builder_test.cc +++ b/src/iceberg/test/table_metadata_builder_test.cc @@ -36,6 +36,7 @@ #include "iceberg/test/matchers.h" #include "iceberg/transform.h" #include "iceberg/type.h" +#include "iceberg/util/timepoint.h" #include "iceberg/util/uuid.h" namespace iceberg { @@ -1193,6 +1194,39 @@ TEST(TableMetadataBuilderTest, RemoveSnapshotRef) { EXPECT_TRUE(metadata->refs.contains("ref1")); } +TEST(TableMetadataBuilderTest, SetRefRejectsTagForMainBranch) { + auto base = CreateBaseMetadata(); + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + builder->AddSnapshot(std::make_shared(Snapshot{.snapshot_id = 1})); + ICEBERG_UNWRAP_OR_FAIL(auto main_tag, SnapshotRef::MakeTag(1)); + + builder->SetRef(std::string(SnapshotRef::kMainBranch), std::move(main_tag)); + + auto result = builder->Build(); + ASSERT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot set main to a tag, it must be a branch")); +} + +TEST(TableMetadataBuilderTest, SetMainRefToAddedSnapshotUsesSnapshotTimestampForLog) { + auto base = CreateBaseMetadata(); + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + auto snapshot_time = TimePointMsFromUnixMs(123456789); + builder->AddSnapshot(std::make_shared( + Snapshot{.snapshot_id = 1, .sequence_number = 1, .timestamp_ms = snapshot_time})); + ICEBERG_UNWRAP_OR_FAIL(auto main_branch, SnapshotRef::MakeBranch(1)); + + builder->SetRef(std::string(SnapshotRef::kMainBranch), std::move(main_branch)); + + ICEBERG_UNWRAP_OR_FAIL(auto metadata, builder->Build()); + EXPECT_EQ(metadata->current_snapshot_id, 1); + EXPECT_NE(metadata->last_updated_ms, snapshot_time); + ASSERT_FALSE(metadata->snapshot_log.empty()); + EXPECT_EQ(metadata->snapshot_log.back().snapshot_id, 1); + EXPECT_EQ(metadata->snapshot_log.back().timestamp_ms, snapshot_time); +} + TEST(TableMetadataBuilderTest, RemoveSnapshot) { auto base = CreateBaseMetadata(); auto builder = TableMetadataBuilder::BuildFrom(base.get()); diff --git a/src/iceberg/test/table_update_test.cc b/src/iceberg/test/table_update_test.cc index 3e41318cf..be464f154 100644 --- a/src/iceberg/test/table_update_test.cc +++ b/src/iceberg/test/table_update_test.cc @@ -440,4 +440,24 @@ TEST(TableUpdateTest, SetSnapshotRefApplyUpdate) { } } +TEST(TableUpdateTest, SetSnapshotRefRejectsTagForMainBranch) { + auto base = CreateBaseMetadata(); + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + auto snapshot = std::make_shared( + Snapshot{.snapshot_id = 987654321, + .sequence_number = 1, + .timestamp_ms = TimePointMsFromUnixMs(2000000), + .manifest_list = "s3://bucket/manifest-list.avro"}); + builder->AddSnapshot(snapshot); + + table::SetSnapshotRef update(std::string(SnapshotRef::kMainBranch), 987654321, + SnapshotRefType::kTag); + update.ApplyTo(*builder); + + auto result = builder->Build(); + ASSERT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot set main to a tag, it must be a branch")); +} + } // namespace iceberg diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index 049b0f49d..00ac0e790 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -209,6 +209,7 @@ Status Transaction::ApplyExpireSnapshots(ExpireSnapshots& update) { if (!result.schema_ids_to_remove.empty()) { ctx_->metadata_builder->RemoveSchemas(std::move(result.schema_ids_to_remove)); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -216,6 +217,7 @@ Status Transaction::ApplySetSnapshot(SetSnapshot& update) { ICEBERG_ASSIGN_OR_RAISE(auto snapshot_id, update.Apply()); ctx_->metadata_builder->SetBranchSnapshot(snapshot_id, std::string(SnapshotRef::kMainBranch)); + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -232,6 +234,7 @@ Status Transaction::ApplyUpdatePartitionSpec(UpdatePartitionSpec& update) { } else { ctx_->metadata_builder->AddPartitionSpec(std::move(result.spec)); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -246,6 +249,7 @@ Status Transaction::ApplyUpdateProperties(UpdateProperties& update) { if (result.format_version.has_value()) { ctx_->metadata_builder->UpgradeFormatVersion(result.format_version.value()); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -256,6 +260,7 @@ Status Transaction::ApplyUpdateSchema(UpdateSchema& update) { if (!result.updated_props.empty()) { ctx_->metadata_builder->SetProperties(result.updated_props); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -275,6 +280,7 @@ Status Transaction::ApplyUpdateSnapshot(SnapshotUpdate& update) { } else { temp_update->SetBranchSnapshot(std::move(result.snapshot), result.target_branch); } + ICEBERG_RETURN_UNEXPECTED(temp_update->CheckErrors()); if (temp_update->changes().empty()) { // Do not commit if the metadata has not changed. for example, this may happen @@ -293,6 +299,7 @@ Status Transaction::ApplyUpdateSnapshot(SnapshotUpdate& update) { if (base.table_uuid.empty()) { ctx_->metadata_builder->AssignUUID(); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -304,12 +311,14 @@ Status Transaction::ApplyUpdateSnapshotReference(UpdateSnapshotReference& update for (auto&& [name, ref] : result.to_set) { ctx_->metadata_builder->SetRef(std::move(name), std::move(ref)); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } Status Transaction::ApplyUpdateSortOrder(UpdateSortOrder& update) { ICEBERG_ASSIGN_OR_RAISE(auto sort_order, update.Apply()); ctx_->metadata_builder->SetDefaultSortOrder(std::move(sort_order)); + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -321,6 +330,7 @@ Status Transaction::ApplyUpdateStatistics(UpdateStatistics& update) { for (const auto& snapshot_id : result.to_remove) { ctx_->metadata_builder->RemoveStatistics(snapshot_id); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } @@ -332,6 +342,7 @@ Status Transaction::ApplyUpdatePartitionStatistics(UpdatePartitionStatistics& up for (const auto& snapshot_id : result.to_remove) { ctx_->metadata_builder->RemovePartitionStatistics(snapshot_id); } + ICEBERG_RETURN_UNEXPECTED(ctx_->metadata_builder->CheckErrors()); return {}; } From 1777794fc01dfcaf45c932b6aa2d1c5c8e0e9175 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Tue, 16 Jun 2026 14:45:27 +0800 Subject: [PATCH 092/151] feat: implement RenameTable in InMemoryCatalog (#742) Replace the NotImplemented stub with a full implementation that: - Returns early as a no-op when renaming a table to itself - Returns NoSuchTable when the source table does not exist - Returns AlreadyExists when the destination table already exists - Moves the metadata location from source to destination identifier Add unit test covering rename to self, nonexistent source, destination conflict, and full rename + load verification. --- .../catalog/memory/in_memory_catalog.cc | 30 ++++++++++++- src/iceberg/test/in_memory_catalog_test.cc | 43 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/iceberg/catalog/memory/in_memory_catalog.cc b/src/iceberg/catalog/memory/in_memory_catalog.cc index ede316add..35593ed93 100644 --- a/src/iceberg/catalog/memory/in_memory_catalog.cc +++ b/src/iceberg/catalog/memory/in_memory_catalog.cc @@ -518,7 +518,35 @@ Status InMemoryCatalog::DropTable(const TableIdentifier& identifier, bool purge) Status InMemoryCatalog::RenameTable(const TableIdentifier& from, const TableIdentifier& to) { std::unique_lock lock(mutex_); - return NotImplemented("rename table"); + + // Renaming a table to itself is a no-op. + if (from == to) { + return {}; + } + + // Verify the source table exists. + ICEBERG_ASSIGN_OR_RAISE(auto from_exists, root_namespace_->TableExists(from)); + if (!from_exists) { + return NoSuchTable("Source table does not exist: {}", from); + } + + // Verify the destination table does not already exist. + ICEBERG_ASSIGN_OR_RAISE(auto to_exists, root_namespace_->TableExists(to)); + if (to_exists) { + return AlreadyExists("Destination table already exists: {}", to); + } + + // Get the metadata location from the source table. + ICEBERG_ASSIGN_OR_RAISE(auto metadata_location, + root_namespace_->GetTableMetadataLocation(from)); + + // Register the destination with the same metadata location. + ICEBERG_RETURN_UNEXPECTED(root_namespace_->RegisterTable(to, metadata_location)); + + // Unregister the source table. + ICEBERG_RETURN_UNEXPECTED(root_namespace_->UnregisterTable(from)); + + return {}; } Result> InMemoryCatalog::LoadTable( diff --git a/src/iceberg/test/in_memory_catalog_test.cc b/src/iceberg/test/in_memory_catalog_test.cc index 1a65098e6..af6921f1e 100644 --- a/src/iceberg/test/in_memory_catalog_test.cc +++ b/src/iceberg/test/in_memory_catalog_test.cc @@ -305,6 +305,49 @@ TEST_F(InMemoryCatalogTest, DropTable) { EXPECT_THAT(result, IsOk()); } +TEST_F(InMemoryCatalogTest, RenameTable) { + // Create a table first. + TableIdentifier ident{.ns = {}, .name = "t1"}; + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "x", int64())}, + /*schema_id=*/1); + auto spec = PartitionSpec::Unpartitioned(); + auto sort_order = SortOrder::Unsorted(); + + ICEBERG_UNWRAP_OR_FAIL( + auto table, catalog_->CreateTable(ident, schema, spec, sort_order, + GenerateTestTableLocation(ident.name), {})); + + // Rename to itself is a no-op. + EXPECT_THAT(catalog_->RenameTable(ident, ident), IsOk()); + + // Rename non-existent source table. + TableIdentifier nonexist{.ns = {}, .name = "nonexist"}; + EXPECT_THAT(catalog_->RenameTable(nonexist, ident), IsError(ErrorKind::kNoSuchTable)); + + // Rename to an existing destination table. + TableIdentifier ident2{.ns = {}, .name = "t2"}; + ICEBERG_UNWRAP_OR_FAIL( + auto table2, catalog_->CreateTable(ident2, schema, spec, sort_order, + GenerateTestTableLocation(ident2.name), {})); + EXPECT_THAT(catalog_->RenameTable(ident, ident2), IsError(ErrorKind::kAlreadyExists)); + + // Drop ident2 to clear the destination, then rename. + EXPECT_THAT(catalog_->DropTable(ident2, /*purge=*/false), IsOk()); + + // Rename ident -> ident2. + TableIdentifier renamed{.ns = {}, .name = "t2"}; + EXPECT_THAT(catalog_->RenameTable(ident, renamed), IsOk()); + EXPECT_THAT(catalog_->TableExists(ident), HasValue(::testing::Eq(false))); + EXPECT_THAT(catalog_->TableExists(renamed), HasValue(::testing::Eq(true))); + + // Load the renamed table to verify it's intact. + auto loaded = catalog_->LoadTable(renamed); + ASSERT_THAT(loaded, IsOk()); + EXPECT_EQ(loaded.value()->name().name, "t2"); + EXPECT_EQ(loaded.value()->uuid(), table->uuid()); +} + TEST_F(InMemoryCatalogTest, Namespace) { Namespace ns{.levels = {"n1", "n2"}}; std::unordered_map properties = {{"prop1", "val1"}, From 40cc9922bb17d70df1de5044b6f2b5a17d808080 Mon Sep 17 00:00:00 2001 From: liuxiaoyu <45345701+MisterRaindrop@users.noreply.github.com> Date: Tue, 16 Jun 2026 14:50:11 +0800 Subject: [PATCH 093/151] feat(hive): vendor Hive Metastore IDL and generated bindings (#749) - Update vendored Hive Metastore IDL to Hive 4.0.1. - Check in generated HMS/fb303 C++ bindings. - Add a regeneration script plus lint/license exclusions for generated sources. --- .github/.licenserc.yaml | 1 + .github/workflows/cpp-linter.yml | 2 +- .pre-commit-config.yaml | 4 + dev/update_hive_thrift.sh | 45 + .../catalog/hive/gen-cpp/FacebookService.cpp | 4476 + .../catalog/hive/gen-cpp/FacebookService.h | 1673 + .../hive/gen-cpp/ThriftHiveMetastore.cpp | 126865 +++++++++++++++ .../hive/gen-cpp/ThriftHiveMetastore.h | 35369 ++++ .../catalog/hive/gen-cpp/fb303_types.cpp | 53 + .../catalog/hive/gen-cpp/fb303_types.h | 46 + .../hive/gen-cpp/hive_metastore_constants.cpp | 105 + .../hive/gen-cpp/hive_metastore_constants.h | 68 + .../hive/gen-cpp/hive_metastore_types.cpp | 62322 +++++++ .../hive/gen-cpp/hive_metastore_types.h | 15912 ++ thirdparty/hive_metastore/README.md | 2 +- .../hive_metastore/hive_metastore.thrift | 1381 +- 16 files changed, 248184 insertions(+), 140 deletions(-) create mode 100755 dev/update_hive_thrift.sh create mode 100644 src/iceberg/catalog/hive/gen-cpp/FacebookService.cpp create mode 100644 src/iceberg/catalog/hive/gen-cpp/FacebookService.h create mode 100644 src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.cpp create mode 100644 src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.h create mode 100644 src/iceberg/catalog/hive/gen-cpp/fb303_types.cpp create mode 100644 src/iceberg/catalog/hive/gen-cpp/fb303_types.h create mode 100644 src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.cpp create mode 100644 src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.h create mode 100644 src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.cpp create mode 100644 src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.h diff --git a/.github/.licenserc.yaml b/.github/.licenserc.yaml index aeaa2f556..a667c903e 100644 --- a/.github/.licenserc.yaml +++ b/.github/.licenserc.yaml @@ -31,6 +31,7 @@ header: - 'requirements.txt' - 'src/iceberg/util/murmurhash3_internal.*' - 'src/iceberg/test/resources/**' + - 'src/iceberg/catalog/hive/gen-cpp/**' - 'thirdparty/**' comment: on-failure diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 5af67dd2c..834ade883 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -68,7 +68,7 @@ jobs: files-changed-only: true lines-changed-only: true thread-comments: true - ignore: 'build|cmake_modules|ci' + ignore: 'build|cmake_modules|ci|src/iceberg/catalog/hive/gen-cpp' database: build verbosity: 'debug' # need '-fno-builtin-std-forward_like', see https://github.com/llvm/llvm-project/issues/101614 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a10bbb63..522923a47 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,15 +25,19 @@ repos: rev: v5.0.0 hooks: - id: trailing-whitespace + exclude: ^src/iceberg/catalog/hive/gen-cpp/ - id: end-of-file-fixer + exclude: ^src/iceberg/catalog/hive/gen-cpp/ - id: check-yaml - id: check-added-large-files + exclude: ^src/iceberg/catalog/hive/gen-cpp/ - repo: https://github.com/pre-commit/mirrors-clang-format rev: v20.1.8 hooks: - id: clang-format exclude_types: [json] + exclude: ^src/iceberg/catalog/hive/gen-cpp/ - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.10 diff --git a/dev/update_hive_thrift.sh b/dev/update_hive_thrift.sh new file mode 100755 index 000000000..3bc7e09d9 --- /dev/null +++ b/dev/update_hive_thrift.sh @@ -0,0 +1,45 @@ +#!/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. +# +# Regenerate the committed Hive Metastore C++ bindings from the vendored +# Thrift IDL. Run this whenever thirdparty/hive_metastore/*.thrift changes. +# Requires the Apache Thrift IDL compiler ("thrift") on PATH; the generated +# sources are checked in so a normal build needs no Thrift compiler. + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +idl_dir="${repo_root}/thirdparty/hive_metastore" +out_dir="${repo_root}/src/iceberg/catalog/hive/gen-cpp" + +if ! command -v thrift >/dev/null 2>&1; then + echo "error: 'thrift' IDL compiler not found on PATH" >&2 + echo " install it (e.g. 'brew install thrift' or 'apt install thrift-compiler')" >&2 + exit 1 +fi + +rm -rf "${out_dir}" +mkdir -p "${out_dir}" + +# -r recurses into included IDL (fb303); cpp:no_skeleton omits server stubs. +thrift -r --gen cpp:no_skeleton -out "${out_dir}" \ + -I "${idl_dir}" "${idl_dir}/hive_metastore.thrift" + +echo "Regenerated Hive Metastore bindings in ${out_dir}" +echo "Review the diff and commit the result." diff --git a/src/iceberg/catalog/hive/gen-cpp/FacebookService.cpp b/src/iceberg/catalog/hive/gen-cpp/FacebookService.cpp new file mode 100644 index 000000000..6db1b83cf --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/FacebookService.cpp @@ -0,0 +1,4476 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "FacebookService.h" + +namespace facebook { namespace fb303 { + + +FacebookService_getName_args::~FacebookService_getName_args() noexcept { +} + +FacebookService_getName_args::FacebookService_getName_args() noexcept { +} + +uint32_t FacebookService_getName_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getName_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getName_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getName_pargs::~FacebookService_getName_pargs() noexcept { +} + + +uint32_t FacebookService_getName_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getName_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getName_result::~FacebookService_getName_result() noexcept { +} + +FacebookService_getName_result::FacebookService_getName_result() noexcept + : success() { +} + +uint32_t FacebookService_getName_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getName_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getName_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getName_presult::~FacebookService_getName_presult() noexcept { +} + + +uint32_t FacebookService_getName_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getVersion_args::~FacebookService_getVersion_args() noexcept { +} + +FacebookService_getVersion_args::FacebookService_getVersion_args() noexcept { +} + +uint32_t FacebookService_getVersion_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getVersion_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getVersion_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getVersion_pargs::~FacebookService_getVersion_pargs() noexcept { +} + + +uint32_t FacebookService_getVersion_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getVersion_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getVersion_result::~FacebookService_getVersion_result() noexcept { +} + +FacebookService_getVersion_result::FacebookService_getVersion_result() noexcept + : success() { +} + +uint32_t FacebookService_getVersion_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getVersion_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getVersion_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getVersion_presult::~FacebookService_getVersion_presult() noexcept { +} + + +uint32_t FacebookService_getVersion_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getStatus_args::~FacebookService_getStatus_args() noexcept { +} + +FacebookService_getStatus_args::FacebookService_getStatus_args() noexcept { +} + +uint32_t FacebookService_getStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getStatus_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatus_pargs::~FacebookService_getStatus_pargs() noexcept { +} + + +uint32_t FacebookService_getStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getStatus_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatus_result::~FacebookService_getStatus_result() noexcept { +} + +FacebookService_getStatus_result::FacebookService_getStatus_result() noexcept + : success(static_cast(0)) { +} + +uint32_t FacebookService_getStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast0; + xfer += iprot->readI32(ecast0); + this->success = static_cast(ecast0); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getStatus_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(static_cast(this->success)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatus_presult::~FacebookService_getStatus_presult() noexcept { +} + + +uint32_t FacebookService_getStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1; + xfer += iprot->readI32(ecast1); + (*(this->success)) = static_cast(ecast1); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getStatusDetails_args::~FacebookService_getStatusDetails_args() noexcept { +} + +FacebookService_getStatusDetails_args::FacebookService_getStatusDetails_args() noexcept { +} + +uint32_t FacebookService_getStatusDetails_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getStatusDetails_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getStatusDetails_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatusDetails_pargs::~FacebookService_getStatusDetails_pargs() noexcept { +} + + +uint32_t FacebookService_getStatusDetails_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getStatusDetails_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatusDetails_result::~FacebookService_getStatusDetails_result() noexcept { +} + +FacebookService_getStatusDetails_result::FacebookService_getStatusDetails_result() noexcept + : success() { +} + +uint32_t FacebookService_getStatusDetails_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getStatusDetails_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getStatusDetails_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getStatusDetails_presult::~FacebookService_getStatusDetails_presult() noexcept { +} + + +uint32_t FacebookService_getStatusDetails_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getCounters_args::~FacebookService_getCounters_args() noexcept { +} + +FacebookService_getCounters_args::FacebookService_getCounters_args() noexcept { +} + +uint32_t FacebookService_getCounters_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCounters_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCounters_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounters_pargs::~FacebookService_getCounters_pargs() noexcept { +} + + +uint32_t FacebookService_getCounters_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCounters_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounters_result::~FacebookService_getCounters_result() noexcept { +} + +FacebookService_getCounters_result::FacebookService_getCounters_result() noexcept { +} + +uint32_t FacebookService_getCounters_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size2; + ::apache::thrift::protocol::TType _ktype3; + ::apache::thrift::protocol::TType _vtype4; + xfer += iprot->readMapBegin(_ktype3, _vtype4, _size2); + uint32_t _i6; + for (_i6 = 0; _i6 < _size2; ++_i6) + { + std::string _key7; + xfer += iprot->readString(_key7); + int64_t& _val8 = this->success[_key7]; + xfer += iprot->readI64(_val8); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCounters_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getCounters_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast(this->success.size())); + std::map ::const_iterator _iter9; + for (_iter9 = this->success.begin(); _iter9 != this->success.end(); ++_iter9) + { + xfer += oprot->writeString(_iter9->first); + xfer += oprot->writeI64(_iter9->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounters_presult::~FacebookService_getCounters_presult() noexcept { +} + + +uint32_t FacebookService_getCounters_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size10; + ::apache::thrift::protocol::TType _ktype11; + ::apache::thrift::protocol::TType _vtype12; + xfer += iprot->readMapBegin(_ktype11, _vtype12, _size10); + uint32_t _i14; + for (_i14 = 0; _i14 < _size10; ++_i14) + { + std::string _key15; + xfer += iprot->readString(_key15); + int64_t& _val16 = (*(this->success))[_key15]; + xfer += iprot->readI64(_val16); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getCounter_args::~FacebookService_getCounter_args() noexcept { +} + +FacebookService_getCounter_args::FacebookService_getCounter_args() noexcept + : key() { +} + +uint32_t FacebookService_getCounter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCounter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCounter_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounter_pargs::~FacebookService_getCounter_pargs() noexcept { +} + + +uint32_t FacebookService_getCounter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCounter_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounter_result::~FacebookService_getCounter_result() noexcept { +} + +FacebookService_getCounter_result::FacebookService_getCounter_result() noexcept + : success(0) { +} + +uint32_t FacebookService_getCounter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCounter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getCounter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCounter_presult::~FacebookService_getCounter_presult() noexcept { +} + + +uint32_t FacebookService_getCounter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_setOption_args::~FacebookService_setOption_args() noexcept { +} + +FacebookService_setOption_args::FacebookService_setOption_args() noexcept + : key(), + value() { +} + +uint32_t FacebookService_setOption_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_setOption_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_setOption_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->value); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_setOption_pargs::~FacebookService_setOption_pargs() noexcept { +} + + +uint32_t FacebookService_setOption_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_setOption_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->value))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_setOption_result::~FacebookService_setOption_result() noexcept { +} + +FacebookService_setOption_result::FacebookService_setOption_result() noexcept { +} + +uint32_t FacebookService_setOption_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_setOption_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_setOption_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_setOption_presult::~FacebookService_setOption_presult() noexcept { +} + + +uint32_t FacebookService_setOption_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getOption_args::~FacebookService_getOption_args() noexcept { +} + +FacebookService_getOption_args::FacebookService_getOption_args() noexcept + : key() { +} + +uint32_t FacebookService_getOption_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getOption_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getOption_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOption_pargs::~FacebookService_getOption_pargs() noexcept { +} + + +uint32_t FacebookService_getOption_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getOption_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOption_result::~FacebookService_getOption_result() noexcept { +} + +FacebookService_getOption_result::FacebookService_getOption_result() noexcept + : success() { +} + +uint32_t FacebookService_getOption_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getOption_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getOption_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOption_presult::~FacebookService_getOption_presult() noexcept { +} + + +uint32_t FacebookService_getOption_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getOptions_args::~FacebookService_getOptions_args() noexcept { +} + +FacebookService_getOptions_args::FacebookService_getOptions_args() noexcept { +} + +uint32_t FacebookService_getOptions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getOptions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getOptions_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOptions_pargs::~FacebookService_getOptions_pargs() noexcept { +} + + +uint32_t FacebookService_getOptions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getOptions_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOptions_result::~FacebookService_getOptions_result() noexcept { +} + +FacebookService_getOptions_result::FacebookService_getOptions_result() noexcept { +} + +uint32_t FacebookService_getOptions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size17; + ::apache::thrift::protocol::TType _ktype18; + ::apache::thrift::protocol::TType _vtype19; + xfer += iprot->readMapBegin(_ktype18, _vtype19, _size17); + uint32_t _i21; + for (_i21 = 0; _i21 < _size17; ++_i21) + { + std::string _key22; + xfer += iprot->readString(_key22); + std::string& _val23 = this->success[_key22]; + xfer += iprot->readString(_val23); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getOptions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getOptions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::map ::const_iterator _iter24; + for (_iter24 = this->success.begin(); _iter24 != this->success.end(); ++_iter24) + { + xfer += oprot->writeString(_iter24->first); + xfer += oprot->writeString(_iter24->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getOptions_presult::~FacebookService_getOptions_presult() noexcept { +} + + +uint32_t FacebookService_getOptions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size25; + ::apache::thrift::protocol::TType _ktype26; + ::apache::thrift::protocol::TType _vtype27; + xfer += iprot->readMapBegin(_ktype26, _vtype27, _size25); + uint32_t _i29; + for (_i29 = 0; _i29 < _size25; ++_i29) + { + std::string _key30; + xfer += iprot->readString(_key30); + std::string& _val31 = (*(this->success))[_key30]; + xfer += iprot->readString(_val31); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_getCpuProfile_args::~FacebookService_getCpuProfile_args() noexcept { +} + +FacebookService_getCpuProfile_args::FacebookService_getCpuProfile_args() noexcept + : profileDurationInSec(0) { +} + +uint32_t FacebookService_getCpuProfile_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->profileDurationInSec); + this->__isset.profileDurationInSec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCpuProfile_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCpuProfile_args"); + + xfer += oprot->writeFieldBegin("profileDurationInSec", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->profileDurationInSec); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCpuProfile_pargs::~FacebookService_getCpuProfile_pargs() noexcept { +} + + +uint32_t FacebookService_getCpuProfile_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_getCpuProfile_pargs"); + + xfer += oprot->writeFieldBegin("profileDurationInSec", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->profileDurationInSec))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCpuProfile_result::~FacebookService_getCpuProfile_result() noexcept { +} + +FacebookService_getCpuProfile_result::FacebookService_getCpuProfile_result() noexcept + : success() { +} + +uint32_t FacebookService_getCpuProfile_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_getCpuProfile_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_getCpuProfile_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_getCpuProfile_presult::~FacebookService_getCpuProfile_presult() noexcept { +} + + +uint32_t FacebookService_getCpuProfile_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_aliveSince_args::~FacebookService_aliveSince_args() noexcept { +} + +FacebookService_aliveSince_args::FacebookService_aliveSince_args() noexcept { +} + +uint32_t FacebookService_aliveSince_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_aliveSince_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_aliveSince_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_aliveSince_pargs::~FacebookService_aliveSince_pargs() noexcept { +} + + +uint32_t FacebookService_aliveSince_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_aliveSince_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_aliveSince_result::~FacebookService_aliveSince_result() noexcept { +} + +FacebookService_aliveSince_result::FacebookService_aliveSince_result() noexcept + : success(0) { +} + +uint32_t FacebookService_aliveSince_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_aliveSince_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("FacebookService_aliveSince_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_aliveSince_presult::~FacebookService_aliveSince_presult() noexcept { +} + + +uint32_t FacebookService_aliveSince_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +FacebookService_reinitialize_args::~FacebookService_reinitialize_args() noexcept { +} + +FacebookService_reinitialize_args::FacebookService_reinitialize_args() noexcept { +} + +uint32_t FacebookService_reinitialize_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_reinitialize_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_reinitialize_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_reinitialize_pargs::~FacebookService_reinitialize_pargs() noexcept { +} + + +uint32_t FacebookService_reinitialize_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_reinitialize_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_shutdown_args::~FacebookService_shutdown_args() noexcept { +} + +FacebookService_shutdown_args::FacebookService_shutdown_args() noexcept { +} + +uint32_t FacebookService_shutdown_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FacebookService_shutdown_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_shutdown_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +FacebookService_shutdown_pargs::~FacebookService_shutdown_pargs() noexcept { +} + + +uint32_t FacebookService_shutdown_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FacebookService_shutdown_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void FacebookServiceClient::getName(std::string& _return) +{ + send_getName(); + recv_getName(_return); +} + +void FacebookServiceClient::send_getName() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getName", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getName_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getName(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getName") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getName_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getName failed: unknown result"); +} + +void FacebookServiceClient::getVersion(std::string& _return) +{ + send_getVersion(); + recv_getVersion(_return); +} + +void FacebookServiceClient::send_getVersion() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getVersion", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getVersion_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getVersion(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getVersion") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getVersion_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getVersion failed: unknown result"); +} + +fb_status::type FacebookServiceClient::getStatus() +{ + send_getStatus(); + return recv_getStatus(); +} + +void FacebookServiceClient::send_getStatus() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getStatus_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +fb_status::type FacebookServiceClient::recv_getStatus() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + fb_status::type _return; + FacebookService_getStatus_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStatus failed: unknown result"); +} + +void FacebookServiceClient::getStatusDetails(std::string& _return) +{ + send_getStatusDetails(); + recv_getStatusDetails(_return); +} + +void FacebookServiceClient::send_getStatusDetails() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getStatusDetails", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getStatusDetails_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getStatusDetails(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getStatusDetails") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getStatusDetails_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStatusDetails failed: unknown result"); +} + +void FacebookServiceClient::getCounters(std::map & _return) +{ + send_getCounters(); + recv_getCounters(_return); +} + +void FacebookServiceClient::send_getCounters() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getCounters", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCounters_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getCounters(std::map & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCounters") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getCounters_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCounters failed: unknown result"); +} + +int64_t FacebookServiceClient::getCounter(const std::string& key) +{ + send_getCounter(key); + return recv_getCounter(); +} + +void FacebookServiceClient::send_getCounter(const std::string& key) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getCounter", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCounter_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t FacebookServiceClient::recv_getCounter() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCounter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + FacebookService_getCounter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCounter failed: unknown result"); +} + +void FacebookServiceClient::setOption(const std::string& key, const std::string& value) +{ + send_setOption(key, value); + recv_setOption(); +} + +void FacebookServiceClient::send_setOption(const std::string& key, const std::string& value) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("setOption", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_setOption_pargs args; + args.key = &key; + args.value = &value; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_setOption() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("setOption") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_setOption_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void FacebookServiceClient::getOption(std::string& _return, const std::string& key) +{ + send_getOption(key); + recv_getOption(_return); +} + +void FacebookServiceClient::send_getOption(const std::string& key) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getOption", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getOption_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getOption(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getOption") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getOption_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getOption failed: unknown result"); +} + +void FacebookServiceClient::getOptions(std::map & _return) +{ + send_getOptions(); + recv_getOptions(_return); +} + +void FacebookServiceClient::send_getOptions() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getOptions", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getOptions_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getOptions(std::map & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getOptions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getOptions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getOptions failed: unknown result"); +} + +void FacebookServiceClient::getCpuProfile(std::string& _return, const int32_t profileDurationInSec) +{ + send_getCpuProfile(profileDurationInSec); + recv_getCpuProfile(_return); +} + +void FacebookServiceClient::send_getCpuProfile(const int32_t profileDurationInSec) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getCpuProfile", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCpuProfile_pargs args; + args.profileDurationInSec = &profileDurationInSec; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::recv_getCpuProfile(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCpuProfile") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + FacebookService_getCpuProfile_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCpuProfile failed: unknown result"); +} + +int64_t FacebookServiceClient::aliveSince() +{ + send_aliveSince(); + return recv_aliveSince(); +} + +void FacebookServiceClient::send_aliveSince() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("aliveSince", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_aliveSince_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t FacebookServiceClient::recv_aliveSince() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("aliveSince") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + FacebookService_aliveSince_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "aliveSince failed: unknown result"); +} + +void FacebookServiceClient::reinitialize() +{ + send_reinitialize(); +} + +void FacebookServiceClient::send_reinitialize() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("reinitialize", ::apache::thrift::protocol::T_ONEWAY, cseqid); + + FacebookService_reinitialize_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void FacebookServiceClient::shutdown() +{ + send_shutdown(); +} + +void FacebookServiceClient::send_shutdown() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("shutdown", ::apache::thrift::protocol::T_ONEWAY, cseqid); + + FacebookService_shutdown_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool FacebookServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void FacebookServiceProcessor::process_getName(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getName", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getName"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getName"); + } + + FacebookService_getName_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getName", bytes); + } + + FacebookService_getName_result result; + try { + iface_->getName(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getName"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getName", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getName"); + } + + oprot->writeMessageBegin("getName", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getName", bytes); + } +} + +void FacebookServiceProcessor::process_getVersion(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getVersion", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getVersion"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getVersion"); + } + + FacebookService_getVersion_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getVersion", bytes); + } + + FacebookService_getVersion_result result; + try { + iface_->getVersion(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getVersion"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getVersion", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getVersion"); + } + + oprot->writeMessageBegin("getVersion", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getVersion", bytes); + } +} + +void FacebookServiceProcessor::process_getStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getStatus", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getStatus"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getStatus"); + } + + FacebookService_getStatus_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getStatus", bytes); + } + + FacebookService_getStatus_result result; + try { + result.success = iface_->getStatus(); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getStatus"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getStatus"); + } + + oprot->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getStatus", bytes); + } +} + +void FacebookServiceProcessor::process_getStatusDetails(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getStatusDetails", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getStatusDetails"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getStatusDetails"); + } + + FacebookService_getStatusDetails_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getStatusDetails", bytes); + } + + FacebookService_getStatusDetails_result result; + try { + iface_->getStatusDetails(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getStatusDetails"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getStatusDetails", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getStatusDetails"); + } + + oprot->writeMessageBegin("getStatusDetails", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getStatusDetails", bytes); + } +} + +void FacebookServiceProcessor::process_getCounters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getCounters", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getCounters"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getCounters"); + } + + FacebookService_getCounters_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getCounters", bytes); + } + + FacebookService_getCounters_result result; + try { + iface_->getCounters(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getCounters"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getCounters", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getCounters"); + } + + oprot->writeMessageBegin("getCounters", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getCounters", bytes); + } +} + +void FacebookServiceProcessor::process_getCounter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getCounter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getCounter"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getCounter"); + } + + FacebookService_getCounter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getCounter", bytes); + } + + FacebookService_getCounter_result result; + try { + result.success = iface_->getCounter(args.key); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getCounter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getCounter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getCounter"); + } + + oprot->writeMessageBegin("getCounter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getCounter", bytes); + } +} + +void FacebookServiceProcessor::process_setOption(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.setOption", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.setOption"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.setOption"); + } + + FacebookService_setOption_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.setOption", bytes); + } + + FacebookService_setOption_result result; + try { + iface_->setOption(args.key, args.value); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.setOption"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("setOption", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.setOption"); + } + + oprot->writeMessageBegin("setOption", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.setOption", bytes); + } +} + +void FacebookServiceProcessor::process_getOption(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getOption", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getOption"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getOption"); + } + + FacebookService_getOption_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getOption", bytes); + } + + FacebookService_getOption_result result; + try { + iface_->getOption(result.success, args.key); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getOption"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getOption", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getOption"); + } + + oprot->writeMessageBegin("getOption", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getOption", bytes); + } +} + +void FacebookServiceProcessor::process_getOptions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getOptions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getOptions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getOptions"); + } + + FacebookService_getOptions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getOptions", bytes); + } + + FacebookService_getOptions_result result; + try { + iface_->getOptions(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getOptions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getOptions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getOptions"); + } + + oprot->writeMessageBegin("getOptions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getOptions", bytes); + } +} + +void FacebookServiceProcessor::process_getCpuProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.getCpuProfile", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.getCpuProfile"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.getCpuProfile"); + } + + FacebookService_getCpuProfile_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.getCpuProfile", bytes); + } + + FacebookService_getCpuProfile_result result; + try { + iface_->getCpuProfile(result.success, args.profileDurationInSec); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.getCpuProfile"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getCpuProfile", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.getCpuProfile"); + } + + oprot->writeMessageBegin("getCpuProfile", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.getCpuProfile", bytes); + } +} + +void FacebookServiceProcessor::process_aliveSince(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.aliveSince", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.aliveSince"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.aliveSince"); + } + + FacebookService_aliveSince_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.aliveSince", bytes); + } + + FacebookService_aliveSince_result result; + try { + result.success = iface_->aliveSince(); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.aliveSince"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("aliveSince", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "FacebookService.aliveSince"); + } + + oprot->writeMessageBegin("aliveSince", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "FacebookService.aliveSince", bytes); + } +} + +void FacebookServiceProcessor::process_reinitialize(int32_t, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol*, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.reinitialize", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.reinitialize"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.reinitialize"); + } + + FacebookService_reinitialize_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.reinitialize", bytes); + } + + try { + iface_->reinitialize(); + } catch (const std::exception&) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.reinitialize"); + } + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->asyncComplete(ctx, "FacebookService.reinitialize"); + } + + return; +} + +void FacebookServiceProcessor::process_shutdown(int32_t, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol*, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("FacebookService.shutdown", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "FacebookService.shutdown"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "FacebookService.shutdown"); + } + + FacebookService_shutdown_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "FacebookService.shutdown", bytes); + } + + try { + iface_->shutdown(); + } catch (const std::exception&) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "FacebookService.shutdown"); + } + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->asyncComplete(ctx, "FacebookService.shutdown"); + } + + return; +} + +::std::shared_ptr< ::apache::thrift::TProcessor > FacebookServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< FacebookServiceIfFactory > cleanup(handlerFactory_); + ::std::shared_ptr< FacebookServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup); + ::std::shared_ptr< ::apache::thrift::TProcessor > processor(new FacebookServiceProcessor(handler)); + return processor; +} + +void FacebookServiceConcurrentClient::getName(std::string& _return) +{ + int32_t seqid = send_getName(); + recv_getName(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getName() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getName", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getName_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getName(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getName") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getName_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getName failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getVersion(std::string& _return) +{ + int32_t seqid = send_getVersion(); + recv_getVersion(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getVersion() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getVersion", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getVersion_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getVersion(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getVersion") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getVersion_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getVersion failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +fb_status::type FacebookServiceConcurrentClient::getStatus() +{ + int32_t seqid = send_getStatus(); + return recv_getStatus(seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getStatus() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getStatus_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +fb_status::type FacebookServiceConcurrentClient::recv_getStatus(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + fb_status::type _return; + FacebookService_getStatus_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStatus failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getStatusDetails(std::string& _return) +{ + int32_t seqid = send_getStatusDetails(); + recv_getStatusDetails(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getStatusDetails() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getStatusDetails", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getStatusDetails_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getStatusDetails(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getStatusDetails") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getStatusDetails_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStatusDetails failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getCounters(std::map & _return) +{ + int32_t seqid = send_getCounters(); + recv_getCounters(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getCounters() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getCounters", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCounters_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getCounters(std::map & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCounters") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getCounters_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCounters failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int64_t FacebookServiceConcurrentClient::getCounter(const std::string& key) +{ + int32_t seqid = send_getCounter(key); + return recv_getCounter(seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getCounter(const std::string& key) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getCounter", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCounter_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t FacebookServiceConcurrentClient::recv_getCounter(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCounter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + FacebookService_getCounter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCounter failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::setOption(const std::string& key, const std::string& value) +{ + int32_t seqid = send_setOption(key, value); + recv_setOption(seqid); +} + +int32_t FacebookServiceConcurrentClient::send_setOption(const std::string& key, const std::string& value) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("setOption", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_setOption_pargs args; + args.key = &key; + args.value = &value; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_setOption(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("setOption") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_setOption_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getOption(std::string& _return, const std::string& key) +{ + int32_t seqid = send_getOption(key); + recv_getOption(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getOption(const std::string& key) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getOption", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getOption_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getOption(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getOption") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getOption_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getOption failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getOptions(std::map & _return) +{ + int32_t seqid = send_getOptions(); + recv_getOptions(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getOptions() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getOptions", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getOptions_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getOptions(std::map & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getOptions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getOptions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getOptions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::getCpuProfile(std::string& _return, const int32_t profileDurationInSec) +{ + int32_t seqid = send_getCpuProfile(profileDurationInSec); + recv_getCpuProfile(_return, seqid); +} + +int32_t FacebookServiceConcurrentClient::send_getCpuProfile(const int32_t profileDurationInSec) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getCpuProfile", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_getCpuProfile_pargs args; + args.profileDurationInSec = &profileDurationInSec; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void FacebookServiceConcurrentClient::recv_getCpuProfile(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getCpuProfile") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + FacebookService_getCpuProfile_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getCpuProfile failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int64_t FacebookServiceConcurrentClient::aliveSince() +{ + int32_t seqid = send_aliveSince(); + return recv_aliveSince(seqid); +} + +int32_t FacebookServiceConcurrentClient::send_aliveSince() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("aliveSince", ::apache::thrift::protocol::T_CALL, cseqid); + + FacebookService_aliveSince_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t FacebookServiceConcurrentClient::recv_aliveSince(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("aliveSince") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + FacebookService_aliveSince_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "aliveSince failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void FacebookServiceConcurrentClient::reinitialize() +{ + send_reinitialize(); +} + +void FacebookServiceConcurrentClient::send_reinitialize() +{ + int32_t cseqid = 0; + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("reinitialize", ::apache::thrift::protocol::T_ONEWAY, cseqid); + + FacebookService_reinitialize_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); +} + +void FacebookServiceConcurrentClient::shutdown() +{ + send_shutdown(); +} + +void FacebookServiceConcurrentClient::send_shutdown() +{ + int32_t cseqid = 0; + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("shutdown", ::apache::thrift::protocol::T_ONEWAY, cseqid); + + FacebookService_shutdown_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); +} + +}} // namespace + diff --git a/src/iceberg/catalog/hive/gen-cpp/FacebookService.h b/src/iceberg/catalog/hive/gen-cpp/FacebookService.h new file mode 100644 index 000000000..d53c459ac --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/FacebookService.h @@ -0,0 +1,1673 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef FacebookService_H +#define FacebookService_H + +#include +#include +#include +#include "fb303_types.h" + +namespace facebook { namespace fb303 { + +#ifdef _MSC_VER + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +/** + * Standard base service + */ +class FacebookServiceIf { + public: + virtual ~FacebookServiceIf() {} + + /** + * Returns a descriptive name of the service + */ + virtual void getName(std::string& _return) = 0; + + /** + * Returns the version of the service + */ + virtual void getVersion(std::string& _return) = 0; + + /** + * Gets the status of this service + */ + virtual fb_status::type getStatus() = 0; + + /** + * User friendly description of status, such as why the service is in + * the dead or warning state, or what is being started or stopped. + */ + virtual void getStatusDetails(std::string& _return) = 0; + + /** + * Gets the counters for this service + */ + virtual void getCounters(std::map & _return) = 0; + + /** + * Gets the value of a single counter + * + * @param key + */ + virtual int64_t getCounter(const std::string& key) = 0; + + /** + * Sets an option + * + * @param key + * @param value + */ + virtual void setOption(const std::string& key, const std::string& value) = 0; + + /** + * Gets an option + * + * @param key + */ + virtual void getOption(std::string& _return, const std::string& key) = 0; + + /** + * Gets all options + */ + virtual void getOptions(std::map & _return) = 0; + + /** + * Returns a CPU profile over the given time interval (client and server + * must agree on the profile format). + * + * @param profileDurationInSec + */ + virtual void getCpuProfile(std::string& _return, const int32_t profileDurationInSec) = 0; + + /** + * Returns the unix time that the server has been running since + */ + virtual int64_t aliveSince() = 0; + + /** + * Tell the server to reload its configuration, reopen log files, etc + */ + virtual void reinitialize() = 0; + + /** + * Suggest a shutdown to the server + */ + virtual void shutdown() = 0; +}; + +class FacebookServiceIfFactory { + public: + typedef FacebookServiceIf Handler; + + virtual ~FacebookServiceIfFactory() {} + + virtual FacebookServiceIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler(FacebookServiceIf* /* handler */) = 0; + }; + +class FacebookServiceIfSingletonFactory : virtual public FacebookServiceIfFactory { + public: + FacebookServiceIfSingletonFactory(const ::std::shared_ptr& iface) : iface_(iface) {} + virtual ~FacebookServiceIfSingletonFactory() {} + + virtual FacebookServiceIf* getHandler(const ::apache::thrift::TConnectionInfo&) override { + return iface_.get(); + } + virtual void releaseHandler(FacebookServiceIf* /* handler */) override {} + + protected: + ::std::shared_ptr iface_; +}; + +class FacebookServiceNull : virtual public FacebookServiceIf { + public: + virtual ~FacebookServiceNull() {} + void getName(std::string& /* _return */) override { + return; + } + void getVersion(std::string& /* _return */) override { + return; + } + fb_status::type getStatus() override { + fb_status::type _return = static_cast(0); + return _return; + } + void getStatusDetails(std::string& /* _return */) override { + return; + } + void getCounters(std::map & /* _return */) override { + return; + } + int64_t getCounter(const std::string& /* key */) override { + int64_t _return = 0; + return _return; + } + void setOption(const std::string& /* key */, const std::string& /* value */) override { + return; + } + void getOption(std::string& /* _return */, const std::string& /* key */) override { + return; + } + void getOptions(std::map & /* _return */) override { + return; + } + void getCpuProfile(std::string& /* _return */, const int32_t /* profileDurationInSec */) override { + return; + } + int64_t aliveSince() override { + int64_t _return = 0; + return _return; + } + void reinitialize() override { + return; + } + void shutdown() override { + return; + } +}; + + +class FacebookService_getName_args { + public: + + FacebookService_getName_args(const FacebookService_getName_args&) noexcept; + FacebookService_getName_args& operator=(const FacebookService_getName_args&) noexcept; + FacebookService_getName_args() noexcept; + + virtual ~FacebookService_getName_args() noexcept; + + bool operator == (const FacebookService_getName_args & /* rhs */) const; + bool operator != (const FacebookService_getName_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getName_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getName_pargs { + public: + + + virtual ~FacebookService_getName_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getName_result__isset { + _FacebookService_getName_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getName_result__isset; + +class FacebookService_getName_result { + public: + + FacebookService_getName_result(const FacebookService_getName_result&); + FacebookService_getName_result& operator=(const FacebookService_getName_result&); + FacebookService_getName_result() noexcept; + + virtual ~FacebookService_getName_result() noexcept; + std::string success; + + _FacebookService_getName_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const FacebookService_getName_result & rhs) const; + bool operator != (const FacebookService_getName_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getName_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getName_presult__isset { + _FacebookService_getName_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getName_presult__isset; + +class FacebookService_getName_presult { + public: + + + virtual ~FacebookService_getName_presult() noexcept; + std::string* success; + + _FacebookService_getName_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_getVersion_args { + public: + + FacebookService_getVersion_args(const FacebookService_getVersion_args&) noexcept; + FacebookService_getVersion_args& operator=(const FacebookService_getVersion_args&) noexcept; + FacebookService_getVersion_args() noexcept; + + virtual ~FacebookService_getVersion_args() noexcept; + + bool operator == (const FacebookService_getVersion_args & /* rhs */) const; + bool operator != (const FacebookService_getVersion_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getVersion_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getVersion_pargs { + public: + + + virtual ~FacebookService_getVersion_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getVersion_result__isset { + _FacebookService_getVersion_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getVersion_result__isset; + +class FacebookService_getVersion_result { + public: + + FacebookService_getVersion_result(const FacebookService_getVersion_result&); + FacebookService_getVersion_result& operator=(const FacebookService_getVersion_result&); + FacebookService_getVersion_result() noexcept; + + virtual ~FacebookService_getVersion_result() noexcept; + std::string success; + + _FacebookService_getVersion_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const FacebookService_getVersion_result & rhs) const; + bool operator != (const FacebookService_getVersion_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getVersion_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getVersion_presult__isset { + _FacebookService_getVersion_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getVersion_presult__isset; + +class FacebookService_getVersion_presult { + public: + + + virtual ~FacebookService_getVersion_presult() noexcept; + std::string* success; + + _FacebookService_getVersion_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_getStatus_args { + public: + + FacebookService_getStatus_args(const FacebookService_getStatus_args&) noexcept; + FacebookService_getStatus_args& operator=(const FacebookService_getStatus_args&) noexcept; + FacebookService_getStatus_args() noexcept; + + virtual ~FacebookService_getStatus_args() noexcept; + + bool operator == (const FacebookService_getStatus_args & /* rhs */) const; + bool operator != (const FacebookService_getStatus_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getStatus_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getStatus_pargs { + public: + + + virtual ~FacebookService_getStatus_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getStatus_result__isset { + _FacebookService_getStatus_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getStatus_result__isset; + +class FacebookService_getStatus_result { + public: + + FacebookService_getStatus_result(const FacebookService_getStatus_result&) noexcept; + FacebookService_getStatus_result& operator=(const FacebookService_getStatus_result&) noexcept; + FacebookService_getStatus_result() noexcept; + + virtual ~FacebookService_getStatus_result() noexcept; + /** + * + * @see fb_status + */ + fb_status::type success; + + _FacebookService_getStatus_result__isset __isset; + + void __set_success(const fb_status::type val); + + bool operator == (const FacebookService_getStatus_result & rhs) const; + bool operator != (const FacebookService_getStatus_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getStatus_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getStatus_presult__isset { + _FacebookService_getStatus_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getStatus_presult__isset; + +class FacebookService_getStatus_presult { + public: + + + virtual ~FacebookService_getStatus_presult() noexcept; + /** + * + * @see fb_status + */ + fb_status::type* success; + + _FacebookService_getStatus_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_getStatusDetails_args { + public: + + FacebookService_getStatusDetails_args(const FacebookService_getStatusDetails_args&) noexcept; + FacebookService_getStatusDetails_args& operator=(const FacebookService_getStatusDetails_args&) noexcept; + FacebookService_getStatusDetails_args() noexcept; + + virtual ~FacebookService_getStatusDetails_args() noexcept; + + bool operator == (const FacebookService_getStatusDetails_args & /* rhs */) const; + bool operator != (const FacebookService_getStatusDetails_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getStatusDetails_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getStatusDetails_pargs { + public: + + + virtual ~FacebookService_getStatusDetails_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getStatusDetails_result__isset { + _FacebookService_getStatusDetails_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getStatusDetails_result__isset; + +class FacebookService_getStatusDetails_result { + public: + + FacebookService_getStatusDetails_result(const FacebookService_getStatusDetails_result&); + FacebookService_getStatusDetails_result& operator=(const FacebookService_getStatusDetails_result&); + FacebookService_getStatusDetails_result() noexcept; + + virtual ~FacebookService_getStatusDetails_result() noexcept; + std::string success; + + _FacebookService_getStatusDetails_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const FacebookService_getStatusDetails_result & rhs) const; + bool operator != (const FacebookService_getStatusDetails_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getStatusDetails_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getStatusDetails_presult__isset { + _FacebookService_getStatusDetails_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getStatusDetails_presult__isset; + +class FacebookService_getStatusDetails_presult { + public: + + + virtual ~FacebookService_getStatusDetails_presult() noexcept; + std::string* success; + + _FacebookService_getStatusDetails_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_getCounters_args { + public: + + FacebookService_getCounters_args(const FacebookService_getCounters_args&) noexcept; + FacebookService_getCounters_args& operator=(const FacebookService_getCounters_args&) noexcept; + FacebookService_getCounters_args() noexcept; + + virtual ~FacebookService_getCounters_args() noexcept; + + bool operator == (const FacebookService_getCounters_args & /* rhs */) const; + bool operator != (const FacebookService_getCounters_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCounters_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getCounters_pargs { + public: + + + virtual ~FacebookService_getCounters_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCounters_result__isset { + _FacebookService_getCounters_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getCounters_result__isset; + +class FacebookService_getCounters_result { + public: + + FacebookService_getCounters_result(const FacebookService_getCounters_result&); + FacebookService_getCounters_result& operator=(const FacebookService_getCounters_result&); + FacebookService_getCounters_result() noexcept; + + virtual ~FacebookService_getCounters_result() noexcept; + std::map success; + + _FacebookService_getCounters_result__isset __isset; + + void __set_success(const std::map & val); + + bool operator == (const FacebookService_getCounters_result & rhs) const; + bool operator != (const FacebookService_getCounters_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCounters_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCounters_presult__isset { + _FacebookService_getCounters_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getCounters_presult__isset; + +class FacebookService_getCounters_presult { + public: + + + virtual ~FacebookService_getCounters_presult() noexcept; + std::map * success; + + _FacebookService_getCounters_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _FacebookService_getCounter_args__isset { + _FacebookService_getCounter_args__isset() : key(false) {} + bool key :1; +} _FacebookService_getCounter_args__isset; + +class FacebookService_getCounter_args { + public: + + FacebookService_getCounter_args(const FacebookService_getCounter_args&); + FacebookService_getCounter_args& operator=(const FacebookService_getCounter_args&); + FacebookService_getCounter_args() noexcept; + + virtual ~FacebookService_getCounter_args() noexcept; + std::string key; + + _FacebookService_getCounter_args__isset __isset; + + void __set_key(const std::string& val); + + bool operator == (const FacebookService_getCounter_args & rhs) const; + bool operator != (const FacebookService_getCounter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCounter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getCounter_pargs { + public: + + + virtual ~FacebookService_getCounter_pargs() noexcept; + const std::string* key; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCounter_result__isset { + _FacebookService_getCounter_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getCounter_result__isset; + +class FacebookService_getCounter_result { + public: + + FacebookService_getCounter_result(const FacebookService_getCounter_result&) noexcept; + FacebookService_getCounter_result& operator=(const FacebookService_getCounter_result&) noexcept; + FacebookService_getCounter_result() noexcept; + + virtual ~FacebookService_getCounter_result() noexcept; + int64_t success; + + _FacebookService_getCounter_result__isset __isset; + + void __set_success(const int64_t val); + + bool operator == (const FacebookService_getCounter_result & rhs) const; + bool operator != (const FacebookService_getCounter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCounter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCounter_presult__isset { + _FacebookService_getCounter_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getCounter_presult__isset; + +class FacebookService_getCounter_presult { + public: + + + virtual ~FacebookService_getCounter_presult() noexcept; + int64_t* success; + + _FacebookService_getCounter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _FacebookService_setOption_args__isset { + _FacebookService_setOption_args__isset() : key(false), value(false) {} + bool key :1; + bool value :1; +} _FacebookService_setOption_args__isset; + +class FacebookService_setOption_args { + public: + + FacebookService_setOption_args(const FacebookService_setOption_args&); + FacebookService_setOption_args& operator=(const FacebookService_setOption_args&); + FacebookService_setOption_args() noexcept; + + virtual ~FacebookService_setOption_args() noexcept; + std::string key; + std::string value; + + _FacebookService_setOption_args__isset __isset; + + void __set_key(const std::string& val); + + void __set_value(const std::string& val); + + bool operator == (const FacebookService_setOption_args & rhs) const; + bool operator != (const FacebookService_setOption_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_setOption_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_setOption_pargs { + public: + + + virtual ~FacebookService_setOption_pargs() noexcept; + const std::string* key; + const std::string* value; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_setOption_result { + public: + + FacebookService_setOption_result(const FacebookService_setOption_result&) noexcept; + FacebookService_setOption_result& operator=(const FacebookService_setOption_result&) noexcept; + FacebookService_setOption_result() noexcept; + + virtual ~FacebookService_setOption_result() noexcept; + + bool operator == (const FacebookService_setOption_result & /* rhs */) const; + bool operator != (const FacebookService_setOption_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_setOption_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_setOption_presult { + public: + + + virtual ~FacebookService_setOption_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _FacebookService_getOption_args__isset { + _FacebookService_getOption_args__isset() : key(false) {} + bool key :1; +} _FacebookService_getOption_args__isset; + +class FacebookService_getOption_args { + public: + + FacebookService_getOption_args(const FacebookService_getOption_args&); + FacebookService_getOption_args& operator=(const FacebookService_getOption_args&); + FacebookService_getOption_args() noexcept; + + virtual ~FacebookService_getOption_args() noexcept; + std::string key; + + _FacebookService_getOption_args__isset __isset; + + void __set_key(const std::string& val); + + bool operator == (const FacebookService_getOption_args & rhs) const; + bool operator != (const FacebookService_getOption_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getOption_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getOption_pargs { + public: + + + virtual ~FacebookService_getOption_pargs() noexcept; + const std::string* key; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getOption_result__isset { + _FacebookService_getOption_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getOption_result__isset; + +class FacebookService_getOption_result { + public: + + FacebookService_getOption_result(const FacebookService_getOption_result&); + FacebookService_getOption_result& operator=(const FacebookService_getOption_result&); + FacebookService_getOption_result() noexcept; + + virtual ~FacebookService_getOption_result() noexcept; + std::string success; + + _FacebookService_getOption_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const FacebookService_getOption_result & rhs) const; + bool operator != (const FacebookService_getOption_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getOption_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getOption_presult__isset { + _FacebookService_getOption_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getOption_presult__isset; + +class FacebookService_getOption_presult { + public: + + + virtual ~FacebookService_getOption_presult() noexcept; + std::string* success; + + _FacebookService_getOption_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_getOptions_args { + public: + + FacebookService_getOptions_args(const FacebookService_getOptions_args&) noexcept; + FacebookService_getOptions_args& operator=(const FacebookService_getOptions_args&) noexcept; + FacebookService_getOptions_args() noexcept; + + virtual ~FacebookService_getOptions_args() noexcept; + + bool operator == (const FacebookService_getOptions_args & /* rhs */) const; + bool operator != (const FacebookService_getOptions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getOptions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getOptions_pargs { + public: + + + virtual ~FacebookService_getOptions_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getOptions_result__isset { + _FacebookService_getOptions_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getOptions_result__isset; + +class FacebookService_getOptions_result { + public: + + FacebookService_getOptions_result(const FacebookService_getOptions_result&); + FacebookService_getOptions_result& operator=(const FacebookService_getOptions_result&); + FacebookService_getOptions_result() noexcept; + + virtual ~FacebookService_getOptions_result() noexcept; + std::map success; + + _FacebookService_getOptions_result__isset __isset; + + void __set_success(const std::map & val); + + bool operator == (const FacebookService_getOptions_result & rhs) const; + bool operator != (const FacebookService_getOptions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getOptions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getOptions_presult__isset { + _FacebookService_getOptions_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getOptions_presult__isset; + +class FacebookService_getOptions_presult { + public: + + + virtual ~FacebookService_getOptions_presult() noexcept; + std::map * success; + + _FacebookService_getOptions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _FacebookService_getCpuProfile_args__isset { + _FacebookService_getCpuProfile_args__isset() : profileDurationInSec(false) {} + bool profileDurationInSec :1; +} _FacebookService_getCpuProfile_args__isset; + +class FacebookService_getCpuProfile_args { + public: + + FacebookService_getCpuProfile_args(const FacebookService_getCpuProfile_args&) noexcept; + FacebookService_getCpuProfile_args& operator=(const FacebookService_getCpuProfile_args&) noexcept; + FacebookService_getCpuProfile_args() noexcept; + + virtual ~FacebookService_getCpuProfile_args() noexcept; + int32_t profileDurationInSec; + + _FacebookService_getCpuProfile_args__isset __isset; + + void __set_profileDurationInSec(const int32_t val); + + bool operator == (const FacebookService_getCpuProfile_args & rhs) const; + bool operator != (const FacebookService_getCpuProfile_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCpuProfile_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_getCpuProfile_pargs { + public: + + + virtual ~FacebookService_getCpuProfile_pargs() noexcept; + const int32_t* profileDurationInSec; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCpuProfile_result__isset { + _FacebookService_getCpuProfile_result__isset() : success(false) {} + bool success :1; +} _FacebookService_getCpuProfile_result__isset; + +class FacebookService_getCpuProfile_result { + public: + + FacebookService_getCpuProfile_result(const FacebookService_getCpuProfile_result&); + FacebookService_getCpuProfile_result& operator=(const FacebookService_getCpuProfile_result&); + FacebookService_getCpuProfile_result() noexcept; + + virtual ~FacebookService_getCpuProfile_result() noexcept; + std::string success; + + _FacebookService_getCpuProfile_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const FacebookService_getCpuProfile_result & rhs) const; + bool operator != (const FacebookService_getCpuProfile_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_getCpuProfile_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_getCpuProfile_presult__isset { + _FacebookService_getCpuProfile_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_getCpuProfile_presult__isset; + +class FacebookService_getCpuProfile_presult { + public: + + + virtual ~FacebookService_getCpuProfile_presult() noexcept; + std::string* success; + + _FacebookService_getCpuProfile_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_aliveSince_args { + public: + + FacebookService_aliveSince_args(const FacebookService_aliveSince_args&) noexcept; + FacebookService_aliveSince_args& operator=(const FacebookService_aliveSince_args&) noexcept; + FacebookService_aliveSince_args() noexcept; + + virtual ~FacebookService_aliveSince_args() noexcept; + + bool operator == (const FacebookService_aliveSince_args & /* rhs */) const; + bool operator != (const FacebookService_aliveSince_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_aliveSince_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_aliveSince_pargs { + public: + + + virtual ~FacebookService_aliveSince_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_aliveSince_result__isset { + _FacebookService_aliveSince_result__isset() : success(false) {} + bool success :1; +} _FacebookService_aliveSince_result__isset; + +class FacebookService_aliveSince_result { + public: + + FacebookService_aliveSince_result(const FacebookService_aliveSince_result&) noexcept; + FacebookService_aliveSince_result& operator=(const FacebookService_aliveSince_result&) noexcept; + FacebookService_aliveSince_result() noexcept; + + virtual ~FacebookService_aliveSince_result() noexcept; + int64_t success; + + _FacebookService_aliveSince_result__isset __isset; + + void __set_success(const int64_t val); + + bool operator == (const FacebookService_aliveSince_result & rhs) const; + bool operator != (const FacebookService_aliveSince_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_aliveSince_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _FacebookService_aliveSince_presult__isset { + _FacebookService_aliveSince_presult__isset() : success(false) {} + bool success :1; +} _FacebookService_aliveSince_presult__isset; + +class FacebookService_aliveSince_presult { + public: + + + virtual ~FacebookService_aliveSince_presult() noexcept; + int64_t* success; + + _FacebookService_aliveSince_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class FacebookService_reinitialize_args { + public: + + FacebookService_reinitialize_args(const FacebookService_reinitialize_args&) noexcept; + FacebookService_reinitialize_args& operator=(const FacebookService_reinitialize_args&) noexcept; + FacebookService_reinitialize_args() noexcept; + + virtual ~FacebookService_reinitialize_args() noexcept; + + bool operator == (const FacebookService_reinitialize_args & /* rhs */) const; + bool operator != (const FacebookService_reinitialize_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_reinitialize_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_reinitialize_pargs { + public: + + + virtual ~FacebookService_reinitialize_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_shutdown_args { + public: + + FacebookService_shutdown_args(const FacebookService_shutdown_args&) noexcept; + FacebookService_shutdown_args& operator=(const FacebookService_shutdown_args&) noexcept; + FacebookService_shutdown_args() noexcept; + + virtual ~FacebookService_shutdown_args() noexcept; + + bool operator == (const FacebookService_shutdown_args & /* rhs */) const; + bool operator != (const FacebookService_shutdown_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FacebookService_shutdown_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class FacebookService_shutdown_pargs { + public: + + + virtual ~FacebookService_shutdown_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +class FacebookServiceClient : virtual public FacebookServiceIf { + public: + FacebookServiceClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + FacebookServiceClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + /** + * Returns a descriptive name of the service + */ + void getName(std::string& _return) override; + void send_getName(); + void recv_getName(std::string& _return); + /** + * Returns the version of the service + */ + void getVersion(std::string& _return) override; + void send_getVersion(); + void recv_getVersion(std::string& _return); + /** + * Gets the status of this service + */ + fb_status::type getStatus() override; + void send_getStatus(); + fb_status::type recv_getStatus(); + /** + * User friendly description of status, such as why the service is in + * the dead or warning state, or what is being started or stopped. + */ + void getStatusDetails(std::string& _return) override; + void send_getStatusDetails(); + void recv_getStatusDetails(std::string& _return); + /** + * Gets the counters for this service + */ + void getCounters(std::map & _return) override; + void send_getCounters(); + void recv_getCounters(std::map & _return); + /** + * Gets the value of a single counter + * + * @param key + */ + int64_t getCounter(const std::string& key) override; + void send_getCounter(const std::string& key); + int64_t recv_getCounter(); + /** + * Sets an option + * + * @param key + * @param value + */ + void setOption(const std::string& key, const std::string& value) override; + void send_setOption(const std::string& key, const std::string& value); + void recv_setOption(); + /** + * Gets an option + * + * @param key + */ + void getOption(std::string& _return, const std::string& key) override; + void send_getOption(const std::string& key); + void recv_getOption(std::string& _return); + /** + * Gets all options + */ + void getOptions(std::map & _return) override; + void send_getOptions(); + void recv_getOptions(std::map & _return); + /** + * Returns a CPU profile over the given time interval (client and server + * must agree on the profile format). + * + * @param profileDurationInSec + */ + void getCpuProfile(std::string& _return, const int32_t profileDurationInSec) override; + void send_getCpuProfile(const int32_t profileDurationInSec); + void recv_getCpuProfile(std::string& _return); + /** + * Returns the unix time that the server has been running since + */ + int64_t aliveSince() override; + void send_aliveSince(); + int64_t recv_aliveSince(); + /** + * Tell the server to reload its configuration, reopen log files, etc + */ + void reinitialize() override; + void send_reinitialize(); + /** + * Suggest a shutdown to the server + */ + void shutdown() override; + void send_shutdown(); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; +}; + +class FacebookServiceProcessor : public ::apache::thrift::TDispatchProcessor { + protected: + ::std::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) override; + private: + typedef void (FacebookServiceProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_getName(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getVersion(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getStatusDetails(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getCounters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getCounter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_setOption(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getOption(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getOptions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getCpuProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_aliveSince(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_reinitialize(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_shutdown(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + FacebookServiceProcessor(::std::shared_ptr iface) : + iface_(iface) { + processMap_["getName"] = &FacebookServiceProcessor::process_getName; + processMap_["getVersion"] = &FacebookServiceProcessor::process_getVersion; + processMap_["getStatus"] = &FacebookServiceProcessor::process_getStatus; + processMap_["getStatusDetails"] = &FacebookServiceProcessor::process_getStatusDetails; + processMap_["getCounters"] = &FacebookServiceProcessor::process_getCounters; + processMap_["getCounter"] = &FacebookServiceProcessor::process_getCounter; + processMap_["setOption"] = &FacebookServiceProcessor::process_setOption; + processMap_["getOption"] = &FacebookServiceProcessor::process_getOption; + processMap_["getOptions"] = &FacebookServiceProcessor::process_getOptions; + processMap_["getCpuProfile"] = &FacebookServiceProcessor::process_getCpuProfile; + processMap_["aliveSince"] = &FacebookServiceProcessor::process_aliveSince; + processMap_["reinitialize"] = &FacebookServiceProcessor::process_reinitialize; + processMap_["shutdown"] = &FacebookServiceProcessor::process_shutdown; + } + + virtual ~FacebookServiceProcessor() {} +}; + +class FacebookServiceProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + FacebookServiceProcessorFactory(const ::std::shared_ptr< FacebookServiceIfFactory >& handlerFactory) noexcept : + handlerFactory_(handlerFactory) {} + + ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) override; + + protected: + ::std::shared_ptr< FacebookServiceIfFactory > handlerFactory_; +}; + +class FacebookServiceMultiface : virtual public FacebookServiceIf { + public: + FacebookServiceMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + } + virtual ~FacebookServiceMultiface() {} + protected: + std::vector > ifaces_; + FacebookServiceMultiface() {} + void add(::std::shared_ptr iface) { + ifaces_.push_back(iface); + } + public: + /** + * Returns a descriptive name of the service + */ + void getName(std::string& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getName(_return); + } + ifaces_[i]->getName(_return); + return; + } + + /** + * Returns the version of the service + */ + void getVersion(std::string& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getVersion(_return); + } + ifaces_[i]->getVersion(_return); + return; + } + + /** + * Gets the status of this service + */ + fb_status::type getStatus() override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getStatus(); + } + return ifaces_[i]->getStatus(); + } + + /** + * User friendly description of status, such as why the service is in + * the dead or warning state, or what is being started or stopped. + */ + void getStatusDetails(std::string& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getStatusDetails(_return); + } + ifaces_[i]->getStatusDetails(_return); + return; + } + + /** + * Gets the counters for this service + */ + void getCounters(std::map & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getCounters(_return); + } + ifaces_[i]->getCounters(_return); + return; + } + + /** + * Gets the value of a single counter + * + * @param key + */ + int64_t getCounter(const std::string& key) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getCounter(key); + } + return ifaces_[i]->getCounter(key); + } + + /** + * Sets an option + * + * @param key + * @param value + */ + void setOption(const std::string& key, const std::string& value) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->setOption(key, value); + } + ifaces_[i]->setOption(key, value); + } + + /** + * Gets an option + * + * @param key + */ + void getOption(std::string& _return, const std::string& key) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getOption(_return, key); + } + ifaces_[i]->getOption(_return, key); + return; + } + + /** + * Gets all options + */ + void getOptions(std::map & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getOptions(_return); + } + ifaces_[i]->getOptions(_return); + return; + } + + /** + * Returns a CPU profile over the given time interval (client and server + * must agree on the profile format). + * + * @param profileDurationInSec + */ + void getCpuProfile(std::string& _return, const int32_t profileDurationInSec) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getCpuProfile(_return, profileDurationInSec); + } + ifaces_[i]->getCpuProfile(_return, profileDurationInSec); + return; + } + + /** + * Returns the unix time that the server has been running since + */ + int64_t aliveSince() override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->aliveSince(); + } + return ifaces_[i]->aliveSince(); + } + + /** + * Tell the server to reload its configuration, reopen log files, etc + */ + void reinitialize() override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->reinitialize(); + } + ifaces_[i]->reinitialize(); + } + + /** + * Suggest a shutdown to the server + */ + void shutdown() override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->shutdown(); + } + ifaces_[i]->shutdown(); + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class FacebookServiceConcurrentClient : virtual public FacebookServiceIf { + public: + FacebookServiceConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot, std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync) +{ + setProtocol(prot); + } + FacebookServiceConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot, std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync) : sync_(sync) +{ + setProtocol(iprot,oprot); + } + private: + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + /** + * Returns a descriptive name of the service + */ + void getName(std::string& _return) override; + int32_t send_getName(); + void recv_getName(std::string& _return, const int32_t seqid); + /** + * Returns the version of the service + */ + void getVersion(std::string& _return) override; + int32_t send_getVersion(); + void recv_getVersion(std::string& _return, const int32_t seqid); + /** + * Gets the status of this service + */ + fb_status::type getStatus() override; + int32_t send_getStatus(); + fb_status::type recv_getStatus(const int32_t seqid); + /** + * User friendly description of status, such as why the service is in + * the dead or warning state, or what is being started or stopped. + */ + void getStatusDetails(std::string& _return) override; + int32_t send_getStatusDetails(); + void recv_getStatusDetails(std::string& _return, const int32_t seqid); + /** + * Gets the counters for this service + */ + void getCounters(std::map & _return) override; + int32_t send_getCounters(); + void recv_getCounters(std::map & _return, const int32_t seqid); + /** + * Gets the value of a single counter + * + * @param key + */ + int64_t getCounter(const std::string& key) override; + int32_t send_getCounter(const std::string& key); + int64_t recv_getCounter(const int32_t seqid); + /** + * Sets an option + * + * @param key + * @param value + */ + void setOption(const std::string& key, const std::string& value) override; + int32_t send_setOption(const std::string& key, const std::string& value); + void recv_setOption(const int32_t seqid); + /** + * Gets an option + * + * @param key + */ + void getOption(std::string& _return, const std::string& key) override; + int32_t send_getOption(const std::string& key); + void recv_getOption(std::string& _return, const int32_t seqid); + /** + * Gets all options + */ + void getOptions(std::map & _return) override; + int32_t send_getOptions(); + void recv_getOptions(std::map & _return, const int32_t seqid); + /** + * Returns a CPU profile over the given time interval (client and server + * must agree on the profile format). + * + * @param profileDurationInSec + */ + void getCpuProfile(std::string& _return, const int32_t profileDurationInSec) override; + int32_t send_getCpuProfile(const int32_t profileDurationInSec); + void recv_getCpuProfile(std::string& _return, const int32_t seqid); + /** + * Returns the unix time that the server has been running since + */ + int64_t aliveSince() override; + int32_t send_aliveSince(); + int64_t recv_aliveSince(const int32_t seqid); + /** + * Tell the server to reload its configuration, reopen log files, etc + */ + void reinitialize() override; + void send_reinitialize(); + /** + * Suggest a shutdown to the server + */ + void shutdown() override; + void send_shutdown(); + protected: + std::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + std::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; + std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync_; +}; + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + +}} // namespace + +#endif diff --git a/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.cpp b/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.cpp new file mode 100644 index 000000000..19fa0cf1a --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.cpp @@ -0,0 +1,126865 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "ThriftHiveMetastore.h" + +namespace Apache { namespace Hadoop { namespace Hive { + + +ThriftHiveMetastore_abort_Compactions_args::~ThriftHiveMetastore_abort_Compactions_args() noexcept { +} + +ThriftHiveMetastore_abort_Compactions_args::ThriftHiveMetastore_abort_Compactions_args() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_Compactions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_Compactions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_Compactions_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_Compactions_pargs::~ThriftHiveMetastore_abort_Compactions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_Compactions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_Compactions_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_Compactions_result::~ThriftHiveMetastore_abort_Compactions_result() noexcept { +} + +ThriftHiveMetastore_abort_Compactions_result::ThriftHiveMetastore_abort_Compactions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_Compactions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_Compactions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_Compactions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_Compactions_presult::~ThriftHiveMetastore_abort_Compactions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_Compactions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_getMetaConf_args::~ThriftHiveMetastore_getMetaConf_args() noexcept { +} + +ThriftHiveMetastore_getMetaConf_args::ThriftHiveMetastore_getMetaConf_args() noexcept + : key() { +} + +uint32_t ThriftHiveMetastore_getMetaConf_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_getMetaConf_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_getMetaConf_pargs::~ThriftHiveMetastore_getMetaConf_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_getMetaConf_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_getMetaConf_result::~ThriftHiveMetastore_getMetaConf_result() noexcept { +} + +ThriftHiveMetastore_getMetaConf_result::ThriftHiveMetastore_getMetaConf_result() noexcept + : success() { +} + +uint32_t ThriftHiveMetastore_getMetaConf_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_getMetaConf_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_getMetaConf_presult::~ThriftHiveMetastore_getMetaConf_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_getMetaConf_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_setMetaConf_args::~ThriftHiveMetastore_setMetaConf_args() noexcept { +} + +ThriftHiveMetastore_setMetaConf_args::ThriftHiveMetastore_setMetaConf_args() noexcept + : key(), + value() { +} + +uint32_t ThriftHiveMetastore_setMetaConf_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_setMetaConf_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->value); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_setMetaConf_pargs::~ThriftHiveMetastore_setMetaConf_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_setMetaConf_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->value))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_setMetaConf_result::~ThriftHiveMetastore_setMetaConf_result() noexcept { +} + +ThriftHiveMetastore_setMetaConf_result::ThriftHiveMetastore_setMetaConf_result() noexcept { +} + +uint32_t ThriftHiveMetastore_setMetaConf_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_setMetaConf_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_setMetaConf_presult::~ThriftHiveMetastore_setMetaConf_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_setMetaConf_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_catalog_args::~ThriftHiveMetastore_create_catalog_args() noexcept { +} + +ThriftHiveMetastore_create_catalog_args::ThriftHiveMetastore_create_catalog_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_catalog_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->catalog.read(iprot); + this->__isset.catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_catalog_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_catalog_args"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->catalog.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_catalog_pargs::~ThriftHiveMetastore_create_catalog_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_catalog_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_catalog_pargs"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->catalog)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_catalog_result::~ThriftHiveMetastore_create_catalog_result() noexcept { +} + +ThriftHiveMetastore_create_catalog_result::ThriftHiveMetastore_create_catalog_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_catalog_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_catalog_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_catalog_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_catalog_presult::~ThriftHiveMetastore_create_catalog_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_catalog_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_catalog_args::~ThriftHiveMetastore_alter_catalog_args() noexcept { +} + +ThriftHiveMetastore_alter_catalog_args::ThriftHiveMetastore_alter_catalog_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_catalog_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_catalog_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_catalog_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_catalog_pargs::~ThriftHiveMetastore_alter_catalog_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_catalog_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_catalog_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_catalog_result::~ThriftHiveMetastore_alter_catalog_result() noexcept { +} + +ThriftHiveMetastore_alter_catalog_result::ThriftHiveMetastore_alter_catalog_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_catalog_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_catalog_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_catalog_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_catalog_presult::~ThriftHiveMetastore_alter_catalog_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_catalog_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_catalog_args::~ThriftHiveMetastore_get_catalog_args() noexcept { +} + +ThriftHiveMetastore_get_catalog_args::ThriftHiveMetastore_get_catalog_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_catalog_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->catName.read(iprot); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_catalog_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalog_args"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->catName.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalog_pargs::~ThriftHiveMetastore_get_catalog_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_catalog_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalog_pargs"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->catName)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalog_result::~ThriftHiveMetastore_get_catalog_result() noexcept { +} + +ThriftHiveMetastore_get_catalog_result::ThriftHiveMetastore_get_catalog_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_catalog_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_catalog_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalog_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalog_presult::~ThriftHiveMetastore_get_catalog_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_catalog_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_catalogs_args::~ThriftHiveMetastore_get_catalogs_args() noexcept { +} + +ThriftHiveMetastore_get_catalogs_args::ThriftHiveMetastore_get_catalogs_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_catalogs_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_catalogs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalogs_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalogs_pargs::~ThriftHiveMetastore_get_catalogs_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_catalogs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalogs_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalogs_result::~ThriftHiveMetastore_get_catalogs_result() noexcept { +} + +ThriftHiveMetastore_get_catalogs_result::ThriftHiveMetastore_get_catalogs_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_catalogs_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_catalogs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_catalogs_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_catalogs_presult::~ThriftHiveMetastore_get_catalogs_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_catalogs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_catalog_args::~ThriftHiveMetastore_drop_catalog_args() noexcept { +} + +ThriftHiveMetastore_drop_catalog_args::ThriftHiveMetastore_drop_catalog_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_catalog_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->catName.read(iprot); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_catalog_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_catalog_args"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->catName.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_catalog_pargs::~ThriftHiveMetastore_drop_catalog_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_catalog_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_catalog_pargs"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->catName)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_catalog_result::~ThriftHiveMetastore_drop_catalog_result() noexcept { +} + +ThriftHiveMetastore_drop_catalog_result::ThriftHiveMetastore_drop_catalog_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_catalog_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_catalog_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_catalog_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_catalog_presult::~ThriftHiveMetastore_drop_catalog_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_catalog_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_database_args::~ThriftHiveMetastore_create_database_args() noexcept { +} + +ThriftHiveMetastore_create_database_args::ThriftHiveMetastore_create_database_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_database_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->database.read(iprot); + this->__isset.database = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_database_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_args"); + + xfer += oprot->writeFieldBegin("database", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->database.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_pargs::~ThriftHiveMetastore_create_database_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_database_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_pargs"); + + xfer += oprot->writeFieldBegin("database", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->database)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_result::~ThriftHiveMetastore_create_database_result() noexcept { +} + +ThriftHiveMetastore_create_database_result::ThriftHiveMetastore_create_database_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_database_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_database_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_presult::~ThriftHiveMetastore_create_database_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_database_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_database_req_args::~ThriftHiveMetastore_create_database_req_args() noexcept { +} + +ThriftHiveMetastore_create_database_req_args::ThriftHiveMetastore_create_database_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_database_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->createDatabaseRequest.read(iprot); + this->__isset.createDatabaseRequest = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_database_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_req_args"); + + xfer += oprot->writeFieldBegin("createDatabaseRequest", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->createDatabaseRequest.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_req_pargs::~ThriftHiveMetastore_create_database_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_database_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_req_pargs"); + + xfer += oprot->writeFieldBegin("createDatabaseRequest", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->createDatabaseRequest)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_req_result::~ThriftHiveMetastore_create_database_req_result() noexcept { +} + +ThriftHiveMetastore_create_database_req_result::ThriftHiveMetastore_create_database_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_database_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_database_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_database_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_database_req_presult::~ThriftHiveMetastore_create_database_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_database_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_database_args::~ThriftHiveMetastore_get_database_args() noexcept { +} + +ThriftHiveMetastore_get_database_args::ThriftHiveMetastore_get_database_args() noexcept + : name() { +} + +uint32_t ThriftHiveMetastore_get_database_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_database_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_pargs::~ThriftHiveMetastore_get_database_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_database_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_result::~ThriftHiveMetastore_get_database_result() noexcept { +} + +ThriftHiveMetastore_get_database_result::ThriftHiveMetastore_get_database_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_database_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_database_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_presult::~ThriftHiveMetastore_get_database_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_database_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_database_req_args::~ThriftHiveMetastore_get_database_req_args() noexcept { +} + +ThriftHiveMetastore_get_database_req_args::ThriftHiveMetastore_get_database_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_database_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_database_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_req_pargs::~ThriftHiveMetastore_get_database_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_database_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_req_result::~ThriftHiveMetastore_get_database_req_result() noexcept { +} + +ThriftHiveMetastore_get_database_req_result::ThriftHiveMetastore_get_database_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_database_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_database_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_database_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_database_req_presult::~ThriftHiveMetastore_get_database_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_database_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_database_args::~ThriftHiveMetastore_drop_database_args() noexcept { +} + +ThriftHiveMetastore_drop_database_args::ThriftHiveMetastore_drop_database_args() noexcept + : name(), + deleteData(0), + cascade(0) { +} + +uint32_t ThriftHiveMetastore_drop_database_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->cascade); + this->__isset.cascade = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_database_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cascade", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->cascade); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_pargs::~ThriftHiveMetastore_drop_database_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_database_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cascade", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool((*(this->cascade))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_result::~ThriftHiveMetastore_drop_database_result() noexcept { +} + +ThriftHiveMetastore_drop_database_result::ThriftHiveMetastore_drop_database_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_database_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_database_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_presult::~ThriftHiveMetastore_drop_database_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_database_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_database_req_args::~ThriftHiveMetastore_drop_database_req_args() noexcept { +} + +ThriftHiveMetastore_drop_database_req_args::ThriftHiveMetastore_drop_database_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_database_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_database_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_req_pargs::~ThriftHiveMetastore_drop_database_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_database_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_req_result::~ThriftHiveMetastore_drop_database_req_result() noexcept { +} + +ThriftHiveMetastore_drop_database_req_result::ThriftHiveMetastore_drop_database_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_database_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_database_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_database_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_database_req_presult::~ThriftHiveMetastore_drop_database_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_database_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_databases_args::~ThriftHiveMetastore_get_databases_args() noexcept { +} + +ThriftHiveMetastore_get_databases_args::ThriftHiveMetastore_get_databases_args() noexcept + : pattern() { +} + +uint32_t ThriftHiveMetastore_get_databases_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pattern); + this->__isset.pattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_databases_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_databases_args"); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_databases_pargs::~ThriftHiveMetastore_get_databases_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_databases_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_databases_pargs"); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_databases_result::~ThriftHiveMetastore_get_databases_result() noexcept { +} + +ThriftHiveMetastore_get_databases_result::ThriftHiveMetastore_get_databases_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_databases_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1887; + ::apache::thrift::protocol::TType _etype1890; + xfer += iprot->readListBegin(_etype1890, _size1887); + this->success.resize(_size1887); + uint32_t _i1891; + for (_i1891 = 0; _i1891 < _size1887; ++_i1891) + { + xfer += iprot->readString(this->success[_i1891]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_databases_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_databases_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter1892; + for (_iter1892 = this->success.begin(); _iter1892 != this->success.end(); ++_iter1892) + { + xfer += oprot->writeString((*_iter1892)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_databases_presult::~ThriftHiveMetastore_get_databases_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_databases_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1893; + ::apache::thrift::protocol::TType _etype1896; + xfer += iprot->readListBegin(_etype1896, _size1893); + (*(this->success)).resize(_size1893); + uint32_t _i1897; + for (_i1897 = 0; _i1897 < _size1893; ++_i1897) + { + xfer += iprot->readString((*(this->success))[_i1897]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_databases_args::~ThriftHiveMetastore_get_all_databases_args() noexcept { +} + +ThriftHiveMetastore_get_all_databases_args::ThriftHiveMetastore_get_all_databases_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_databases_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_databases_pargs::~ThriftHiveMetastore_get_all_databases_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_databases_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_databases_result::~ThriftHiveMetastore_get_all_databases_result() noexcept { +} + +ThriftHiveMetastore_get_all_databases_result::ThriftHiveMetastore_get_all_databases_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_databases_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1898; + ::apache::thrift::protocol::TType _etype1901; + xfer += iprot->readListBegin(_etype1901, _size1898); + this->success.resize(_size1898); + uint32_t _i1902; + for (_i1902 = 0; _i1902 < _size1898; ++_i1902) + { + xfer += iprot->readString(this->success[_i1902]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_databases_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_databases_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter1903; + for (_iter1903 = this->success.begin(); _iter1903 != this->success.end(); ++_iter1903) + { + xfer += oprot->writeString((*_iter1903)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_databases_presult::~ThriftHiveMetastore_get_all_databases_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_databases_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1904; + ::apache::thrift::protocol::TType _etype1907; + xfer += iprot->readListBegin(_etype1907, _size1904); + (*(this->success)).resize(_size1904); + uint32_t _i1908; + for (_i1908 = 0; _i1908 < _size1904; ++_i1908) + { + xfer += iprot->readString((*(this->success))[_i1908]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_database_args::~ThriftHiveMetastore_alter_database_args() noexcept { +} + +ThriftHiveMetastore_alter_database_args::ThriftHiveMetastore_alter_database_args() noexcept + : dbname() { +} + +uint32_t ThriftHiveMetastore_alter_database_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->db.read(iprot); + this->__isset.db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_database_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->db.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_pargs::~ThriftHiveMetastore_alter_database_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_database_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->db)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_result::~ThriftHiveMetastore_alter_database_result() noexcept { +} + +ThriftHiveMetastore_alter_database_result::ThriftHiveMetastore_alter_database_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_database_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_database_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_presult::~ThriftHiveMetastore_alter_database_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_database_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_database_req_args::~ThriftHiveMetastore_alter_database_req_args() noexcept { +} + +ThriftHiveMetastore_alter_database_req_args::ThriftHiveMetastore_alter_database_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_database_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->alterDbReq.read(iprot); + this->__isset.alterDbReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_database_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_req_args"); + + xfer += oprot->writeFieldBegin("alterDbReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->alterDbReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_req_pargs::~ThriftHiveMetastore_alter_database_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_database_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_req_pargs"); + + xfer += oprot->writeFieldBegin("alterDbReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->alterDbReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_req_result::~ThriftHiveMetastore_alter_database_req_result() noexcept { +} + +ThriftHiveMetastore_alter_database_req_result::ThriftHiveMetastore_alter_database_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_database_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_database_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_database_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_database_req_presult::~ThriftHiveMetastore_alter_database_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_database_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_dataconnector_req_args::~ThriftHiveMetastore_create_dataconnector_req_args() noexcept { +} + +ThriftHiveMetastore_create_dataconnector_req_args::ThriftHiveMetastore_create_dataconnector_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_dataconnector_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->connectorReq.read(iprot); + this->__isset.connectorReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_dataconnector_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_dataconnector_req_args"); + + xfer += oprot->writeFieldBegin("connectorReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->connectorReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_dataconnector_req_pargs::~ThriftHiveMetastore_create_dataconnector_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_dataconnector_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_dataconnector_req_pargs"); + + xfer += oprot->writeFieldBegin("connectorReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->connectorReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_dataconnector_req_result::~ThriftHiveMetastore_create_dataconnector_req_result() noexcept { +} + +ThriftHiveMetastore_create_dataconnector_req_result::ThriftHiveMetastore_create_dataconnector_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_dataconnector_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_dataconnector_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_dataconnector_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_dataconnector_req_presult::~ThriftHiveMetastore_create_dataconnector_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_dataconnector_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_dataconnector_req_args::~ThriftHiveMetastore_get_dataconnector_req_args() noexcept { +} + +ThriftHiveMetastore_get_dataconnector_req_args::ThriftHiveMetastore_get_dataconnector_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_dataconnector_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_dataconnector_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnector_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnector_req_pargs::~ThriftHiveMetastore_get_dataconnector_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_dataconnector_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnector_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnector_req_result::~ThriftHiveMetastore_get_dataconnector_req_result() noexcept { +} + +ThriftHiveMetastore_get_dataconnector_req_result::ThriftHiveMetastore_get_dataconnector_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_dataconnector_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_dataconnector_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnector_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnector_req_presult::~ThriftHiveMetastore_get_dataconnector_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_dataconnector_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_dataconnector_req_args::~ThriftHiveMetastore_drop_dataconnector_req_args() noexcept { +} + +ThriftHiveMetastore_drop_dataconnector_req_args::ThriftHiveMetastore_drop_dataconnector_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dropDcReq.read(iprot); + this->__isset.dropDcReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_dataconnector_req_args"); + + xfer += oprot->writeFieldBegin("dropDcReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->dropDcReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_dataconnector_req_pargs::~ThriftHiveMetastore_drop_dataconnector_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_dataconnector_req_pargs"); + + xfer += oprot->writeFieldBegin("dropDcReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->dropDcReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_dataconnector_req_result::~ThriftHiveMetastore_drop_dataconnector_req_result() noexcept { +} + +ThriftHiveMetastore_drop_dataconnector_req_result::ThriftHiveMetastore_drop_dataconnector_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_dataconnector_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_dataconnector_req_presult::~ThriftHiveMetastore_drop_dataconnector_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_dataconnector_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_dataconnectors_args::~ThriftHiveMetastore_get_dataconnectors_args() noexcept { +} + +ThriftHiveMetastore_get_dataconnectors_args::ThriftHiveMetastore_get_dataconnectors_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_dataconnectors_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_dataconnectors_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnectors_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnectors_pargs::~ThriftHiveMetastore_get_dataconnectors_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_dataconnectors_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnectors_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnectors_result::~ThriftHiveMetastore_get_dataconnectors_result() noexcept { +} + +ThriftHiveMetastore_get_dataconnectors_result::ThriftHiveMetastore_get_dataconnectors_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_dataconnectors_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1909; + ::apache::thrift::protocol::TType _etype1912; + xfer += iprot->readListBegin(_etype1912, _size1909); + this->success.resize(_size1909); + uint32_t _i1913; + for (_i1913 = 0; _i1913 < _size1909; ++_i1913) + { + xfer += iprot->readString(this->success[_i1913]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_dataconnectors_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_dataconnectors_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter1914; + for (_iter1914 = this->success.begin(); _iter1914 != this->success.end(); ++_iter1914) + { + xfer += oprot->writeString((*_iter1914)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_dataconnectors_presult::~ThriftHiveMetastore_get_dataconnectors_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_dataconnectors_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1915; + ::apache::thrift::protocol::TType _etype1918; + xfer += iprot->readListBegin(_etype1918, _size1915); + (*(this->success)).resize(_size1915); + uint32_t _i1919; + for (_i1919 = 0; _i1919 < _size1915; ++_i1919) + { + xfer += iprot->readString((*(this->success))[_i1919]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_dataconnector_req_args::~ThriftHiveMetastore_alter_dataconnector_req_args() noexcept { +} + +ThriftHiveMetastore_alter_dataconnector_req_args::ThriftHiveMetastore_alter_dataconnector_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->alterReq.read(iprot); + this->__isset.alterReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_dataconnector_req_args"); + + xfer += oprot->writeFieldBegin("alterReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->alterReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_dataconnector_req_pargs::~ThriftHiveMetastore_alter_dataconnector_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_dataconnector_req_pargs"); + + xfer += oprot->writeFieldBegin("alterReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->alterReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_dataconnector_req_result::~ThriftHiveMetastore_alter_dataconnector_req_result() noexcept { +} + +ThriftHiveMetastore_alter_dataconnector_req_result::ThriftHiveMetastore_alter_dataconnector_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_dataconnector_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_dataconnector_req_presult::~ThriftHiveMetastore_alter_dataconnector_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_dataconnector_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_type_args::~ThriftHiveMetastore_get_type_args() noexcept { +} + +ThriftHiveMetastore_get_type_args::ThriftHiveMetastore_get_type_args() noexcept + : name() { +} + +uint32_t ThriftHiveMetastore_get_type_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_type_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_pargs::~ThriftHiveMetastore_get_type_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_type_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_result::~ThriftHiveMetastore_get_type_result() noexcept { +} + +ThriftHiveMetastore_get_type_result::ThriftHiveMetastore_get_type_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_type_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_type_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_presult::~ThriftHiveMetastore_get_type_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_type_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_type_args::~ThriftHiveMetastore_create_type_args() noexcept { +} + +ThriftHiveMetastore_create_type_args::ThriftHiveMetastore_create_type_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_type_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->type.read(iprot); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_type_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_type_args"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->type.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_type_pargs::~ThriftHiveMetastore_create_type_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_type_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_type_pargs"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->type)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_type_result::~ThriftHiveMetastore_create_type_result() noexcept { +} + +ThriftHiveMetastore_create_type_result::ThriftHiveMetastore_create_type_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_create_type_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_type_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_type_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_type_presult::~ThriftHiveMetastore_create_type_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_type_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_type_args::~ThriftHiveMetastore_drop_type_args() noexcept { +} + +ThriftHiveMetastore_drop_type_args::ThriftHiveMetastore_drop_type_args() noexcept + : type() { +} + +uint32_t ThriftHiveMetastore_drop_type_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_type_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_type_args"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->type); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_type_pargs::~ThriftHiveMetastore_drop_type_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_type_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_type_pargs"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->type))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_type_result::~ThriftHiveMetastore_drop_type_result() noexcept { +} + +ThriftHiveMetastore_drop_type_result::ThriftHiveMetastore_drop_type_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_type_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_type_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_type_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_type_presult::~ThriftHiveMetastore_drop_type_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_type_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_type_all_args::~ThriftHiveMetastore_get_type_all_args() noexcept { +} + +ThriftHiveMetastore_get_type_all_args::ThriftHiveMetastore_get_type_all_args() noexcept + : name() { +} + +uint32_t ThriftHiveMetastore_get_type_all_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_type_all_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_all_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_all_pargs::~ThriftHiveMetastore_get_type_all_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_type_all_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_all_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_all_result::~ThriftHiveMetastore_get_type_all_result() noexcept { +} + +ThriftHiveMetastore_get_type_all_result::ThriftHiveMetastore_get_type_all_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_type_all_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size1920; + ::apache::thrift::protocol::TType _ktype1921; + ::apache::thrift::protocol::TType _vtype1922; + xfer += iprot->readMapBegin(_ktype1921, _vtype1922, _size1920); + uint32_t _i1924; + for (_i1924 = 0; _i1924 < _size1920; ++_i1924) + { + std::string _key1925; + xfer += iprot->readString(_key1925); + Type& _val1926 = this->success[_key1925]; + xfer += _val1926.read(iprot); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_type_all_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_type_all_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::map ::const_iterator _iter1927; + for (_iter1927 = this->success.begin(); _iter1927 != this->success.end(); ++_iter1927) + { + xfer += oprot->writeString(_iter1927->first); + xfer += _iter1927->second.write(oprot); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_type_all_presult::~ThriftHiveMetastore_get_type_all_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_type_all_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size1928; + ::apache::thrift::protocol::TType _ktype1929; + ::apache::thrift::protocol::TType _vtype1930; + xfer += iprot->readMapBegin(_ktype1929, _vtype1930, _size1928); + uint32_t _i1932; + for (_i1932 = 0; _i1932 < _size1928; ++_i1932) + { + std::string _key1933; + xfer += iprot->readString(_key1933); + Type& _val1934 = (*(this->success))[_key1933]; + xfer += _val1934.read(iprot); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_fields_args::~ThriftHiveMetastore_get_fields_args() noexcept { +} + +ThriftHiveMetastore_get_fields_args::ThriftHiveMetastore_get_fields_args() noexcept + : db_name(), + table_name() { +} + +uint32_t ThriftHiveMetastore_get_fields_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_pargs::~ThriftHiveMetastore_get_fields_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_result::~ThriftHiveMetastore_get_fields_result() noexcept { +} + +ThriftHiveMetastore_get_fields_result::ThriftHiveMetastore_get_fields_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_fields_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1935; + ::apache::thrift::protocol::TType _etype1938; + xfer += iprot->readListBegin(_etype1938, _size1935); + this->success.resize(_size1935); + uint32_t _i1939; + for (_i1939 = 0; _i1939 < _size1935; ++_i1939) + { + xfer += this->success[_i1939].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter1940; + for (_iter1940 = this->success.begin(); _iter1940 != this->success.end(); ++_iter1940) + { + xfer += (*_iter1940).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_presult::~ThriftHiveMetastore_get_fields_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1941; + ::apache::thrift::protocol::TType _etype1944; + xfer += iprot->readListBegin(_etype1944, _size1941); + (*(this->success)).resize(_size1941); + uint32_t _i1945; + for (_i1945 = 0; _i1945 < _size1941; ++_i1945) + { + xfer += (*(this->success))[_i1945].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_fields_with_environment_context_args::~ThriftHiveMetastore_get_fields_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_get_fields_with_environment_context_args::ThriftHiveMetastore_get_fields_with_environment_context_args() noexcept + : db_name(), + table_name() { +} + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_with_environment_context_pargs::~ThriftHiveMetastore_get_fields_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_with_environment_context_result::~ThriftHiveMetastore_get_fields_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_get_fields_with_environment_context_result::ThriftHiveMetastore_get_fields_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1946; + ::apache::thrift::protocol::TType _etype1949; + xfer += iprot->readListBegin(_etype1949, _size1946); + this->success.resize(_size1946); + uint32_t _i1950; + for (_i1950 = 0; _i1950 < _size1946; ++_i1950) + { + xfer += this->success[_i1950].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter1951; + for (_iter1951 = this->success.begin(); _iter1951 != this->success.end(); ++_iter1951) + { + xfer += (*_iter1951).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_with_environment_context_presult::~ThriftHiveMetastore_get_fields_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1952; + ::apache::thrift::protocol::TType _etype1955; + xfer += iprot->readListBegin(_etype1955, _size1952); + (*(this->success)).resize(_size1952); + uint32_t _i1956; + for (_i1956 = 0; _i1956 < _size1952; ++_i1956) + { + xfer += (*(this->success))[_i1956].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_fields_req_args::~ThriftHiveMetastore_get_fields_req_args() noexcept { +} + +ThriftHiveMetastore_get_fields_req_args::ThriftHiveMetastore_get_fields_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_fields_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_req_pargs::~ThriftHiveMetastore_get_fields_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_req_result::~ThriftHiveMetastore_get_fields_req_result() noexcept { +} + +ThriftHiveMetastore_get_fields_req_result::ThriftHiveMetastore_get_fields_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_fields_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_fields_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_fields_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_fields_req_presult::~ThriftHiveMetastore_get_fields_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_fields_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_args::~ThriftHiveMetastore_get_schema_args() noexcept { +} + +ThriftHiveMetastore_get_schema_args::ThriftHiveMetastore_get_schema_args() noexcept + : db_name(), + table_name() { +} + +uint32_t ThriftHiveMetastore_get_schema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_pargs::~ThriftHiveMetastore_get_schema_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_result::~ThriftHiveMetastore_get_schema_result() noexcept { +} + +ThriftHiveMetastore_get_schema_result::ThriftHiveMetastore_get_schema_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1957; + ::apache::thrift::protocol::TType _etype1960; + xfer += iprot->readListBegin(_etype1960, _size1957); + this->success.resize(_size1957); + uint32_t _i1961; + for (_i1961 = 0; _i1961 < _size1957; ++_i1961) + { + xfer += this->success[_i1961].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter1962; + for (_iter1962 = this->success.begin(); _iter1962 != this->success.end(); ++_iter1962) + { + xfer += (*_iter1962).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_presult::~ThriftHiveMetastore_get_schema_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1963; + ::apache::thrift::protocol::TType _etype1966; + xfer += iprot->readListBegin(_etype1966, _size1963); + (*(this->success)).resize(_size1963); + uint32_t _i1967; + for (_i1967 = 0; _i1967 < _size1963; ++_i1967) + { + xfer += (*(this->success))[_i1967].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_with_environment_context_args::~ThriftHiveMetastore_get_schema_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_get_schema_with_environment_context_args::ThriftHiveMetastore_get_schema_with_environment_context_args() noexcept + : db_name(), + table_name() { +} + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_with_environment_context_pargs::~ThriftHiveMetastore_get_schema_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_with_environment_context_result::~ThriftHiveMetastore_get_schema_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_get_schema_with_environment_context_result::ThriftHiveMetastore_get_schema_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size1968; + ::apache::thrift::protocol::TType _etype1971; + xfer += iprot->readListBegin(_etype1971, _size1968); + this->success.resize(_size1968); + uint32_t _i1972; + for (_i1972 = 0; _i1972 < _size1968; ++_i1972) + { + xfer += this->success[_i1972].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter1973; + for (_iter1973 = this->success.begin(); _iter1973 != this->success.end(); ++_iter1973) + { + xfer += (*_iter1973).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_with_environment_context_presult::~ThriftHiveMetastore_get_schema_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size1974; + ::apache::thrift::protocol::TType _etype1977; + xfer += iprot->readListBegin(_etype1977, _size1974); + (*(this->success)).resize(_size1974); + uint32_t _i1978; + for (_i1978 = 0; _i1978 < _size1974; ++_i1978) + { + xfer += (*(this->success))[_i1978].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_req_args::~ThriftHiveMetastore_get_schema_req_args() noexcept { +} + +ThriftHiveMetastore_get_schema_req_args::ThriftHiveMetastore_get_schema_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_req_pargs::~ThriftHiveMetastore_get_schema_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_req_result::~ThriftHiveMetastore_get_schema_req_result() noexcept { +} + +ThriftHiveMetastore_get_schema_req_result::ThriftHiveMetastore_get_schema_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_req_presult::~ThriftHiveMetastore_get_schema_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_table_args::~ThriftHiveMetastore_create_table_args() noexcept { +} + +ThriftHiveMetastore_create_table_args::ThriftHiveMetastore_create_table_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->tbl.read(iprot); + this->__isset.tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_args"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_pargs::~ThriftHiveMetastore_create_table_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_pargs"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_result::~ThriftHiveMetastore_create_table_result() noexcept { +} + +ThriftHiveMetastore_create_table_result::ThriftHiveMetastore_create_table_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_presult::~ThriftHiveMetastore_create_table_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_table_with_environment_context_args::~ThriftHiveMetastore_create_table_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_create_table_with_environment_context_args::ThriftHiveMetastore_create_table_with_environment_context_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->tbl.read(iprot); + this->__isset.tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_environment_context_pargs::~ThriftHiveMetastore_create_table_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_environment_context_result::~ThriftHiveMetastore_create_table_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_create_table_with_environment_context_result::ThriftHiveMetastore_create_table_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_environment_context_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_environment_context_presult::~ThriftHiveMetastore_create_table_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_table_with_constraints_args::~ThriftHiveMetastore_create_table_with_constraints_args() noexcept { +} + +ThriftHiveMetastore_create_table_with_constraints_args::ThriftHiveMetastore_create_table_with_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_with_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->tbl.read(iprot); + this->__isset.tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->primaryKeys.clear(); + uint32_t _size1979; + ::apache::thrift::protocol::TType _etype1982; + xfer += iprot->readListBegin(_etype1982, _size1979); + this->primaryKeys.resize(_size1979); + uint32_t _i1983; + for (_i1983 = 0; _i1983 < _size1979; ++_i1983) + { + xfer += this->primaryKeys[_i1983].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.primaryKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->foreignKeys.clear(); + uint32_t _size1984; + ::apache::thrift::protocol::TType _etype1987; + xfer += iprot->readListBegin(_etype1987, _size1984); + this->foreignKeys.resize(_size1984); + uint32_t _i1988; + for (_i1988 = 0; _i1988 < _size1984; ++_i1988) + { + xfer += this->foreignKeys[_i1988].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.foreignKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->uniqueConstraints.clear(); + uint32_t _size1989; + ::apache::thrift::protocol::TType _etype1992; + xfer += iprot->readListBegin(_etype1992, _size1989); + this->uniqueConstraints.resize(_size1989); + uint32_t _i1993; + for (_i1993 = 0; _i1993 < _size1989; ++_i1993) + { + xfer += this->uniqueConstraints[_i1993].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.uniqueConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->notNullConstraints.clear(); + uint32_t _size1994; + ::apache::thrift::protocol::TType _etype1997; + xfer += iprot->readListBegin(_etype1997, _size1994); + this->notNullConstraints.resize(_size1994); + uint32_t _i1998; + for (_i1998 = 0; _i1998 < _size1994; ++_i1998) + { + xfer += this->notNullConstraints[_i1998].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.notNullConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->defaultConstraints.clear(); + uint32_t _size1999; + ::apache::thrift::protocol::TType _etype2002; + xfer += iprot->readListBegin(_etype2002, _size1999); + this->defaultConstraints.resize(_size1999); + uint32_t _i2003; + for (_i2003 = 0; _i2003 < _size1999; ++_i2003) + { + xfer += this->defaultConstraints[_i2003].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.defaultConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->checkConstraints.clear(); + uint32_t _size2004; + ::apache::thrift::protocol::TType _etype2007; + xfer += iprot->readListBegin(_etype2007, _size2004); + this->checkConstraints.resize(_size2004); + uint32_t _i2008; + for (_i2008 = 0; _i2008 < _size2004; ++_i2008) + { + xfer += this->checkConstraints[_i2008].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.checkConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_with_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_constraints_args"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("primaryKeys", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->primaryKeys.size())); + std::vector ::const_iterator _iter2009; + for (_iter2009 = this->primaryKeys.begin(); _iter2009 != this->primaryKeys.end(); ++_iter2009) + { + xfer += (*_iter2009).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("foreignKeys", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->foreignKeys.size())); + std::vector ::const_iterator _iter2010; + for (_iter2010 = this->foreignKeys.begin(); _iter2010 != this->foreignKeys.end(); ++_iter2010) + { + xfer += (*_iter2010).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("uniqueConstraints", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->uniqueConstraints.size())); + std::vector ::const_iterator _iter2011; + for (_iter2011 = this->uniqueConstraints.begin(); _iter2011 != this->uniqueConstraints.end(); ++_iter2011) + { + xfer += (*_iter2011).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("notNullConstraints", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->notNullConstraints.size())); + std::vector ::const_iterator _iter2012; + for (_iter2012 = this->notNullConstraints.begin(); _iter2012 != this->notNullConstraints.end(); ++_iter2012) + { + xfer += (*_iter2012).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("defaultConstraints", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->defaultConstraints.size())); + std::vector ::const_iterator _iter2013; + for (_iter2013 = this->defaultConstraints.begin(); _iter2013 != this->defaultConstraints.end(); ++_iter2013) + { + xfer += (*_iter2013).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("checkConstraints", ::apache::thrift::protocol::T_LIST, 7); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->checkConstraints.size())); + std::vector ::const_iterator _iter2014; + for (_iter2014 = this->checkConstraints.begin(); _iter2014 != this->checkConstraints.end(); ++_iter2014) + { + xfer += (*_iter2014).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_constraints_pargs::~ThriftHiveMetastore_create_table_with_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_with_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_constraints_pargs"); + + xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("primaryKeys", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->primaryKeys)).size())); + std::vector ::const_iterator _iter2015; + for (_iter2015 = (*(this->primaryKeys)).begin(); _iter2015 != (*(this->primaryKeys)).end(); ++_iter2015) + { + xfer += (*_iter2015).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("foreignKeys", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->foreignKeys)).size())); + std::vector ::const_iterator _iter2016; + for (_iter2016 = (*(this->foreignKeys)).begin(); _iter2016 != (*(this->foreignKeys)).end(); ++_iter2016) + { + xfer += (*_iter2016).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("uniqueConstraints", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->uniqueConstraints)).size())); + std::vector ::const_iterator _iter2017; + for (_iter2017 = (*(this->uniqueConstraints)).begin(); _iter2017 != (*(this->uniqueConstraints)).end(); ++_iter2017) + { + xfer += (*_iter2017).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("notNullConstraints", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->notNullConstraints)).size())); + std::vector ::const_iterator _iter2018; + for (_iter2018 = (*(this->notNullConstraints)).begin(); _iter2018 != (*(this->notNullConstraints)).end(); ++_iter2018) + { + xfer += (*_iter2018).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("defaultConstraints", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->defaultConstraints)).size())); + std::vector ::const_iterator _iter2019; + for (_iter2019 = (*(this->defaultConstraints)).begin(); _iter2019 != (*(this->defaultConstraints)).end(); ++_iter2019) + { + xfer += (*_iter2019).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("checkConstraints", ::apache::thrift::protocol::T_LIST, 7); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->checkConstraints)).size())); + std::vector ::const_iterator _iter2020; + for (_iter2020 = (*(this->checkConstraints)).begin(); _iter2020 != (*(this->checkConstraints)).end(); ++_iter2020) + { + xfer += (*_iter2020).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_constraints_result::~ThriftHiveMetastore_create_table_with_constraints_result() noexcept { +} + +ThriftHiveMetastore_create_table_with_constraints_result::ThriftHiveMetastore_create_table_with_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_with_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_with_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_with_constraints_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_with_constraints_presult::~ThriftHiveMetastore_create_table_with_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_with_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_table_req_args::~ThriftHiveMetastore_create_table_req_args() noexcept { +} + +ThriftHiveMetastore_create_table_req_args::ThriftHiveMetastore_create_table_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_req_pargs::~ThriftHiveMetastore_create_table_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_req_result::~ThriftHiveMetastore_create_table_req_result() noexcept { +} + +ThriftHiveMetastore_create_table_req_result::ThriftHiveMetastore_create_table_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_table_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_table_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_table_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_table_req_presult::~ThriftHiveMetastore_create_table_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_table_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_constraint_args::~ThriftHiveMetastore_drop_constraint_args() noexcept { +} + +ThriftHiveMetastore_drop_constraint_args::ThriftHiveMetastore_drop_constraint_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_constraint_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_constraint_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_constraint_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_constraint_pargs::~ThriftHiveMetastore_drop_constraint_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_constraint_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_constraint_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_constraint_result::~ThriftHiveMetastore_drop_constraint_result() noexcept { +} + +ThriftHiveMetastore_drop_constraint_result::ThriftHiveMetastore_drop_constraint_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_constraint_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_constraint_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_constraint_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_constraint_presult::~ThriftHiveMetastore_drop_constraint_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_constraint_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_primary_key_args::~ThriftHiveMetastore_add_primary_key_args() noexcept { +} + +ThriftHiveMetastore_add_primary_key_args::ThriftHiveMetastore_add_primary_key_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_primary_key_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_primary_key_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_primary_key_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_primary_key_pargs::~ThriftHiveMetastore_add_primary_key_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_primary_key_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_primary_key_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_primary_key_result::~ThriftHiveMetastore_add_primary_key_result() noexcept { +} + +ThriftHiveMetastore_add_primary_key_result::ThriftHiveMetastore_add_primary_key_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_primary_key_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_primary_key_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_primary_key_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_primary_key_presult::~ThriftHiveMetastore_add_primary_key_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_primary_key_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_foreign_key_args::~ThriftHiveMetastore_add_foreign_key_args() noexcept { +} + +ThriftHiveMetastore_add_foreign_key_args::ThriftHiveMetastore_add_foreign_key_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_foreign_key_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_foreign_key_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_foreign_key_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_foreign_key_pargs::~ThriftHiveMetastore_add_foreign_key_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_foreign_key_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_foreign_key_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_foreign_key_result::~ThriftHiveMetastore_add_foreign_key_result() noexcept { +} + +ThriftHiveMetastore_add_foreign_key_result::ThriftHiveMetastore_add_foreign_key_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_foreign_key_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_foreign_key_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_foreign_key_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_foreign_key_presult::~ThriftHiveMetastore_add_foreign_key_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_foreign_key_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_unique_constraint_args::~ThriftHiveMetastore_add_unique_constraint_args() noexcept { +} + +ThriftHiveMetastore_add_unique_constraint_args::ThriftHiveMetastore_add_unique_constraint_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_unique_constraint_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_unique_constraint_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_unique_constraint_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_unique_constraint_pargs::~ThriftHiveMetastore_add_unique_constraint_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_unique_constraint_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_unique_constraint_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_unique_constraint_result::~ThriftHiveMetastore_add_unique_constraint_result() noexcept { +} + +ThriftHiveMetastore_add_unique_constraint_result::ThriftHiveMetastore_add_unique_constraint_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_unique_constraint_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_unique_constraint_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_unique_constraint_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_unique_constraint_presult::~ThriftHiveMetastore_add_unique_constraint_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_unique_constraint_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_not_null_constraint_args::~ThriftHiveMetastore_add_not_null_constraint_args() noexcept { +} + +ThriftHiveMetastore_add_not_null_constraint_args::ThriftHiveMetastore_add_not_null_constraint_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_not_null_constraint_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_not_null_constraint_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_not_null_constraint_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_not_null_constraint_pargs::~ThriftHiveMetastore_add_not_null_constraint_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_not_null_constraint_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_not_null_constraint_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_not_null_constraint_result::~ThriftHiveMetastore_add_not_null_constraint_result() noexcept { +} + +ThriftHiveMetastore_add_not_null_constraint_result::ThriftHiveMetastore_add_not_null_constraint_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_not_null_constraint_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_not_null_constraint_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_not_null_constraint_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_not_null_constraint_presult::~ThriftHiveMetastore_add_not_null_constraint_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_not_null_constraint_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_default_constraint_args::~ThriftHiveMetastore_add_default_constraint_args() noexcept { +} + +ThriftHiveMetastore_add_default_constraint_args::ThriftHiveMetastore_add_default_constraint_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_default_constraint_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_default_constraint_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_default_constraint_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_default_constraint_pargs::~ThriftHiveMetastore_add_default_constraint_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_default_constraint_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_default_constraint_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_default_constraint_result::~ThriftHiveMetastore_add_default_constraint_result() noexcept { +} + +ThriftHiveMetastore_add_default_constraint_result::ThriftHiveMetastore_add_default_constraint_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_default_constraint_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_default_constraint_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_default_constraint_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_default_constraint_presult::~ThriftHiveMetastore_add_default_constraint_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_default_constraint_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_check_constraint_args::~ThriftHiveMetastore_add_check_constraint_args() noexcept { +} + +ThriftHiveMetastore_add_check_constraint_args::ThriftHiveMetastore_add_check_constraint_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_check_constraint_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_check_constraint_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_check_constraint_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_check_constraint_pargs::~ThriftHiveMetastore_add_check_constraint_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_check_constraint_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_check_constraint_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_check_constraint_result::~ThriftHiveMetastore_add_check_constraint_result() noexcept { +} + +ThriftHiveMetastore_add_check_constraint_result::ThriftHiveMetastore_add_check_constraint_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_check_constraint_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_check_constraint_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_check_constraint_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_check_constraint_presult::~ThriftHiveMetastore_add_check_constraint_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_check_constraint_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_translate_table_dryrun_args::~ThriftHiveMetastore_translate_table_dryrun_args() noexcept { +} + +ThriftHiveMetastore_translate_table_dryrun_args::ThriftHiveMetastore_translate_table_dryrun_args() noexcept { +} + +uint32_t ThriftHiveMetastore_translate_table_dryrun_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_translate_table_dryrun_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_translate_table_dryrun_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_translate_table_dryrun_pargs::~ThriftHiveMetastore_translate_table_dryrun_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_translate_table_dryrun_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_translate_table_dryrun_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_translate_table_dryrun_result::~ThriftHiveMetastore_translate_table_dryrun_result() noexcept { +} + +ThriftHiveMetastore_translate_table_dryrun_result::ThriftHiveMetastore_translate_table_dryrun_result() noexcept { +} + +uint32_t ThriftHiveMetastore_translate_table_dryrun_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_translate_table_dryrun_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_translate_table_dryrun_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_translate_table_dryrun_presult::~ThriftHiveMetastore_translate_table_dryrun_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_translate_table_dryrun_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_table_args::~ThriftHiveMetastore_drop_table_args() noexcept { +} + +ThriftHiveMetastore_drop_table_args::ThriftHiveMetastore_drop_table_args() noexcept + : dbname(), + name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_table_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_pargs::~ThriftHiveMetastore_drop_table_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_result::~ThriftHiveMetastore_drop_table_result() noexcept { +} + +ThriftHiveMetastore_drop_table_result::ThriftHiveMetastore_drop_table_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_table_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_presult::~ThriftHiveMetastore_drop_table_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_table_with_environment_context_args::~ThriftHiveMetastore_drop_table_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_drop_table_with_environment_context_args::ThriftHiveMetastore_drop_table_with_environment_context_args() noexcept + : dbname(), + name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_with_environment_context_pargs::~ThriftHiveMetastore_drop_table_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_with_environment_context_result::~ThriftHiveMetastore_drop_table_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_drop_table_with_environment_context_result::ThriftHiveMetastore_drop_table_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_with_environment_context_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_with_environment_context_presult::~ThriftHiveMetastore_drop_table_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_table_req_args::~ThriftHiveMetastore_drop_table_req_args() noexcept { +} + +ThriftHiveMetastore_drop_table_req_args::ThriftHiveMetastore_drop_table_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_table_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dropTableReq.read(iprot); + this->__isset.dropTableReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_req_args"); + + xfer += oprot->writeFieldBegin("dropTableReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->dropTableReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_req_pargs::~ThriftHiveMetastore_drop_table_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_req_pargs"); + + xfer += oprot->writeFieldBegin("dropTableReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->dropTableReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_req_result::~ThriftHiveMetastore_drop_table_req_result() noexcept { +} + +ThriftHiveMetastore_drop_table_req_result::ThriftHiveMetastore_drop_table_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_table_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_table_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_table_req_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_table_req_presult::~ThriftHiveMetastore_drop_table_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_table_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_truncate_table_args::~ThriftHiveMetastore_truncate_table_args() noexcept { +} + +ThriftHiveMetastore_truncate_table_args::ThriftHiveMetastore_truncate_table_args() noexcept + : dbName(), + tableName() { +} + +uint32_t ThriftHiveMetastore_truncate_table_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partNames.clear(); + uint32_t _size2021; + ::apache::thrift::protocol::TType _etype2024; + xfer += iprot->readListBegin(_etype2024, _size2021); + this->partNames.resize(_size2021); + uint32_t _i2025; + for (_i2025 = 0; _i2025 < _size2021; ++_i2025) + { + xfer += iprot->readString(this->partNames[_i2025]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_truncate_table_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partNames.size())); + std::vector ::const_iterator _iter2026; + for (_iter2026 = this->partNames.begin(); _iter2026 != this->partNames.end(); ++_iter2026) + { + xfer += oprot->writeString((*_iter2026)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_pargs::~ThriftHiveMetastore_truncate_table_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_truncate_table_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tableName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->partNames)).size())); + std::vector ::const_iterator _iter2027; + for (_iter2027 = (*(this->partNames)).begin(); _iter2027 != (*(this->partNames)).end(); ++_iter2027) + { + xfer += oprot->writeString((*_iter2027)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_result::~ThriftHiveMetastore_truncate_table_result() noexcept { +} + +ThriftHiveMetastore_truncate_table_result::ThriftHiveMetastore_truncate_table_result() noexcept { +} + +uint32_t ThriftHiveMetastore_truncate_table_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_truncate_table_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_presult::~ThriftHiveMetastore_truncate_table_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_truncate_table_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_truncate_table_req_args::~ThriftHiveMetastore_truncate_table_req_args() noexcept { +} + +ThriftHiveMetastore_truncate_table_req_args::ThriftHiveMetastore_truncate_table_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_truncate_table_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_truncate_table_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_req_pargs::~ThriftHiveMetastore_truncate_table_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_truncate_table_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_req_result::~ThriftHiveMetastore_truncate_table_req_result() noexcept { +} + +ThriftHiveMetastore_truncate_table_req_result::ThriftHiveMetastore_truncate_table_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_truncate_table_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_truncate_table_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_truncate_table_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_truncate_table_req_presult::~ThriftHiveMetastore_truncate_table_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_truncate_table_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_tables_args::~ThriftHiveMetastore_get_tables_args() noexcept { +} + +ThriftHiveMetastore_get_tables_args::ThriftHiveMetastore_get_tables_args() noexcept + : db_name(), + pattern() { +} + +uint32_t ThriftHiveMetastore_get_tables_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pattern); + this->__isset.pattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_pargs::~ThriftHiveMetastore_get_tables_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_result::~ThriftHiveMetastore_get_tables_result() noexcept { +} + +ThriftHiveMetastore_get_tables_result::ThriftHiveMetastore_get_tables_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_tables_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2028; + ::apache::thrift::protocol::TType _etype2031; + xfer += iprot->readListBegin(_etype2031, _size2028); + this->success.resize(_size2028); + uint32_t _i2032; + for (_i2032 = 0; _i2032 < _size2028; ++_i2032) + { + xfer += iprot->readString(this->success[_i2032]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2033; + for (_iter2033 = this->success.begin(); _iter2033 != this->success.end(); ++_iter2033) + { + xfer += oprot->writeString((*_iter2033)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_presult::~ThriftHiveMetastore_get_tables_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2034; + ::apache::thrift::protocol::TType _etype2037; + xfer += iprot->readListBegin(_etype2037, _size2034); + (*(this->success)).resize(_size2034); + uint32_t _i2038; + for (_i2038 = 0; _i2038 < _size2034; ++_i2038) + { + xfer += iprot->readString((*(this->success))[_i2038]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_tables_by_type_args::~ThriftHiveMetastore_get_tables_by_type_args() noexcept { +} + +ThriftHiveMetastore_get_tables_by_type_args::ThriftHiveMetastore_get_tables_by_type_args() noexcept + : db_name(), + pattern(), + tableType() { +} + +uint32_t ThriftHiveMetastore_get_tables_by_type_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pattern); + this->__isset.pattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableType); + this->__isset.tableType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_by_type_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_by_type_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableType", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_by_type_pargs::~ThriftHiveMetastore_get_tables_by_type_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_by_type_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_by_type_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableType", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->tableType))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_by_type_result::~ThriftHiveMetastore_get_tables_by_type_result() noexcept { +} + +ThriftHiveMetastore_get_tables_by_type_result::ThriftHiveMetastore_get_tables_by_type_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_tables_by_type_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2039; + ::apache::thrift::protocol::TType _etype2042; + xfer += iprot->readListBegin(_etype2042, _size2039); + this->success.resize(_size2039); + uint32_t _i2043; + for (_i2043 = 0; _i2043 < _size2039; ++_i2043) + { + xfer += iprot->readString(this->success[_i2043]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_by_type_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_by_type_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2044; + for (_iter2044 = this->success.begin(); _iter2044 != this->success.end(); ++_iter2044) + { + xfer += oprot->writeString((*_iter2044)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_by_type_presult::~ThriftHiveMetastore_get_tables_by_type_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_by_type_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2045; + ::apache::thrift::protocol::TType _etype2048; + xfer += iprot->readListBegin(_etype2048, _size2045); + (*(this->success)).resize(_size2045); + uint32_t _i2049; + for (_i2049 = 0; _i2049 < _size2045; ++_i2049) + { + xfer += iprot->readString((*(this->success))[_i2049]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args::~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args() noexcept { +} + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args::ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs::~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result::~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result() noexcept { +} + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result::ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2050; + ::apache::thrift::protocol::TType _etype2053; + xfer += iprot->readListBegin(_etype2053, _size2050); + this->success.resize(_size2050); + uint32_t _i2054; + for (_i2054 = 0; _i2054 < _size2050; ++_i2054) + { + xfer += this->success[_i2054].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector
::const_iterator _iter2055; + for (_iter2055 = this->success.begin(); _iter2055 != this->success.end(); ++_iter2055) + { + xfer += (*_iter2055).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult::~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2056; + ::apache::thrift::protocol::TType _etype2059; + xfer += iprot->readListBegin(_etype2059, _size2056); + (*(this->success)).resize(_size2056); + uint32_t _i2060; + for (_i2060 = 0; _i2060 < _size2056; ++_i2060) + { + xfer += (*(this->success))[_i2060].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_materialized_views_for_rewriting_args::~ThriftHiveMetastore_get_materialized_views_for_rewriting_args() noexcept { +} + +ThriftHiveMetastore_get_materialized_views_for_rewriting_args::ThriftHiveMetastore_get_materialized_views_for_rewriting_args() noexcept + : db_name() { +} + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialized_views_for_rewriting_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs::~ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialized_views_for_rewriting_result::~ThriftHiveMetastore_get_materialized_views_for_rewriting_result() noexcept { +} + +ThriftHiveMetastore_get_materialized_views_for_rewriting_result::ThriftHiveMetastore_get_materialized_views_for_rewriting_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2061; + ::apache::thrift::protocol::TType _etype2064; + xfer += iprot->readListBegin(_etype2064, _size2061); + this->success.resize(_size2061); + uint32_t _i2065; + for (_i2065 = 0; _i2065 < _size2061; ++_i2065) + { + xfer += iprot->readString(this->success[_i2065]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialized_views_for_rewriting_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2066; + for (_iter2066 = this->success.begin(); _iter2066 != this->success.end(); ++_iter2066) + { + xfer += oprot->writeString((*_iter2066)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialized_views_for_rewriting_presult::~ThriftHiveMetastore_get_materialized_views_for_rewriting_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_materialized_views_for_rewriting_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2067; + ::apache::thrift::protocol::TType _etype2070; + xfer += iprot->readListBegin(_etype2070, _size2067); + (*(this->success)).resize(_size2067); + uint32_t _i2071; + for (_i2071 = 0; _i2071 < _size2067; ++_i2071) + { + xfer += iprot->readString((*(this->success))[_i2071]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_meta_args::~ThriftHiveMetastore_get_table_meta_args() noexcept { +} + +ThriftHiveMetastore_get_table_meta_args::ThriftHiveMetastore_get_table_meta_args() noexcept + : db_patterns(), + tbl_patterns() { +} + +uint32_t ThriftHiveMetastore_get_table_meta_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_patterns); + this->__isset.db_patterns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_patterns); + this->__isset.tbl_patterns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tbl_types.clear(); + uint32_t _size2072; + ::apache::thrift::protocol::TType _etype2075; + xfer += iprot->readListBegin(_etype2075, _size2072); + this->tbl_types.resize(_size2072); + uint32_t _i2076; + for (_i2076 = 0; _i2076 < _size2072; ++_i2076) + { + xfer += iprot->readString(this->tbl_types[_i2076]); + } + xfer += iprot->readListEnd(); + } + this->__isset.tbl_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_meta_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_meta_args"); + + xfer += oprot->writeFieldBegin("db_patterns", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_patterns); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_patterns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_patterns); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_types", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tbl_types.size())); + std::vector ::const_iterator _iter2077; + for (_iter2077 = this->tbl_types.begin(); _iter2077 != this->tbl_types.end(); ++_iter2077) + { + xfer += oprot->writeString((*_iter2077)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_meta_pargs::~ThriftHiveMetastore_get_table_meta_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_meta_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_meta_pargs"); + + xfer += oprot->writeFieldBegin("db_patterns", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_patterns))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_patterns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_patterns))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_types", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->tbl_types)).size())); + std::vector ::const_iterator _iter2078; + for (_iter2078 = (*(this->tbl_types)).begin(); _iter2078 != (*(this->tbl_types)).end(); ++_iter2078) + { + xfer += oprot->writeString((*_iter2078)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_meta_result::~ThriftHiveMetastore_get_table_meta_result() noexcept { +} + +ThriftHiveMetastore_get_table_meta_result::ThriftHiveMetastore_get_table_meta_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_meta_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2079; + ::apache::thrift::protocol::TType _etype2082; + xfer += iprot->readListBegin(_etype2082, _size2079); + this->success.resize(_size2079); + uint32_t _i2083; + for (_i2083 = 0; _i2083 < _size2079; ++_i2083) + { + xfer += this->success[_i2083].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_meta_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_meta_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2084; + for (_iter2084 = this->success.begin(); _iter2084 != this->success.end(); ++_iter2084) + { + xfer += (*_iter2084).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_meta_presult::~ThriftHiveMetastore_get_table_meta_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_meta_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2085; + ::apache::thrift::protocol::TType _etype2088; + xfer += iprot->readListBegin(_etype2088, _size2085); + (*(this->success)).resize(_size2085); + uint32_t _i2089; + for (_i2089 = 0; _i2089 < _size2085; ++_i2089) + { + xfer += (*(this->success))[_i2089].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_tables_args::~ThriftHiveMetastore_get_all_tables_args() noexcept { +} + +ThriftHiveMetastore_get_all_tables_args::ThriftHiveMetastore_get_all_tables_args() noexcept + : db_name() { +} + +uint32_t ThriftHiveMetastore_get_all_tables_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_tables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_tables_pargs::~ThriftHiveMetastore_get_all_tables_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_tables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_tables_result::~ThriftHiveMetastore_get_all_tables_result() noexcept { +} + +ThriftHiveMetastore_get_all_tables_result::ThriftHiveMetastore_get_all_tables_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_tables_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2090; + ::apache::thrift::protocol::TType _etype2093; + xfer += iprot->readListBegin(_etype2093, _size2090); + this->success.resize(_size2090); + uint32_t _i2094; + for (_i2094 = 0; _i2094 < _size2090; ++_i2094) + { + xfer += iprot->readString(this->success[_i2094]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_tables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_tables_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2095; + for (_iter2095 = this->success.begin(); _iter2095 != this->success.end(); ++_iter2095) + { + xfer += oprot->writeString((*_iter2095)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_tables_presult::~ThriftHiveMetastore_get_all_tables_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_tables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2096; + ::apache::thrift::protocol::TType _etype2099; + xfer += iprot->readListBegin(_etype2099, _size2096); + (*(this->success)).resize(_size2096); + uint32_t _i2100; + for (_i2100 = 0; _i2100 < _size2096; ++_i2100) + { + xfer += iprot->readString((*(this->success))[_i2100]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_tables_ext_args::~ThriftHiveMetastore_get_tables_ext_args() noexcept { +} + +ThriftHiveMetastore_get_tables_ext_args::ThriftHiveMetastore_get_tables_ext_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_tables_ext_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_ext_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_ext_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_ext_pargs::~ThriftHiveMetastore_get_tables_ext_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_ext_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_ext_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_ext_result::~ThriftHiveMetastore_get_tables_ext_result() noexcept { +} + +ThriftHiveMetastore_get_tables_ext_result::ThriftHiveMetastore_get_tables_ext_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_tables_ext_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2101; + ::apache::thrift::protocol::TType _etype2104; + xfer += iprot->readListBegin(_etype2104, _size2101); + this->success.resize(_size2101); + uint32_t _i2105; + for (_i2105 = 0; _i2105 < _size2101; ++_i2105) + { + xfer += this->success[_i2105].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_tables_ext_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_tables_ext_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2106; + for (_iter2106 = this->success.begin(); _iter2106 != this->success.end(); ++_iter2106) + { + xfer += (*_iter2106).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_tables_ext_presult::~ThriftHiveMetastore_get_tables_ext_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_tables_ext_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2107; + ::apache::thrift::protocol::TType _etype2110; + xfer += iprot->readListBegin(_etype2110, _size2107); + (*(this->success)).resize(_size2107); + uint32_t _i2111; + for (_i2111 = 0; _i2111 < _size2107; ++_i2111) + { + xfer += (*(this->success))[_i2111].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_req_args::~ThriftHiveMetastore_get_table_req_args() noexcept { +} + +ThriftHiveMetastore_get_table_req_args::ThriftHiveMetastore_get_table_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_req_pargs::~ThriftHiveMetastore_get_table_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_req_result::~ThriftHiveMetastore_get_table_req_result() noexcept { +} + +ThriftHiveMetastore_get_table_req_result::ThriftHiveMetastore_get_table_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_req_presult::~ThriftHiveMetastore_get_table_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_objects_by_name_req_args::~ThriftHiveMetastore_get_table_objects_by_name_req_args() noexcept { +} + +ThriftHiveMetastore_get_table_objects_by_name_req_args::ThriftHiveMetastore_get_table_objects_by_name_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_objects_by_name_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_objects_by_name_req_pargs::~ThriftHiveMetastore_get_table_objects_by_name_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_objects_by_name_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_objects_by_name_req_result::~ThriftHiveMetastore_get_table_objects_by_name_req_result() noexcept { +} + +ThriftHiveMetastore_get_table_objects_by_name_req_result::ThriftHiveMetastore_get_table_objects_by_name_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_objects_by_name_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_objects_by_name_req_presult::~ThriftHiveMetastore_get_table_objects_by_name_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_objects_by_name_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_materialization_invalidation_info_args::~ThriftHiveMetastore_get_materialization_invalidation_info_args() noexcept { +} + +ThriftHiveMetastore_get_materialization_invalidation_info_args::ThriftHiveMetastore_get_materialization_invalidation_info_args() noexcept + : validTxnList() { +} + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->creation_metadata.read(iprot); + this->__isset.creation_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validTxnList); + this->__isset.validTxnList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialization_invalidation_info_args"); + + xfer += oprot->writeFieldBegin("creation_metadata", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->creation_metadata.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validTxnList", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->validTxnList); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialization_invalidation_info_pargs::~ThriftHiveMetastore_get_materialization_invalidation_info_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialization_invalidation_info_pargs"); + + xfer += oprot->writeFieldBegin("creation_metadata", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->creation_metadata)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validTxnList", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->validTxnList))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialization_invalidation_info_result::~ThriftHiveMetastore_get_materialization_invalidation_info_result() noexcept { +} + +ThriftHiveMetastore_get_materialization_invalidation_info_result::ThriftHiveMetastore_get_materialization_invalidation_info_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_materialization_invalidation_info_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_materialization_invalidation_info_presult::~ThriftHiveMetastore_get_materialization_invalidation_info_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_materialization_invalidation_info_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_creation_metadata_args::~ThriftHiveMetastore_update_creation_metadata_args() noexcept { +} + +ThriftHiveMetastore_update_creation_metadata_args::ThriftHiveMetastore_update_creation_metadata_args() noexcept + : catName(), + dbname(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_update_creation_metadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->creation_metadata.read(iprot); + this->__isset.creation_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_creation_metadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_creation_metadata_args"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("creation_metadata", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->creation_metadata.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_creation_metadata_pargs::~ThriftHiveMetastore_update_creation_metadata_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_creation_metadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_creation_metadata_pargs"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->catName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("creation_metadata", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->creation_metadata)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_creation_metadata_result::~ThriftHiveMetastore_update_creation_metadata_result() noexcept { +} + +ThriftHiveMetastore_update_creation_metadata_result::ThriftHiveMetastore_update_creation_metadata_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_creation_metadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_creation_metadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_creation_metadata_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_creation_metadata_presult::~ThriftHiveMetastore_update_creation_metadata_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_creation_metadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_names_by_filter_args::~ThriftHiveMetastore_get_table_names_by_filter_args() noexcept { +} + +ThriftHiveMetastore_get_table_names_by_filter_args::ThriftHiveMetastore_get_table_names_by_filter_args() noexcept + : dbname(), + filter(), + max_tables(-1) { +} + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_tables); + this->__isset.max_tables = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_names_by_filter_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_tables", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16(this->max_tables); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_names_by_filter_pargs::~ThriftHiveMetastore_get_table_names_by_filter_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_names_by_filter_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->filter))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_tables", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16((*(this->max_tables))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_names_by_filter_result::~ThriftHiveMetastore_get_table_names_by_filter_result() noexcept { +} + +ThriftHiveMetastore_get_table_names_by_filter_result::ThriftHiveMetastore_get_table_names_by_filter_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2112; + ::apache::thrift::protocol::TType _etype2115; + xfer += iprot->readListBegin(_etype2115, _size2112); + this->success.resize(_size2112); + uint32_t _i2116; + for (_i2116 = 0; _i2116 < _size2112; ++_i2116) + { + xfer += iprot->readString(this->success[_i2116]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_names_by_filter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2117; + for (_iter2117 = this->success.begin(); _iter2117 != this->success.end(); ++_iter2117) + { + xfer += oprot->writeString((*_iter2117)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_names_by_filter_presult::~ThriftHiveMetastore_get_table_names_by_filter_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_names_by_filter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2118; + ::apache::thrift::protocol::TType _etype2121; + xfer += iprot->readListBegin(_etype2121, _size2118); + (*(this->success)).resize(_size2118); + uint32_t _i2122; + for (_i2122 = 0; _i2122 < _size2118; ++_i2122) + { + xfer += iprot->readString((*(this->success))[_i2122]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_table_args::~ThriftHiveMetastore_alter_table_args() noexcept { +} + +ThriftHiveMetastore_alter_table_args::ThriftHiveMetastore_alter_table_args() noexcept + : dbname(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_table_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_tbl.read(iprot); + this->__isset.new_tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->new_tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_pargs::~ThriftHiveMetastore_alter_table_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->new_tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_result::~ThriftHiveMetastore_alter_table_result() noexcept { +} + +ThriftHiveMetastore_alter_table_result::ThriftHiveMetastore_alter_table_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_table_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_presult::~ThriftHiveMetastore_alter_table_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_environment_context_args::~ThriftHiveMetastore_alter_table_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_alter_table_with_environment_context_args::ThriftHiveMetastore_alter_table_with_environment_context_args() noexcept + : dbname(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_tbl.read(iprot); + this->__isset.new_tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->new_tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_environment_context_pargs::~ThriftHiveMetastore_alter_table_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->new_tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_environment_context_result::~ThriftHiveMetastore_alter_table_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_alter_table_with_environment_context_result::ThriftHiveMetastore_alter_table_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_environment_context_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_environment_context_presult::~ThriftHiveMetastore_alter_table_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_cascade_args::~ThriftHiveMetastore_alter_table_with_cascade_args() noexcept { +} + +ThriftHiveMetastore_alter_table_with_cascade_args::ThriftHiveMetastore_alter_table_with_cascade_args() noexcept + : dbname(), + tbl_name(), + cascade(0) { +} + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_tbl.read(iprot); + this->__isset.new_tbl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->cascade); + this->__isset.cascade = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_cascade_args"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->new_tbl.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cascade", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->cascade); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_cascade_pargs::~ThriftHiveMetastore_alter_table_with_cascade_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_cascade_pargs"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbname))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_tbl", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->new_tbl)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cascade", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool((*(this->cascade))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_cascade_result::~ThriftHiveMetastore_alter_table_with_cascade_result() noexcept { +} + +ThriftHiveMetastore_alter_table_with_cascade_result::ThriftHiveMetastore_alter_table_with_cascade_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_with_cascade_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_with_cascade_presult::~ThriftHiveMetastore_alter_table_with_cascade_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_with_cascade_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_table_req_args::~ThriftHiveMetastore_alter_table_req_args() noexcept { +} + +ThriftHiveMetastore_alter_table_req_args::ThriftHiveMetastore_alter_table_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_table_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_req_pargs::~ThriftHiveMetastore_alter_table_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_req_result::~ThriftHiveMetastore_alter_table_req_result() noexcept { +} + +ThriftHiveMetastore_alter_table_req_result::ThriftHiveMetastore_alter_table_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_table_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_table_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_table_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_table_req_presult::~ThriftHiveMetastore_alter_table_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_table_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_partition_args::~ThriftHiveMetastore_add_partition_args() noexcept { +} + +ThriftHiveMetastore_add_partition_args::ThriftHiveMetastore_add_partition_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_args"); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_pargs::~ThriftHiveMetastore_add_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_pargs"); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_result::~ThriftHiveMetastore_add_partition_result() noexcept { +} + +ThriftHiveMetastore_add_partition_result::ThriftHiveMetastore_add_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_presult::~ThriftHiveMetastore_add_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_partition_with_environment_context_args::~ThriftHiveMetastore_add_partition_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_add_partition_with_environment_context_args::ThriftHiveMetastore_add_partition_with_environment_context_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_with_environment_context_pargs::~ThriftHiveMetastore_add_partition_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_with_environment_context_result::~ThriftHiveMetastore_add_partition_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_add_partition_with_environment_context_result::ThriftHiveMetastore_add_partition_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partition_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partition_with_environment_context_presult::~ThriftHiveMetastore_add_partition_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partition_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_partitions_args::~ThriftHiveMetastore_add_partitions_args() noexcept { +} + +ThriftHiveMetastore_add_partitions_args::ThriftHiveMetastore_add_partitions_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partitions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->new_parts.clear(); + uint32_t _size2123; + ::apache::thrift::protocol::TType _etype2126; + xfer += iprot->readListBegin(_etype2126, _size2123); + this->new_parts.resize(_size2123); + uint32_t _i2127; + for (_i2127 = 0; _i2127 < _size2123; ++_i2127) + { + xfer += this->new_parts[_i2127].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.new_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_args"); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->new_parts.size())); + std::vector ::const_iterator _iter2128; + for (_iter2128 = this->new_parts.begin(); _iter2128 != this->new_parts.end(); ++_iter2128) + { + xfer += (*_iter2128).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_pargs::~ThriftHiveMetastore_add_partitions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_pargs"); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->new_parts)).size())); + std::vector ::const_iterator _iter2129; + for (_iter2129 = (*(this->new_parts)).begin(); _iter2129 != (*(this->new_parts)).end(); ++_iter2129) + { + xfer += (*_iter2129).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_result::~ThriftHiveMetastore_add_partitions_result() noexcept { +} + +ThriftHiveMetastore_add_partitions_result::ThriftHiveMetastore_add_partitions_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_add_partitions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_presult::~ThriftHiveMetastore_add_partitions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_partitions_pspec_args::~ThriftHiveMetastore_add_partitions_pspec_args() noexcept { +} + +ThriftHiveMetastore_add_partitions_pspec_args::ThriftHiveMetastore_add_partitions_pspec_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partitions_pspec_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->new_parts.clear(); + uint32_t _size2130; + ::apache::thrift::protocol::TType _etype2133; + xfer += iprot->readListBegin(_etype2133, _size2130); + this->new_parts.resize(_size2130); + uint32_t _i2134; + for (_i2134 = 0; _i2134 < _size2130; ++_i2134) + { + xfer += this->new_parts[_i2134].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.new_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_pspec_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_pspec_args"); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->new_parts.size())); + std::vector ::const_iterator _iter2135; + for (_iter2135 = this->new_parts.begin(); _iter2135 != this->new_parts.end(); ++_iter2135) + { + xfer += (*_iter2135).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_pspec_pargs::~ThriftHiveMetastore_add_partitions_pspec_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_pspec_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_pspec_pargs"); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->new_parts)).size())); + std::vector ::const_iterator _iter2136; + for (_iter2136 = (*(this->new_parts)).begin(); _iter2136 != (*(this->new_parts)).end(); ++_iter2136) + { + xfer += (*_iter2136).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_pspec_result::~ThriftHiveMetastore_add_partitions_pspec_result() noexcept { +} + +ThriftHiveMetastore_add_partitions_pspec_result::ThriftHiveMetastore_add_partitions_pspec_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_add_partitions_pspec_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_pspec_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_pspec_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_pspec_presult::~ThriftHiveMetastore_add_partitions_pspec_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_pspec_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_append_partition_args::~ThriftHiveMetastore_append_partition_args() noexcept { +} + +ThriftHiveMetastore_append_partition_args::ThriftHiveMetastore_append_partition_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_append_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2137; + ::apache::thrift::protocol::TType _etype2140; + xfer += iprot->readListBegin(_etype2140, _size2137); + this->part_vals.resize(_size2137); + uint32_t _i2141; + for (_i2141 = 0; _i2141 < _size2137; ++_i2141) + { + xfer += iprot->readString(this->part_vals[_i2141]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2142; + for (_iter2142 = this->part_vals.begin(); _iter2142 != this->part_vals.end(); ++_iter2142) + { + xfer += oprot->writeString((*_iter2142)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_pargs::~ThriftHiveMetastore_append_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2143; + for (_iter2143 = (*(this->part_vals)).begin(); _iter2143 != (*(this->part_vals)).end(); ++_iter2143) + { + xfer += oprot->writeString((*_iter2143)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_result::~ThriftHiveMetastore_append_partition_result() noexcept { +} + +ThriftHiveMetastore_append_partition_result::ThriftHiveMetastore_append_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_presult::~ThriftHiveMetastore_append_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_partitions_req_args::~ThriftHiveMetastore_add_partitions_req_args() noexcept { +} + +ThriftHiveMetastore_add_partitions_req_args::ThriftHiveMetastore_add_partitions_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partitions_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_req_pargs::~ThriftHiveMetastore_add_partitions_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_req_result::~ThriftHiveMetastore_add_partitions_req_result() noexcept { +} + +ThriftHiveMetastore_add_partitions_req_result::ThriftHiveMetastore_add_partitions_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_partitions_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_partitions_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_partitions_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_partitions_req_presult::~ThriftHiveMetastore_add_partitions_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_partitions_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_append_partition_with_environment_context_args::~ThriftHiveMetastore_append_partition_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_append_partition_with_environment_context_args::ThriftHiveMetastore_append_partition_with_environment_context_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2144; + ::apache::thrift::protocol::TType _etype2147; + xfer += iprot->readListBegin(_etype2147, _size2144); + this->part_vals.resize(_size2144); + uint32_t _i2148; + for (_i2148 = 0; _i2148 < _size2144; ++_i2148) + { + xfer += iprot->readString(this->part_vals[_i2148]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2149; + for (_iter2149 = this->part_vals.begin(); _iter2149 != this->part_vals.end(); ++_iter2149) + { + xfer += oprot->writeString((*_iter2149)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_with_environment_context_pargs::~ThriftHiveMetastore_append_partition_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2150; + for (_iter2150 = (*(this->part_vals)).begin(); _iter2150 != (*(this->part_vals)).end(); ++_iter2150) + { + xfer += oprot->writeString((*_iter2150)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_with_environment_context_result::~ThriftHiveMetastore_append_partition_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_append_partition_with_environment_context_result::ThriftHiveMetastore_append_partition_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_with_environment_context_presult::~ThriftHiveMetastore_append_partition_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_append_partition_req_args::~ThriftHiveMetastore_append_partition_req_args() noexcept { +} + +ThriftHiveMetastore_append_partition_req_args::ThriftHiveMetastore_append_partition_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->appendPartitionsReq.read(iprot); + this->__isset.appendPartitionsReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_req_args"); + + xfer += oprot->writeFieldBegin("appendPartitionsReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->appendPartitionsReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_req_pargs::~ThriftHiveMetastore_append_partition_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_req_pargs"); + + xfer += oprot->writeFieldBegin("appendPartitionsReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->appendPartitionsReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_req_result::~ThriftHiveMetastore_append_partition_req_result() noexcept { +} + +ThriftHiveMetastore_append_partition_req_result::ThriftHiveMetastore_append_partition_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_req_presult::~ThriftHiveMetastore_append_partition_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_args::~ThriftHiveMetastore_append_partition_by_name_args() noexcept { +} + +ThriftHiveMetastore_append_partition_by_name_args::ThriftHiveMetastore_append_partition_by_name_args() noexcept + : db_name(), + tbl_name(), + part_name() { +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_pargs::~ThriftHiveMetastore_append_partition_by_name_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_by_name_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_result::~ThriftHiveMetastore_append_partition_by_name_result() noexcept { +} + +ThriftHiveMetastore_append_partition_by_name_result::ThriftHiveMetastore_append_partition_by_name_result() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_presult::~ThriftHiveMetastore_append_partition_by_name_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_by_name_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_args::~ThriftHiveMetastore_append_partition_by_name_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_args::ThriftHiveMetastore_append_partition_by_name_with_environment_context_args() noexcept + : db_name(), + tbl_name(), + part_name() { +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs::~ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_result::~ThriftHiveMetastore_append_partition_by_name_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_result::ThriftHiveMetastore_append_partition_by_name_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_append_partition_by_name_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult::~ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partition_args::~ThriftHiveMetastore_drop_partition_args() noexcept { +} + +ThriftHiveMetastore_drop_partition_args::ThriftHiveMetastore_drop_partition_args() noexcept + : db_name(), + tbl_name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2151; + ::apache::thrift::protocol::TType _etype2154; + xfer += iprot->readListBegin(_etype2154, _size2151); + this->part_vals.resize(_size2151); + uint32_t _i2155; + for (_i2155 = 0; _i2155 < _size2151; ++_i2155) + { + xfer += iprot->readString(this->part_vals[_i2155]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2156; + for (_iter2156 = this->part_vals.begin(); _iter2156 != this->part_vals.end(); ++_iter2156) + { + xfer += oprot->writeString((*_iter2156)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_pargs::~ThriftHiveMetastore_drop_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2157; + for (_iter2157 = (*(this->part_vals)).begin(); _iter2157 != (*(this->part_vals)).end(); ++_iter2157) + { + xfer += oprot->writeString((*_iter2157)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_result::~ThriftHiveMetastore_drop_partition_result() noexcept { +} + +ThriftHiveMetastore_drop_partition_result::ThriftHiveMetastore_drop_partition_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_presult::~ThriftHiveMetastore_drop_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partition_with_environment_context_args::~ThriftHiveMetastore_drop_partition_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_drop_partition_with_environment_context_args::ThriftHiveMetastore_drop_partition_with_environment_context_args() noexcept + : db_name(), + tbl_name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2158; + ::apache::thrift::protocol::TType _etype2161; + xfer += iprot->readListBegin(_etype2161, _size2158); + this->part_vals.resize(_size2158); + uint32_t _i2162; + for (_i2162 = 0; _i2162 < _size2158; ++_i2162) + { + xfer += iprot->readString(this->part_vals[_i2162]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2163; + for (_iter2163 = this->part_vals.begin(); _iter2163 != this->part_vals.end(); ++_iter2163) + { + xfer += oprot->writeString((*_iter2163)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_with_environment_context_pargs::~ThriftHiveMetastore_drop_partition_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2164; + for (_iter2164 = (*(this->part_vals)).begin(); _iter2164 != (*(this->part_vals)).end(); ++_iter2164) + { + xfer += oprot->writeString((*_iter2164)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_with_environment_context_result::~ThriftHiveMetastore_drop_partition_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_drop_partition_with_environment_context_result::ThriftHiveMetastore_drop_partition_with_environment_context_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_with_environment_context_presult::~ThriftHiveMetastore_drop_partition_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partition_req_args::~ThriftHiveMetastore_drop_partition_req_args() noexcept { +} + +ThriftHiveMetastore_drop_partition_req_args::ThriftHiveMetastore_drop_partition_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_partition_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dropPartitionReq.read(iprot); + this->__isset.dropPartitionReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_req_args"); + + xfer += oprot->writeFieldBegin("dropPartitionReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->dropPartitionReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_req_pargs::~ThriftHiveMetastore_drop_partition_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_req_pargs"); + + xfer += oprot->writeFieldBegin("dropPartitionReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->dropPartitionReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_req_result::~ThriftHiveMetastore_drop_partition_req_result() noexcept { +} + +ThriftHiveMetastore_drop_partition_req_result::ThriftHiveMetastore_drop_partition_req_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_req_presult::~ThriftHiveMetastore_drop_partition_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_args::~ThriftHiveMetastore_drop_partition_by_name_args() noexcept { +} + +ThriftHiveMetastore_drop_partition_by_name_args::ThriftHiveMetastore_drop_partition_by_name_args() noexcept + : db_name(), + tbl_name(), + part_name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_pargs::~ThriftHiveMetastore_drop_partition_by_name_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_by_name_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_result::~ThriftHiveMetastore_drop_partition_by_name_result() noexcept { +} + +ThriftHiveMetastore_drop_partition_by_name_result::ThriftHiveMetastore_drop_partition_by_name_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_presult::~ThriftHiveMetastore_drop_partition_by_name_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_by_name_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args::~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args::ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args() noexcept + : db_name(), + tbl_name(), + part_name(), + deleteData(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs::~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool((*(this->deleteData))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result::~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result::ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult::~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_partitions_req_args::~ThriftHiveMetastore_drop_partitions_req_args() noexcept { +} + +ThriftHiveMetastore_drop_partitions_req_args::ThriftHiveMetastore_drop_partitions_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_partitions_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partitions_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partitions_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partitions_req_pargs::~ThriftHiveMetastore_drop_partitions_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partitions_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partitions_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partitions_req_result::~ThriftHiveMetastore_drop_partitions_req_result() noexcept { +} + +ThriftHiveMetastore_drop_partitions_req_result::ThriftHiveMetastore_drop_partitions_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_partitions_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_partitions_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_partitions_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_partitions_req_presult::~ThriftHiveMetastore_drop_partitions_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_partitions_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_args::~ThriftHiveMetastore_get_partition_args() noexcept { +} + +ThriftHiveMetastore_get_partition_args::ThriftHiveMetastore_get_partition_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_get_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2165; + ::apache::thrift::protocol::TType _etype2168; + xfer += iprot->readListBegin(_etype2168, _size2165); + this->part_vals.resize(_size2165); + uint32_t _i2169; + for (_i2169 = 0; _i2169 < _size2165; ++_i2169) + { + xfer += iprot->readString(this->part_vals[_i2169]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2170; + for (_iter2170 = this->part_vals.begin(); _iter2170 != this->part_vals.end(); ++_iter2170) + { + xfer += oprot->writeString((*_iter2170)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_pargs::~ThriftHiveMetastore_get_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2171; + for (_iter2171 = (*(this->part_vals)).begin(); _iter2171 != (*(this->part_vals)).end(); ++_iter2171) + { + xfer += oprot->writeString((*_iter2171)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_result::~ThriftHiveMetastore_get_partition_result() noexcept { +} + +ThriftHiveMetastore_get_partition_result::ThriftHiveMetastore_get_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_presult::~ThriftHiveMetastore_get_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_req_args::~ThriftHiveMetastore_get_partition_req_args() noexcept { +} + +ThriftHiveMetastore_get_partition_req_args::ThriftHiveMetastore_get_partition_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_req_pargs::~ThriftHiveMetastore_get_partition_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_req_result::~ThriftHiveMetastore_get_partition_req_result() noexcept { +} + +ThriftHiveMetastore_get_partition_req_result::ThriftHiveMetastore_get_partition_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_req_presult::~ThriftHiveMetastore_get_partition_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_exchange_partition_args::~ThriftHiveMetastore_exchange_partition_args() noexcept { +} + +ThriftHiveMetastore_exchange_partition_args::ThriftHiveMetastore_exchange_partition_args() noexcept + : source_db(), + source_table_name(), + dest_db(), + dest_table_name() { +} + +uint32_t ThriftHiveMetastore_exchange_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->partitionSpecs.clear(); + uint32_t _size2172; + ::apache::thrift::protocol::TType _ktype2173; + ::apache::thrift::protocol::TType _vtype2174; + xfer += iprot->readMapBegin(_ktype2173, _vtype2174, _size2172); + uint32_t _i2176; + for (_i2176 = 0; _i2176 < _size2172; ++_i2176) + { + std::string _key2177; + xfer += iprot->readString(_key2177); + std::string& _val2178 = this->partitionSpecs[_key2177]; + xfer += iprot->readString(_val2178); + } + xfer += iprot->readMapEnd(); + } + this->__isset.partitionSpecs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->source_db); + this->__isset.source_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->source_table_name); + this->__isset.source_table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dest_db); + this->__isset.dest_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dest_table_name); + this->__isset.dest_table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_exchange_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partition_args"); + + xfer += oprot->writeFieldBegin("partitionSpecs", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->partitionSpecs.size())); + std::map ::const_iterator _iter2179; + for (_iter2179 = this->partitionSpecs.begin(); _iter2179 != this->partitionSpecs.end(); ++_iter2179) + { + xfer += oprot->writeString(_iter2179->first); + xfer += oprot->writeString(_iter2179->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->source_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->source_table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_db", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dest_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_table_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->dest_table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partition_pargs::~ThriftHiveMetastore_exchange_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_exchange_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partition_pargs"); + + xfer += oprot->writeFieldBegin("partitionSpecs", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->partitionSpecs)).size())); + std::map ::const_iterator _iter2180; + for (_iter2180 = (*(this->partitionSpecs)).begin(); _iter2180 != (*(this->partitionSpecs)).end(); ++_iter2180) + { + xfer += oprot->writeString(_iter2180->first); + xfer += oprot->writeString(_iter2180->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->source_db))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->source_table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_db", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->dest_db))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_table_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString((*(this->dest_table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partition_result::~ThriftHiveMetastore_exchange_partition_result() noexcept { +} + +ThriftHiveMetastore_exchange_partition_result::ThriftHiveMetastore_exchange_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_exchange_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_exchange_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partition_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partition_presult::~ThriftHiveMetastore_exchange_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_exchange_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_exchange_partitions_args::~ThriftHiveMetastore_exchange_partitions_args() noexcept { +} + +ThriftHiveMetastore_exchange_partitions_args::ThriftHiveMetastore_exchange_partitions_args() noexcept + : source_db(), + source_table_name(), + dest_db(), + dest_table_name() { +} + +uint32_t ThriftHiveMetastore_exchange_partitions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->partitionSpecs.clear(); + uint32_t _size2181; + ::apache::thrift::protocol::TType _ktype2182; + ::apache::thrift::protocol::TType _vtype2183; + xfer += iprot->readMapBegin(_ktype2182, _vtype2183, _size2181); + uint32_t _i2185; + for (_i2185 = 0; _i2185 < _size2181; ++_i2185) + { + std::string _key2186; + xfer += iprot->readString(_key2186); + std::string& _val2187 = this->partitionSpecs[_key2186]; + xfer += iprot->readString(_val2187); + } + xfer += iprot->readMapEnd(); + } + this->__isset.partitionSpecs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->source_db); + this->__isset.source_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->source_table_name); + this->__isset.source_table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dest_db); + this->__isset.dest_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dest_table_name); + this->__isset.dest_table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_exchange_partitions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partitions_args"); + + xfer += oprot->writeFieldBegin("partitionSpecs", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->partitionSpecs.size())); + std::map ::const_iterator _iter2188; + for (_iter2188 = this->partitionSpecs.begin(); _iter2188 != this->partitionSpecs.end(); ++_iter2188) + { + xfer += oprot->writeString(_iter2188->first); + xfer += oprot->writeString(_iter2188->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->source_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->source_table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_db", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dest_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_table_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->dest_table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partitions_pargs::~ThriftHiveMetastore_exchange_partitions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_exchange_partitions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partitions_pargs"); + + xfer += oprot->writeFieldBegin("partitionSpecs", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->partitionSpecs)).size())); + std::map ::const_iterator _iter2189; + for (_iter2189 = (*(this->partitionSpecs)).begin(); _iter2189 != (*(this->partitionSpecs)).end(); ++_iter2189) + { + xfer += oprot->writeString(_iter2189->first); + xfer += oprot->writeString(_iter2189->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->source_db))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source_table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->source_table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_db", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->dest_db))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dest_table_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString((*(this->dest_table_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partitions_result::~ThriftHiveMetastore_exchange_partitions_result() noexcept { +} + +ThriftHiveMetastore_exchange_partitions_result::ThriftHiveMetastore_exchange_partitions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_exchange_partitions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2190; + ::apache::thrift::protocol::TType _etype2193; + xfer += iprot->readListBegin(_etype2193, _size2190); + this->success.resize(_size2190); + uint32_t _i2194; + for (_i2194 = 0; _i2194 < _size2190; ++_i2194) + { + xfer += this->success[_i2194].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_exchange_partitions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_exchange_partitions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2195; + for (_iter2195 = this->success.begin(); _iter2195 != this->success.end(); ++_iter2195) + { + xfer += (*_iter2195).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_exchange_partitions_presult::~ThriftHiveMetastore_exchange_partitions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_exchange_partitions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2196; + ::apache::thrift::protocol::TType _etype2199; + xfer += iprot->readListBegin(_etype2199, _size2196); + (*(this->success)).resize(_size2196); + uint32_t _i2200; + for (_i2200 = 0; _i2200 < _size2196; ++_i2200) + { + xfer += (*(this->success))[_i2200].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_with_auth_args::~ThriftHiveMetastore_get_partition_with_auth_args() noexcept { +} + +ThriftHiveMetastore_get_partition_with_auth_args::ThriftHiveMetastore_get_partition_with_auth_args() noexcept + : db_name(), + tbl_name(), + user_name() { +} + +uint32_t ThriftHiveMetastore_get_partition_with_auth_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2201; + ::apache::thrift::protocol::TType _etype2204; + xfer += iprot->readListBegin(_etype2204, _size2201); + this->part_vals.resize(_size2201); + uint32_t _i2205; + for (_i2205 = 0; _i2205 < _size2201; ++_i2205) + { + xfer += iprot->readString(this->part_vals[_i2205]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user_name); + this->__isset.user_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->group_names.clear(); + uint32_t _size2206; + ::apache::thrift::protocol::TType _etype2209; + xfer += iprot->readListBegin(_etype2209, _size2206); + this->group_names.resize(_size2206); + uint32_t _i2210; + for (_i2210 = 0; _i2210 < _size2206; ++_i2210) + { + xfer += iprot->readString(this->group_names[_i2210]); + } + xfer += iprot->readListEnd(); + } + this->__isset.group_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_with_auth_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_with_auth_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2211; + for (_iter2211 = this->part_vals.begin(); _iter2211 != this->part_vals.end(); ++_iter2211) + { + xfer += oprot->writeString((*_iter2211)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->user_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); + std::vector ::const_iterator _iter2212; + for (_iter2212 = this->group_names.begin(); _iter2212 != this->group_names.end(); ++_iter2212) + { + xfer += oprot->writeString((*_iter2212)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_with_auth_pargs::~ThriftHiveMetastore_get_partition_with_auth_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_with_auth_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_with_auth_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2213; + for (_iter2213 = (*(this->part_vals)).begin(); _iter2213 != (*(this->part_vals)).end(); ++_iter2213) + { + xfer += oprot->writeString((*_iter2213)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->user_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); + std::vector ::const_iterator _iter2214; + for (_iter2214 = (*(this->group_names)).begin(); _iter2214 != (*(this->group_names)).end(); ++_iter2214) + { + xfer += oprot->writeString((*_iter2214)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_with_auth_result::~ThriftHiveMetastore_get_partition_with_auth_result() noexcept { +} + +ThriftHiveMetastore_get_partition_with_auth_result::ThriftHiveMetastore_get_partition_with_auth_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_with_auth_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_with_auth_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_with_auth_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_with_auth_presult::~ThriftHiveMetastore_get_partition_with_auth_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_with_auth_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_by_name_args::~ThriftHiveMetastore_get_partition_by_name_args() noexcept { +} + +ThriftHiveMetastore_get_partition_by_name_args::ThriftHiveMetastore_get_partition_by_name_args() noexcept + : db_name(), + tbl_name(), + part_name() { +} + +uint32_t ThriftHiveMetastore_get_partition_by_name_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_by_name_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_by_name_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_by_name_pargs::~ThriftHiveMetastore_get_partition_by_name_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_by_name_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_by_name_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_by_name_result::~ThriftHiveMetastore_get_partition_by_name_result() noexcept { +} + +ThriftHiveMetastore_get_partition_by_name_result::ThriftHiveMetastore_get_partition_by_name_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_by_name_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_by_name_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_by_name_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_by_name_presult::~ThriftHiveMetastore_get_partition_by_name_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_by_name_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_args::~ThriftHiveMetastore_get_partitions_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_args::ThriftHiveMetastore_get_partitions_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partitions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_pargs::~ThriftHiveMetastore_get_partitions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_result::~ThriftHiveMetastore_get_partitions_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_result::ThriftHiveMetastore_get_partitions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2215; + ::apache::thrift::protocol::TType _etype2218; + xfer += iprot->readListBegin(_etype2218, _size2215); + this->success.resize(_size2215); + uint32_t _i2219; + for (_i2219 = 0; _i2219 < _size2215; ++_i2219) + { + xfer += this->success[_i2219].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2220; + for (_iter2220 = this->success.begin(); _iter2220 != this->success.end(); ++_iter2220) + { + xfer += (*_iter2220).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_presult::~ThriftHiveMetastore_get_partitions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2221; + ::apache::thrift::protocol::TType _etype2224; + xfer += iprot->readListBegin(_etype2224, _size2221); + (*(this->success)).resize(_size2221); + uint32_t _i2225; + for (_i2225 = 0; _i2225 < _size2221; ++_i2225) + { + xfer += (*(this->success))[_i2225].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_req_args::~ThriftHiveMetastore_get_partitions_req_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_req_args::ThriftHiveMetastore_get_partitions_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_req_pargs::~ThriftHiveMetastore_get_partitions_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_req_result::~ThriftHiveMetastore_get_partitions_req_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_req_result::ThriftHiveMetastore_get_partitions_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_req_presult::~ThriftHiveMetastore_get_partitions_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_auth_args::~ThriftHiveMetastore_get_partitions_with_auth_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_with_auth_args::ThriftHiveMetastore_get_partitions_with_auth_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1), + user_name() { +} + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user_name); + this->__isset.user_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->group_names.clear(); + uint32_t _size2226; + ::apache::thrift::protocol::TType _etype2229; + xfer += iprot->readListBegin(_etype2229, _size2226); + this->group_names.resize(_size2226); + uint32_t _i2230; + for (_i2230 = 0; _i2230 < _size2226; ++_i2230) + { + xfer += iprot->readString(this->group_names[_i2230]); + } + xfer += iprot->readListEnd(); + } + this->__isset.group_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_auth_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->user_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); + std::vector ::const_iterator _iter2231; + for (_iter2231 = this->group_names.begin(); _iter2231 != this->group_names.end(); ++_iter2231) + { + xfer += oprot->writeString((*_iter2231)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_auth_pargs::~ThriftHiveMetastore_get_partitions_with_auth_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_auth_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->user_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); + std::vector ::const_iterator _iter2232; + for (_iter2232 = (*(this->group_names)).begin(); _iter2232 != (*(this->group_names)).end(); ++_iter2232) + { + xfer += oprot->writeString((*_iter2232)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_auth_result::~ThriftHiveMetastore_get_partitions_with_auth_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_with_auth_result::ThriftHiveMetastore_get_partitions_with_auth_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2233; + ::apache::thrift::protocol::TType _etype2236; + xfer += iprot->readListBegin(_etype2236, _size2233); + this->success.resize(_size2233); + uint32_t _i2237; + for (_i2237 = 0; _i2237 < _size2233; ++_i2237) + { + xfer += this->success[_i2237].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_auth_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2238; + for (_iter2238 = this->success.begin(); _iter2238 != this->success.end(); ++_iter2238) + { + xfer += (*_iter2238).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_auth_presult::~ThriftHiveMetastore_get_partitions_with_auth_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_with_auth_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2239; + ::apache::thrift::protocol::TType _etype2242; + xfer += iprot->readListBegin(_etype2242, _size2239); + (*(this->success)).resize(_size2239); + uint32_t _i2243; + for (_i2243 = 0; _i2243 < _size2239; ++_i2243) + { + xfer += (*(this->success))[_i2243].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_pspec_args::~ThriftHiveMetastore_get_partitions_pspec_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_pspec_args::ThriftHiveMetastore_get_partitions_pspec_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partitions_pspec_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_pspec_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_pspec_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_pspec_pargs::~ThriftHiveMetastore_get_partitions_pspec_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_pspec_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_pspec_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_pspec_result::~ThriftHiveMetastore_get_partitions_pspec_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_pspec_result::ThriftHiveMetastore_get_partitions_pspec_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_pspec_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2244; + ::apache::thrift::protocol::TType _etype2247; + xfer += iprot->readListBegin(_etype2247, _size2244); + this->success.resize(_size2244); + uint32_t _i2248; + for (_i2248 = 0; _i2248 < _size2244; ++_i2248) + { + xfer += this->success[_i2248].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_pspec_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_pspec_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2249; + for (_iter2249 = this->success.begin(); _iter2249 != this->success.end(); ++_iter2249) + { + xfer += (*_iter2249).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_pspec_presult::~ThriftHiveMetastore_get_partitions_pspec_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_pspec_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2250; + ::apache::thrift::protocol::TType _etype2253; + xfer += iprot->readListBegin(_etype2253, _size2250); + (*(this->success)).resize(_size2250); + uint32_t _i2254; + for (_i2254 = 0; _i2254 < _size2250; ++_i2254) + { + xfer += (*(this->success))[_i2254].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_args::~ThriftHiveMetastore_get_partition_names_args() noexcept { +} + +ThriftHiveMetastore_get_partition_names_args::ThriftHiveMetastore_get_partition_names_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partition_names_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_pargs::~ThriftHiveMetastore_get_partition_names_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_result::~ThriftHiveMetastore_get_partition_names_result() noexcept { +} + +ThriftHiveMetastore_get_partition_names_result::ThriftHiveMetastore_get_partition_names_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2255; + ::apache::thrift::protocol::TType _etype2258; + xfer += iprot->readListBegin(_etype2258, _size2255); + this->success.resize(_size2255); + uint32_t _i2259; + for (_i2259 = 0; _i2259 < _size2255; ++_i2259) + { + xfer += iprot->readString(this->success[_i2259]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2260; + for (_iter2260 = this->success.begin(); _iter2260 != this->success.end(); ++_iter2260) + { + xfer += oprot->writeString((*_iter2260)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_presult::~ThriftHiveMetastore_get_partition_names_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2261; + ::apache::thrift::protocol::TType _etype2264; + xfer += iprot->readListBegin(_etype2264, _size2261); + (*(this->success)).resize(_size2261); + uint32_t _i2265; + for (_i2265 = 0; _i2265 < _size2261; ++_i2265) + { + xfer += iprot->readString((*(this->success))[_i2265]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_fetch_partition_names_req_args::~ThriftHiveMetastore_fetch_partition_names_req_args() noexcept { +} + +ThriftHiveMetastore_fetch_partition_names_req_args::ThriftHiveMetastore_fetch_partition_names_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->partitionReq.read(iprot); + this->__isset.partitionReq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fetch_partition_names_req_args"); + + xfer += oprot->writeFieldBegin("partitionReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->partitionReq.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fetch_partition_names_req_pargs::~ThriftHiveMetastore_fetch_partition_names_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fetch_partition_names_req_pargs"); + + xfer += oprot->writeFieldBegin("partitionReq", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->partitionReq)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fetch_partition_names_req_result::~ThriftHiveMetastore_fetch_partition_names_req_result() noexcept { +} + +ThriftHiveMetastore_fetch_partition_names_req_result::ThriftHiveMetastore_fetch_partition_names_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2266; + ::apache::thrift::protocol::TType _etype2269; + xfer += iprot->readListBegin(_etype2269, _size2266); + this->success.resize(_size2266); + uint32_t _i2270; + for (_i2270 = 0; _i2270 < _size2266; ++_i2270) + { + xfer += iprot->readString(this->success[_i2270]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fetch_partition_names_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2271; + for (_iter2271 = this->success.begin(); _iter2271 != this->success.end(); ++_iter2271) + { + xfer += oprot->writeString((*_iter2271)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fetch_partition_names_req_presult::~ThriftHiveMetastore_fetch_partition_names_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_fetch_partition_names_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2272; + ::apache::thrift::protocol::TType _etype2275; + xfer += iprot->readListBegin(_etype2275, _size2272); + (*(this->success)).resize(_size2272); + uint32_t _i2276; + for (_i2276 = 0; _i2276 < _size2272; ++_i2276) + { + xfer += iprot->readString((*(this->success))[_i2276]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_values_args::~ThriftHiveMetastore_get_partition_values_args() noexcept { +} + +ThriftHiveMetastore_get_partition_values_args::ThriftHiveMetastore_get_partition_values_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_values_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_values_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_values_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_values_pargs::~ThriftHiveMetastore_get_partition_values_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_values_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_values_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_values_result::~ThriftHiveMetastore_get_partition_values_result() noexcept { +} + +ThriftHiveMetastore_get_partition_values_result::ThriftHiveMetastore_get_partition_values_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_values_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_values_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_values_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_values_presult::~ThriftHiveMetastore_get_partition_values_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_values_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_args::~ThriftHiveMetastore_get_partitions_ps_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_args::ThriftHiveMetastore_get_partitions_ps_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2277; + ::apache::thrift::protocol::TType _etype2280; + xfer += iprot->readListBegin(_etype2280, _size2277); + this->part_vals.resize(_size2277); + uint32_t _i2281; + for (_i2281 = 0; _i2281 < _size2277; ++_i2281) + { + xfer += iprot->readString(this->part_vals[_i2281]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2282; + for (_iter2282 = this->part_vals.begin(); _iter2282 != this->part_vals.end(); ++_iter2282) + { + xfer += oprot->writeString((*_iter2282)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_pargs::~ThriftHiveMetastore_get_partitions_ps_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2283; + for (_iter2283 = (*(this->part_vals)).begin(); _iter2283 != (*(this->part_vals)).end(); ++_iter2283) + { + xfer += oprot->writeString((*_iter2283)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_result::~ThriftHiveMetastore_get_partitions_ps_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_result::ThriftHiveMetastore_get_partitions_ps_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2284; + ::apache::thrift::protocol::TType _etype2287; + xfer += iprot->readListBegin(_etype2287, _size2284); + this->success.resize(_size2284); + uint32_t _i2288; + for (_i2288 = 0; _i2288 < _size2284; ++_i2288) + { + xfer += this->success[_i2288].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2289; + for (_iter2289 = this->success.begin(); _iter2289 != this->success.end(); ++_iter2289) + { + xfer += (*_iter2289).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_presult::~ThriftHiveMetastore_get_partitions_ps_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2290; + ::apache::thrift::protocol::TType _etype2293; + xfer += iprot->readListBegin(_etype2293, _size2290); + (*(this->success)).resize(_size2290); + uint32_t _i2294; + for (_i2294 = 0; _i2294 < _size2290; ++_i2294) + { + xfer += (*(this->success))[_i2294].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_args::~ThriftHiveMetastore_get_partitions_ps_with_auth_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_with_auth_args::ThriftHiveMetastore_get_partitions_ps_with_auth_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1), + user_name() { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2295; + ::apache::thrift::protocol::TType _etype2298; + xfer += iprot->readListBegin(_etype2298, _size2295); + this->part_vals.resize(_size2295); + uint32_t _i2299; + for (_i2299 = 0; _i2299 < _size2295; ++_i2299) + { + xfer += iprot->readString(this->part_vals[_i2299]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user_name); + this->__isset.user_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->group_names.clear(); + uint32_t _size2300; + ::apache::thrift::protocol::TType _etype2303; + xfer += iprot->readListBegin(_etype2303, _size2300); + this->group_names.resize(_size2300); + uint32_t _i2304; + for (_i2304 = 0; _i2304 < _size2300; ++_i2304) + { + xfer += iprot->readString(this->group_names[_i2304]); + } + xfer += iprot->readListEnd(); + } + this->__isset.group_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2305; + for (_iter2305 = this->part_vals.begin(); _iter2305 != this->part_vals.end(); ++_iter2305) + { + xfer += oprot->writeString((*_iter2305)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->user_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); + std::vector ::const_iterator _iter2306; + for (_iter2306 = this->group_names.begin(); _iter2306 != this->group_names.end(); ++_iter2306) + { + xfer += oprot->writeString((*_iter2306)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_pargs::~ThriftHiveMetastore_get_partitions_ps_with_auth_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2307; + for (_iter2307 = (*(this->part_vals)).begin(); _iter2307 != (*(this->part_vals)).end(); ++_iter2307) + { + xfer += oprot->writeString((*_iter2307)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString((*(this->user_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); + std::vector ::const_iterator _iter2308; + for (_iter2308 = (*(this->group_names)).begin(); _iter2308 != (*(this->group_names)).end(); ++_iter2308) + { + xfer += oprot->writeString((*_iter2308)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_result::~ThriftHiveMetastore_get_partitions_ps_with_auth_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_with_auth_result::ThriftHiveMetastore_get_partitions_ps_with_auth_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2309; + ::apache::thrift::protocol::TType _etype2312; + xfer += iprot->readListBegin(_etype2312, _size2309); + this->success.resize(_size2309); + uint32_t _i2313; + for (_i2313 = 0; _i2313 < _size2309; ++_i2313) + { + xfer += this->success[_i2313].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2314; + for (_iter2314 = this->success.begin(); _iter2314 != this->success.end(); ++_iter2314) + { + xfer += (*_iter2314).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_presult::~ThriftHiveMetastore_get_partitions_ps_with_auth_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2315; + ::apache::thrift::protocol::TType _etype2318; + xfer += iprot->readListBegin(_etype2318, _size2315); + (*(this->success)).resize(_size2315); + uint32_t _i2319; + for (_i2319 = 0; _i2319 < _size2315; ++_i2319) + { + xfer += (*(this->success))[_i2319].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_args::~ThriftHiveMetastore_get_partitions_ps_with_auth_req_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_args::ThriftHiveMetastore_get_partitions_ps_with_auth_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs::~ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_result::~ThriftHiveMetastore_get_partitions_ps_with_auth_req_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_result::ThriftHiveMetastore_get_partitions_ps_with_auth_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_ps_with_auth_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult::~ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_args::~ThriftHiveMetastore_get_partition_names_ps_args() noexcept { +} + +ThriftHiveMetastore_get_partition_names_ps_args::ThriftHiveMetastore_get_partition_names_ps_args() noexcept + : db_name(), + tbl_name(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2320; + ::apache::thrift::protocol::TType _etype2323; + xfer += iprot->readListBegin(_etype2323, _size2320); + this->part_vals.resize(_size2320); + uint32_t _i2324; + for (_i2324 = 0; _i2324 < _size2320; ++_i2324) + { + xfer += iprot->readString(this->part_vals[_i2324]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2325; + for (_iter2325 = this->part_vals.begin(); _iter2325 != this->part_vals.end(); ++_iter2325) + { + xfer += oprot->writeString((*_iter2325)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_pargs::~ThriftHiveMetastore_get_partition_names_ps_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_ps_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2326; + for (_iter2326 = (*(this->part_vals)).begin(); _iter2326 != (*(this->part_vals)).end(); ++_iter2326) + { + xfer += oprot->writeString((*_iter2326)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_result::~ThriftHiveMetastore_get_partition_names_ps_result() noexcept { +} + +ThriftHiveMetastore_get_partition_names_ps_result::ThriftHiveMetastore_get_partition_names_ps_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2327; + ::apache::thrift::protocol::TType _etype2330; + xfer += iprot->readListBegin(_etype2330, _size2327); + this->success.resize(_size2327); + uint32_t _i2331; + for (_i2331 = 0; _i2331 < _size2327; ++_i2331) + { + xfer += iprot->readString(this->success[_i2331]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2332; + for (_iter2332 = this->success.begin(); _iter2332 != this->success.end(); ++_iter2332) + { + xfer += oprot->writeString((*_iter2332)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_presult::~ThriftHiveMetastore_get_partition_names_ps_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_ps_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2333; + ::apache::thrift::protocol::TType _etype2336; + xfer += iprot->readListBegin(_etype2336, _size2333); + (*(this->success)).resize(_size2333); + uint32_t _i2337; + for (_i2337 = 0; _i2337 < _size2333; ++_i2337) + { + xfer += iprot->readString((*(this->success))[_i2337]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_req_args::~ThriftHiveMetastore_get_partition_names_ps_req_args() noexcept { +} + +ThriftHiveMetastore_get_partition_names_ps_req_args::ThriftHiveMetastore_get_partition_names_ps_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_req_pargs::~ThriftHiveMetastore_get_partition_names_ps_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_req_result::~ThriftHiveMetastore_get_partition_names_ps_req_result() noexcept { +} + +ThriftHiveMetastore_get_partition_names_ps_req_result::ThriftHiveMetastore_get_partition_names_ps_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_ps_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_ps_req_presult::~ThriftHiveMetastore_get_partition_names_ps_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_ps_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_req_args::~ThriftHiveMetastore_get_partition_names_req_args() noexcept { +} + +ThriftHiveMetastore_get_partition_names_req_args::ThriftHiveMetastore_get_partition_names_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_req_pargs::~ThriftHiveMetastore_get_partition_names_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_req_result::~ThriftHiveMetastore_get_partition_names_req_result() noexcept { +} + +ThriftHiveMetastore_get_partition_names_req_result::ThriftHiveMetastore_get_partition_names_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_names_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2338; + ::apache::thrift::protocol::TType _etype2341; + xfer += iprot->readListBegin(_etype2341, _size2338); + this->success.resize(_size2338); + uint32_t _i2342; + for (_i2342 = 0; _i2342 < _size2338; ++_i2342) + { + xfer += iprot->readString(this->success[_i2342]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_names_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_names_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2343; + for (_iter2343 = this->success.begin(); _iter2343 != this->success.end(); ++_iter2343) + { + xfer += oprot->writeString((*_iter2343)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_names_req_presult::~ThriftHiveMetastore_get_partition_names_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_names_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2344; + ::apache::thrift::protocol::TType _etype2347; + xfer += iprot->readListBegin(_etype2347, _size2344); + (*(this->success)).resize(_size2344); + uint32_t _i2348; + for (_i2348 = 0; _i2348 < _size2344; ++_i2348) + { + xfer += iprot->readString((*(this->success))[_i2348]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_args::~ThriftHiveMetastore_get_partitions_by_filter_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_filter_args::ThriftHiveMetastore_get_partitions_by_filter_args() noexcept + : db_name(), + tbl_name(), + filter(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_pargs::~ThriftHiveMetastore_get_partitions_by_filter_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->filter))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_result::~ThriftHiveMetastore_get_partitions_by_filter_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_filter_result::ThriftHiveMetastore_get_partitions_by_filter_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2349; + ::apache::thrift::protocol::TType _etype2352; + xfer += iprot->readListBegin(_etype2352, _size2349); + this->success.resize(_size2349); + uint32_t _i2353; + for (_i2353 = 0; _i2353 < _size2349; ++_i2353) + { + xfer += this->success[_i2353].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2354; + for (_iter2354 = this->success.begin(); _iter2354 != this->success.end(); ++_iter2354) + { + xfer += (*_iter2354).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_presult::~ThriftHiveMetastore_get_partitions_by_filter_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2355; + ::apache::thrift::protocol::TType _etype2358; + xfer += iprot->readListBegin(_etype2358, _size2355); + (*(this->success)).resize(_size2355); + uint32_t _i2359; + for (_i2359 = 0; _i2359 < _size2355; ++_i2359) + { + xfer += (*(this->success))[_i2359].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_req_args::~ThriftHiveMetastore_get_partitions_by_filter_req_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_filter_req_args::ThriftHiveMetastore_get_partitions_by_filter_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_req_pargs::~ThriftHiveMetastore_get_partitions_by_filter_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_req_result::~ThriftHiveMetastore_get_partitions_by_filter_req_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_filter_req_result::ThriftHiveMetastore_get_partitions_by_filter_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2360; + ::apache::thrift::protocol::TType _etype2363; + xfer += iprot->readListBegin(_etype2363, _size2360); + this->success.resize(_size2360); + uint32_t _i2364; + for (_i2364 = 0; _i2364 < _size2360; ++_i2364) + { + xfer += this->success[_i2364].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_filter_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2365; + for (_iter2365 = this->success.begin(); _iter2365 != this->success.end(); ++_iter2365) + { + xfer += (*_iter2365).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_filter_req_presult::~ThriftHiveMetastore_get_partitions_by_filter_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_filter_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2366; + ::apache::thrift::protocol::TType _etype2369; + xfer += iprot->readListBegin(_etype2369, _size2366); + (*(this->success)).resize(_size2366); + uint32_t _i2370; + for (_i2370 = 0; _i2370 < _size2366; ++_i2370) + { + xfer += (*(this->success))[_i2370].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_part_specs_by_filter_args::~ThriftHiveMetastore_get_part_specs_by_filter_args() noexcept { +} + +ThriftHiveMetastore_get_part_specs_by_filter_args::ThriftHiveMetastore_get_part_specs_by_filter_args() noexcept + : db_name(), + tbl_name(), + filter(), + max_parts(-1) { +} + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->max_parts); + this->__isset.max_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_part_specs_by_filter_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->max_parts); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_part_specs_by_filter_pargs::~ThriftHiveMetastore_get_part_specs_by_filter_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_part_specs_by_filter_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->filter))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max_parts", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((*(this->max_parts))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_part_specs_by_filter_result::~ThriftHiveMetastore_get_part_specs_by_filter_result() noexcept { +} + +ThriftHiveMetastore_get_part_specs_by_filter_result::ThriftHiveMetastore_get_part_specs_by_filter_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2371; + ::apache::thrift::protocol::TType _etype2374; + xfer += iprot->readListBegin(_etype2374, _size2371); + this->success.resize(_size2371); + uint32_t _i2375; + for (_i2375 = 0; _i2375 < _size2371; ++_i2375) + { + xfer += this->success[_i2375].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_part_specs_by_filter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2376; + for (_iter2376 = this->success.begin(); _iter2376 != this->success.end(); ++_iter2376) + { + xfer += (*_iter2376).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_part_specs_by_filter_presult::~ThriftHiveMetastore_get_part_specs_by_filter_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_part_specs_by_filter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2377; + ::apache::thrift::protocol::TType _etype2380; + xfer += iprot->readListBegin(_etype2380, _size2377); + (*(this->success)).resize(_size2377); + uint32_t _i2381; + for (_i2381 = 0; _i2381 < _size2377; ++_i2381) + { + xfer += (*(this->success))[_i2381].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_expr_args::~ThriftHiveMetastore_get_partitions_by_expr_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_expr_args::ThriftHiveMetastore_get_partitions_by_expr_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_expr_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_expr_pargs::~ThriftHiveMetastore_get_partitions_by_expr_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_expr_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_expr_result::~ThriftHiveMetastore_get_partitions_by_expr_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_expr_result::ThriftHiveMetastore_get_partitions_by_expr_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_expr_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_expr_presult::~ThriftHiveMetastore_get_partitions_by_expr_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_expr_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_spec_by_expr_args::~ThriftHiveMetastore_get_partitions_spec_by_expr_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_spec_by_expr_args::ThriftHiveMetastore_get_partitions_spec_by_expr_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_spec_by_expr_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_spec_by_expr_pargs::~ThriftHiveMetastore_get_partitions_spec_by_expr_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_spec_by_expr_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_spec_by_expr_result::~ThriftHiveMetastore_get_partitions_spec_by_expr_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_spec_by_expr_result::ThriftHiveMetastore_get_partitions_spec_by_expr_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_spec_by_expr_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_spec_by_expr_presult::~ThriftHiveMetastore_get_partitions_spec_by_expr_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_spec_by_expr_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_args::~ThriftHiveMetastore_get_num_partitions_by_filter_args() noexcept { +} + +ThriftHiveMetastore_get_num_partitions_by_filter_args::ThriftHiveMetastore_get_num_partitions_by_filter_args() noexcept + : db_name(), + tbl_name(), + filter() { +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_pargs::~ThriftHiveMetastore_get_num_partitions_by_filter_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->filter))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_result::~ThriftHiveMetastore_get_num_partitions_by_filter_result() noexcept { +} + +ThriftHiveMetastore_get_num_partitions_by_filter_result::ThriftHiveMetastore_get_num_partitions_by_filter_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_presult::~ThriftHiveMetastore_get_num_partitions_by_filter_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_args::~ThriftHiveMetastore_get_partitions_by_names_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_names_args::ThriftHiveMetastore_get_partitions_by_names_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->names.clear(); + uint32_t _size2382; + ::apache::thrift::protocol::TType _etype2385; + xfer += iprot->readListBegin(_etype2385, _size2382); + this->names.resize(_size2382); + uint32_t _i2386; + for (_i2386 = 0; _i2386 < _size2382; ++_i2386) + { + xfer += iprot->readString(this->names[_i2386]); + } + xfer += iprot->readListEnd(); + } + this->__isset.names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->names.size())); + std::vector ::const_iterator _iter2387; + for (_iter2387 = this->names.begin(); _iter2387 != this->names.end(); ++_iter2387) + { + xfer += oprot->writeString((*_iter2387)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_pargs::~ThriftHiveMetastore_get_partitions_by_names_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_names_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->names)).size())); + std::vector ::const_iterator _iter2388; + for (_iter2388 = (*(this->names)).begin(); _iter2388 != (*(this->names)).end(); ++_iter2388) + { + xfer += oprot->writeString((*_iter2388)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_result::~ThriftHiveMetastore_get_partitions_by_names_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_names_result::ThriftHiveMetastore_get_partitions_by_names_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2389; + ::apache::thrift::protocol::TType _etype2392; + xfer += iprot->readListBegin(_etype2392, _size2389); + this->success.resize(_size2389); + uint32_t _i2393; + for (_i2393 = 0; _i2393 < _size2389; ++_i2393) + { + xfer += this->success[_i2393].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2394; + for (_iter2394 = this->success.begin(); _iter2394 != this->success.end(); ++_iter2394) + { + xfer += (*_iter2394).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_presult::~ThriftHiveMetastore_get_partitions_by_names_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_names_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2395; + ::apache::thrift::protocol::TType _etype2398; + xfer += iprot->readListBegin(_etype2398, _size2395); + (*(this->success)).resize(_size2395); + uint32_t _i2399; + for (_i2399 = 0; _i2399 < _size2395; ++_i2399) + { + xfer += (*(this->success))[_i2399].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_req_args::~ThriftHiveMetastore_get_partitions_by_names_req_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_names_req_args::ThriftHiveMetastore_get_partitions_by_names_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_req_pargs::~ThriftHiveMetastore_get_partitions_by_names_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_req_result::~ThriftHiveMetastore_get_partitions_by_names_req_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_by_names_req_result::ThriftHiveMetastore_get_partitions_by_names_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_by_names_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_by_names_req_presult::~ThriftHiveMetastore_get_partitions_by_names_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_by_names_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_properties_args::~ThriftHiveMetastore_get_properties_args() noexcept { +} + +ThriftHiveMetastore_get_properties_args::ThriftHiveMetastore_get_properties_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_properties_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_properties_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_properties_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_properties_pargs::~ThriftHiveMetastore_get_properties_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_properties_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_properties_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_properties_result::~ThriftHiveMetastore_get_properties_result() noexcept { +} + +ThriftHiveMetastore_get_properties_result::ThriftHiveMetastore_get_properties_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_properties_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e1.read(iprot); + this->__isset.e1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e2.read(iprot); + this->__isset.e2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_properties_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_properties_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.e1) { + xfer += oprot->writeFieldBegin("e1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->e1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.e2) { + xfer += oprot->writeFieldBegin("e2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->e2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_properties_presult::~ThriftHiveMetastore_get_properties_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_properties_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e1.read(iprot); + this->__isset.e1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e2.read(iprot); + this->__isset.e2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_set_properties_args::~ThriftHiveMetastore_set_properties_args() noexcept { +} + +ThriftHiveMetastore_set_properties_args::ThriftHiveMetastore_set_properties_args() noexcept { +} + +uint32_t ThriftHiveMetastore_set_properties_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_properties_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_properties_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_properties_pargs::~ThriftHiveMetastore_set_properties_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_properties_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_properties_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_properties_result::~ThriftHiveMetastore_set_properties_result() noexcept { +} + +ThriftHiveMetastore_set_properties_result::ThriftHiveMetastore_set_properties_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_set_properties_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e1.read(iprot); + this->__isset.e1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e2.read(iprot); + this->__isset.e2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_properties_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_properties_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.e1) { + xfer += oprot->writeFieldBegin("e1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->e1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.e2) { + xfer += oprot->writeFieldBegin("e2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->e2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_properties_presult::~ThriftHiveMetastore_set_properties_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_properties_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e1.read(iprot); + this->__isset.e1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->e2.read(iprot); + this->__isset.e2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_partition_args::~ThriftHiveMetastore_alter_partition_args() noexcept { +} + +ThriftHiveMetastore_alter_partition_args::ThriftHiveMetastore_alter_partition_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_pargs::~ThriftHiveMetastore_alter_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_result::~ThriftHiveMetastore_alter_partition_result() noexcept { +} + +ThriftHiveMetastore_alter_partition_result::ThriftHiveMetastore_alter_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_presult::~ThriftHiveMetastore_alter_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_args::~ThriftHiveMetastore_alter_partitions_args() noexcept { +} + +ThriftHiveMetastore_alter_partitions_args::ThriftHiveMetastore_alter_partitions_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_partitions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->new_parts.clear(); + uint32_t _size2400; + ::apache::thrift::protocol::TType _etype2403; + xfer += iprot->readListBegin(_etype2403, _size2400); + this->new_parts.resize(_size2400); + uint32_t _i2404; + for (_i2404 = 0; _i2404 < _size2400; ++_i2404) + { + xfer += this->new_parts[_i2404].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.new_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->new_parts.size())); + std::vector ::const_iterator _iter2405; + for (_iter2405 = this->new_parts.begin(); _iter2405 != this->new_parts.end(); ++_iter2405) + { + xfer += (*_iter2405).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_pargs::~ThriftHiveMetastore_alter_partitions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->new_parts)).size())); + std::vector ::const_iterator _iter2406; + for (_iter2406 = (*(this->new_parts)).begin(); _iter2406 != (*(this->new_parts)).end(); ++_iter2406) + { + xfer += (*_iter2406).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_result::~ThriftHiveMetastore_alter_partitions_result() noexcept { +} + +ThriftHiveMetastore_alter_partitions_result::ThriftHiveMetastore_alter_partitions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partitions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_presult::~ThriftHiveMetastore_alter_partitions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_with_environment_context_args::~ThriftHiveMetastore_alter_partitions_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_alter_partitions_with_environment_context_args::ThriftHiveMetastore_alter_partitions_with_environment_context_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->new_parts.clear(); + uint32_t _size2407; + ::apache::thrift::protocol::TType _etype2410; + xfer += iprot->readListBegin(_etype2410, _size2407); + this->new_parts.resize(_size2407); + uint32_t _i2411; + for (_i2411 = 0; _i2411 < _size2407; ++_i2411) + { + xfer += this->new_parts[_i2411].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.new_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->new_parts.size())); + std::vector ::const_iterator _iter2412; + for (_iter2412 = this->new_parts.begin(); _iter2412 != this->new_parts.end(); ++_iter2412) + { + xfer += (*_iter2412).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_with_environment_context_pargs::~ThriftHiveMetastore_alter_partitions_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_parts", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast((*(this->new_parts)).size())); + std::vector ::const_iterator _iter2413; + for (_iter2413 = (*(this->new_parts)).begin(); _iter2413 != (*(this->new_parts)).end(); ++_iter2413) + { + xfer += (*_iter2413).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_with_environment_context_result::~ThriftHiveMetastore_alter_partitions_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_alter_partitions_with_environment_context_result::ThriftHiveMetastore_alter_partitions_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_with_environment_context_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_with_environment_context_presult::~ThriftHiveMetastore_alter_partitions_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_req_args::~ThriftHiveMetastore_alter_partitions_req_args() noexcept { +} + +ThriftHiveMetastore_alter_partitions_req_args::ThriftHiveMetastore_alter_partitions_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partitions_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_req_pargs::~ThriftHiveMetastore_alter_partitions_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_req_result::~ThriftHiveMetastore_alter_partitions_req_result() noexcept { +} + +ThriftHiveMetastore_alter_partitions_req_result::ThriftHiveMetastore_alter_partitions_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partitions_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partitions_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partitions_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partitions_req_presult::~ThriftHiveMetastore_alter_partitions_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partitions_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_partition_with_environment_context_args::~ThriftHiveMetastore_alter_partition_with_environment_context_args() noexcept { +} + +ThriftHiveMetastore_alter_partition_with_environment_context_args::ThriftHiveMetastore_alter_partition_with_environment_context_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environment_context.read(iprot); + this->__isset.environment_context = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_with_environment_context_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->environment_context.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_with_environment_context_pargs::~ThriftHiveMetastore_alter_partition_with_environment_context_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_with_environment_context_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("environment_context", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->environment_context)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_with_environment_context_result::~ThriftHiveMetastore_alter_partition_with_environment_context_result() noexcept { +} + +ThriftHiveMetastore_alter_partition_with_environment_context_result::ThriftHiveMetastore_alter_partition_with_environment_context_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_partition_with_environment_context_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_partition_with_environment_context_presult::~ThriftHiveMetastore_alter_partition_with_environment_context_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_partition_with_environment_context_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_rename_partition_args::~ThriftHiveMetastore_rename_partition_args() noexcept { +} + +ThriftHiveMetastore_rename_partition_args::ThriftHiveMetastore_rename_partition_args() noexcept + : db_name(), + tbl_name() { +} + +uint32_t ThriftHiveMetastore_rename_partition_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2414; + ::apache::thrift::protocol::TType _etype2417; + xfer += iprot->readListBegin(_etype2417, _size2414); + this->part_vals.resize(_size2414); + uint32_t _i2418; + for (_i2418 = 0; _i2418 < _size2414; ++_i2418) + { + xfer += iprot->readString(this->part_vals[_i2418]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->new_part.read(iprot); + this->__isset.new_part = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2419; + for (_iter2419 = this->part_vals.begin(); _iter2419 != this->part_vals.end(); ++_iter2419) + { + xfer += oprot->writeString((*_iter2419)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->new_part.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_pargs::~ThriftHiveMetastore_rename_partition_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_rename_partition_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2420; + for (_iter2420 = (*(this->part_vals)).begin(); _iter2420 != (*(this->part_vals)).end(); ++_iter2420) + { + xfer += oprot->writeString((*_iter2420)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("new_part", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += (*(this->new_part)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_result::~ThriftHiveMetastore_rename_partition_result() noexcept { +} + +ThriftHiveMetastore_rename_partition_result::ThriftHiveMetastore_rename_partition_result() noexcept { +} + +uint32_t ThriftHiveMetastore_rename_partition_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_presult::~ThriftHiveMetastore_rename_partition_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_rename_partition_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_rename_partition_req_args::~ThriftHiveMetastore_rename_partition_req_args() noexcept { +} + +ThriftHiveMetastore_rename_partition_req_args::ThriftHiveMetastore_rename_partition_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_rename_partition_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_req_pargs::~ThriftHiveMetastore_rename_partition_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_rename_partition_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_req_result::~ThriftHiveMetastore_rename_partition_req_result() noexcept { +} + +ThriftHiveMetastore_rename_partition_req_result::ThriftHiveMetastore_rename_partition_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_rename_partition_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_rename_partition_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_rename_partition_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_rename_partition_req_presult::~ThriftHiveMetastore_rename_partition_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_rename_partition_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_partition_name_has_valid_characters_args::~ThriftHiveMetastore_partition_name_has_valid_characters_args() noexcept { +} + +ThriftHiveMetastore_partition_name_has_valid_characters_args::ThriftHiveMetastore_partition_name_has_valid_characters_args() noexcept + : throw_exception(0) { +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->part_vals.clear(); + uint32_t _size2421; + ::apache::thrift::protocol::TType _etype2424; + xfer += iprot->readListBegin(_etype2424, _size2421); + this->part_vals.resize(_size2421); + uint32_t _i2425; + for (_i2425 = 0; _i2425 < _size2421; ++_i2425) + { + xfer += iprot->readString(this->part_vals[_i2425]); + } + xfer += iprot->readListEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->throw_exception); + this->__isset.throw_exception = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_args"); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::vector ::const_iterator _iter2426; + for (_iter2426 = this->part_vals.begin(); _iter2426 != this->part_vals.end(); ++_iter2426) + { + xfer += oprot->writeString((*_iter2426)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("throw_exception", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->throw_exception); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_has_valid_characters_pargs::~ThriftHiveMetastore_partition_name_has_valid_characters_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_pargs"); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::vector ::const_iterator _iter2427; + for (_iter2427 = (*(this->part_vals)).begin(); _iter2427 != (*(this->part_vals)).end(); ++_iter2427) + { + xfer += oprot->writeString((*_iter2427)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("throw_exception", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool((*(this->throw_exception))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_has_valid_characters_result::~ThriftHiveMetastore_partition_name_has_valid_characters_result() noexcept { +} + +ThriftHiveMetastore_partition_name_has_valid_characters_result::ThriftHiveMetastore_partition_name_has_valid_characters_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_has_valid_characters_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_has_valid_characters_presult::~ThriftHiveMetastore_partition_name_has_valid_characters_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_has_valid_characters_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_config_value_args::~ThriftHiveMetastore_get_config_value_args() noexcept { +} + +ThriftHiveMetastore_get_config_value_args::ThriftHiveMetastore_get_config_value_args() noexcept + : name(), + defaultValue() { +} + +uint32_t ThriftHiveMetastore_get_config_value_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->defaultValue); + this->__isset.defaultValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_config_value_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_config_value_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("defaultValue", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->defaultValue); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_config_value_pargs::~ThriftHiveMetastore_get_config_value_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_config_value_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_config_value_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("defaultValue", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->defaultValue))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_config_value_result::~ThriftHiveMetastore_get_config_value_result() noexcept { +} + +ThriftHiveMetastore_get_config_value_result::ThriftHiveMetastore_get_config_value_result() noexcept + : success() { +} + +uint32_t ThriftHiveMetastore_get_config_value_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_config_value_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_config_value_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_config_value_presult::~ThriftHiveMetastore_get_config_value_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_config_value_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_vals_args::~ThriftHiveMetastore_partition_name_to_vals_args() noexcept { +} + +ThriftHiveMetastore_partition_name_to_vals_args::ThriftHiveMetastore_partition_name_to_vals_args() noexcept + : part_name() { +} + +uint32_t ThriftHiveMetastore_partition_name_to_vals_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_to_vals_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_vals_args"); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_vals_pargs::~ThriftHiveMetastore_partition_name_to_vals_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_to_vals_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_vals_pargs"); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_vals_result::~ThriftHiveMetastore_partition_name_to_vals_result() noexcept { +} + +ThriftHiveMetastore_partition_name_to_vals_result::ThriftHiveMetastore_partition_name_to_vals_result() noexcept { +} + +uint32_t ThriftHiveMetastore_partition_name_to_vals_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2428; + ::apache::thrift::protocol::TType _etype2431; + xfer += iprot->readListBegin(_etype2431, _size2428); + this->success.resize(_size2428); + uint32_t _i2432; + for (_i2432 = 0; _i2432 < _size2428; ++_i2432) + { + xfer += iprot->readString(this->success[_i2432]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_to_vals_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_vals_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2433; + for (_iter2433 = this->success.begin(); _iter2433 != this->success.end(); ++_iter2433) + { + xfer += oprot->writeString((*_iter2433)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_vals_presult::~ThriftHiveMetastore_partition_name_to_vals_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_to_vals_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2434; + ::apache::thrift::protocol::TType _etype2437; + xfer += iprot->readListBegin(_etype2437, _size2434); + (*(this->success)).resize(_size2434); + uint32_t _i2438; + for (_i2438 = 0; _i2438 < _size2434; ++_i2438) + { + xfer += iprot->readString((*(this->success))[_i2438]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_spec_args::~ThriftHiveMetastore_partition_name_to_spec_args() noexcept { +} + +ThriftHiveMetastore_partition_name_to_spec_args::ThriftHiveMetastore_partition_name_to_spec_args() noexcept + : part_name() { +} + +uint32_t ThriftHiveMetastore_partition_name_to_spec_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_to_spec_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_spec_args"); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_spec_pargs::~ThriftHiveMetastore_partition_name_to_spec_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_to_spec_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_spec_pargs"); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_spec_result::~ThriftHiveMetastore_partition_name_to_spec_result() noexcept { +} + +ThriftHiveMetastore_partition_name_to_spec_result::ThriftHiveMetastore_partition_name_to_spec_result() noexcept { +} + +uint32_t ThriftHiveMetastore_partition_name_to_spec_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size2439; + ::apache::thrift::protocol::TType _ktype2440; + ::apache::thrift::protocol::TType _vtype2441; + xfer += iprot->readMapBegin(_ktype2440, _vtype2441, _size2439); + uint32_t _i2443; + for (_i2443 = 0; _i2443 < _size2439; ++_i2443) + { + std::string _key2444; + xfer += iprot->readString(_key2444); + std::string& _val2445 = this->success[_key2444]; + xfer += iprot->readString(_val2445); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_partition_name_to_spec_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_partition_name_to_spec_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::map ::const_iterator _iter2446; + for (_iter2446 = this->success.begin(); _iter2446 != this->success.end(); ++_iter2446) + { + xfer += oprot->writeString(_iter2446->first); + xfer += oprot->writeString(_iter2446->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_partition_name_to_spec_presult::~ThriftHiveMetastore_partition_name_to_spec_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_partition_name_to_spec_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size2447; + ::apache::thrift::protocol::TType _ktype2448; + ::apache::thrift::protocol::TType _vtype2449; + xfer += iprot->readMapBegin(_ktype2448, _vtype2449, _size2447); + uint32_t _i2451; + for (_i2451 = 0; _i2451 < _size2447; ++_i2451) + { + std::string _key2452; + xfer += iprot->readString(_key2452); + std::string& _val2453 = (*(this->success))[_key2452]; + xfer += iprot->readString(_val2453); + } + xfer += iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_markPartitionForEvent_args::~ThriftHiveMetastore_markPartitionForEvent_args() noexcept { +} + +ThriftHiveMetastore_markPartitionForEvent_args::ThriftHiveMetastore_markPartitionForEvent_args() noexcept + : db_name(), + tbl_name(), + eventType(static_cast(0)) { +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->part_vals.clear(); + uint32_t _size2454; + ::apache::thrift::protocol::TType _ktype2455; + ::apache::thrift::protocol::TType _vtype2456; + xfer += iprot->readMapBegin(_ktype2455, _vtype2456, _size2454); + uint32_t _i2458; + for (_i2458 = 0; _i2458 < _size2454; ++_i2458) + { + std::string _key2459; + xfer += iprot->readString(_key2459); + std::string& _val2460 = this->part_vals[_key2459]; + xfer += iprot->readString(_val2460); + } + xfer += iprot->readMapEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2461; + xfer += iprot->readI32(ecast2461); + this->eventType = static_cast(ecast2461); + this->__isset.eventType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::map ::const_iterator _iter2462; + for (_iter2462 = this->part_vals.begin(); _iter2462 != this->part_vals.end(); ++_iter2462) + { + xfer += oprot->writeString(_iter2462->first); + xfer += oprot->writeString(_iter2462->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->eventType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_markPartitionForEvent_pargs::~ThriftHiveMetastore_markPartitionForEvent_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_markPartitionForEvent_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::map ::const_iterator _iter2463; + for (_iter2463 = (*(this->part_vals)).begin(); _iter2463 != (*(this->part_vals)).end(); ++_iter2463) + { + xfer += oprot->writeString(_iter2463->first); + xfer += oprot->writeString(_iter2463->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast((*(this->eventType)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_markPartitionForEvent_result::~ThriftHiveMetastore_markPartitionForEvent_result() noexcept { +} + +ThriftHiveMetastore_markPartitionForEvent_result::ThriftHiveMetastore_markPartitionForEvent_result() noexcept { +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_markPartitionForEvent_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_markPartitionForEvent_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o5) { + xfer += oprot->writeFieldBegin("o5", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->o5.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o6) { + xfer += oprot->writeFieldBegin("o6", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->o6.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_markPartitionForEvent_presult::~ThriftHiveMetastore_markPartitionForEvent_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_markPartitionForEvent_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_isPartitionMarkedForEvent_args::~ThriftHiveMetastore_isPartitionMarkedForEvent_args() noexcept { +} + +ThriftHiveMetastore_isPartitionMarkedForEvent_args::ThriftHiveMetastore_isPartitionMarkedForEvent_args() noexcept + : db_name(), + tbl_name(), + eventType(static_cast(0)) { +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->part_vals.clear(); + uint32_t _size2464; + ::apache::thrift::protocol::TType _ktype2465; + ::apache::thrift::protocol::TType _vtype2466; + xfer += iprot->readMapBegin(_ktype2465, _vtype2466, _size2464); + uint32_t _i2468; + for (_i2468 = 0; _i2468 < _size2464; ++_i2468) + { + std::string _key2469; + xfer += iprot->readString(_key2469); + std::string& _val2470 = this->part_vals[_key2469]; + xfer += iprot->readString(_val2470); + } + xfer += iprot->readMapEnd(); + } + this->__isset.part_vals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2471; + xfer += iprot->readI32(ecast2471); + this->eventType = static_cast(ecast2471); + this->__isset.eventType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->part_vals.size())); + std::map ::const_iterator _iter2472; + for (_iter2472 = this->part_vals.begin(); _iter2472 != this->part_vals.end(); ++_iter2472) + { + xfer += oprot->writeString(_iter2472->first); + xfer += oprot->writeString(_iter2472->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->eventType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_isPartitionMarkedForEvent_pargs::~ThriftHiveMetastore_isPartitionMarkedForEvent_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_vals", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast((*(this->part_vals)).size())); + std::map ::const_iterator _iter2473; + for (_iter2473 = (*(this->part_vals)).begin(); _iter2473 != (*(this->part_vals)).end(); ++_iter2473) + { + xfer += oprot->writeString(_iter2473->first); + xfer += oprot->writeString(_iter2473->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast((*(this->eventType)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_isPartitionMarkedForEvent_result::~ThriftHiveMetastore_isPartitionMarkedForEvent_result() noexcept { +} + +ThriftHiveMetastore_isPartitionMarkedForEvent_result::ThriftHiveMetastore_isPartitionMarkedForEvent_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_isPartitionMarkedForEvent_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o5) { + xfer += oprot->writeFieldBegin("o5", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->o5.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o6) { + xfer += oprot->writeFieldBegin("o6", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->o6.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_isPartitionMarkedForEvent_presult::~ThriftHiveMetastore_isPartitionMarkedForEvent_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_isPartitionMarkedForEvent_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o5.read(iprot); + this->__isset.o5 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o6.read(iprot); + this->__isset.o6 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_primary_keys_args::~ThriftHiveMetastore_get_primary_keys_args() noexcept { +} + +ThriftHiveMetastore_get_primary_keys_args::ThriftHiveMetastore_get_primary_keys_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_primary_keys_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_primary_keys_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_primary_keys_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_primary_keys_pargs::~ThriftHiveMetastore_get_primary_keys_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_primary_keys_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_primary_keys_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_primary_keys_result::~ThriftHiveMetastore_get_primary_keys_result() noexcept { +} + +ThriftHiveMetastore_get_primary_keys_result::ThriftHiveMetastore_get_primary_keys_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_primary_keys_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_primary_keys_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_primary_keys_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_primary_keys_presult::~ThriftHiveMetastore_get_primary_keys_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_primary_keys_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_foreign_keys_args::~ThriftHiveMetastore_get_foreign_keys_args() noexcept { +} + +ThriftHiveMetastore_get_foreign_keys_args::ThriftHiveMetastore_get_foreign_keys_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_foreign_keys_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_foreign_keys_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_foreign_keys_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_foreign_keys_pargs::~ThriftHiveMetastore_get_foreign_keys_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_foreign_keys_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_foreign_keys_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_foreign_keys_result::~ThriftHiveMetastore_get_foreign_keys_result() noexcept { +} + +ThriftHiveMetastore_get_foreign_keys_result::ThriftHiveMetastore_get_foreign_keys_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_foreign_keys_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_foreign_keys_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_foreign_keys_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_foreign_keys_presult::~ThriftHiveMetastore_get_foreign_keys_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_foreign_keys_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_unique_constraints_args::~ThriftHiveMetastore_get_unique_constraints_args() noexcept { +} + +ThriftHiveMetastore_get_unique_constraints_args::ThriftHiveMetastore_get_unique_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_unique_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_unique_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_unique_constraints_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_unique_constraints_pargs::~ThriftHiveMetastore_get_unique_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_unique_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_unique_constraints_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_unique_constraints_result::~ThriftHiveMetastore_get_unique_constraints_result() noexcept { +} + +ThriftHiveMetastore_get_unique_constraints_result::ThriftHiveMetastore_get_unique_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_unique_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_unique_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_unique_constraints_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_unique_constraints_presult::~ThriftHiveMetastore_get_unique_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_unique_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_not_null_constraints_args::~ThriftHiveMetastore_get_not_null_constraints_args() noexcept { +} + +ThriftHiveMetastore_get_not_null_constraints_args::ThriftHiveMetastore_get_not_null_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_not_null_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_not_null_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_not_null_constraints_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_not_null_constraints_pargs::~ThriftHiveMetastore_get_not_null_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_not_null_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_not_null_constraints_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_not_null_constraints_result::~ThriftHiveMetastore_get_not_null_constraints_result() noexcept { +} + +ThriftHiveMetastore_get_not_null_constraints_result::ThriftHiveMetastore_get_not_null_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_not_null_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_not_null_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_not_null_constraints_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_not_null_constraints_presult::~ThriftHiveMetastore_get_not_null_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_not_null_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_default_constraints_args::~ThriftHiveMetastore_get_default_constraints_args() noexcept { +} + +ThriftHiveMetastore_get_default_constraints_args::ThriftHiveMetastore_get_default_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_default_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_default_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_default_constraints_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_default_constraints_pargs::~ThriftHiveMetastore_get_default_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_default_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_default_constraints_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_default_constraints_result::~ThriftHiveMetastore_get_default_constraints_result() noexcept { +} + +ThriftHiveMetastore_get_default_constraints_result::ThriftHiveMetastore_get_default_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_default_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_default_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_default_constraints_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_default_constraints_presult::~ThriftHiveMetastore_get_default_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_default_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_check_constraints_args::~ThriftHiveMetastore_get_check_constraints_args() noexcept { +} + +ThriftHiveMetastore_get_check_constraints_args::ThriftHiveMetastore_get_check_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_check_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_check_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_check_constraints_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_check_constraints_pargs::~ThriftHiveMetastore_get_check_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_check_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_check_constraints_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_check_constraints_result::~ThriftHiveMetastore_get_check_constraints_result() noexcept { +} + +ThriftHiveMetastore_get_check_constraints_result::ThriftHiveMetastore_get_check_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_check_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_check_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_check_constraints_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_check_constraints_presult::~ThriftHiveMetastore_get_check_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_check_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_table_constraints_args::~ThriftHiveMetastore_get_all_table_constraints_args() noexcept { +} + +ThriftHiveMetastore_get_all_table_constraints_args::ThriftHiveMetastore_get_all_table_constraints_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_table_constraints_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_table_constraints_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_table_constraints_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_table_constraints_pargs::~ThriftHiveMetastore_get_all_table_constraints_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_table_constraints_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_table_constraints_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_table_constraints_result::~ThriftHiveMetastore_get_all_table_constraints_result() noexcept { +} + +ThriftHiveMetastore_get_all_table_constraints_result::ThriftHiveMetastore_get_all_table_constraints_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_table_constraints_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_table_constraints_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_table_constraints_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_table_constraints_presult::~ThriftHiveMetastore_get_all_table_constraints_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_table_constraints_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_args::~ThriftHiveMetastore_update_table_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_update_table_column_statistics_args::ThriftHiveMetastore_update_table_column_statistics_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stats_obj.read(iprot); + this->__isset.stats_obj = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_args"); + + xfer += oprot->writeFieldBegin("stats_obj", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->stats_obj.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_pargs::~ThriftHiveMetastore_update_table_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_table_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("stats_obj", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->stats_obj)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_result::~ThriftHiveMetastore_update_table_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_update_table_column_statistics_result::ThriftHiveMetastore_update_table_column_statistics_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_presult::~ThriftHiveMetastore_update_table_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_table_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_args::~ThriftHiveMetastore_update_partition_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_update_partition_column_statistics_args::ThriftHiveMetastore_update_partition_column_statistics_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stats_obj.read(iprot); + this->__isset.stats_obj = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_args"); + + xfer += oprot->writeFieldBegin("stats_obj", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->stats_obj.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_pargs::~ThriftHiveMetastore_update_partition_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("stats_obj", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->stats_obj)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_result::~ThriftHiveMetastore_update_partition_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_update_partition_column_statistics_result::ThriftHiveMetastore_update_partition_column_statistics_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_presult::~ThriftHiveMetastore_update_partition_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_req_args::~ThriftHiveMetastore_update_table_column_statistics_req_args() noexcept { +} + +ThriftHiveMetastore_update_table_column_statistics_req_args::ThriftHiveMetastore_update_table_column_statistics_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_req_pargs::~ThriftHiveMetastore_update_table_column_statistics_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_req_result::~ThriftHiveMetastore_update_table_column_statistics_req_result() noexcept { +} + +ThriftHiveMetastore_update_table_column_statistics_req_result::ThriftHiveMetastore_update_table_column_statistics_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_table_column_statistics_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_table_column_statistics_req_presult::~ThriftHiveMetastore_update_table_column_statistics_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_table_column_statistics_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_req_args::~ThriftHiveMetastore_update_partition_column_statistics_req_args() noexcept { +} + +ThriftHiveMetastore_update_partition_column_statistics_req_args::ThriftHiveMetastore_update_partition_column_statistics_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_req_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_req_pargs::~ThriftHiveMetastore_update_partition_column_statistics_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_req_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_req_result::~ThriftHiveMetastore_update_partition_column_statistics_req_result() noexcept { +} + +ThriftHiveMetastore_update_partition_column_statistics_req_result::ThriftHiveMetastore_update_partition_column_statistics_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_partition_column_statistics_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_partition_column_statistics_req_presult::~ThriftHiveMetastore_update_partition_column_statistics_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_partition_column_statistics_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_transaction_statistics_args::~ThriftHiveMetastore_update_transaction_statistics_args() noexcept { +} + +ThriftHiveMetastore_update_transaction_statistics_args::ThriftHiveMetastore_update_transaction_statistics_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_transaction_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_transaction_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_transaction_statistics_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_transaction_statistics_pargs::~ThriftHiveMetastore_update_transaction_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_transaction_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_transaction_statistics_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_transaction_statistics_result::~ThriftHiveMetastore_update_transaction_statistics_result() noexcept { +} + +ThriftHiveMetastore_update_transaction_statistics_result::ThriftHiveMetastore_update_transaction_statistics_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_transaction_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_transaction_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_transaction_statistics_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_transaction_statistics_presult::~ThriftHiveMetastore_update_transaction_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_transaction_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_column_statistics_args::~ThriftHiveMetastore_get_table_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_get_table_column_statistics_args::ThriftHiveMetastore_get_table_column_statistics_args() noexcept + : db_name(), + tbl_name(), + col_name() { +} + +uint32_t ThriftHiveMetastore_get_table_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->col_name); + this->__isset.col_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_column_statistics_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->col_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_column_statistics_pargs::~ThriftHiveMetastore_get_table_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->col_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_column_statistics_result::~ThriftHiveMetastore_get_table_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_get_table_column_statistics_result::ThriftHiveMetastore_get_table_column_statistics_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_column_statistics_presult::~ThriftHiveMetastore_get_table_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partition_column_statistics_args::~ThriftHiveMetastore_get_partition_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_get_partition_column_statistics_args::ThriftHiveMetastore_get_partition_column_statistics_args() noexcept + : db_name(), + tbl_name(), + part_name(), + col_name() { +} + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->col_name); + this->__isset.col_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_column_statistics_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->col_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_column_statistics_pargs::~ThriftHiveMetastore_get_partition_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->col_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_column_statistics_result::~ThriftHiveMetastore_get_partition_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_get_partition_column_statistics_result::ThriftHiveMetastore_get_partition_column_statistics_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partition_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partition_column_statistics_presult::~ThriftHiveMetastore_get_partition_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partition_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_table_statistics_req_args::~ThriftHiveMetastore_get_table_statistics_req_args() noexcept { +} + +ThriftHiveMetastore_get_table_statistics_req_args::ThriftHiveMetastore_get_table_statistics_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_statistics_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_statistics_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_statistics_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_statistics_req_pargs::~ThriftHiveMetastore_get_table_statistics_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_statistics_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_statistics_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_statistics_req_result::~ThriftHiveMetastore_get_table_statistics_req_result() noexcept { +} + +ThriftHiveMetastore_get_table_statistics_req_result::ThriftHiveMetastore_get_table_statistics_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_table_statistics_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_table_statistics_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_table_statistics_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_table_statistics_req_presult::~ThriftHiveMetastore_get_table_statistics_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_table_statistics_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_statistics_req_args::~ThriftHiveMetastore_get_partitions_statistics_req_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_statistics_req_args::ThriftHiveMetastore_get_partitions_statistics_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_statistics_req_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_statistics_req_pargs::~ThriftHiveMetastore_get_partitions_statistics_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_statistics_req_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_statistics_req_result::~ThriftHiveMetastore_get_partitions_statistics_req_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_statistics_req_result::ThriftHiveMetastore_get_partitions_statistics_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_statistics_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_statistics_req_presult::~ThriftHiveMetastore_get_partitions_statistics_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_statistics_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_aggr_stats_for_args::~ThriftHiveMetastore_get_aggr_stats_for_args() noexcept { +} + +ThriftHiveMetastore_get_aggr_stats_for_args::ThriftHiveMetastore_get_aggr_stats_for_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_aggr_stats_for_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_aggr_stats_for_pargs::~ThriftHiveMetastore_get_aggr_stats_for_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_aggr_stats_for_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_aggr_stats_for_result::~ThriftHiveMetastore_get_aggr_stats_for_result() noexcept { +} + +ThriftHiveMetastore_get_aggr_stats_for_result::ThriftHiveMetastore_get_aggr_stats_for_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_aggr_stats_for_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_aggr_stats_for_presult::~ThriftHiveMetastore_get_aggr_stats_for_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_aggr_stats_for_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_set_aggr_stats_for_args::~ThriftHiveMetastore_set_aggr_stats_for_args() noexcept { +} + +ThriftHiveMetastore_set_aggr_stats_for_args::ThriftHiveMetastore_set_aggr_stats_for_args() noexcept { +} + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_aggr_stats_for_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_aggr_stats_for_pargs::~ThriftHiveMetastore_set_aggr_stats_for_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_aggr_stats_for_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_aggr_stats_for_result::~ThriftHiveMetastore_set_aggr_stats_for_result() noexcept { +} + +ThriftHiveMetastore_set_aggr_stats_for_result::ThriftHiveMetastore_set_aggr_stats_for_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_aggr_stats_for_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_aggr_stats_for_presult::~ThriftHiveMetastore_set_aggr_stats_for_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_aggr_stats_for_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_delete_partition_column_statistics_args::~ThriftHiveMetastore_delete_partition_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_delete_partition_column_statistics_args::ThriftHiveMetastore_delete_partition_column_statistics_args() noexcept + : db_name(), + tbl_name(), + part_name(), + col_name(), + engine() { +} + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->part_name); + this->__isset.part_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->col_name); + this->__isset.col_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_partition_column_statistics_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->part_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->col_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_partition_column_statistics_pargs::~ThriftHiveMetastore_delete_partition_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_partition_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("part_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->part_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->col_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString((*(this->engine))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_partition_column_statistics_result::~ThriftHiveMetastore_delete_partition_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_delete_partition_column_statistics_result::ThriftHiveMetastore_delete_partition_column_statistics_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_partition_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_partition_column_statistics_presult::~ThriftHiveMetastore_delete_partition_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_delete_partition_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_delete_table_column_statistics_args::~ThriftHiveMetastore_delete_table_column_statistics_args() noexcept { +} + +ThriftHiveMetastore_delete_table_column_statistics_args::ThriftHiveMetastore_delete_table_column_statistics_args() noexcept + : db_name(), + tbl_name(), + col_name(), + engine() { +} + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->col_name); + this->__isset.col_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_table_column_statistics_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->col_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_table_column_statistics_pargs::~ThriftHiveMetastore_delete_table_column_statistics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_table_column_statistics_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("col_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->col_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->engine))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_table_column_statistics_result::~ThriftHiveMetastore_delete_table_column_statistics_result() noexcept { +} + +ThriftHiveMetastore_delete_table_column_statistics_result::ThriftHiveMetastore_delete_table_column_statistics_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_delete_table_column_statistics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_delete_table_column_statistics_presult::~ThriftHiveMetastore_delete_table_column_statistics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_delete_table_column_statistics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_function_args::~ThriftHiveMetastore_create_function_args() noexcept { +} + +ThriftHiveMetastore_create_function_args::ThriftHiveMetastore_create_function_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_function_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->func.read(iprot); + this->__isset.func = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_function_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_function_args"); + + xfer += oprot->writeFieldBegin("func", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->func.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_function_pargs::~ThriftHiveMetastore_create_function_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_function_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_function_pargs"); + + xfer += oprot->writeFieldBegin("func", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->func)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_function_result::~ThriftHiveMetastore_create_function_result() noexcept { +} + +ThriftHiveMetastore_create_function_result::ThriftHiveMetastore_create_function_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_function_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_function_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_function_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_function_presult::~ThriftHiveMetastore_create_function_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_function_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_function_args::~ThriftHiveMetastore_drop_function_args() noexcept { +} + +ThriftHiveMetastore_drop_function_args::ThriftHiveMetastore_drop_function_args() noexcept + : dbName(), + funcName() { +} + +uint32_t ThriftHiveMetastore_drop_function_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->funcName); + this->__isset.funcName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_function_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_function_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->funcName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_function_pargs::~ThriftHiveMetastore_drop_function_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_function_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_function_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->funcName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_function_result::~ThriftHiveMetastore_drop_function_result() noexcept { +} + +ThriftHiveMetastore_drop_function_result::ThriftHiveMetastore_drop_function_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_function_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_function_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_function_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_function_presult::~ThriftHiveMetastore_drop_function_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_function_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_function_args::~ThriftHiveMetastore_alter_function_args() noexcept { +} + +ThriftHiveMetastore_alter_function_args::ThriftHiveMetastore_alter_function_args() noexcept + : dbName(), + funcName() { +} + +uint32_t ThriftHiveMetastore_alter_function_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->funcName); + this->__isset.funcName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newFunc.read(iprot); + this->__isset.newFunc = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_function_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_function_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->funcName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newFunc", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->newFunc.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_function_pargs::~ThriftHiveMetastore_alter_function_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_function_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_function_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->funcName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newFunc", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->newFunc)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_function_result::~ThriftHiveMetastore_alter_function_result() noexcept { +} + +ThriftHiveMetastore_alter_function_result::ThriftHiveMetastore_alter_function_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_function_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_function_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_function_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_function_presult::~ThriftHiveMetastore_alter_function_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_function_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_functions_args::~ThriftHiveMetastore_get_functions_args() noexcept { +} + +ThriftHiveMetastore_get_functions_args::ThriftHiveMetastore_get_functions_args() noexcept + : dbName(), + pattern() { +} + +uint32_t ThriftHiveMetastore_get_functions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pattern); + this->__isset.pattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_functions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_functions_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->pattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_functions_pargs::~ThriftHiveMetastore_get_functions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_functions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_functions_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->pattern))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_functions_result::~ThriftHiveMetastore_get_functions_result() noexcept { +} + +ThriftHiveMetastore_get_functions_result::ThriftHiveMetastore_get_functions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_functions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2474; + ::apache::thrift::protocol::TType _etype2477; + xfer += iprot->readListBegin(_etype2477, _size2474); + this->success.resize(_size2474); + uint32_t _i2478; + for (_i2478 = 0; _i2478 < _size2474; ++_i2478) + { + xfer += iprot->readString(this->success[_i2478]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_functions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_functions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2479; + for (_iter2479 = this->success.begin(); _iter2479 != this->success.end(); ++_iter2479) + { + xfer += oprot->writeString((*_iter2479)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_functions_presult::~ThriftHiveMetastore_get_functions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_functions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2480; + ::apache::thrift::protocol::TType _etype2483; + xfer += iprot->readListBegin(_etype2483, _size2480); + (*(this->success)).resize(_size2480); + uint32_t _i2484; + for (_i2484 = 0; _i2484 < _size2480; ++_i2484) + { + xfer += iprot->readString((*(this->success))[_i2484]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_function_args::~ThriftHiveMetastore_get_function_args() noexcept { +} + +ThriftHiveMetastore_get_function_args::ThriftHiveMetastore_get_function_args() noexcept + : dbName(), + funcName() { +} + +uint32_t ThriftHiveMetastore_get_function_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->funcName); + this->__isset.funcName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_function_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_function_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->funcName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_function_pargs::~ThriftHiveMetastore_get_function_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_function_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_function_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("funcName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->funcName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_function_result::~ThriftHiveMetastore_get_function_result() noexcept { +} + +ThriftHiveMetastore_get_function_result::ThriftHiveMetastore_get_function_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_function_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_function_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_function_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_function_presult::~ThriftHiveMetastore_get_function_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_function_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_functions_args::~ThriftHiveMetastore_get_all_functions_args() noexcept { +} + +ThriftHiveMetastore_get_all_functions_args::ThriftHiveMetastore_get_all_functions_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_functions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_functions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_functions_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_functions_pargs::~ThriftHiveMetastore_get_all_functions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_functions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_functions_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_functions_result::~ThriftHiveMetastore_get_all_functions_result() noexcept { +} + +ThriftHiveMetastore_get_all_functions_result::ThriftHiveMetastore_get_all_functions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_functions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_functions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_functions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_functions_presult::~ThriftHiveMetastore_get_all_functions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_functions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_role_args::~ThriftHiveMetastore_create_role_args() noexcept { +} + +ThriftHiveMetastore_create_role_args::ThriftHiveMetastore_create_role_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->role.read(iprot); + this->__isset.role = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_role_args"); + + xfer += oprot->writeFieldBegin("role", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->role.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_role_pargs::~ThriftHiveMetastore_create_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_role_pargs"); + + xfer += oprot->writeFieldBegin("role", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->role)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_role_result::~ThriftHiveMetastore_create_role_result() noexcept { +} + +ThriftHiveMetastore_create_role_result::ThriftHiveMetastore_create_role_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_create_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_role_presult::~ThriftHiveMetastore_create_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_role_args::~ThriftHiveMetastore_drop_role_args() noexcept { +} + +ThriftHiveMetastore_drop_role_args::ThriftHiveMetastore_drop_role_args() noexcept + : role_name() { +} + +uint32_t ThriftHiveMetastore_drop_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->role_name); + this->__isset.role_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_role_args"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->role_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_role_pargs::~ThriftHiveMetastore_drop_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_role_pargs"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->role_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_role_result::~ThriftHiveMetastore_drop_role_result() noexcept { +} + +ThriftHiveMetastore_drop_role_result::ThriftHiveMetastore_drop_role_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_drop_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_role_presult::~ThriftHiveMetastore_drop_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_role_names_args::~ThriftHiveMetastore_get_role_names_args() noexcept { +} + +ThriftHiveMetastore_get_role_names_args::ThriftHiveMetastore_get_role_names_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_role_names_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_role_names_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_names_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_names_pargs::~ThriftHiveMetastore_get_role_names_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_role_names_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_names_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_names_result::~ThriftHiveMetastore_get_role_names_result() noexcept { +} + +ThriftHiveMetastore_get_role_names_result::ThriftHiveMetastore_get_role_names_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_role_names_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2485; + ::apache::thrift::protocol::TType _etype2488; + xfer += iprot->readListBegin(_etype2488, _size2485); + this->success.resize(_size2485); + uint32_t _i2489; + for (_i2489 = 0; _i2489 < _size2485; ++_i2489) + { + xfer += iprot->readString(this->success[_i2489]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_role_names_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_names_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2490; + for (_iter2490 = this->success.begin(); _iter2490 != this->success.end(); ++_iter2490) + { + xfer += oprot->writeString((*_iter2490)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_names_presult::~ThriftHiveMetastore_get_role_names_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_role_names_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2491; + ::apache::thrift::protocol::TType _etype2494; + xfer += iprot->readListBegin(_etype2494, _size2491); + (*(this->success)).resize(_size2491); + uint32_t _i2495; + for (_i2495 = 0; _i2495 < _size2491; ++_i2495) + { + xfer += iprot->readString((*(this->success))[_i2495]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_grant_role_args::~ThriftHiveMetastore_grant_role_args() noexcept { +} + +ThriftHiveMetastore_grant_role_args::ThriftHiveMetastore_grant_role_args() noexcept + : role_name(), + principal_name(), + principal_type(static_cast(0)), + grantor(), + grantorType(static_cast(0)), + grant_option(0) { +} + +uint32_t ThriftHiveMetastore_grant_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->role_name); + this->__isset.role_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principal_name); + this->__isset.principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2496; + xfer += iprot->readI32(ecast2496); + this->principal_type = static_cast(ecast2496); + this->__isset.principal_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->grantor); + this->__isset.grantor = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2497; + xfer += iprot->readI32(ecast2497); + this->grantorType = static_cast(ecast2497); + this->__isset.grantorType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->grant_option); + this->__isset.grant_option = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_role_args"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->role_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->principal_type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantor", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->grantor); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantorType", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->grantorType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grant_option", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->grant_option); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_role_pargs::~ThriftHiveMetastore_grant_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_role_pargs"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->role_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->principal_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast((*(this->principal_type)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantor", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString((*(this->grantor))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantorType", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast((*(this->grantorType)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grant_option", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool((*(this->grant_option))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_role_result::~ThriftHiveMetastore_grant_role_result() noexcept { +} + +ThriftHiveMetastore_grant_role_result::ThriftHiveMetastore_grant_role_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_grant_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_role_presult::~ThriftHiveMetastore_grant_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_revoke_role_args::~ThriftHiveMetastore_revoke_role_args() noexcept { +} + +ThriftHiveMetastore_revoke_role_args::ThriftHiveMetastore_revoke_role_args() noexcept + : role_name(), + principal_name(), + principal_type(static_cast(0)) { +} + +uint32_t ThriftHiveMetastore_revoke_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->role_name); + this->__isset.role_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principal_name); + this->__isset.principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2498; + xfer += iprot->readI32(ecast2498); + this->principal_type = static_cast(ecast2498); + this->__isset.principal_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_revoke_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_role_args"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->role_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->principal_type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_role_pargs::~ThriftHiveMetastore_revoke_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_revoke_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_role_pargs"); + + xfer += oprot->writeFieldBegin("role_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->role_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->principal_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast((*(this->principal_type)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_role_result::~ThriftHiveMetastore_revoke_role_result() noexcept { +} + +ThriftHiveMetastore_revoke_role_result::ThriftHiveMetastore_revoke_role_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_revoke_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_revoke_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_role_presult::~ThriftHiveMetastore_revoke_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_revoke_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_list_roles_args::~ThriftHiveMetastore_list_roles_args() noexcept { +} + +ThriftHiveMetastore_list_roles_args::ThriftHiveMetastore_list_roles_args() noexcept + : principal_name(), + principal_type(static_cast(0)) { +} + +uint32_t ThriftHiveMetastore_list_roles_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principal_name); + this->__isset.principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2499; + xfer += iprot->readI32(ecast2499); + this->principal_type = static_cast(ecast2499); + this->__isset.principal_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_list_roles_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_roles_args"); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->principal_type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_roles_pargs::~ThriftHiveMetastore_list_roles_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_list_roles_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_roles_pargs"); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->principal_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast((*(this->principal_type)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_roles_result::~ThriftHiveMetastore_list_roles_result() noexcept { +} + +ThriftHiveMetastore_list_roles_result::ThriftHiveMetastore_list_roles_result() noexcept { +} + +uint32_t ThriftHiveMetastore_list_roles_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2500; + ::apache::thrift::protocol::TType _etype2503; + xfer += iprot->readListBegin(_etype2503, _size2500); + this->success.resize(_size2500); + uint32_t _i2504; + for (_i2504 = 0; _i2504 < _size2500; ++_i2504) + { + xfer += this->success[_i2504].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_list_roles_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_roles_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2505; + for (_iter2505 = this->success.begin(); _iter2505 != this->success.end(); ++_iter2505) + { + xfer += (*_iter2505).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_roles_presult::~ThriftHiveMetastore_list_roles_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_list_roles_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2506; + ::apache::thrift::protocol::TType _etype2509; + xfer += iprot->readListBegin(_etype2509, _size2506); + (*(this->success)).resize(_size2506); + uint32_t _i2510; + for (_i2510 = 0; _i2510 < _size2506; ++_i2510) + { + xfer += (*(this->success))[_i2510].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_role_args::~ThriftHiveMetastore_grant_revoke_role_args() noexcept { +} + +ThriftHiveMetastore_grant_revoke_role_args::ThriftHiveMetastore_grant_revoke_role_args() noexcept { +} + +uint32_t ThriftHiveMetastore_grant_revoke_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_revoke_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_role_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_role_pargs::~ThriftHiveMetastore_grant_revoke_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_revoke_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_role_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_role_result::~ThriftHiveMetastore_grant_revoke_role_result() noexcept { +} + +ThriftHiveMetastore_grant_revoke_role_result::ThriftHiveMetastore_grant_revoke_role_result() noexcept { +} + +uint32_t ThriftHiveMetastore_grant_revoke_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_revoke_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_role_presult::~ThriftHiveMetastore_grant_revoke_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_revoke_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_principals_in_role_args::~ThriftHiveMetastore_get_principals_in_role_args() noexcept { +} + +ThriftHiveMetastore_get_principals_in_role_args::ThriftHiveMetastore_get_principals_in_role_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_principals_in_role_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_principals_in_role_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_principals_in_role_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_principals_in_role_pargs::~ThriftHiveMetastore_get_principals_in_role_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_principals_in_role_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_principals_in_role_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_principals_in_role_result::~ThriftHiveMetastore_get_principals_in_role_result() noexcept { +} + +ThriftHiveMetastore_get_principals_in_role_result::ThriftHiveMetastore_get_principals_in_role_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_principals_in_role_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_principals_in_role_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_principals_in_role_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_principals_in_role_presult::~ThriftHiveMetastore_get_principals_in_role_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_principals_in_role_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_role_grants_for_principal_args::~ThriftHiveMetastore_get_role_grants_for_principal_args() noexcept { +} + +ThriftHiveMetastore_get_role_grants_for_principal_args::ThriftHiveMetastore_get_role_grants_for_principal_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_grants_for_principal_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_grants_for_principal_pargs::~ThriftHiveMetastore_get_role_grants_for_principal_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_grants_for_principal_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_grants_for_principal_result::~ThriftHiveMetastore_get_role_grants_for_principal_result() noexcept { +} + +ThriftHiveMetastore_get_role_grants_for_principal_result::ThriftHiveMetastore_get_role_grants_for_principal_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_role_grants_for_principal_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_role_grants_for_principal_presult::~ThriftHiveMetastore_get_role_grants_for_principal_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_role_grants_for_principal_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_privilege_set_args::~ThriftHiveMetastore_get_privilege_set_args() noexcept { +} + +ThriftHiveMetastore_get_privilege_set_args::ThriftHiveMetastore_get_privilege_set_args() noexcept + : user_name() { +} + +uint32_t ThriftHiveMetastore_get_privilege_set_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->hiveObject.read(iprot); + this->__isset.hiveObject = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user_name); + this->__isset.user_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->group_names.clear(); + uint32_t _size2511; + ::apache::thrift::protocol::TType _etype2514; + xfer += iprot->readListBegin(_etype2514, _size2511); + this->group_names.resize(_size2511); + uint32_t _i2515; + for (_i2515 = 0; _i2515 < _size2511; ++_i2515) + { + xfer += iprot->readString(this->group_names[_i2515]); + } + xfer += iprot->readListEnd(); + } + this->__isset.group_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_privilege_set_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_privilege_set_args"); + + xfer += oprot->writeFieldBegin("hiveObject", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->hiveObject.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->user_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); + std::vector ::const_iterator _iter2516; + for (_iter2516 = this->group_names.begin(); _iter2516 != this->group_names.end(); ++_iter2516) + { + xfer += oprot->writeString((*_iter2516)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_privilege_set_pargs::~ThriftHiveMetastore_get_privilege_set_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_privilege_set_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_privilege_set_pargs"); + + xfer += oprot->writeFieldBegin("hiveObject", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->hiveObject)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->user_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); + std::vector ::const_iterator _iter2517; + for (_iter2517 = (*(this->group_names)).begin(); _iter2517 != (*(this->group_names)).end(); ++_iter2517) + { + xfer += oprot->writeString((*_iter2517)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_privilege_set_result::~ThriftHiveMetastore_get_privilege_set_result() noexcept { +} + +ThriftHiveMetastore_get_privilege_set_result::ThriftHiveMetastore_get_privilege_set_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_privilege_set_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_privilege_set_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_privilege_set_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_privilege_set_presult::~ThriftHiveMetastore_get_privilege_set_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_privilege_set_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_list_privileges_args::~ThriftHiveMetastore_list_privileges_args() noexcept { +} + +ThriftHiveMetastore_list_privileges_args::ThriftHiveMetastore_list_privileges_args() noexcept + : principal_name(), + principal_type(static_cast(0)) { +} + +uint32_t ThriftHiveMetastore_list_privileges_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principal_name); + this->__isset.principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast2518; + xfer += iprot->readI32(ecast2518); + this->principal_type = static_cast(ecast2518); + this->__isset.principal_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->hiveObject.read(iprot); + this->__isset.hiveObject = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_list_privileges_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_privileges_args"); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->principal_type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hiveObject", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->hiveObject.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_privileges_pargs::~ThriftHiveMetastore_list_privileges_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_list_privileges_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_privileges_pargs"); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->principal_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast((*(this->principal_type)))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hiveObject", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->hiveObject)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_privileges_result::~ThriftHiveMetastore_list_privileges_result() noexcept { +} + +ThriftHiveMetastore_list_privileges_result::ThriftHiveMetastore_list_privileges_result() noexcept { +} + +uint32_t ThriftHiveMetastore_list_privileges_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2519; + ::apache::thrift::protocol::TType _etype2522; + xfer += iprot->readListBegin(_etype2522, _size2519); + this->success.resize(_size2519); + uint32_t _i2523; + for (_i2523 = 0; _i2523 < _size2519; ++_i2523) + { + xfer += this->success[_i2523].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_list_privileges_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_list_privileges_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2524; + for (_iter2524 = this->success.begin(); _iter2524 != this->success.end(); ++_iter2524) + { + xfer += (*_iter2524).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_list_privileges_presult::~ThriftHiveMetastore_list_privileges_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_list_privileges_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2525; + ::apache::thrift::protocol::TType _etype2528; + xfer += iprot->readListBegin(_etype2528, _size2525); + (*(this->success)).resize(_size2525); + uint32_t _i2529; + for (_i2529 = 0; _i2529 < _size2525; ++_i2529) + { + xfer += (*(this->success))[_i2529].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_grant_privileges_args::~ThriftHiveMetastore_grant_privileges_args() noexcept { +} + +ThriftHiveMetastore_grant_privileges_args::ThriftHiveMetastore_grant_privileges_args() noexcept { +} + +uint32_t ThriftHiveMetastore_grant_privileges_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_privileges_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_privileges_args"); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_privileges_pargs::~ThriftHiveMetastore_grant_privileges_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_privileges_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_privileges_pargs"); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->privileges)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_privileges_result::~ThriftHiveMetastore_grant_privileges_result() noexcept { +} + +ThriftHiveMetastore_grant_privileges_result::ThriftHiveMetastore_grant_privileges_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_grant_privileges_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_privileges_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_privileges_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_privileges_presult::~ThriftHiveMetastore_grant_privileges_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_privileges_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_revoke_privileges_args::~ThriftHiveMetastore_revoke_privileges_args() noexcept { +} + +ThriftHiveMetastore_revoke_privileges_args::ThriftHiveMetastore_revoke_privileges_args() noexcept { +} + +uint32_t ThriftHiveMetastore_revoke_privileges_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_revoke_privileges_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_privileges_args"); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_privileges_pargs::~ThriftHiveMetastore_revoke_privileges_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_revoke_privileges_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_privileges_pargs"); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->privileges)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_privileges_result::~ThriftHiveMetastore_revoke_privileges_result() noexcept { +} + +ThriftHiveMetastore_revoke_privileges_result::ThriftHiveMetastore_revoke_privileges_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_revoke_privileges_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_revoke_privileges_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_revoke_privileges_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_revoke_privileges_presult::~ThriftHiveMetastore_revoke_privileges_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_revoke_privileges_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_privileges_args::~ThriftHiveMetastore_grant_revoke_privileges_args() noexcept { +} + +ThriftHiveMetastore_grant_revoke_privileges_args::ThriftHiveMetastore_grant_revoke_privileges_args() noexcept { +} + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_privileges_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_privileges_pargs::~ThriftHiveMetastore_grant_revoke_privileges_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_privileges_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_privileges_result::~ThriftHiveMetastore_grant_revoke_privileges_result() noexcept { +} + +ThriftHiveMetastore_grant_revoke_privileges_result::ThriftHiveMetastore_grant_revoke_privileges_result() noexcept { +} + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_grant_revoke_privileges_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_grant_revoke_privileges_presult::~ThriftHiveMetastore_grant_revoke_privileges_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_grant_revoke_privileges_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_refresh_privileges_args::~ThriftHiveMetastore_refresh_privileges_args() noexcept { +} + +ThriftHiveMetastore_refresh_privileges_args::ThriftHiveMetastore_refresh_privileges_args() noexcept + : authorizer() { +} + +uint32_t ThriftHiveMetastore_refresh_privileges_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->objToRefresh.read(iprot); + this->__isset.objToRefresh = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->authorizer); + this->__isset.authorizer = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->grantRequest.read(iprot); + this->__isset.grantRequest = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_refresh_privileges_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_refresh_privileges_args"); + + xfer += oprot->writeFieldBegin("objToRefresh", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->objToRefresh.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("authorizer", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->authorizer); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantRequest", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->grantRequest.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_refresh_privileges_pargs::~ThriftHiveMetastore_refresh_privileges_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_refresh_privileges_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_refresh_privileges_pargs"); + + xfer += oprot->writeFieldBegin("objToRefresh", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->objToRefresh)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("authorizer", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->authorizer))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantRequest", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->grantRequest)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_refresh_privileges_result::~ThriftHiveMetastore_refresh_privileges_result() noexcept { +} + +ThriftHiveMetastore_refresh_privileges_result::ThriftHiveMetastore_refresh_privileges_result() noexcept { +} + +uint32_t ThriftHiveMetastore_refresh_privileges_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_refresh_privileges_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_refresh_privileges_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_refresh_privileges_presult::~ThriftHiveMetastore_refresh_privileges_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_refresh_privileges_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_set_ugi_args::~ThriftHiveMetastore_set_ugi_args() noexcept { +} + +ThriftHiveMetastore_set_ugi_args::ThriftHiveMetastore_set_ugi_args() noexcept + : user_name() { +} + +uint32_t ThriftHiveMetastore_set_ugi_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user_name); + this->__isset.user_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->group_names.clear(); + uint32_t _size2530; + ::apache::thrift::protocol::TType _etype2533; + xfer += iprot->readListBegin(_etype2533, _size2530); + this->group_names.resize(_size2530); + uint32_t _i2534; + for (_i2534 = 0; _i2534 < _size2530; ++_i2534) + { + xfer += iprot->readString(this->group_names[_i2534]); + } + xfer += iprot->readListEnd(); + } + this->__isset.group_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_ugi_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_ugi_args"); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->user_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->group_names.size())); + std::vector ::const_iterator _iter2535; + for (_iter2535 = this->group_names.begin(); _iter2535 != this->group_names.end(); ++_iter2535) + { + xfer += oprot->writeString((*_iter2535)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_ugi_pargs::~ThriftHiveMetastore_set_ugi_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_ugi_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_ugi_pargs"); + + xfer += oprot->writeFieldBegin("user_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->user_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("group_names", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*(this->group_names)).size())); + std::vector ::const_iterator _iter2536; + for (_iter2536 = (*(this->group_names)).begin(); _iter2536 != (*(this->group_names)).end(); ++_iter2536) + { + xfer += oprot->writeString((*_iter2536)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_ugi_result::~ThriftHiveMetastore_set_ugi_result() noexcept { +} + +ThriftHiveMetastore_set_ugi_result::ThriftHiveMetastore_set_ugi_result() noexcept { +} + +uint32_t ThriftHiveMetastore_set_ugi_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2537; + ::apache::thrift::protocol::TType _etype2540; + xfer += iprot->readListBegin(_etype2540, _size2537); + this->success.resize(_size2537); + uint32_t _i2541; + for (_i2541 = 0; _i2541 < _size2537; ++_i2541) + { + xfer += iprot->readString(this->success[_i2541]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_ugi_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_ugi_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2542; + for (_iter2542 = this->success.begin(); _iter2542 != this->success.end(); ++_iter2542) + { + xfer += oprot->writeString((*_iter2542)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_ugi_presult::~ThriftHiveMetastore_set_ugi_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_ugi_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2543; + ::apache::thrift::protocol::TType _etype2546; + xfer += iprot->readListBegin(_etype2546, _size2543); + (*(this->success)).resize(_size2543); + uint32_t _i2547; + for (_i2547 = 0; _i2547 < _size2543; ++_i2547) + { + xfer += iprot->readString((*(this->success))[_i2547]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_delegation_token_args::~ThriftHiveMetastore_get_delegation_token_args() noexcept { +} + +ThriftHiveMetastore_get_delegation_token_args::ThriftHiveMetastore_get_delegation_token_args() noexcept + : token_owner(), + renewer_kerberos_principal_name() { +} + +uint32_t ThriftHiveMetastore_get_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_owner); + this->__isset.token_owner = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->renewer_kerberos_principal_name); + this->__isset.renewer_kerberos_principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_args"); + + xfer += oprot->writeFieldBegin("token_owner", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_owner); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->renewer_kerberos_principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_delegation_token_pargs::~ThriftHiveMetastore_get_delegation_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_pargs"); + + xfer += oprot->writeFieldBegin("token_owner", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_owner))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("renewer_kerberos_principal_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->renewer_kerberos_principal_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_delegation_token_result::~ThriftHiveMetastore_get_delegation_token_result() noexcept { +} + +ThriftHiveMetastore_get_delegation_token_result::ThriftHiveMetastore_get_delegation_token_result() noexcept + : success() { +} + +uint32_t ThriftHiveMetastore_get_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_delegation_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_delegation_token_presult::~ThriftHiveMetastore_get_delegation_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_renew_delegation_token_args::~ThriftHiveMetastore_renew_delegation_token_args() noexcept { +} + +ThriftHiveMetastore_renew_delegation_token_args::ThriftHiveMetastore_renew_delegation_token_args() noexcept + : token_str_form() { +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_str_form); + this->__isset.token_str_form = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_args"); + + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_str_form); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_renew_delegation_token_pargs::~ThriftHiveMetastore_renew_delegation_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_renew_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_pargs"); + + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_str_form))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_renew_delegation_token_result::~ThriftHiveMetastore_renew_delegation_token_result() noexcept { +} + +ThriftHiveMetastore_renew_delegation_token_result::ThriftHiveMetastore_renew_delegation_token_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_renew_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_renew_delegation_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_renew_delegation_token_presult::~ThriftHiveMetastore_renew_delegation_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_renew_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_cancel_delegation_token_args::~ThriftHiveMetastore_cancel_delegation_token_args() noexcept { +} + +ThriftHiveMetastore_cancel_delegation_token_args::ThriftHiveMetastore_cancel_delegation_token_args() noexcept + : token_str_form() { +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_str_form); + this->__isset.token_str_form = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_args"); + + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_str_form); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cancel_delegation_token_pargs::~ThriftHiveMetastore_cancel_delegation_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_cancel_delegation_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_pargs"); + + xfer += oprot->writeFieldBegin("token_str_form", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_str_form))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cancel_delegation_token_result::~ThriftHiveMetastore_cancel_delegation_token_result() noexcept { +} + +ThriftHiveMetastore_cancel_delegation_token_result::ThriftHiveMetastore_cancel_delegation_token_result() noexcept { +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cancel_delegation_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cancel_delegation_token_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cancel_delegation_token_presult::~ThriftHiveMetastore_cancel_delegation_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_cancel_delegation_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_token_args::~ThriftHiveMetastore_add_token_args() noexcept { +} + +ThriftHiveMetastore_add_token_args::ThriftHiveMetastore_add_token_args() noexcept + : token_identifier(), + delegation_token() { +} + +uint32_t ThriftHiveMetastore_add_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_identifier); + this->__isset.token_identifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->delegation_token); + this->__isset.delegation_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_token_args"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_identifier); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("delegation_token", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->delegation_token); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_token_pargs::~ThriftHiveMetastore_add_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_token_pargs"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_identifier))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("delegation_token", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->delegation_token))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_token_result::~ThriftHiveMetastore_add_token_result() noexcept { +} + +ThriftHiveMetastore_add_token_result::ThriftHiveMetastore_add_token_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_add_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_token_presult::~ThriftHiveMetastore_add_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_remove_token_args::~ThriftHiveMetastore_remove_token_args() noexcept { +} + +ThriftHiveMetastore_remove_token_args::ThriftHiveMetastore_remove_token_args() noexcept + : token_identifier() { +} + +uint32_t ThriftHiveMetastore_remove_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_identifier); + this->__isset.token_identifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_token_args"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_identifier); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_token_pargs::~ThriftHiveMetastore_remove_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_token_pargs"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_identifier))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_token_result::~ThriftHiveMetastore_remove_token_result() noexcept { +} + +ThriftHiveMetastore_remove_token_result::ThriftHiveMetastore_remove_token_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_remove_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_token_presult::~ThriftHiveMetastore_remove_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_token_args::~ThriftHiveMetastore_get_token_args() noexcept { +} + +ThriftHiveMetastore_get_token_args::ThriftHiveMetastore_get_token_args() noexcept + : token_identifier() { +} + +uint32_t ThriftHiveMetastore_get_token_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->token_identifier); + this->__isset.token_identifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_token_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_token_args"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->token_identifier); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_token_pargs::~ThriftHiveMetastore_get_token_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_token_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_token_pargs"); + + xfer += oprot->writeFieldBegin("token_identifier", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->token_identifier))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_token_result::~ThriftHiveMetastore_get_token_result() noexcept { +} + +ThriftHiveMetastore_get_token_result::ThriftHiveMetastore_get_token_result() noexcept + : success() { +} + +uint32_t ThriftHiveMetastore_get_token_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_token_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_token_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_token_presult::~ThriftHiveMetastore_get_token_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_token_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_token_identifiers_args::~ThriftHiveMetastore_get_all_token_identifiers_args() noexcept { +} + +ThriftHiveMetastore_get_all_token_identifiers_args::ThriftHiveMetastore_get_all_token_identifiers_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_token_identifiers_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_token_identifiers_pargs::~ThriftHiveMetastore_get_all_token_identifiers_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_token_identifiers_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_token_identifiers_result::~ThriftHiveMetastore_get_all_token_identifiers_result() noexcept { +} + +ThriftHiveMetastore_get_all_token_identifiers_result::ThriftHiveMetastore_get_all_token_identifiers_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2548; + ::apache::thrift::protocol::TType _etype2551; + xfer += iprot->readListBegin(_etype2551, _size2548); + this->success.resize(_size2548); + uint32_t _i2552; + for (_i2552 = 0; _i2552 < _size2548; ++_i2552) + { + xfer += iprot->readString(this->success[_i2552]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_token_identifiers_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2553; + for (_iter2553 = this->success.begin(); _iter2553 != this->success.end(); ++_iter2553) + { + xfer += oprot->writeString((*_iter2553)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_token_identifiers_presult::~ThriftHiveMetastore_get_all_token_identifiers_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_token_identifiers_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2554; + ::apache::thrift::protocol::TType _etype2557; + xfer += iprot->readListBegin(_etype2557, _size2554); + (*(this->success)).resize(_size2554); + uint32_t _i2558; + for (_i2558 = 0; _i2558 < _size2554; ++_i2558) + { + xfer += iprot->readString((*(this->success))[_i2558]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_master_key_args::~ThriftHiveMetastore_add_master_key_args() noexcept { +} + +ThriftHiveMetastore_add_master_key_args::ThriftHiveMetastore_add_master_key_args() noexcept + : key() { +} + +uint32_t ThriftHiveMetastore_add_master_key_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_master_key_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_master_key_args"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_master_key_pargs::~ThriftHiveMetastore_add_master_key_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_master_key_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_master_key_pargs"); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_master_key_result::~ThriftHiveMetastore_add_master_key_result() noexcept { +} + +ThriftHiveMetastore_add_master_key_result::ThriftHiveMetastore_add_master_key_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_add_master_key_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_master_key_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_master_key_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_master_key_presult::~ThriftHiveMetastore_add_master_key_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_master_key_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_master_key_args::~ThriftHiveMetastore_update_master_key_args() noexcept { +} + +ThriftHiveMetastore_update_master_key_args::ThriftHiveMetastore_update_master_key_args() noexcept + : seq_number(0), + key() { +} + +uint32_t ThriftHiveMetastore_update_master_key_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->seq_number); + this->__isset.seq_number = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + this->__isset.key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_master_key_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_master_key_args"); + + xfer += oprot->writeFieldBegin("seq_number", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->seq_number); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_master_key_pargs::~ThriftHiveMetastore_update_master_key_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_master_key_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_master_key_pargs"); + + xfer += oprot->writeFieldBegin("seq_number", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->seq_number))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->key))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_master_key_result::~ThriftHiveMetastore_update_master_key_result() noexcept { +} + +ThriftHiveMetastore_update_master_key_result::ThriftHiveMetastore_update_master_key_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_master_key_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_master_key_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_master_key_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_master_key_presult::~ThriftHiveMetastore_update_master_key_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_master_key_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_remove_master_key_args::~ThriftHiveMetastore_remove_master_key_args() noexcept { +} + +ThriftHiveMetastore_remove_master_key_args::ThriftHiveMetastore_remove_master_key_args() noexcept + : key_seq(0) { +} + +uint32_t ThriftHiveMetastore_remove_master_key_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->key_seq); + this->__isset.key_seq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_master_key_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_master_key_args"); + + xfer += oprot->writeFieldBegin("key_seq", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->key_seq); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_master_key_pargs::~ThriftHiveMetastore_remove_master_key_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_master_key_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_master_key_pargs"); + + xfer += oprot->writeFieldBegin("key_seq", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->key_seq))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_master_key_result::~ThriftHiveMetastore_remove_master_key_result() noexcept { +} + +ThriftHiveMetastore_remove_master_key_result::ThriftHiveMetastore_remove_master_key_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_remove_master_key_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_master_key_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_master_key_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_master_key_presult::~ThriftHiveMetastore_remove_master_key_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_master_key_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_master_keys_args::~ThriftHiveMetastore_get_master_keys_args() noexcept { +} + +ThriftHiveMetastore_get_master_keys_args::ThriftHiveMetastore_get_master_keys_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_master_keys_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_master_keys_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_master_keys_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_master_keys_pargs::~ThriftHiveMetastore_get_master_keys_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_master_keys_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_master_keys_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_master_keys_result::~ThriftHiveMetastore_get_master_keys_result() noexcept { +} + +ThriftHiveMetastore_get_master_keys_result::ThriftHiveMetastore_get_master_keys_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_master_keys_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2559; + ::apache::thrift::protocol::TType _etype2562; + xfer += iprot->readListBegin(_etype2562, _size2559); + this->success.resize(_size2559); + uint32_t _i2563; + for (_i2563 = 0; _i2563 < _size2559; ++_i2563) + { + xfer += iprot->readString(this->success[_i2563]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_master_keys_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_master_keys_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2564; + for (_iter2564 = this->success.begin(); _iter2564 != this->success.end(); ++_iter2564) + { + xfer += oprot->writeString((*_iter2564)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_master_keys_presult::~ThriftHiveMetastore_get_master_keys_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_master_keys_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2565; + ::apache::thrift::protocol::TType _etype2568; + xfer += iprot->readListBegin(_etype2568, _size2565); + (*(this->success)).resize(_size2565); + uint32_t _i2569; + for (_i2569 = 0; _i2569 < _size2565; ++_i2569) + { + xfer += iprot->readString((*(this->success))[_i2569]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_args::~ThriftHiveMetastore_get_open_txns_args() noexcept { +} + +ThriftHiveMetastore_get_open_txns_args::ThriftHiveMetastore_get_open_txns_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_pargs::~ThriftHiveMetastore_get_open_txns_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_result::~ThriftHiveMetastore_get_open_txns_result() noexcept { +} + +ThriftHiveMetastore_get_open_txns_result::ThriftHiveMetastore_get_open_txns_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_presult::~ThriftHiveMetastore_get_open_txns_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_info_args::~ThriftHiveMetastore_get_open_txns_info_args() noexcept { +} + +ThriftHiveMetastore_get_open_txns_info_args::ThriftHiveMetastore_get_open_txns_info_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_info_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_info_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_info_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_info_pargs::~ThriftHiveMetastore_get_open_txns_info_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_info_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_info_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_info_result::~ThriftHiveMetastore_get_open_txns_info_result() noexcept { +} + +ThriftHiveMetastore_get_open_txns_info_result::ThriftHiveMetastore_get_open_txns_info_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_info_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_info_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_info_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_info_presult::~ThriftHiveMetastore_get_open_txns_info_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_info_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_open_txns_args::~ThriftHiveMetastore_open_txns_args() noexcept { +} + +ThriftHiveMetastore_open_txns_args::ThriftHiveMetastore_open_txns_args() noexcept { +} + +uint32_t ThriftHiveMetastore_open_txns_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_open_txns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_open_txns_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_open_txns_pargs::~ThriftHiveMetastore_open_txns_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_open_txns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_open_txns_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_open_txns_result::~ThriftHiveMetastore_open_txns_result() noexcept { +} + +ThriftHiveMetastore_open_txns_result::ThriftHiveMetastore_open_txns_result() noexcept { +} + +uint32_t ThriftHiveMetastore_open_txns_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_open_txns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_open_txns_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_open_txns_presult::~ThriftHiveMetastore_open_txns_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_open_txns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_abort_txn_args::~ThriftHiveMetastore_abort_txn_args() noexcept { +} + +ThriftHiveMetastore_abort_txn_args::ThriftHiveMetastore_abort_txn_args() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_txn_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_txn_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txn_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txn_pargs::~ThriftHiveMetastore_abort_txn_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_txn_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txn_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txn_result::~ThriftHiveMetastore_abort_txn_result() noexcept { +} + +ThriftHiveMetastore_abort_txn_result::ThriftHiveMetastore_abort_txn_result() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_txn_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_txn_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txn_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txn_presult::~ThriftHiveMetastore_abort_txn_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_txn_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_abort_txns_args::~ThriftHiveMetastore_abort_txns_args() noexcept { +} + +ThriftHiveMetastore_abort_txns_args::ThriftHiveMetastore_abort_txns_args() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_txns_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_txns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txns_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txns_pargs::~ThriftHiveMetastore_abort_txns_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_txns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txns_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txns_result::~ThriftHiveMetastore_abort_txns_result() noexcept { +} + +ThriftHiveMetastore_abort_txns_result::ThriftHiveMetastore_abort_txns_result() noexcept { +} + +uint32_t ThriftHiveMetastore_abort_txns_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_abort_txns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_abort_txns_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_abort_txns_presult::~ThriftHiveMetastore_abort_txns_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_abort_txns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_commit_txn_args::~ThriftHiveMetastore_commit_txn_args() noexcept { +} + +ThriftHiveMetastore_commit_txn_args::ThriftHiveMetastore_commit_txn_args() noexcept { +} + +uint32_t ThriftHiveMetastore_commit_txn_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_commit_txn_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_commit_txn_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_commit_txn_pargs::~ThriftHiveMetastore_commit_txn_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_commit_txn_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_commit_txn_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_commit_txn_result::~ThriftHiveMetastore_commit_txn_result() noexcept { +} + +ThriftHiveMetastore_commit_txn_result::ThriftHiveMetastore_commit_txn_result() noexcept { +} + +uint32_t ThriftHiveMetastore_commit_txn_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_commit_txn_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_commit_txn_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_commit_txn_presult::~ThriftHiveMetastore_commit_txn_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_commit_txn_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_latest_txnid_in_conflict_args::~ThriftHiveMetastore_get_latest_txnid_in_conflict_args() noexcept { +} + +ThriftHiveMetastore_get_latest_txnid_in_conflict_args::ThriftHiveMetastore_get_latest_txnid_in_conflict_args() noexcept + : txnId(0) { +} + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_txnid_in_conflict_args"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs::~ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64((*(this->txnId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_txnid_in_conflict_result::~ThriftHiveMetastore_get_latest_txnid_in_conflict_result() noexcept { +} + +ThriftHiveMetastore_get_latest_txnid_in_conflict_result::ThriftHiveMetastore_get_latest_txnid_in_conflict_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_txnid_in_conflict_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I64, 0); + xfer += oprot->writeI64(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_txnid_in_conflict_presult::~ThriftHiveMetastore_get_latest_txnid_in_conflict_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_latest_txnid_in_conflict_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_repl_tbl_writeid_state_args::~ThriftHiveMetastore_repl_tbl_writeid_state_args() noexcept { +} + +ThriftHiveMetastore_repl_tbl_writeid_state_args::ThriftHiveMetastore_repl_tbl_writeid_state_args() noexcept { +} + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_repl_tbl_writeid_state_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_repl_tbl_writeid_state_pargs::~ThriftHiveMetastore_repl_tbl_writeid_state_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_repl_tbl_writeid_state_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_repl_tbl_writeid_state_result::~ThriftHiveMetastore_repl_tbl_writeid_state_result() noexcept { +} + +ThriftHiveMetastore_repl_tbl_writeid_state_result::ThriftHiveMetastore_repl_tbl_writeid_state_result() noexcept { +} + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_repl_tbl_writeid_state_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_repl_tbl_writeid_state_presult::~ThriftHiveMetastore_repl_tbl_writeid_state_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_repl_tbl_writeid_state_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_valid_write_ids_args::~ThriftHiveMetastore_get_valid_write_ids_args() noexcept { +} + +ThriftHiveMetastore_get_valid_write_ids_args::ThriftHiveMetastore_get_valid_write_ids_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_valid_write_ids_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_valid_write_ids_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_valid_write_ids_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_valid_write_ids_pargs::~ThriftHiveMetastore_get_valid_write_ids_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_valid_write_ids_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_valid_write_ids_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_valid_write_ids_result::~ThriftHiveMetastore_get_valid_write_ids_result() noexcept { +} + +ThriftHiveMetastore_get_valid_write_ids_result::ThriftHiveMetastore_get_valid_write_ids_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_valid_write_ids_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_valid_write_ids_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_valid_write_ids_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_valid_write_ids_presult::~ThriftHiveMetastore_get_valid_write_ids_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_valid_write_ids_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_write_ids_to_min_history_args::~ThriftHiveMetastore_add_write_ids_to_min_history_args() noexcept { +} + +ThriftHiveMetastore_add_write_ids_to_min_history_args::ThriftHiveMetastore_add_write_ids_to_min_history_args() noexcept + : txnId(0) { +} + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->writeIds.clear(); + uint32_t _size2570; + ::apache::thrift::protocol::TType _ktype2571; + ::apache::thrift::protocol::TType _vtype2572; + xfer += iprot->readMapBegin(_ktype2571, _vtype2572, _size2570); + uint32_t _i2574; + for (_i2574 = 0; _i2574 < _size2570; ++_i2574) + { + std::string _key2575; + xfer += iprot->readString(_key2575); + int64_t& _val2576 = this->writeIds[_key2575]; + xfer += iprot->readI64(_val2576); + } + xfer += iprot->readMapEnd(); + } + this->__isset.writeIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_ids_to_min_history_args"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeIds", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast(this->writeIds.size())); + std::map ::const_iterator _iter2577; + for (_iter2577 = this->writeIds.begin(); _iter2577 != this->writeIds.end(); ++_iter2577) + { + xfer += oprot->writeString(_iter2577->first); + xfer += oprot->writeI64(_iter2577->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_ids_to_min_history_pargs::~ThriftHiveMetastore_add_write_ids_to_min_history_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_ids_to_min_history_pargs"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64((*(this->txnId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeIds", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast((*(this->writeIds)).size())); + std::map ::const_iterator _iter2578; + for (_iter2578 = (*(this->writeIds)).begin(); _iter2578 != (*(this->writeIds)).end(); ++_iter2578) + { + xfer += oprot->writeString(_iter2578->first); + xfer += oprot->writeI64(_iter2578->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_ids_to_min_history_result::~ThriftHiveMetastore_add_write_ids_to_min_history_result() noexcept { +} + +ThriftHiveMetastore_add_write_ids_to_min_history_result::ThriftHiveMetastore_add_write_ids_to_min_history_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_ids_to_min_history_result"); + + if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_ids_to_min_history_presult::~ThriftHiveMetastore_add_write_ids_to_min_history_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_ids_to_min_history_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_allocate_table_write_ids_args::~ThriftHiveMetastore_allocate_table_write_ids_args() noexcept { +} + +ThriftHiveMetastore_allocate_table_write_ids_args::ThriftHiveMetastore_allocate_table_write_ids_args() noexcept { +} + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_allocate_table_write_ids_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_allocate_table_write_ids_pargs::~ThriftHiveMetastore_allocate_table_write_ids_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_allocate_table_write_ids_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_allocate_table_write_ids_result::~ThriftHiveMetastore_allocate_table_write_ids_result() noexcept { +} + +ThriftHiveMetastore_allocate_table_write_ids_result::ThriftHiveMetastore_allocate_table_write_ids_result() noexcept { +} + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_allocate_table_write_ids_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_allocate_table_write_ids_presult::~ThriftHiveMetastore_allocate_table_write_ids_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_allocate_table_write_ids_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_max_allocated_table_write_id_args::~ThriftHiveMetastore_get_max_allocated_table_write_id_args() noexcept { +} + +ThriftHiveMetastore_get_max_allocated_table_write_id_args::ThriftHiveMetastore_get_max_allocated_table_write_id_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_max_allocated_table_write_id_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_max_allocated_table_write_id_pargs::~ThriftHiveMetastore_get_max_allocated_table_write_id_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_max_allocated_table_write_id_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_max_allocated_table_write_id_result::~ThriftHiveMetastore_get_max_allocated_table_write_id_result() noexcept { +} + +ThriftHiveMetastore_get_max_allocated_table_write_id_result::ThriftHiveMetastore_get_max_allocated_table_write_id_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_max_allocated_table_write_id_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_max_allocated_table_write_id_presult::~ThriftHiveMetastore_get_max_allocated_table_write_id_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_max_allocated_table_write_id_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_seed_write_id_args::~ThriftHiveMetastore_seed_write_id_args() noexcept { +} + +ThriftHiveMetastore_seed_write_id_args::ThriftHiveMetastore_seed_write_id_args() noexcept { +} + +uint32_t ThriftHiveMetastore_seed_write_id_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_seed_write_id_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_write_id_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_write_id_pargs::~ThriftHiveMetastore_seed_write_id_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_seed_write_id_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_write_id_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_write_id_result::~ThriftHiveMetastore_seed_write_id_result() noexcept { +} + +ThriftHiveMetastore_seed_write_id_result::ThriftHiveMetastore_seed_write_id_result() noexcept { +} + +uint32_t ThriftHiveMetastore_seed_write_id_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_seed_write_id_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_write_id_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_write_id_presult::~ThriftHiveMetastore_seed_write_id_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_seed_write_id_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_seed_txn_id_args::~ThriftHiveMetastore_seed_txn_id_args() noexcept { +} + +ThriftHiveMetastore_seed_txn_id_args::ThriftHiveMetastore_seed_txn_id_args() noexcept { +} + +uint32_t ThriftHiveMetastore_seed_txn_id_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_seed_txn_id_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_txn_id_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_txn_id_pargs::~ThriftHiveMetastore_seed_txn_id_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_seed_txn_id_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_txn_id_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_txn_id_result::~ThriftHiveMetastore_seed_txn_id_result() noexcept { +} + +ThriftHiveMetastore_seed_txn_id_result::ThriftHiveMetastore_seed_txn_id_result() noexcept { +} + +uint32_t ThriftHiveMetastore_seed_txn_id_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_seed_txn_id_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_seed_txn_id_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_seed_txn_id_presult::~ThriftHiveMetastore_seed_txn_id_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_seed_txn_id_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_lock_args::~ThriftHiveMetastore_lock_args() noexcept { +} + +ThriftHiveMetastore_lock_args::ThriftHiveMetastore_lock_args() noexcept { +} + +uint32_t ThriftHiveMetastore_lock_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_lock_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_lock_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_lock_pargs::~ThriftHiveMetastore_lock_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_lock_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_lock_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_lock_result::~ThriftHiveMetastore_lock_result() noexcept { +} + +ThriftHiveMetastore_lock_result::ThriftHiveMetastore_lock_result() noexcept { +} + +uint32_t ThriftHiveMetastore_lock_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_lock_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_lock_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_lock_presult::~ThriftHiveMetastore_lock_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_lock_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_check_lock_args::~ThriftHiveMetastore_check_lock_args() noexcept { +} + +ThriftHiveMetastore_check_lock_args::ThriftHiveMetastore_check_lock_args() noexcept { +} + +uint32_t ThriftHiveMetastore_check_lock_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_check_lock_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_check_lock_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_check_lock_pargs::~ThriftHiveMetastore_check_lock_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_check_lock_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_check_lock_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_check_lock_result::~ThriftHiveMetastore_check_lock_result() noexcept { +} + +ThriftHiveMetastore_check_lock_result::ThriftHiveMetastore_check_lock_result() noexcept { +} + +uint32_t ThriftHiveMetastore_check_lock_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_check_lock_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_check_lock_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_check_lock_presult::~ThriftHiveMetastore_check_lock_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_check_lock_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_unlock_args::~ThriftHiveMetastore_unlock_args() noexcept { +} + +ThriftHiveMetastore_unlock_args::ThriftHiveMetastore_unlock_args() noexcept { +} + +uint32_t ThriftHiveMetastore_unlock_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_unlock_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_unlock_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_unlock_pargs::~ThriftHiveMetastore_unlock_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_unlock_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_unlock_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_unlock_result::~ThriftHiveMetastore_unlock_result() noexcept { +} + +ThriftHiveMetastore_unlock_result::ThriftHiveMetastore_unlock_result() noexcept { +} + +uint32_t ThriftHiveMetastore_unlock_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_unlock_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_unlock_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_unlock_presult::~ThriftHiveMetastore_unlock_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_unlock_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_show_locks_args::~ThriftHiveMetastore_show_locks_args() noexcept { +} + +ThriftHiveMetastore_show_locks_args::ThriftHiveMetastore_show_locks_args() noexcept { +} + +uint32_t ThriftHiveMetastore_show_locks_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_show_locks_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_locks_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_locks_pargs::~ThriftHiveMetastore_show_locks_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_show_locks_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_locks_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_locks_result::~ThriftHiveMetastore_show_locks_result() noexcept { +} + +ThriftHiveMetastore_show_locks_result::ThriftHiveMetastore_show_locks_result() noexcept { +} + +uint32_t ThriftHiveMetastore_show_locks_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_show_locks_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_locks_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_locks_presult::~ThriftHiveMetastore_show_locks_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_show_locks_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_heartbeat_args::~ThriftHiveMetastore_heartbeat_args() noexcept { +} + +ThriftHiveMetastore_heartbeat_args::ThriftHiveMetastore_heartbeat_args() noexcept { +} + +uint32_t ThriftHiveMetastore_heartbeat_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ids.read(iprot); + this->__isset.ids = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_args"); + + xfer += oprot->writeFieldBegin("ids", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ids.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_pargs::~ThriftHiveMetastore_heartbeat_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_pargs"); + + xfer += oprot->writeFieldBegin("ids", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->ids)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_result::~ThriftHiveMetastore_heartbeat_result() noexcept { +} + +ThriftHiveMetastore_heartbeat_result::ThriftHiveMetastore_heartbeat_result() noexcept { +} + +uint32_t ThriftHiveMetastore_heartbeat_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_presult::~ThriftHiveMetastore_heartbeat_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_heartbeat_txn_range_args::~ThriftHiveMetastore_heartbeat_txn_range_args() noexcept { +} + +ThriftHiveMetastore_heartbeat_txn_range_args::ThriftHiveMetastore_heartbeat_txn_range_args() noexcept { +} + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->txns.read(iprot); + this->__isset.txns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_txn_range_args"); + + xfer += oprot->writeFieldBegin("txns", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->txns.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_txn_range_pargs::~ThriftHiveMetastore_heartbeat_txn_range_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_txn_range_pargs"); + + xfer += oprot->writeFieldBegin("txns", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->txns)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_txn_range_result::~ThriftHiveMetastore_heartbeat_txn_range_result() noexcept { +} + +ThriftHiveMetastore_heartbeat_txn_range_result::ThriftHiveMetastore_heartbeat_txn_range_result() noexcept { +} + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_txn_range_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_txn_range_presult::~ThriftHiveMetastore_heartbeat_txn_range_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_txn_range_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_compact_args::~ThriftHiveMetastore_compact_args() noexcept { +} + +ThriftHiveMetastore_compact_args::ThriftHiveMetastore_compact_args() noexcept { +} + +uint32_t ThriftHiveMetastore_compact_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_compact_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact_pargs::~ThriftHiveMetastore_compact_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_compact_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact_result::~ThriftHiveMetastore_compact_result() noexcept { +} + +ThriftHiveMetastore_compact_result::ThriftHiveMetastore_compact_result() noexcept { +} + +uint32_t ThriftHiveMetastore_compact_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_compact_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact_presult::~ThriftHiveMetastore_compact_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_compact_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_compact2_args::~ThriftHiveMetastore_compact2_args() noexcept { +} + +ThriftHiveMetastore_compact2_args::ThriftHiveMetastore_compact2_args() noexcept { +} + +uint32_t ThriftHiveMetastore_compact2_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_compact2_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact2_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact2_pargs::~ThriftHiveMetastore_compact2_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_compact2_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact2_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact2_result::~ThriftHiveMetastore_compact2_result() noexcept { +} + +ThriftHiveMetastore_compact2_result::ThriftHiveMetastore_compact2_result() noexcept { +} + +uint32_t ThriftHiveMetastore_compact2_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_compact2_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_compact2_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_compact2_presult::~ThriftHiveMetastore_compact2_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_compact2_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_show_compact_args::~ThriftHiveMetastore_show_compact_args() noexcept { +} + +ThriftHiveMetastore_show_compact_args::ThriftHiveMetastore_show_compact_args() noexcept { +} + +uint32_t ThriftHiveMetastore_show_compact_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_show_compact_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_compact_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_compact_pargs::~ThriftHiveMetastore_show_compact_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_show_compact_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_compact_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_compact_result::~ThriftHiveMetastore_show_compact_result() noexcept { +} + +ThriftHiveMetastore_show_compact_result::ThriftHiveMetastore_show_compact_result() noexcept { +} + +uint32_t ThriftHiveMetastore_show_compact_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_show_compact_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_show_compact_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_show_compact_presult::~ThriftHiveMetastore_show_compact_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_show_compact_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_submit_for_cleanup_args::~ThriftHiveMetastore_submit_for_cleanup_args() noexcept { +} + +ThriftHiveMetastore_submit_for_cleanup_args::ThriftHiveMetastore_submit_for_cleanup_args() noexcept + : o2(0), + o3(0) { +} + +uint32_t ThriftHiveMetastore_submit_for_cleanup_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->o2); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->o3); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_submit_for_cleanup_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_submit_for_cleanup_args"); + + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->o2); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->o3); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_submit_for_cleanup_pargs::~ThriftHiveMetastore_submit_for_cleanup_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_submit_for_cleanup_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_submit_for_cleanup_pargs"); + + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->o1)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64((*(this->o2))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64((*(this->o3))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_submit_for_cleanup_result::~ThriftHiveMetastore_submit_for_cleanup_result() noexcept { +} + +ThriftHiveMetastore_submit_for_cleanup_result::ThriftHiveMetastore_submit_for_cleanup_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_submit_for_cleanup_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_submit_for_cleanup_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_submit_for_cleanup_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_submit_for_cleanup_presult::~ThriftHiveMetastore_submit_for_cleanup_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_submit_for_cleanup_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_dynamic_partitions_args::~ThriftHiveMetastore_add_dynamic_partitions_args() noexcept { +} + +ThriftHiveMetastore_add_dynamic_partitions_args::ThriftHiveMetastore_add_dynamic_partitions_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_dynamic_partitions_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_dynamic_partitions_pargs::~ThriftHiveMetastore_add_dynamic_partitions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_dynamic_partitions_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_dynamic_partitions_result::~ThriftHiveMetastore_add_dynamic_partitions_result() noexcept { +} + +ThriftHiveMetastore_add_dynamic_partitions_result::ThriftHiveMetastore_add_dynamic_partitions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_dynamic_partitions_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_dynamic_partitions_presult::~ThriftHiveMetastore_add_dynamic_partitions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_dynamic_partitions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_find_next_compact_args::~ThriftHiveMetastore_find_next_compact_args() noexcept { +} + +ThriftHiveMetastore_find_next_compact_args::ThriftHiveMetastore_find_next_compact_args() noexcept + : workerId() { +} + +uint32_t ThriftHiveMetastore_find_next_compact_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerId); + this->__isset.workerId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_next_compact_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact_args"); + + xfer += oprot->writeFieldBegin("workerId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->workerId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact_pargs::~ThriftHiveMetastore_find_next_compact_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_next_compact_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact_pargs"); + + xfer += oprot->writeFieldBegin("workerId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->workerId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact_result::~ThriftHiveMetastore_find_next_compact_result() noexcept { +} + +ThriftHiveMetastore_find_next_compact_result::ThriftHiveMetastore_find_next_compact_result() noexcept { +} + +uint32_t ThriftHiveMetastore_find_next_compact_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_next_compact_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact_presult::~ThriftHiveMetastore_find_next_compact_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_next_compact_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_find_next_compact2_args::~ThriftHiveMetastore_find_next_compact2_args() noexcept { +} + +ThriftHiveMetastore_find_next_compact2_args::ThriftHiveMetastore_find_next_compact2_args() noexcept { +} + +uint32_t ThriftHiveMetastore_find_next_compact2_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_next_compact2_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact2_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact2_pargs::~ThriftHiveMetastore_find_next_compact2_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_next_compact2_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact2_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact2_result::~ThriftHiveMetastore_find_next_compact2_result() noexcept { +} + +ThriftHiveMetastore_find_next_compact2_result::ThriftHiveMetastore_find_next_compact2_result() noexcept { +} + +uint32_t ThriftHiveMetastore_find_next_compact2_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_next_compact2_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_next_compact2_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_next_compact2_presult::~ThriftHiveMetastore_find_next_compact2_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_next_compact2_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_compactor_state_args::~ThriftHiveMetastore_update_compactor_state_args() noexcept { +} + +ThriftHiveMetastore_update_compactor_state_args::ThriftHiveMetastore_update_compactor_state_args() noexcept + : txn_id(0) { +} + +uint32_t ThriftHiveMetastore_update_compactor_state_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txn_id); + this->__isset.txn_id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_compactor_state_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compactor_state_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txn_id", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->txn_id); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compactor_state_pargs::~ThriftHiveMetastore_update_compactor_state_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_compactor_state_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compactor_state_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txn_id", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64((*(this->txn_id))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compactor_state_result::~ThriftHiveMetastore_update_compactor_state_result() noexcept { +} + +ThriftHiveMetastore_update_compactor_state_result::ThriftHiveMetastore_update_compactor_state_result() noexcept { +} + +uint32_t ThriftHiveMetastore_update_compactor_state_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_compactor_state_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compactor_state_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compactor_state_presult::~ThriftHiveMetastore_update_compactor_state_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_compactor_state_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_find_columns_with_stats_args::~ThriftHiveMetastore_find_columns_with_stats_args() noexcept { +} + +ThriftHiveMetastore_find_columns_with_stats_args::ThriftHiveMetastore_find_columns_with_stats_args() noexcept { +} + +uint32_t ThriftHiveMetastore_find_columns_with_stats_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_columns_with_stats_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_columns_with_stats_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_columns_with_stats_pargs::~ThriftHiveMetastore_find_columns_with_stats_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_columns_with_stats_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_columns_with_stats_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_columns_with_stats_result::~ThriftHiveMetastore_find_columns_with_stats_result() noexcept { +} + +ThriftHiveMetastore_find_columns_with_stats_result::ThriftHiveMetastore_find_columns_with_stats_result() noexcept { +} + +uint32_t ThriftHiveMetastore_find_columns_with_stats_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2579; + ::apache::thrift::protocol::TType _etype2582; + xfer += iprot->readListBegin(_etype2582, _size2579); + this->success.resize(_size2579); + uint32_t _i2583; + for (_i2583 = 0; _i2583 < _size2579; ++_i2583) + { + xfer += iprot->readString(this->success[_i2583]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_columns_with_stats_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_columns_with_stats_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2584; + for (_iter2584 = this->success.begin(); _iter2584 != this->success.end(); ++_iter2584) + { + xfer += oprot->writeString((*_iter2584)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_columns_with_stats_presult::~ThriftHiveMetastore_find_columns_with_stats_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_columns_with_stats_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2585; + ::apache::thrift::protocol::TType _etype2588; + xfer += iprot->readListBegin(_etype2588, _size2585); + (*(this->success)).resize(_size2585); + uint32_t _i2589; + for (_i2589 = 0; _i2589 < _size2585; ++_i2589) + { + xfer += iprot->readString((*(this->success))[_i2589]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_mark_cleaned_args::~ThriftHiveMetastore_mark_cleaned_args() noexcept { +} + +ThriftHiveMetastore_mark_cleaned_args::ThriftHiveMetastore_mark_cleaned_args() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_cleaned_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_cleaned_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_cleaned_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_cleaned_pargs::~ThriftHiveMetastore_mark_cleaned_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_cleaned_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_cleaned_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_cleaned_result::~ThriftHiveMetastore_mark_cleaned_result() noexcept { +} + +ThriftHiveMetastore_mark_cleaned_result::ThriftHiveMetastore_mark_cleaned_result() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_cleaned_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_cleaned_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_cleaned_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_cleaned_presult::~ThriftHiveMetastore_mark_cleaned_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_cleaned_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_mark_compacted_args::~ThriftHiveMetastore_mark_compacted_args() noexcept { +} + +ThriftHiveMetastore_mark_compacted_args::ThriftHiveMetastore_mark_compacted_args() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_compacted_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_compacted_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_compacted_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_compacted_pargs::~ThriftHiveMetastore_mark_compacted_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_compacted_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_compacted_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_compacted_result::~ThriftHiveMetastore_mark_compacted_result() noexcept { +} + +ThriftHiveMetastore_mark_compacted_result::ThriftHiveMetastore_mark_compacted_result() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_compacted_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_compacted_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_compacted_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_compacted_presult::~ThriftHiveMetastore_mark_compacted_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_compacted_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_mark_failed_args::~ThriftHiveMetastore_mark_failed_args() noexcept { +} + +ThriftHiveMetastore_mark_failed_args::ThriftHiveMetastore_mark_failed_args() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_failed_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_failed_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_failed_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_failed_pargs::~ThriftHiveMetastore_mark_failed_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_failed_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_failed_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_failed_result::~ThriftHiveMetastore_mark_failed_result() noexcept { +} + +ThriftHiveMetastore_mark_failed_result::ThriftHiveMetastore_mark_failed_result() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_failed_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_failed_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_failed_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_failed_presult::~ThriftHiveMetastore_mark_failed_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_failed_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_mark_refused_args::~ThriftHiveMetastore_mark_refused_args() noexcept { +} + +ThriftHiveMetastore_mark_refused_args::ThriftHiveMetastore_mark_refused_args() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_refused_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cr.read(iprot); + this->__isset.cr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_refused_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_refused_args"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cr.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_refused_pargs::~ThriftHiveMetastore_mark_refused_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_refused_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_refused_pargs"); + + xfer += oprot->writeFieldBegin("cr", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cr)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_refused_result::~ThriftHiveMetastore_mark_refused_result() noexcept { +} + +ThriftHiveMetastore_mark_refused_result::ThriftHiveMetastore_mark_refused_result() noexcept { +} + +uint32_t ThriftHiveMetastore_mark_refused_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_mark_refused_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_mark_refused_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_mark_refused_presult::~ThriftHiveMetastore_mark_refused_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_mark_refused_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_update_compaction_metrics_data_args::~ThriftHiveMetastore_update_compaction_metrics_data_args() noexcept { +} + +ThriftHiveMetastore_update_compaction_metrics_data_args::ThriftHiveMetastore_update_compaction_metrics_data_args() noexcept { +} + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->data.read(iprot); + this->__isset.data = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compaction_metrics_data_args"); + + xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->data.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compaction_metrics_data_pargs::~ThriftHiveMetastore_update_compaction_metrics_data_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compaction_metrics_data_pargs"); + + xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->data)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compaction_metrics_data_result::~ThriftHiveMetastore_update_compaction_metrics_data_result() noexcept { +} + +ThriftHiveMetastore_update_compaction_metrics_data_result::ThriftHiveMetastore_update_compaction_metrics_data_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_update_compaction_metrics_data_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_update_compaction_metrics_data_presult::~ThriftHiveMetastore_update_compaction_metrics_data_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_update_compaction_metrics_data_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_remove_compaction_metrics_data_args::~ThriftHiveMetastore_remove_compaction_metrics_data_args() noexcept { +} + +ThriftHiveMetastore_remove_compaction_metrics_data_args::ThriftHiveMetastore_remove_compaction_metrics_data_args() noexcept { +} + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_compaction_metrics_data_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_compaction_metrics_data_pargs::~ThriftHiveMetastore_remove_compaction_metrics_data_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_compaction_metrics_data_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_compaction_metrics_data_result::~ThriftHiveMetastore_remove_compaction_metrics_data_result() noexcept { +} + +ThriftHiveMetastore_remove_compaction_metrics_data_result::ThriftHiveMetastore_remove_compaction_metrics_data_result() noexcept { +} + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_remove_compaction_metrics_data_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_remove_compaction_metrics_data_presult::~ThriftHiveMetastore_remove_compaction_metrics_data_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_remove_compaction_metrics_data_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_set_hadoop_jobid_args::~ThriftHiveMetastore_set_hadoop_jobid_args() noexcept { +} + +ThriftHiveMetastore_set_hadoop_jobid_args::ThriftHiveMetastore_set_hadoop_jobid_args() noexcept + : jobId(), + cq_id(0) { +} + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->jobId); + this->__isset.jobId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->cq_id); + this->__isset.cq_id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_hadoop_jobid_args"); + + xfer += oprot->writeFieldBegin("jobId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->jobId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cq_id", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->cq_id); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_hadoop_jobid_pargs::~ThriftHiveMetastore_set_hadoop_jobid_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_hadoop_jobid_pargs"); + + xfer += oprot->writeFieldBegin("jobId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->jobId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cq_id", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64((*(this->cq_id))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_hadoop_jobid_result::~ThriftHiveMetastore_set_hadoop_jobid_result() noexcept { +} + +ThriftHiveMetastore_set_hadoop_jobid_result::ThriftHiveMetastore_set_hadoop_jobid_result() noexcept { +} + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_hadoop_jobid_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_hadoop_jobid_presult::~ThriftHiveMetastore_set_hadoop_jobid_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_hadoop_jobid_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_latest_committed_compaction_info_args::~ThriftHiveMetastore_get_latest_committed_compaction_info_args() noexcept { +} + +ThriftHiveMetastore_get_latest_committed_compaction_info_args::ThriftHiveMetastore_get_latest_committed_compaction_info_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_committed_compaction_info_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_committed_compaction_info_pargs::~ThriftHiveMetastore_get_latest_committed_compaction_info_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_committed_compaction_info_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_committed_compaction_info_result::~ThriftHiveMetastore_get_latest_committed_compaction_info_result() noexcept { +} + +ThriftHiveMetastore_get_latest_committed_compaction_info_result::ThriftHiveMetastore_get_latest_committed_compaction_info_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_latest_committed_compaction_info_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_latest_committed_compaction_info_presult::~ThriftHiveMetastore_get_latest_committed_compaction_info_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_latest_committed_compaction_info_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_next_notification_args::~ThriftHiveMetastore_get_next_notification_args() noexcept { +} + +ThriftHiveMetastore_get_next_notification_args::ThriftHiveMetastore_get_next_notification_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_next_notification_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_next_notification_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_next_notification_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_next_notification_pargs::~ThriftHiveMetastore_get_next_notification_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_next_notification_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_next_notification_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_next_notification_result::~ThriftHiveMetastore_get_next_notification_result() noexcept { +} + +ThriftHiveMetastore_get_next_notification_result::ThriftHiveMetastore_get_next_notification_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_next_notification_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_next_notification_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_next_notification_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_next_notification_presult::~ThriftHiveMetastore_get_next_notification_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_next_notification_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_current_notificationEventId_args::~ThriftHiveMetastore_get_current_notificationEventId_args() noexcept { +} + +ThriftHiveMetastore_get_current_notificationEventId_args::ThriftHiveMetastore_get_current_notificationEventId_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_current_notificationEventId_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_current_notificationEventId_pargs::~ThriftHiveMetastore_get_current_notificationEventId_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_current_notificationEventId_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_current_notificationEventId_result::~ThriftHiveMetastore_get_current_notificationEventId_result() noexcept { +} + +ThriftHiveMetastore_get_current_notificationEventId_result::ThriftHiveMetastore_get_current_notificationEventId_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_current_notificationEventId_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_current_notificationEventId_presult::~ThriftHiveMetastore_get_current_notificationEventId_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_current_notificationEventId_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_notification_events_count_args::~ThriftHiveMetastore_get_notification_events_count_args() noexcept { +} + +ThriftHiveMetastore_get_notification_events_count_args::ThriftHiveMetastore_get_notification_events_count_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_notification_events_count_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_notification_events_count_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_notification_events_count_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_notification_events_count_pargs::~ThriftHiveMetastore_get_notification_events_count_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_notification_events_count_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_notification_events_count_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_notification_events_count_result::~ThriftHiveMetastore_get_notification_events_count_result() noexcept { +} + +ThriftHiveMetastore_get_notification_events_count_result::ThriftHiveMetastore_get_notification_events_count_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_notification_events_count_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_notification_events_count_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_notification_events_count_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_notification_events_count_presult::~ThriftHiveMetastore_get_notification_events_count_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_notification_events_count_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_fire_listener_event_args::~ThriftHiveMetastore_fire_listener_event_args() noexcept { +} + +ThriftHiveMetastore_fire_listener_event_args::ThriftHiveMetastore_fire_listener_event_args() noexcept { +} + +uint32_t ThriftHiveMetastore_fire_listener_event_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_fire_listener_event_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fire_listener_event_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fire_listener_event_pargs::~ThriftHiveMetastore_fire_listener_event_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_fire_listener_event_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fire_listener_event_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fire_listener_event_result::~ThriftHiveMetastore_fire_listener_event_result() noexcept { +} + +ThriftHiveMetastore_fire_listener_event_result::ThriftHiveMetastore_fire_listener_event_result() noexcept { +} + +uint32_t ThriftHiveMetastore_fire_listener_event_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_fire_listener_event_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_fire_listener_event_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_fire_listener_event_presult::~ThriftHiveMetastore_fire_listener_event_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_fire_listener_event_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_flushCache_args::~ThriftHiveMetastore_flushCache_args() noexcept { +} + +ThriftHiveMetastore_flushCache_args::ThriftHiveMetastore_flushCache_args() noexcept { +} + +uint32_t ThriftHiveMetastore_flushCache_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_flushCache_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_flushCache_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_flushCache_pargs::~ThriftHiveMetastore_flushCache_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_flushCache_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_flushCache_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_flushCache_result::~ThriftHiveMetastore_flushCache_result() noexcept { +} + +ThriftHiveMetastore_flushCache_result::ThriftHiveMetastore_flushCache_result() noexcept { +} + +uint32_t ThriftHiveMetastore_flushCache_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_flushCache_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_flushCache_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_flushCache_presult::~ThriftHiveMetastore_flushCache_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_flushCache_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_args::~ThriftHiveMetastore_add_write_notification_log_args() noexcept { +} + +ThriftHiveMetastore_add_write_notification_log_args::ThriftHiveMetastore_add_write_notification_log_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_pargs::~ThriftHiveMetastore_add_write_notification_log_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_notification_log_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_result::~ThriftHiveMetastore_add_write_notification_log_result() noexcept { +} + +ThriftHiveMetastore_add_write_notification_log_result::ThriftHiveMetastore_add_write_notification_log_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_presult::~ThriftHiveMetastore_add_write_notification_log_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_notification_log_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_in_batch_args::~ThriftHiveMetastore_add_write_notification_log_in_batch_args() noexcept { +} + +ThriftHiveMetastore_add_write_notification_log_in_batch_args::ThriftHiveMetastore_add_write_notification_log_in_batch_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_in_batch_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_in_batch_pargs::~ThriftHiveMetastore_add_write_notification_log_in_batch_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_in_batch_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_in_batch_result::~ThriftHiveMetastore_add_write_notification_log_in_batch_result() noexcept { +} + +ThriftHiveMetastore_add_write_notification_log_in_batch_result::ThriftHiveMetastore_add_write_notification_log_in_batch_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_write_notification_log_in_batch_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_write_notification_log_in_batch_presult::~ThriftHiveMetastore_add_write_notification_log_in_batch_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_write_notification_log_in_batch_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_cm_recycle_args::~ThriftHiveMetastore_cm_recycle_args() noexcept { +} + +ThriftHiveMetastore_cm_recycle_args::ThriftHiveMetastore_cm_recycle_args() noexcept { +} + +uint32_t ThriftHiveMetastore_cm_recycle_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cm_recycle_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cm_recycle_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cm_recycle_pargs::~ThriftHiveMetastore_cm_recycle_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_cm_recycle_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cm_recycle_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cm_recycle_result::~ThriftHiveMetastore_cm_recycle_result() noexcept { +} + +ThriftHiveMetastore_cm_recycle_result::ThriftHiveMetastore_cm_recycle_result() noexcept { +} + +uint32_t ThriftHiveMetastore_cm_recycle_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cm_recycle_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cm_recycle_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cm_recycle_presult::~ThriftHiveMetastore_cm_recycle_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_cm_recycle_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_by_expr_args::~ThriftHiveMetastore_get_file_metadata_by_expr_args() noexcept { +} + +ThriftHiveMetastore_get_file_metadata_by_expr_args::ThriftHiveMetastore_get_file_metadata_by_expr_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_by_expr_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_by_expr_pargs::~ThriftHiveMetastore_get_file_metadata_by_expr_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_by_expr_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_by_expr_result::~ThriftHiveMetastore_get_file_metadata_by_expr_result() noexcept { +} + +ThriftHiveMetastore_get_file_metadata_by_expr_result::ThriftHiveMetastore_get_file_metadata_by_expr_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_by_expr_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_by_expr_presult::~ThriftHiveMetastore_get_file_metadata_by_expr_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_file_metadata_by_expr_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_args::~ThriftHiveMetastore_get_file_metadata_args() noexcept { +} + +ThriftHiveMetastore_get_file_metadata_args::ThriftHiveMetastore_get_file_metadata_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_file_metadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_file_metadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_pargs::~ThriftHiveMetastore_get_file_metadata_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_file_metadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_result::~ThriftHiveMetastore_get_file_metadata_result() noexcept { +} + +ThriftHiveMetastore_get_file_metadata_result::ThriftHiveMetastore_get_file_metadata_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_file_metadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_file_metadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_file_metadata_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_file_metadata_presult::~ThriftHiveMetastore_get_file_metadata_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_file_metadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_put_file_metadata_args::~ThriftHiveMetastore_put_file_metadata_args() noexcept { +} + +ThriftHiveMetastore_put_file_metadata_args::ThriftHiveMetastore_put_file_metadata_args() noexcept { +} + +uint32_t ThriftHiveMetastore_put_file_metadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_put_file_metadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_put_file_metadata_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_put_file_metadata_pargs::~ThriftHiveMetastore_put_file_metadata_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_put_file_metadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_put_file_metadata_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_put_file_metadata_result::~ThriftHiveMetastore_put_file_metadata_result() noexcept { +} + +ThriftHiveMetastore_put_file_metadata_result::ThriftHiveMetastore_put_file_metadata_result() noexcept { +} + +uint32_t ThriftHiveMetastore_put_file_metadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_put_file_metadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_put_file_metadata_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_put_file_metadata_presult::~ThriftHiveMetastore_put_file_metadata_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_put_file_metadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_clear_file_metadata_args::~ThriftHiveMetastore_clear_file_metadata_args() noexcept { +} + +ThriftHiveMetastore_clear_file_metadata_args::ThriftHiveMetastore_clear_file_metadata_args() noexcept { +} + +uint32_t ThriftHiveMetastore_clear_file_metadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_clear_file_metadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_clear_file_metadata_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_clear_file_metadata_pargs::~ThriftHiveMetastore_clear_file_metadata_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_clear_file_metadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_clear_file_metadata_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_clear_file_metadata_result::~ThriftHiveMetastore_clear_file_metadata_result() noexcept { +} + +ThriftHiveMetastore_clear_file_metadata_result::ThriftHiveMetastore_clear_file_metadata_result() noexcept { +} + +uint32_t ThriftHiveMetastore_clear_file_metadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_clear_file_metadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_clear_file_metadata_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_clear_file_metadata_presult::~ThriftHiveMetastore_clear_file_metadata_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_clear_file_metadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_cache_file_metadata_args::~ThriftHiveMetastore_cache_file_metadata_args() noexcept { +} + +ThriftHiveMetastore_cache_file_metadata_args::ThriftHiveMetastore_cache_file_metadata_args() noexcept { +} + +uint32_t ThriftHiveMetastore_cache_file_metadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cache_file_metadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cache_file_metadata_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cache_file_metadata_pargs::~ThriftHiveMetastore_cache_file_metadata_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_cache_file_metadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cache_file_metadata_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cache_file_metadata_result::~ThriftHiveMetastore_cache_file_metadata_result() noexcept { +} + +ThriftHiveMetastore_cache_file_metadata_result::ThriftHiveMetastore_cache_file_metadata_result() noexcept { +} + +uint32_t ThriftHiveMetastore_cache_file_metadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_cache_file_metadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_cache_file_metadata_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_cache_file_metadata_presult::~ThriftHiveMetastore_cache_file_metadata_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_cache_file_metadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_metastore_db_uuid_args::~ThriftHiveMetastore_get_metastore_db_uuid_args() noexcept { +} + +ThriftHiveMetastore_get_metastore_db_uuid_args::ThriftHiveMetastore_get_metastore_db_uuid_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_metastore_db_uuid_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_metastore_db_uuid_pargs::~ThriftHiveMetastore_get_metastore_db_uuid_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_metastore_db_uuid_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_metastore_db_uuid_result::~ThriftHiveMetastore_get_metastore_db_uuid_result() noexcept { +} + +ThriftHiveMetastore_get_metastore_db_uuid_result::ThriftHiveMetastore_get_metastore_db_uuid_result() noexcept + : success() { +} + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_metastore_db_uuid_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_metastore_db_uuid_presult::~ThriftHiveMetastore_get_metastore_db_uuid_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_metastore_db_uuid_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_resource_plan_args::~ThriftHiveMetastore_create_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_create_resource_plan_args::ThriftHiveMetastore_create_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_resource_plan_pargs::~ThriftHiveMetastore_create_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_resource_plan_result::~ThriftHiveMetastore_create_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_create_resource_plan_result::ThriftHiveMetastore_create_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_resource_plan_presult::~ThriftHiveMetastore_create_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_resource_plan_args::~ThriftHiveMetastore_get_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_get_resource_plan_args::ThriftHiveMetastore_get_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_resource_plan_pargs::~ThriftHiveMetastore_get_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_resource_plan_result::~ThriftHiveMetastore_get_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_get_resource_plan_result::ThriftHiveMetastore_get_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_resource_plan_presult::~ThriftHiveMetastore_get_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_active_resource_plan_args::~ThriftHiveMetastore_get_active_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_get_active_resource_plan_args::ThriftHiveMetastore_get_active_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_active_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_active_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_active_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_active_resource_plan_pargs::~ThriftHiveMetastore_get_active_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_active_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_active_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_active_resource_plan_result::~ThriftHiveMetastore_get_active_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_get_active_resource_plan_result::ThriftHiveMetastore_get_active_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_active_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_active_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_active_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_active_resource_plan_presult::~ThriftHiveMetastore_get_active_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_active_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_resource_plans_args::~ThriftHiveMetastore_get_all_resource_plans_args() noexcept { +} + +ThriftHiveMetastore_get_all_resource_plans_args::ThriftHiveMetastore_get_all_resource_plans_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_resource_plans_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_resource_plans_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_resource_plans_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_resource_plans_pargs::~ThriftHiveMetastore_get_all_resource_plans_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_resource_plans_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_resource_plans_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_resource_plans_result::~ThriftHiveMetastore_get_all_resource_plans_result() noexcept { +} + +ThriftHiveMetastore_get_all_resource_plans_result::ThriftHiveMetastore_get_all_resource_plans_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_resource_plans_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_resource_plans_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_resource_plans_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_resource_plans_presult::~ThriftHiveMetastore_get_all_resource_plans_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_resource_plans_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_resource_plan_args::~ThriftHiveMetastore_alter_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_alter_resource_plan_args::ThriftHiveMetastore_alter_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_resource_plan_pargs::~ThriftHiveMetastore_alter_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_resource_plan_result::~ThriftHiveMetastore_alter_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_alter_resource_plan_result::ThriftHiveMetastore_alter_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_resource_plan_presult::~ThriftHiveMetastore_alter_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_validate_resource_plan_args::~ThriftHiveMetastore_validate_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_validate_resource_plan_args::ThriftHiveMetastore_validate_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_validate_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_validate_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_validate_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_validate_resource_plan_pargs::~ThriftHiveMetastore_validate_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_validate_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_validate_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_validate_resource_plan_result::~ThriftHiveMetastore_validate_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_validate_resource_plan_result::ThriftHiveMetastore_validate_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_validate_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_validate_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_validate_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_validate_resource_plan_presult::~ThriftHiveMetastore_validate_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_validate_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_resource_plan_args::~ThriftHiveMetastore_drop_resource_plan_args() noexcept { +} + +ThriftHiveMetastore_drop_resource_plan_args::ThriftHiveMetastore_drop_resource_plan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_resource_plan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_resource_plan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_resource_plan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_resource_plan_pargs::~ThriftHiveMetastore_drop_resource_plan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_resource_plan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_resource_plan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_resource_plan_result::~ThriftHiveMetastore_drop_resource_plan_result() noexcept { +} + +ThriftHiveMetastore_drop_resource_plan_result::ThriftHiveMetastore_drop_resource_plan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_resource_plan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_resource_plan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_resource_plan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_resource_plan_presult::~ThriftHiveMetastore_drop_resource_plan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_resource_plan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_wm_trigger_args::~ThriftHiveMetastore_create_wm_trigger_args() noexcept { +} + +ThriftHiveMetastore_create_wm_trigger_args::ThriftHiveMetastore_create_wm_trigger_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_wm_trigger_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_wm_trigger_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_trigger_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_trigger_pargs::~ThriftHiveMetastore_create_wm_trigger_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_wm_trigger_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_trigger_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_trigger_result::~ThriftHiveMetastore_create_wm_trigger_result() noexcept { +} + +ThriftHiveMetastore_create_wm_trigger_result::ThriftHiveMetastore_create_wm_trigger_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_wm_trigger_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_wm_trigger_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_trigger_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_trigger_presult::~ThriftHiveMetastore_create_wm_trigger_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_wm_trigger_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_wm_trigger_args::~ThriftHiveMetastore_alter_wm_trigger_args() noexcept { +} + +ThriftHiveMetastore_alter_wm_trigger_args::ThriftHiveMetastore_alter_wm_trigger_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_wm_trigger_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_wm_trigger_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_trigger_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_trigger_pargs::~ThriftHiveMetastore_alter_wm_trigger_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_wm_trigger_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_trigger_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_trigger_result::~ThriftHiveMetastore_alter_wm_trigger_result() noexcept { +} + +ThriftHiveMetastore_alter_wm_trigger_result::ThriftHiveMetastore_alter_wm_trigger_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_wm_trigger_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_wm_trigger_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_trigger_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_trigger_presult::~ThriftHiveMetastore_alter_wm_trigger_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_wm_trigger_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_wm_trigger_args::~ThriftHiveMetastore_drop_wm_trigger_args() noexcept { +} + +ThriftHiveMetastore_drop_wm_trigger_args::ThriftHiveMetastore_drop_wm_trigger_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_trigger_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_trigger_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_trigger_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_trigger_pargs::~ThriftHiveMetastore_drop_wm_trigger_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_trigger_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_trigger_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_trigger_result::~ThriftHiveMetastore_drop_wm_trigger_result() noexcept { +} + +ThriftHiveMetastore_drop_wm_trigger_result::ThriftHiveMetastore_drop_wm_trigger_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_trigger_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_trigger_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_trigger_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_trigger_presult::~ThriftHiveMetastore_drop_wm_trigger_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_trigger_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_triggers_for_resourceplan_args::~ThriftHiveMetastore_get_triggers_for_resourceplan_args() noexcept { +} + +ThriftHiveMetastore_get_triggers_for_resourceplan_args::ThriftHiveMetastore_get_triggers_for_resourceplan_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_triggers_for_resourceplan_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_triggers_for_resourceplan_pargs::~ThriftHiveMetastore_get_triggers_for_resourceplan_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_triggers_for_resourceplan_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_triggers_for_resourceplan_result::~ThriftHiveMetastore_get_triggers_for_resourceplan_result() noexcept { +} + +ThriftHiveMetastore_get_triggers_for_resourceplan_result::ThriftHiveMetastore_get_triggers_for_resourceplan_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_triggers_for_resourceplan_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_triggers_for_resourceplan_presult::~ThriftHiveMetastore_get_triggers_for_resourceplan_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_triggers_for_resourceplan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_wm_pool_args::~ThriftHiveMetastore_create_wm_pool_args() noexcept { +} + +ThriftHiveMetastore_create_wm_pool_args::ThriftHiveMetastore_create_wm_pool_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_wm_pool_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_wm_pool_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_pool_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_pool_pargs::~ThriftHiveMetastore_create_wm_pool_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_wm_pool_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_pool_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_pool_result::~ThriftHiveMetastore_create_wm_pool_result() noexcept { +} + +ThriftHiveMetastore_create_wm_pool_result::ThriftHiveMetastore_create_wm_pool_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_wm_pool_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_wm_pool_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_wm_pool_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_wm_pool_presult::~ThriftHiveMetastore_create_wm_pool_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_wm_pool_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_wm_pool_args::~ThriftHiveMetastore_alter_wm_pool_args() noexcept { +} + +ThriftHiveMetastore_alter_wm_pool_args::ThriftHiveMetastore_alter_wm_pool_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_wm_pool_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_wm_pool_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_pool_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_pool_pargs::~ThriftHiveMetastore_alter_wm_pool_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_wm_pool_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_pool_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_pool_result::~ThriftHiveMetastore_alter_wm_pool_result() noexcept { +} + +ThriftHiveMetastore_alter_wm_pool_result::ThriftHiveMetastore_alter_wm_pool_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_wm_pool_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_wm_pool_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_wm_pool_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_wm_pool_presult::~ThriftHiveMetastore_alter_wm_pool_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_wm_pool_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_wm_pool_args::~ThriftHiveMetastore_drop_wm_pool_args() noexcept { +} + +ThriftHiveMetastore_drop_wm_pool_args::ThriftHiveMetastore_drop_wm_pool_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_pool_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_pool_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_pool_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_pool_pargs::~ThriftHiveMetastore_drop_wm_pool_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_pool_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_pool_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_pool_result::~ThriftHiveMetastore_drop_wm_pool_result() noexcept { +} + +ThriftHiveMetastore_drop_wm_pool_result::ThriftHiveMetastore_drop_wm_pool_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_pool_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_pool_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_pool_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_pool_presult::~ThriftHiveMetastore_drop_wm_pool_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_pool_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_or_update_wm_mapping_args::~ThriftHiveMetastore_create_or_update_wm_mapping_args() noexcept { +} + +ThriftHiveMetastore_create_or_update_wm_mapping_args::ThriftHiveMetastore_create_or_update_wm_mapping_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_update_wm_mapping_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_update_wm_mapping_pargs::~ThriftHiveMetastore_create_or_update_wm_mapping_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_update_wm_mapping_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_update_wm_mapping_result::~ThriftHiveMetastore_create_or_update_wm_mapping_result() noexcept { +} + +ThriftHiveMetastore_create_or_update_wm_mapping_result::ThriftHiveMetastore_create_or_update_wm_mapping_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_update_wm_mapping_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_update_wm_mapping_presult::~ThriftHiveMetastore_create_or_update_wm_mapping_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_or_update_wm_mapping_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_wm_mapping_args::~ThriftHiveMetastore_drop_wm_mapping_args() noexcept { +} + +ThriftHiveMetastore_drop_wm_mapping_args::ThriftHiveMetastore_drop_wm_mapping_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_mapping_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_mapping_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_mapping_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_mapping_pargs::~ThriftHiveMetastore_drop_wm_mapping_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_mapping_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_mapping_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_mapping_result::~ThriftHiveMetastore_drop_wm_mapping_result() noexcept { +} + +ThriftHiveMetastore_drop_wm_mapping_result::ThriftHiveMetastore_drop_wm_mapping_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_wm_mapping_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_wm_mapping_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_wm_mapping_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_wm_mapping_presult::~ThriftHiveMetastore_drop_wm_mapping_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_wm_mapping_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args::~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args() noexcept { +} + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args::ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs::~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result::~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result() noexcept { +} + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result::ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult::~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_ischema_args::~ThriftHiveMetastore_create_ischema_args() noexcept { +} + +ThriftHiveMetastore_create_ischema_args::ThriftHiveMetastore_create_ischema_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_ischema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schema.read(iprot); + this->__isset.schema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_ischema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_ischema_args"); + + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schema.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_ischema_pargs::~ThriftHiveMetastore_create_ischema_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_ischema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_ischema_pargs"); + + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schema)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_ischema_result::~ThriftHiveMetastore_create_ischema_result() noexcept { +} + +ThriftHiveMetastore_create_ischema_result::ThriftHiveMetastore_create_ischema_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_ischema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_ischema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_ischema_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_ischema_presult::~ThriftHiveMetastore_create_ischema_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_ischema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_alter_ischema_args::~ThriftHiveMetastore_alter_ischema_args() noexcept { +} + +ThriftHiveMetastore_alter_ischema_args::ThriftHiveMetastore_alter_ischema_args() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_ischema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_ischema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_ischema_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_ischema_pargs::~ThriftHiveMetastore_alter_ischema_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_ischema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_ischema_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_ischema_result::~ThriftHiveMetastore_alter_ischema_result() noexcept { +} + +ThriftHiveMetastore_alter_ischema_result::ThriftHiveMetastore_alter_ischema_result() noexcept { +} + +uint32_t ThriftHiveMetastore_alter_ischema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_alter_ischema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_alter_ischema_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_alter_ischema_presult::~ThriftHiveMetastore_alter_ischema_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_alter_ischema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_ischema_args::~ThriftHiveMetastore_get_ischema_args() noexcept { +} + +ThriftHiveMetastore_get_ischema_args::ThriftHiveMetastore_get_ischema_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_ischema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->name.read(iprot); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_ischema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_ischema_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->name.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_ischema_pargs::~ThriftHiveMetastore_get_ischema_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_ischema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_ischema_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->name)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_ischema_result::~ThriftHiveMetastore_get_ischema_result() noexcept { +} + +ThriftHiveMetastore_get_ischema_result::ThriftHiveMetastore_get_ischema_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_ischema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_ischema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_ischema_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_ischema_presult::~ThriftHiveMetastore_get_ischema_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_ischema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_ischema_args::~ThriftHiveMetastore_drop_ischema_args() noexcept { +} + +ThriftHiveMetastore_drop_ischema_args::ThriftHiveMetastore_drop_ischema_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_ischema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->name.read(iprot); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_ischema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_ischema_args"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->name.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_ischema_pargs::~ThriftHiveMetastore_drop_ischema_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_ischema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_ischema_pargs"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->name)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_ischema_result::~ThriftHiveMetastore_drop_ischema_result() noexcept { +} + +ThriftHiveMetastore_drop_ischema_result::ThriftHiveMetastore_drop_ischema_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_ischema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_ischema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_ischema_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_ischema_presult::~ThriftHiveMetastore_drop_ischema_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_ischema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_schema_version_args::~ThriftHiveMetastore_add_schema_version_args() noexcept { +} + +ThriftHiveMetastore_add_schema_version_args::ThriftHiveMetastore_add_schema_version_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_schema_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaVersion.read(iprot); + this->__isset.schemaVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_schema_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_schema_version_args"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaVersion.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_schema_version_pargs::~ThriftHiveMetastore_add_schema_version_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_schema_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_schema_version_pargs"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schemaVersion)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_schema_version_result::~ThriftHiveMetastore_add_schema_version_result() noexcept { +} + +ThriftHiveMetastore_add_schema_version_result::ThriftHiveMetastore_add_schema_version_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_schema_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_schema_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_schema_version_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_schema_version_presult::~ThriftHiveMetastore_add_schema_version_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_schema_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_version_args::~ThriftHiveMetastore_get_schema_version_args() noexcept { +} + +ThriftHiveMetastore_get_schema_version_args::ThriftHiveMetastore_get_schema_version_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaVersion.read(iprot); + this->__isset.schemaVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_version_args"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaVersion.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_version_pargs::~ThriftHiveMetastore_get_schema_version_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_version_pargs"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schemaVersion)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_version_result::~ThriftHiveMetastore_get_schema_version_result() noexcept { +} + +ThriftHiveMetastore_get_schema_version_result::ThriftHiveMetastore_get_schema_version_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_version_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_version_presult::~ThriftHiveMetastore_get_schema_version_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_latest_version_args::~ThriftHiveMetastore_get_schema_latest_version_args() noexcept { +} + +ThriftHiveMetastore_get_schema_latest_version_args::ThriftHiveMetastore_get_schema_latest_version_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_latest_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaName.read(iprot); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_latest_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_latest_version_args"); + + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaName.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_latest_version_pargs::~ThriftHiveMetastore_get_schema_latest_version_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_latest_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_latest_version_pargs"); + + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schemaName)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_latest_version_result::~ThriftHiveMetastore_get_schema_latest_version_result() noexcept { +} + +ThriftHiveMetastore_get_schema_latest_version_result::ThriftHiveMetastore_get_schema_latest_version_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_latest_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_latest_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_latest_version_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_latest_version_presult::~ThriftHiveMetastore_get_schema_latest_version_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_latest_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schema_all_versions_args::~ThriftHiveMetastore_get_schema_all_versions_args() noexcept { +} + +ThriftHiveMetastore_get_schema_all_versions_args::ThriftHiveMetastore_get_schema_all_versions_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_all_versions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaName.read(iprot); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_all_versions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_all_versions_args"); + + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaName.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_all_versions_pargs::~ThriftHiveMetastore_get_schema_all_versions_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_all_versions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_all_versions_pargs"); + + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schemaName)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_all_versions_result::~ThriftHiveMetastore_get_schema_all_versions_result() noexcept { +} + +ThriftHiveMetastore_get_schema_all_versions_result::ThriftHiveMetastore_get_schema_all_versions_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schema_all_versions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2590; + ::apache::thrift::protocol::TType _etype2593; + xfer += iprot->readListBegin(_etype2593, _size2590); + this->success.resize(_size2590); + uint32_t _i2594; + for (_i2594 = 0; _i2594 < _size2590; ++_i2594) + { + xfer += this->success[_i2594].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schema_all_versions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schema_all_versions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2595; + for (_iter2595 = this->success.begin(); _iter2595 != this->success.end(); ++_iter2595) + { + xfer += (*_iter2595).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schema_all_versions_presult::~ThriftHiveMetastore_get_schema_all_versions_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schema_all_versions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2596; + ::apache::thrift::protocol::TType _etype2599; + xfer += iprot->readListBegin(_etype2599, _size2596); + (*(this->success)).resize(_size2596); + uint32_t _i2600; + for (_i2600 = 0; _i2600 < _size2596; ++_i2600) + { + xfer += (*(this->success))[_i2600].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_schema_version_args::~ThriftHiveMetastore_drop_schema_version_args() noexcept { +} + +ThriftHiveMetastore_drop_schema_version_args::ThriftHiveMetastore_drop_schema_version_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_schema_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaVersion.read(iprot); + this->__isset.schemaVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_schema_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_schema_version_args"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaVersion.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_schema_version_pargs::~ThriftHiveMetastore_drop_schema_version_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_schema_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_schema_version_pargs"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->schemaVersion)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_schema_version_result::~ThriftHiveMetastore_drop_schema_version_result() noexcept { +} + +ThriftHiveMetastore_drop_schema_version_result::ThriftHiveMetastore_drop_schema_version_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_schema_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_schema_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_schema_version_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_schema_version_presult::~ThriftHiveMetastore_drop_schema_version_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_schema_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_schemas_by_cols_args::~ThriftHiveMetastore_get_schemas_by_cols_args() noexcept { +} + +ThriftHiveMetastore_get_schemas_by_cols_args::ThriftHiveMetastore_get_schemas_by_cols_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schemas_by_cols_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schemas_by_cols_pargs::~ThriftHiveMetastore_get_schemas_by_cols_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schemas_by_cols_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schemas_by_cols_result::~ThriftHiveMetastore_get_schemas_by_cols_result() noexcept { +} + +ThriftHiveMetastore_get_schemas_by_cols_result::ThriftHiveMetastore_get_schemas_by_cols_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_schemas_by_cols_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_schemas_by_cols_presult::~ThriftHiveMetastore_get_schemas_by_cols_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_schemas_by_cols_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_map_schema_version_to_serde_args::~ThriftHiveMetastore_map_schema_version_to_serde_args() noexcept { +} + +ThriftHiveMetastore_map_schema_version_to_serde_args::ThriftHiveMetastore_map_schema_version_to_serde_args() noexcept { +} + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_map_schema_version_to_serde_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_map_schema_version_to_serde_pargs::~ThriftHiveMetastore_map_schema_version_to_serde_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_map_schema_version_to_serde_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_map_schema_version_to_serde_result::~ThriftHiveMetastore_map_schema_version_to_serde_result() noexcept { +} + +ThriftHiveMetastore_map_schema_version_to_serde_result::ThriftHiveMetastore_map_schema_version_to_serde_result() noexcept { +} + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_map_schema_version_to_serde_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_map_schema_version_to_serde_presult::~ThriftHiveMetastore_map_schema_version_to_serde_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_map_schema_version_to_serde_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_set_schema_version_state_args::~ThriftHiveMetastore_set_schema_version_state_args() noexcept { +} + +ThriftHiveMetastore_set_schema_version_state_args::ThriftHiveMetastore_set_schema_version_state_args() noexcept { +} + +uint32_t ThriftHiveMetastore_set_schema_version_state_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_schema_version_state_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_schema_version_state_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_schema_version_state_pargs::~ThriftHiveMetastore_set_schema_version_state_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_schema_version_state_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_schema_version_state_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_schema_version_state_result::~ThriftHiveMetastore_set_schema_version_state_result() noexcept { +} + +ThriftHiveMetastore_set_schema_version_state_result::ThriftHiveMetastore_set_schema_version_state_result() noexcept { +} + +uint32_t ThriftHiveMetastore_set_schema_version_state_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_set_schema_version_state_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_set_schema_version_state_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_set_schema_version_state_presult::~ThriftHiveMetastore_set_schema_version_state_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_set_schema_version_state_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_serde_args::~ThriftHiveMetastore_add_serde_args() noexcept { +} + +ThriftHiveMetastore_add_serde_args::ThriftHiveMetastore_add_serde_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_serde_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->serde.read(iprot); + this->__isset.serde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_serde_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_serde_args"); + + xfer += oprot->writeFieldBegin("serde", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->serde.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_serde_pargs::~ThriftHiveMetastore_add_serde_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_serde_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_serde_pargs"); + + xfer += oprot->writeFieldBegin("serde", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->serde)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_serde_result::~ThriftHiveMetastore_add_serde_result() noexcept { +} + +ThriftHiveMetastore_add_serde_result::ThriftHiveMetastore_add_serde_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_serde_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_serde_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_serde_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_serde_presult::~ThriftHiveMetastore_add_serde_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_serde_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_serde_args::~ThriftHiveMetastore_get_serde_args() noexcept { +} + +ThriftHiveMetastore_get_serde_args::ThriftHiveMetastore_get_serde_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_serde_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_serde_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_serde_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_serde_pargs::~ThriftHiveMetastore_get_serde_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_serde_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_serde_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_serde_result::~ThriftHiveMetastore_get_serde_result() noexcept { +} + +ThriftHiveMetastore_get_serde_result::ThriftHiveMetastore_get_serde_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_serde_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_serde_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_serde_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_serde_presult::~ThriftHiveMetastore_get_serde_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_serde_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_lock_materialization_rebuild_args::~ThriftHiveMetastore_get_lock_materialization_rebuild_args() noexcept { +} + +ThriftHiveMetastore_get_lock_materialization_rebuild_args::ThriftHiveMetastore_get_lock_materialization_rebuild_args() noexcept + : dbName(), + tableName(), + txnId(0) { +} + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_lock_materialization_rebuild_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_lock_materialization_rebuild_pargs::~ThriftHiveMetastore_get_lock_materialization_rebuild_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_lock_materialization_rebuild_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tableName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64((*(this->txnId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_lock_materialization_rebuild_result::~ThriftHiveMetastore_get_lock_materialization_rebuild_result() noexcept { +} + +ThriftHiveMetastore_get_lock_materialization_rebuild_result::ThriftHiveMetastore_get_lock_materialization_rebuild_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_lock_materialization_rebuild_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_lock_materialization_rebuild_presult::~ThriftHiveMetastore_get_lock_materialization_rebuild_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_lock_materialization_rebuild_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args::~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args() noexcept { +} + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args::ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args() noexcept + : dbName(), + tableName(), + txnId(0) { +} + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs::~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->dbName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tableName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64((*(this->txnId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result::~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result() noexcept { +} + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result::ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result() noexcept + : success(0) { +} + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult::~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_runtime_stats_args::~ThriftHiveMetastore_add_runtime_stats_args() noexcept { +} + +ThriftHiveMetastore_add_runtime_stats_args::ThriftHiveMetastore_add_runtime_stats_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_runtime_stats_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stat.read(iprot); + this->__isset.stat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_runtime_stats_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_runtime_stats_args"); + + xfer += oprot->writeFieldBegin("stat", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->stat.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_runtime_stats_pargs::~ThriftHiveMetastore_add_runtime_stats_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_runtime_stats_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_runtime_stats_pargs"); + + xfer += oprot->writeFieldBegin("stat", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->stat)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_runtime_stats_result::~ThriftHiveMetastore_add_runtime_stats_result() noexcept { +} + +ThriftHiveMetastore_add_runtime_stats_result::ThriftHiveMetastore_add_runtime_stats_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_runtime_stats_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_runtime_stats_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_runtime_stats_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_runtime_stats_presult::~ThriftHiveMetastore_add_runtime_stats_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_runtime_stats_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_runtime_stats_args::~ThriftHiveMetastore_get_runtime_stats_args() noexcept { +} + +ThriftHiveMetastore_get_runtime_stats_args::ThriftHiveMetastore_get_runtime_stats_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_runtime_stats_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_runtime_stats_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_runtime_stats_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_runtime_stats_pargs::~ThriftHiveMetastore_get_runtime_stats_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_runtime_stats_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_runtime_stats_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_runtime_stats_result::~ThriftHiveMetastore_get_runtime_stats_result() noexcept { +} + +ThriftHiveMetastore_get_runtime_stats_result::ThriftHiveMetastore_get_runtime_stats_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_runtime_stats_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2601; + ::apache::thrift::protocol::TType _etype2604; + xfer += iprot->readListBegin(_etype2604, _size2601); + this->success.resize(_size2601); + uint32_t _i2605; + for (_i2605 = 0; _i2605 < _size2601; ++_i2605) + { + xfer += this->success[_i2605].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_runtime_stats_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_runtime_stats_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2606; + for (_iter2606 = this->success.begin(); _iter2606 != this->success.end(); ++_iter2606) + { + xfer += (*_iter2606).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_runtime_stats_presult::~ThriftHiveMetastore_get_runtime_stats_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_runtime_stats_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2607; + ::apache::thrift::protocol::TType _etype2610; + xfer += iprot->readListBegin(_etype2610, _size2607); + (*(this->success)).resize(_size2607); + uint32_t _i2611; + for (_i2611 = 0; _i2611 < _size2607; ++_i2611) + { + xfer += (*(this->success))[_i2611].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_specs_args::~ThriftHiveMetastore_get_partitions_with_specs_args() noexcept { +} + +ThriftHiveMetastore_get_partitions_with_specs_args::ThriftHiveMetastore_get_partitions_with_specs_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_specs_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_specs_pargs::~ThriftHiveMetastore_get_partitions_with_specs_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_specs_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_specs_result::~ThriftHiveMetastore_get_partitions_with_specs_result() noexcept { +} + +ThriftHiveMetastore_get_partitions_with_specs_result::ThriftHiveMetastore_get_partitions_with_specs_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_partitions_with_specs_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_partitions_with_specs_presult::~ThriftHiveMetastore_get_partitions_with_specs_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_partitions_with_specs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_poll_args::~ThriftHiveMetastore_scheduled_query_poll_args() noexcept { +} + +ThriftHiveMetastore_scheduled_query_poll_args::ThriftHiveMetastore_scheduled_query_poll_args() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_poll_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_poll_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_poll_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_poll_pargs::~ThriftHiveMetastore_scheduled_query_poll_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_poll_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_poll_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_poll_result::~ThriftHiveMetastore_scheduled_query_poll_result() noexcept { +} + +ThriftHiveMetastore_scheduled_query_poll_result::ThriftHiveMetastore_scheduled_query_poll_result() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_poll_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_poll_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_poll_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_poll_presult::~ThriftHiveMetastore_scheduled_query_poll_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_poll_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_maintenance_args::~ThriftHiveMetastore_scheduled_query_maintenance_args() noexcept { +} + +ThriftHiveMetastore_scheduled_query_maintenance_args::ThriftHiveMetastore_scheduled_query_maintenance_args() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_maintenance_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_maintenance_pargs::~ThriftHiveMetastore_scheduled_query_maintenance_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_maintenance_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_maintenance_result::~ThriftHiveMetastore_scheduled_query_maintenance_result() noexcept { +} + +ThriftHiveMetastore_scheduled_query_maintenance_result::ThriftHiveMetastore_scheduled_query_maintenance_result() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_maintenance_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o3) { + xfer += oprot->writeFieldBegin("o3", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->o3.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o4) { + xfer += oprot->writeFieldBegin("o4", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->o4.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_maintenance_presult::~ThriftHiveMetastore_scheduled_query_maintenance_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_maintenance_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o3.read(iprot); + this->__isset.o3 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o4.read(iprot); + this->__isset.o4 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_progress_args::~ThriftHiveMetastore_scheduled_query_progress_args() noexcept { +} + +ThriftHiveMetastore_scheduled_query_progress_args::ThriftHiveMetastore_scheduled_query_progress_args() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_progress_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->info.read(iprot); + this->__isset.info = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_progress_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_progress_args"); + + xfer += oprot->writeFieldBegin("info", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->info.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_progress_pargs::~ThriftHiveMetastore_scheduled_query_progress_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_progress_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_progress_pargs"); + + xfer += oprot->writeFieldBegin("info", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->info)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_progress_result::~ThriftHiveMetastore_scheduled_query_progress_result() noexcept { +} + +ThriftHiveMetastore_scheduled_query_progress_result::ThriftHiveMetastore_scheduled_query_progress_result() noexcept { +} + +uint32_t ThriftHiveMetastore_scheduled_query_progress_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_scheduled_query_progress_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_scheduled_query_progress_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_scheduled_query_progress_presult::~ThriftHiveMetastore_scheduled_query_progress_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_scheduled_query_progress_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_scheduled_query_args::~ThriftHiveMetastore_get_scheduled_query_args() noexcept { +} + +ThriftHiveMetastore_get_scheduled_query_args::ThriftHiveMetastore_get_scheduled_query_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_scheduled_query_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->scheduleKey.read(iprot); + this->__isset.scheduleKey = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_scheduled_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_scheduled_query_args"); + + xfer += oprot->writeFieldBegin("scheduleKey", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->scheduleKey.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_scheduled_query_pargs::~ThriftHiveMetastore_get_scheduled_query_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_scheduled_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_scheduled_query_pargs"); + + xfer += oprot->writeFieldBegin("scheduleKey", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->scheduleKey)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_scheduled_query_result::~ThriftHiveMetastore_get_scheduled_query_result() noexcept { +} + +ThriftHiveMetastore_get_scheduled_query_result::ThriftHiveMetastore_get_scheduled_query_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_scheduled_query_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_scheduled_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_scheduled_query_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_scheduled_query_presult::~ThriftHiveMetastore_get_scheduled_query_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_scheduled_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_replication_metrics_args::~ThriftHiveMetastore_add_replication_metrics_args() noexcept { +} + +ThriftHiveMetastore_add_replication_metrics_args::ThriftHiveMetastore_add_replication_metrics_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_replication_metrics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->replicationMetricList.read(iprot); + this->__isset.replicationMetricList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_replication_metrics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_replication_metrics_args"); + + xfer += oprot->writeFieldBegin("replicationMetricList", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->replicationMetricList.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_replication_metrics_pargs::~ThriftHiveMetastore_add_replication_metrics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_replication_metrics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_replication_metrics_pargs"); + + xfer += oprot->writeFieldBegin("replicationMetricList", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->replicationMetricList)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_replication_metrics_result::~ThriftHiveMetastore_add_replication_metrics_result() noexcept { +} + +ThriftHiveMetastore_add_replication_metrics_result::ThriftHiveMetastore_add_replication_metrics_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_replication_metrics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_replication_metrics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_replication_metrics_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_replication_metrics_presult::~ThriftHiveMetastore_add_replication_metrics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_replication_metrics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_replication_metrics_args::~ThriftHiveMetastore_get_replication_metrics_args() noexcept { +} + +ThriftHiveMetastore_get_replication_metrics_args::ThriftHiveMetastore_get_replication_metrics_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_replication_metrics_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->rqst.read(iprot); + this->__isset.rqst = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_replication_metrics_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_replication_metrics_args"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->rqst.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_replication_metrics_pargs::~ThriftHiveMetastore_get_replication_metrics_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_replication_metrics_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_replication_metrics_pargs"); + + xfer += oprot->writeFieldBegin("rqst", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->rqst)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_replication_metrics_result::~ThriftHiveMetastore_get_replication_metrics_result() noexcept { +} + +ThriftHiveMetastore_get_replication_metrics_result::ThriftHiveMetastore_get_replication_metrics_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_replication_metrics_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_replication_metrics_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_replication_metrics_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_replication_metrics_presult::~ThriftHiveMetastore_get_replication_metrics_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_replication_metrics_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_req_args::~ThriftHiveMetastore_get_open_txns_req_args() noexcept { +} + +ThriftHiveMetastore_get_open_txns_req_args::ThriftHiveMetastore_get_open_txns_req_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_req_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->getOpenTxnsRequest.read(iprot); + this->__isset.getOpenTxnsRequest = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_req_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_req_args"); + + xfer += oprot->writeFieldBegin("getOpenTxnsRequest", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->getOpenTxnsRequest.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_req_pargs::~ThriftHiveMetastore_get_open_txns_req_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_req_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_req_pargs"); + + xfer += oprot->writeFieldBegin("getOpenTxnsRequest", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->getOpenTxnsRequest)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_req_result::~ThriftHiveMetastore_get_open_txns_req_result() noexcept { +} + +ThriftHiveMetastore_get_open_txns_req_result::ThriftHiveMetastore_get_open_txns_req_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_open_txns_req_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_open_txns_req_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_open_txns_req_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_open_txns_req_presult::~ThriftHiveMetastore_get_open_txns_req_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_open_txns_req_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_create_stored_procedure_args::~ThriftHiveMetastore_create_stored_procedure_args() noexcept { +} + +ThriftHiveMetastore_create_stored_procedure_args::ThriftHiveMetastore_create_stored_procedure_args() noexcept { +} + +uint32_t ThriftHiveMetastore_create_stored_procedure_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->proc.read(iprot); + this->__isset.proc = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_stored_procedure_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_stored_procedure_args"); + + xfer += oprot->writeFieldBegin("proc", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->proc.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_stored_procedure_pargs::~ThriftHiveMetastore_create_stored_procedure_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_stored_procedure_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_stored_procedure_pargs"); + + xfer += oprot->writeFieldBegin("proc", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->proc)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_stored_procedure_result::~ThriftHiveMetastore_create_stored_procedure_result() noexcept { +} + +ThriftHiveMetastore_create_stored_procedure_result::ThriftHiveMetastore_create_stored_procedure_result() noexcept { +} + +uint32_t ThriftHiveMetastore_create_stored_procedure_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_create_stored_procedure_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_create_stored_procedure_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_create_stored_procedure_presult::~ThriftHiveMetastore_create_stored_procedure_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_create_stored_procedure_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_stored_procedure_args::~ThriftHiveMetastore_get_stored_procedure_args() noexcept { +} + +ThriftHiveMetastore_get_stored_procedure_args::ThriftHiveMetastore_get_stored_procedure_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_stored_procedure_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_stored_procedure_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_stored_procedure_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_stored_procedure_pargs::~ThriftHiveMetastore_get_stored_procedure_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_stored_procedure_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_stored_procedure_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_stored_procedure_result::~ThriftHiveMetastore_get_stored_procedure_result() noexcept { +} + +ThriftHiveMetastore_get_stored_procedure_result::ThriftHiveMetastore_get_stored_procedure_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_stored_procedure_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_stored_procedure_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_stored_procedure_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_stored_procedure_presult::~ThriftHiveMetastore_get_stored_procedure_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_stored_procedure_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_stored_procedure_args::~ThriftHiveMetastore_drop_stored_procedure_args() noexcept { +} + +ThriftHiveMetastore_drop_stored_procedure_args::ThriftHiveMetastore_drop_stored_procedure_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_stored_procedure_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_stored_procedure_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_stored_procedure_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_stored_procedure_pargs::~ThriftHiveMetastore_drop_stored_procedure_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_stored_procedure_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_stored_procedure_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_stored_procedure_result::~ThriftHiveMetastore_drop_stored_procedure_result() noexcept { +} + +ThriftHiveMetastore_drop_stored_procedure_result::ThriftHiveMetastore_drop_stored_procedure_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_stored_procedure_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_stored_procedure_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_stored_procedure_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_stored_procedure_presult::~ThriftHiveMetastore_drop_stored_procedure_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_stored_procedure_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_stored_procedures_args::~ThriftHiveMetastore_get_all_stored_procedures_args() noexcept { +} + +ThriftHiveMetastore_get_all_stored_procedures_args::ThriftHiveMetastore_get_all_stored_procedures_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_stored_procedures_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_stored_procedures_pargs::~ThriftHiveMetastore_get_all_stored_procedures_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_stored_procedures_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_stored_procedures_result::~ThriftHiveMetastore_get_all_stored_procedures_result() noexcept { +} + +ThriftHiveMetastore_get_all_stored_procedures_result::ThriftHiveMetastore_get_all_stored_procedures_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2612; + ::apache::thrift::protocol::TType _etype2615; + xfer += iprot->readListBegin(_etype2615, _size2612); + this->success.resize(_size2612); + uint32_t _i2616; + for (_i2616 = 0; _i2616 < _size2612; ++_i2616) + { + xfer += iprot->readString(this->success[_i2616]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_stored_procedures_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2617; + for (_iter2617 = this->success.begin(); _iter2617 != this->success.end(); ++_iter2617) + { + xfer += oprot->writeString((*_iter2617)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_stored_procedures_presult::~ThriftHiveMetastore_get_all_stored_procedures_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_stored_procedures_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2618; + ::apache::thrift::protocol::TType _etype2621; + xfer += iprot->readListBegin(_etype2621, _size2618); + (*(this->success)).resize(_size2618); + uint32_t _i2622; + for (_i2622 = 0; _i2622 < _size2618; ++_i2622) + { + xfer += iprot->readString((*(this->success))[_i2622]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_find_package_args::~ThriftHiveMetastore_find_package_args() noexcept { +} + +ThriftHiveMetastore_find_package_args::ThriftHiveMetastore_find_package_args() noexcept { +} + +uint32_t ThriftHiveMetastore_find_package_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_package_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_package_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_package_pargs::~ThriftHiveMetastore_find_package_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_package_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_package_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_package_result::~ThriftHiveMetastore_find_package_result() noexcept { +} + +ThriftHiveMetastore_find_package_result::ThriftHiveMetastore_find_package_result() noexcept { +} + +uint32_t ThriftHiveMetastore_find_package_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_find_package_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_find_package_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_find_package_presult::~ThriftHiveMetastore_find_package_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_find_package_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_add_package_args::~ThriftHiveMetastore_add_package_args() noexcept { +} + +ThriftHiveMetastore_add_package_args::ThriftHiveMetastore_add_package_args() noexcept { +} + +uint32_t ThriftHiveMetastore_add_package_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_package_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_package_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_package_pargs::~ThriftHiveMetastore_add_package_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_package_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_package_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_package_result::~ThriftHiveMetastore_add_package_result() noexcept { +} + +ThriftHiveMetastore_add_package_result::ThriftHiveMetastore_add_package_result() noexcept { +} + +uint32_t ThriftHiveMetastore_add_package_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_add_package_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_add_package_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_add_package_presult::~ThriftHiveMetastore_add_package_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_add_package_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_packages_args::~ThriftHiveMetastore_get_all_packages_args() noexcept { +} + +ThriftHiveMetastore_get_all_packages_args::ThriftHiveMetastore_get_all_packages_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_packages_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_packages_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_packages_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_packages_pargs::~ThriftHiveMetastore_get_all_packages_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_packages_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_packages_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_packages_result::~ThriftHiveMetastore_get_all_packages_result() noexcept { +} + +ThriftHiveMetastore_get_all_packages_result::ThriftHiveMetastore_get_all_packages_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_packages_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2623; + ::apache::thrift::protocol::TType _etype2626; + xfer += iprot->readListBegin(_etype2626, _size2623); + this->success.resize(_size2623); + uint32_t _i2627; + for (_i2627 = 0; _i2627 < _size2623; ++_i2627) + { + xfer += iprot->readString(this->success[_i2627]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_packages_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_packages_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter2628; + for (_iter2628 = this->success.begin(); _iter2628 != this->success.end(); ++_iter2628) + { + xfer += oprot->writeString((*_iter2628)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_packages_presult::~ThriftHiveMetastore_get_all_packages_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_packages_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2629; + ::apache::thrift::protocol::TType _etype2632; + xfer += iprot->readListBegin(_etype2632, _size2629); + (*(this->success)).resize(_size2629); + uint32_t _i2633; + for (_i2633 = 0; _i2633 < _size2629; ++_i2633) + { + xfer += iprot->readString((*(this->success))[_i2633]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_drop_package_args::~ThriftHiveMetastore_drop_package_args() noexcept { +} + +ThriftHiveMetastore_drop_package_args::ThriftHiveMetastore_drop_package_args() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_package_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_package_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_package_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_package_pargs::~ThriftHiveMetastore_drop_package_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_package_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_package_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_package_result::~ThriftHiveMetastore_drop_package_result() noexcept { +} + +ThriftHiveMetastore_drop_package_result::ThriftHiveMetastore_drop_package_result() noexcept { +} + +uint32_t ThriftHiveMetastore_drop_package_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_drop_package_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_drop_package_result"); + + if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_drop_package_presult::~ThriftHiveMetastore_drop_package_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_drop_package_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHiveMetastore_get_all_write_event_info_args::~ThriftHiveMetastore_get_all_write_event_info_args() noexcept { +} + +ThriftHiveMetastore_get_all_write_event_info_args::ThriftHiveMetastore_get_all_write_event_info_args() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_write_event_info_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->request.read(iprot); + this->__isset.request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_write_event_info_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_write_event_info_args"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_write_event_info_pargs::~ThriftHiveMetastore_get_all_write_event_info_pargs() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_write_event_info_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_write_event_info_pargs"); + + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_write_event_info_result::~ThriftHiveMetastore_get_all_write_event_info_result() noexcept { +} + +ThriftHiveMetastore_get_all_write_event_info_result::ThriftHiveMetastore_get_all_write_event_info_result() noexcept { +} + +uint32_t ThriftHiveMetastore_get_all_write_event_info_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size2634; + ::apache::thrift::protocol::TType _etype2637; + xfer += iprot->readListBegin(_etype2637, _size2634); + this->success.resize(_size2634); + uint32_t _i2638; + for (_i2638 = 0; _i2638 < _size2634; ++_i2638) + { + xfer += this->success[_i2638].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_all_write_event_info_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_all_write_event_info_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->success.size())); + std::vector ::const_iterator _iter2639; + for (_iter2639 = this->success.begin(); _iter2639 != this->success.end(); ++_iter2639) + { + xfer += (*_iter2639).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_all_write_event_info_presult::~ThriftHiveMetastore_get_all_write_event_info_presult() noexcept { +} + + +uint32_t ThriftHiveMetastore_get_all_write_event_info_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size2640; + ::apache::thrift::protocol::TType _etype2643; + xfer += iprot->readListBegin(_etype2643, _size2640); + (*(this->success)).resize(_size2640); + uint32_t _i2644; + for (_i2644 = 0; _i2644 < _size2640; ++_i2644) + { + xfer += (*(this->success))[_i2644].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +void ThriftHiveMetastoreClient::abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) +{ + send_abort_Compactions(rqst); + recv_abort_Compactions(_return); +} + +void ThriftHiveMetastoreClient::send_abort_Compactions(const AbortCompactionRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("abort_Compactions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_Compactions_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_abort_Compactions(AbortCompactResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_Compactions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_abort_Compactions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "abort_Compactions failed: unknown result"); +} + +void ThriftHiveMetastoreClient::getMetaConf(std::string& _return, const std::string& key) +{ + send_getMetaConf(key); + recv_getMetaConf(_return); +} + +void ThriftHiveMetastoreClient::send_getMetaConf(const std::string& key) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_getMetaConf_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_getMetaConf(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getMetaConf") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_getMetaConf_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getMetaConf failed: unknown result"); +} + +void ThriftHiveMetastoreClient::setMetaConf(const std::string& key, const std::string& value) +{ + send_setMetaConf(key, value); + recv_setMetaConf(); +} + +void ThriftHiveMetastoreClient::send_setMetaConf(const std::string& key, const std::string& value) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_setMetaConf_pargs args; + args.key = &key; + args.value = &value; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_setMetaConf() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("setMetaConf") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_setMetaConf_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::create_catalog(const CreateCatalogRequest& catalog) +{ + send_create_catalog(catalog); + recv_create_catalog(); +} + +void ThriftHiveMetastoreClient::send_create_catalog(const CreateCatalogRequest& catalog) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_catalog_pargs args; + args.catalog = &catalog; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_catalog() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::alter_catalog(const AlterCatalogRequest& rqst) +{ + send_alter_catalog(rqst); + recv_alter_catalog(); +} + +void ThriftHiveMetastoreClient::send_alter_catalog(const AlterCatalogRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_catalog_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_catalog() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) +{ + send_get_catalog(catName); + recv_get_catalog(_return); +} + +void ThriftHiveMetastoreClient::send_get_catalog(const GetCatalogRequest& catName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_catalog_pargs args; + args.catName = &catName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_catalog(GetCatalogResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_catalog_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_catalog failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_catalogs(GetCatalogsResponse& _return) +{ + send_get_catalogs(); + recv_get_catalogs(_return); +} + +void ThriftHiveMetastoreClient::send_get_catalogs() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_catalogs", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_catalogs_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_catalogs(GetCatalogsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_catalogs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_catalogs_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_catalogs failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_catalog(const DropCatalogRequest& catName) +{ + send_drop_catalog(catName); + recv_drop_catalog(); +} + +void ThriftHiveMetastoreClient::send_drop_catalog(const DropCatalogRequest& catName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_catalog_pargs args; + args.catName = &catName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_catalog() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::create_database(const Database& database) +{ + send_create_database(database); + recv_create_database(); +} + +void ThriftHiveMetastoreClient::send_create_database(const Database& database) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_database_pargs args; + args.database = &database; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_database() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::create_database_req(const CreateDatabaseRequest& createDatabaseRequest) +{ + send_create_database_req(createDatabaseRequest); + recv_create_database_req(); +} + +void ThriftHiveMetastoreClient::send_create_database_req(const CreateDatabaseRequest& createDatabaseRequest) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_database_req_pargs args; + args.createDatabaseRequest = &createDatabaseRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_database_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_database(Database& _return, const std::string& name) +{ + send_get_database(name); + recv_get_database(_return); +} + +void ThriftHiveMetastoreClient::send_get_database(const std::string& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_database_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_database(Database& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_database_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_database_req(Database& _return, const GetDatabaseRequest& request) +{ + send_get_database_req(request); + recv_get_database_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_database_req(const GetDatabaseRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_database_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_database_req(Database& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_database_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_database(const std::string& name, const bool deleteData, const bool cascade) +{ + send_drop_database(name, deleteData, cascade); + recv_drop_database(); +} + +void ThriftHiveMetastoreClient::send_drop_database(const std::string& name, const bool deleteData, const bool cascade) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_database_pargs args; + args.name = &name; + args.deleteData = &deleteData; + args.cascade = &cascade; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_database() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::drop_database_req(const DropDatabaseRequest& req) +{ + send_drop_database_req(req); + recv_drop_database_req(); +} + +void ThriftHiveMetastoreClient::send_drop_database_req(const DropDatabaseRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_database_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_database_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_databases(std::vector & _return, const std::string& pattern) +{ + send_get_databases(pattern); + recv_get_databases(_return); +} + +void ThriftHiveMetastoreClient::send_get_databases(const std::string& pattern) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_databases_pargs args; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_databases(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_databases") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_databases failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_databases(std::vector & _return) +{ + send_get_all_databases(); + recv_get_all_databases(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_databases() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_databases_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_databases(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_databases") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_databases failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_database(const std::string& dbname, const Database& db) +{ + send_alter_database(dbname, db); + recv_alter_database(); +} + +void ThriftHiveMetastoreClient::send_alter_database(const std::string& dbname, const Database& db) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_database_pargs args; + args.dbname = &dbname; + args.db = &db; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_database() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_database_req(const AlterDatabaseRequest& alterDbReq) +{ + send_alter_database_req(alterDbReq); + recv_alter_database_req(); +} + +void ThriftHiveMetastoreClient::send_alter_database_req(const AlterDatabaseRequest& alterDbReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_database_req_pargs args; + args.alterDbReq = &alterDbReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_database_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) +{ + send_create_dataconnector_req(connectorReq); + recv_create_dataconnector_req(); +} + +void ThriftHiveMetastoreClient::send_create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_dataconnector_req_pargs args; + args.connectorReq = &connectorReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_dataconnector_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) +{ + send_get_dataconnector_req(request); + recv_get_dataconnector_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_dataconnector_req(const GetDataConnectorRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_dataconnector_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_dataconnector_req(DataConnector& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_dataconnector_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_dataconnector_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) +{ + send_drop_dataconnector_req(dropDcReq); + recv_drop_dataconnector_req(); +} + +void ThriftHiveMetastoreClient::send_drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_dataconnector_req_pargs args; + args.dropDcReq = &dropDcReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_dataconnector_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_dataconnectors(std::vector & _return) +{ + send_get_dataconnectors(); + recv_get_dataconnectors(_return); +} + +void ThriftHiveMetastoreClient::send_get_dataconnectors() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_dataconnectors", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_dataconnectors_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_dataconnectors(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_dataconnectors") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_dataconnectors_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_dataconnectors failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) +{ + send_alter_dataconnector_req(alterReq); + recv_alter_dataconnector_req(); +} + +void ThriftHiveMetastoreClient::send_alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_dataconnector_req_pargs args; + args.alterReq = &alterReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_dataconnector_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_type(Type& _return, const std::string& name) +{ + send_get_type(name); + recv_get_type(_return); +} + +void ThriftHiveMetastoreClient::send_get_type(const std::string& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_type_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_type(Type& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::create_type(const Type& type) +{ + send_create_type(type); + return recv_create_type(); +} + +void ThriftHiveMetastoreClient::send_create_type(const Type& type) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_type_pargs args; + args.type = &type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_create_type() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_create_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_type failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_type(const std::string& type) +{ + send_drop_type(type); + return recv_drop_type(); +} + +void ThriftHiveMetastoreClient::send_drop_type(const std::string& type) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_type_pargs args; + args.type = &type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_type() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_type failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_type_all(std::map & _return, const std::string& name) +{ + send_get_type_all(name); + recv_get_type_all(_return); +} + +void ThriftHiveMetastoreClient::send_get_type_all(const std::string& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_type_all_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_type_all(std::map & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_type_all") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_type_all_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type_all failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) +{ + send_get_fields(db_name, table_name); + recv_get_fields(_return); +} + +void ThriftHiveMetastoreClient::send_get_fields(const std::string& db_name, const std::string& table_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_fields(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_fields_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + send_get_fields_with_environment_context(db_name, table_name, environment_context); + recv_get_fields_with_environment_context(_return); +} + +void ThriftHiveMetastoreClient::send_get_fields_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_fields_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_with_environment_context_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_fields_with_environment_context(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_fields_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields_with_environment_context failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) +{ + send_get_fields_req(req); + recv_get_fields_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_fields_req(const GetFieldsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_fields_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_fields_req(GetFieldsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_fields_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) +{ + send_get_schema(db_name, table_name); + recv_get_schema(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema(const std::string& db_name, const std::string& table_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + send_get_schema_with_environment_context(db_name, table_name, environment_context); + recv_get_schema_with_environment_context(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_with_environment_context_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema_with_environment_context(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_with_environment_context failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) +{ + send_get_schema_req(req); + recv_get_schema_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema_req(const GetSchemaRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema_req(GetSchemaResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_table(const Table& tbl) +{ + send_create_table(tbl); + recv_create_table(); +} + +void ThriftHiveMetastoreClient::send_create_table(const Table& tbl) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_pargs args; + args.tbl = &tbl; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_table() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) +{ + send_create_table_with_environment_context(tbl, environment_context); + recv_create_table_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_with_environment_context_pargs args; + args.tbl = &tbl; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_table_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) +{ + send_create_table_with_constraints(tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); + recv_create_table_with_constraints(); +} + +void ThriftHiveMetastoreClient::send_create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_table_with_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_with_constraints_pargs args; + args.tbl = &tbl; + args.primaryKeys = &primaryKeys; + args.foreignKeys = &foreignKeys; + args.uniqueConstraints = &uniqueConstraints; + args.notNullConstraints = ¬NullConstraints; + args.defaultConstraints = &defaultConstraints; + args.checkConstraints = &checkConstraints; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_table_with_constraints() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_with_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_table_with_constraints_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::create_table_req(const CreateTableRequest& request) +{ + send_create_table_req(request); + recv_create_table_req(); +} + +void ThriftHiveMetastoreClient::send_create_table_req(const CreateTableRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_table_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_table_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::drop_constraint(const DropConstraintRequest& req) +{ + send_drop_constraint(req); + recv_drop_constraint(); +} + +void ThriftHiveMetastoreClient::send_drop_constraint(const DropConstraintRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_constraint() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::add_primary_key(const AddPrimaryKeyRequest& req) +{ + send_add_primary_key(req); + recv_add_primary_key(); +} + +void ThriftHiveMetastoreClient::send_add_primary_key(const AddPrimaryKeyRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_primary_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_primary_key_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_primary_key() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_primary_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_primary_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::add_foreign_key(const AddForeignKeyRequest& req) +{ + send_add_foreign_key(req); + recv_add_foreign_key(); +} + +void ThriftHiveMetastoreClient::send_add_foreign_key(const AddForeignKeyRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_foreign_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_foreign_key_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_foreign_key() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_foreign_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_foreign_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::add_unique_constraint(const AddUniqueConstraintRequest& req) +{ + send_add_unique_constraint(req); + recv_add_unique_constraint(); +} + +void ThriftHiveMetastoreClient::send_add_unique_constraint(const AddUniqueConstraintRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_unique_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_unique_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_unique_constraint() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_unique_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_unique_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::add_not_null_constraint(const AddNotNullConstraintRequest& req) +{ + send_add_not_null_constraint(req); + recv_add_not_null_constraint(); +} + +void ThriftHiveMetastoreClient::send_add_not_null_constraint(const AddNotNullConstraintRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_not_null_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_not_null_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_not_null_constraint() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_not_null_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_not_null_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::add_default_constraint(const AddDefaultConstraintRequest& req) +{ + send_add_default_constraint(req); + recv_add_default_constraint(); +} + +void ThriftHiveMetastoreClient::send_add_default_constraint(const AddDefaultConstraintRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_default_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_default_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_default_constraint() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_default_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_default_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::add_check_constraint(const AddCheckConstraintRequest& req) +{ + send_add_check_constraint(req); + recv_add_check_constraint(); +} + +void ThriftHiveMetastoreClient::send_add_check_constraint(const AddCheckConstraintRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_check_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_check_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_check_constraint() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_check_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_check_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::translate_table_dryrun(Table& _return, const CreateTableRequest& request) +{ + send_translate_table_dryrun(request); + recv_translate_table_dryrun(_return); +} + +void ThriftHiveMetastoreClient::send_translate_table_dryrun(const CreateTableRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_translate_table_dryrun_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_translate_table_dryrun(Table& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("translate_table_dryrun") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_translate_table_dryrun_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "translate_table_dryrun failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +{ + send_drop_table(dbname, name, deleteData); + recv_drop_table(); +} + +void ThriftHiveMetastoreClient::send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_pargs args; + args.dbname = &dbname; + args.name = &name; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_table() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) +{ + send_drop_table_with_environment_context(dbname, name, deleteData, environment_context); + recv_drop_table_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_with_environment_context_pargs args; + args.dbname = &dbname; + args.name = &name; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_table_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::drop_table_req(const DropTableRequest& dropTableReq) +{ + send_drop_table_req(dropTableReq); + recv_drop_table_req(); +} + +void ThriftHiveMetastoreClient::send_drop_table_req(const DropTableRequest& dropTableReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_req_pargs args; + args.dropTableReq = &dropTableReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_table_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_table_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) +{ + send_truncate_table(dbName, tableName, partNames); + recv_truncate_table(); +} + +void ThriftHiveMetastoreClient::send_truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("truncate_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_truncate_table_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.partNames = &partNames; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_truncate_table() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("truncate_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_truncate_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) +{ + send_truncate_table_req(req); + recv_truncate_table_req(_return); +} + +void ThriftHiveMetastoreClient::send_truncate_table_req(const TruncateTableRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("truncate_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_truncate_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_truncate_table_req(TruncateTableResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("truncate_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_truncate_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "truncate_table_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) +{ + send_get_tables(db_name, pattern); + recv_get_tables(_return); +} + +void ThriftHiveMetastoreClient::send_get_tables(const std::string& db_name, const std::string& pattern) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_pargs args; + args.db_name = &db_name; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_tables(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_tables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) +{ + send_get_tables_by_type(db_name, pattern, tableType); + recv_get_tables_by_type(_return); +} + +void ThriftHiveMetastoreClient::send_get_tables_by_type(const std::string& db_name, const std::string& pattern, const std::string& tableType) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_tables_by_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_by_type_pargs args; + args.db_name = &db_name; + args.pattern = &pattern; + args.tableType = &tableType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_tables_by_type(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables_by_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_tables_by_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables_by_type failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_materialized_view_objects_for_rewriting(std::vector
& _return) +{ + send_get_all_materialized_view_objects_for_rewriting(); + recv_get_all_materialized_view_objects_for_rewriting(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_materialized_view_objects_for_rewriting() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_materialized_view_objects_for_rewriting", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_materialized_view_objects_for_rewriting(std::vector
& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_materialized_view_objects_for_rewriting") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_materialized_view_objects_for_rewriting failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) +{ + send_get_materialized_views_for_rewriting(db_name); + recv_get_materialized_views_for_rewriting(_return); +} + +void ThriftHiveMetastoreClient::send_get_materialized_views_for_rewriting(const std::string& db_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_materialized_views_for_rewriting", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs args; + args.db_name = &db_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_materialized_views_for_rewriting(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_materialized_views_for_rewriting") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_materialized_views_for_rewriting_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_materialized_views_for_rewriting failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) +{ + send_get_table_meta(db_patterns, tbl_patterns, tbl_types); + recv_get_table_meta(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_meta(const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_meta", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_meta_pargs args; + args.db_patterns = &db_patterns; + args.tbl_patterns = &tbl_patterns; + args.tbl_types = &tbl_types; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_meta(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_meta") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_meta_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_meta failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_tables(std::vector & _return, const std::string& db_name) +{ + send_get_all_tables(db_name); + recv_get_all_tables(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_tables(const std::string& db_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_tables_pargs args; + args.db_name = &db_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_tables(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_tables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_tables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_tables failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) +{ + send_get_tables_ext(req); + recv_get_tables_ext(_return); +} + +void ThriftHiveMetastoreClient::send_get_tables_ext(const GetTablesExtRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_tables_ext", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_ext_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_tables_ext(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables_ext") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_tables_ext_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables_ext failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_table_req(GetTableResult& _return, const GetTableRequest& req) +{ + send_get_table_req(req); + recv_get_table_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_req(const GetTableRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_req(GetTableResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) +{ + send_get_table_objects_by_name_req(req); + recv_get_table_objects_by_name_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_objects_by_name_req(const GetTablesRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_objects_by_name_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_objects_by_name_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_objects_by_name_req(GetTablesResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_objects_by_name_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_objects_by_name_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_objects_by_name_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) +{ + send_get_materialization_invalidation_info(creation_metadata, validTxnList); + recv_get_materialization_invalidation_info(_return); +} + +void ThriftHiveMetastoreClient::send_get_materialization_invalidation_info(const CreationMetadata& creation_metadata, const std::string& validTxnList) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_materialization_invalidation_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_materialization_invalidation_info_pargs args; + args.creation_metadata = &creation_metadata; + args.validTxnList = &validTxnList; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_materialization_invalidation_info(Materialization& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_materialization_invalidation_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_materialization_invalidation_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_materialization_invalidation_info failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) +{ + send_update_creation_metadata(catName, dbname, tbl_name, creation_metadata); + recv_update_creation_metadata(); +} + +void ThriftHiveMetastoreClient::send_update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_creation_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_creation_metadata_pargs args; + args.catName = &catName; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.creation_metadata = &creation_metadata; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_creation_metadata() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_creation_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_creation_metadata_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) +{ + send_get_table_names_by_filter(dbname, filter, max_tables); + recv_get_table_names_by_filter(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_names_by_filter(const std::string& dbname, const std::string& filter, const int16_t max_tables) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_names_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_names_by_filter_pargs args; + args.dbname = &dbname; + args.filter = &filter; + args.max_tables = &max_tables; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_names_by_filter(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_names_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_names_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_names_by_filter failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +{ + send_alter_table(dbname, tbl_name, new_tbl); + recv_alter_table(); +} + +void ThriftHiveMetastoreClient::send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_table() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) +{ + send_alter_table_with_environment_context(dbname, tbl_name, new_tbl, environment_context); + recv_alter_table_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_with_environment_context_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_table_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) +{ + send_alter_table_with_cascade(dbname, tbl_name, new_tbl, cascade); + recv_alter_table_with_cascade(); +} + +void ThriftHiveMetastoreClient::send_alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_table_with_cascade", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_with_cascade_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.cascade = &cascade; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_table_with_cascade() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_with_cascade") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_table_with_cascade_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) +{ + send_alter_table_req(req); + recv_alter_table_req(_return); +} + +void ThriftHiveMetastoreClient::send_alter_table_req(const AlterTableRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_table_req(AlterTableResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_table_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_partition(Partition& _return, const Partition& new_part) +{ + send_add_partition(new_part); + recv_add_partition(_return); +} + +void ThriftHiveMetastoreClient::send_add_partition(const Partition& new_part) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partition_pargs args; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_partition(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) +{ + send_add_partition_with_environment_context(new_part, environment_context); + recv_add_partition_with_environment_context(_return); +} + +void ThriftHiveMetastoreClient::send_add_partition_with_environment_context(const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partition_with_environment_context_pargs args; + args.new_part = &new_part; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_partition_with_environment_context(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition_with_environment_context failed: unknown result"); +} + +int32_t ThriftHiveMetastoreClient::add_partitions(const std::vector & new_parts) +{ + send_add_partitions(new_parts); + return recv_add_partitions(); +} + +void ThriftHiveMetastoreClient::send_add_partitions(const std::vector & new_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_pargs args; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t ThriftHiveMetastoreClient::recv_add_partitions() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + ThriftHiveMetastore_add_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions failed: unknown result"); +} + +int32_t ThriftHiveMetastoreClient::add_partitions_pspec(const std::vector & new_parts) +{ + send_add_partitions_pspec(new_parts); + return recv_add_partitions_pspec(); +} + +void ThriftHiveMetastoreClient::send_add_partitions_pspec(const std::vector & new_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_partitions_pspec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_pspec_pargs args; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t ThriftHiveMetastoreClient::recv_add_partitions_pspec() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions_pspec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + ThriftHiveMetastore_add_partitions_pspec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions_pspec failed: unknown result"); +} + +void ThriftHiveMetastoreClient::append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + send_append_partition(db_name, tbl_name, part_vals); + recv_append_partition(_return); +} + +void ThriftHiveMetastoreClient::send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_append_partition(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_append_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) +{ + send_add_partitions_req(request); + recv_add_partitions_req(_return); +} + +void ThriftHiveMetastoreClient::send_add_partitions_req(const AddPartitionsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_partitions_req(AddPartitionsResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) +{ + send_append_partition_with_environment_context(db_name, tbl_name, part_vals, environment_context); + recv_append_partition_with_environment_context(_return); +} + +void ThriftHiveMetastoreClient::send_append_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("append_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_append_partition_with_environment_context(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_append_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_with_environment_context failed: unknown result"); +} + +void ThriftHiveMetastoreClient::append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) +{ + send_append_partition_req(appendPartitionsReq); + recv_append_partition_req(_return); +} + +void ThriftHiveMetastoreClient::send_append_partition_req(const AppendPartitionsRequest& appendPartitionsReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("append_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_req_pargs args; + args.appendPartitionsReq = &appendPartitionsReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_append_partition_req(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_append_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + send_append_partition_by_name(db_name, tbl_name, part_name); + recv_append_partition_by_name(_return); +} + +void ThriftHiveMetastoreClient::send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_append_partition_by_name(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_append_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name failed: unknown result"); +} + +void ThriftHiveMetastoreClient::append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) +{ + send_append_partition_by_name_with_environment_context(db_name, tbl_name, part_name, environment_context); + recv_append_partition_by_name_with_environment_context(_return); +} + +void ThriftHiveMetastoreClient::send_append_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("append_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_append_partition_by_name_with_environment_context(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_by_name_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name_with_environment_context failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +{ + send_drop_partition(db_name, tbl_name, part_vals, deleteData); + return recv_drop_partition(); +} + +void ThriftHiveMetastoreClient::send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_partition() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) +{ + send_drop_partition_with_environment_context(db_name, tbl_name, part_vals, deleteData, environment_context); + return recv_drop_partition_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_partition_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_with_environment_context failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_partition_req(const DropPartitionRequest& dropPartitionReq) +{ + send_drop_partition_req(dropPartitionReq); + return recv_drop_partition_req(); +} + +void ThriftHiveMetastoreClient::send_drop_partition_req(const DropPartitionRequest& dropPartitionReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_req_pargs args; + args.dropPartitionReq = &dropPartitionReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_partition_req() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_req failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +{ + send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData); + return recv_drop_partition_by_name(); +} + +void ThriftHiveMetastoreClient::send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_partition_by_name() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) +{ + send_drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context); + return recv_drop_partition_by_name_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_partition_by_name_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_by_name_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name_with_environment_context failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) +{ + send_drop_partitions_req(req); + recv_drop_partitions_req(_return); +} + +void ThriftHiveMetastoreClient::send_drop_partitions_req(const DropPartitionsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_partitions_req(DropPartitionsResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partitions_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + send_get_partition(db_name, tbl_name, part_vals); + recv_get_partition(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) +{ + send_get_partition_req(req); + recv_get_partition_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_req(const GetPartitionRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_req(GetPartitionResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + send_exchange_partition(partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + recv_exchange_partition(_return); +} + +void ThriftHiveMetastoreClient::send_exchange_partition(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("exchange_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_exchange_partition_pargs args; + args.partitionSpecs = &partitionSpecs; + args.source_db = &source_db; + args.source_table_name = &source_table_name; + args.dest_db = &dest_db; + args.dest_table_name = &dest_table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_exchange_partition(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("exchange_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_exchange_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exchange_partition failed: unknown result"); +} + +void ThriftHiveMetastoreClient::exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + send_exchange_partitions(partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + recv_exchange_partitions(_return); +} + +void ThriftHiveMetastoreClient::send_exchange_partitions(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("exchange_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_exchange_partitions_pargs args; + args.partitionSpecs = &partitionSpecs; + args.source_db = &source_db; + args.source_table_name = &source_table_name; + args.dest_db = &dest_db; + args.dest_table_name = &dest_table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_exchange_partitions(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("exchange_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_exchange_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exchange_partitions failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +{ + send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names); + recv_get_partition_with_auth(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_with_auth(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_with_auth failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + send_get_partition_by_name(db_name, tbl_name, part_name); + recv_get_partition_by_name(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_by_name(Partition& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_by_name failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + send_get_partitions(db_name, tbl_name, max_parts); + recv_get_partitions(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) +{ + send_get_partitions_req(req); + recv_get_partitions_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_req(const PartitionsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_req(PartitionsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names); + recv_get_partitions_with_auth(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_with_auth(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_with_auth failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) +{ + send_get_partitions_pspec(db_name, tbl_name, max_parts); + recv_get_partitions_pspec(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_pspec(const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_pspec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_pspec_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_pspec(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_pspec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_pspec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_pspec failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + send_get_partition_names(db_name, tbl_name, max_parts); + recv_get_partition_names(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_names(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names failed: unknown result"); +} + +void ThriftHiveMetastoreClient::fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) +{ + send_fetch_partition_names_req(partitionReq); + recv_fetch_partition_names_req(_return); +} + +void ThriftHiveMetastoreClient::send_fetch_partition_names_req(const PartitionsRequest& partitionReq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("fetch_partition_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_fetch_partition_names_req_pargs args; + args.partitionReq = &partitionReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_fetch_partition_names_req(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fetch_partition_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_fetch_partition_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetch_partition_names_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) +{ + send_get_partition_values(request); + recv_get_partition_values(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_values(const PartitionValuesRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_values", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_values_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_values(PartitionValuesResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_values") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_values_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_values failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partitions_ps(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_ps(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_ps_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names); + recv_get_partitions_ps_with_auth(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_ps_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps_with_auth failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) +{ + send_get_partitions_ps_with_auth_req(req); + recv_get_partitions_ps_with_auth_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_ps_with_auth_req(const GetPartitionsPsWithAuthRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_ps_with_auth_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps_with_auth_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps_with_auth_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partition_names_ps(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_ps_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_names_ps(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_ps") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_names_ps_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_ps failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) +{ + send_get_partition_names_ps_req(req); + recv_get_partition_names_ps_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_names_ps_req(const GetPartitionNamesPsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_names_ps_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_ps_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_names_ps_req(GetPartitionNamesPsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_ps_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_names_ps_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_ps_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) +{ + send_get_partition_names_req(req); + recv_get_partition_names_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_names_req(const PartitionsByExprRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_names_req(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +{ + send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts); + recv_get_partitions_by_filter(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_by_filter(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_filter failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) +{ + send_get_partitions_by_filter_req(req); + recv_get_partitions_by_filter_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_by_filter_req(const GetPartitionsByFilterRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_by_filter_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_filter_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_by_filter_req(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_filter_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_by_filter_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_filter_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) +{ + send_get_part_specs_by_filter(db_name, tbl_name, filter, max_parts); + recv_get_part_specs_by_filter(_return); +} + +void ThriftHiveMetastoreClient::send_get_part_specs_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_part_specs_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_part_specs_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_part_specs_by_filter(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_part_specs_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_part_specs_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_part_specs_by_filter failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) +{ + send_get_partitions_by_expr(req); + recv_get_partitions_by_expr(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_by_expr(const PartitionsByExprRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_by_expr(PartitionsByExprResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_expr failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) +{ + send_get_partitions_spec_by_expr(req); + recv_get_partitions_spec_by_expr(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_spec_by_expr(const PartitionsByExprRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_spec_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_spec_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_spec_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_spec_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_spec_by_expr failed: unknown result"); +} + +int32_t ThriftHiveMetastoreClient::get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + send_get_num_partitions_by_filter(db_name, tbl_name, filter); + return recv_get_num_partitions_by_filter(); +} + +void ThriftHiveMetastoreClient::send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_num_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t ThriftHiveMetastoreClient::recv_get_num_partitions_by_filter() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_num_partitions_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + ThriftHiveMetastore_get_num_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) +{ + send_get_partitions_by_names(db_name, tbl_name, names); + recv_get_partitions_by_names(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_by_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_names_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.names = &names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_by_names(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_by_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) +{ + send_get_partitions_by_names_req(req); + recv_get_partitions_by_names_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_by_names_req(const GetPartitionsByNamesRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_by_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_names_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_by_names_req(GetPartitionsByNamesResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_by_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) +{ + send_get_properties(req); + recv_get_properties(_return); +} + +void ThriftHiveMetastoreClient::send_get_properties(const PropertyGetRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_properties", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_properties_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_properties(PropertyGetResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_properties") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_properties_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.e1) { + throw result.e1; + } + if (result.__isset.e2) { + throw result.e2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_properties failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::set_properties(const PropertySetRequest& req) +{ + send_set_properties(req); + return recv_set_properties(); +} + +void ThriftHiveMetastoreClient::send_set_properties(const PropertySetRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_properties", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_properties_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_set_properties() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_properties") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_set_properties_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.e1) { + throw result.e1; + } + if (result.__isset.e2) { + throw result.e2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_properties failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) +{ + send_alter_partition(db_name, tbl_name, new_part); + recv_alter_partition(); +} + +void ThriftHiveMetastoreClient::send_alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_partition() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_partition_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) +{ + send_alter_partitions(db_name, tbl_name, new_parts); + recv_alter_partitions(); +} + +void ThriftHiveMetastoreClient::send_alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_partitions() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_partitions_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) +{ + send_alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context); + recv_alter_partitions_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_partitions_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_parts = &new_parts; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_partitions_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_partitions_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) +{ + send_alter_partitions_req(req); + recv_alter_partitions_req(_return); +} + +void ThriftHiveMetastoreClient::send_alter_partitions_req(const AlterPartitionsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_partitions_req(AlterPartitionsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_partitions_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) +{ + send_alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context); + recv_alter_partition_with_environment_context(); +} + +void ThriftHiveMetastoreClient::send_alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_part = &new_part; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_partition_with_environment_context() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_partition_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) +{ + send_rename_partition(db_name, tbl_name, part_vals, new_part); + recv_rename_partition(); +} + +void ThriftHiveMetastoreClient::send_rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_rename_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_rename_partition() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("rename_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_rename_partition_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) +{ + send_rename_partition_req(req); + recv_rename_partition_req(_return); +} + +void ThriftHiveMetastoreClient::send_rename_partition_req(const RenamePartitionRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("rename_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_rename_partition_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_rename_partition_req(RenamePartitionResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("rename_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_rename_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "rename_partition_req failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + send_partition_name_has_valid_characters(part_vals, throw_exception); + return recv_partition_name_has_valid_characters(); +} + +void ThriftHiveMetastoreClient::send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_has_valid_characters_pargs args; + args.part_vals = &part_vals; + args.throw_exception = &throw_exception; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_partition_name_has_valid_characters() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_has_valid_characters") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_partition_name_has_valid_characters_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_has_valid_characters failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) +{ + send_get_config_value(name, defaultValue); + recv_get_config_value(_return); +} + +void ThriftHiveMetastoreClient::send_get_config_value(const std::string& name, const std::string& defaultValue) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_config_value_pargs args; + args.name = &name; + args.defaultValue = &defaultValue; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_config_value(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_config_value") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_config_value_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_config_value failed: unknown result"); +} + +void ThriftHiveMetastoreClient::partition_name_to_vals(std::vector & _return, const std::string& part_name) +{ + send_partition_name_to_vals(part_name); + recv_partition_name_to_vals(_return); +} + +void ThriftHiveMetastoreClient::send_partition_name_to_vals(const std::string& part_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_to_vals_pargs args; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_partition_name_to_vals(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_to_vals") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_partition_name_to_vals_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_vals failed: unknown result"); +} + +void ThriftHiveMetastoreClient::partition_name_to_spec(std::map & _return, const std::string& part_name) +{ + send_partition_name_to_spec(part_name); + recv_partition_name_to_spec(_return); +} + +void ThriftHiveMetastoreClient::send_partition_name_to_spec(const std::string& part_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_to_spec_pargs args; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_partition_name_to_spec(std::map & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_to_spec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_partition_name_to_spec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_spec failed: unknown result"); +} + +void ThriftHiveMetastoreClient::markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + recv_markPartitionForEvent(); +} + +void ThriftHiveMetastoreClient::send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_markPartitionForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_markPartitionForEvent() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("markPartitionForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_markPartitionForEvent_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + if (result.__isset.o5) { + throw result.o5; + } + if (result.__isset.o6) { + throw result.o6; + } + return; +} + +bool ThriftHiveMetastoreClient::isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + return recv_isPartitionMarkedForEvent(); +} + +void ThriftHiveMetastoreClient::send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_isPartitionMarkedForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_isPartitionMarkedForEvent() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("isPartitionMarkedForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_isPartitionMarkedForEvent_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + if (result.__isset.o5) { + throw result.o5; + } + if (result.__isset.o6) { + throw result.o6; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "isPartitionMarkedForEvent failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) +{ + send_get_primary_keys(request); + recv_get_primary_keys(_return); +} + +void ThriftHiveMetastoreClient::send_get_primary_keys(const PrimaryKeysRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_primary_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_primary_keys_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_primary_keys(PrimaryKeysResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_primary_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_primary_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_primary_keys failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) +{ + send_get_foreign_keys(request); + recv_get_foreign_keys(_return); +} + +void ThriftHiveMetastoreClient::send_get_foreign_keys(const ForeignKeysRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_foreign_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_foreign_keys_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_foreign_keys(ForeignKeysResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_foreign_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_foreign_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_foreign_keys failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) +{ + send_get_unique_constraints(request); + recv_get_unique_constraints(_return); +} + +void ThriftHiveMetastoreClient::send_get_unique_constraints(const UniqueConstraintsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_unique_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_unique_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_unique_constraints(UniqueConstraintsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_unique_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_unique_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_unique_constraints failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) +{ + send_get_not_null_constraints(request); + recv_get_not_null_constraints(_return); +} + +void ThriftHiveMetastoreClient::send_get_not_null_constraints(const NotNullConstraintsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_not_null_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_not_null_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_not_null_constraints(NotNullConstraintsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_not_null_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_not_null_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_not_null_constraints failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) +{ + send_get_default_constraints(request); + recv_get_default_constraints(_return); +} + +void ThriftHiveMetastoreClient::send_get_default_constraints(const DefaultConstraintsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_default_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_default_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_default_constraints(DefaultConstraintsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_default_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_default_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_default_constraints failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) +{ + send_get_check_constraints(request); + recv_get_check_constraints(_return); +} + +void ThriftHiveMetastoreClient::send_get_check_constraints(const CheckConstraintsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_check_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_check_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_check_constraints(CheckConstraintsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_check_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_check_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_check_constraints failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) +{ + send_get_all_table_constraints(request); + recv_get_all_table_constraints(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_table_constraints(const AllTableConstraintsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_table_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_table_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_table_constraints(AllTableConstraintsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_table_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_table_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_table_constraints failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::update_table_column_statistics(const ColumnStatistics& stats_obj) +{ + send_update_table_column_statistics(stats_obj); + return recv_update_table_column_statistics(); +} + +void ThriftHiveMetastoreClient::send_update_table_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_table_column_statistics_pargs args; + args.stats_obj = &stats_obj; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_update_table_column_statistics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_update_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_table_column_statistics failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::update_partition_column_statistics(const ColumnStatistics& stats_obj) +{ + send_update_partition_column_statistics(stats_obj); + return recv_update_partition_column_statistics(); +} + +void ThriftHiveMetastoreClient::send_update_partition_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_partition_column_statistics_pargs args; + args.stats_obj = &stats_obj; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_update_partition_column_statistics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_update_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_partition_column_statistics failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) +{ + send_update_table_column_statistics_req(req); + recv_update_table_column_statistics_req(_return); +} + +void ThriftHiveMetastoreClient::send_update_table_column_statistics_req(const SetPartitionsStatsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_table_column_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_table_column_statistics_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_table_column_statistics_req(SetPartitionsStatsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_table_column_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_table_column_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_table_column_statistics_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) +{ + send_update_partition_column_statistics_req(req); + recv_update_partition_column_statistics_req(_return); +} + +void ThriftHiveMetastoreClient::send_update_partition_column_statistics_req(const SetPartitionsStatsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_partition_column_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_partition_column_statistics_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_partition_column_statistics_req(SetPartitionsStatsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_partition_column_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_partition_column_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_partition_column_statistics_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_transaction_statistics(const UpdateTransactionalStatsRequest& req) +{ + send_update_transaction_statistics(req); + recv_update_transaction_statistics(); +} + +void ThriftHiveMetastoreClient::send_update_transaction_statistics(const UpdateTransactionalStatsRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_transaction_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_transaction_statistics_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_transaction_statistics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_transaction_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_transaction_statistics_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) +{ + send_get_table_column_statistics(db_name, tbl_name, col_name); + recv_get_table_column_statistics(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.col_name = &col_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_column_statistics(ColumnStatistics& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_column_statistics failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) +{ + send_get_partition_column_statistics(db_name, tbl_name, part_name, col_name); + recv_get_partition_column_statistics(_return); +} + +void ThriftHiveMetastoreClient::send_get_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.col_name = &col_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partition_column_statistics(ColumnStatistics& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_column_statistics failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) +{ + send_get_table_statistics_req(request); + recv_get_table_statistics_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_table_statistics_req(const TableStatsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_table_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_statistics_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_table_statistics_req(TableStatsResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_table_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_statistics_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) +{ + send_get_partitions_statistics_req(request); + recv_get_partitions_statistics_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_statistics_req(const PartitionsStatsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_statistics_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_statistics_req(PartitionsStatsResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_statistics_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) +{ + send_get_aggr_stats_for(request); + recv_get_aggr_stats_for(_return); +} + +void ThriftHiveMetastoreClient::send_get_aggr_stats_for(const PartitionsStatsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_aggr_stats_for", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_aggr_stats_for_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_aggr_stats_for(AggrStats& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_aggr_stats_for") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_aggr_stats_for_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_aggr_stats_for failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::set_aggr_stats_for(const SetPartitionsStatsRequest& request) +{ + send_set_aggr_stats_for(request); + return recv_set_aggr_stats_for(); +} + +void ThriftHiveMetastoreClient::send_set_aggr_stats_for(const SetPartitionsStatsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_aggr_stats_for", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_aggr_stats_for_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_set_aggr_stats_for() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_aggr_stats_for") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_set_aggr_stats_for_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_aggr_stats_for failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) +{ + send_delete_partition_column_statistics(db_name, tbl_name, part_name, col_name, engine); + return recv_delete_partition_column_statistics(); +} + +void ThriftHiveMetastoreClient::send_delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("delete_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_delete_partition_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.col_name = &col_name; + args.engine = &engine; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_delete_partition_column_statistics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("delete_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_delete_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "delete_partition_column_statistics failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) +{ + send_delete_table_column_statistics(db_name, tbl_name, col_name, engine); + return recv_delete_table_column_statistics(); +} + +void ThriftHiveMetastoreClient::send_delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("delete_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_delete_table_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.col_name = &col_name; + args.engine = &engine; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_delete_table_column_statistics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("delete_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_delete_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "delete_table_column_statistics failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_function(const Function& func) +{ + send_create_function(func); + recv_create_function(); +} + +void ThriftHiveMetastoreClient::send_create_function(const Function& func) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_function_pargs args; + args.func = &func; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_function() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::drop_function(const std::string& dbName, const std::string& funcName) +{ + send_drop_function(dbName, funcName); + recv_drop_function(); +} + +void ThriftHiveMetastoreClient::send_drop_function(const std::string& dbName, const std::string& funcName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_function() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) +{ + send_alter_function(dbName, funcName, newFunc); + recv_alter_function(); +} + +void ThriftHiveMetastoreClient::send_alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.newFunc = &newFunc; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_function() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) +{ + send_get_functions(dbName, pattern); + recv_get_functions(_return); +} + +void ThriftHiveMetastoreClient::send_get_functions(const std::string& dbName, const std::string& pattern) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_functions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_functions_pargs args; + args.dbName = &dbName; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_functions(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_functions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_functions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_functions failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_function(Function& _return, const std::string& dbName, const std::string& funcName) +{ + send_get_function(dbName, funcName); + recv_get_function(_return); +} + +void ThriftHiveMetastoreClient::send_get_function(const std::string& dbName, const std::string& funcName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_function(Function& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_function_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_function failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_functions(GetAllFunctionsResponse& _return) +{ + send_get_all_functions(); + recv_get_all_functions(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_functions() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_functions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_functions_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_functions(GetAllFunctionsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_functions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_functions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_functions failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::create_role(const Role& role) +{ + send_create_role(role); + return recv_create_role(); +} + +void ThriftHiveMetastoreClient::send_create_role(const Role& role) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_role_pargs args; + args.role = &role; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_create_role() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_create_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_role failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::drop_role(const std::string& role_name) +{ + send_drop_role(role_name); + return recv_drop_role(); +} + +void ThriftHiveMetastoreClient::send_drop_role(const std::string& role_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_role_pargs args; + args.role_name = &role_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_drop_role() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_drop_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_role failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_role_names(std::vector & _return) +{ + send_get_role_names(); + recv_get_role_names(_return); +} + +void ThriftHiveMetastoreClient::send_get_role_names() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_role_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_role_names_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_role_names(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_role_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_role_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_role_names failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +{ + send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); + return recv_grant_role(); +} + +void ThriftHiveMetastoreClient::send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.grantor = &grantor; + args.grantorType = &grantorType; + args.grant_option = &grant_option; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_grant_role() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_grant_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_role failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +{ + send_revoke_role(role_name, principal_name, principal_type); + return recv_revoke_role(); +} + +void ThriftHiveMetastoreClient::send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_revoke_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_revoke_role() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("revoke_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_revoke_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_role failed: unknown result"); +} + +void ThriftHiveMetastoreClient::list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) +{ + send_list_roles(principal_name, principal_type); + recv_list_roles(_return); +} + +void ThriftHiveMetastoreClient::send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_list_roles_pargs args; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_list_roles(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("list_roles") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_list_roles_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_roles failed: unknown result"); +} + +void ThriftHiveMetastoreClient::grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) +{ + send_grant_revoke_role(request); + recv_grant_revoke_role(_return); +} + +void ThriftHiveMetastoreClient::send_grant_revoke_role(const GrantRevokeRoleRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("grant_revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_revoke_role_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_grant_revoke_role(GrantRevokeRoleResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_revoke_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_grant_revoke_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_revoke_role failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) +{ + send_get_principals_in_role(request); + recv_get_principals_in_role(_return); +} + +void ThriftHiveMetastoreClient::send_get_principals_in_role(const GetPrincipalsInRoleRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_principals_in_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_principals_in_role_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_principals_in_role(GetPrincipalsInRoleResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_principals_in_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_principals_in_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_principals_in_role failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) +{ + send_get_role_grants_for_principal(request); + recv_get_role_grants_for_principal(_return); +} + +void ThriftHiveMetastoreClient::send_get_role_grants_for_principal(const GetRoleGrantsForPrincipalRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_role_grants_for_principal", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_role_grants_for_principal_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_role_grants_for_principal") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_role_grants_for_principal_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_role_grants_for_principal failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +{ + send_get_privilege_set(hiveObject, user_name, group_names); + recv_get_privilege_set(_return); +} + +void ThriftHiveMetastoreClient::send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_privilege_set_pargs args; + args.hiveObject = &hiveObject; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_privilege_set(PrincipalPrivilegeSet& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_privilege_set") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_privilege_set_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_privilege_set failed: unknown result"); +} + +void ThriftHiveMetastoreClient::list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +{ + send_list_privileges(principal_name, principal_type, hiveObject); + recv_list_privileges(_return); +} + +void ThriftHiveMetastoreClient::send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_list_privileges_pargs args; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.hiveObject = &hiveObject; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_list_privileges(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("list_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_list_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_privileges failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::grant_privileges(const PrivilegeBag& privileges) +{ + send_grant_privileges(privileges); + return recv_grant_privileges(); +} + +void ThriftHiveMetastoreClient::send_grant_privileges(const PrivilegeBag& privileges) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("grant_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_privileges_pargs args; + args.privileges = &privileges; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_grant_privileges() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_grant_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_privileges failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::revoke_privileges(const PrivilegeBag& privileges) +{ + send_revoke_privileges(privileges); + return recv_revoke_privileges(); +} + +void ThriftHiveMetastoreClient::send_revoke_privileges(const PrivilegeBag& privileges) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_revoke_privileges_pargs args; + args.privileges = &privileges; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_revoke_privileges() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("revoke_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_revoke_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_privileges failed: unknown result"); +} + +void ThriftHiveMetastoreClient::grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) +{ + send_grant_revoke_privileges(request); + recv_grant_revoke_privileges(_return); +} + +void ThriftHiveMetastoreClient::send_grant_revoke_privileges(const GrantRevokePrivilegeRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("grant_revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_revoke_privileges_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_grant_revoke_privileges(GrantRevokePrivilegeResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_revoke_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_grant_revoke_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_revoke_privileges failed: unknown result"); +} + +void ThriftHiveMetastoreClient::refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) +{ + send_refresh_privileges(objToRefresh, authorizer, grantRequest); + recv_refresh_privileges(_return); +} + +void ThriftHiveMetastoreClient::send_refresh_privileges(const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("refresh_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_refresh_privileges_pargs args; + args.objToRefresh = &objToRefresh; + args.authorizer = &authorizer; + args.grantRequest = &grantRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_refresh_privileges(GrantRevokePrivilegeResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("refresh_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_refresh_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "refresh_privileges failed: unknown result"); +} + +void ThriftHiveMetastoreClient::set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) +{ + send_set_ugi(user_name, group_names); + recv_set_ugi(_return); +} + +void ThriftHiveMetastoreClient::send_set_ugi(const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_ugi", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_ugi_pargs args; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_set_ugi(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_ugi") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_set_ugi_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_ugi failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) +{ + send_get_delegation_token(token_owner, renewer_kerberos_principal_name); + recv_get_delegation_token(_return); +} + +void ThriftHiveMetastoreClient::send_get_delegation_token(const std::string& token_owner, const std::string& renewer_kerberos_principal_name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_delegation_token_pargs args; + args.token_owner = &token_owner; + args.renewer_kerberos_principal_name = &renewer_kerberos_principal_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_delegation_token(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_delegation_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_delegation_token failed: unknown result"); +} + +int64_t ThriftHiveMetastoreClient::renew_delegation_token(const std::string& token_str_form) +{ + send_renew_delegation_token(token_str_form); + return recv_renew_delegation_token(); +} + +void ThriftHiveMetastoreClient::send_renew_delegation_token(const std::string& token_str_form) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_renew_delegation_token_pargs args; + args.token_str_form = &token_str_form; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t ThriftHiveMetastoreClient::recv_renew_delegation_token() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("renew_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + ThriftHiveMetastore_renew_delegation_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "renew_delegation_token failed: unknown result"); +} + +void ThriftHiveMetastoreClient::cancel_delegation_token(const std::string& token_str_form) +{ + send_cancel_delegation_token(token_str_form); + recv_cancel_delegation_token(); +} + +void ThriftHiveMetastoreClient::send_cancel_delegation_token(const std::string& token_str_form) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cancel_delegation_token_pargs args; + args.token_str_form = &token_str_form; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_cancel_delegation_token() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cancel_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_cancel_delegation_token_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +bool ThriftHiveMetastoreClient::add_token(const std::string& token_identifier, const std::string& delegation_token) +{ + send_add_token(token_identifier, delegation_token); + return recv_add_token(); +} + +void ThriftHiveMetastoreClient::send_add_token(const std::string& token_identifier, const std::string& delegation_token) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_token_pargs args; + args.token_identifier = &token_identifier; + args.delegation_token = &delegation_token; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_add_token() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_add_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_token failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::remove_token(const std::string& token_identifier) +{ + send_remove_token(token_identifier); + return recv_remove_token(); +} + +void ThriftHiveMetastoreClient::send_remove_token(const std::string& token_identifier) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("remove_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_token_pargs args; + args.token_identifier = &token_identifier; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_remove_token() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_remove_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "remove_token failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_token(std::string& _return, const std::string& token_identifier) +{ + send_get_token(token_identifier); + recv_get_token(_return); +} + +void ThriftHiveMetastoreClient::send_get_token(const std::string& token_identifier) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_token_pargs args; + args.token_identifier = &token_identifier; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_token(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_token failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_token_identifiers(std::vector & _return) +{ + send_get_all_token_identifiers(); + recv_get_all_token_identifiers(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_token_identifiers() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_token_identifiers", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_token_identifiers_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_token_identifiers(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_token_identifiers") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_token_identifiers_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_token_identifiers failed: unknown result"); +} + +int32_t ThriftHiveMetastoreClient::add_master_key(const std::string& key) +{ + send_add_master_key(key); + return recv_add_master_key(); +} + +void ThriftHiveMetastoreClient::send_add_master_key(const std::string& key) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_master_key_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t ThriftHiveMetastoreClient::recv_add_master_key() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + ThriftHiveMetastore_add_master_key_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_master_key failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_master_key(const int32_t seq_number, const std::string& key) +{ + send_update_master_key(seq_number, key); + recv_update_master_key(); +} + +void ThriftHiveMetastoreClient::send_update_master_key(const int32_t seq_number, const std::string& key) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_master_key_pargs args; + args.seq_number = &seq_number; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_master_key() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_master_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +bool ThriftHiveMetastoreClient::remove_master_key(const int32_t key_seq) +{ + send_remove_master_key(key_seq); + return recv_remove_master_key(); +} + +void ThriftHiveMetastoreClient::send_remove_master_key(const int32_t key_seq) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("remove_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_master_key_pargs args; + args.key_seq = &key_seq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_remove_master_key() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_remove_master_key_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "remove_master_key failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_master_keys(std::vector & _return) +{ + send_get_master_keys(); + recv_get_master_keys(_return); +} + +void ThriftHiveMetastoreClient::send_get_master_keys() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_master_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_master_keys_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_master_keys(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_master_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_master_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_master_keys failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_open_txns(GetOpenTxnsResponse& _return) +{ + send_get_open_txns(); + recv_get_open_txns(_return); +} + +void ThriftHiveMetastoreClient::send_get_open_txns() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_open_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_open_txns(GetOpenTxnsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_open_txns_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_open_txns_info(GetOpenTxnsInfoResponse& _return) +{ + send_get_open_txns_info(); + recv_get_open_txns_info(_return); +} + +void ThriftHiveMetastoreClient::send_get_open_txns_info() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_open_txns_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_info_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_open_txns_info(GetOpenTxnsInfoResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_open_txns_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns_info failed: unknown result"); +} + +void ThriftHiveMetastoreClient::open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) +{ + send_open_txns(rqst); + recv_open_txns(_return); +} + +void ThriftHiveMetastoreClient::send_open_txns(const OpenTxnRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("open_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_open_txns_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_open_txns(OpenTxnsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("open_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_open_txns_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "open_txns failed: unknown result"); +} + +void ThriftHiveMetastoreClient::abort_txn(const AbortTxnRequest& rqst) +{ + send_abort_txn(rqst); + recv_abort_txn(); +} + +void ThriftHiveMetastoreClient::send_abort_txn(const AbortTxnRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("abort_txn", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_txn_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_abort_txn() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_txn") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_abort_txn_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::abort_txns(const AbortTxnsRequest& rqst) +{ + send_abort_txns(rqst); + recv_abort_txns(); +} + +void ThriftHiveMetastoreClient::send_abort_txns(const AbortTxnsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("abort_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_txns_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_abort_txns() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_abort_txns_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::commit_txn(const CommitTxnRequest& rqst) +{ + send_commit_txn(rqst); + recv_commit_txn(); +} + +void ThriftHiveMetastoreClient::send_commit_txn(const CommitTxnRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("commit_txn", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_commit_txn_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_commit_txn() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("commit_txn") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_commit_txn_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +int64_t ThriftHiveMetastoreClient::get_latest_txnid_in_conflict(const int64_t txnId) +{ + send_get_latest_txnid_in_conflict(txnId); + return recv_get_latest_txnid_in_conflict(); +} + +void ThriftHiveMetastoreClient::send_get_latest_txnid_in_conflict(const int64_t txnId) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_latest_txnid_in_conflict", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs args; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int64_t ThriftHiveMetastoreClient::recv_get_latest_txnid_in_conflict() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_latest_txnid_in_conflict") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int64_t _return; + ThriftHiveMetastore_get_latest_txnid_in_conflict_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_latest_txnid_in_conflict failed: unknown result"); +} + +void ThriftHiveMetastoreClient::repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) +{ + send_repl_tbl_writeid_state(rqst); + recv_repl_tbl_writeid_state(); +} + +void ThriftHiveMetastoreClient::send_repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("repl_tbl_writeid_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_repl_tbl_writeid_state_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_repl_tbl_writeid_state() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("repl_tbl_writeid_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_repl_tbl_writeid_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void ThriftHiveMetastoreClient::get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) +{ + send_get_valid_write_ids(rqst); + recv_get_valid_write_ids(_return); +} + +void ThriftHiveMetastoreClient::send_get_valid_write_ids(const GetValidWriteIdsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_valid_write_ids", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_valid_write_ids_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_valid_write_ids(GetValidWriteIdsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_valid_write_ids") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_valid_write_ids_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_valid_write_ids failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) +{ + send_add_write_ids_to_min_history(txnId, writeIds); + recv_add_write_ids_to_min_history(); +} + +void ThriftHiveMetastoreClient::send_add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_write_ids_to_min_history", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_ids_to_min_history_pargs args; + args.txnId = &txnId; + args.writeIds = &writeIds; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_write_ids_to_min_history() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_ids_to_min_history") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_write_ids_to_min_history_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) +{ + send_allocate_table_write_ids(rqst); + recv_allocate_table_write_ids(_return); +} + +void ThriftHiveMetastoreClient::send_allocate_table_write_ids(const AllocateTableWriteIdsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("allocate_table_write_ids", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_allocate_table_write_ids_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_allocate_table_write_ids(AllocateTableWriteIdsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("allocate_table_write_ids") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_allocate_table_write_ids_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "allocate_table_write_ids failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) +{ + send_get_max_allocated_table_write_id(rqst); + recv_get_max_allocated_table_write_id(_return); +} + +void ThriftHiveMetastoreClient::send_get_max_allocated_table_write_id(const MaxAllocatedTableWriteIdRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_max_allocated_table_write_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_max_allocated_table_write_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_max_allocated_table_write_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_max_allocated_table_write_id_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_max_allocated_table_write_id failed: unknown result"); +} + +void ThriftHiveMetastoreClient::seed_write_id(const SeedTableWriteIdsRequest& rqst) +{ + send_seed_write_id(rqst); + recv_seed_write_id(); +} + +void ThriftHiveMetastoreClient::send_seed_write_id(const SeedTableWriteIdsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("seed_write_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_seed_write_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_seed_write_id() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("seed_write_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_seed_write_id_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::seed_txn_id(const SeedTxnIdRequest& rqst) +{ + send_seed_txn_id(rqst); + recv_seed_txn_id(); +} + +void ThriftHiveMetastoreClient::send_seed_txn_id(const SeedTxnIdRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("seed_txn_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_seed_txn_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_seed_txn_id() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("seed_txn_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_seed_txn_id_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::lock(LockResponse& _return, const LockRequest& rqst) +{ + send_lock(rqst); + recv_lock(_return); +} + +void ThriftHiveMetastoreClient::send_lock(const LockRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("lock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_lock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_lock(LockResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("lock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_lock_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "lock failed: unknown result"); +} + +void ThriftHiveMetastoreClient::check_lock(LockResponse& _return, const CheckLockRequest& rqst) +{ + send_check_lock(rqst); + recv_check_lock(_return); +} + +void ThriftHiveMetastoreClient::send_check_lock(const CheckLockRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("check_lock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_check_lock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_check_lock(LockResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("check_lock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_check_lock_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "check_lock failed: unknown result"); +} + +void ThriftHiveMetastoreClient::unlock(const UnlockRequest& rqst) +{ + send_unlock(rqst); + recv_unlock(); +} + +void ThriftHiveMetastoreClient::send_unlock(const UnlockRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("unlock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_unlock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_unlock() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("unlock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_unlock_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) +{ + send_show_locks(rqst); + recv_show_locks(_return); +} + +void ThriftHiveMetastoreClient::send_show_locks(const ShowLocksRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("show_locks", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_show_locks_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_show_locks(ShowLocksResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("show_locks") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_show_locks_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "show_locks failed: unknown result"); +} + +void ThriftHiveMetastoreClient::heartbeat(const HeartbeatRequest& ids) +{ + send_heartbeat(ids); + recv_heartbeat(); +} + +void ThriftHiveMetastoreClient::send_heartbeat(const HeartbeatRequest& ids) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("heartbeat", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_pargs args; + args.ids = &ids; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_heartbeat() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_heartbeat_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) +{ + send_heartbeat_txn_range(txns); + recv_heartbeat_txn_range(_return); +} + +void ThriftHiveMetastoreClient::send_heartbeat_txn_range(const HeartbeatTxnRangeRequest& txns) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("heartbeat_txn_range", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_txn_range_pargs args; + args.txns = &txns; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_heartbeat_txn_range(HeartbeatTxnRangeResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat_txn_range") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_heartbeat_txn_range_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "heartbeat_txn_range failed: unknown result"); +} + +void ThriftHiveMetastoreClient::compact(const CompactionRequest& rqst) +{ + send_compact(rqst); + recv_compact(); +} + +void ThriftHiveMetastoreClient::send_compact(const CompactionRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_compact_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_compact() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_compact_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void ThriftHiveMetastoreClient::compact2(CompactionResponse& _return, const CompactionRequest& rqst) +{ + send_compact2(rqst); + recv_compact2(_return); +} + +void ThriftHiveMetastoreClient::send_compact2(const CompactionRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("compact2", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_compact2_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_compact2(CompactionResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("compact2") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_compact2_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "compact2 failed: unknown result"); +} + +void ThriftHiveMetastoreClient::show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) +{ + send_show_compact(rqst); + recv_show_compact(_return); +} + +void ThriftHiveMetastoreClient::send_show_compact(const ShowCompactRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("show_compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_show_compact_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_show_compact(ShowCompactResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("show_compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_show_compact_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "show_compact failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) +{ + send_submit_for_cleanup(o1, o2, o3); + return recv_submit_for_cleanup(); +} + +void ThriftHiveMetastoreClient::send_submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("submit_for_cleanup", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_submit_for_cleanup_pargs args; + args.o1 = &o1; + args.o2 = &o2; + args.o3 = &o3; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_submit_for_cleanup() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("submit_for_cleanup") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_submit_for_cleanup_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "submit_for_cleanup failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_dynamic_partitions(const AddDynamicPartitions& rqst) +{ + send_add_dynamic_partitions(rqst); + recv_add_dynamic_partitions(); +} + +void ThriftHiveMetastoreClient::send_add_dynamic_partitions(const AddDynamicPartitions& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_dynamic_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_dynamic_partitions_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_dynamic_partitions() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_dynamic_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_dynamic_partitions_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) +{ + send_find_next_compact(workerId); + recv_find_next_compact(_return); +} + +void ThriftHiveMetastoreClient::send_find_next_compact(const std::string& workerId) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("find_next_compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_next_compact_pargs args; + args.workerId = &workerId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_find_next_compact(OptionalCompactionInfoStruct& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_next_compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_find_next_compact_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_next_compact failed: unknown result"); +} + +void ThriftHiveMetastoreClient::find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) +{ + send_find_next_compact2(rqst); + recv_find_next_compact2(_return); +} + +void ThriftHiveMetastoreClient::send_find_next_compact2(const FindNextCompactRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("find_next_compact2", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_next_compact2_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_find_next_compact2(OptionalCompactionInfoStruct& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_next_compact2") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_find_next_compact2_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_next_compact2 failed: unknown result"); +} + +void ThriftHiveMetastoreClient::update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) +{ + send_update_compactor_state(cr, txn_id); + recv_update_compactor_state(); +} + +void ThriftHiveMetastoreClient::send_update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_compactor_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_compactor_state_pargs args; + args.cr = &cr; + args.txn_id = &txn_id; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_update_compactor_state() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_compactor_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_update_compactor_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void ThriftHiveMetastoreClient::find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) +{ + send_find_columns_with_stats(cr); + recv_find_columns_with_stats(_return); +} + +void ThriftHiveMetastoreClient::send_find_columns_with_stats(const CompactionInfoStruct& cr) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("find_columns_with_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_columns_with_stats_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_find_columns_with_stats(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_columns_with_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_find_columns_with_stats_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_columns_with_stats failed: unknown result"); +} + +void ThriftHiveMetastoreClient::mark_cleaned(const CompactionInfoStruct& cr) +{ + send_mark_cleaned(cr); + recv_mark_cleaned(); +} + +void ThriftHiveMetastoreClient::send_mark_cleaned(const CompactionInfoStruct& cr) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("mark_cleaned", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_cleaned_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_mark_cleaned() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_cleaned") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_mark_cleaned_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::mark_compacted(const CompactionInfoStruct& cr) +{ + send_mark_compacted(cr); + recv_mark_compacted(); +} + +void ThriftHiveMetastoreClient::send_mark_compacted(const CompactionInfoStruct& cr) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("mark_compacted", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_compacted_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_mark_compacted() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_compacted") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_mark_compacted_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::mark_failed(const CompactionInfoStruct& cr) +{ + send_mark_failed(cr); + recv_mark_failed(); +} + +void ThriftHiveMetastoreClient::send_mark_failed(const CompactionInfoStruct& cr) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("mark_failed", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_failed_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_mark_failed() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_failed") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_mark_failed_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::mark_refused(const CompactionInfoStruct& cr) +{ + send_mark_refused(cr); + recv_mark_refused(); +} + +void ThriftHiveMetastoreClient::send_mark_refused(const CompactionInfoStruct& cr) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("mark_refused", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_refused_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_mark_refused() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_refused") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_mark_refused_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +bool ThriftHiveMetastoreClient::update_compaction_metrics_data(const CompactionMetricsDataStruct& data) +{ + send_update_compaction_metrics_data(data); + return recv_update_compaction_metrics_data(); +} + +void ThriftHiveMetastoreClient::send_update_compaction_metrics_data(const CompactionMetricsDataStruct& data) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("update_compaction_metrics_data", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_compaction_metrics_data_pargs args; + args.data = &data; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_update_compaction_metrics_data() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_compaction_metrics_data") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_update_compaction_metrics_data_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_compaction_metrics_data failed: unknown result"); +} + +void ThriftHiveMetastoreClient::remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) +{ + send_remove_compaction_metrics_data(request); + recv_remove_compaction_metrics_data(); +} + +void ThriftHiveMetastoreClient::send_remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("remove_compaction_metrics_data", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_compaction_metrics_data_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_remove_compaction_metrics_data() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_compaction_metrics_data") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_remove_compaction_metrics_data_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) +{ + send_set_hadoop_jobid(jobId, cq_id); + recv_set_hadoop_jobid(); +} + +void ThriftHiveMetastoreClient::send_set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_hadoop_jobid", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_hadoop_jobid_pargs args; + args.jobId = &jobId; + args.cq_id = &cq_id; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_set_hadoop_jobid() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_hadoop_jobid") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_set_hadoop_jobid_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void ThriftHiveMetastoreClient::get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) +{ + send_get_latest_committed_compaction_info(rqst); + recv_get_latest_committed_compaction_info(_return); +} + +void ThriftHiveMetastoreClient::send_get_latest_committed_compaction_info(const GetLatestCommittedCompactionInfoRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_latest_committed_compaction_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_latest_committed_compaction_info_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_latest_committed_compaction_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_latest_committed_compaction_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_latest_committed_compaction_info failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) +{ + send_get_next_notification(rqst); + recv_get_next_notification(_return); +} + +void ThriftHiveMetastoreClient::send_get_next_notification(const NotificationEventRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_next_notification", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_next_notification_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_next_notification(NotificationEventResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_next_notification") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_next_notification_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_next_notification failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_current_notificationEventId(CurrentNotificationEventId& _return) +{ + send_get_current_notificationEventId(); + recv_get_current_notificationEventId(_return); +} + +void ThriftHiveMetastoreClient::send_get_current_notificationEventId() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_current_notificationEventId", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_current_notificationEventId_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_current_notificationEventId(CurrentNotificationEventId& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_current_notificationEventId") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_current_notificationEventId_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_current_notificationEventId failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) +{ + send_get_notification_events_count(rqst); + recv_get_notification_events_count(_return); +} + +void ThriftHiveMetastoreClient::send_get_notification_events_count(const NotificationEventsCountRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_notification_events_count", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_notification_events_count_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_notification_events_count(NotificationEventsCountResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_notification_events_count") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_notification_events_count_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_notification_events_count failed: unknown result"); +} + +void ThriftHiveMetastoreClient::fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) +{ + send_fire_listener_event(rqst); + recv_fire_listener_event(_return); +} + +void ThriftHiveMetastoreClient::send_fire_listener_event(const FireEventRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("fire_listener_event", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_fire_listener_event_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_fire_listener_event(FireEventResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fire_listener_event") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_fire_listener_event_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fire_listener_event failed: unknown result"); +} + +void ThriftHiveMetastoreClient::flushCache() +{ + send_flushCache(); + recv_flushCache(); +} + +void ThriftHiveMetastoreClient::send_flushCache() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("flushCache", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_flushCache_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_flushCache() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("flushCache") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_flushCache_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +void ThriftHiveMetastoreClient::add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) +{ + send_add_write_notification_log(rqst); + recv_add_write_notification_log(_return); +} + +void ThriftHiveMetastoreClient::send_add_write_notification_log(const WriteNotificationLogRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_write_notification_log", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_notification_log_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_write_notification_log(WriteNotificationLogResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_notification_log") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_write_notification_log_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_write_notification_log failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) +{ + send_add_write_notification_log_in_batch(rqst); + recv_add_write_notification_log_in_batch(_return); +} + +void ThriftHiveMetastoreClient::send_add_write_notification_log_in_batch(const WriteNotificationLogBatchRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_write_notification_log_in_batch", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_notification_log_in_batch_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_notification_log_in_batch") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_write_notification_log_in_batch_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_write_notification_log_in_batch failed: unknown result"); +} + +void ThriftHiveMetastoreClient::cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) +{ + send_cm_recycle(request); + recv_cm_recycle(_return); +} + +void ThriftHiveMetastoreClient::send_cm_recycle(const CmRecycleRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("cm_recycle", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cm_recycle_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_cm_recycle(CmRecycleResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cm_recycle") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_cm_recycle_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "cm_recycle failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) +{ + send_get_file_metadata_by_expr(req); + recv_get_file_metadata_by_expr(_return); +} + +void ThriftHiveMetastoreClient::send_get_file_metadata_by_expr(const GetFileMetadataByExprRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_file_metadata_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_file_metadata_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_file_metadata_by_expr(GetFileMetadataByExprResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_file_metadata_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_file_metadata_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_file_metadata_by_expr failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) +{ + send_get_file_metadata(req); + recv_get_file_metadata(_return); +} + +void ThriftHiveMetastoreClient::send_get_file_metadata(const GetFileMetadataRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_file_metadata(GetFileMetadataResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_file_metadata failed: unknown result"); +} + +void ThriftHiveMetastoreClient::put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) +{ + send_put_file_metadata(req); + recv_put_file_metadata(_return); +} + +void ThriftHiveMetastoreClient::send_put_file_metadata(const PutFileMetadataRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("put_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_put_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_put_file_metadata(PutFileMetadataResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("put_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_put_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "put_file_metadata failed: unknown result"); +} + +void ThriftHiveMetastoreClient::clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) +{ + send_clear_file_metadata(req); + recv_clear_file_metadata(_return); +} + +void ThriftHiveMetastoreClient::send_clear_file_metadata(const ClearFileMetadataRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("clear_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_clear_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_clear_file_metadata(ClearFileMetadataResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("clear_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_clear_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "clear_file_metadata failed: unknown result"); +} + +void ThriftHiveMetastoreClient::cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) +{ + send_cache_file_metadata(req); + recv_cache_file_metadata(_return); +} + +void ThriftHiveMetastoreClient::send_cache_file_metadata(const CacheFileMetadataRequest& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("cache_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cache_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_cache_file_metadata(CacheFileMetadataResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cache_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_cache_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "cache_file_metadata failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_metastore_db_uuid(std::string& _return) +{ + send_get_metastore_db_uuid(); + recv_get_metastore_db_uuid(_return); +} + +void ThriftHiveMetastoreClient::send_get_metastore_db_uuid() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_metastore_db_uuid", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_metastore_db_uuid_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_metastore_db_uuid(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_metastore_db_uuid") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_metastore_db_uuid_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_metastore_db_uuid failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) +{ + send_create_resource_plan(request); + recv_create_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_create_resource_plan(const WMCreateResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_resource_plan(WMCreateResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) +{ + send_get_resource_plan(request); + recv_get_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_get_resource_plan(const WMGetResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_resource_plan(WMGetResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) +{ + send_get_active_resource_plan(request); + recv_get_active_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_get_active_resource_plan(const WMGetActiveResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_active_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_active_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_active_resource_plan(WMGetActiveResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_active_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_active_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_active_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) +{ + send_get_all_resource_plans(request); + recv_get_all_resource_plans(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_resource_plans(const WMGetAllResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_resource_plans", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_resource_plans_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_resource_plans(WMGetAllResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_resource_plans") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_resource_plans_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_resource_plans failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) +{ + send_alter_resource_plan(request); + recv_alter_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_alter_resource_plan(const WMAlterResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_resource_plan(WMAlterResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) +{ + send_validate_resource_plan(request); + recv_validate_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_validate_resource_plan(const WMValidateResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("validate_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_validate_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_validate_resource_plan(WMValidateResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("validate_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_validate_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "validate_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) +{ + send_drop_resource_plan(request); + recv_drop_resource_plan(_return); +} + +void ThriftHiveMetastoreClient::send_drop_resource_plan(const WMDropResourcePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_resource_plan(WMDropResourcePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_resource_plan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) +{ + send_create_wm_trigger(request); + recv_create_wm_trigger(_return); +} + +void ThriftHiveMetastoreClient::send_create_wm_trigger(const WMCreateTriggerRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_wm_trigger(WMCreateTriggerResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_wm_trigger failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) +{ + send_alter_wm_trigger(request); + recv_alter_wm_trigger(_return); +} + +void ThriftHiveMetastoreClient::send_alter_wm_trigger(const WMAlterTriggerRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_wm_trigger(WMAlterTriggerResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_wm_trigger failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) +{ + send_drop_wm_trigger(request); + recv_drop_wm_trigger(_return); +} + +void ThriftHiveMetastoreClient::send_drop_wm_trigger(const WMDropTriggerRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_wm_trigger(WMDropTriggerResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_trigger failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) +{ + send_get_triggers_for_resourceplan(request); + recv_get_triggers_for_resourceplan(_return); +} + +void ThriftHiveMetastoreClient::send_get_triggers_for_resourceplan(const WMGetTriggersForResourePlanRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_triggers_for_resourceplan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_triggers_for_resourceplan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_triggers_for_resourceplan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_triggers_for_resourceplan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_triggers_for_resourceplan failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) +{ + send_create_wm_pool(request); + recv_create_wm_pool(_return); +} + +void ThriftHiveMetastoreClient::send_create_wm_pool(const WMCreatePoolRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_wm_pool(WMCreatePoolResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_wm_pool failed: unknown result"); +} + +void ThriftHiveMetastoreClient::alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) +{ + send_alter_wm_pool(request); + recv_alter_wm_pool(_return); +} + +void ThriftHiveMetastoreClient::send_alter_wm_pool(const WMAlterPoolRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_wm_pool(WMAlterPoolResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_wm_pool failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) +{ + send_drop_wm_pool(request); + recv_drop_wm_pool(_return); +} + +void ThriftHiveMetastoreClient::send_drop_wm_pool(const WMDropPoolRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_wm_pool(WMDropPoolResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_pool failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) +{ + send_create_or_update_wm_mapping(request); + recv_create_or_update_wm_mapping(_return); +} + +void ThriftHiveMetastoreClient::send_create_or_update_wm_mapping(const WMCreateOrUpdateMappingRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_or_update_wm_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_or_update_wm_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_or_update_wm_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_or_update_wm_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_or_update_wm_mapping failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) +{ + send_drop_wm_mapping(request); + recv_drop_wm_mapping(_return); +} + +void ThriftHiveMetastoreClient::send_drop_wm_mapping(const WMDropMappingRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_wm_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_wm_mapping(WMDropMappingResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_wm_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_mapping failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) +{ + send_create_or_drop_wm_trigger_to_pool_mapping(request); + recv_create_or_drop_wm_trigger_to_pool_mapping(_return); +} + +void ThriftHiveMetastoreClient::send_create_or_drop_wm_trigger_to_pool_mapping(const WMCreateOrDropTriggerToPoolMappingRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_or_drop_wm_trigger_to_pool_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_or_drop_wm_trigger_to_pool_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_or_drop_wm_trigger_to_pool_mapping failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_ischema(const ISchema& schema) +{ + send_create_ischema(schema); + recv_create_ischema(); +} + +void ThriftHiveMetastoreClient::send_create_ischema(const ISchema& schema) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_ischema_pargs args; + args.schema = &schema; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_ischema() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::alter_ischema(const AlterISchemaRequest& rqst) +{ + send_alter_ischema(rqst); + recv_alter_ischema(); +} + +void ThriftHiveMetastoreClient::send_alter_ischema(const AlterISchemaRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("alter_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_ischema_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_alter_ischema() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_alter_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_ischema(ISchema& _return, const ISchemaName& name) +{ + send_get_ischema(name); + recv_get_ischema(_return); +} + +void ThriftHiveMetastoreClient::send_get_ischema(const ISchemaName& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_ischema_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_ischema(ISchema& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_ischema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_ischema failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_ischema(const ISchemaName& name) +{ + send_drop_ischema(name); + recv_drop_ischema(); +} + +void ThriftHiveMetastoreClient::send_drop_ischema(const ISchemaName& name) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_ischema_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_ischema() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::add_schema_version(const SchemaVersion& schemaVersion) +{ + send_add_schema_version(schemaVersion); + recv_add_schema_version(); +} + +void ThriftHiveMetastoreClient::send_add_schema_version(const SchemaVersion& schemaVersion) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_schema_version() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_schema_version_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) +{ + send_get_schema_version(schemaVersion); + recv_get_schema_version(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema_version(SchemaVersion& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_version_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_version failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) +{ + send_get_schema_latest_version(schemaName); + recv_get_schema_latest_version(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema_latest_version(const ISchemaName& schemaName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema_latest_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_latest_version_pargs args; + args.schemaName = &schemaName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema_latest_version(SchemaVersion& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_latest_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_latest_version_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_latest_version failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) +{ + send_get_schema_all_versions(schemaName); + recv_get_schema_all_versions(_return); +} + +void ThriftHiveMetastoreClient::send_get_schema_all_versions(const ISchemaName& schemaName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schema_all_versions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_all_versions_pargs args; + args.schemaName = &schemaName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schema_all_versions(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_all_versions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schema_all_versions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_all_versions failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + send_drop_schema_version(schemaVersion); + recv_drop_schema_version(); +} + +void ThriftHiveMetastoreClient::send_drop_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_schema_version() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_schema_version_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) +{ + send_get_schemas_by_cols(rqst); + recv_get_schemas_by_cols(_return); +} + +void ThriftHiveMetastoreClient::send_get_schemas_by_cols(const FindSchemasByColsRqst& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_schemas_by_cols", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schemas_by_cols_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_schemas_by_cols(FindSchemasByColsResp& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schemas_by_cols") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_schemas_by_cols_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schemas_by_cols failed: unknown result"); +} + +void ThriftHiveMetastoreClient::map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) +{ + send_map_schema_version_to_serde(rqst); + recv_map_schema_version_to_serde(); +} + +void ThriftHiveMetastoreClient::send_map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("map_schema_version_to_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_map_schema_version_to_serde_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_map_schema_version_to_serde() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("map_schema_version_to_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_map_schema_version_to_serde_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::set_schema_version_state(const SetSchemaVersionStateRequest& rqst) +{ + send_set_schema_version_state(rqst); + recv_set_schema_version_state(); +} + +void ThriftHiveMetastoreClient::send_set_schema_version_state(const SetSchemaVersionStateRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_schema_version_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_schema_version_state_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_set_schema_version_state() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_schema_version_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_set_schema_version_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + return; +} + +void ThriftHiveMetastoreClient::add_serde(const SerDeInfo& serde) +{ + send_add_serde(serde); + recv_add_serde(); +} + +void ThriftHiveMetastoreClient::send_add_serde(const SerDeInfo& serde) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_serde_pargs args; + args.serde = &serde; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_serde() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_serde_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) +{ + send_get_serde(rqst); + recv_get_serde(_return); +} + +void ThriftHiveMetastoreClient::send_get_serde(const GetSerdeRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_serde_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_serde(SerDeInfo& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_serde_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_serde failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + send_get_lock_materialization_rebuild(dbName, tableName, txnId); + recv_get_lock_materialization_rebuild(_return); +} + +void ThriftHiveMetastoreClient::send_get_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_lock_materialization_rebuild", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_lock_materialization_rebuild_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_lock_materialization_rebuild(LockResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_lock_materialization_rebuild") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_lock_materialization_rebuild_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_lock_materialization_rebuild failed: unknown result"); +} + +bool ThriftHiveMetastoreClient::heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + send_heartbeat_lock_materialization_rebuild(dbName, tableName, txnId); + return recv_heartbeat_lock_materialization_rebuild(); +} + +void ThriftHiveMetastoreClient::send_heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("heartbeat_lock_materialization_rebuild", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool ThriftHiveMetastoreClient::recv_heartbeat_lock_materialization_rebuild() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat_lock_materialization_rebuild") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "heartbeat_lock_materialization_rebuild failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_runtime_stats(const RuntimeStat& stat) +{ + send_add_runtime_stats(stat); + recv_add_runtime_stats(); +} + +void ThriftHiveMetastoreClient::send_add_runtime_stats(const RuntimeStat& stat) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_runtime_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_runtime_stats_pargs args; + args.stat = &stat; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_runtime_stats() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_runtime_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_runtime_stats_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) +{ + send_get_runtime_stats(rqst); + recv_get_runtime_stats(_return); +} + +void ThriftHiveMetastoreClient::send_get_runtime_stats(const GetRuntimeStatsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_runtime_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_runtime_stats_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_runtime_stats(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_runtime_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_runtime_stats_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_runtime_stats failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) +{ + send_get_partitions_with_specs(request); + recv_get_partitions_with_specs(_return); +} + +void ThriftHiveMetastoreClient::send_get_partitions_with_specs(const GetPartitionsRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_partitions_with_specs", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_with_specs_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_partitions_with_specs(GetPartitionsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_with_specs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_partitions_with_specs_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_with_specs failed: unknown result"); +} + +void ThriftHiveMetastoreClient::scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) +{ + send_scheduled_query_poll(request); + recv_scheduled_query_poll(_return); +} + +void ThriftHiveMetastoreClient::send_scheduled_query_poll(const ScheduledQueryPollRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("scheduled_query_poll", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_poll_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_scheduled_query_poll(ScheduledQueryPollResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_poll") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_scheduled_query_poll_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "scheduled_query_poll failed: unknown result"); +} + +void ThriftHiveMetastoreClient::scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) +{ + send_scheduled_query_maintenance(request); + recv_scheduled_query_maintenance(); +} + +void ThriftHiveMetastoreClient::send_scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("scheduled_query_maintenance", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_maintenance_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_scheduled_query_maintenance() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_maintenance") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_scheduled_query_maintenance_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + if (result.__isset.o3) { + throw result.o3; + } + if (result.__isset.o4) { + throw result.o4; + } + return; +} + +void ThriftHiveMetastoreClient::scheduled_query_progress(const ScheduledQueryProgressInfo& info) +{ + send_scheduled_query_progress(info); + recv_scheduled_query_progress(); +} + +void ThriftHiveMetastoreClient::send_scheduled_query_progress(const ScheduledQueryProgressInfo& info) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("scheduled_query_progress", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_progress_pargs args; + args.info = &info; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_scheduled_query_progress() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_progress") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_scheduled_query_progress_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) +{ + send_get_scheduled_query(scheduleKey); + recv_get_scheduled_query(_return); +} + +void ThriftHiveMetastoreClient::send_get_scheduled_query(const ScheduledQueryKey& scheduleKey) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_scheduled_query", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_scheduled_query_pargs args; + args.scheduleKey = &scheduleKey; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_scheduled_query(ScheduledQuery& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_scheduled_query") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_scheduled_query_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_scheduled_query failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_replication_metrics(const ReplicationMetricList& replicationMetricList) +{ + send_add_replication_metrics(replicationMetricList); + recv_add_replication_metrics(); +} + +void ThriftHiveMetastoreClient::send_add_replication_metrics(const ReplicationMetricList& replicationMetricList) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_replication_metrics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_replication_metrics_pargs args; + args.replicationMetricList = &replicationMetricList; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_replication_metrics() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_replication_metrics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_replication_metrics_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) +{ + send_get_replication_metrics(rqst); + recv_get_replication_metrics(_return); +} + +void ThriftHiveMetastoreClient::send_get_replication_metrics(const GetReplicationMetricsRequest& rqst) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_replication_metrics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_replication_metrics_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_replication_metrics(ReplicationMetricList& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_replication_metrics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_replication_metrics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_replication_metrics failed: unknown result"); +} + +void ThriftHiveMetastoreClient::get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) +{ + send_get_open_txns_req(getOpenTxnsRequest); + recv_get_open_txns_req(_return); +} + +void ThriftHiveMetastoreClient::send_get_open_txns_req(const GetOpenTxnsRequest& getOpenTxnsRequest) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_open_txns_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_req_pargs args; + args.getOpenTxnsRequest = &getOpenTxnsRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_open_txns_req(GetOpenTxnsResponse& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_open_txns_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns_req failed: unknown result"); +} + +void ThriftHiveMetastoreClient::create_stored_procedure(const StoredProcedure& proc) +{ + send_create_stored_procedure(proc); + recv_create_stored_procedure(); +} + +void ThriftHiveMetastoreClient::send_create_stored_procedure(const StoredProcedure& proc) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("create_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_stored_procedure_pargs args; + args.proc = &proc; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_create_stored_procedure() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_create_stored_procedure_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + return; +} + +void ThriftHiveMetastoreClient::get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) +{ + send_get_stored_procedure(request); + recv_get_stored_procedure(_return); +} + +void ThriftHiveMetastoreClient::send_get_stored_procedure(const StoredProcedureRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_stored_procedure_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_stored_procedure(StoredProcedure& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_stored_procedure_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_stored_procedure failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_stored_procedure(const StoredProcedureRequest& request) +{ + send_drop_stored_procedure(request); + recv_drop_stored_procedure(); +} + +void ThriftHiveMetastoreClient::send_drop_stored_procedure(const StoredProcedureRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_stored_procedure_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_stored_procedure() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_stored_procedure_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) +{ + send_get_all_stored_procedures(request); + recv_get_all_stored_procedures(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_stored_procedures(const ListStoredProcedureRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_stored_procedures", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_stored_procedures_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_stored_procedures(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_stored_procedures") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_stored_procedures_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_stored_procedures failed: unknown result"); +} + +void ThriftHiveMetastoreClient::find_package(Package& _return, const GetPackageRequest& request) +{ + send_find_package(request); + recv_find_package(_return); +} + +void ThriftHiveMetastoreClient::send_find_package(const GetPackageRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("find_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_find_package(Package& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_find_package_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_package failed: unknown result"); +} + +void ThriftHiveMetastoreClient::add_package(const AddPackageRequest& request) +{ + send_add_package(request); + recv_add_package(); +} + +void ThriftHiveMetastoreClient::send_add_package(const AddPackageRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_add_package() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_add_package_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_all_packages(std::vector & _return, const ListPackageRequest& request) +{ + send_get_all_packages(request); + recv_get_all_packages(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_packages(const ListPackageRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_packages", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_packages_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_packages(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_packages") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_packages_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_packages failed: unknown result"); +} + +void ThriftHiveMetastoreClient::drop_package(const DropPackageRequest& request) +{ + send_drop_package(request); + recv_drop_package(); +} + +void ThriftHiveMetastoreClient::send_drop_package(const DropPackageRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("drop_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_drop_package() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_drop_package_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + throw result.o1; + } + return; +} + +void ThriftHiveMetastoreClient::get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) +{ + send_get_all_write_event_info(request); + recv_get_all_write_event_info(_return); +} + +void ThriftHiveMetastoreClient::send_get_all_write_event_info(const GetAllWriteEventInfoRequest& request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_all_write_event_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_write_event_info_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveMetastoreClient::recv_get_all_write_event_info(std::vector & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_write_event_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHiveMetastore_get_all_write_event_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.o1) { + throw result.o1; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_write_event_info failed: unknown result"); +} + +bool ThriftHiveMetastoreProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + return ::facebook::fb303::FacebookServiceProcessor::dispatchCall(iprot, oprot, fname, seqid, callContext); + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void ThriftHiveMetastoreProcessor::process_abort_Compactions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.abort_Compactions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.abort_Compactions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.abort_Compactions"); + } + + ThriftHiveMetastore_abort_Compactions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.abort_Compactions", bytes); + } + + ThriftHiveMetastore_abort_Compactions_result result; + try { + iface_->abort_Compactions(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.abort_Compactions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("abort_Compactions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.abort_Compactions"); + } + + oprot->writeMessageBegin("abort_Compactions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.abort_Compactions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_getMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.getMetaConf", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.getMetaConf"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.getMetaConf"); + } + + ThriftHiveMetastore_getMetaConf_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.getMetaConf", bytes); + } + + ThriftHiveMetastore_getMetaConf_result result; + try { + iface_->getMetaConf(result.success, args.key); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.getMetaConf"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.getMetaConf"); + } + + oprot->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.getMetaConf", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_setMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.setMetaConf", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.setMetaConf"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.setMetaConf"); + } + + ThriftHiveMetastore_setMetaConf_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.setMetaConf", bytes); + } + + ThriftHiveMetastore_setMetaConf_result result; + try { + iface_->setMetaConf(args.key, args.value); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.setMetaConf"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.setMetaConf"); + } + + oprot->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.setMetaConf", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_catalog", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_catalog"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_catalog"); + } + + ThriftHiveMetastore_create_catalog_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_catalog", bytes); + } + + ThriftHiveMetastore_create_catalog_result result; + try { + iface_->create_catalog(args.catalog); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_catalog"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_catalog", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_catalog"); + } + + oprot->writeMessageBegin("create_catalog", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_catalog", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_catalog", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_catalog"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_catalog"); + } + + ThriftHiveMetastore_alter_catalog_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_catalog", bytes); + } + + ThriftHiveMetastore_alter_catalog_result result; + try { + iface_->alter_catalog(args.rqst); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_catalog"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_catalog", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_catalog"); + } + + oprot->writeMessageBegin("alter_catalog", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_catalog", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_catalog", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_catalog"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_catalog"); + } + + ThriftHiveMetastore_get_catalog_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_catalog", bytes); + } + + ThriftHiveMetastore_get_catalog_result result; + try { + iface_->get_catalog(result.success, args.catName); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_catalog"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_catalog", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_catalog"); + } + + oprot->writeMessageBegin("get_catalog", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_catalog", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_catalogs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_catalogs", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_catalogs"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_catalogs"); + } + + ThriftHiveMetastore_get_catalogs_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_catalogs", bytes); + } + + ThriftHiveMetastore_get_catalogs_result result; + try { + iface_->get_catalogs(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_catalogs"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_catalogs", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_catalogs"); + } + + oprot->writeMessageBegin("get_catalogs", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_catalogs", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_catalog", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_catalog"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_catalog"); + } + + ThriftHiveMetastore_drop_catalog_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_catalog", bytes); + } + + ThriftHiveMetastore_drop_catalog_result result; + try { + iface_->drop_catalog(args.catName); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_catalog"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_catalog", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_catalog"); + } + + oprot->writeMessageBegin("drop_catalog", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_catalog", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_database", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_database"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_database"); + } + + ThriftHiveMetastore_create_database_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_database", bytes); + } + + ThriftHiveMetastore_create_database_result result; + try { + iface_->create_database(args.database); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_database"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_database", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_database"); + } + + oprot->writeMessageBegin("create_database", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_database", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_database_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_database_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_database_req"); + } + + ThriftHiveMetastore_create_database_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_database_req", bytes); + } + + ThriftHiveMetastore_create_database_req_result result; + try { + iface_->create_database_req(args.createDatabaseRequest); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_database_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_database_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_database_req"); + } + + oprot->writeMessageBegin("create_database_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_database_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_database", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_database"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_database"); + } + + ThriftHiveMetastore_get_database_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_database", bytes); + } + + ThriftHiveMetastore_get_database_result result; + try { + iface_->get_database(result.success, args.name); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_database"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_database", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_database"); + } + + oprot->writeMessageBegin("get_database", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_database", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_database_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_database_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_database_req"); + } + + ThriftHiveMetastore_get_database_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_database_req", bytes); + } + + ThriftHiveMetastore_get_database_req_result result; + try { + iface_->get_database_req(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_database_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_database_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_database_req"); + } + + oprot->writeMessageBegin("get_database_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_database_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_database", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_database"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_database"); + } + + ThriftHiveMetastore_drop_database_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_database", bytes); + } + + ThriftHiveMetastore_drop_database_result result; + try { + iface_->drop_database(args.name, args.deleteData, args.cascade); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_database"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_database"); + } + + oprot->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_database", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_database_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_database_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_database_req"); + } + + ThriftHiveMetastore_drop_database_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_database_req", bytes); + } + + ThriftHiveMetastore_drop_database_req_result result; + try { + iface_->drop_database_req(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_database_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_database_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_database_req"); + } + + oprot->writeMessageBegin("drop_database_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_database_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_databases(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_databases", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_databases"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_databases"); + } + + ThriftHiveMetastore_get_databases_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_databases", bytes); + } + + ThriftHiveMetastore_get_databases_result result; + try { + iface_->get_databases(result.success, args.pattern); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_databases"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_databases"); + } + + oprot->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_databases", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_databases(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_databases", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_databases"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_databases"); + } + + ThriftHiveMetastore_get_all_databases_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_databases", bytes); + } + + ThriftHiveMetastore_get_all_databases_result result; + try { + iface_->get_all_databases(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_databases"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_databases"); + } + + oprot->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_databases", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_database", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_database"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_database"); + } + + ThriftHiveMetastore_alter_database_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_database", bytes); + } + + ThriftHiveMetastore_alter_database_result result; + try { + iface_->alter_database(args.dbname, args.db); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_database"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_database"); + } + + oprot->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_database", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_database_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_database_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_database_req"); + } + + ThriftHiveMetastore_alter_database_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_database_req", bytes); + } + + ThriftHiveMetastore_alter_database_req_result result; + try { + iface_->alter_database_req(args.alterDbReq); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_database_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_database_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_database_req"); + } + + oprot->writeMessageBegin("alter_database_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_database_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_dataconnector_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_dataconnector_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_dataconnector_req"); + } + + ThriftHiveMetastore_create_dataconnector_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_dataconnector_req", bytes); + } + + ThriftHiveMetastore_create_dataconnector_req_result result; + try { + iface_->create_dataconnector_req(args.connectorReq); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_dataconnector_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_dataconnector_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_dataconnector_req"); + } + + oprot->writeMessageBegin("create_dataconnector_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_dataconnector_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_dataconnector_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_dataconnector_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_dataconnector_req"); + } + + ThriftHiveMetastore_get_dataconnector_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_dataconnector_req", bytes); + } + + ThriftHiveMetastore_get_dataconnector_req_result result; + try { + iface_->get_dataconnector_req(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_dataconnector_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_dataconnector_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_dataconnector_req"); + } + + oprot->writeMessageBegin("get_dataconnector_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_dataconnector_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_dataconnector_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_dataconnector_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_dataconnector_req"); + } + + ThriftHiveMetastore_drop_dataconnector_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_dataconnector_req", bytes); + } + + ThriftHiveMetastore_drop_dataconnector_req_result result; + try { + iface_->drop_dataconnector_req(args.dropDcReq); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_dataconnector_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_dataconnector_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_dataconnector_req"); + } + + oprot->writeMessageBegin("drop_dataconnector_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_dataconnector_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_dataconnectors(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_dataconnectors", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_dataconnectors"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_dataconnectors"); + } + + ThriftHiveMetastore_get_dataconnectors_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_dataconnectors", bytes); + } + + ThriftHiveMetastore_get_dataconnectors_result result; + try { + iface_->get_dataconnectors(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_dataconnectors"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_dataconnectors", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_dataconnectors"); + } + + oprot->writeMessageBegin("get_dataconnectors", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_dataconnectors", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_dataconnector_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_dataconnector_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_dataconnector_req"); + } + + ThriftHiveMetastore_alter_dataconnector_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_dataconnector_req", bytes); + } + + ThriftHiveMetastore_alter_dataconnector_req_result result; + try { + iface_->alter_dataconnector_req(args.alterReq); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_dataconnector_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_dataconnector_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_dataconnector_req"); + } + + oprot->writeMessageBegin("alter_dataconnector_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_dataconnector_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_type", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_type"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_type"); + } + + ThriftHiveMetastore_get_type_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_type", bytes); + } + + ThriftHiveMetastore_get_type_result result; + try { + iface_->get_type(result.success, args.name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_type"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_type", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_type"); + } + + oprot->writeMessageBegin("get_type", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_type", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_type", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_type"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_type"); + } + + ThriftHiveMetastore_create_type_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_type", bytes); + } + + ThriftHiveMetastore_create_type_result result; + try { + result.success = iface_->create_type(args.type); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_type"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_type", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_type"); + } + + oprot->writeMessageBegin("create_type", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_type", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_type", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_type"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_type"); + } + + ThriftHiveMetastore_drop_type_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_type", bytes); + } + + ThriftHiveMetastore_drop_type_result result; + try { + result.success = iface_->drop_type(args.type); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_type"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_type"); + } + + oprot->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_type", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_type_all(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_type_all", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_type_all"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_type_all"); + } + + ThriftHiveMetastore_get_type_all_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_type_all", bytes); + } + + ThriftHiveMetastore_get_type_all_result result; + try { + iface_->get_type_all(result.success, args.name); + result.__isset.success = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_type_all"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_type_all"); + } + + oprot->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_type_all", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_fields(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_fields", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_fields"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_fields"); + } + + ThriftHiveMetastore_get_fields_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_fields", bytes); + } + + ThriftHiveMetastore_get_fields_result result; + try { + iface_->get_fields(result.success, args.db_name, args.table_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_fields"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_fields"); + } + + oprot->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_fields", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_fields_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_fields_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_fields_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_fields_with_environment_context"); + } + + ThriftHiveMetastore_get_fields_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_fields_with_environment_context", bytes); + } + + ThriftHiveMetastore_get_fields_with_environment_context_result result; + try { + iface_->get_fields_with_environment_context(result.success, args.db_name, args.table_name, args.environment_context); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_fields_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_fields_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_fields_with_environment_context"); + } + + oprot->writeMessageBegin("get_fields_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_fields_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_fields_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_fields_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_fields_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_fields_req"); + } + + ThriftHiveMetastore_get_fields_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_fields_req", bytes); + } + + ThriftHiveMetastore_get_fields_req_result result; + try { + iface_->get_fields_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_fields_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_fields_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_fields_req"); + } + + oprot->writeMessageBegin("get_fields_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_fields_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema"); + } + + ThriftHiveMetastore_get_schema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema", bytes); + } + + ThriftHiveMetastore_get_schema_result result; + try { + iface_->get_schema(result.success, args.db_name, args.table_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema"); + } + + oprot->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema_with_environment_context"); + } + + ThriftHiveMetastore_get_schema_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema_with_environment_context", bytes); + } + + ThriftHiveMetastore_get_schema_with_environment_context_result result; + try { + iface_->get_schema_with_environment_context(result.success, args.db_name, args.table_name, args.environment_context); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema_with_environment_context"); + } + + oprot->writeMessageBegin("get_schema_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema_req"); + } + + ThriftHiveMetastore_get_schema_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema_req", bytes); + } + + ThriftHiveMetastore_get_schema_req_result result; + try { + iface_->get_schema_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (UnknownTableException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema_req"); + } + + oprot->writeMessageBegin("get_schema_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_table", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_table"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_table"); + } + + ThriftHiveMetastore_create_table_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_table", bytes); + } + + ThriftHiveMetastore_create_table_result result; + try { + iface_->create_table(args.tbl); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_table"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_table", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_table"); + } + + oprot->writeMessageBegin("create_table", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_table", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_table_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_table_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_table_with_environment_context"); + } + + ThriftHiveMetastore_create_table_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_table_with_environment_context", bytes); + } + + ThriftHiveMetastore_create_table_with_environment_context_result result; + try { + iface_->create_table_with_environment_context(args.tbl, args.environment_context); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_table_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_table_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_table_with_environment_context"); + } + + oprot->writeMessageBegin("create_table_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_table_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_table_with_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_table_with_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_table_with_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_table_with_constraints"); + } + + ThriftHiveMetastore_create_table_with_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_table_with_constraints", bytes); + } + + ThriftHiveMetastore_create_table_with_constraints_result result; + try { + iface_->create_table_with_constraints(args.tbl, args.primaryKeys, args.foreignKeys, args.uniqueConstraints, args.notNullConstraints, args.defaultConstraints, args.checkConstraints); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_table_with_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_table_with_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_table_with_constraints"); + } + + oprot->writeMessageBegin("create_table_with_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_table_with_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_table_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_table_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_table_req"); + } + + ThriftHiveMetastore_create_table_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_table_req", bytes); + } + + ThriftHiveMetastore_create_table_req_result result; + try { + iface_->create_table_req(args.request); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_table_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_table_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_table_req"); + } + + oprot->writeMessageBegin("create_table_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_table_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_constraint", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_constraint"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_constraint"); + } + + ThriftHiveMetastore_drop_constraint_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_constraint", bytes); + } + + ThriftHiveMetastore_drop_constraint_result result; + try { + iface_->drop_constraint(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_constraint"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_constraint", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_constraint"); + } + + oprot->writeMessageBegin("drop_constraint", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_constraint", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_primary_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_primary_key", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_primary_key"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_primary_key"); + } + + ThriftHiveMetastore_add_primary_key_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_primary_key", bytes); + } + + ThriftHiveMetastore_add_primary_key_result result; + try { + iface_->add_primary_key(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_primary_key"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_primary_key", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_primary_key"); + } + + oprot->writeMessageBegin("add_primary_key", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_primary_key", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_foreign_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_foreign_key", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_foreign_key"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_foreign_key"); + } + + ThriftHiveMetastore_add_foreign_key_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_foreign_key", bytes); + } + + ThriftHiveMetastore_add_foreign_key_result result; + try { + iface_->add_foreign_key(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_foreign_key"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_foreign_key", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_foreign_key"); + } + + oprot->writeMessageBegin("add_foreign_key", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_foreign_key", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_unique_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_unique_constraint", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_unique_constraint"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_unique_constraint"); + } + + ThriftHiveMetastore_add_unique_constraint_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_unique_constraint", bytes); + } + + ThriftHiveMetastore_add_unique_constraint_result result; + try { + iface_->add_unique_constraint(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_unique_constraint"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_unique_constraint", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_unique_constraint"); + } + + oprot->writeMessageBegin("add_unique_constraint", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_unique_constraint", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_not_null_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_not_null_constraint", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_not_null_constraint"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_not_null_constraint"); + } + + ThriftHiveMetastore_add_not_null_constraint_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_not_null_constraint", bytes); + } + + ThriftHiveMetastore_add_not_null_constraint_result result; + try { + iface_->add_not_null_constraint(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_not_null_constraint"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_not_null_constraint", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_not_null_constraint"); + } + + oprot->writeMessageBegin("add_not_null_constraint", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_not_null_constraint", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_default_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_default_constraint", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_default_constraint"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_default_constraint"); + } + + ThriftHiveMetastore_add_default_constraint_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_default_constraint", bytes); + } + + ThriftHiveMetastore_add_default_constraint_result result; + try { + iface_->add_default_constraint(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_default_constraint"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_default_constraint", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_default_constraint"); + } + + oprot->writeMessageBegin("add_default_constraint", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_default_constraint", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_check_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_check_constraint", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_check_constraint"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_check_constraint"); + } + + ThriftHiveMetastore_add_check_constraint_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_check_constraint", bytes); + } + + ThriftHiveMetastore_add_check_constraint_result result; + try { + iface_->add_check_constraint(args.req); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_check_constraint"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_check_constraint", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_check_constraint"); + } + + oprot->writeMessageBegin("add_check_constraint", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_check_constraint", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_translate_table_dryrun(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.translate_table_dryrun", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.translate_table_dryrun"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.translate_table_dryrun"); + } + + ThriftHiveMetastore_translate_table_dryrun_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.translate_table_dryrun", bytes); + } + + ThriftHiveMetastore_translate_table_dryrun_result result; + try { + iface_->translate_table_dryrun(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.translate_table_dryrun"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.translate_table_dryrun"); + } + + oprot->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.translate_table_dryrun", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_table", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_table"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_table"); + } + + ThriftHiveMetastore_drop_table_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_table", bytes); + } + + ThriftHiveMetastore_drop_table_result result; + try { + iface_->drop_table(args.dbname, args.name, args.deleteData); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_table"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_table"); + } + + oprot->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_table", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_table_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_table_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_table_with_environment_context"); + } + + ThriftHiveMetastore_drop_table_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_table_with_environment_context", bytes); + } + + ThriftHiveMetastore_drop_table_with_environment_context_result result; + try { + iface_->drop_table_with_environment_context(args.dbname, args.name, args.deleteData, args.environment_context); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_table_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_table_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_table_with_environment_context"); + } + + oprot->writeMessageBegin("drop_table_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_table_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_table_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_table_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_table_req"); + } + + ThriftHiveMetastore_drop_table_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_table_req", bytes); + } + + ThriftHiveMetastore_drop_table_req_result result; + try { + iface_->drop_table_req(args.dropTableReq); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_table_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_table_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_table_req"); + } + + oprot->writeMessageBegin("drop_table_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_table_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_truncate_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.truncate_table", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.truncate_table"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.truncate_table"); + } + + ThriftHiveMetastore_truncate_table_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.truncate_table", bytes); + } + + ThriftHiveMetastore_truncate_table_result result; + try { + iface_->truncate_table(args.dbName, args.tableName, args.partNames); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.truncate_table"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("truncate_table", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.truncate_table"); + } + + oprot->writeMessageBegin("truncate_table", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.truncate_table", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_truncate_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.truncate_table_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.truncate_table_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.truncate_table_req"); + } + + ThriftHiveMetastore_truncate_table_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.truncate_table_req", bytes); + } + + ThriftHiveMetastore_truncate_table_req_result result; + try { + iface_->truncate_table_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.truncate_table_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("truncate_table_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.truncate_table_req"); + } + + oprot->writeMessageBegin("truncate_table_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.truncate_table_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_tables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_tables", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_tables"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_tables"); + } + + ThriftHiveMetastore_get_tables_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_tables", bytes); + } + + ThriftHiveMetastore_get_tables_result result; + try { + iface_->get_tables(result.success, args.db_name, args.pattern); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_tables"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_tables"); + } + + oprot->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_tables", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_tables_by_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_tables_by_type", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_tables_by_type"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_tables_by_type"); + } + + ThriftHiveMetastore_get_tables_by_type_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_tables_by_type", bytes); + } + + ThriftHiveMetastore_get_tables_by_type_result result; + try { + iface_->get_tables_by_type(result.success, args.db_name, args.pattern, args.tableType); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_tables_by_type"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_tables_by_type", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_tables_by_type"); + } + + oprot->writeMessageBegin("get_tables_by_type", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_tables_by_type", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_materialized_view_objects_for_rewriting(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting"); + } + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting", bytes); + } + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result result; + try { + iface_->get_all_materialized_view_objects_for_rewriting(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_materialized_view_objects_for_rewriting", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting"); + } + + oprot->writeMessageBegin("get_all_materialized_view_objects_for_rewriting", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_materialized_view_objects_for_rewriting", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_materialized_views_for_rewriting(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_materialized_views_for_rewriting", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting"); + } + + ThriftHiveMetastore_get_materialized_views_for_rewriting_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting", bytes); + } + + ThriftHiveMetastore_get_materialized_views_for_rewriting_result result; + try { + iface_->get_materialized_views_for_rewriting(result.success, args.db_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_materialized_views_for_rewriting", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting"); + } + + oprot->writeMessageBegin("get_materialized_views_for_rewriting", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_materialized_views_for_rewriting", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_meta(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_meta", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_meta"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_meta"); + } + + ThriftHiveMetastore_get_table_meta_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_meta", bytes); + } + + ThriftHiveMetastore_get_table_meta_result result; + try { + iface_->get_table_meta(result.success, args.db_patterns, args.tbl_patterns, args.tbl_types); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_meta"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_meta", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_meta"); + } + + oprot->writeMessageBegin("get_table_meta", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_meta", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_tables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_tables", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_tables"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_tables"); + } + + ThriftHiveMetastore_get_all_tables_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_tables", bytes); + } + + ThriftHiveMetastore_get_all_tables_result result; + try { + iface_->get_all_tables(result.success, args.db_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_tables"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_tables"); + } + + oprot->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_tables", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_tables_ext(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_tables_ext", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_tables_ext"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_tables_ext"); + } + + ThriftHiveMetastore_get_tables_ext_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_tables_ext", bytes); + } + + ThriftHiveMetastore_get_tables_ext_result result; + try { + iface_->get_tables_ext(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_tables_ext"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_tables_ext", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_tables_ext"); + } + + oprot->writeMessageBegin("get_tables_ext", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_tables_ext", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_req"); + } + + ThriftHiveMetastore_get_table_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_req", bytes); + } + + ThriftHiveMetastore_get_table_req_result result; + try { + iface_->get_table_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_req"); + } + + oprot->writeMessageBegin("get_table_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_objects_by_name_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_objects_by_name_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_objects_by_name_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_objects_by_name_req"); + } + + ThriftHiveMetastore_get_table_objects_by_name_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_objects_by_name_req", bytes); + } + + ThriftHiveMetastore_get_table_objects_by_name_req_result result; + try { + iface_->get_table_objects_by_name_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_objects_by_name_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_objects_by_name_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_objects_by_name_req"); + } + + oprot->writeMessageBegin("get_table_objects_by_name_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_objects_by_name_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_materialization_invalidation_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_materialization_invalidation_info", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_materialization_invalidation_info"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_materialization_invalidation_info"); + } + + ThriftHiveMetastore_get_materialization_invalidation_info_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_materialization_invalidation_info", bytes); + } + + ThriftHiveMetastore_get_materialization_invalidation_info_result result; + try { + iface_->get_materialization_invalidation_info(result.success, args.creation_metadata, args.validTxnList); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_materialization_invalidation_info"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_materialization_invalidation_info", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_materialization_invalidation_info"); + } + + oprot->writeMessageBegin("get_materialization_invalidation_info", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_materialization_invalidation_info", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_creation_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_creation_metadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_creation_metadata"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_creation_metadata"); + } + + ThriftHiveMetastore_update_creation_metadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_creation_metadata", bytes); + } + + ThriftHiveMetastore_update_creation_metadata_result result; + try { + iface_->update_creation_metadata(args.catName, args.dbname, args.tbl_name, args.creation_metadata); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_creation_metadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_creation_metadata", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_creation_metadata"); + } + + oprot->writeMessageBegin("update_creation_metadata", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_creation_metadata", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_names_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_names_by_filter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_names_by_filter"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_names_by_filter"); + } + + ThriftHiveMetastore_get_table_names_by_filter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_names_by_filter", bytes); + } + + ThriftHiveMetastore_get_table_names_by_filter_result result; + try { + iface_->get_table_names_by_filter(result.success, args.dbname, args.filter, args.max_tables); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_names_by_filter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_names_by_filter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_names_by_filter"); + } + + oprot->writeMessageBegin("get_table_names_by_filter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_names_by_filter", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_table", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_table"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_table"); + } + + ThriftHiveMetastore_alter_table_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_table", bytes); + } + + ThriftHiveMetastore_alter_table_result result; + try { + iface_->alter_table(args.dbname, args.tbl_name, args.new_tbl); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_table"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_table"); + } + + oprot->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_table", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_table_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_table_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_table_with_environment_context"); + } + + ThriftHiveMetastore_alter_table_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_table_with_environment_context", bytes); + } + + ThriftHiveMetastore_alter_table_with_environment_context_result result; + try { + iface_->alter_table_with_environment_context(args.dbname, args.tbl_name, args.new_tbl, args.environment_context); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_table_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_table_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_table_with_environment_context"); + } + + oprot->writeMessageBegin("alter_table_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_table_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_table_with_cascade(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_table_with_cascade", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_table_with_cascade"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_table_with_cascade"); + } + + ThriftHiveMetastore_alter_table_with_cascade_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_table_with_cascade", bytes); + } + + ThriftHiveMetastore_alter_table_with_cascade_result result; + try { + iface_->alter_table_with_cascade(args.dbname, args.tbl_name, args.new_tbl, args.cascade); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_table_with_cascade"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_table_with_cascade", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_table_with_cascade"); + } + + oprot->writeMessageBegin("alter_table_with_cascade", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_table_with_cascade", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_table_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_table_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_table_req"); + } + + ThriftHiveMetastore_alter_table_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_table_req", bytes); + } + + ThriftHiveMetastore_alter_table_req_result result; + try { + iface_->alter_table_req(result.success, args.req); + result.__isset.success = true; + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_table_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_table_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_table_req"); + } + + oprot->writeMessageBegin("alter_table_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_table_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_partition"); + } + + ThriftHiveMetastore_add_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_partition", bytes); + } + + ThriftHiveMetastore_add_partition_result result; + try { + iface_->add_partition(result.success, args.new_part); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_partition"); + } + + oprot->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_partition_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_partition_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_partition_with_environment_context"); + } + + ThriftHiveMetastore_add_partition_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_partition_with_environment_context", bytes); + } + + ThriftHiveMetastore_add_partition_with_environment_context_result result; + try { + iface_->add_partition_with_environment_context(result.success, args.new_part, args.environment_context); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_partition_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_partition_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_partition_with_environment_context"); + } + + oprot->writeMessageBegin("add_partition_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_partition_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_partitions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_partitions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_partitions"); + } + + ThriftHiveMetastore_add_partitions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_partitions", bytes); + } + + ThriftHiveMetastore_add_partitions_result result; + try { + result.success = iface_->add_partitions(args.new_parts); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_partitions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_partitions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_partitions"); + } + + oprot->writeMessageBegin("add_partitions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_partitions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_partitions_pspec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_partitions_pspec", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_partitions_pspec"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_partitions_pspec"); + } + + ThriftHiveMetastore_add_partitions_pspec_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_partitions_pspec", bytes); + } + + ThriftHiveMetastore_add_partitions_pspec_result result; + try { + result.success = iface_->add_partitions_pspec(args.new_parts); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_partitions_pspec"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_partitions_pspec", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_partitions_pspec"); + } + + oprot->writeMessageBegin("add_partitions_pspec", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_partitions_pspec", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_append_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.append_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.append_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.append_partition"); + } + + ThriftHiveMetastore_append_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.append_partition", bytes); + } + + ThriftHiveMetastore_append_partition_result result; + try { + iface_->append_partition(result.success, args.db_name, args.tbl_name, args.part_vals); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.append_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.append_partition"); + } + + oprot->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.append_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_partitions_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_partitions_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_partitions_req"); + } + + ThriftHiveMetastore_add_partitions_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_partitions_req", bytes); + } + + ThriftHiveMetastore_add_partitions_req_result result; + try { + iface_->add_partitions_req(result.success, args.request); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_partitions_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_partitions_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_partitions_req"); + } + + oprot->writeMessageBegin("add_partitions_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_partitions_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_append_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.append_partition_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.append_partition_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.append_partition_with_environment_context"); + } + + ThriftHiveMetastore_append_partition_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.append_partition_with_environment_context", bytes); + } + + ThriftHiveMetastore_append_partition_with_environment_context_result result; + try { + iface_->append_partition_with_environment_context(result.success, args.db_name, args.tbl_name, args.part_vals, args.environment_context); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.append_partition_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("append_partition_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.append_partition_with_environment_context"); + } + + oprot->writeMessageBegin("append_partition_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.append_partition_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_append_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.append_partition_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.append_partition_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.append_partition_req"); + } + + ThriftHiveMetastore_append_partition_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.append_partition_req", bytes); + } + + ThriftHiveMetastore_append_partition_req_result result; + try { + iface_->append_partition_req(result.success, args.appendPartitionsReq); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.append_partition_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("append_partition_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.append_partition_req"); + } + + oprot->writeMessageBegin("append_partition_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.append_partition_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_append_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.append_partition_by_name", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.append_partition_by_name"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.append_partition_by_name"); + } + + ThriftHiveMetastore_append_partition_by_name_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.append_partition_by_name", bytes); + } + + ThriftHiveMetastore_append_partition_by_name_result result; + try { + iface_->append_partition_by_name(result.success, args.db_name, args.tbl_name, args.part_name); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.append_partition_by_name"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.append_partition_by_name"); + } + + oprot->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.append_partition_by_name", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_append_partition_by_name_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.append_partition_by_name_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context"); + } + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context", bytes); + } + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_result result; + try { + iface_->append_partition_by_name_with_environment_context(result.success, args.db_name, args.tbl_name, args.part_name, args.environment_context); + result.__isset.success = true; + } catch (InvalidObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (AlreadyExistsException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("append_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context"); + } + + oprot->writeMessageBegin("append_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.append_partition_by_name_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partition"); + } + + ThriftHiveMetastore_drop_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partition", bytes); + } + + ThriftHiveMetastore_drop_partition_result result; + try { + result.success = iface_->drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partition"); + } + + oprot->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partition_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partition_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partition_with_environment_context"); + } + + ThriftHiveMetastore_drop_partition_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partition_with_environment_context", bytes); + } + + ThriftHiveMetastore_drop_partition_with_environment_context_result result; + try { + result.success = iface_->drop_partition_with_environment_context(args.db_name, args.tbl_name, args.part_vals, args.deleteData, args.environment_context); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partition_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partition_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partition_with_environment_context"); + } + + oprot->writeMessageBegin("drop_partition_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partition_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partition_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partition_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partition_req"); + } + + ThriftHiveMetastore_drop_partition_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partition_req", bytes); + } + + ThriftHiveMetastore_drop_partition_req_result result; + try { + result.success = iface_->drop_partition_req(args.dropPartitionReq); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partition_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partition_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partition_req"); + } + + oprot->writeMessageBegin("drop_partition_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partition_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partition_by_name", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partition_by_name"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partition_by_name"); + } + + ThriftHiveMetastore_drop_partition_by_name_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partition_by_name", bytes); + } + + ThriftHiveMetastore_drop_partition_by_name_result result; + try { + result.success = iface_->drop_partition_by_name(args.db_name, args.tbl_name, args.part_name, args.deleteData); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partition_by_name"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partition_by_name"); + } + + oprot->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partition_by_name", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partition_by_name_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partition_by_name_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context"); + } + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context", bytes); + } + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result result; + try { + result.success = iface_->drop_partition_by_name_with_environment_context(args.db_name, args.tbl_name, args.part_name, args.deleteData, args.environment_context); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context"); + } + + oprot->writeMessageBegin("drop_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partition_by_name_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_partitions_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_partitions_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_partitions_req"); + } + + ThriftHiveMetastore_drop_partitions_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_partitions_req", bytes); + } + + ThriftHiveMetastore_drop_partitions_req_result result; + try { + iface_->drop_partitions_req(result.success, args.req); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_partitions_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_partitions_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_partitions_req"); + } + + oprot->writeMessageBegin("drop_partitions_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_partitions_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition"); + } + + ThriftHiveMetastore_get_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition", bytes); + } + + ThriftHiveMetastore_get_partition_result result; + try { + iface_->get_partition(result.success, args.db_name, args.tbl_name, args.part_vals); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition"); + } + + oprot->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_req"); + } + + ThriftHiveMetastore_get_partition_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_req", bytes); + } + + ThriftHiveMetastore_get_partition_req_result result; + try { + iface_->get_partition_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_req"); + } + + oprot->writeMessageBegin("get_partition_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_exchange_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.exchange_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.exchange_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.exchange_partition"); + } + + ThriftHiveMetastore_exchange_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.exchange_partition", bytes); + } + + ThriftHiveMetastore_exchange_partition_result result; + try { + iface_->exchange_partition(result.success, args.partitionSpecs, args.source_db, args.source_table_name, args.dest_db, args.dest_table_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.exchange_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("exchange_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.exchange_partition"); + } + + oprot->writeMessageBegin("exchange_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.exchange_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_exchange_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.exchange_partitions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.exchange_partitions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.exchange_partitions"); + } + + ThriftHiveMetastore_exchange_partitions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.exchange_partitions", bytes); + } + + ThriftHiveMetastore_exchange_partitions_result result; + try { + iface_->exchange_partitions(result.success, args.partitionSpecs, args.source_db, args.source_table_name, args.dest_db, args.dest_table_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.exchange_partitions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("exchange_partitions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.exchange_partitions"); + } + + oprot->writeMessageBegin("exchange_partitions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.exchange_partitions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_with_auth", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_with_auth"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_with_auth"); + } + + ThriftHiveMetastore_get_partition_with_auth_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_with_auth", bytes); + } + + ThriftHiveMetastore_get_partition_with_auth_result result; + try { + iface_->get_partition_with_auth(result.success, args.db_name, args.tbl_name, args.part_vals, args.user_name, args.group_names); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_with_auth"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_with_auth"); + } + + oprot->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_with_auth", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_by_name", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_by_name"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_by_name"); + } + + ThriftHiveMetastore_get_partition_by_name_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_by_name", bytes); + } + + ThriftHiveMetastore_get_partition_by_name_result result; + try { + iface_->get_partition_by_name(result.success, args.db_name, args.tbl_name, args.part_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_by_name"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_by_name"); + } + + oprot->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_by_name", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions"); + } + + ThriftHiveMetastore_get_partitions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions", bytes); + } + + ThriftHiveMetastore_get_partitions_result result; + try { + iface_->get_partitions(result.success, args.db_name, args.tbl_name, args.max_parts); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions"); + } + + oprot->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_req"); + } + + ThriftHiveMetastore_get_partitions_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_req", bytes); + } + + ThriftHiveMetastore_get_partitions_req_result result; + try { + iface_->get_partitions_req(result.success, args.req); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_req"); + } + + oprot->writeMessageBegin("get_partitions_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_with_auth", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_with_auth"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_with_auth"); + } + + ThriftHiveMetastore_get_partitions_with_auth_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_with_auth", bytes); + } + + ThriftHiveMetastore_get_partitions_with_auth_result result; + try { + iface_->get_partitions_with_auth(result.success, args.db_name, args.tbl_name, args.max_parts, args.user_name, args.group_names); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_with_auth"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_with_auth"); + } + + oprot->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_with_auth", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_pspec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_pspec", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_pspec"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_pspec"); + } + + ThriftHiveMetastore_get_partitions_pspec_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_pspec", bytes); + } + + ThriftHiveMetastore_get_partitions_pspec_result result; + try { + iface_->get_partitions_pspec(result.success, args.db_name, args.tbl_name, args.max_parts); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_pspec"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_pspec", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_pspec"); + } + + oprot->writeMessageBegin("get_partitions_pspec", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_pspec", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_names", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_names"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_names"); + } + + ThriftHiveMetastore_get_partition_names_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_names", bytes); + } + + ThriftHiveMetastore_get_partition_names_result result; + try { + iface_->get_partition_names(result.success, args.db_name, args.tbl_name, args.max_parts); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_names"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_names"); + } + + oprot->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_names", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_fetch_partition_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.fetch_partition_names_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.fetch_partition_names_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.fetch_partition_names_req"); + } + + ThriftHiveMetastore_fetch_partition_names_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.fetch_partition_names_req", bytes); + } + + ThriftHiveMetastore_fetch_partition_names_req_result result; + try { + iface_->fetch_partition_names_req(result.success, args.partitionReq); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.fetch_partition_names_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("fetch_partition_names_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.fetch_partition_names_req"); + } + + oprot->writeMessageBegin("fetch_partition_names_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.fetch_partition_names_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_values(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_values", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_values"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_values"); + } + + ThriftHiveMetastore_get_partition_values_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_values", bytes); + } + + ThriftHiveMetastore_get_partition_values_result result; + try { + iface_->get_partition_values(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_values"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_values", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_values"); + } + + oprot->writeMessageBegin("get_partition_values", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_values", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_ps(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_ps", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_ps"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_ps"); + } + + ThriftHiveMetastore_get_partitions_ps_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_ps", bytes); + } + + ThriftHiveMetastore_get_partitions_ps_result result; + try { + iface_->get_partitions_ps(result.success, args.db_name, args.tbl_name, args.part_vals, args.max_parts); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_ps"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_ps"); + } + + oprot->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_ps", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_ps_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_ps_with_auth", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth"); + } + + ThriftHiveMetastore_get_partitions_ps_with_auth_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth", bytes); + } + + ThriftHiveMetastore_get_partitions_ps_with_auth_result result; + try { + iface_->get_partitions_ps_with_auth(result.success, args.db_name, args.tbl_name, args.part_vals, args.max_parts, args.user_name, args.group_names); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth"); + } + + oprot->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_ps_with_auth_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_ps_with_auth_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req"); + } + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req", bytes); + } + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_result result; + try { + iface_->get_partitions_ps_with_auth_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_ps_with_auth_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req"); + } + + oprot->writeMessageBegin("get_partitions_ps_with_auth_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_ps_with_auth_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_names_ps(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_names_ps", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_names_ps"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_names_ps"); + } + + ThriftHiveMetastore_get_partition_names_ps_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_names_ps", bytes); + } + + ThriftHiveMetastore_get_partition_names_ps_result result; + try { + iface_->get_partition_names_ps(result.success, args.db_name, args.tbl_name, args.part_vals, args.max_parts); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_names_ps"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_names_ps"); + } + + oprot->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_names_ps", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_names_ps_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_names_ps_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_names_ps_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_names_ps_req"); + } + + ThriftHiveMetastore_get_partition_names_ps_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_names_ps_req", bytes); + } + + ThriftHiveMetastore_get_partition_names_ps_req_result result; + try { + iface_->get_partition_names_ps_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_names_ps_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_names_ps_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_names_ps_req"); + } + + oprot->writeMessageBegin("get_partition_names_ps_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_names_ps_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_names_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_names_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_names_req"); + } + + ThriftHiveMetastore_get_partition_names_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_names_req", bytes); + } + + ThriftHiveMetastore_get_partition_names_req_result result; + try { + iface_->get_partition_names_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_names_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_names_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_names_req"); + } + + oprot->writeMessageBegin("get_partition_names_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_names_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_by_filter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_by_filter"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_by_filter"); + } + + ThriftHiveMetastore_get_partitions_by_filter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_by_filter", bytes); + } + + ThriftHiveMetastore_get_partitions_by_filter_result result; + try { + iface_->get_partitions_by_filter(result.success, args.db_name, args.tbl_name, args.filter, args.max_parts); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_filter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_by_filter"); + } + + oprot->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_by_filter", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_by_filter_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_by_filter_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_by_filter_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_by_filter_req"); + } + + ThriftHiveMetastore_get_partitions_by_filter_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_by_filter_req", bytes); + } + + ThriftHiveMetastore_get_partitions_by_filter_req_result result; + try { + iface_->get_partitions_by_filter_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_filter_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_by_filter_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_by_filter_req"); + } + + oprot->writeMessageBegin("get_partitions_by_filter_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_by_filter_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_part_specs_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_part_specs_by_filter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_part_specs_by_filter"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_part_specs_by_filter"); + } + + ThriftHiveMetastore_get_part_specs_by_filter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_part_specs_by_filter", bytes); + } + + ThriftHiveMetastore_get_part_specs_by_filter_result result; + try { + iface_->get_part_specs_by_filter(result.success, args.db_name, args.tbl_name, args.filter, args.max_parts); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_part_specs_by_filter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_part_specs_by_filter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_part_specs_by_filter"); + } + + oprot->writeMessageBegin("get_part_specs_by_filter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_part_specs_by_filter", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_by_expr", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_by_expr"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_by_expr"); + } + + ThriftHiveMetastore_get_partitions_by_expr_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_by_expr", bytes); + } + + ThriftHiveMetastore_get_partitions_by_expr_result result; + try { + iface_->get_partitions_by_expr(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_expr"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_by_expr", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_by_expr"); + } + + oprot->writeMessageBegin("get_partitions_by_expr", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_by_expr", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_spec_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_spec_by_expr", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr"); + } + + ThriftHiveMetastore_get_partitions_spec_by_expr_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr", bytes); + } + + ThriftHiveMetastore_get_partitions_spec_by_expr_result result; + try { + iface_->get_partitions_spec_by_expr(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_spec_by_expr", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr"); + } + + oprot->writeMessageBegin("get_partitions_spec_by_expr", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_spec_by_expr", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_num_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_num_partitions_by_filter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + ThriftHiveMetastore_get_num_partitions_by_filter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter", bytes); + } + + ThriftHiveMetastore_get_num_partitions_by_filter_result result; + try { + result.success = iface_->get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + oprot->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_by_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_by_names", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_by_names"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_by_names"); + } + + ThriftHiveMetastore_get_partitions_by_names_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_by_names", bytes); + } + + ThriftHiveMetastore_get_partitions_by_names_result result; + try { + iface_->get_partitions_by_names(result.success, args.db_name, args.tbl_name, args.names); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_names"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_by_names", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_by_names"); + } + + oprot->writeMessageBegin("get_partitions_by_names", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_by_names", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_by_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_by_names_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_by_names_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_by_names_req"); + } + + ThriftHiveMetastore_get_partitions_by_names_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_by_names_req", bytes); + } + + ThriftHiveMetastore_get_partitions_by_names_req_result result; + try { + iface_->get_partitions_by_names_req(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_by_names_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_by_names_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_by_names_req"); + } + + oprot->writeMessageBegin("get_partitions_by_names_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_by_names_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_properties(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_properties", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_properties"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_properties"); + } + + ThriftHiveMetastore_get_properties_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_properties", bytes); + } + + ThriftHiveMetastore_get_properties_result result; + try { + iface_->get_properties(result.success, args.req); + result.__isset.success = true; + } catch (MetaException &e1) { + result.e1 = std::move(e1); + result.__isset.e1 = true; + } catch (NoSuchObjectException &e2) { + result.e2 = std::move(e2); + result.__isset.e2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_properties"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_properties", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_properties"); + } + + oprot->writeMessageBegin("get_properties", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_properties", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_set_properties(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.set_properties", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.set_properties"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.set_properties"); + } + + ThriftHiveMetastore_set_properties_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.set_properties", bytes); + } + + ThriftHiveMetastore_set_properties_result result; + try { + result.success = iface_->set_properties(args.req); + result.__isset.success = true; + } catch (MetaException &e1) { + result.e1 = std::move(e1); + result.__isset.e1 = true; + } catch (NoSuchObjectException &e2) { + result.e2 = std::move(e2); + result.__isset.e2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.set_properties"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_properties", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.set_properties"); + } + + oprot->writeMessageBegin("set_properties", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.set_properties", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_partition"); + } + + ThriftHiveMetastore_alter_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_partition", bytes); + } + + ThriftHiveMetastore_alter_partition_result result; + try { + iface_->alter_partition(args.db_name, args.tbl_name, args.new_part); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_partition"); + } + + oprot->writeMessageBegin("alter_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_partitions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_partitions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_partitions"); + } + + ThriftHiveMetastore_alter_partitions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_partitions", bytes); + } + + ThriftHiveMetastore_alter_partitions_result result; + try { + iface_->alter_partitions(args.db_name, args.tbl_name, args.new_parts); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_partitions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_partitions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_partitions"); + } + + oprot->writeMessageBegin("alter_partitions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_partitions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_partitions_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_partitions_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context"); + } + + ThriftHiveMetastore_alter_partitions_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context", bytes); + } + + ThriftHiveMetastore_alter_partitions_with_environment_context_result result; + try { + iface_->alter_partitions_with_environment_context(args.db_name, args.tbl_name, args.new_parts, args.environment_context); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_partitions_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context"); + } + + oprot->writeMessageBegin("alter_partitions_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_partitions_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_partitions_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_partitions_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_partitions_req"); + } + + ThriftHiveMetastore_alter_partitions_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_partitions_req", bytes); + } + + ThriftHiveMetastore_alter_partitions_req_result result; + try { + iface_->alter_partitions_req(result.success, args.req); + result.__isset.success = true; + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_partitions_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_partitions_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_partitions_req"); + } + + oprot->writeMessageBegin("alter_partitions_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_partitions_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_partition_with_environment_context", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_partition_with_environment_context"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_partition_with_environment_context"); + } + + ThriftHiveMetastore_alter_partition_with_environment_context_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_partition_with_environment_context", bytes); + } + + ThriftHiveMetastore_alter_partition_with_environment_context_result result; + try { + iface_->alter_partition_with_environment_context(args.db_name, args.tbl_name, args.new_part, args.environment_context); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_partition_with_environment_context"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_partition_with_environment_context", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_partition_with_environment_context"); + } + + oprot->writeMessageBegin("alter_partition_with_environment_context", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_partition_with_environment_context", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_rename_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.rename_partition", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.rename_partition"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.rename_partition"); + } + + ThriftHiveMetastore_rename_partition_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.rename_partition", bytes); + } + + ThriftHiveMetastore_rename_partition_result result; + try { + iface_->rename_partition(args.db_name, args.tbl_name, args.part_vals, args.new_part); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.rename_partition"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.rename_partition"); + } + + oprot->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.rename_partition", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_rename_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.rename_partition_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.rename_partition_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.rename_partition_req"); + } + + ThriftHiveMetastore_rename_partition_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.rename_partition_req", bytes); + } + + ThriftHiveMetastore_rename_partition_req_result result; + try { + iface_->rename_partition_req(result.success, args.req); + result.__isset.success = true; + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.rename_partition_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("rename_partition_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.rename_partition_req"); + } + + oprot->writeMessageBegin("rename_partition_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.rename_partition_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_partition_name_has_valid_characters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.partition_name_has_valid_characters", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + ThriftHiveMetastore_partition_name_has_valid_characters_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters", bytes); + } + + ThriftHiveMetastore_partition_name_has_valid_characters_result result; + try { + result.success = iface_->partition_name_has_valid_characters(args.part_vals, args.throw_exception); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters"); + } + + oprot->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.partition_name_has_valid_characters", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_config_value(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_config_value", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_config_value"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_config_value"); + } + + ThriftHiveMetastore_get_config_value_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_config_value", bytes); + } + + ThriftHiveMetastore_get_config_value_result result; + try { + iface_->get_config_value(result.success, args.name, args.defaultValue); + result.__isset.success = true; + } catch (ConfigValSecurityException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_config_value"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_config_value"); + } + + oprot->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_config_value", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_partition_name_to_vals(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.partition_name_to_vals", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.partition_name_to_vals"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.partition_name_to_vals"); + } + + ThriftHiveMetastore_partition_name_to_vals_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.partition_name_to_vals", bytes); + } + + ThriftHiveMetastore_partition_name_to_vals_result result; + try { + iface_->partition_name_to_vals(result.success, args.part_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.partition_name_to_vals"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.partition_name_to_vals"); + } + + oprot->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.partition_name_to_vals", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_partition_name_to_spec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.partition_name_to_spec", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.partition_name_to_spec"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.partition_name_to_spec"); + } + + ThriftHiveMetastore_partition_name_to_spec_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.partition_name_to_spec", bytes); + } + + ThriftHiveMetastore_partition_name_to_spec_result result; + try { + iface_->partition_name_to_spec(result.success, args.part_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.partition_name_to_spec"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.partition_name_to_spec"); + } + + oprot->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.partition_name_to_spec", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_markPartitionForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.markPartitionForEvent", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.markPartitionForEvent"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.markPartitionForEvent"); + } + + ThriftHiveMetastore_markPartitionForEvent_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.markPartitionForEvent", bytes); + } + + ThriftHiveMetastore_markPartitionForEvent_result result; + try { + iface_->markPartitionForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (UnknownTableException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (UnknownPartitionException &o5) { + result.o5 = std::move(o5); + result.__isset.o5 = true; + } catch (InvalidPartitionException &o6) { + result.o6 = std::move(o6); + result.__isset.o6 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.markPartitionForEvent"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.markPartitionForEvent"); + } + + oprot->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.markPartitionForEvent", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_isPartitionMarkedForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.isPartitionMarkedForEvent", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent"); + } + + ThriftHiveMetastore_isPartitionMarkedForEvent_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent", bytes); + } + + ThriftHiveMetastore_isPartitionMarkedForEvent_result result; + try { + result.success = iface_->isPartitionMarkedForEvent(args.db_name, args.tbl_name, args.part_vals, args.eventType); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (UnknownDBException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (UnknownTableException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (UnknownPartitionException &o5) { + result.o5 = std::move(o5); + result.__isset.o5 = true; + } catch (InvalidPartitionException &o6) { + result.o6 = std::move(o6); + result.__isset.o6 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent"); + } + + oprot->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.isPartitionMarkedForEvent", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_primary_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_primary_keys", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_primary_keys"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_primary_keys"); + } + + ThriftHiveMetastore_get_primary_keys_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_primary_keys", bytes); + } + + ThriftHiveMetastore_get_primary_keys_result result; + try { + iface_->get_primary_keys(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_primary_keys"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_primary_keys", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_primary_keys"); + } + + oprot->writeMessageBegin("get_primary_keys", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_primary_keys", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_foreign_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_foreign_keys", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_foreign_keys"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_foreign_keys"); + } + + ThriftHiveMetastore_get_foreign_keys_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_foreign_keys", bytes); + } + + ThriftHiveMetastore_get_foreign_keys_result result; + try { + iface_->get_foreign_keys(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_foreign_keys"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_foreign_keys", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_foreign_keys"); + } + + oprot->writeMessageBegin("get_foreign_keys", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_foreign_keys", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_unique_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_unique_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_unique_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_unique_constraints"); + } + + ThriftHiveMetastore_get_unique_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_unique_constraints", bytes); + } + + ThriftHiveMetastore_get_unique_constraints_result result; + try { + iface_->get_unique_constraints(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_unique_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_unique_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_unique_constraints"); + } + + oprot->writeMessageBegin("get_unique_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_unique_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_not_null_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_not_null_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_not_null_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_not_null_constraints"); + } + + ThriftHiveMetastore_get_not_null_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_not_null_constraints", bytes); + } + + ThriftHiveMetastore_get_not_null_constraints_result result; + try { + iface_->get_not_null_constraints(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_not_null_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_not_null_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_not_null_constraints"); + } + + oprot->writeMessageBegin("get_not_null_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_not_null_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_default_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_default_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_default_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_default_constraints"); + } + + ThriftHiveMetastore_get_default_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_default_constraints", bytes); + } + + ThriftHiveMetastore_get_default_constraints_result result; + try { + iface_->get_default_constraints(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_default_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_default_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_default_constraints"); + } + + oprot->writeMessageBegin("get_default_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_default_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_check_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_check_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_check_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_check_constraints"); + } + + ThriftHiveMetastore_get_check_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_check_constraints", bytes); + } + + ThriftHiveMetastore_get_check_constraints_result result; + try { + iface_->get_check_constraints(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_check_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_check_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_check_constraints"); + } + + oprot->writeMessageBegin("get_check_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_check_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_table_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_table_constraints", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_table_constraints"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_table_constraints"); + } + + ThriftHiveMetastore_get_all_table_constraints_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_table_constraints", bytes); + } + + ThriftHiveMetastore_get_all_table_constraints_result result; + try { + iface_->get_all_table_constraints(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_table_constraints"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_table_constraints", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_table_constraints"); + } + + oprot->writeMessageBegin("get_all_table_constraints", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_table_constraints", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_table_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_table_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_table_column_statistics"); + } + + ThriftHiveMetastore_update_table_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_table_column_statistics", bytes); + } + + ThriftHiveMetastore_update_table_column_statistics_result result; + try { + result.success = iface_->update_table_column_statistics(args.stats_obj); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_table_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_table_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_table_column_statistics"); + } + + oprot->writeMessageBegin("update_table_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_table_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_partition_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_partition_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_partition_column_statistics"); + } + + ThriftHiveMetastore_update_partition_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_partition_column_statistics", bytes); + } + + ThriftHiveMetastore_update_partition_column_statistics_result result; + try { + result.success = iface_->update_partition_column_statistics(args.stats_obj); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_partition_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_partition_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_partition_column_statistics"); + } + + oprot->writeMessageBegin("update_partition_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_partition_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_table_column_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_table_column_statistics_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_table_column_statistics_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_table_column_statistics_req"); + } + + ThriftHiveMetastore_update_table_column_statistics_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_table_column_statistics_req", bytes); + } + + ThriftHiveMetastore_update_table_column_statistics_req_result result; + try { + iface_->update_table_column_statistics_req(result.success, args.req); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_table_column_statistics_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_table_column_statistics_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_table_column_statistics_req"); + } + + oprot->writeMessageBegin("update_table_column_statistics_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_table_column_statistics_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_partition_column_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_partition_column_statistics_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_partition_column_statistics_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_partition_column_statistics_req"); + } + + ThriftHiveMetastore_update_partition_column_statistics_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_partition_column_statistics_req", bytes); + } + + ThriftHiveMetastore_update_partition_column_statistics_req_result result; + try { + iface_->update_partition_column_statistics_req(result.success, args.req); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_partition_column_statistics_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_partition_column_statistics_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_partition_column_statistics_req"); + } + + oprot->writeMessageBegin("update_partition_column_statistics_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_partition_column_statistics_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_transaction_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_transaction_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_transaction_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_transaction_statistics"); + } + + ThriftHiveMetastore_update_transaction_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_transaction_statistics", bytes); + } + + ThriftHiveMetastore_update_transaction_statistics_result result; + try { + iface_->update_transaction_statistics(args.req); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_transaction_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_transaction_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_transaction_statistics"); + } + + oprot->writeMessageBegin("update_transaction_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_transaction_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_column_statistics"); + } + + ThriftHiveMetastore_get_table_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_column_statistics", bytes); + } + + ThriftHiveMetastore_get_table_column_statistics_result result; + try { + iface_->get_table_column_statistics(result.success, args.db_name, args.tbl_name, args.col_name); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidInputException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_column_statistics"); + } + + oprot->writeMessageBegin("get_table_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partition_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partition_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partition_column_statistics"); + } + + ThriftHiveMetastore_get_partition_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partition_column_statistics", bytes); + } + + ThriftHiveMetastore_get_partition_column_statistics_result result; + try { + iface_->get_partition_column_statistics(result.success, args.db_name, args.tbl_name, args.part_name, args.col_name); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidInputException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partition_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partition_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partition_column_statistics"); + } + + oprot->writeMessageBegin("get_partition_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partition_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_table_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_table_statistics_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_table_statistics_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_table_statistics_req"); + } + + ThriftHiveMetastore_get_table_statistics_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_table_statistics_req", bytes); + } + + ThriftHiveMetastore_get_table_statistics_req_result result; + try { + iface_->get_table_statistics_req(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_table_statistics_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_table_statistics_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_table_statistics_req"); + } + + oprot->writeMessageBegin("get_table_statistics_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_table_statistics_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_statistics_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_statistics_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_statistics_req"); + } + + ThriftHiveMetastore_get_partitions_statistics_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_statistics_req", bytes); + } + + ThriftHiveMetastore_get_partitions_statistics_req_result result; + try { + iface_->get_partitions_statistics_req(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_statistics_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_statistics_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_statistics_req"); + } + + oprot->writeMessageBegin("get_partitions_statistics_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_statistics_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_aggr_stats_for(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_aggr_stats_for", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_aggr_stats_for"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_aggr_stats_for"); + } + + ThriftHiveMetastore_get_aggr_stats_for_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_aggr_stats_for", bytes); + } + + ThriftHiveMetastore_get_aggr_stats_for_result result; + try { + iface_->get_aggr_stats_for(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_aggr_stats_for"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_aggr_stats_for", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_aggr_stats_for"); + } + + oprot->writeMessageBegin("get_aggr_stats_for", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_aggr_stats_for", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_set_aggr_stats_for(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.set_aggr_stats_for", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.set_aggr_stats_for"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.set_aggr_stats_for"); + } + + ThriftHiveMetastore_set_aggr_stats_for_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.set_aggr_stats_for", bytes); + } + + ThriftHiveMetastore_set_aggr_stats_for_result result; + try { + result.success = iface_->set_aggr_stats_for(args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.set_aggr_stats_for"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_aggr_stats_for", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.set_aggr_stats_for"); + } + + oprot->writeMessageBegin("set_aggr_stats_for", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.set_aggr_stats_for", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_delete_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.delete_partition_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.delete_partition_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.delete_partition_column_statistics"); + } + + ThriftHiveMetastore_delete_partition_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.delete_partition_column_statistics", bytes); + } + + ThriftHiveMetastore_delete_partition_column_statistics_result result; + try { + result.success = iface_->delete_partition_column_statistics(args.db_name, args.tbl_name, args.part_name, args.col_name, args.engine); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.delete_partition_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("delete_partition_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.delete_partition_column_statistics"); + } + + oprot->writeMessageBegin("delete_partition_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.delete_partition_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_delete_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.delete_table_column_statistics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.delete_table_column_statistics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.delete_table_column_statistics"); + } + + ThriftHiveMetastore_delete_table_column_statistics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.delete_table_column_statistics", bytes); + } + + ThriftHiveMetastore_delete_table_column_statistics_result result; + try { + result.success = iface_->delete_table_column_statistics(args.db_name, args.tbl_name, args.col_name, args.engine); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.delete_table_column_statistics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("delete_table_column_statistics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.delete_table_column_statistics"); + } + + oprot->writeMessageBegin("delete_table_column_statistics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.delete_table_column_statistics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_function", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_function"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_function"); + } + + ThriftHiveMetastore_create_function_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_function", bytes); + } + + ThriftHiveMetastore_create_function_result result; + try { + iface_->create_function(args.func); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (NoSuchObjectException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_function"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_function", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_function"); + } + + oprot->writeMessageBegin("create_function", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_function", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_function", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_function"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_function"); + } + + ThriftHiveMetastore_drop_function_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_function", bytes); + } + + ThriftHiveMetastore_drop_function_result result; + try { + iface_->drop_function(args.dbName, args.funcName); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_function"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_function", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_function"); + } + + oprot->writeMessageBegin("drop_function", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_function", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_function", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_function"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_function"); + } + + ThriftHiveMetastore_alter_function_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_function", bytes); + } + + ThriftHiveMetastore_alter_function_result result; + try { + iface_->alter_function(args.dbName, args.funcName, args.newFunc); + } catch (InvalidOperationException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_function"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_function", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_function"); + } + + oprot->writeMessageBegin("alter_function", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_function", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_functions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_functions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_functions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_functions"); + } + + ThriftHiveMetastore_get_functions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_functions", bytes); + } + + ThriftHiveMetastore_get_functions_result result; + try { + iface_->get_functions(result.success, args.dbName, args.pattern); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_functions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_functions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_functions"); + } + + oprot->writeMessageBegin("get_functions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_functions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_function", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_function"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_function"); + } + + ThriftHiveMetastore_get_function_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_function", bytes); + } + + ThriftHiveMetastore_get_function_result result; + try { + iface_->get_function(result.success, args.dbName, args.funcName); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_function"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_function", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_function"); + } + + oprot->writeMessageBegin("get_function", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_function", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_functions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_functions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_functions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_functions"); + } + + ThriftHiveMetastore_get_all_functions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_functions", bytes); + } + + ThriftHiveMetastore_get_all_functions_result result; + try { + iface_->get_all_functions(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_functions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_functions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_functions"); + } + + oprot->writeMessageBegin("get_all_functions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_functions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_role"); + } + + ThriftHiveMetastore_create_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_role", bytes); + } + + ThriftHiveMetastore_create_role_result result; + try { + result.success = iface_->create_role(args.role); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_role"); + } + + oprot->writeMessageBegin("create_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_role"); + } + + ThriftHiveMetastore_drop_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_role", bytes); + } + + ThriftHiveMetastore_drop_role_result result; + try { + result.success = iface_->drop_role(args.role_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_role"); + } + + oprot->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_role_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_role_names", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_role_names"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_role_names"); + } + + ThriftHiveMetastore_get_role_names_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_role_names", bytes); + } + + ThriftHiveMetastore_get_role_names_result result; + try { + iface_->get_role_names(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_role_names"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_role_names", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_role_names"); + } + + oprot->writeMessageBegin("get_role_names", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_role_names", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_grant_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.grant_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.grant_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.grant_role"); + } + + ThriftHiveMetastore_grant_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.grant_role", bytes); + } + + ThriftHiveMetastore_grant_role_result result; + try { + result.success = iface_->grant_role(args.role_name, args.principal_name, args.principal_type, args.grantor, args.grantorType, args.grant_option); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.grant_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.grant_role"); + } + + oprot->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.grant_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_revoke_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.revoke_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.revoke_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.revoke_role"); + } + + ThriftHiveMetastore_revoke_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.revoke_role", bytes); + } + + ThriftHiveMetastore_revoke_role_result result; + try { + result.success = iface_->revoke_role(args.role_name, args.principal_name, args.principal_type); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.revoke_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.revoke_role"); + } + + oprot->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.revoke_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_list_roles(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.list_roles", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.list_roles"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.list_roles"); + } + + ThriftHiveMetastore_list_roles_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.list_roles", bytes); + } + + ThriftHiveMetastore_list_roles_result result; + try { + iface_->list_roles(result.success, args.principal_name, args.principal_type); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.list_roles"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.list_roles"); + } + + oprot->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.list_roles", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_grant_revoke_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.grant_revoke_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.grant_revoke_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.grant_revoke_role"); + } + + ThriftHiveMetastore_grant_revoke_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.grant_revoke_role", bytes); + } + + ThriftHiveMetastore_grant_revoke_role_result result; + try { + iface_->grant_revoke_role(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.grant_revoke_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("grant_revoke_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.grant_revoke_role"); + } + + oprot->writeMessageBegin("grant_revoke_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.grant_revoke_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_principals_in_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_principals_in_role", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_principals_in_role"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_principals_in_role"); + } + + ThriftHiveMetastore_get_principals_in_role_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_principals_in_role", bytes); + } + + ThriftHiveMetastore_get_principals_in_role_result result; + try { + iface_->get_principals_in_role(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_principals_in_role"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_principals_in_role", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_principals_in_role"); + } + + oprot->writeMessageBegin("get_principals_in_role", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_principals_in_role", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_role_grants_for_principal(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_role_grants_for_principal", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_role_grants_for_principal"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_role_grants_for_principal"); + } + + ThriftHiveMetastore_get_role_grants_for_principal_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_role_grants_for_principal", bytes); + } + + ThriftHiveMetastore_get_role_grants_for_principal_result result; + try { + iface_->get_role_grants_for_principal(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_role_grants_for_principal"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_role_grants_for_principal", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_role_grants_for_principal"); + } + + oprot->writeMessageBegin("get_role_grants_for_principal", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_role_grants_for_principal", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_privilege_set(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_privilege_set", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_privilege_set"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_privilege_set"); + } + + ThriftHiveMetastore_get_privilege_set_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_privilege_set", bytes); + } + + ThriftHiveMetastore_get_privilege_set_result result; + try { + iface_->get_privilege_set(result.success, args.hiveObject, args.user_name, args.group_names); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_privilege_set"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_privilege_set"); + } + + oprot->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_privilege_set", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_list_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.list_privileges", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.list_privileges"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.list_privileges"); + } + + ThriftHiveMetastore_list_privileges_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.list_privileges", bytes); + } + + ThriftHiveMetastore_list_privileges_result result; + try { + iface_->list_privileges(result.success, args.principal_name, args.principal_type, args.hiveObject); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.list_privileges"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.list_privileges"); + } + + oprot->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.list_privileges", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_grant_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.grant_privileges", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.grant_privileges"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.grant_privileges"); + } + + ThriftHiveMetastore_grant_privileges_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.grant_privileges", bytes); + } + + ThriftHiveMetastore_grant_privileges_result result; + try { + result.success = iface_->grant_privileges(args.privileges); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.grant_privileges"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("grant_privileges", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.grant_privileges"); + } + + oprot->writeMessageBegin("grant_privileges", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.grant_privileges", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_revoke_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.revoke_privileges", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.revoke_privileges"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.revoke_privileges"); + } + + ThriftHiveMetastore_revoke_privileges_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.revoke_privileges", bytes); + } + + ThriftHiveMetastore_revoke_privileges_result result; + try { + result.success = iface_->revoke_privileges(args.privileges); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.revoke_privileges"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.revoke_privileges"); + } + + oprot->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.revoke_privileges", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_grant_revoke_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.grant_revoke_privileges", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.grant_revoke_privileges"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.grant_revoke_privileges"); + } + + ThriftHiveMetastore_grant_revoke_privileges_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.grant_revoke_privileges", bytes); + } + + ThriftHiveMetastore_grant_revoke_privileges_result result; + try { + iface_->grant_revoke_privileges(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.grant_revoke_privileges"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("grant_revoke_privileges", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.grant_revoke_privileges"); + } + + oprot->writeMessageBegin("grant_revoke_privileges", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.grant_revoke_privileges", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_refresh_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.refresh_privileges", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.refresh_privileges"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.refresh_privileges"); + } + + ThriftHiveMetastore_refresh_privileges_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.refresh_privileges", bytes); + } + + ThriftHiveMetastore_refresh_privileges_result result; + try { + iface_->refresh_privileges(result.success, args.objToRefresh, args.authorizer, args.grantRequest); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.refresh_privileges"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("refresh_privileges", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.refresh_privileges"); + } + + oprot->writeMessageBegin("refresh_privileges", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.refresh_privileges", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_set_ugi(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.set_ugi", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.set_ugi"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.set_ugi"); + } + + ThriftHiveMetastore_set_ugi_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.set_ugi", bytes); + } + + ThriftHiveMetastore_set_ugi_result result; + try { + iface_->set_ugi(result.success, args.user_name, args.group_names); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.set_ugi"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_ugi", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.set_ugi"); + } + + oprot->writeMessageBegin("set_ugi", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.set_ugi", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_delegation_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_delegation_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_delegation_token"); + } + + ThriftHiveMetastore_get_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_delegation_token", bytes); + } + + ThriftHiveMetastore_get_delegation_token_result result; + try { + iface_->get_delegation_token(result.success, args.token_owner, args.renewer_kerberos_principal_name); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_delegation_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_delegation_token"); + } + + oprot->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_delegation_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_renew_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.renew_delegation_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.renew_delegation_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.renew_delegation_token"); + } + + ThriftHiveMetastore_renew_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.renew_delegation_token", bytes); + } + + ThriftHiveMetastore_renew_delegation_token_result result; + try { + result.success = iface_->renew_delegation_token(args.token_str_form); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.renew_delegation_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.renew_delegation_token"); + } + + oprot->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.renew_delegation_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_cancel_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.cancel_delegation_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.cancel_delegation_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.cancel_delegation_token"); + } + + ThriftHiveMetastore_cancel_delegation_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.cancel_delegation_token", bytes); + } + + ThriftHiveMetastore_cancel_delegation_token_result result; + try { + iface_->cancel_delegation_token(args.token_str_form); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.cancel_delegation_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.cancel_delegation_token"); + } + + oprot->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.cancel_delegation_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_token"); + } + + ThriftHiveMetastore_add_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_token", bytes); + } + + ThriftHiveMetastore_add_token_result result; + try { + result.success = iface_->add_token(args.token_identifier, args.delegation_token); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_token"); + } + + oprot->writeMessageBegin("add_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_remove_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.remove_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.remove_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.remove_token"); + } + + ThriftHiveMetastore_remove_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.remove_token", bytes); + } + + ThriftHiveMetastore_remove_token_result result; + try { + result.success = iface_->remove_token(args.token_identifier); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.remove_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("remove_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.remove_token"); + } + + oprot->writeMessageBegin("remove_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.remove_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_token", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_token"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_token"); + } + + ThriftHiveMetastore_get_token_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_token", bytes); + } + + ThriftHiveMetastore_get_token_result result; + try { + iface_->get_token(result.success, args.token_identifier); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_token"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_token", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_token"); + } + + oprot->writeMessageBegin("get_token", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_token", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_token_identifiers(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_token_identifiers", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_token_identifiers"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_token_identifiers"); + } + + ThriftHiveMetastore_get_all_token_identifiers_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_token_identifiers", bytes); + } + + ThriftHiveMetastore_get_all_token_identifiers_result result; + try { + iface_->get_all_token_identifiers(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_token_identifiers"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_token_identifiers", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_token_identifiers"); + } + + oprot->writeMessageBegin("get_all_token_identifiers", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_token_identifiers", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_master_key", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_master_key"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_master_key"); + } + + ThriftHiveMetastore_add_master_key_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_master_key", bytes); + } + + ThriftHiveMetastore_add_master_key_result result; + try { + result.success = iface_->add_master_key(args.key); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_master_key"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_master_key", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_master_key"); + } + + oprot->writeMessageBegin("add_master_key", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_master_key", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_master_key", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_master_key"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_master_key"); + } + + ThriftHiveMetastore_update_master_key_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_master_key", bytes); + } + + ThriftHiveMetastore_update_master_key_result result; + try { + iface_->update_master_key(args.seq_number, args.key); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_master_key"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_master_key", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_master_key"); + } + + oprot->writeMessageBegin("update_master_key", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_master_key", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_remove_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.remove_master_key", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.remove_master_key"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.remove_master_key"); + } + + ThriftHiveMetastore_remove_master_key_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.remove_master_key", bytes); + } + + ThriftHiveMetastore_remove_master_key_result result; + try { + result.success = iface_->remove_master_key(args.key_seq); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.remove_master_key"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("remove_master_key", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.remove_master_key"); + } + + oprot->writeMessageBegin("remove_master_key", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.remove_master_key", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_master_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_master_keys", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_master_keys"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_master_keys"); + } + + ThriftHiveMetastore_get_master_keys_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_master_keys", bytes); + } + + ThriftHiveMetastore_get_master_keys_result result; + try { + iface_->get_master_keys(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_master_keys"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_master_keys", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_master_keys"); + } + + oprot->writeMessageBegin("get_master_keys", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_master_keys", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_open_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_open_txns", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_open_txns"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_open_txns"); + } + + ThriftHiveMetastore_get_open_txns_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_open_txns", bytes); + } + + ThriftHiveMetastore_get_open_txns_result result; + try { + iface_->get_open_txns(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_open_txns"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_open_txns", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_open_txns"); + } + + oprot->writeMessageBegin("get_open_txns", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_open_txns", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_open_txns_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_open_txns_info", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_open_txns_info"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_open_txns_info"); + } + + ThriftHiveMetastore_get_open_txns_info_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_open_txns_info", bytes); + } + + ThriftHiveMetastore_get_open_txns_info_result result; + try { + iface_->get_open_txns_info(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_open_txns_info"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_open_txns_info", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_open_txns_info"); + } + + oprot->writeMessageBegin("get_open_txns_info", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_open_txns_info", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_open_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.open_txns", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.open_txns"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.open_txns"); + } + + ThriftHiveMetastore_open_txns_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.open_txns", bytes); + } + + ThriftHiveMetastore_open_txns_result result; + try { + iface_->open_txns(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.open_txns"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("open_txns", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.open_txns"); + } + + oprot->writeMessageBegin("open_txns", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.open_txns", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_abort_txn(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.abort_txn", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.abort_txn"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.abort_txn"); + } + + ThriftHiveMetastore_abort_txn_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.abort_txn", bytes); + } + + ThriftHiveMetastore_abort_txn_result result; + try { + iface_->abort_txn(args.rqst); + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.abort_txn"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("abort_txn", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.abort_txn"); + } + + oprot->writeMessageBegin("abort_txn", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.abort_txn", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_abort_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.abort_txns", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.abort_txns"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.abort_txns"); + } + + ThriftHiveMetastore_abort_txns_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.abort_txns", bytes); + } + + ThriftHiveMetastore_abort_txns_result result; + try { + iface_->abort_txns(args.rqst); + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.abort_txns"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("abort_txns", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.abort_txns"); + } + + oprot->writeMessageBegin("abort_txns", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.abort_txns", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_commit_txn(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.commit_txn", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.commit_txn"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.commit_txn"); + } + + ThriftHiveMetastore_commit_txn_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.commit_txn", bytes); + } + + ThriftHiveMetastore_commit_txn_result result; + try { + iface_->commit_txn(args.rqst); + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnAbortedException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.commit_txn"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("commit_txn", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.commit_txn"); + } + + oprot->writeMessageBegin("commit_txn", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.commit_txn", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_latest_txnid_in_conflict(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_latest_txnid_in_conflict", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict"); + } + + ThriftHiveMetastore_get_latest_txnid_in_conflict_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict", bytes); + } + + ThriftHiveMetastore_get_latest_txnid_in_conflict_result result; + try { + result.success = iface_->get_latest_txnid_in_conflict(args.txnId); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_latest_txnid_in_conflict", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict"); + } + + oprot->writeMessageBegin("get_latest_txnid_in_conflict", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_latest_txnid_in_conflict", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_repl_tbl_writeid_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.repl_tbl_writeid_state", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.repl_tbl_writeid_state"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.repl_tbl_writeid_state"); + } + + ThriftHiveMetastore_repl_tbl_writeid_state_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.repl_tbl_writeid_state", bytes); + } + + ThriftHiveMetastore_repl_tbl_writeid_state_result result; + try { + iface_->repl_tbl_writeid_state(args.rqst); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.repl_tbl_writeid_state"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("repl_tbl_writeid_state", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.repl_tbl_writeid_state"); + } + + oprot->writeMessageBegin("repl_tbl_writeid_state", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.repl_tbl_writeid_state", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_valid_write_ids(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_valid_write_ids", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_valid_write_ids"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_valid_write_ids"); + } + + ThriftHiveMetastore_get_valid_write_ids_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_valid_write_ids", bytes); + } + + ThriftHiveMetastore_get_valid_write_ids_result result; + try { + iface_->get_valid_write_ids(result.success, args.rqst); + result.__isset.success = true; + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_valid_write_ids"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_valid_write_ids", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_valid_write_ids"); + } + + oprot->writeMessageBegin("get_valid_write_ids", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_valid_write_ids", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_write_ids_to_min_history(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_write_ids_to_min_history", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_write_ids_to_min_history"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_write_ids_to_min_history"); + } + + ThriftHiveMetastore_add_write_ids_to_min_history_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_write_ids_to_min_history", bytes); + } + + ThriftHiveMetastore_add_write_ids_to_min_history_result result; + try { + iface_->add_write_ids_to_min_history(args.txnId, args.writeIds); + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_write_ids_to_min_history"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_write_ids_to_min_history", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_write_ids_to_min_history"); + } + + oprot->writeMessageBegin("add_write_ids_to_min_history", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_write_ids_to_min_history", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_allocate_table_write_ids(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.allocate_table_write_ids", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.allocate_table_write_ids"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.allocate_table_write_ids"); + } + + ThriftHiveMetastore_allocate_table_write_ids_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.allocate_table_write_ids", bytes); + } + + ThriftHiveMetastore_allocate_table_write_ids_result result; + try { + iface_->allocate_table_write_ids(result.success, args.rqst); + result.__isset.success = true; + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnAbortedException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.allocate_table_write_ids"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("allocate_table_write_ids", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.allocate_table_write_ids"); + } + + oprot->writeMessageBegin("allocate_table_write_ids", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.allocate_table_write_ids", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_max_allocated_table_write_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_max_allocated_table_write_id", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id"); + } + + ThriftHiveMetastore_get_max_allocated_table_write_id_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id", bytes); + } + + ThriftHiveMetastore_get_max_allocated_table_write_id_result result; + try { + iface_->get_max_allocated_table_write_id(result.success, args.rqst); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_max_allocated_table_write_id", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id"); + } + + oprot->writeMessageBegin("get_max_allocated_table_write_id", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_max_allocated_table_write_id", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_seed_write_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.seed_write_id", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.seed_write_id"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.seed_write_id"); + } + + ThriftHiveMetastore_seed_write_id_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.seed_write_id", bytes); + } + + ThriftHiveMetastore_seed_write_id_result result; + try { + iface_->seed_write_id(args.rqst); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.seed_write_id"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("seed_write_id", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.seed_write_id"); + } + + oprot->writeMessageBegin("seed_write_id", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.seed_write_id", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_seed_txn_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.seed_txn_id", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.seed_txn_id"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.seed_txn_id"); + } + + ThriftHiveMetastore_seed_txn_id_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.seed_txn_id", bytes); + } + + ThriftHiveMetastore_seed_txn_id_result result; + try { + iface_->seed_txn_id(args.rqst); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.seed_txn_id"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("seed_txn_id", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.seed_txn_id"); + } + + oprot->writeMessageBegin("seed_txn_id", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.seed_txn_id", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_lock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.lock", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.lock"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.lock"); + } + + ThriftHiveMetastore_lock_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.lock", bytes); + } + + ThriftHiveMetastore_lock_result result; + try { + iface_->lock(result.success, args.rqst); + result.__isset.success = true; + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnAbortedException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.lock"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("lock", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.lock"); + } + + oprot->writeMessageBegin("lock", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.lock", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_check_lock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.check_lock", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.check_lock"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.check_lock"); + } + + ThriftHiveMetastore_check_lock_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.check_lock", bytes); + } + + ThriftHiveMetastore_check_lock_result result; + try { + iface_->check_lock(result.success, args.rqst); + result.__isset.success = true; + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnAbortedException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (NoSuchLockException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.check_lock"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("check_lock", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.check_lock"); + } + + oprot->writeMessageBegin("check_lock", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.check_lock", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_unlock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.unlock", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.unlock"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.unlock"); + } + + ThriftHiveMetastore_unlock_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.unlock", bytes); + } + + ThriftHiveMetastore_unlock_result result; + try { + iface_->unlock(args.rqst); + } catch (NoSuchLockException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnOpenException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.unlock"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("unlock", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.unlock"); + } + + oprot->writeMessageBegin("unlock", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.unlock", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_show_locks(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.show_locks", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.show_locks"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.show_locks"); + } + + ThriftHiveMetastore_show_locks_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.show_locks", bytes); + } + + ThriftHiveMetastore_show_locks_result result; + try { + iface_->show_locks(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.show_locks"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("show_locks", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.show_locks"); + } + + oprot->writeMessageBegin("show_locks", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.show_locks", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_heartbeat(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.heartbeat", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.heartbeat"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.heartbeat"); + } + + ThriftHiveMetastore_heartbeat_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.heartbeat", bytes); + } + + ThriftHiveMetastore_heartbeat_result result; + try { + iface_->heartbeat(args.ids); + } catch (NoSuchLockException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchTxnException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (TxnAbortedException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.heartbeat"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("heartbeat", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.heartbeat"); + } + + oprot->writeMessageBegin("heartbeat", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.heartbeat", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_heartbeat_txn_range(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.heartbeat_txn_range", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.heartbeat_txn_range"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.heartbeat_txn_range"); + } + + ThriftHiveMetastore_heartbeat_txn_range_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.heartbeat_txn_range", bytes); + } + + ThriftHiveMetastore_heartbeat_txn_range_result result; + try { + iface_->heartbeat_txn_range(result.success, args.txns); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.heartbeat_txn_range"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("heartbeat_txn_range", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.heartbeat_txn_range"); + } + + oprot->writeMessageBegin("heartbeat_txn_range", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.heartbeat_txn_range", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.compact", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.compact"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.compact"); + } + + ThriftHiveMetastore_compact_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.compact", bytes); + } + + ThriftHiveMetastore_compact_result result; + try { + iface_->compact(args.rqst); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.compact"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("compact", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.compact"); + } + + oprot->writeMessageBegin("compact", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.compact", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_compact2(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.compact2", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.compact2"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.compact2"); + } + + ThriftHiveMetastore_compact2_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.compact2", bytes); + } + + ThriftHiveMetastore_compact2_result result; + try { + iface_->compact2(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.compact2"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("compact2", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.compact2"); + } + + oprot->writeMessageBegin("compact2", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.compact2", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_show_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.show_compact", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.show_compact"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.show_compact"); + } + + ThriftHiveMetastore_show_compact_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.show_compact", bytes); + } + + ThriftHiveMetastore_show_compact_result result; + try { + iface_->show_compact(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.show_compact"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("show_compact", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.show_compact"); + } + + oprot->writeMessageBegin("show_compact", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.show_compact", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_submit_for_cleanup(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.submit_for_cleanup", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.submit_for_cleanup"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.submit_for_cleanup"); + } + + ThriftHiveMetastore_submit_for_cleanup_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.submit_for_cleanup", bytes); + } + + ThriftHiveMetastore_submit_for_cleanup_result result; + try { + result.success = iface_->submit_for_cleanup(args.o1, args.o2, args.o3); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.submit_for_cleanup"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("submit_for_cleanup", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.submit_for_cleanup"); + } + + oprot->writeMessageBegin("submit_for_cleanup", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.submit_for_cleanup", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_dynamic_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_dynamic_partitions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_dynamic_partitions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_dynamic_partitions"); + } + + ThriftHiveMetastore_add_dynamic_partitions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_dynamic_partitions", bytes); + } + + ThriftHiveMetastore_add_dynamic_partitions_result result; + try { + iface_->add_dynamic_partitions(args.rqst); + } catch (NoSuchTxnException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (TxnAbortedException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_dynamic_partitions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_dynamic_partitions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_dynamic_partitions"); + } + + oprot->writeMessageBegin("add_dynamic_partitions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_dynamic_partitions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_find_next_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.find_next_compact", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.find_next_compact"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.find_next_compact"); + } + + ThriftHiveMetastore_find_next_compact_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.find_next_compact", bytes); + } + + ThriftHiveMetastore_find_next_compact_result result; + try { + iface_->find_next_compact(result.success, args.workerId); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.find_next_compact"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("find_next_compact", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.find_next_compact"); + } + + oprot->writeMessageBegin("find_next_compact", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.find_next_compact", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_find_next_compact2(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.find_next_compact2", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.find_next_compact2"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.find_next_compact2"); + } + + ThriftHiveMetastore_find_next_compact2_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.find_next_compact2", bytes); + } + + ThriftHiveMetastore_find_next_compact2_result result; + try { + iface_->find_next_compact2(result.success, args.rqst); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.find_next_compact2"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("find_next_compact2", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.find_next_compact2"); + } + + oprot->writeMessageBegin("find_next_compact2", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.find_next_compact2", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_compactor_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_compactor_state", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_compactor_state"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_compactor_state"); + } + + ThriftHiveMetastore_update_compactor_state_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_compactor_state", bytes); + } + + ThriftHiveMetastore_update_compactor_state_result result; + try { + iface_->update_compactor_state(args.cr, args.txn_id); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_compactor_state"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_compactor_state", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_compactor_state"); + } + + oprot->writeMessageBegin("update_compactor_state", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_compactor_state", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_find_columns_with_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.find_columns_with_stats", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.find_columns_with_stats"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.find_columns_with_stats"); + } + + ThriftHiveMetastore_find_columns_with_stats_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.find_columns_with_stats", bytes); + } + + ThriftHiveMetastore_find_columns_with_stats_result result; + try { + iface_->find_columns_with_stats(result.success, args.cr); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.find_columns_with_stats"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("find_columns_with_stats", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.find_columns_with_stats"); + } + + oprot->writeMessageBegin("find_columns_with_stats", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.find_columns_with_stats", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_mark_cleaned(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.mark_cleaned", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.mark_cleaned"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.mark_cleaned"); + } + + ThriftHiveMetastore_mark_cleaned_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.mark_cleaned", bytes); + } + + ThriftHiveMetastore_mark_cleaned_result result; + try { + iface_->mark_cleaned(args.cr); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.mark_cleaned"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("mark_cleaned", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.mark_cleaned"); + } + + oprot->writeMessageBegin("mark_cleaned", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.mark_cleaned", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_mark_compacted(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.mark_compacted", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.mark_compacted"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.mark_compacted"); + } + + ThriftHiveMetastore_mark_compacted_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.mark_compacted", bytes); + } + + ThriftHiveMetastore_mark_compacted_result result; + try { + iface_->mark_compacted(args.cr); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.mark_compacted"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("mark_compacted", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.mark_compacted"); + } + + oprot->writeMessageBegin("mark_compacted", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.mark_compacted", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_mark_failed(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.mark_failed", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.mark_failed"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.mark_failed"); + } + + ThriftHiveMetastore_mark_failed_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.mark_failed", bytes); + } + + ThriftHiveMetastore_mark_failed_result result; + try { + iface_->mark_failed(args.cr); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.mark_failed"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("mark_failed", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.mark_failed"); + } + + oprot->writeMessageBegin("mark_failed", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.mark_failed", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_mark_refused(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.mark_refused", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.mark_refused"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.mark_refused"); + } + + ThriftHiveMetastore_mark_refused_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.mark_refused", bytes); + } + + ThriftHiveMetastore_mark_refused_result result; + try { + iface_->mark_refused(args.cr); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.mark_refused"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("mark_refused", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.mark_refused"); + } + + oprot->writeMessageBegin("mark_refused", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.mark_refused", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_update_compaction_metrics_data(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.update_compaction_metrics_data", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.update_compaction_metrics_data"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.update_compaction_metrics_data"); + } + + ThriftHiveMetastore_update_compaction_metrics_data_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.update_compaction_metrics_data", bytes); + } + + ThriftHiveMetastore_update_compaction_metrics_data_result result; + try { + result.success = iface_->update_compaction_metrics_data(args.data); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.update_compaction_metrics_data"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("update_compaction_metrics_data", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.update_compaction_metrics_data"); + } + + oprot->writeMessageBegin("update_compaction_metrics_data", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.update_compaction_metrics_data", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_remove_compaction_metrics_data(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.remove_compaction_metrics_data", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.remove_compaction_metrics_data"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.remove_compaction_metrics_data"); + } + + ThriftHiveMetastore_remove_compaction_metrics_data_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.remove_compaction_metrics_data", bytes); + } + + ThriftHiveMetastore_remove_compaction_metrics_data_result result; + try { + iface_->remove_compaction_metrics_data(args.request); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.remove_compaction_metrics_data"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("remove_compaction_metrics_data", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.remove_compaction_metrics_data"); + } + + oprot->writeMessageBegin("remove_compaction_metrics_data", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.remove_compaction_metrics_data", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_set_hadoop_jobid(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.set_hadoop_jobid", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.set_hadoop_jobid"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.set_hadoop_jobid"); + } + + ThriftHiveMetastore_set_hadoop_jobid_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.set_hadoop_jobid", bytes); + } + + ThriftHiveMetastore_set_hadoop_jobid_result result; + try { + iface_->set_hadoop_jobid(args.jobId, args.cq_id); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.set_hadoop_jobid"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_hadoop_jobid", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.set_hadoop_jobid"); + } + + oprot->writeMessageBegin("set_hadoop_jobid", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.set_hadoop_jobid", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_latest_committed_compaction_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_latest_committed_compaction_info", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info"); + } + + ThriftHiveMetastore_get_latest_committed_compaction_info_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info", bytes); + } + + ThriftHiveMetastore_get_latest_committed_compaction_info_result result; + try { + iface_->get_latest_committed_compaction_info(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_latest_committed_compaction_info", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info"); + } + + oprot->writeMessageBegin("get_latest_committed_compaction_info", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_latest_committed_compaction_info", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_next_notification(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_next_notification", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_next_notification"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_next_notification"); + } + + ThriftHiveMetastore_get_next_notification_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_next_notification", bytes); + } + + ThriftHiveMetastore_get_next_notification_result result; + try { + iface_->get_next_notification(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_next_notification"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_next_notification", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_next_notification"); + } + + oprot->writeMessageBegin("get_next_notification", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_next_notification", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_current_notificationEventId(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_current_notificationEventId", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_current_notificationEventId"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_current_notificationEventId"); + } + + ThriftHiveMetastore_get_current_notificationEventId_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_current_notificationEventId", bytes); + } + + ThriftHiveMetastore_get_current_notificationEventId_result result; + try { + iface_->get_current_notificationEventId(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_current_notificationEventId"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_current_notificationEventId", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_current_notificationEventId"); + } + + oprot->writeMessageBegin("get_current_notificationEventId", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_current_notificationEventId", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_notification_events_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_notification_events_count", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_notification_events_count"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_notification_events_count"); + } + + ThriftHiveMetastore_get_notification_events_count_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_notification_events_count", bytes); + } + + ThriftHiveMetastore_get_notification_events_count_result result; + try { + iface_->get_notification_events_count(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_notification_events_count"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_notification_events_count", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_notification_events_count"); + } + + oprot->writeMessageBegin("get_notification_events_count", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_notification_events_count", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_fire_listener_event(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.fire_listener_event", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.fire_listener_event"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.fire_listener_event"); + } + + ThriftHiveMetastore_fire_listener_event_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.fire_listener_event", bytes); + } + + ThriftHiveMetastore_fire_listener_event_result result; + try { + iface_->fire_listener_event(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.fire_listener_event"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("fire_listener_event", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.fire_listener_event"); + } + + oprot->writeMessageBegin("fire_listener_event", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.fire_listener_event", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_flushCache(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.flushCache", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.flushCache"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.flushCache"); + } + + ThriftHiveMetastore_flushCache_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.flushCache", bytes); + } + + ThriftHiveMetastore_flushCache_result result; + try { + iface_->flushCache(); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.flushCache"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("flushCache", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.flushCache"); + } + + oprot->writeMessageBegin("flushCache", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.flushCache", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_write_notification_log(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_write_notification_log", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_write_notification_log"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_write_notification_log"); + } + + ThriftHiveMetastore_add_write_notification_log_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_write_notification_log", bytes); + } + + ThriftHiveMetastore_add_write_notification_log_result result; + try { + iface_->add_write_notification_log(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_write_notification_log"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_write_notification_log", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_write_notification_log"); + } + + oprot->writeMessageBegin("add_write_notification_log", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_write_notification_log", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_write_notification_log_in_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_write_notification_log_in_batch", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch"); + } + + ThriftHiveMetastore_add_write_notification_log_in_batch_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch", bytes); + } + + ThriftHiveMetastore_add_write_notification_log_in_batch_result result; + try { + iface_->add_write_notification_log_in_batch(result.success, args.rqst); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_write_notification_log_in_batch", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch"); + } + + oprot->writeMessageBegin("add_write_notification_log_in_batch", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_write_notification_log_in_batch", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_cm_recycle(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.cm_recycle", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.cm_recycle"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.cm_recycle"); + } + + ThriftHiveMetastore_cm_recycle_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.cm_recycle", bytes); + } + + ThriftHiveMetastore_cm_recycle_result result; + try { + iface_->cm_recycle(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.cm_recycle"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("cm_recycle", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.cm_recycle"); + } + + oprot->writeMessageBegin("cm_recycle", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.cm_recycle", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_file_metadata_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_file_metadata_by_expr", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_file_metadata_by_expr"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_file_metadata_by_expr"); + } + + ThriftHiveMetastore_get_file_metadata_by_expr_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_file_metadata_by_expr", bytes); + } + + ThriftHiveMetastore_get_file_metadata_by_expr_result result; + try { + iface_->get_file_metadata_by_expr(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_file_metadata_by_expr"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_file_metadata_by_expr", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_file_metadata_by_expr"); + } + + oprot->writeMessageBegin("get_file_metadata_by_expr", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_file_metadata_by_expr", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_file_metadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_file_metadata"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_file_metadata"); + } + + ThriftHiveMetastore_get_file_metadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_file_metadata", bytes); + } + + ThriftHiveMetastore_get_file_metadata_result result; + try { + iface_->get_file_metadata(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_file_metadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_file_metadata", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_file_metadata"); + } + + oprot->writeMessageBegin("get_file_metadata", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_file_metadata", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_put_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.put_file_metadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.put_file_metadata"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.put_file_metadata"); + } + + ThriftHiveMetastore_put_file_metadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.put_file_metadata", bytes); + } + + ThriftHiveMetastore_put_file_metadata_result result; + try { + iface_->put_file_metadata(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.put_file_metadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("put_file_metadata", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.put_file_metadata"); + } + + oprot->writeMessageBegin("put_file_metadata", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.put_file_metadata", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_clear_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.clear_file_metadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.clear_file_metadata"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.clear_file_metadata"); + } + + ThriftHiveMetastore_clear_file_metadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.clear_file_metadata", bytes); + } + + ThriftHiveMetastore_clear_file_metadata_result result; + try { + iface_->clear_file_metadata(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.clear_file_metadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("clear_file_metadata", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.clear_file_metadata"); + } + + oprot->writeMessageBegin("clear_file_metadata", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.clear_file_metadata", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_cache_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.cache_file_metadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.cache_file_metadata"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.cache_file_metadata"); + } + + ThriftHiveMetastore_cache_file_metadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.cache_file_metadata", bytes); + } + + ThriftHiveMetastore_cache_file_metadata_result result; + try { + iface_->cache_file_metadata(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.cache_file_metadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("cache_file_metadata", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.cache_file_metadata"); + } + + oprot->writeMessageBegin("cache_file_metadata", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.cache_file_metadata", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_metastore_db_uuid(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_metastore_db_uuid", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_metastore_db_uuid"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_metastore_db_uuid"); + } + + ThriftHiveMetastore_get_metastore_db_uuid_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_metastore_db_uuid", bytes); + } + + ThriftHiveMetastore_get_metastore_db_uuid_result result; + try { + iface_->get_metastore_db_uuid(result.success); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_metastore_db_uuid"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_metastore_db_uuid", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_metastore_db_uuid"); + } + + oprot->writeMessageBegin("get_metastore_db_uuid", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_metastore_db_uuid", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_resource_plan"); + } + + ThriftHiveMetastore_create_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_resource_plan", bytes); + } + + ThriftHiveMetastore_create_resource_plan_result result; + try { + iface_->create_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_resource_plan"); + } + + oprot->writeMessageBegin("create_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_resource_plan"); + } + + ThriftHiveMetastore_get_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_resource_plan", bytes); + } + + ThriftHiveMetastore_get_resource_plan_result result; + try { + iface_->get_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_resource_plan"); + } + + oprot->writeMessageBegin("get_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_active_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_active_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_active_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_active_resource_plan"); + } + + ThriftHiveMetastore_get_active_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_active_resource_plan", bytes); + } + + ThriftHiveMetastore_get_active_resource_plan_result result; + try { + iface_->get_active_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_active_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_active_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_active_resource_plan"); + } + + oprot->writeMessageBegin("get_active_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_active_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_resource_plans(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_resource_plans", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_resource_plans"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_resource_plans"); + } + + ThriftHiveMetastore_get_all_resource_plans_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_resource_plans", bytes); + } + + ThriftHiveMetastore_get_all_resource_plans_result result; + try { + iface_->get_all_resource_plans(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_resource_plans"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_resource_plans", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_resource_plans"); + } + + oprot->writeMessageBegin("get_all_resource_plans", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_resource_plans", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_resource_plan"); + } + + ThriftHiveMetastore_alter_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_resource_plan", bytes); + } + + ThriftHiveMetastore_alter_resource_plan_result result; + try { + iface_->alter_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_resource_plan"); + } + + oprot->writeMessageBegin("alter_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_validate_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.validate_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.validate_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.validate_resource_plan"); + } + + ThriftHiveMetastore_validate_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.validate_resource_plan", bytes); + } + + ThriftHiveMetastore_validate_resource_plan_result result; + try { + iface_->validate_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.validate_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("validate_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.validate_resource_plan"); + } + + oprot->writeMessageBegin("validate_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.validate_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_resource_plan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_resource_plan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_resource_plan"); + } + + ThriftHiveMetastore_drop_resource_plan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_resource_plan", bytes); + } + + ThriftHiveMetastore_drop_resource_plan_result result; + try { + iface_->drop_resource_plan(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_resource_plan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_resource_plan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_resource_plan"); + } + + oprot->writeMessageBegin("drop_resource_plan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_resource_plan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_wm_trigger", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_wm_trigger"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_wm_trigger"); + } + + ThriftHiveMetastore_create_wm_trigger_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_wm_trigger", bytes); + } + + ThriftHiveMetastore_create_wm_trigger_result result; + try { + iface_->create_wm_trigger(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_wm_trigger"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_wm_trigger", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_wm_trigger"); + } + + oprot->writeMessageBegin("create_wm_trigger", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_wm_trigger", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_wm_trigger", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_wm_trigger"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_wm_trigger"); + } + + ThriftHiveMetastore_alter_wm_trigger_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_wm_trigger", bytes); + } + + ThriftHiveMetastore_alter_wm_trigger_result result; + try { + iface_->alter_wm_trigger(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_wm_trigger"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_wm_trigger", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_wm_trigger"); + } + + oprot->writeMessageBegin("alter_wm_trigger", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_wm_trigger", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_wm_trigger", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_wm_trigger"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_wm_trigger"); + } + + ThriftHiveMetastore_drop_wm_trigger_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_wm_trigger", bytes); + } + + ThriftHiveMetastore_drop_wm_trigger_result result; + try { + iface_->drop_wm_trigger(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_wm_trigger"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_wm_trigger", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_wm_trigger"); + } + + oprot->writeMessageBegin("drop_wm_trigger", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_wm_trigger", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_triggers_for_resourceplan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_triggers_for_resourceplan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan"); + } + + ThriftHiveMetastore_get_triggers_for_resourceplan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan", bytes); + } + + ThriftHiveMetastore_get_triggers_for_resourceplan_result result; + try { + iface_->get_triggers_for_resourceplan(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_triggers_for_resourceplan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan"); + } + + oprot->writeMessageBegin("get_triggers_for_resourceplan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_triggers_for_resourceplan", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_wm_pool", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_wm_pool"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_wm_pool"); + } + + ThriftHiveMetastore_create_wm_pool_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_wm_pool", bytes); + } + + ThriftHiveMetastore_create_wm_pool_result result; + try { + iface_->create_wm_pool(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_wm_pool"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_wm_pool", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_wm_pool"); + } + + oprot->writeMessageBegin("create_wm_pool", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_wm_pool", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_wm_pool", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_wm_pool"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_wm_pool"); + } + + ThriftHiveMetastore_alter_wm_pool_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_wm_pool", bytes); + } + + ThriftHiveMetastore_alter_wm_pool_result result; + try { + iface_->alter_wm_pool(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_wm_pool"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_wm_pool", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_wm_pool"); + } + + oprot->writeMessageBegin("alter_wm_pool", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_wm_pool", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_wm_pool", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_wm_pool"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_wm_pool"); + } + + ThriftHiveMetastore_drop_wm_pool_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_wm_pool", bytes); + } + + ThriftHiveMetastore_drop_wm_pool_result result; + try { + iface_->drop_wm_pool(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_wm_pool"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_wm_pool", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_wm_pool"); + } + + oprot->writeMessageBegin("drop_wm_pool", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_wm_pool", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_or_update_wm_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_or_update_wm_mapping", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_or_update_wm_mapping"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_or_update_wm_mapping"); + } + + ThriftHiveMetastore_create_or_update_wm_mapping_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_or_update_wm_mapping", bytes); + } + + ThriftHiveMetastore_create_or_update_wm_mapping_result result; + try { + iface_->create_or_update_wm_mapping(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_or_update_wm_mapping"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_or_update_wm_mapping", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_or_update_wm_mapping"); + } + + oprot->writeMessageBegin("create_or_update_wm_mapping", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_or_update_wm_mapping", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_wm_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_wm_mapping", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_wm_mapping"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_wm_mapping"); + } + + ThriftHiveMetastore_drop_wm_mapping_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_wm_mapping", bytes); + } + + ThriftHiveMetastore_drop_wm_mapping_result result; + try { + iface_->drop_wm_mapping(result.success, args.request); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_wm_mapping"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_wm_mapping", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_wm_mapping"); + } + + oprot->writeMessageBegin("drop_wm_mapping", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_wm_mapping", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_or_drop_wm_trigger_to_pool_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping"); + } + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping", bytes); + } + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result result; + try { + iface_->create_or_drop_wm_trigger_to_pool_mapping(result.success, args.request); + result.__isset.success = true; + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (InvalidObjectException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (MetaException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_or_drop_wm_trigger_to_pool_mapping", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping"); + } + + oprot->writeMessageBegin("create_or_drop_wm_trigger_to_pool_mapping", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_or_drop_wm_trigger_to_pool_mapping", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_ischema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_ischema"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_ischema"); + } + + ThriftHiveMetastore_create_ischema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_ischema", bytes); + } + + ThriftHiveMetastore_create_ischema_result result; + try { + iface_->create_ischema(args.schema); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_ischema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_ischema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_ischema"); + } + + oprot->writeMessageBegin("create_ischema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_ischema", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_alter_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.alter_ischema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.alter_ischema"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.alter_ischema"); + } + + ThriftHiveMetastore_alter_ischema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.alter_ischema", bytes); + } + + ThriftHiveMetastore_alter_ischema_result result; + try { + iface_->alter_ischema(args.rqst); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.alter_ischema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("alter_ischema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.alter_ischema"); + } + + oprot->writeMessageBegin("alter_ischema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.alter_ischema", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_ischema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_ischema"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_ischema"); + } + + ThriftHiveMetastore_get_ischema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_ischema", bytes); + } + + ThriftHiveMetastore_get_ischema_result result; + try { + iface_->get_ischema(result.success, args.name); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_ischema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_ischema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_ischema"); + } + + oprot->writeMessageBegin("get_ischema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_ischema", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_ischema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_ischema"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_ischema"); + } + + ThriftHiveMetastore_drop_ischema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_ischema", bytes); + } + + ThriftHiveMetastore_drop_ischema_result result; + try { + iface_->drop_ischema(args.name); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_ischema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_ischema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_ischema"); + } + + oprot->writeMessageBegin("drop_ischema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_ischema", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_schema_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_schema_version"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_schema_version"); + } + + ThriftHiveMetastore_add_schema_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_schema_version", bytes); + } + + ThriftHiveMetastore_add_schema_version_result result; + try { + iface_->add_schema_version(args.schemaVersion); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_schema_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_schema_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_schema_version"); + } + + oprot->writeMessageBegin("add_schema_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_schema_version", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema_version"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema_version"); + } + + ThriftHiveMetastore_get_schema_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema_version", bytes); + } + + ThriftHiveMetastore_get_schema_version_result result; + try { + iface_->get_schema_version(result.success, args.schemaVersion); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema_version"); + } + + oprot->writeMessageBegin("get_schema_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema_version", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema_latest_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema_latest_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema_latest_version"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema_latest_version"); + } + + ThriftHiveMetastore_get_schema_latest_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema_latest_version", bytes); + } + + ThriftHiveMetastore_get_schema_latest_version_result result; + try { + iface_->get_schema_latest_version(result.success, args.schemaName); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema_latest_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema_latest_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema_latest_version"); + } + + oprot->writeMessageBegin("get_schema_latest_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema_latest_version", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schema_all_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schema_all_versions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schema_all_versions"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schema_all_versions"); + } + + ThriftHiveMetastore_get_schema_all_versions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schema_all_versions", bytes); + } + + ThriftHiveMetastore_get_schema_all_versions_result result; + try { + iface_->get_schema_all_versions(result.success, args.schemaName); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schema_all_versions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schema_all_versions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schema_all_versions"); + } + + oprot->writeMessageBegin("get_schema_all_versions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schema_all_versions", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_schema_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_schema_version"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_schema_version"); + } + + ThriftHiveMetastore_drop_schema_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_schema_version", bytes); + } + + ThriftHiveMetastore_drop_schema_version_result result; + try { + iface_->drop_schema_version(args.schemaVersion); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_schema_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_schema_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_schema_version"); + } + + oprot->writeMessageBegin("drop_schema_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_schema_version", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_schemas_by_cols(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_schemas_by_cols", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_schemas_by_cols"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_schemas_by_cols"); + } + + ThriftHiveMetastore_get_schemas_by_cols_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_schemas_by_cols", bytes); + } + + ThriftHiveMetastore_get_schemas_by_cols_result result; + try { + iface_->get_schemas_by_cols(result.success, args.rqst); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_schemas_by_cols"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_schemas_by_cols", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_schemas_by_cols"); + } + + oprot->writeMessageBegin("get_schemas_by_cols", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_schemas_by_cols", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_map_schema_version_to_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.map_schema_version_to_serde", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.map_schema_version_to_serde"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.map_schema_version_to_serde"); + } + + ThriftHiveMetastore_map_schema_version_to_serde_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.map_schema_version_to_serde", bytes); + } + + ThriftHiveMetastore_map_schema_version_to_serde_result result; + try { + iface_->map_schema_version_to_serde(args.rqst); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.map_schema_version_to_serde"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("map_schema_version_to_serde", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.map_schema_version_to_serde"); + } + + oprot->writeMessageBegin("map_schema_version_to_serde", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.map_schema_version_to_serde", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_set_schema_version_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.set_schema_version_state", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.set_schema_version_state"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.set_schema_version_state"); + } + + ThriftHiveMetastore_set_schema_version_state_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.set_schema_version_state", bytes); + } + + ThriftHiveMetastore_set_schema_version_state_result result; + try { + iface_->set_schema_version_state(args.rqst); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (MetaException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.set_schema_version_state"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_schema_version_state", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.set_schema_version_state"); + } + + oprot->writeMessageBegin("set_schema_version_state", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.set_schema_version_state", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_serde", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_serde"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_serde"); + } + + ThriftHiveMetastore_add_serde_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_serde", bytes); + } + + ThriftHiveMetastore_add_serde_result result; + try { + iface_->add_serde(args.serde); + } catch (AlreadyExistsException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_serde"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_serde", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_serde"); + } + + oprot->writeMessageBegin("add_serde", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_serde", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_serde", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_serde"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_serde"); + } + + ThriftHiveMetastore_get_serde_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_serde", bytes); + } + + ThriftHiveMetastore_get_serde_result result; + try { + iface_->get_serde(result.success, args.rqst); + result.__isset.success = true; + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_serde"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_serde", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_serde"); + } + + oprot->writeMessageBegin("get_serde", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_serde", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_lock_materialization_rebuild(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_lock_materialization_rebuild", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild"); + } + + ThriftHiveMetastore_get_lock_materialization_rebuild_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild", bytes); + } + + ThriftHiveMetastore_get_lock_materialization_rebuild_result result; + try { + iface_->get_lock_materialization_rebuild(result.success, args.dbName, args.tableName, args.txnId); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_lock_materialization_rebuild", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild"); + } + + oprot->writeMessageBegin("get_lock_materialization_rebuild", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_lock_materialization_rebuild", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_heartbeat_lock_materialization_rebuild(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.heartbeat_lock_materialization_rebuild", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild"); + } + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild", bytes); + } + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result result; + try { + result.success = iface_->heartbeat_lock_materialization_rebuild(args.dbName, args.tableName, args.txnId); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("heartbeat_lock_materialization_rebuild", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild"); + } + + oprot->writeMessageBegin("heartbeat_lock_materialization_rebuild", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.heartbeat_lock_materialization_rebuild", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_runtime_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_runtime_stats", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_runtime_stats"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_runtime_stats"); + } + + ThriftHiveMetastore_add_runtime_stats_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_runtime_stats", bytes); + } + + ThriftHiveMetastore_add_runtime_stats_result result; + try { + iface_->add_runtime_stats(args.stat); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_runtime_stats"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_runtime_stats", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_runtime_stats"); + } + + oprot->writeMessageBegin("add_runtime_stats", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_runtime_stats", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_runtime_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_runtime_stats", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_runtime_stats"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_runtime_stats"); + } + + ThriftHiveMetastore_get_runtime_stats_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_runtime_stats", bytes); + } + + ThriftHiveMetastore_get_runtime_stats_result result; + try { + iface_->get_runtime_stats(result.success, args.rqst); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_runtime_stats"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_runtime_stats", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_runtime_stats"); + } + + oprot->writeMessageBegin("get_runtime_stats", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_runtime_stats", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_partitions_with_specs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_partitions_with_specs", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_partitions_with_specs"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_partitions_with_specs"); + } + + ThriftHiveMetastore_get_partitions_with_specs_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_partitions_with_specs", bytes); + } + + ThriftHiveMetastore_get_partitions_with_specs_result result; + try { + iface_->get_partitions_with_specs(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_partitions_with_specs"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_partitions_with_specs", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_partitions_with_specs"); + } + + oprot->writeMessageBegin("get_partitions_with_specs", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_partitions_with_specs", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_scheduled_query_poll(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.scheduled_query_poll", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.scheduled_query_poll"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.scheduled_query_poll"); + } + + ThriftHiveMetastore_scheduled_query_poll_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.scheduled_query_poll", bytes); + } + + ThriftHiveMetastore_scheduled_query_poll_result result; + try { + iface_->scheduled_query_poll(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.scheduled_query_poll"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("scheduled_query_poll", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.scheduled_query_poll"); + } + + oprot->writeMessageBegin("scheduled_query_poll", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.scheduled_query_poll", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_scheduled_query_maintenance(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.scheduled_query_maintenance", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.scheduled_query_maintenance"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.scheduled_query_maintenance"); + } + + ThriftHiveMetastore_scheduled_query_maintenance_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.scheduled_query_maintenance", bytes); + } + + ThriftHiveMetastore_scheduled_query_maintenance_result result; + try { + iface_->scheduled_query_maintenance(args.request); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (AlreadyExistsException &o3) { + result.o3 = std::move(o3); + result.__isset.o3 = true; + } catch (InvalidInputException &o4) { + result.o4 = std::move(o4); + result.__isset.o4 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.scheduled_query_maintenance"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("scheduled_query_maintenance", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.scheduled_query_maintenance"); + } + + oprot->writeMessageBegin("scheduled_query_maintenance", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.scheduled_query_maintenance", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_scheduled_query_progress(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.scheduled_query_progress", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.scheduled_query_progress"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.scheduled_query_progress"); + } + + ThriftHiveMetastore_scheduled_query_progress_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.scheduled_query_progress", bytes); + } + + ThriftHiveMetastore_scheduled_query_progress_result result; + try { + iface_->scheduled_query_progress(args.info); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (InvalidOperationException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.scheduled_query_progress"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("scheduled_query_progress", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.scheduled_query_progress"); + } + + oprot->writeMessageBegin("scheduled_query_progress", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.scheduled_query_progress", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_scheduled_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_scheduled_query", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_scheduled_query"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_scheduled_query"); + } + + ThriftHiveMetastore_get_scheduled_query_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_scheduled_query", bytes); + } + + ThriftHiveMetastore_get_scheduled_query_result result; + try { + iface_->get_scheduled_query(result.success, args.scheduleKey); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_scheduled_query"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_scheduled_query", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_scheduled_query"); + } + + oprot->writeMessageBegin("get_scheduled_query", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_scheduled_query", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_replication_metrics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_replication_metrics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_replication_metrics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_replication_metrics"); + } + + ThriftHiveMetastore_add_replication_metrics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_replication_metrics", bytes); + } + + ThriftHiveMetastore_add_replication_metrics_result result; + try { + iface_->add_replication_metrics(args.replicationMetricList); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_replication_metrics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_replication_metrics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_replication_metrics"); + } + + oprot->writeMessageBegin("add_replication_metrics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_replication_metrics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_replication_metrics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_replication_metrics", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_replication_metrics"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_replication_metrics"); + } + + ThriftHiveMetastore_get_replication_metrics_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_replication_metrics", bytes); + } + + ThriftHiveMetastore_get_replication_metrics_result result; + try { + iface_->get_replication_metrics(result.success, args.rqst); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_replication_metrics"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_replication_metrics", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_replication_metrics"); + } + + oprot->writeMessageBegin("get_replication_metrics", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_replication_metrics", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_open_txns_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_open_txns_req", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_open_txns_req"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_open_txns_req"); + } + + ThriftHiveMetastore_get_open_txns_req_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_open_txns_req", bytes); + } + + ThriftHiveMetastore_get_open_txns_req_result result; + try { + iface_->get_open_txns_req(result.success, args.getOpenTxnsRequest); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_open_txns_req"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_open_txns_req", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_open_txns_req"); + } + + oprot->writeMessageBegin("get_open_txns_req", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_open_txns_req", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_create_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.create_stored_procedure", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.create_stored_procedure"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.create_stored_procedure"); + } + + ThriftHiveMetastore_create_stored_procedure_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.create_stored_procedure", bytes); + } + + ThriftHiveMetastore_create_stored_procedure_result result; + try { + iface_->create_stored_procedure(args.proc); + } catch (NoSuchObjectException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (MetaException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.create_stored_procedure"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("create_stored_procedure", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.create_stored_procedure"); + } + + oprot->writeMessageBegin("create_stored_procedure", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.create_stored_procedure", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_stored_procedure", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_stored_procedure"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_stored_procedure"); + } + + ThriftHiveMetastore_get_stored_procedure_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_stored_procedure", bytes); + } + + ThriftHiveMetastore_get_stored_procedure_result result; + try { + iface_->get_stored_procedure(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_stored_procedure"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_stored_procedure", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_stored_procedure"); + } + + oprot->writeMessageBegin("get_stored_procedure", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_stored_procedure", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_stored_procedure", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_stored_procedure"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_stored_procedure"); + } + + ThriftHiveMetastore_drop_stored_procedure_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_stored_procedure", bytes); + } + + ThriftHiveMetastore_drop_stored_procedure_result result; + try { + iface_->drop_stored_procedure(args.request); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_stored_procedure"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_stored_procedure", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_stored_procedure"); + } + + oprot->writeMessageBegin("drop_stored_procedure", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_stored_procedure", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_stored_procedures(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_stored_procedures", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_stored_procedures"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_stored_procedures"); + } + + ThriftHiveMetastore_get_all_stored_procedures_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_stored_procedures", bytes); + } + + ThriftHiveMetastore_get_all_stored_procedures_result result; + try { + iface_->get_all_stored_procedures(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_stored_procedures"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_stored_procedures", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_stored_procedures"); + } + + oprot->writeMessageBegin("get_all_stored_procedures", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_stored_procedures", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_find_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.find_package", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.find_package"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.find_package"); + } + + ThriftHiveMetastore_find_package_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.find_package", bytes); + } + + ThriftHiveMetastore_find_package_result result; + try { + iface_->find_package(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = std::move(o2); + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.find_package"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("find_package", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.find_package"); + } + + oprot->writeMessageBegin("find_package", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.find_package", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_add_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.add_package", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.add_package"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.add_package"); + } + + ThriftHiveMetastore_add_package_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.add_package", bytes); + } + + ThriftHiveMetastore_add_package_result result; + try { + iface_->add_package(args.request); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.add_package"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add_package", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.add_package"); + } + + oprot->writeMessageBegin("add_package", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.add_package", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_packages(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_packages", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_packages"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_packages"); + } + + ThriftHiveMetastore_get_all_packages_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_packages", bytes); + } + + ThriftHiveMetastore_get_all_packages_result result; + try { + iface_->get_all_packages(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_packages"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_packages", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_packages"); + } + + oprot->writeMessageBegin("get_all_packages", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_packages", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_drop_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.drop_package", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.drop_package"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.drop_package"); + } + + ThriftHiveMetastore_drop_package_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.drop_package", bytes); + } + + ThriftHiveMetastore_drop_package_result result; + try { + iface_->drop_package(args.request); + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.drop_package"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("drop_package", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.drop_package"); + } + + oprot->writeMessageBegin("drop_package", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.drop_package", bytes); + } +} + +void ThriftHiveMetastoreProcessor::process_get_all_write_event_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = nullptr; + if (this->eventHandler_.get() != nullptr) { + ctx = this->eventHandler_->getContext("ThriftHiveMetastore.get_all_write_event_info", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_all_write_event_info"); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_all_write_event_info"); + } + + ThriftHiveMetastore_get_all_write_event_info_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_all_write_event_info", bytes); + } + + ThriftHiveMetastore_get_all_write_event_info_result result; + try { + iface_->get_all_write_event_info(result.success, args.request); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = std::move(o1); + result.__isset.o1 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_all_write_event_info"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_all_write_event_info", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.get_all_write_event_info"); + } + + oprot->writeMessageBegin("get_all_write_event_info", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != nullptr) { + this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.get_all_write_event_info", bytes); + } +} + +::std::shared_ptr< ::apache::thrift::TProcessor > ThriftHiveMetastoreProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< ThriftHiveMetastoreIfFactory > cleanup(handlerFactory_); + ::std::shared_ptr< ThriftHiveMetastoreIf > handler(handlerFactory_->getHandler(connInfo), cleanup); + ::std::shared_ptr< ::apache::thrift::TProcessor > processor(new ThriftHiveMetastoreProcessor(handler)); + return processor; +} + +void ThriftHiveMetastoreConcurrentClient::abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) +{ + int32_t seqid = send_abort_Compactions(rqst); + recv_abort_Compactions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_abort_Compactions(const AbortCompactionRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("abort_Compactions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_Compactions_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_abort_Compactions(AbortCompactResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_Compactions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_abort_Compactions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "abort_Compactions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::getMetaConf(std::string& _return, const std::string& key) +{ + int32_t seqid = send_getMetaConf(key); + recv_getMetaConf(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_getMetaConf(const std::string& key) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_getMetaConf_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_getMetaConf(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getMetaConf") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_getMetaConf_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getMetaConf failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::setMetaConf(const std::string& key, const std::string& value) +{ + int32_t seqid = send_setMetaConf(key, value); + recv_setMetaConf(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_setMetaConf(const std::string& key, const std::string& value) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_setMetaConf_pargs args; + args.key = &key; + args.value = &value; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_setMetaConf(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("setMetaConf") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_setMetaConf_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_catalog(const CreateCatalogRequest& catalog) +{ + int32_t seqid = send_create_catalog(catalog); + recv_create_catalog(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_catalog(const CreateCatalogRequest& catalog) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_catalog_pargs args; + args.catalog = &catalog; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_catalog(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_catalog(const AlterCatalogRequest& rqst) +{ + int32_t seqid = send_alter_catalog(rqst); + recv_alter_catalog(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_catalog(const AlterCatalogRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_catalog_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_catalog(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) +{ + int32_t seqid = send_get_catalog(catName); + recv_get_catalog(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_catalog(const GetCatalogRequest& catName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_catalog_pargs args; + args.catName = &catName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_catalog(GetCatalogResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_catalog_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_catalog failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_catalogs(GetCatalogsResponse& _return) +{ + int32_t seqid = send_get_catalogs(); + recv_get_catalogs(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_catalogs() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_catalogs", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_catalogs_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_catalogs(GetCatalogsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_catalogs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_catalogs_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_catalogs failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_catalog(const DropCatalogRequest& catName) +{ + int32_t seqid = send_drop_catalog(catName); + recv_drop_catalog(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_catalog(const DropCatalogRequest& catName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_catalog", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_catalog_pargs args; + args.catName = &catName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_catalog(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_catalog") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_catalog_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_database(const Database& database) +{ + int32_t seqid = send_create_database(database); + recv_create_database(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_database(const Database& database) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_database_pargs args; + args.database = &database; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_database(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_database_req(const CreateDatabaseRequest& createDatabaseRequest) +{ + int32_t seqid = send_create_database_req(createDatabaseRequest); + recv_create_database_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_database_req(const CreateDatabaseRequest& createDatabaseRequest) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_database_req_pargs args; + args.createDatabaseRequest = &createDatabaseRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_database_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_database(Database& _return, const std::string& name) +{ + int32_t seqid = send_get_database(name); + recv_get_database(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_database(const std::string& name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_database_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_database(Database& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_database_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_database_req(Database& _return, const GetDatabaseRequest& request) +{ + int32_t seqid = send_get_database_req(request); + recv_get_database_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_database_req(const GetDatabaseRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_database_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_database_req(Database& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_database_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_database_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_database(const std::string& name, const bool deleteData, const bool cascade) +{ + int32_t seqid = send_drop_database(name, deleteData, cascade); + recv_drop_database(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_database(const std::string& name, const bool deleteData, const bool cascade) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_database_pargs args; + args.name = &name; + args.deleteData = &deleteData; + args.cascade = &cascade; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_database(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_database_req(const DropDatabaseRequest& req) +{ + int32_t seqid = send_drop_database_req(req); + recv_drop_database_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_database_req(const DropDatabaseRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_database_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_database_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_databases(std::vector & _return, const std::string& pattern) +{ + int32_t seqid = send_get_databases(pattern); + recv_get_databases(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_databases(const std::string& pattern) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_databases", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_databases_pargs args; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_databases(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_databases") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_databases failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_databases(std::vector & _return) +{ + int32_t seqid = send_get_all_databases(); + recv_get_all_databases(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_databases() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_databases", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_databases_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_databases(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_databases") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_databases_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_databases failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_database(const std::string& dbname, const Database& db) +{ + int32_t seqid = send_alter_database(dbname, db); + recv_alter_database(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_database(const std::string& dbname, const Database& db) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_database", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_database_pargs args; + args.dbname = &dbname; + args.db = &db; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_database(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_database") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_database_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_database_req(const AlterDatabaseRequest& alterDbReq) +{ + int32_t seqid = send_alter_database_req(alterDbReq); + recv_alter_database_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_database_req(const AlterDatabaseRequest& alterDbReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_database_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_database_req_pargs args; + args.alterDbReq = &alterDbReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_database_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_database_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_database_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) +{ + int32_t seqid = send_create_dataconnector_req(connectorReq); + recv_create_dataconnector_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_dataconnector_req_pargs args; + args.connectorReq = &connectorReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_dataconnector_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) +{ + int32_t seqid = send_get_dataconnector_req(request); + recv_get_dataconnector_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_dataconnector_req(const GetDataConnectorRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_dataconnector_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_dataconnector_req(DataConnector& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_dataconnector_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_dataconnector_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) +{ + int32_t seqid = send_drop_dataconnector_req(dropDcReq); + recv_drop_dataconnector_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_dataconnector_req_pargs args; + args.dropDcReq = &dropDcReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_dataconnector_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_dataconnectors(std::vector & _return) +{ + int32_t seqid = send_get_dataconnectors(); + recv_get_dataconnectors(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_dataconnectors() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_dataconnectors", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_dataconnectors_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_dataconnectors(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_dataconnectors") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_dataconnectors_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_dataconnectors failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) +{ + int32_t seqid = send_alter_dataconnector_req(alterReq); + recv_alter_dataconnector_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_dataconnector_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_dataconnector_req_pargs args; + args.alterReq = &alterReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_dataconnector_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_dataconnector_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_dataconnector_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_type(Type& _return, const std::string& name) +{ + int32_t seqid = send_get_type(name); + recv_get_type(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_type(const std::string& name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_type_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_type(Type& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::create_type(const Type& type) +{ + int32_t seqid = send_create_type(type); + return recv_create_type(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_type(const Type& type) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_type_pargs args; + args.type = &type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_create_type(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_create_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_type failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_type(const std::string& type) +{ + int32_t seqid = send_drop_type(type); + return recv_drop_type(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_type(const std::string& type) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_type_pargs args; + args.type = &type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_type(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_type failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_type_all(std::map & _return, const std::string& name) +{ + int32_t seqid = send_get_type_all(name); + recv_get_type_all(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_type_all(const std::string& name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_type_all", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_type_all_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_type_all(std::map & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_type_all") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_type_all_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_type_all failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) +{ + int32_t seqid = send_get_fields(db_name, table_name); + recv_get_fields(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_fields(const std::string& db_name, const std::string& table_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_fields", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_fields(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_fields_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_get_fields_with_environment_context(db_name, table_name, environment_context); + recv_get_fields_with_environment_context(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_fields_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_fields_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_with_environment_context_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_fields_with_environment_context(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_fields_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) +{ + int32_t seqid = send_get_fields_req(req); + recv_get_fields_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_fields_req(const GetFieldsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_fields_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_fields_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_fields_req(GetFieldsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_fields_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_fields_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_fields_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) +{ + int32_t seqid = send_get_schema(db_name, table_name); + recv_get_schema(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema(const std::string& db_name, const std::string& table_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_get_schema_with_environment_context(db_name, table_name, environment_context); + recv_get_schema_with_environment_context(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_with_environment_context_pargs args; + args.db_name = &db_name; + args.table_name = &table_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema_with_environment_context(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) +{ + int32_t seqid = send_get_schema_req(req); + recv_get_schema_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema_req(const GetSchemaRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema_req(GetSchemaResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_table(const Table& tbl) +{ + int32_t seqid = send_create_table(tbl); + recv_create_table(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_table(const Table& tbl) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_pargs args; + args.tbl = &tbl; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_table(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_create_table_with_environment_context(tbl, environment_context); + recv_create_table_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_with_environment_context_pargs args; + args.tbl = &tbl; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_table_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) +{ + int32_t seqid = send_create_table_with_constraints(tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); + recv_create_table_with_constraints(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_table_with_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_with_constraints_pargs args; + args.tbl = &tbl; + args.primaryKeys = &primaryKeys; + args.foreignKeys = &foreignKeys; + args.uniqueConstraints = &uniqueConstraints; + args.notNullConstraints = ¬NullConstraints; + args.defaultConstraints = &defaultConstraints; + args.checkConstraints = &checkConstraints; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_table_with_constraints(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_with_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_table_with_constraints_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_table_req(const CreateTableRequest& request) +{ + int32_t seqid = send_create_table_req(request); + recv_create_table_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_table_req(const CreateTableRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_table_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_table_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_table_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_constraint(const DropConstraintRequest& req) +{ + int32_t seqid = send_drop_constraint(req); + recv_drop_constraint(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_constraint(const DropConstraintRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_constraint(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_primary_key(const AddPrimaryKeyRequest& req) +{ + int32_t seqid = send_add_primary_key(req); + recv_add_primary_key(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_primary_key(const AddPrimaryKeyRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_primary_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_primary_key_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_primary_key(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_primary_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_primary_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_foreign_key(const AddForeignKeyRequest& req) +{ + int32_t seqid = send_add_foreign_key(req); + recv_add_foreign_key(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_foreign_key(const AddForeignKeyRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_foreign_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_foreign_key_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_foreign_key(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_foreign_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_foreign_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_unique_constraint(const AddUniqueConstraintRequest& req) +{ + int32_t seqid = send_add_unique_constraint(req); + recv_add_unique_constraint(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_unique_constraint(const AddUniqueConstraintRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_unique_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_unique_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_unique_constraint(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_unique_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_unique_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_not_null_constraint(const AddNotNullConstraintRequest& req) +{ + int32_t seqid = send_add_not_null_constraint(req); + recv_add_not_null_constraint(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_not_null_constraint(const AddNotNullConstraintRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_not_null_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_not_null_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_not_null_constraint(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_not_null_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_not_null_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_default_constraint(const AddDefaultConstraintRequest& req) +{ + int32_t seqid = send_add_default_constraint(req); + recv_add_default_constraint(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_default_constraint(const AddDefaultConstraintRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_default_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_default_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_default_constraint(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_default_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_default_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_check_constraint(const AddCheckConstraintRequest& req) +{ + int32_t seqid = send_add_check_constraint(req); + recv_add_check_constraint(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_check_constraint(const AddCheckConstraintRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_check_constraint", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_check_constraint_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_check_constraint(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_check_constraint") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_check_constraint_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::translate_table_dryrun(Table& _return, const CreateTableRequest& request) +{ + int32_t seqid = send_translate_table_dryrun(request); + recv_translate_table_dryrun(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_translate_table_dryrun(const CreateTableRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_translate_table_dryrun_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_translate_table_dryrun(Table& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("translate_table_dryrun") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_translate_table_dryrun_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "translate_table_dryrun failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +{ + int32_t seqid = send_drop_table(dbname, name, deleteData); + recv_drop_table(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_pargs args; + args.dbname = &dbname; + args.name = &name; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_table(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_drop_table_with_environment_context(dbname, name, deleteData, environment_context); + recv_drop_table_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_with_environment_context_pargs args; + args.dbname = &dbname; + args.name = &name; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_table_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_table_req(const DropTableRequest& dropTableReq) +{ + int32_t seqid = send_drop_table_req(dropTableReq); + recv_drop_table_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_table_req(const DropTableRequest& dropTableReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_table_req_pargs args; + args.dropTableReq = &dropTableReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_table_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_table_req_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) +{ + int32_t seqid = send_truncate_table(dbName, tableName, partNames); + recv_truncate_table(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("truncate_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_truncate_table_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.partNames = &partNames; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_truncate_table(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("truncate_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_truncate_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) +{ + int32_t seqid = send_truncate_table_req(req); + recv_truncate_table_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_truncate_table_req(const TruncateTableRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("truncate_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_truncate_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_truncate_table_req(TruncateTableResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("truncate_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_truncate_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "truncate_table_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) +{ + int32_t seqid = send_get_tables(db_name, pattern); + recv_get_tables(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_tables(const std::string& db_name, const std::string& pattern) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_tables", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_pargs args; + args.db_name = &db_name; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_tables(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_tables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) +{ + int32_t seqid = send_get_tables_by_type(db_name, pattern, tableType); + recv_get_tables_by_type(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_tables_by_type(const std::string& db_name, const std::string& pattern, const std::string& tableType) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_tables_by_type", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_by_type_pargs args; + args.db_name = &db_name; + args.pattern = &pattern; + args.tableType = &tableType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_tables_by_type(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables_by_type") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_tables_by_type_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables_by_type failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_materialized_view_objects_for_rewriting(std::vector
& _return) +{ + int32_t seqid = send_get_all_materialized_view_objects_for_rewriting(); + recv_get_all_materialized_view_objects_for_rewriting(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_materialized_view_objects_for_rewriting() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_materialized_view_objects_for_rewriting", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_materialized_view_objects_for_rewriting(std::vector
& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_materialized_view_objects_for_rewriting") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_materialized_view_objects_for_rewriting failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) +{ + int32_t seqid = send_get_materialized_views_for_rewriting(db_name); + recv_get_materialized_views_for_rewriting(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_materialized_views_for_rewriting(const std::string& db_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_materialized_views_for_rewriting", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs args; + args.db_name = &db_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_materialized_views_for_rewriting(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_materialized_views_for_rewriting") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_materialized_views_for_rewriting_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_materialized_views_for_rewriting failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) +{ + int32_t seqid = send_get_table_meta(db_patterns, tbl_patterns, tbl_types); + recv_get_table_meta(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_meta(const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_meta", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_meta_pargs args; + args.db_patterns = &db_patterns; + args.tbl_patterns = &tbl_patterns; + args.tbl_types = &tbl_types; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_meta(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_meta") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_meta_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_meta failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_tables(std::vector & _return, const std::string& db_name) +{ + int32_t seqid = send_get_all_tables(db_name); + recv_get_all_tables(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_tables(const std::string& db_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_tables", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_tables_pargs args; + args.db_name = &db_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_tables(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_tables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_tables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_tables failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) +{ + int32_t seqid = send_get_tables_ext(req); + recv_get_tables_ext(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_tables_ext(const GetTablesExtRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_tables_ext", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_tables_ext_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_tables_ext(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_tables_ext") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_tables_ext_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_tables_ext failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_req(GetTableResult& _return, const GetTableRequest& req) +{ + int32_t seqid = send_get_table_req(req); + recv_get_table_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_req(const GetTableRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_req(GetTableResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) +{ + int32_t seqid = send_get_table_objects_by_name_req(req); + recv_get_table_objects_by_name_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_objects_by_name_req(const GetTablesRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_objects_by_name_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_objects_by_name_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_objects_by_name_req(GetTablesResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_objects_by_name_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_objects_by_name_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_objects_by_name_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) +{ + int32_t seqid = send_get_materialization_invalidation_info(creation_metadata, validTxnList); + recv_get_materialization_invalidation_info(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_materialization_invalidation_info(const CreationMetadata& creation_metadata, const std::string& validTxnList) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_materialization_invalidation_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_materialization_invalidation_info_pargs args; + args.creation_metadata = &creation_metadata; + args.validTxnList = &validTxnList; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_materialization_invalidation_info(Materialization& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_materialization_invalidation_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_materialization_invalidation_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_materialization_invalidation_info failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) +{ + int32_t seqid = send_update_creation_metadata(catName, dbname, tbl_name, creation_metadata); + recv_update_creation_metadata(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_creation_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_creation_metadata_pargs args; + args.catName = &catName; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.creation_metadata = &creation_metadata; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_creation_metadata(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_creation_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_creation_metadata_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) +{ + int32_t seqid = send_get_table_names_by_filter(dbname, filter, max_tables); + recv_get_table_names_by_filter(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_names_by_filter(const std::string& dbname, const std::string& filter, const int16_t max_tables) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_names_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_names_by_filter_pargs args; + args.dbname = &dbname; + args.filter = &filter; + args.max_tables = &max_tables; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_names_by_filter(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_names_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_names_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_names_by_filter failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +{ + int32_t seqid = send_alter_table(dbname, tbl_name, new_tbl); + recv_alter_table(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_table", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_table(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_table_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_alter_table_with_environment_context(dbname, tbl_name, new_tbl, environment_context); + recv_alter_table_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_table_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_with_environment_context_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_table_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_table_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) +{ + int32_t seqid = send_alter_table_with_cascade(dbname, tbl_name, new_tbl, cascade); + recv_alter_table_with_cascade(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_table_with_cascade", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_with_cascade_pargs args; + args.dbname = &dbname; + args.tbl_name = &tbl_name; + args.new_tbl = &new_tbl; + args.cascade = &cascade; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_table_with_cascade(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_with_cascade") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_table_with_cascade_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) +{ + int32_t seqid = send_alter_table_req(req); + recv_alter_table_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_table_req(const AlterTableRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_table_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_table_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_table_req(AlterTableResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_table_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_table_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_table_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_partition(Partition& _return, const Partition& new_part) +{ + int32_t seqid = send_add_partition(new_part); + recv_add_partition(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_partition(const Partition& new_part) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partition_pargs args; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_partition(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_add_partition_with_environment_context(new_part, environment_context); + recv_add_partition_with_environment_context(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_partition_with_environment_context(const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partition_with_environment_context_pargs args; + args.new_part = &new_part; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_partition_with_environment_context(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partition_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int32_t ThriftHiveMetastoreConcurrentClient::add_partitions(const std::vector & new_parts) +{ + int32_t seqid = send_add_partitions(new_parts); + return recv_add_partitions(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_partitions(const std::vector & new_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_pargs args; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int32_t ThriftHiveMetastoreConcurrentClient::recv_add_partitions(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int32_t _return; + ThriftHiveMetastore_add_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int32_t ThriftHiveMetastoreConcurrentClient::add_partitions_pspec(const std::vector & new_parts) +{ + int32_t seqid = send_add_partitions_pspec(new_parts); + return recv_add_partitions_pspec(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_partitions_pspec(const std::vector & new_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_partitions_pspec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_pspec_pargs args; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int32_t ThriftHiveMetastoreConcurrentClient::recv_add_partitions_pspec(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions_pspec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int32_t _return; + ThriftHiveMetastore_add_partitions_pspec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions_pspec failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t seqid = send_append_partition(db_name, tbl_name, part_vals); + recv_append_partition(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("append_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_append_partition(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_append_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) +{ + int32_t seqid = send_add_partitions_req(request); + recv_add_partitions_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_partitions_req(const AddPartitionsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_partitions_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_partitions_req(AddPartitionsResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_partitions_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_append_partition_with_environment_context(db_name, tbl_name, part_vals, environment_context); + recv_append_partition_with_environment_context(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_append_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("append_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_append_partition_with_environment_context(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_append_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) +{ + int32_t seqid = send_append_partition_req(appendPartitionsReq); + recv_append_partition_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_append_partition_req(const AppendPartitionsRequest& appendPartitionsReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("append_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_req_pargs args; + args.appendPartitionsReq = &appendPartitionsReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_append_partition_req(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_append_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t seqid = send_append_partition_by_name(db_name, tbl_name, part_name); + recv_append_partition_by_name(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("append_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_append_partition_by_name(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_append_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_append_partition_by_name_with_environment_context(db_name, tbl_name, part_name, environment_context); + recv_append_partition_by_name_with_environment_context(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_append_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("append_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_append_partition_by_name_with_environment_context(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("append_partition_by_name_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "append_partition_by_name_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +{ + int32_t seqid = send_drop_partition(db_name, tbl_name, part_vals, deleteData); + return recv_drop_partition(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_partition(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_drop_partition_with_environment_context(db_name, tbl_name, part_vals, deleteData, environment_context); + return recv_drop_partition_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_partition_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_partition_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_partition_req(const DropPartitionRequest& dropPartitionReq) +{ + int32_t seqid = send_drop_partition_req(dropPartitionReq); + return recv_drop_partition_req(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partition_req(const DropPartitionRequest& dropPartitionReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_req_pargs args; + args.dropPartitionReq = &dropPartitionReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_partition_req(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +{ + int32_t seqid = send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData); + return recv_drop_partition_by_name(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.deleteData = &deleteData; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_partition_by_name(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context); + return recv_drop_partition_by_name_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partition_by_name_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.deleteData = &deleteData; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_partition_by_name_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partition_by_name_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partition_by_name_with_environment_context failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) +{ + int32_t seqid = send_drop_partitions_req(req); + recv_drop_partitions_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_partitions_req(const DropPartitionsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_partitions_req(DropPartitionsResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_partitions_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t seqid = send_get_partition(db_name, tbl_name, part_vals); + recv_get_partition(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) +{ + int32_t seqid = send_get_partition_req(req); + recv_get_partition_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_req(const GetPartitionRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_req(GetPartitionResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t seqid = send_exchange_partition(partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + recv_exchange_partition(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_exchange_partition(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("exchange_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_exchange_partition_pargs args; + args.partitionSpecs = &partitionSpecs; + args.source_db = &source_db; + args.source_table_name = &source_table_name; + args.dest_db = &dest_db; + args.dest_table_name = &dest_table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_exchange_partition(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("exchange_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_exchange_partition_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exchange_partition failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t seqid = send_exchange_partitions(partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + recv_exchange_partitions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_exchange_partitions(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("exchange_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_exchange_partitions_pargs args; + args.partitionSpecs = &partitionSpecs; + args.source_db = &source_db; + args.source_table_name = &source_table_name; + args.dest_db = &dest_db; + args.dest_table_name = &dest_table_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_exchange_partitions(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("exchange_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_exchange_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "exchange_partitions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +{ + int32_t seqid = send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names); + recv_get_partition_with_auth(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_with_auth(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_with_auth failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t seqid = send_get_partition_by_name(db_name, tbl_name, part_name); + recv_get_partition_by_name(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_by_name", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_by_name_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_by_name(Partition& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_by_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_by_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_by_name failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t seqid = send_get_partitions(db_name, tbl_name, max_parts); + recv_get_partitions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) +{ + int32_t seqid = send_get_partitions_req(req); + recv_get_partitions_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_req(const PartitionsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_req(PartitionsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t seqid = send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names); + recv_get_partitions_with_auth(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_with_auth(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_with_auth failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) +{ + int32_t seqid = send_get_partitions_pspec(db_name, tbl_name, max_parts); + recv_get_partitions_pspec(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_pspec(const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_pspec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_pspec_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_pspec(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_pspec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_pspec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_pspec failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t seqid = send_get_partition_names(db_name, tbl_name, max_parts); + recv_get_partition_names(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_names(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) +{ + int32_t seqid = send_fetch_partition_names_req(partitionReq); + recv_fetch_partition_names_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_fetch_partition_names_req(const PartitionsRequest& partitionReq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("fetch_partition_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_fetch_partition_names_req_pargs args; + args.partitionReq = &partitionReq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_fetch_partition_names_req(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fetch_partition_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_fetch_partition_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetch_partition_names_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) +{ + int32_t seqid = send_get_partition_values(request); + recv_get_partition_values(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_values(const PartitionValuesRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_values", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_values_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_values(PartitionValuesResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_values") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_values_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_values failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t seqid = send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partitions_ps(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_ps", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_ps(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_ps_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t seqid = send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names); + recv_get_partitions_ps_with_auth(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_ps_with_auth", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_with_auth_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_ps_with_auth(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps_with_auth") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_ps_with_auth_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps_with_auth failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) +{ + int32_t seqid = send_get_partitions_ps_with_auth_req(req); + recv_get_partitions_ps_with_auth_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_ps_with_auth_req(const GetPartitionsPsWithAuthRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_ps_with_auth_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_ps_with_auth_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_ps_with_auth_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t seqid = send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts); + recv_get_partition_names_ps(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_names_ps", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_ps_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_names_ps(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_ps") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_names_ps_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_ps failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) +{ + int32_t seqid = send_get_partition_names_ps_req(req); + recv_get_partition_names_ps_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_names_ps_req(const GetPartitionNamesPsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_names_ps_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_ps_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_ps_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_names_ps_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_ps_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) +{ + int32_t seqid = send_get_partition_names_req(req); + recv_get_partition_names_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_names_req(const PartitionsByExprRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_names_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_names_req(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_names_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +{ + int32_t seqid = send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts); + recv_get_partitions_by_filter(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_filter(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_filter failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) +{ + int32_t seqid = send_get_partitions_by_filter_req(req); + recv_get_partitions_by_filter_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_by_filter_req(const GetPartitionsByFilterRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_by_filter_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_filter_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_filter_req(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_filter_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_by_filter_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_filter_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) +{ + int32_t seqid = send_get_part_specs_by_filter(db_name, tbl_name, filter, max_parts); + recv_get_part_specs_by_filter(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_part_specs_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_part_specs_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_part_specs_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.max_parts = &max_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_part_specs_by_filter(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_part_specs_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_part_specs_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_part_specs_by_filter failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) +{ + int32_t seqid = send_get_partitions_by_expr(req); + recv_get_partitions_by_expr(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_by_expr(const PartitionsByExprRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_expr(PartitionsByExprResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_expr failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) +{ + int32_t seqid = send_get_partitions_spec_by_expr(req); + recv_get_partitions_spec_by_expr(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_spec_by_expr(const PartitionsByExprRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_spec_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_spec_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_spec_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_spec_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_spec_by_expr failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int32_t ThriftHiveMetastoreConcurrentClient::get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t seqid = send_get_num_partitions_by_filter(db_name, tbl_name, filter); + return recv_get_num_partitions_by_filter(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_num_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int32_t ThriftHiveMetastoreConcurrentClient::recv_get_num_partitions_by_filter(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_num_partitions_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int32_t _return; + ThriftHiveMetastore_get_num_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) +{ + int32_t seqid = send_get_partitions_by_names(db_name, tbl_name, names); + recv_get_partitions_by_names(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_by_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_names_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.names = &names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_names(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_by_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) +{ + int32_t seqid = send_get_partitions_by_names_req(req); + recv_get_partitions_by_names_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_by_names_req(const GetPartitionsByNamesRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_by_names_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_by_names_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_by_names_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_by_names_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_names_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) +{ + int32_t seqid = send_get_properties(req); + recv_get_properties(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_properties(const PropertyGetRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_properties", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_properties_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_properties(PropertyGetResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_properties") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_properties_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.e1) { + sentry.commit(); + throw result.e1; + } + if (result.__isset.e2) { + sentry.commit(); + throw result.e2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_properties failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::set_properties(const PropertySetRequest& req) +{ + int32_t seqid = send_set_properties(req); + return recv_set_properties(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_set_properties(const PropertySetRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("set_properties", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_properties_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_set_properties(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_properties") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_set_properties_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.e1) { + sentry.commit(); + throw result.e1; + } + if (result.__isset.e2) { + sentry.commit(); + throw result.e2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_properties failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) +{ + int32_t seqid = send_alter_partition(db_name, tbl_name, new_part); + recv_alter_partition(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_partition(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_partition_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) +{ + int32_t seqid = send_alter_partitions(db_name, tbl_name, new_parts); + recv_alter_partitions(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_parts = &new_parts; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_partitions(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_partitions_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context); + recv_alter_partitions_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_partitions_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_parts = &new_parts; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_partitions_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_partitions_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) +{ + int32_t seqid = send_alter_partitions_req(req); + recv_alter_partitions_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_partitions_req(const AlterPartitionsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_partitions_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partitions_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_partitions_req(AlterPartitionsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partitions_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_partitions_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_partitions_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t seqid = send_alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context); + recv_alter_partition_with_environment_context(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_partition_with_environment_context", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_partition_with_environment_context_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.new_part = &new_part; + args.environment_context = &environment_context; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_partition_with_environment_context(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_partition_with_environment_context") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_partition_with_environment_context_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) +{ + int32_t seqid = send_rename_partition(db_name, tbl_name, part_vals, new_part); + recv_rename_partition(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("rename_partition", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_rename_partition_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.new_part = &new_part; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_rename_partition(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("rename_partition") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_rename_partition_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) +{ + int32_t seqid = send_rename_partition_req(req); + recv_rename_partition_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_rename_partition_req(const RenamePartitionRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("rename_partition_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_rename_partition_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_rename_partition_req(RenamePartitionResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("rename_partition_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_rename_partition_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "rename_partition_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + int32_t seqid = send_partition_name_has_valid_characters(part_vals, throw_exception); + return recv_partition_name_has_valid_characters(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("partition_name_has_valid_characters", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_has_valid_characters_pargs args; + args.part_vals = &part_vals; + args.throw_exception = &throw_exception; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_partition_name_has_valid_characters(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_has_valid_characters") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_partition_name_has_valid_characters_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_has_valid_characters failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) +{ + int32_t seqid = send_get_config_value(name, defaultValue); + recv_get_config_value(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_config_value(const std::string& name, const std::string& defaultValue) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_config_value", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_config_value_pargs args; + args.name = &name; + args.defaultValue = &defaultValue; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_config_value(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_config_value") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_config_value_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_config_value failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::partition_name_to_vals(std::vector & _return, const std::string& part_name) +{ + int32_t seqid = send_partition_name_to_vals(part_name); + recv_partition_name_to_vals(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_partition_name_to_vals(const std::string& part_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("partition_name_to_vals", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_to_vals_pargs args; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_partition_name_to_vals(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_to_vals") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_partition_name_to_vals_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_vals failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::partition_name_to_spec(std::map & _return, const std::string& part_name) +{ + int32_t seqid = send_partition_name_to_spec(part_name); + recv_partition_name_to_spec(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_partition_name_to_spec(const std::string& part_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("partition_name_to_spec", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_partition_name_to_spec_pargs args; + args.part_name = &part_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_partition_name_to_spec(std::map & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("partition_name_to_spec") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_partition_name_to_spec_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "partition_name_to_spec failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t seqid = send_markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + recv_markPartitionForEvent(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("markPartitionForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_markPartitionForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_markPartitionForEvent(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("markPartitionForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_markPartitionForEvent_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + if (result.__isset.o5) { + sentry.commit(); + throw result.o5; + } + if (result.__isset.o6) { + sentry.commit(); + throw result.o6; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t seqid = send_isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + return recv_isPartitionMarkedForEvent(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("isPartitionMarkedForEvent", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_isPartitionMarkedForEvent_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_vals = &part_vals; + args.eventType = &eventType; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_isPartitionMarkedForEvent(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("isPartitionMarkedForEvent") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_isPartitionMarkedForEvent_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + if (result.__isset.o5) { + sentry.commit(); + throw result.o5; + } + if (result.__isset.o6) { + sentry.commit(); + throw result.o6; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "isPartitionMarkedForEvent failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) +{ + int32_t seqid = send_get_primary_keys(request); + recv_get_primary_keys(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_primary_keys(const PrimaryKeysRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_primary_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_primary_keys_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_primary_keys(PrimaryKeysResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_primary_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_primary_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_primary_keys failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) +{ + int32_t seqid = send_get_foreign_keys(request); + recv_get_foreign_keys(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_foreign_keys(const ForeignKeysRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_foreign_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_foreign_keys_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_foreign_keys(ForeignKeysResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_foreign_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_foreign_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_foreign_keys failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) +{ + int32_t seqid = send_get_unique_constraints(request); + recv_get_unique_constraints(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_unique_constraints(const UniqueConstraintsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_unique_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_unique_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_unique_constraints(UniqueConstraintsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_unique_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_unique_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_unique_constraints failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) +{ + int32_t seqid = send_get_not_null_constraints(request); + recv_get_not_null_constraints(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_not_null_constraints(const NotNullConstraintsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_not_null_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_not_null_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_not_null_constraints(NotNullConstraintsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_not_null_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_not_null_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_not_null_constraints failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) +{ + int32_t seqid = send_get_default_constraints(request); + recv_get_default_constraints(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_default_constraints(const DefaultConstraintsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_default_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_default_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_default_constraints(DefaultConstraintsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_default_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_default_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_default_constraints failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) +{ + int32_t seqid = send_get_check_constraints(request); + recv_get_check_constraints(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_check_constraints(const CheckConstraintsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_check_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_check_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_check_constraints(CheckConstraintsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_check_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_check_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_check_constraints failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) +{ + int32_t seqid = send_get_all_table_constraints(request); + recv_get_all_table_constraints(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_table_constraints(const AllTableConstraintsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_table_constraints", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_table_constraints_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_table_constraints(AllTableConstraintsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_table_constraints") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_table_constraints_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_table_constraints failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::update_table_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t seqid = send_update_table_column_statistics(stats_obj); + return recv_update_table_column_statistics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_table_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_table_column_statistics_pargs args; + args.stats_obj = &stats_obj; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_update_table_column_statistics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_update_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_table_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::update_partition_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t seqid = send_update_partition_column_statistics(stats_obj); + return recv_update_partition_column_statistics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_partition_column_statistics(const ColumnStatistics& stats_obj) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_partition_column_statistics_pargs args; + args.stats_obj = &stats_obj; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_update_partition_column_statistics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_update_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_partition_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) +{ + int32_t seqid = send_update_table_column_statistics_req(req); + recv_update_table_column_statistics_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_table_column_statistics_req(const SetPartitionsStatsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_table_column_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_table_column_statistics_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_table_column_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_table_column_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_table_column_statistics_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) +{ + int32_t seqid = send_update_partition_column_statistics_req(req); + recv_update_partition_column_statistics_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_partition_column_statistics_req(const SetPartitionsStatsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_partition_column_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_partition_column_statistics_req_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_partition_column_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_partition_column_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_partition_column_statistics_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_transaction_statistics(const UpdateTransactionalStatsRequest& req) +{ + int32_t seqid = send_update_transaction_statistics(req); + recv_update_transaction_statistics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_transaction_statistics(const UpdateTransactionalStatsRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_transaction_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_transaction_statistics_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_transaction_statistics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_transaction_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_transaction_statistics_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) +{ + int32_t seqid = send_get_table_column_statistics(db_name, tbl_name, col_name); + recv_get_table_column_statistics(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.col_name = &col_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_column_statistics(ColumnStatistics& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) +{ + int32_t seqid = send_get_partition_column_statistics(db_name, tbl_name, part_name, col_name); + recv_get_partition_column_statistics(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partition_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.col_name = &col_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partition_column_statistics(ColumnStatistics& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partition_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) +{ + int32_t seqid = send_get_table_statistics_req(request); + recv_get_table_statistics_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_table_statistics_req(const TableStatsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_table_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_table_statistics_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_table_statistics_req(TableStatsResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_table_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_table_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_table_statistics_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) +{ + int32_t seqid = send_get_partitions_statistics_req(request); + recv_get_partitions_statistics_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_statistics_req(const PartitionsStatsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_statistics_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_statistics_req_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_statistics_req(PartitionsStatsResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_statistics_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_statistics_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_statistics_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) +{ + int32_t seqid = send_get_aggr_stats_for(request); + recv_get_aggr_stats_for(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_aggr_stats_for(const PartitionsStatsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_aggr_stats_for", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_aggr_stats_for_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_aggr_stats_for(AggrStats& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_aggr_stats_for") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_aggr_stats_for_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_aggr_stats_for failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::set_aggr_stats_for(const SetPartitionsStatsRequest& request) +{ + int32_t seqid = send_set_aggr_stats_for(request); + return recv_set_aggr_stats_for(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_set_aggr_stats_for(const SetPartitionsStatsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("set_aggr_stats_for", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_aggr_stats_for_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_set_aggr_stats_for(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_aggr_stats_for") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_set_aggr_stats_for_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_aggr_stats_for failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) +{ + int32_t seqid = send_delete_partition_column_statistics(db_name, tbl_name, part_name, col_name, engine); + return recv_delete_partition_column_statistics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("delete_partition_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_delete_partition_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.part_name = &part_name; + args.col_name = &col_name; + args.engine = &engine; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_delete_partition_column_statistics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("delete_partition_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_delete_partition_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "delete_partition_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) +{ + int32_t seqid = send_delete_table_column_statistics(db_name, tbl_name, col_name, engine); + return recv_delete_table_column_statistics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("delete_table_column_statistics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_delete_table_column_statistics_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.col_name = &col_name; + args.engine = &engine; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_delete_table_column_statistics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("delete_table_column_statistics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_delete_table_column_statistics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "delete_table_column_statistics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_function(const Function& func) +{ + int32_t seqid = send_create_function(func); + recv_create_function(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_function(const Function& func) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_function_pargs args; + args.func = &func; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_function(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_function(const std::string& dbName, const std::string& funcName) +{ + int32_t seqid = send_drop_function(dbName, funcName); + recv_drop_function(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_function(const std::string& dbName, const std::string& funcName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_function(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) +{ + int32_t seqid = send_alter_function(dbName, funcName, newFunc); + recv_alter_function(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.newFunc = &newFunc; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_function(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_function_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) +{ + int32_t seqid = send_get_functions(dbName, pattern); + recv_get_functions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_functions(const std::string& dbName, const std::string& pattern) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_functions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_functions_pargs args; + args.dbName = &dbName; + args.pattern = &pattern; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_functions(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_functions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_functions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_functions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_function(Function& _return, const std::string& dbName, const std::string& funcName) +{ + int32_t seqid = send_get_function(dbName, funcName); + recv_get_function(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_function(const std::string& dbName, const std::string& funcName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_function", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_function_pargs args; + args.dbName = &dbName; + args.funcName = &funcName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_function(Function& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_function") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_function_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_function failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_functions(GetAllFunctionsResponse& _return) +{ + int32_t seqid = send_get_all_functions(); + recv_get_all_functions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_functions() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_functions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_functions_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_functions(GetAllFunctionsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_functions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_functions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_functions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::create_role(const Role& role) +{ + int32_t seqid = send_create_role(role); + return recv_create_role(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_role(const Role& role) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_role_pargs args; + args.role = &role; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_create_role(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_create_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::drop_role(const std::string& role_name) +{ + int32_t seqid = send_drop_role(role_name); + return recv_drop_role(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_role(const std::string& role_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_role_pargs args; + args.role_name = &role_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_drop_role(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_drop_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_role_names(std::vector & _return) +{ + int32_t seqid = send_get_role_names(); + recv_get_role_names(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_role_names() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_role_names", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_role_names_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_role_names(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_role_names") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_role_names_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_role_names failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +{ + int32_t seqid = send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); + return recv_grant_role(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("grant_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.grantor = &grantor; + args.grantorType = &grantorType; + args.grant_option = &grant_option; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_grant_role(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_grant_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t seqid = send_revoke_role(role_name, principal_name, principal_type); + return recv_revoke_role(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_revoke_role_pargs args; + args.role_name = &role_name; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_revoke_role(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("revoke_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_revoke_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t seqid = send_list_roles(principal_name, principal_type); + recv_list_roles(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("list_roles", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_list_roles_pargs args; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_list_roles(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("list_roles") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_list_roles_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_roles failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) +{ + int32_t seqid = send_grant_revoke_role(request); + recv_grant_revoke_role(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_grant_revoke_role(const GrantRevokeRoleRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("grant_revoke_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_revoke_role_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_grant_revoke_role(GrantRevokeRoleResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_revoke_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_grant_revoke_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_revoke_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) +{ + int32_t seqid = send_get_principals_in_role(request); + recv_get_principals_in_role(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_principals_in_role(const GetPrincipalsInRoleRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_principals_in_role", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_principals_in_role_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_principals_in_role(GetPrincipalsInRoleResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_principals_in_role") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_principals_in_role_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_principals_in_role failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) +{ + int32_t seqid = send_get_role_grants_for_principal(request); + recv_get_role_grants_for_principal(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_role_grants_for_principal(const GetRoleGrantsForPrincipalRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_role_grants_for_principal", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_role_grants_for_principal_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_role_grants_for_principal") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_role_grants_for_principal_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_role_grants_for_principal failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +{ + int32_t seqid = send_get_privilege_set(hiveObject, user_name, group_names); + recv_get_privilege_set(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_privilege_set", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_privilege_set_pargs args; + args.hiveObject = &hiveObject; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_privilege_set(PrincipalPrivilegeSet& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_privilege_set") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_privilege_set_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_privilege_set failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +{ + int32_t seqid = send_list_privileges(principal_name, principal_type, hiveObject); + recv_list_privileges(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("list_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_list_privileges_pargs args; + args.principal_name = &principal_name; + args.principal_type = &principal_type; + args.hiveObject = &hiveObject; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_list_privileges(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("list_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_list_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "list_privileges failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::grant_privileges(const PrivilegeBag& privileges) +{ + int32_t seqid = send_grant_privileges(privileges); + return recv_grant_privileges(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_grant_privileges(const PrivilegeBag& privileges) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("grant_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_privileges_pargs args; + args.privileges = &privileges; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_grant_privileges(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_grant_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_privileges failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::revoke_privileges(const PrivilegeBag& privileges) +{ + int32_t seqid = send_revoke_privileges(privileges); + return recv_revoke_privileges(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_revoke_privileges(const PrivilegeBag& privileges) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_revoke_privileges_pargs args; + args.privileges = &privileges; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_revoke_privileges(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("revoke_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_revoke_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "revoke_privileges failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) +{ + int32_t seqid = send_grant_revoke_privileges(request); + recv_grant_revoke_privileges(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_grant_revoke_privileges(const GrantRevokePrivilegeRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("grant_revoke_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_grant_revoke_privileges_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("grant_revoke_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_grant_revoke_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "grant_revoke_privileges failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) +{ + int32_t seqid = send_refresh_privileges(objToRefresh, authorizer, grantRequest); + recv_refresh_privileges(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_refresh_privileges(const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("refresh_privileges", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_refresh_privileges_pargs args; + args.objToRefresh = &objToRefresh; + args.authorizer = &authorizer; + args.grantRequest = &grantRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_refresh_privileges(GrantRevokePrivilegeResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("refresh_privileges") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_refresh_privileges_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "refresh_privileges failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) +{ + int32_t seqid = send_set_ugi(user_name, group_names); + recv_set_ugi(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_set_ugi(const std::string& user_name, const std::vector & group_names) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("set_ugi", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_ugi_pargs args; + args.user_name = &user_name; + args.group_names = &group_names; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_set_ugi(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_ugi") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_set_ugi_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "set_ugi failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) +{ + int32_t seqid = send_get_delegation_token(token_owner, renewer_kerberos_principal_name); + recv_get_delegation_token(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_delegation_token(const std::string& token_owner, const std::string& renewer_kerberos_principal_name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_delegation_token_pargs args; + args.token_owner = &token_owner; + args.renewer_kerberos_principal_name = &renewer_kerberos_principal_name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_delegation_token(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_delegation_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_delegation_token failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int64_t ThriftHiveMetastoreConcurrentClient::renew_delegation_token(const std::string& token_str_form) +{ + int32_t seqid = send_renew_delegation_token(token_str_form); + return recv_renew_delegation_token(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_renew_delegation_token(const std::string& token_str_form) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("renew_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_renew_delegation_token_pargs args; + args.token_str_form = &token_str_form; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t ThriftHiveMetastoreConcurrentClient::recv_renew_delegation_token(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("renew_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + ThriftHiveMetastore_renew_delegation_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "renew_delegation_token failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::cancel_delegation_token(const std::string& token_str_form) +{ + int32_t seqid = send_cancel_delegation_token(token_str_form); + recv_cancel_delegation_token(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_cancel_delegation_token(const std::string& token_str_form) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("cancel_delegation_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cancel_delegation_token_pargs args; + args.token_str_form = &token_str_form; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_cancel_delegation_token(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cancel_delegation_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_cancel_delegation_token_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::add_token(const std::string& token_identifier, const std::string& delegation_token) +{ + int32_t seqid = send_add_token(token_identifier, delegation_token); + return recv_add_token(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_token(const std::string& token_identifier, const std::string& delegation_token) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_token_pargs args; + args.token_identifier = &token_identifier; + args.delegation_token = &delegation_token; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_add_token(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_add_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_token failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::remove_token(const std::string& token_identifier) +{ + int32_t seqid = send_remove_token(token_identifier); + return recv_remove_token(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_remove_token(const std::string& token_identifier) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("remove_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_token_pargs args; + args.token_identifier = &token_identifier; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_remove_token(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_remove_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "remove_token failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_token(std::string& _return, const std::string& token_identifier) +{ + int32_t seqid = send_get_token(token_identifier); + recv_get_token(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_token(const std::string& token_identifier) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_token", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_token_pargs args; + args.token_identifier = &token_identifier; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_token(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_token") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_token_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_token failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_token_identifiers(std::vector & _return) +{ + int32_t seqid = send_get_all_token_identifiers(); + recv_get_all_token_identifiers(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_token_identifiers() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_token_identifiers", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_token_identifiers_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_token_identifiers(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_token_identifiers") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_token_identifiers_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_token_identifiers failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int32_t ThriftHiveMetastoreConcurrentClient::add_master_key(const std::string& key) +{ + int32_t seqid = send_add_master_key(key); + return recv_add_master_key(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_master_key(const std::string& key) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_master_key_pargs args; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int32_t ThriftHiveMetastoreConcurrentClient::recv_add_master_key(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int32_t _return; + ThriftHiveMetastore_add_master_key_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_master_key failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_master_key(const int32_t seq_number, const std::string& key) +{ + int32_t seqid = send_update_master_key(seq_number, key); + recv_update_master_key(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_master_key(const int32_t seq_number, const std::string& key) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_master_key_pargs args; + args.seq_number = &seq_number; + args.key = &key; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_master_key(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_master_key_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::remove_master_key(const int32_t key_seq) +{ + int32_t seqid = send_remove_master_key(key_seq); + return recv_remove_master_key(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_remove_master_key(const int32_t key_seq) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("remove_master_key", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_master_key_pargs args; + args.key_seq = &key_seq; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_remove_master_key(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_master_key") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_remove_master_key_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "remove_master_key failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_master_keys(std::vector & _return) +{ + int32_t seqid = send_get_master_keys(); + recv_get_master_keys(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_master_keys() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_master_keys", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_master_keys_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_master_keys(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_master_keys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_master_keys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_master_keys failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_open_txns(GetOpenTxnsResponse& _return) +{ + int32_t seqid = send_get_open_txns(); + recv_get_open_txns(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_open_txns() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_open_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_open_txns(GetOpenTxnsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_open_txns_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_open_txns_info(GetOpenTxnsInfoResponse& _return) +{ + int32_t seqid = send_get_open_txns_info(); + recv_get_open_txns_info(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_open_txns_info() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_open_txns_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_info_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_open_txns_info(GetOpenTxnsInfoResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_open_txns_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns_info failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) +{ + int32_t seqid = send_open_txns(rqst); + recv_open_txns(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_open_txns(const OpenTxnRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("open_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_open_txns_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_open_txns(OpenTxnsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("open_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_open_txns_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "open_txns failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::abort_txn(const AbortTxnRequest& rqst) +{ + int32_t seqid = send_abort_txn(rqst); + recv_abort_txn(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_abort_txn(const AbortTxnRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("abort_txn", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_txn_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_abort_txn(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_txn") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_abort_txn_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::abort_txns(const AbortTxnsRequest& rqst) +{ + int32_t seqid = send_abort_txns(rqst); + recv_abort_txns(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_abort_txns(const AbortTxnsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("abort_txns", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_abort_txns_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_abort_txns(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("abort_txns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_abort_txns_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::commit_txn(const CommitTxnRequest& rqst) +{ + int32_t seqid = send_commit_txn(rqst); + recv_commit_txn(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_commit_txn(const CommitTxnRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("commit_txn", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_commit_txn_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_commit_txn(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("commit_txn") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_commit_txn_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +int64_t ThriftHiveMetastoreConcurrentClient::get_latest_txnid_in_conflict(const int64_t txnId) +{ + int32_t seqid = send_get_latest_txnid_in_conflict(txnId); + return recv_get_latest_txnid_in_conflict(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_latest_txnid_in_conflict(const int64_t txnId) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_latest_txnid_in_conflict", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs args; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int64_t ThriftHiveMetastoreConcurrentClient::recv_get_latest_txnid_in_conflict(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_latest_txnid_in_conflict") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + int64_t _return; + ThriftHiveMetastore_get_latest_txnid_in_conflict_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_latest_txnid_in_conflict failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) +{ + int32_t seqid = send_repl_tbl_writeid_state(rqst); + recv_repl_tbl_writeid_state(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("repl_tbl_writeid_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_repl_tbl_writeid_state_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_repl_tbl_writeid_state(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("repl_tbl_writeid_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_repl_tbl_writeid_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) +{ + int32_t seqid = send_get_valid_write_ids(rqst); + recv_get_valid_write_ids(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_valid_write_ids(const GetValidWriteIdsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_valid_write_ids", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_valid_write_ids_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_valid_write_ids(GetValidWriteIdsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_valid_write_ids") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_valid_write_ids_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_valid_write_ids failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) +{ + int32_t seqid = send_add_write_ids_to_min_history(txnId, writeIds); + recv_add_write_ids_to_min_history(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_write_ids_to_min_history", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_ids_to_min_history_pargs args; + args.txnId = &txnId; + args.writeIds = &writeIds; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_write_ids_to_min_history(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_ids_to_min_history") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_write_ids_to_min_history_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) +{ + int32_t seqid = send_allocate_table_write_ids(rqst); + recv_allocate_table_write_ids(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_allocate_table_write_ids(const AllocateTableWriteIdsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("allocate_table_write_ids", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_allocate_table_write_ids_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("allocate_table_write_ids") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_allocate_table_write_ids_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "allocate_table_write_ids failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) +{ + int32_t seqid = send_get_max_allocated_table_write_id(rqst); + recv_get_max_allocated_table_write_id(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_max_allocated_table_write_id(const MaxAllocatedTableWriteIdRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_max_allocated_table_write_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_max_allocated_table_write_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_max_allocated_table_write_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_max_allocated_table_write_id_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_max_allocated_table_write_id failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::seed_write_id(const SeedTableWriteIdsRequest& rqst) +{ + int32_t seqid = send_seed_write_id(rqst); + recv_seed_write_id(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_seed_write_id(const SeedTableWriteIdsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("seed_write_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_seed_write_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_seed_write_id(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("seed_write_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_seed_write_id_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::seed_txn_id(const SeedTxnIdRequest& rqst) +{ + int32_t seqid = send_seed_txn_id(rqst); + recv_seed_txn_id(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_seed_txn_id(const SeedTxnIdRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("seed_txn_id", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_seed_txn_id_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_seed_txn_id(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("seed_txn_id") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_seed_txn_id_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::lock(LockResponse& _return, const LockRequest& rqst) +{ + int32_t seqid = send_lock(rqst); + recv_lock(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_lock(const LockRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("lock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_lock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_lock(LockResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("lock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_lock_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "lock failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::check_lock(LockResponse& _return, const CheckLockRequest& rqst) +{ + int32_t seqid = send_check_lock(rqst); + recv_check_lock(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_check_lock(const CheckLockRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("check_lock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_check_lock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_check_lock(LockResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("check_lock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_check_lock_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "check_lock failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::unlock(const UnlockRequest& rqst) +{ + int32_t seqid = send_unlock(rqst); + recv_unlock(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_unlock(const UnlockRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("unlock", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_unlock_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_unlock(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("unlock") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_unlock_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) +{ + int32_t seqid = send_show_locks(rqst); + recv_show_locks(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_show_locks(const ShowLocksRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("show_locks", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_show_locks_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_show_locks(ShowLocksResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("show_locks") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_show_locks_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "show_locks failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::heartbeat(const HeartbeatRequest& ids) +{ + int32_t seqid = send_heartbeat(ids); + recv_heartbeat(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_heartbeat(const HeartbeatRequest& ids) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("heartbeat", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_pargs args; + args.ids = &ids; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_heartbeat(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_heartbeat_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) +{ + int32_t seqid = send_heartbeat_txn_range(txns); + recv_heartbeat_txn_range(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_heartbeat_txn_range(const HeartbeatTxnRangeRequest& txns) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("heartbeat_txn_range", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_txn_range_pargs args; + args.txns = &txns; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat_txn_range") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_heartbeat_txn_range_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "heartbeat_txn_range failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::compact(const CompactionRequest& rqst) +{ + int32_t seqid = send_compact(rqst); + recv_compact(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_compact(const CompactionRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_compact_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_compact(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_compact_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::compact2(CompactionResponse& _return, const CompactionRequest& rqst) +{ + int32_t seqid = send_compact2(rqst); + recv_compact2(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_compact2(const CompactionRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("compact2", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_compact2_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_compact2(CompactionResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("compact2") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_compact2_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "compact2 failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) +{ + int32_t seqid = send_show_compact(rqst); + recv_show_compact(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_show_compact(const ShowCompactRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("show_compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_show_compact_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_show_compact(ShowCompactResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("show_compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_show_compact_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "show_compact failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) +{ + int32_t seqid = send_submit_for_cleanup(o1, o2, o3); + return recv_submit_for_cleanup(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("submit_for_cleanup", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_submit_for_cleanup_pargs args; + args.o1 = &o1; + args.o2 = &o2; + args.o3 = &o3; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_submit_for_cleanup(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("submit_for_cleanup") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_submit_for_cleanup_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "submit_for_cleanup failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_dynamic_partitions(const AddDynamicPartitions& rqst) +{ + int32_t seqid = send_add_dynamic_partitions(rqst); + recv_add_dynamic_partitions(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_dynamic_partitions(const AddDynamicPartitions& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_dynamic_partitions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_dynamic_partitions_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_dynamic_partitions(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_dynamic_partitions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_dynamic_partitions_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) +{ + int32_t seqid = send_find_next_compact(workerId); + recv_find_next_compact(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_find_next_compact(const std::string& workerId) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("find_next_compact", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_next_compact_pargs args; + args.workerId = &workerId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_find_next_compact(OptionalCompactionInfoStruct& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_next_compact") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_find_next_compact_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_next_compact failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) +{ + int32_t seqid = send_find_next_compact2(rqst); + recv_find_next_compact2(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_find_next_compact2(const FindNextCompactRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("find_next_compact2", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_next_compact2_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_find_next_compact2(OptionalCompactionInfoStruct& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_next_compact2") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_find_next_compact2_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_next_compact2 failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) +{ + int32_t seqid = send_update_compactor_state(cr, txn_id); + recv_update_compactor_state(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_compactor_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_compactor_state_pargs args; + args.cr = &cr; + args.txn_id = &txn_id; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_update_compactor_state(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_compactor_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_update_compactor_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) +{ + int32_t seqid = send_find_columns_with_stats(cr); + recv_find_columns_with_stats(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_find_columns_with_stats(const CompactionInfoStruct& cr) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("find_columns_with_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_columns_with_stats_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_find_columns_with_stats(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_columns_with_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_find_columns_with_stats_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_columns_with_stats failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::mark_cleaned(const CompactionInfoStruct& cr) +{ + int32_t seqid = send_mark_cleaned(cr); + recv_mark_cleaned(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_mark_cleaned(const CompactionInfoStruct& cr) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("mark_cleaned", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_cleaned_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_mark_cleaned(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_cleaned") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_mark_cleaned_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::mark_compacted(const CompactionInfoStruct& cr) +{ + int32_t seqid = send_mark_compacted(cr); + recv_mark_compacted(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_mark_compacted(const CompactionInfoStruct& cr) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("mark_compacted", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_compacted_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_mark_compacted(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_compacted") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_mark_compacted_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::mark_failed(const CompactionInfoStruct& cr) +{ + int32_t seqid = send_mark_failed(cr); + recv_mark_failed(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_mark_failed(const CompactionInfoStruct& cr) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("mark_failed", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_failed_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_mark_failed(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_failed") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_mark_failed_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::mark_refused(const CompactionInfoStruct& cr) +{ + int32_t seqid = send_mark_refused(cr); + recv_mark_refused(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_mark_refused(const CompactionInfoStruct& cr) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("mark_refused", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_mark_refused_pargs args; + args.cr = &cr; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_mark_refused(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("mark_refused") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_mark_refused_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::update_compaction_metrics_data(const CompactionMetricsDataStruct& data) +{ + int32_t seqid = send_update_compaction_metrics_data(data); + return recv_update_compaction_metrics_data(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_update_compaction_metrics_data(const CompactionMetricsDataStruct& data) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("update_compaction_metrics_data", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_update_compaction_metrics_data_pargs args; + args.data = &data; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_update_compaction_metrics_data(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("update_compaction_metrics_data") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_update_compaction_metrics_data_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "update_compaction_metrics_data failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) +{ + int32_t seqid = send_remove_compaction_metrics_data(request); + recv_remove_compaction_metrics_data(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("remove_compaction_metrics_data", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_remove_compaction_metrics_data_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_remove_compaction_metrics_data(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_compaction_metrics_data") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_remove_compaction_metrics_data_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) +{ + int32_t seqid = send_set_hadoop_jobid(jobId, cq_id); + recv_set_hadoop_jobid(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("set_hadoop_jobid", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_hadoop_jobid_pargs args; + args.jobId = &jobId; + args.cq_id = &cq_id; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_set_hadoop_jobid(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_hadoop_jobid") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_set_hadoop_jobid_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) +{ + int32_t seqid = send_get_latest_committed_compaction_info(rqst); + recv_get_latest_committed_compaction_info(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_latest_committed_compaction_info(const GetLatestCommittedCompactionInfoRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_latest_committed_compaction_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_latest_committed_compaction_info_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_latest_committed_compaction_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_latest_committed_compaction_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_latest_committed_compaction_info failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) +{ + int32_t seqid = send_get_next_notification(rqst); + recv_get_next_notification(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_next_notification(const NotificationEventRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_next_notification", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_next_notification_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_next_notification(NotificationEventResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_next_notification") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_next_notification_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_next_notification failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_current_notificationEventId(CurrentNotificationEventId& _return) +{ + int32_t seqid = send_get_current_notificationEventId(); + recv_get_current_notificationEventId(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_current_notificationEventId() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_current_notificationEventId", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_current_notificationEventId_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_current_notificationEventId(CurrentNotificationEventId& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_current_notificationEventId") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_current_notificationEventId_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_current_notificationEventId failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) +{ + int32_t seqid = send_get_notification_events_count(rqst); + recv_get_notification_events_count(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_notification_events_count(const NotificationEventsCountRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_notification_events_count", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_notification_events_count_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_notification_events_count(NotificationEventsCountResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_notification_events_count") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_notification_events_count_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_notification_events_count failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) +{ + int32_t seqid = send_fire_listener_event(rqst); + recv_fire_listener_event(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_fire_listener_event(const FireEventRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("fire_listener_event", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_fire_listener_event_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_fire_listener_event(FireEventResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fire_listener_event") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_fire_listener_event_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fire_listener_event failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::flushCache() +{ + int32_t seqid = send_flushCache(); + recv_flushCache(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_flushCache() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("flushCache", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_flushCache_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_flushCache(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("flushCache") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_flushCache_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) +{ + int32_t seqid = send_add_write_notification_log(rqst); + recv_add_write_notification_log(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_write_notification_log(const WriteNotificationLogRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_write_notification_log", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_notification_log_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_write_notification_log(WriteNotificationLogResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_notification_log") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_write_notification_log_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_write_notification_log failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) +{ + int32_t seqid = send_add_write_notification_log_in_batch(rqst); + recv_add_write_notification_log_in_batch(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_write_notification_log_in_batch(const WriteNotificationLogBatchRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_write_notification_log_in_batch", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_write_notification_log_in_batch_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_write_notification_log_in_batch") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_write_notification_log_in_batch_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add_write_notification_log_in_batch failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) +{ + int32_t seqid = send_cm_recycle(request); + recv_cm_recycle(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_cm_recycle(const CmRecycleRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("cm_recycle", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cm_recycle_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_cm_recycle(CmRecycleResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cm_recycle") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_cm_recycle_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "cm_recycle failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) +{ + int32_t seqid = send_get_file_metadata_by_expr(req); + recv_get_file_metadata_by_expr(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_file_metadata_by_expr(const GetFileMetadataByExprRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_file_metadata_by_expr", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_file_metadata_by_expr_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_file_metadata_by_expr") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_file_metadata_by_expr_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_file_metadata_by_expr failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) +{ + int32_t seqid = send_get_file_metadata(req); + recv_get_file_metadata(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_file_metadata(const GetFileMetadataRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_file_metadata(GetFileMetadataResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_file_metadata failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) +{ + int32_t seqid = send_put_file_metadata(req); + recv_put_file_metadata(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_put_file_metadata(const PutFileMetadataRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("put_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_put_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_put_file_metadata(PutFileMetadataResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("put_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_put_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "put_file_metadata failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) +{ + int32_t seqid = send_clear_file_metadata(req); + recv_clear_file_metadata(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_clear_file_metadata(const ClearFileMetadataRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("clear_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_clear_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_clear_file_metadata(ClearFileMetadataResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("clear_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_clear_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "clear_file_metadata failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) +{ + int32_t seqid = send_cache_file_metadata(req); + recv_cache_file_metadata(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_cache_file_metadata(const CacheFileMetadataRequest& req) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("cache_file_metadata", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_cache_file_metadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_cache_file_metadata(CacheFileMetadataResult& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("cache_file_metadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_cache_file_metadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "cache_file_metadata failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_metastore_db_uuid(std::string& _return) +{ + int32_t seqid = send_get_metastore_db_uuid(); + recv_get_metastore_db_uuid(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_metastore_db_uuid() +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_metastore_db_uuid", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_metastore_db_uuid_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_metastore_db_uuid(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_metastore_db_uuid") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_metastore_db_uuid_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_metastore_db_uuid failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) +{ + int32_t seqid = send_create_resource_plan(request); + recv_create_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_resource_plan(const WMCreateResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_resource_plan(WMCreateResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) +{ + int32_t seqid = send_get_resource_plan(request); + recv_get_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_resource_plan(const WMGetResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_resource_plan(WMGetResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) +{ + int32_t seqid = send_get_active_resource_plan(request); + recv_get_active_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_active_resource_plan(const WMGetActiveResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_active_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_active_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_active_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_active_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_active_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) +{ + int32_t seqid = send_get_all_resource_plans(request); + recv_get_all_resource_plans(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_resource_plans(const WMGetAllResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_resource_plans", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_resource_plans_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_resource_plans") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_resource_plans_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_resource_plans failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) +{ + int32_t seqid = send_alter_resource_plan(request); + recv_alter_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_resource_plan(const WMAlterResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_resource_plan(WMAlterResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) +{ + int32_t seqid = send_validate_resource_plan(request); + recv_validate_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_validate_resource_plan(const WMValidateResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("validate_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_validate_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_validate_resource_plan(WMValidateResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("validate_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_validate_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "validate_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) +{ + int32_t seqid = send_drop_resource_plan(request); + recv_drop_resource_plan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_resource_plan(const WMDropResourcePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_resource_plan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_resource_plan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_resource_plan(WMDropResourcePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_resource_plan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_resource_plan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_resource_plan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) +{ + int32_t seqid = send_create_wm_trigger(request); + recv_create_wm_trigger(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_wm_trigger(const WMCreateTriggerRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_wm_trigger(WMCreateTriggerResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_wm_trigger failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) +{ + int32_t seqid = send_alter_wm_trigger(request); + recv_alter_wm_trigger(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_wm_trigger(const WMAlterTriggerRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_wm_trigger(WMAlterTriggerResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_wm_trigger failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) +{ + int32_t seqid = send_drop_wm_trigger(request); + recv_drop_wm_trigger(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_wm_trigger(const WMDropTriggerRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_wm_trigger", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_trigger_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_wm_trigger(WMDropTriggerResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_trigger") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_wm_trigger_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_trigger failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) +{ + int32_t seqid = send_get_triggers_for_resourceplan(request); + recv_get_triggers_for_resourceplan(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_triggers_for_resourceplan(const WMGetTriggersForResourePlanRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_triggers_for_resourceplan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_triggers_for_resourceplan_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_triggers_for_resourceplan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_triggers_for_resourceplan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_triggers_for_resourceplan failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) +{ + int32_t seqid = send_create_wm_pool(request); + recv_create_wm_pool(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_wm_pool(const WMCreatePoolRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_wm_pool(WMCreatePoolResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_wm_pool failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) +{ + int32_t seqid = send_alter_wm_pool(request); + recv_alter_wm_pool(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_wm_pool(const WMAlterPoolRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_wm_pool(WMAlterPoolResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "alter_wm_pool failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) +{ + int32_t seqid = send_drop_wm_pool(request); + recv_drop_wm_pool(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_wm_pool(const WMDropPoolRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_wm_pool", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_pool_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_wm_pool(WMDropPoolResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_pool") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_wm_pool_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_pool failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) +{ + int32_t seqid = send_create_or_update_wm_mapping(request); + recv_create_or_update_wm_mapping(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_or_update_wm_mapping(const WMCreateOrUpdateMappingRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_or_update_wm_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_or_update_wm_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_or_update_wm_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_or_update_wm_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_or_update_wm_mapping failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) +{ + int32_t seqid = send_drop_wm_mapping(request); + recv_drop_wm_mapping(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_wm_mapping(const WMDropMappingRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_wm_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_wm_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_wm_mapping(WMDropMappingResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_wm_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_wm_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "drop_wm_mapping failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) +{ + int32_t seqid = send_create_or_drop_wm_trigger_to_pool_mapping(request); + recv_create_or_drop_wm_trigger_to_pool_mapping(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_or_drop_wm_trigger_to_pool_mapping(const WMCreateOrDropTriggerToPoolMappingRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_or_drop_wm_trigger_to_pool_mapping", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_or_drop_wm_trigger_to_pool_mapping") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "create_or_drop_wm_trigger_to_pool_mapping failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_ischema(const ISchema& schema) +{ + int32_t seqid = send_create_ischema(schema); + recv_create_ischema(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_ischema(const ISchema& schema) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_ischema_pargs args; + args.schema = &schema; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_ischema(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::alter_ischema(const AlterISchemaRequest& rqst) +{ + int32_t seqid = send_alter_ischema(rqst); + recv_alter_ischema(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_alter_ischema(const AlterISchemaRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("alter_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_alter_ischema_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_alter_ischema(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("alter_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_alter_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_ischema(ISchema& _return, const ISchemaName& name) +{ + int32_t seqid = send_get_ischema(name); + recv_get_ischema(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_ischema(const ISchemaName& name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_ischema_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_ischema(ISchema& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_ischema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_ischema failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_ischema(const ISchemaName& name) +{ + int32_t seqid = send_drop_ischema(name); + recv_drop_ischema(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_ischema(const ISchemaName& name) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_ischema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_ischema_pargs args; + args.name = &name; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_ischema(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_ischema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_ischema_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_schema_version(const SchemaVersion& schemaVersion) +{ + int32_t seqid = send_add_schema_version(schemaVersion); + recv_add_schema_version(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_schema_version(const SchemaVersion& schemaVersion) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_schema_version(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_schema_version_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) +{ + int32_t seqid = send_get_schema_version(schemaVersion); + recv_get_schema_version(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema_version(SchemaVersion& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_version_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_version failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) +{ + int32_t seqid = send_get_schema_latest_version(schemaName); + recv_get_schema_latest_version(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema_latest_version(const ISchemaName& schemaName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema_latest_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_latest_version_pargs args; + args.schemaName = &schemaName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema_latest_version(SchemaVersion& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_latest_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_latest_version_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_latest_version failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) +{ + int32_t seqid = send_get_schema_all_versions(schemaName); + recv_get_schema_all_versions(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schema_all_versions(const ISchemaName& schemaName) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schema_all_versions", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schema_all_versions_pargs args; + args.schemaName = &schemaName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schema_all_versions(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schema_all_versions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schema_all_versions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schema_all_versions failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + int32_t seqid = send_drop_schema_version(schemaVersion); + recv_drop_schema_version(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_schema_version(const SchemaVersionDescriptor& schemaVersion) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_schema_version", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_schema_version_pargs args; + args.schemaVersion = &schemaVersion; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_schema_version(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_schema_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_schema_version_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) +{ + int32_t seqid = send_get_schemas_by_cols(rqst); + recv_get_schemas_by_cols(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_schemas_by_cols(const FindSchemasByColsRqst& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_schemas_by_cols", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_schemas_by_cols_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_schemas_by_cols(FindSchemasByColsResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_schemas_by_cols") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_schemas_by_cols_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_schemas_by_cols failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) +{ + int32_t seqid = send_map_schema_version_to_serde(rqst); + recv_map_schema_version_to_serde(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("map_schema_version_to_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_map_schema_version_to_serde_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_map_schema_version_to_serde(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("map_schema_version_to_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_map_schema_version_to_serde_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::set_schema_version_state(const SetSchemaVersionStateRequest& rqst) +{ + int32_t seqid = send_set_schema_version_state(rqst); + recv_set_schema_version_state(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_set_schema_version_state(const SetSchemaVersionStateRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("set_schema_version_state", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_set_schema_version_state_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_set_schema_version_state(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_schema_version_state") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_set_schema_version_state_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_serde(const SerDeInfo& serde) +{ + int32_t seqid = send_add_serde(serde); + recv_add_serde(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_serde(const SerDeInfo& serde) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_serde_pargs args; + args.serde = &serde; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_serde(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_serde_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) +{ + int32_t seqid = send_get_serde(rqst); + recv_get_serde(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_serde(const GetSerdeRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_serde", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_serde_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_serde(SerDeInfo& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_serde") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_serde_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_serde failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t seqid = send_get_lock_materialization_rebuild(dbName, tableName, txnId); + recv_get_lock_materialization_rebuild(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_lock_materialization_rebuild", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_lock_materialization_rebuild_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_lock_materialization_rebuild(LockResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_lock_materialization_rebuild") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_lock_materialization_rebuild_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_lock_materialization_rebuild failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +bool ThriftHiveMetastoreConcurrentClient::heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t seqid = send_heartbeat_lock_materialization_rebuild(dbName, tableName, txnId); + return recv_heartbeat_lock_materialization_rebuild(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("heartbeat_lock_materialization_rebuild", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs args; + args.dbName = &dbName; + args.tableName = &tableName; + args.txnId = &txnId; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +bool ThriftHiveMetastoreConcurrentClient::recv_heartbeat_lock_materialization_rebuild(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("heartbeat_lock_materialization_rebuild") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + bool _return; + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "heartbeat_lock_materialization_rebuild failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_runtime_stats(const RuntimeStat& stat) +{ + int32_t seqid = send_add_runtime_stats(stat); + recv_add_runtime_stats(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_runtime_stats(const RuntimeStat& stat) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_runtime_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_runtime_stats_pargs args; + args.stat = &stat; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_runtime_stats(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_runtime_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_runtime_stats_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) +{ + int32_t seqid = send_get_runtime_stats(rqst); + recv_get_runtime_stats(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_runtime_stats(const GetRuntimeStatsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_runtime_stats", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_runtime_stats_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_runtime_stats(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_runtime_stats") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_runtime_stats_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_runtime_stats failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) +{ + int32_t seqid = send_get_partitions_with_specs(request); + recv_get_partitions_with_specs(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_partitions_with_specs(const GetPartitionsRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_partitions_with_specs", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_partitions_with_specs_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_with_specs(GetPartitionsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_partitions_with_specs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_partitions_with_specs_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_with_specs failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) +{ + int32_t seqid = send_scheduled_query_poll(request); + recv_scheduled_query_poll(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_scheduled_query_poll(const ScheduledQueryPollRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("scheduled_query_poll", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_poll_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_scheduled_query_poll(ScheduledQueryPollResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_poll") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_scheduled_query_poll_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "scheduled_query_poll failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) +{ + int32_t seqid = send_scheduled_query_maintenance(request); + recv_scheduled_query_maintenance(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("scheduled_query_maintenance", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_maintenance_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_scheduled_query_maintenance(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_maintenance") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_scheduled_query_maintenance_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + if (result.__isset.o3) { + sentry.commit(); + throw result.o3; + } + if (result.__isset.o4) { + sentry.commit(); + throw result.o4; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::scheduled_query_progress(const ScheduledQueryProgressInfo& info) +{ + int32_t seqid = send_scheduled_query_progress(info); + recv_scheduled_query_progress(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_scheduled_query_progress(const ScheduledQueryProgressInfo& info) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("scheduled_query_progress", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_scheduled_query_progress_pargs args; + args.info = &info; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_scheduled_query_progress(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("scheduled_query_progress") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_scheduled_query_progress_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) +{ + int32_t seqid = send_get_scheduled_query(scheduleKey); + recv_get_scheduled_query(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_scheduled_query(const ScheduledQueryKey& scheduleKey) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_scheduled_query", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_scheduled_query_pargs args; + args.scheduleKey = &scheduleKey; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_scheduled_query(ScheduledQuery& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_scheduled_query") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_scheduled_query_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_scheduled_query failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_replication_metrics(const ReplicationMetricList& replicationMetricList) +{ + int32_t seqid = send_add_replication_metrics(replicationMetricList); + recv_add_replication_metrics(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_replication_metrics(const ReplicationMetricList& replicationMetricList) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_replication_metrics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_replication_metrics_pargs args; + args.replicationMetricList = &replicationMetricList; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_replication_metrics(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_replication_metrics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_replication_metrics_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) +{ + int32_t seqid = send_get_replication_metrics(rqst); + recv_get_replication_metrics(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_replication_metrics(const GetReplicationMetricsRequest& rqst) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_replication_metrics", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_replication_metrics_pargs args; + args.rqst = &rqst; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_replication_metrics(ReplicationMetricList& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_replication_metrics") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_replication_metrics_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_replication_metrics failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) +{ + int32_t seqid = send_get_open_txns_req(getOpenTxnsRequest); + recv_get_open_txns_req(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_open_txns_req(const GetOpenTxnsRequest& getOpenTxnsRequest) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_open_txns_req", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_open_txns_req_pargs args; + args.getOpenTxnsRequest = &getOpenTxnsRequest; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_open_txns_req(GetOpenTxnsResponse& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_open_txns_req") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_open_txns_req_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_open_txns_req failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::create_stored_procedure(const StoredProcedure& proc) +{ + int32_t seqid = send_create_stored_procedure(proc); + recv_create_stored_procedure(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_create_stored_procedure(const StoredProcedure& proc) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("create_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_create_stored_procedure_pargs args; + args.proc = &proc; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_create_stored_procedure(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("create_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_create_stored_procedure_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) +{ + int32_t seqid = send_get_stored_procedure(request); + recv_get_stored_procedure(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_stored_procedure(const StoredProcedureRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_stored_procedure_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_stored_procedure(StoredProcedure& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_stored_procedure_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_stored_procedure failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_stored_procedure(const StoredProcedureRequest& request) +{ + int32_t seqid = send_drop_stored_procedure(request); + recv_drop_stored_procedure(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_stored_procedure(const StoredProcedureRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_stored_procedure", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_stored_procedure_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_stored_procedure(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_stored_procedure") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_stored_procedure_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) +{ + int32_t seqid = send_get_all_stored_procedures(request); + recv_get_all_stored_procedures(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_stored_procedures(const ListStoredProcedureRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_stored_procedures", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_stored_procedures_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_stored_procedures(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_stored_procedures") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_stored_procedures_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_stored_procedures failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::find_package(Package& _return, const GetPackageRequest& request) +{ + int32_t seqid = send_find_package(request); + recv_find_package(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_find_package(const GetPackageRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("find_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_find_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_find_package(Package& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("find_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_find_package_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find_package failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::add_package(const AddPackageRequest& request) +{ + int32_t seqid = send_add_package(request); + recv_add_package(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_add_package(const AddPackageRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("add_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_add_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_add_package(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_add_package_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_packages(std::vector & _return, const ListPackageRequest& request) +{ + int32_t seqid = send_get_all_packages(request); + recv_get_all_packages(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_packages(const ListPackageRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_packages", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_packages_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_packages(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_packages") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_packages_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_packages failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::drop_package(const DropPackageRequest& request) +{ + int32_t seqid = send_drop_package(request); + recv_drop_package(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_drop_package(const DropPackageRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("drop_package", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_drop_package_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_drop_package(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("drop_package") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_drop_package_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveMetastoreConcurrentClient::get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) +{ + int32_t seqid = send_get_all_write_event_info(request); + recv_get_all_write_event_info(_return, seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_all_write_event_info(const GetAllWriteEventInfoRequest& request) +{ + int32_t cseqid = this->sync_->generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); + oprot_->writeMessageBegin("get_all_write_event_info", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_all_write_event_info_pargs args; + args.request = &request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveMetastoreConcurrentClient::recv_get_all_write_event_info(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid); + + while(true) { + if(!this->sync_->getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_all_write_event_info") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHiveMetastore_get_all_write_event_info_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_all_write_event_info failed: unknown result"); + } + // seqid != rseqid + this->sync_->updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_->waitForWork(seqid); + } // end while(true) +} + +}}} // namespace + diff --git a/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.h b/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.h new file mode 100644 index 000000000..319a7a334 --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/ThriftHiveMetastore.h @@ -0,0 +1,35369 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef ThriftHiveMetastore_H +#define ThriftHiveMetastore_H + +#include +#include +#include +#include "hive_metastore_types.h" +#include "FacebookService.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +#ifdef _MSC_VER + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +/** + * This interface is live. + */ +class ThriftHiveMetastoreIf : virtual public ::facebook::fb303::FacebookServiceIf { + public: + virtual ~ThriftHiveMetastoreIf() {} + virtual void abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) = 0; + virtual void getMetaConf(std::string& _return, const std::string& key) = 0; + virtual void setMetaConf(const std::string& key, const std::string& value) = 0; + virtual void create_catalog(const CreateCatalogRequest& catalog) = 0; + virtual void alter_catalog(const AlterCatalogRequest& rqst) = 0; + virtual void get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) = 0; + virtual void get_catalogs(GetCatalogsResponse& _return) = 0; + virtual void drop_catalog(const DropCatalogRequest& catName) = 0; + virtual void create_database(const Database& database) = 0; + virtual void create_database_req(const CreateDatabaseRequest& createDatabaseRequest) = 0; + virtual void get_database(Database& _return, const std::string& name) = 0; + virtual void get_database_req(Database& _return, const GetDatabaseRequest& request) = 0; + virtual void drop_database(const std::string& name, const bool deleteData, const bool cascade) = 0; + virtual void drop_database_req(const DropDatabaseRequest& req) = 0; + virtual void get_databases(std::vector & _return, const std::string& pattern) = 0; + virtual void get_all_databases(std::vector & _return) = 0; + virtual void alter_database(const std::string& dbname, const Database& db) = 0; + virtual void alter_database_req(const AlterDatabaseRequest& alterDbReq) = 0; + virtual void create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) = 0; + virtual void get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) = 0; + virtual void drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) = 0; + virtual void get_dataconnectors(std::vector & _return) = 0; + virtual void alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) = 0; + virtual void get_type(Type& _return, const std::string& name) = 0; + virtual bool create_type(const Type& type) = 0; + virtual bool drop_type(const std::string& type) = 0; + virtual void get_type_all(std::map & _return, const std::string& name) = 0; + virtual void get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) = 0; + virtual void get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) = 0; + virtual void get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) = 0; + virtual void get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) = 0; + virtual void get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) = 0; + virtual void get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) = 0; + virtual void create_table(const Table& tbl) = 0; + virtual void create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) = 0; + virtual void create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) = 0; + virtual void create_table_req(const CreateTableRequest& request) = 0; + virtual void drop_constraint(const DropConstraintRequest& req) = 0; + virtual void add_primary_key(const AddPrimaryKeyRequest& req) = 0; + virtual void add_foreign_key(const AddForeignKeyRequest& req) = 0; + virtual void add_unique_constraint(const AddUniqueConstraintRequest& req) = 0; + virtual void add_not_null_constraint(const AddNotNullConstraintRequest& req) = 0; + virtual void add_default_constraint(const AddDefaultConstraintRequest& req) = 0; + virtual void add_check_constraint(const AddCheckConstraintRequest& req) = 0; + virtual void translate_table_dryrun(Table& _return, const CreateTableRequest& request) = 0; + virtual void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) = 0; + virtual void drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) = 0; + virtual void drop_table_req(const DropTableRequest& dropTableReq) = 0; + virtual void truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) = 0; + virtual void truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) = 0; + virtual void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) = 0; + virtual void get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) = 0; + virtual void get_all_materialized_view_objects_for_rewriting(std::vector
& _return) = 0; + virtual void get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) = 0; + virtual void get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) = 0; + virtual void get_all_tables(std::vector & _return, const std::string& db_name) = 0; + virtual void get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) = 0; + virtual void get_table_req(GetTableResult& _return, const GetTableRequest& req) = 0; + virtual void get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) = 0; + virtual void get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) = 0; + virtual void update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) = 0; + virtual void get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) = 0; + virtual void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) = 0; + virtual void alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) = 0; + virtual void alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) = 0; + virtual void alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) = 0; + virtual void add_partition(Partition& _return, const Partition& new_part) = 0; + virtual void add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) = 0; + virtual int32_t add_partitions(const std::vector & new_parts) = 0; + virtual int32_t add_partitions_pspec(const std::vector & new_parts) = 0; + virtual void append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) = 0; + virtual void add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) = 0; + virtual void append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) = 0; + virtual void append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) = 0; + virtual void append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) = 0; + virtual void append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) = 0; + virtual bool drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) = 0; + virtual bool drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) = 0; + virtual bool drop_partition_req(const DropPartitionRequest& dropPartitionReq) = 0; + virtual bool drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) = 0; + virtual bool drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) = 0; + virtual void drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) = 0; + virtual void get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) = 0; + virtual void get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) = 0; + virtual void exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) = 0; + virtual void exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) = 0; + virtual void get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) = 0; + virtual void get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) = 0; + virtual void get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) = 0; + virtual void get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) = 0; + virtual void get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) = 0; + virtual void get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) = 0; + virtual void get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) = 0; + virtual void fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) = 0; + virtual void get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) = 0; + virtual void get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) = 0; + virtual void get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) = 0; + virtual void get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) = 0; + virtual void get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) = 0; + virtual void get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) = 0; + virtual void get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) = 0; + virtual void get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) = 0; + virtual void get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) = 0; + virtual void get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) = 0; + virtual void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) = 0; + virtual void get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) = 0; + virtual int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) = 0; + virtual void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) = 0; + virtual void get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) = 0; + virtual void get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) = 0; + virtual bool set_properties(const PropertySetRequest& req) = 0; + virtual void alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) = 0; + virtual void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) = 0; + virtual void alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) = 0; + virtual void alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) = 0; + virtual void alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) = 0; + virtual void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) = 0; + virtual void rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) = 0; + virtual bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) = 0; + virtual void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) = 0; + virtual void partition_name_to_vals(std::vector & _return, const std::string& part_name) = 0; + virtual void partition_name_to_spec(std::map & _return, const std::string& part_name) = 0; + virtual void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) = 0; + virtual bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) = 0; + virtual void get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) = 0; + virtual void get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) = 0; + virtual void get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) = 0; + virtual void get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) = 0; + virtual void get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) = 0; + virtual void get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) = 0; + virtual void get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) = 0; + virtual bool update_table_column_statistics(const ColumnStatistics& stats_obj) = 0; + virtual bool update_partition_column_statistics(const ColumnStatistics& stats_obj) = 0; + virtual void update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) = 0; + virtual void update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) = 0; + virtual void update_transaction_statistics(const UpdateTransactionalStatsRequest& req) = 0; + virtual void get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) = 0; + virtual void get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) = 0; + virtual void get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) = 0; + virtual void get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) = 0; + virtual void get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) = 0; + virtual bool set_aggr_stats_for(const SetPartitionsStatsRequest& request) = 0; + virtual bool delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) = 0; + virtual bool delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) = 0; + virtual void create_function(const Function& func) = 0; + virtual void drop_function(const std::string& dbName, const std::string& funcName) = 0; + virtual void alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) = 0; + virtual void get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) = 0; + virtual void get_function(Function& _return, const std::string& dbName, const std::string& funcName) = 0; + virtual void get_all_functions(GetAllFunctionsResponse& _return) = 0; + virtual bool create_role(const Role& role) = 0; + virtual bool drop_role(const std::string& role_name) = 0; + virtual void get_role_names(std::vector & _return) = 0; + virtual bool grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) = 0; + virtual bool revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) = 0; + virtual void list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) = 0; + virtual void grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) = 0; + virtual void get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) = 0; + virtual void get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) = 0; + virtual void get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) = 0; + virtual void list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) = 0; + virtual bool grant_privileges(const PrivilegeBag& privileges) = 0; + virtual bool revoke_privileges(const PrivilegeBag& privileges) = 0; + virtual void grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) = 0; + virtual void refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) = 0; + virtual void set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) = 0; + virtual void get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) = 0; + virtual int64_t renew_delegation_token(const std::string& token_str_form) = 0; + virtual void cancel_delegation_token(const std::string& token_str_form) = 0; + virtual bool add_token(const std::string& token_identifier, const std::string& delegation_token) = 0; + virtual bool remove_token(const std::string& token_identifier) = 0; + virtual void get_token(std::string& _return, const std::string& token_identifier) = 0; + virtual void get_all_token_identifiers(std::vector & _return) = 0; + virtual int32_t add_master_key(const std::string& key) = 0; + virtual void update_master_key(const int32_t seq_number, const std::string& key) = 0; + virtual bool remove_master_key(const int32_t key_seq) = 0; + virtual void get_master_keys(std::vector & _return) = 0; + virtual void get_open_txns(GetOpenTxnsResponse& _return) = 0; + virtual void get_open_txns_info(GetOpenTxnsInfoResponse& _return) = 0; + virtual void open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) = 0; + virtual void abort_txn(const AbortTxnRequest& rqst) = 0; + virtual void abort_txns(const AbortTxnsRequest& rqst) = 0; + virtual void commit_txn(const CommitTxnRequest& rqst) = 0; + virtual int64_t get_latest_txnid_in_conflict(const int64_t txnId) = 0; + virtual void repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) = 0; + virtual void get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) = 0; + virtual void add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) = 0; + virtual void allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) = 0; + virtual void get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) = 0; + virtual void seed_write_id(const SeedTableWriteIdsRequest& rqst) = 0; + virtual void seed_txn_id(const SeedTxnIdRequest& rqst) = 0; + virtual void lock(LockResponse& _return, const LockRequest& rqst) = 0; + virtual void check_lock(LockResponse& _return, const CheckLockRequest& rqst) = 0; + virtual void unlock(const UnlockRequest& rqst) = 0; + virtual void show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) = 0; + virtual void heartbeat(const HeartbeatRequest& ids) = 0; + virtual void heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) = 0; + virtual void compact(const CompactionRequest& rqst) = 0; + virtual void compact2(CompactionResponse& _return, const CompactionRequest& rqst) = 0; + virtual void show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) = 0; + virtual bool submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) = 0; + virtual void add_dynamic_partitions(const AddDynamicPartitions& rqst) = 0; + virtual void find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) = 0; + virtual void find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) = 0; + virtual void update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) = 0; + virtual void find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) = 0; + virtual void mark_cleaned(const CompactionInfoStruct& cr) = 0; + virtual void mark_compacted(const CompactionInfoStruct& cr) = 0; + virtual void mark_failed(const CompactionInfoStruct& cr) = 0; + virtual void mark_refused(const CompactionInfoStruct& cr) = 0; + virtual bool update_compaction_metrics_data(const CompactionMetricsDataStruct& data) = 0; + virtual void remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) = 0; + virtual void set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) = 0; + virtual void get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) = 0; + virtual void get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) = 0; + virtual void get_current_notificationEventId(CurrentNotificationEventId& _return) = 0; + virtual void get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) = 0; + virtual void fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) = 0; + virtual void flushCache() = 0; + virtual void add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) = 0; + virtual void add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) = 0; + virtual void cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) = 0; + virtual void get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) = 0; + virtual void get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) = 0; + virtual void put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) = 0; + virtual void clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) = 0; + virtual void cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) = 0; + virtual void get_metastore_db_uuid(std::string& _return) = 0; + virtual void create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) = 0; + virtual void get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) = 0; + virtual void get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) = 0; + virtual void get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) = 0; + virtual void alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) = 0; + virtual void validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) = 0; + virtual void drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) = 0; + virtual void create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) = 0; + virtual void alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) = 0; + virtual void drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) = 0; + virtual void get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) = 0; + virtual void create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) = 0; + virtual void alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) = 0; + virtual void drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) = 0; + virtual void create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) = 0; + virtual void drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) = 0; + virtual void create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) = 0; + virtual void create_ischema(const ISchema& schema) = 0; + virtual void alter_ischema(const AlterISchemaRequest& rqst) = 0; + virtual void get_ischema(ISchema& _return, const ISchemaName& name) = 0; + virtual void drop_ischema(const ISchemaName& name) = 0; + virtual void add_schema_version(const SchemaVersion& schemaVersion) = 0; + virtual void get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) = 0; + virtual void get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) = 0; + virtual void get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) = 0; + virtual void drop_schema_version(const SchemaVersionDescriptor& schemaVersion) = 0; + virtual void get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) = 0; + virtual void map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) = 0; + virtual void set_schema_version_state(const SetSchemaVersionStateRequest& rqst) = 0; + virtual void add_serde(const SerDeInfo& serde) = 0; + virtual void get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) = 0; + virtual void get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) = 0; + virtual bool heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) = 0; + virtual void add_runtime_stats(const RuntimeStat& stat) = 0; + virtual void get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) = 0; + virtual void get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) = 0; + virtual void scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) = 0; + virtual void scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) = 0; + virtual void scheduled_query_progress(const ScheduledQueryProgressInfo& info) = 0; + virtual void get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) = 0; + virtual void add_replication_metrics(const ReplicationMetricList& replicationMetricList) = 0; + virtual void get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) = 0; + virtual void get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) = 0; + virtual void create_stored_procedure(const StoredProcedure& proc) = 0; + virtual void get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) = 0; + virtual void drop_stored_procedure(const StoredProcedureRequest& request) = 0; + virtual void get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) = 0; + virtual void find_package(Package& _return, const GetPackageRequest& request) = 0; + virtual void add_package(const AddPackageRequest& request) = 0; + virtual void get_all_packages(std::vector & _return, const ListPackageRequest& request) = 0; + virtual void drop_package(const DropPackageRequest& request) = 0; + virtual void get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) = 0; +}; + +class ThriftHiveMetastoreIfFactory : virtual public ::facebook::fb303::FacebookServiceIfFactory { + public: + typedef ThriftHiveMetastoreIf Handler; + + virtual ~ThriftHiveMetastoreIfFactory() {} + + virtual ThriftHiveMetastoreIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) override = 0; + virtual void releaseHandler( ::facebook::fb303::FacebookServiceIf* /* handler */) override = 0; + }; + +class ThriftHiveMetastoreIfSingletonFactory : virtual public ThriftHiveMetastoreIfFactory { + public: + ThriftHiveMetastoreIfSingletonFactory(const ::std::shared_ptr& iface) : iface_(iface) {} + virtual ~ThriftHiveMetastoreIfSingletonFactory() {} + + virtual ThriftHiveMetastoreIf* getHandler(const ::apache::thrift::TConnectionInfo&) override { + return iface_.get(); + } + virtual void releaseHandler( ::facebook::fb303::FacebookServiceIf* /* handler */) override {} + + protected: + ::std::shared_ptr iface_; +}; + +class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual public ::facebook::fb303::FacebookServiceNull { + public: + virtual ~ThriftHiveMetastoreNull() {} + void abort_Compactions(AbortCompactResponse& /* _return */, const AbortCompactionRequest& /* rqst */) override { + return; + } + void getMetaConf(std::string& /* _return */, const std::string& /* key */) override { + return; + } + void setMetaConf(const std::string& /* key */, const std::string& /* value */) override { + return; + } + void create_catalog(const CreateCatalogRequest& /* catalog */) override { + return; + } + void alter_catalog(const AlterCatalogRequest& /* rqst */) override { + return; + } + void get_catalog(GetCatalogResponse& /* _return */, const GetCatalogRequest& /* catName */) override { + return; + } + void get_catalogs(GetCatalogsResponse& /* _return */) override { + return; + } + void drop_catalog(const DropCatalogRequest& /* catName */) override { + return; + } + void create_database(const Database& /* database */) override { + return; + } + void create_database_req(const CreateDatabaseRequest& /* createDatabaseRequest */) override { + return; + } + void get_database(Database& /* _return */, const std::string& /* name */) override { + return; + } + void get_database_req(Database& /* _return */, const GetDatabaseRequest& /* request */) override { + return; + } + void drop_database(const std::string& /* name */, const bool /* deleteData */, const bool /* cascade */) override { + return; + } + void drop_database_req(const DropDatabaseRequest& /* req */) override { + return; + } + void get_databases(std::vector & /* _return */, const std::string& /* pattern */) override { + return; + } + void get_all_databases(std::vector & /* _return */) override { + return; + } + void alter_database(const std::string& /* dbname */, const Database& /* db */) override { + return; + } + void alter_database_req(const AlterDatabaseRequest& /* alterDbReq */) override { + return; + } + void create_dataconnector_req(const CreateDataConnectorRequest& /* connectorReq */) override { + return; + } + void get_dataconnector_req(DataConnector& /* _return */, const GetDataConnectorRequest& /* request */) override { + return; + } + void drop_dataconnector_req(const DropDataConnectorRequest& /* dropDcReq */) override { + return; + } + void get_dataconnectors(std::vector & /* _return */) override { + return; + } + void alter_dataconnector_req(const AlterDataConnectorRequest& /* alterReq */) override { + return; + } + void get_type(Type& /* _return */, const std::string& /* name */) override { + return; + } + bool create_type(const Type& /* type */) override { + bool _return = false; + return _return; + } + bool drop_type(const std::string& /* type */) override { + bool _return = false; + return _return; + } + void get_type_all(std::map & /* _return */, const std::string& /* name */) override { + return; + } + void get_fields(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* table_name */) override { + return; + } + void get_fields_with_environment_context(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* table_name */, const EnvironmentContext& /* environment_context */) override { + return; + } + void get_fields_req(GetFieldsResponse& /* _return */, const GetFieldsRequest& /* req */) override { + return; + } + void get_schema(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* table_name */) override { + return; + } + void get_schema_with_environment_context(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* table_name */, const EnvironmentContext& /* environment_context */) override { + return; + } + void get_schema_req(GetSchemaResponse& /* _return */, const GetSchemaRequest& /* req */) override { + return; + } + void create_table(const Table& /* tbl */) override { + return; + } + void create_table_with_environment_context(const Table& /* tbl */, const EnvironmentContext& /* environment_context */) override { + return; + } + void create_table_with_constraints(const Table& /* tbl */, const std::vector & /* primaryKeys */, const std::vector & /* foreignKeys */, const std::vector & /* uniqueConstraints */, const std::vector & /* notNullConstraints */, const std::vector & /* defaultConstraints */, const std::vector & /* checkConstraints */) override { + return; + } + void create_table_req(const CreateTableRequest& /* request */) override { + return; + } + void drop_constraint(const DropConstraintRequest& /* req */) override { + return; + } + void add_primary_key(const AddPrimaryKeyRequest& /* req */) override { + return; + } + void add_foreign_key(const AddForeignKeyRequest& /* req */) override { + return; + } + void add_unique_constraint(const AddUniqueConstraintRequest& /* req */) override { + return; + } + void add_not_null_constraint(const AddNotNullConstraintRequest& /* req */) override { + return; + } + void add_default_constraint(const AddDefaultConstraintRequest& /* req */) override { + return; + } + void add_check_constraint(const AddCheckConstraintRequest& /* req */) override { + return; + } + void translate_table_dryrun(Table& /* _return */, const CreateTableRequest& /* request */) override { + return; + } + void drop_table(const std::string& /* dbname */, const std::string& /* name */, const bool /* deleteData */) override { + return; + } + void drop_table_with_environment_context(const std::string& /* dbname */, const std::string& /* name */, const bool /* deleteData */, const EnvironmentContext& /* environment_context */) override { + return; + } + void drop_table_req(const DropTableRequest& /* dropTableReq */) override { + return; + } + void truncate_table(const std::string& /* dbName */, const std::string& /* tableName */, const std::vector & /* partNames */) override { + return; + } + void truncate_table_req(TruncateTableResponse& /* _return */, const TruncateTableRequest& /* req */) override { + return; + } + void get_tables(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* pattern */) override { + return; + } + void get_tables_by_type(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* pattern */, const std::string& /* tableType */) override { + return; + } + void get_all_materialized_view_objects_for_rewriting(std::vector
& /* _return */) override { + return; + } + void get_materialized_views_for_rewriting(std::vector & /* _return */, const std::string& /* db_name */) override { + return; + } + void get_table_meta(std::vector & /* _return */, const std::string& /* db_patterns */, const std::string& /* tbl_patterns */, const std::vector & /* tbl_types */) override { + return; + } + void get_all_tables(std::vector & /* _return */, const std::string& /* db_name */) override { + return; + } + void get_tables_ext(std::vector & /* _return */, const GetTablesExtRequest& /* req */) override { + return; + } + void get_table_req(GetTableResult& /* _return */, const GetTableRequest& /* req */) override { + return; + } + void get_table_objects_by_name_req(GetTablesResult& /* _return */, const GetTablesRequest& /* req */) override { + return; + } + void get_materialization_invalidation_info(Materialization& /* _return */, const CreationMetadata& /* creation_metadata */, const std::string& /* validTxnList */) override { + return; + } + void update_creation_metadata(const std::string& /* catName */, const std::string& /* dbname */, const std::string& /* tbl_name */, const CreationMetadata& /* creation_metadata */) override { + return; + } + void get_table_names_by_filter(std::vector & /* _return */, const std::string& /* dbname */, const std::string& /* filter */, const int16_t /* max_tables */) override { + return; + } + void alter_table(const std::string& /* dbname */, const std::string& /* tbl_name */, const Table& /* new_tbl */) override { + return; + } + void alter_table_with_environment_context(const std::string& /* dbname */, const std::string& /* tbl_name */, const Table& /* new_tbl */, const EnvironmentContext& /* environment_context */) override { + return; + } + void alter_table_with_cascade(const std::string& /* dbname */, const std::string& /* tbl_name */, const Table& /* new_tbl */, const bool /* cascade */) override { + return; + } + void alter_table_req(AlterTableResponse& /* _return */, const AlterTableRequest& /* req */) override { + return; + } + void add_partition(Partition& /* _return */, const Partition& /* new_part */) override { + return; + } + void add_partition_with_environment_context(Partition& /* _return */, const Partition& /* new_part */, const EnvironmentContext& /* environment_context */) override { + return; + } + int32_t add_partitions(const std::vector & /* new_parts */) override { + int32_t _return = 0; + return _return; + } + int32_t add_partitions_pspec(const std::vector & /* new_parts */) override { + int32_t _return = 0; + return _return; + } + void append_partition(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */) override { + return; + } + void add_partitions_req(AddPartitionsResult& /* _return */, const AddPartitionsRequest& /* request */) override { + return; + } + void append_partition_with_environment_context(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const EnvironmentContext& /* environment_context */) override { + return; + } + void append_partition_req(Partition& /* _return */, const AppendPartitionsRequest& /* appendPartitionsReq */) override { + return; + } + void append_partition_by_name(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */) override { + return; + } + void append_partition_by_name_with_environment_context(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */, const EnvironmentContext& /* environment_context */) override { + return; + } + bool drop_partition(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const bool /* deleteData */) override { + bool _return = false; + return _return; + } + bool drop_partition_with_environment_context(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const bool /* deleteData */, const EnvironmentContext& /* environment_context */) override { + bool _return = false; + return _return; + } + bool drop_partition_req(const DropPartitionRequest& /* dropPartitionReq */) override { + bool _return = false; + return _return; + } + bool drop_partition_by_name(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */, const bool /* deleteData */) override { + bool _return = false; + return _return; + } + bool drop_partition_by_name_with_environment_context(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */, const bool /* deleteData */, const EnvironmentContext& /* environment_context */) override { + bool _return = false; + return _return; + } + void drop_partitions_req(DropPartitionsResult& /* _return */, const DropPartitionsRequest& /* req */) override { + return; + } + void get_partition(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */) override { + return; + } + void get_partition_req(GetPartitionResponse& /* _return */, const GetPartitionRequest& /* req */) override { + return; + } + void exchange_partition(Partition& /* _return */, const std::map & /* partitionSpecs */, const std::string& /* source_db */, const std::string& /* source_table_name */, const std::string& /* dest_db */, const std::string& /* dest_table_name */) override { + return; + } + void exchange_partitions(std::vector & /* _return */, const std::map & /* partitionSpecs */, const std::string& /* source_db */, const std::string& /* source_table_name */, const std::string& /* dest_db */, const std::string& /* dest_table_name */) override { + return; + } + void get_partition_with_auth(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const std::string& /* user_name */, const std::vector & /* group_names */) override { + return; + } + void get_partition_by_name(Partition& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */) override { + return; + } + void get_partitions(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const int16_t /* max_parts */) override { + return; + } + void get_partitions_req(PartitionsResponse& /* _return */, const PartitionsRequest& /* req */) override { + return; + } + void get_partitions_with_auth(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const int16_t /* max_parts */, const std::string& /* user_name */, const std::vector & /* group_names */) override { + return; + } + void get_partitions_pspec(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const int32_t /* max_parts */) override { + return; + } + void get_partition_names(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const int16_t /* max_parts */) override { + return; + } + void fetch_partition_names_req(std::vector & /* _return */, const PartitionsRequest& /* partitionReq */) override { + return; + } + void get_partition_values(PartitionValuesResponse& /* _return */, const PartitionValuesRequest& /* request */) override { + return; + } + void get_partitions_ps(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const int16_t /* max_parts */) override { + return; + } + void get_partitions_ps_with_auth(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const int16_t /* max_parts */, const std::string& /* user_name */, const std::vector & /* group_names */) override { + return; + } + void get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& /* _return */, const GetPartitionsPsWithAuthRequest& /* req */) override { + return; + } + void get_partition_names_ps(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const int16_t /* max_parts */) override { + return; + } + void get_partition_names_ps_req(GetPartitionNamesPsResponse& /* _return */, const GetPartitionNamesPsRequest& /* req */) override { + return; + } + void get_partition_names_req(std::vector & /* _return */, const PartitionsByExprRequest& /* req */) override { + return; + } + void get_partitions_by_filter(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* filter */, const int16_t /* max_parts */) override { + return; + } + void get_partitions_by_filter_req(std::vector & /* _return */, const GetPartitionsByFilterRequest& /* req */) override { + return; + } + void get_part_specs_by_filter(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* filter */, const int32_t /* max_parts */) override { + return; + } + void get_partitions_by_expr(PartitionsByExprResult& /* _return */, const PartitionsByExprRequest& /* req */) override { + return; + } + void get_partitions_spec_by_expr(PartitionsSpecByExprResult& /* _return */, const PartitionsByExprRequest& /* req */) override { + return; + } + int32_t get_num_partitions_by_filter(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* filter */) override { + int32_t _return = 0; + return _return; + } + void get_partitions_by_names(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* names */) override { + return; + } + void get_partitions_by_names_req(GetPartitionsByNamesResult& /* _return */, const GetPartitionsByNamesRequest& /* req */) override { + return; + } + void get_properties(PropertyGetResponse& /* _return */, const PropertyGetRequest& /* req */) override { + return; + } + bool set_properties(const PropertySetRequest& /* req */) override { + bool _return = false; + return _return; + } + void alter_partition(const std::string& /* db_name */, const std::string& /* tbl_name */, const Partition& /* new_part */) override { + return; + } + void alter_partitions(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* new_parts */) override { + return; + } + void alter_partitions_with_environment_context(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* new_parts */, const EnvironmentContext& /* environment_context */) override { + return; + } + void alter_partitions_req(AlterPartitionsResponse& /* _return */, const AlterPartitionsRequest& /* req */) override { + return; + } + void alter_partition_with_environment_context(const std::string& /* db_name */, const std::string& /* tbl_name */, const Partition& /* new_part */, const EnvironmentContext& /* environment_context */) override { + return; + } + void rename_partition(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* part_vals */, const Partition& /* new_part */) override { + return; + } + void rename_partition_req(RenamePartitionResponse& /* _return */, const RenamePartitionRequest& /* req */) override { + return; + } + bool partition_name_has_valid_characters(const std::vector & /* part_vals */, const bool /* throw_exception */) override { + bool _return = false; + return _return; + } + void get_config_value(std::string& /* _return */, const std::string& /* name */, const std::string& /* defaultValue */) override { + return; + } + void partition_name_to_vals(std::vector & /* _return */, const std::string& /* part_name */) override { + return; + } + void partition_name_to_spec(std::map & /* _return */, const std::string& /* part_name */) override { + return; + } + void markPartitionForEvent(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::map & /* part_vals */, const PartitionEventType::type /* eventType */) override { + return; + } + bool isPartitionMarkedForEvent(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::map & /* part_vals */, const PartitionEventType::type /* eventType */) override { + bool _return = false; + return _return; + } + void get_primary_keys(PrimaryKeysResponse& /* _return */, const PrimaryKeysRequest& /* request */) override { + return; + } + void get_foreign_keys(ForeignKeysResponse& /* _return */, const ForeignKeysRequest& /* request */) override { + return; + } + void get_unique_constraints(UniqueConstraintsResponse& /* _return */, const UniqueConstraintsRequest& /* request */) override { + return; + } + void get_not_null_constraints(NotNullConstraintsResponse& /* _return */, const NotNullConstraintsRequest& /* request */) override { + return; + } + void get_default_constraints(DefaultConstraintsResponse& /* _return */, const DefaultConstraintsRequest& /* request */) override { + return; + } + void get_check_constraints(CheckConstraintsResponse& /* _return */, const CheckConstraintsRequest& /* request */) override { + return; + } + void get_all_table_constraints(AllTableConstraintsResponse& /* _return */, const AllTableConstraintsRequest& /* request */) override { + return; + } + bool update_table_column_statistics(const ColumnStatistics& /* stats_obj */) override { + bool _return = false; + return _return; + } + bool update_partition_column_statistics(const ColumnStatistics& /* stats_obj */) override { + bool _return = false; + return _return; + } + void update_table_column_statistics_req(SetPartitionsStatsResponse& /* _return */, const SetPartitionsStatsRequest& /* req */) override { + return; + } + void update_partition_column_statistics_req(SetPartitionsStatsResponse& /* _return */, const SetPartitionsStatsRequest& /* req */) override { + return; + } + void update_transaction_statistics(const UpdateTransactionalStatsRequest& /* req */) override { + return; + } + void get_table_column_statistics(ColumnStatistics& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* col_name */) override { + return; + } + void get_partition_column_statistics(ColumnStatistics& /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */, const std::string& /* col_name */) override { + return; + } + void get_table_statistics_req(TableStatsResult& /* _return */, const TableStatsRequest& /* request */) override { + return; + } + void get_partitions_statistics_req(PartitionsStatsResult& /* _return */, const PartitionsStatsRequest& /* request */) override { + return; + } + void get_aggr_stats_for(AggrStats& /* _return */, const PartitionsStatsRequest& /* request */) override { + return; + } + bool set_aggr_stats_for(const SetPartitionsStatsRequest& /* request */) override { + bool _return = false; + return _return; + } + bool delete_partition_column_statistics(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* part_name */, const std::string& /* col_name */, const std::string& /* engine */) override { + bool _return = false; + return _return; + } + bool delete_table_column_statistics(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* col_name */, const std::string& /* engine */) override { + bool _return = false; + return _return; + } + void create_function(const Function& /* func */) override { + return; + } + void drop_function(const std::string& /* dbName */, const std::string& /* funcName */) override { + return; + } + void alter_function(const std::string& /* dbName */, const std::string& /* funcName */, const Function& /* newFunc */) override { + return; + } + void get_functions(std::vector & /* _return */, const std::string& /* dbName */, const std::string& /* pattern */) override { + return; + } + void get_function(Function& /* _return */, const std::string& /* dbName */, const std::string& /* funcName */) override { + return; + } + void get_all_functions(GetAllFunctionsResponse& /* _return */) override { + return; + } + bool create_role(const Role& /* role */) override { + bool _return = false; + return _return; + } + bool drop_role(const std::string& /* role_name */) override { + bool _return = false; + return _return; + } + void get_role_names(std::vector & /* _return */) override { + return; + } + bool grant_role(const std::string& /* role_name */, const std::string& /* principal_name */, const PrincipalType::type /* principal_type */, const std::string& /* grantor */, const PrincipalType::type /* grantorType */, const bool /* grant_option */) override { + bool _return = false; + return _return; + } + bool revoke_role(const std::string& /* role_name */, const std::string& /* principal_name */, const PrincipalType::type /* principal_type */) override { + bool _return = false; + return _return; + } + void list_roles(std::vector & /* _return */, const std::string& /* principal_name */, const PrincipalType::type /* principal_type */) override { + return; + } + void grant_revoke_role(GrantRevokeRoleResponse& /* _return */, const GrantRevokeRoleRequest& /* request */) override { + return; + } + void get_principals_in_role(GetPrincipalsInRoleResponse& /* _return */, const GetPrincipalsInRoleRequest& /* request */) override { + return; + } + void get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& /* _return */, const GetRoleGrantsForPrincipalRequest& /* request */) override { + return; + } + void get_privilege_set(PrincipalPrivilegeSet& /* _return */, const HiveObjectRef& /* hiveObject */, const std::string& /* user_name */, const std::vector & /* group_names */) override { + return; + } + void list_privileges(std::vector & /* _return */, const std::string& /* principal_name */, const PrincipalType::type /* principal_type */, const HiveObjectRef& /* hiveObject */) override { + return; + } + bool grant_privileges(const PrivilegeBag& /* privileges */) override { + bool _return = false; + return _return; + } + bool revoke_privileges(const PrivilegeBag& /* privileges */) override { + bool _return = false; + return _return; + } + void grant_revoke_privileges(GrantRevokePrivilegeResponse& /* _return */, const GrantRevokePrivilegeRequest& /* request */) override { + return; + } + void refresh_privileges(GrantRevokePrivilegeResponse& /* _return */, const HiveObjectRef& /* objToRefresh */, const std::string& /* authorizer */, const GrantRevokePrivilegeRequest& /* grantRequest */) override { + return; + } + void set_ugi(std::vector & /* _return */, const std::string& /* user_name */, const std::vector & /* group_names */) override { + return; + } + void get_delegation_token(std::string& /* _return */, const std::string& /* token_owner */, const std::string& /* renewer_kerberos_principal_name */) override { + return; + } + int64_t renew_delegation_token(const std::string& /* token_str_form */) override { + int64_t _return = 0; + return _return; + } + void cancel_delegation_token(const std::string& /* token_str_form */) override { + return; + } + bool add_token(const std::string& /* token_identifier */, const std::string& /* delegation_token */) override { + bool _return = false; + return _return; + } + bool remove_token(const std::string& /* token_identifier */) override { + bool _return = false; + return _return; + } + void get_token(std::string& /* _return */, const std::string& /* token_identifier */) override { + return; + } + void get_all_token_identifiers(std::vector & /* _return */) override { + return; + } + int32_t add_master_key(const std::string& /* key */) override { + int32_t _return = 0; + return _return; + } + void update_master_key(const int32_t /* seq_number */, const std::string& /* key */) override { + return; + } + bool remove_master_key(const int32_t /* key_seq */) override { + bool _return = false; + return _return; + } + void get_master_keys(std::vector & /* _return */) override { + return; + } + void get_open_txns(GetOpenTxnsResponse& /* _return */) override { + return; + } + void get_open_txns_info(GetOpenTxnsInfoResponse& /* _return */) override { + return; + } + void open_txns(OpenTxnsResponse& /* _return */, const OpenTxnRequest& /* rqst */) override { + return; + } + void abort_txn(const AbortTxnRequest& /* rqst */) override { + return; + } + void abort_txns(const AbortTxnsRequest& /* rqst */) override { + return; + } + void commit_txn(const CommitTxnRequest& /* rqst */) override { + return; + } + int64_t get_latest_txnid_in_conflict(const int64_t /* txnId */) override { + int64_t _return = 0; + return _return; + } + void repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& /* rqst */) override { + return; + } + void get_valid_write_ids(GetValidWriteIdsResponse& /* _return */, const GetValidWriteIdsRequest& /* rqst */) override { + return; + } + void add_write_ids_to_min_history(const int64_t /* txnId */, const std::map & /* writeIds */) override { + return; + } + void allocate_table_write_ids(AllocateTableWriteIdsResponse& /* _return */, const AllocateTableWriteIdsRequest& /* rqst */) override { + return; + } + void get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& /* _return */, const MaxAllocatedTableWriteIdRequest& /* rqst */) override { + return; + } + void seed_write_id(const SeedTableWriteIdsRequest& /* rqst */) override { + return; + } + void seed_txn_id(const SeedTxnIdRequest& /* rqst */) override { + return; + } + void lock(LockResponse& /* _return */, const LockRequest& /* rqst */) override { + return; + } + void check_lock(LockResponse& /* _return */, const CheckLockRequest& /* rqst */) override { + return; + } + void unlock(const UnlockRequest& /* rqst */) override { + return; + } + void show_locks(ShowLocksResponse& /* _return */, const ShowLocksRequest& /* rqst */) override { + return; + } + void heartbeat(const HeartbeatRequest& /* ids */) override { + return; + } + void heartbeat_txn_range(HeartbeatTxnRangeResponse& /* _return */, const HeartbeatTxnRangeRequest& /* txns */) override { + return; + } + void compact(const CompactionRequest& /* rqst */) override { + return; + } + void compact2(CompactionResponse& /* _return */, const CompactionRequest& /* rqst */) override { + return; + } + void show_compact(ShowCompactResponse& /* _return */, const ShowCompactRequest& /* rqst */) override { + return; + } + bool submit_for_cleanup(const CompactionRequest& /* o1 */, const int64_t /* o2 */, const int64_t /* o3 */) override { + bool _return = false; + return _return; + } + void add_dynamic_partitions(const AddDynamicPartitions& /* rqst */) override { + return; + } + void find_next_compact(OptionalCompactionInfoStruct& /* _return */, const std::string& /* workerId */) override { + return; + } + void find_next_compact2(OptionalCompactionInfoStruct& /* _return */, const FindNextCompactRequest& /* rqst */) override { + return; + } + void update_compactor_state(const CompactionInfoStruct& /* cr */, const int64_t /* txn_id */) override { + return; + } + void find_columns_with_stats(std::vector & /* _return */, const CompactionInfoStruct& /* cr */) override { + return; + } + void mark_cleaned(const CompactionInfoStruct& /* cr */) override { + return; + } + void mark_compacted(const CompactionInfoStruct& /* cr */) override { + return; + } + void mark_failed(const CompactionInfoStruct& /* cr */) override { + return; + } + void mark_refused(const CompactionInfoStruct& /* cr */) override { + return; + } + bool update_compaction_metrics_data(const CompactionMetricsDataStruct& /* data */) override { + bool _return = false; + return _return; + } + void remove_compaction_metrics_data(const CompactionMetricsDataRequest& /* request */) override { + return; + } + void set_hadoop_jobid(const std::string& /* jobId */, const int64_t /* cq_id */) override { + return; + } + void get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& /* _return */, const GetLatestCommittedCompactionInfoRequest& /* rqst */) override { + return; + } + void get_next_notification(NotificationEventResponse& /* _return */, const NotificationEventRequest& /* rqst */) override { + return; + } + void get_current_notificationEventId(CurrentNotificationEventId& /* _return */) override { + return; + } + void get_notification_events_count(NotificationEventsCountResponse& /* _return */, const NotificationEventsCountRequest& /* rqst */) override { + return; + } + void fire_listener_event(FireEventResponse& /* _return */, const FireEventRequest& /* rqst */) override { + return; + } + void flushCache() override { + return; + } + void add_write_notification_log(WriteNotificationLogResponse& /* _return */, const WriteNotificationLogRequest& /* rqst */) override { + return; + } + void add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& /* _return */, const WriteNotificationLogBatchRequest& /* rqst */) override { + return; + } + void cm_recycle(CmRecycleResponse& /* _return */, const CmRecycleRequest& /* request */) override { + return; + } + void get_file_metadata_by_expr(GetFileMetadataByExprResult& /* _return */, const GetFileMetadataByExprRequest& /* req */) override { + return; + } + void get_file_metadata(GetFileMetadataResult& /* _return */, const GetFileMetadataRequest& /* req */) override { + return; + } + void put_file_metadata(PutFileMetadataResult& /* _return */, const PutFileMetadataRequest& /* req */) override { + return; + } + void clear_file_metadata(ClearFileMetadataResult& /* _return */, const ClearFileMetadataRequest& /* req */) override { + return; + } + void cache_file_metadata(CacheFileMetadataResult& /* _return */, const CacheFileMetadataRequest& /* req */) override { + return; + } + void get_metastore_db_uuid(std::string& /* _return */) override { + return; + } + void create_resource_plan(WMCreateResourcePlanResponse& /* _return */, const WMCreateResourcePlanRequest& /* request */) override { + return; + } + void get_resource_plan(WMGetResourcePlanResponse& /* _return */, const WMGetResourcePlanRequest& /* request */) override { + return; + } + void get_active_resource_plan(WMGetActiveResourcePlanResponse& /* _return */, const WMGetActiveResourcePlanRequest& /* request */) override { + return; + } + void get_all_resource_plans(WMGetAllResourcePlanResponse& /* _return */, const WMGetAllResourcePlanRequest& /* request */) override { + return; + } + void alter_resource_plan(WMAlterResourcePlanResponse& /* _return */, const WMAlterResourcePlanRequest& /* request */) override { + return; + } + void validate_resource_plan(WMValidateResourcePlanResponse& /* _return */, const WMValidateResourcePlanRequest& /* request */) override { + return; + } + void drop_resource_plan(WMDropResourcePlanResponse& /* _return */, const WMDropResourcePlanRequest& /* request */) override { + return; + } + void create_wm_trigger(WMCreateTriggerResponse& /* _return */, const WMCreateTriggerRequest& /* request */) override { + return; + } + void alter_wm_trigger(WMAlterTriggerResponse& /* _return */, const WMAlterTriggerRequest& /* request */) override { + return; + } + void drop_wm_trigger(WMDropTriggerResponse& /* _return */, const WMDropTriggerRequest& /* request */) override { + return; + } + void get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& /* _return */, const WMGetTriggersForResourePlanRequest& /* request */) override { + return; + } + void create_wm_pool(WMCreatePoolResponse& /* _return */, const WMCreatePoolRequest& /* request */) override { + return; + } + void alter_wm_pool(WMAlterPoolResponse& /* _return */, const WMAlterPoolRequest& /* request */) override { + return; + } + void drop_wm_pool(WMDropPoolResponse& /* _return */, const WMDropPoolRequest& /* request */) override { + return; + } + void create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& /* _return */, const WMCreateOrUpdateMappingRequest& /* request */) override { + return; + } + void drop_wm_mapping(WMDropMappingResponse& /* _return */, const WMDropMappingRequest& /* request */) override { + return; + } + void create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& /* _return */, const WMCreateOrDropTriggerToPoolMappingRequest& /* request */) override { + return; + } + void create_ischema(const ISchema& /* schema */) override { + return; + } + void alter_ischema(const AlterISchemaRequest& /* rqst */) override { + return; + } + void get_ischema(ISchema& /* _return */, const ISchemaName& /* name */) override { + return; + } + void drop_ischema(const ISchemaName& /* name */) override { + return; + } + void add_schema_version(const SchemaVersion& /* schemaVersion */) override { + return; + } + void get_schema_version(SchemaVersion& /* _return */, const SchemaVersionDescriptor& /* schemaVersion */) override { + return; + } + void get_schema_latest_version(SchemaVersion& /* _return */, const ISchemaName& /* schemaName */) override { + return; + } + void get_schema_all_versions(std::vector & /* _return */, const ISchemaName& /* schemaName */) override { + return; + } + void drop_schema_version(const SchemaVersionDescriptor& /* schemaVersion */) override { + return; + } + void get_schemas_by_cols(FindSchemasByColsResp& /* _return */, const FindSchemasByColsRqst& /* rqst */) override { + return; + } + void map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& /* rqst */) override { + return; + } + void set_schema_version_state(const SetSchemaVersionStateRequest& /* rqst */) override { + return; + } + void add_serde(const SerDeInfo& /* serde */) override { + return; + } + void get_serde(SerDeInfo& /* _return */, const GetSerdeRequest& /* rqst */) override { + return; + } + void get_lock_materialization_rebuild(LockResponse& /* _return */, const std::string& /* dbName */, const std::string& /* tableName */, const int64_t /* txnId */) override { + return; + } + bool heartbeat_lock_materialization_rebuild(const std::string& /* dbName */, const std::string& /* tableName */, const int64_t /* txnId */) override { + bool _return = false; + return _return; + } + void add_runtime_stats(const RuntimeStat& /* stat */) override { + return; + } + void get_runtime_stats(std::vector & /* _return */, const GetRuntimeStatsRequest& /* rqst */) override { + return; + } + void get_partitions_with_specs(GetPartitionsResponse& /* _return */, const GetPartitionsRequest& /* request */) override { + return; + } + void scheduled_query_poll(ScheduledQueryPollResponse& /* _return */, const ScheduledQueryPollRequest& /* request */) override { + return; + } + void scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& /* request */) override { + return; + } + void scheduled_query_progress(const ScheduledQueryProgressInfo& /* info */) override { + return; + } + void get_scheduled_query(ScheduledQuery& /* _return */, const ScheduledQueryKey& /* scheduleKey */) override { + return; + } + void add_replication_metrics(const ReplicationMetricList& /* replicationMetricList */) override { + return; + } + void get_replication_metrics(ReplicationMetricList& /* _return */, const GetReplicationMetricsRequest& /* rqst */) override { + return; + } + void get_open_txns_req(GetOpenTxnsResponse& /* _return */, const GetOpenTxnsRequest& /* getOpenTxnsRequest */) override { + return; + } + void create_stored_procedure(const StoredProcedure& /* proc */) override { + return; + } + void get_stored_procedure(StoredProcedure& /* _return */, const StoredProcedureRequest& /* request */) override { + return; + } + void drop_stored_procedure(const StoredProcedureRequest& /* request */) override { + return; + } + void get_all_stored_procedures(std::vector & /* _return */, const ListStoredProcedureRequest& /* request */) override { + return; + } + void find_package(Package& /* _return */, const GetPackageRequest& /* request */) override { + return; + } + void add_package(const AddPackageRequest& /* request */) override { + return; + } + void get_all_packages(std::vector & /* _return */, const ListPackageRequest& /* request */) override { + return; + } + void drop_package(const DropPackageRequest& /* request */) override { + return; + } + void get_all_write_event_info(std::vector & /* _return */, const GetAllWriteEventInfoRequest& /* request */) override { + return; + } +}; + +typedef struct _ThriftHiveMetastore_abort_Compactions_args__isset { + _ThriftHiveMetastore_abort_Compactions_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_abort_Compactions_args__isset; + +class ThriftHiveMetastore_abort_Compactions_args { + public: + + ThriftHiveMetastore_abort_Compactions_args(const ThriftHiveMetastore_abort_Compactions_args&); + ThriftHiveMetastore_abort_Compactions_args& operator=(const ThriftHiveMetastore_abort_Compactions_args&); + ThriftHiveMetastore_abort_Compactions_args() noexcept; + + virtual ~ThriftHiveMetastore_abort_Compactions_args() noexcept; + AbortCompactionRequest rqst; + + _ThriftHiveMetastore_abort_Compactions_args__isset __isset; + + void __set_rqst(const AbortCompactionRequest& val); + + bool operator == (const ThriftHiveMetastore_abort_Compactions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_Compactions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_Compactions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_abort_Compactions_pargs { + public: + + + virtual ~ThriftHiveMetastore_abort_Compactions_pargs() noexcept; + const AbortCompactionRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_Compactions_result__isset { + _ThriftHiveMetastore_abort_Compactions_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_abort_Compactions_result__isset; + +class ThriftHiveMetastore_abort_Compactions_result { + public: + + ThriftHiveMetastore_abort_Compactions_result(const ThriftHiveMetastore_abort_Compactions_result&); + ThriftHiveMetastore_abort_Compactions_result& operator=(const ThriftHiveMetastore_abort_Compactions_result&); + ThriftHiveMetastore_abort_Compactions_result() noexcept; + + virtual ~ThriftHiveMetastore_abort_Compactions_result() noexcept; + AbortCompactResponse success; + + _ThriftHiveMetastore_abort_Compactions_result__isset __isset; + + void __set_success(const AbortCompactResponse& val); + + bool operator == (const ThriftHiveMetastore_abort_Compactions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_Compactions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_Compactions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_Compactions_presult__isset { + _ThriftHiveMetastore_abort_Compactions_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_abort_Compactions_presult__isset; + +class ThriftHiveMetastore_abort_Compactions_presult { + public: + + + virtual ~ThriftHiveMetastore_abort_Compactions_presult() noexcept; + AbortCompactResponse* success; + + _ThriftHiveMetastore_abort_Compactions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_getMetaConf_args__isset { + _ThriftHiveMetastore_getMetaConf_args__isset() : key(false) {} + bool key :1; +} _ThriftHiveMetastore_getMetaConf_args__isset; + +class ThriftHiveMetastore_getMetaConf_args { + public: + + ThriftHiveMetastore_getMetaConf_args(const ThriftHiveMetastore_getMetaConf_args&); + ThriftHiveMetastore_getMetaConf_args& operator=(const ThriftHiveMetastore_getMetaConf_args&); + ThriftHiveMetastore_getMetaConf_args() noexcept; + + virtual ~ThriftHiveMetastore_getMetaConf_args() noexcept; + std::string key; + + _ThriftHiveMetastore_getMetaConf_args__isset __isset; + + void __set_key(const std::string& val); + + bool operator == (const ThriftHiveMetastore_getMetaConf_args & rhs) const; + bool operator != (const ThriftHiveMetastore_getMetaConf_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_getMetaConf_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_getMetaConf_pargs { + public: + + + virtual ~ThriftHiveMetastore_getMetaConf_pargs() noexcept; + const std::string* key; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_getMetaConf_result__isset { + _ThriftHiveMetastore_getMetaConf_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_getMetaConf_result__isset; + +class ThriftHiveMetastore_getMetaConf_result { + public: + + ThriftHiveMetastore_getMetaConf_result(const ThriftHiveMetastore_getMetaConf_result&); + ThriftHiveMetastore_getMetaConf_result& operator=(const ThriftHiveMetastore_getMetaConf_result&); + ThriftHiveMetastore_getMetaConf_result() noexcept; + + virtual ~ThriftHiveMetastore_getMetaConf_result() noexcept; + std::string success; + MetaException o1; + + _ThriftHiveMetastore_getMetaConf_result__isset __isset; + + void __set_success(const std::string& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_getMetaConf_result & rhs) const; + bool operator != (const ThriftHiveMetastore_getMetaConf_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_getMetaConf_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_getMetaConf_presult__isset { + _ThriftHiveMetastore_getMetaConf_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_getMetaConf_presult__isset; + +class ThriftHiveMetastore_getMetaConf_presult { + public: + + + virtual ~ThriftHiveMetastore_getMetaConf_presult() noexcept; + std::string* success; + MetaException o1; + + _ThriftHiveMetastore_getMetaConf_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_setMetaConf_args__isset { + _ThriftHiveMetastore_setMetaConf_args__isset() : key(false), value(false) {} + bool key :1; + bool value :1; +} _ThriftHiveMetastore_setMetaConf_args__isset; + +class ThriftHiveMetastore_setMetaConf_args { + public: + + ThriftHiveMetastore_setMetaConf_args(const ThriftHiveMetastore_setMetaConf_args&); + ThriftHiveMetastore_setMetaConf_args& operator=(const ThriftHiveMetastore_setMetaConf_args&); + ThriftHiveMetastore_setMetaConf_args() noexcept; + + virtual ~ThriftHiveMetastore_setMetaConf_args() noexcept; + std::string key; + std::string value; + + _ThriftHiveMetastore_setMetaConf_args__isset __isset; + + void __set_key(const std::string& val); + + void __set_value(const std::string& val); + + bool operator == (const ThriftHiveMetastore_setMetaConf_args & rhs) const; + bool operator != (const ThriftHiveMetastore_setMetaConf_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_setMetaConf_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_setMetaConf_pargs { + public: + + + virtual ~ThriftHiveMetastore_setMetaConf_pargs() noexcept; + const std::string* key; + const std::string* value; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_setMetaConf_result__isset { + _ThriftHiveMetastore_setMetaConf_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_setMetaConf_result__isset; + +class ThriftHiveMetastore_setMetaConf_result { + public: + + ThriftHiveMetastore_setMetaConf_result(const ThriftHiveMetastore_setMetaConf_result&); + ThriftHiveMetastore_setMetaConf_result& operator=(const ThriftHiveMetastore_setMetaConf_result&); + ThriftHiveMetastore_setMetaConf_result() noexcept; + + virtual ~ThriftHiveMetastore_setMetaConf_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_setMetaConf_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_setMetaConf_result & rhs) const; + bool operator != (const ThriftHiveMetastore_setMetaConf_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_setMetaConf_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_setMetaConf_presult__isset { + _ThriftHiveMetastore_setMetaConf_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_setMetaConf_presult__isset; + +class ThriftHiveMetastore_setMetaConf_presult { + public: + + + virtual ~ThriftHiveMetastore_setMetaConf_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_setMetaConf_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_catalog_args__isset { + _ThriftHiveMetastore_create_catalog_args__isset() : catalog(false) {} + bool catalog :1; +} _ThriftHiveMetastore_create_catalog_args__isset; + +class ThriftHiveMetastore_create_catalog_args { + public: + + ThriftHiveMetastore_create_catalog_args(const ThriftHiveMetastore_create_catalog_args&); + ThriftHiveMetastore_create_catalog_args& operator=(const ThriftHiveMetastore_create_catalog_args&); + ThriftHiveMetastore_create_catalog_args() noexcept; + + virtual ~ThriftHiveMetastore_create_catalog_args() noexcept; + CreateCatalogRequest catalog; + + _ThriftHiveMetastore_create_catalog_args__isset __isset; + + void __set_catalog(const CreateCatalogRequest& val); + + bool operator == (const ThriftHiveMetastore_create_catalog_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_catalog_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_catalog_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_catalog_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_catalog_pargs() noexcept; + const CreateCatalogRequest* catalog; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_catalog_result__isset { + _ThriftHiveMetastore_create_catalog_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_catalog_result__isset; + +class ThriftHiveMetastore_create_catalog_result { + public: + + ThriftHiveMetastore_create_catalog_result(const ThriftHiveMetastore_create_catalog_result&); + ThriftHiveMetastore_create_catalog_result& operator=(const ThriftHiveMetastore_create_catalog_result&); + ThriftHiveMetastore_create_catalog_result() noexcept; + + virtual ~ThriftHiveMetastore_create_catalog_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_catalog_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_catalog_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_catalog_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_catalog_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_catalog_presult__isset { + _ThriftHiveMetastore_create_catalog_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_catalog_presult__isset; + +class ThriftHiveMetastore_create_catalog_presult { + public: + + + virtual ~ThriftHiveMetastore_create_catalog_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_catalog_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_catalog_args__isset { + _ThriftHiveMetastore_alter_catalog_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_alter_catalog_args__isset; + +class ThriftHiveMetastore_alter_catalog_args { + public: + + ThriftHiveMetastore_alter_catalog_args(const ThriftHiveMetastore_alter_catalog_args&); + ThriftHiveMetastore_alter_catalog_args& operator=(const ThriftHiveMetastore_alter_catalog_args&); + ThriftHiveMetastore_alter_catalog_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_catalog_args() noexcept; + AlterCatalogRequest rqst; + + _ThriftHiveMetastore_alter_catalog_args__isset __isset; + + void __set_rqst(const AlterCatalogRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_catalog_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_catalog_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_catalog_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_catalog_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_catalog_pargs() noexcept; + const AlterCatalogRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_catalog_result__isset { + _ThriftHiveMetastore_alter_catalog_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_catalog_result__isset; + +class ThriftHiveMetastore_alter_catalog_result { + public: + + ThriftHiveMetastore_alter_catalog_result(const ThriftHiveMetastore_alter_catalog_result&); + ThriftHiveMetastore_alter_catalog_result& operator=(const ThriftHiveMetastore_alter_catalog_result&); + ThriftHiveMetastore_alter_catalog_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_catalog_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_catalog_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_catalog_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_catalog_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_catalog_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_catalog_presult__isset { + _ThriftHiveMetastore_alter_catalog_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_catalog_presult__isset; + +class ThriftHiveMetastore_alter_catalog_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_catalog_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_catalog_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_catalog_args__isset { + _ThriftHiveMetastore_get_catalog_args__isset() : catName(false) {} + bool catName :1; +} _ThriftHiveMetastore_get_catalog_args__isset; + +class ThriftHiveMetastore_get_catalog_args { + public: + + ThriftHiveMetastore_get_catalog_args(const ThriftHiveMetastore_get_catalog_args&); + ThriftHiveMetastore_get_catalog_args& operator=(const ThriftHiveMetastore_get_catalog_args&); + ThriftHiveMetastore_get_catalog_args() noexcept; + + virtual ~ThriftHiveMetastore_get_catalog_args() noexcept; + GetCatalogRequest catName; + + _ThriftHiveMetastore_get_catalog_args__isset __isset; + + void __set_catName(const GetCatalogRequest& val); + + bool operator == (const ThriftHiveMetastore_get_catalog_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_catalog_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_catalog_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_catalog_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_catalog_pargs() noexcept; + const GetCatalogRequest* catName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_catalog_result__isset { + _ThriftHiveMetastore_get_catalog_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_catalog_result__isset; + +class ThriftHiveMetastore_get_catalog_result { + public: + + ThriftHiveMetastore_get_catalog_result(const ThriftHiveMetastore_get_catalog_result&); + ThriftHiveMetastore_get_catalog_result& operator=(const ThriftHiveMetastore_get_catalog_result&); + ThriftHiveMetastore_get_catalog_result() noexcept; + + virtual ~ThriftHiveMetastore_get_catalog_result() noexcept; + GetCatalogResponse success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_catalog_result__isset __isset; + + void __set_success(const GetCatalogResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_catalog_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_catalog_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_catalog_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_catalog_presult__isset { + _ThriftHiveMetastore_get_catalog_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_catalog_presult__isset; + +class ThriftHiveMetastore_get_catalog_presult { + public: + + + virtual ~ThriftHiveMetastore_get_catalog_presult() noexcept; + GetCatalogResponse* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_catalog_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_catalogs_args { + public: + + ThriftHiveMetastore_get_catalogs_args(const ThriftHiveMetastore_get_catalogs_args&) noexcept; + ThriftHiveMetastore_get_catalogs_args& operator=(const ThriftHiveMetastore_get_catalogs_args&) noexcept; + ThriftHiveMetastore_get_catalogs_args() noexcept; + + virtual ~ThriftHiveMetastore_get_catalogs_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_catalogs_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_catalogs_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_catalogs_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_catalogs_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_catalogs_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_catalogs_result__isset { + _ThriftHiveMetastore_get_catalogs_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_catalogs_result__isset; + +class ThriftHiveMetastore_get_catalogs_result { + public: + + ThriftHiveMetastore_get_catalogs_result(const ThriftHiveMetastore_get_catalogs_result&); + ThriftHiveMetastore_get_catalogs_result& operator=(const ThriftHiveMetastore_get_catalogs_result&); + ThriftHiveMetastore_get_catalogs_result() noexcept; + + virtual ~ThriftHiveMetastore_get_catalogs_result() noexcept; + GetCatalogsResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_catalogs_result__isset __isset; + + void __set_success(const GetCatalogsResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_catalogs_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_catalogs_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_catalogs_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_catalogs_presult__isset { + _ThriftHiveMetastore_get_catalogs_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_catalogs_presult__isset; + +class ThriftHiveMetastore_get_catalogs_presult { + public: + + + virtual ~ThriftHiveMetastore_get_catalogs_presult() noexcept; + GetCatalogsResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_catalogs_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_catalog_args__isset { + _ThriftHiveMetastore_drop_catalog_args__isset() : catName(false) {} + bool catName :1; +} _ThriftHiveMetastore_drop_catalog_args__isset; + +class ThriftHiveMetastore_drop_catalog_args { + public: + + ThriftHiveMetastore_drop_catalog_args(const ThriftHiveMetastore_drop_catalog_args&); + ThriftHiveMetastore_drop_catalog_args& operator=(const ThriftHiveMetastore_drop_catalog_args&); + ThriftHiveMetastore_drop_catalog_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_catalog_args() noexcept; + DropCatalogRequest catName; + + _ThriftHiveMetastore_drop_catalog_args__isset __isset; + + void __set_catName(const DropCatalogRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_catalog_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_catalog_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_catalog_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_catalog_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_catalog_pargs() noexcept; + const DropCatalogRequest* catName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_catalog_result__isset { + _ThriftHiveMetastore_drop_catalog_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_catalog_result__isset; + +class ThriftHiveMetastore_drop_catalog_result { + public: + + ThriftHiveMetastore_drop_catalog_result(const ThriftHiveMetastore_drop_catalog_result&); + ThriftHiveMetastore_drop_catalog_result& operator=(const ThriftHiveMetastore_drop_catalog_result&); + ThriftHiveMetastore_drop_catalog_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_catalog_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_catalog_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_catalog_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_catalog_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_catalog_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_catalog_presult__isset { + _ThriftHiveMetastore_drop_catalog_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_catalog_presult__isset; + +class ThriftHiveMetastore_drop_catalog_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_catalog_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_catalog_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_database_args__isset { + _ThriftHiveMetastore_create_database_args__isset() : database(false) {} + bool database :1; +} _ThriftHiveMetastore_create_database_args__isset; + +class ThriftHiveMetastore_create_database_args { + public: + + ThriftHiveMetastore_create_database_args(const ThriftHiveMetastore_create_database_args&); + ThriftHiveMetastore_create_database_args& operator=(const ThriftHiveMetastore_create_database_args&); + ThriftHiveMetastore_create_database_args() noexcept; + + virtual ~ThriftHiveMetastore_create_database_args() noexcept; + Database database; + + _ThriftHiveMetastore_create_database_args__isset __isset; + + void __set_database(const Database& val); + + bool operator == (const ThriftHiveMetastore_create_database_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_database_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_database_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_database_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_database_pargs() noexcept; + const Database* database; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_database_result__isset { + _ThriftHiveMetastore_create_database_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_database_result__isset; + +class ThriftHiveMetastore_create_database_result { + public: + + ThriftHiveMetastore_create_database_result(const ThriftHiveMetastore_create_database_result&); + ThriftHiveMetastore_create_database_result& operator=(const ThriftHiveMetastore_create_database_result&); + ThriftHiveMetastore_create_database_result() noexcept; + + virtual ~ThriftHiveMetastore_create_database_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_database_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_database_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_database_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_database_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_database_presult__isset { + _ThriftHiveMetastore_create_database_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_database_presult__isset; + +class ThriftHiveMetastore_create_database_presult { + public: + + + virtual ~ThriftHiveMetastore_create_database_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_database_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_database_req_args__isset { + _ThriftHiveMetastore_create_database_req_args__isset() : createDatabaseRequest(false) {} + bool createDatabaseRequest :1; +} _ThriftHiveMetastore_create_database_req_args__isset; + +class ThriftHiveMetastore_create_database_req_args { + public: + + ThriftHiveMetastore_create_database_req_args(const ThriftHiveMetastore_create_database_req_args&); + ThriftHiveMetastore_create_database_req_args& operator=(const ThriftHiveMetastore_create_database_req_args&); + ThriftHiveMetastore_create_database_req_args() noexcept; + + virtual ~ThriftHiveMetastore_create_database_req_args() noexcept; + CreateDatabaseRequest createDatabaseRequest; + + _ThriftHiveMetastore_create_database_req_args__isset __isset; + + void __set_createDatabaseRequest(const CreateDatabaseRequest& val); + + bool operator == (const ThriftHiveMetastore_create_database_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_database_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_database_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_database_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_database_req_pargs() noexcept; + const CreateDatabaseRequest* createDatabaseRequest; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_database_req_result__isset { + _ThriftHiveMetastore_create_database_req_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_database_req_result__isset; + +class ThriftHiveMetastore_create_database_req_result { + public: + + ThriftHiveMetastore_create_database_req_result(const ThriftHiveMetastore_create_database_req_result&); + ThriftHiveMetastore_create_database_req_result& operator=(const ThriftHiveMetastore_create_database_req_result&); + ThriftHiveMetastore_create_database_req_result() noexcept; + + virtual ~ThriftHiveMetastore_create_database_req_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_database_req_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_database_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_database_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_database_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_database_req_presult__isset { + _ThriftHiveMetastore_create_database_req_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_database_req_presult__isset; + +class ThriftHiveMetastore_create_database_req_presult { + public: + + + virtual ~ThriftHiveMetastore_create_database_req_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_database_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_database_args__isset { + _ThriftHiveMetastore_get_database_args__isset() : name(false) {} + bool name :1; +} _ThriftHiveMetastore_get_database_args__isset; + +class ThriftHiveMetastore_get_database_args { + public: + + ThriftHiveMetastore_get_database_args(const ThriftHiveMetastore_get_database_args&); + ThriftHiveMetastore_get_database_args& operator=(const ThriftHiveMetastore_get_database_args&); + ThriftHiveMetastore_get_database_args() noexcept; + + virtual ~ThriftHiveMetastore_get_database_args() noexcept; + std::string name; + + _ThriftHiveMetastore_get_database_args__isset __isset; + + void __set_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_database_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_database_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_database_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_database_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_database_pargs() noexcept; + const std::string* name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_database_result__isset { + _ThriftHiveMetastore_get_database_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_database_result__isset; + +class ThriftHiveMetastore_get_database_result { + public: + + ThriftHiveMetastore_get_database_result(const ThriftHiveMetastore_get_database_result&); + ThriftHiveMetastore_get_database_result& operator=(const ThriftHiveMetastore_get_database_result&); + ThriftHiveMetastore_get_database_result() noexcept; + + virtual ~ThriftHiveMetastore_get_database_result() noexcept; + Database success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_database_result__isset __isset; + + void __set_success(const Database& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_database_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_database_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_database_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_database_presult__isset { + _ThriftHiveMetastore_get_database_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_database_presult__isset; + +class ThriftHiveMetastore_get_database_presult { + public: + + + virtual ~ThriftHiveMetastore_get_database_presult() noexcept; + Database* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_database_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_database_req_args__isset { + _ThriftHiveMetastore_get_database_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_database_req_args__isset; + +class ThriftHiveMetastore_get_database_req_args { + public: + + ThriftHiveMetastore_get_database_req_args(const ThriftHiveMetastore_get_database_req_args&); + ThriftHiveMetastore_get_database_req_args& operator=(const ThriftHiveMetastore_get_database_req_args&); + ThriftHiveMetastore_get_database_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_database_req_args() noexcept; + GetDatabaseRequest request; + + _ThriftHiveMetastore_get_database_req_args__isset __isset; + + void __set_request(const GetDatabaseRequest& val); + + bool operator == (const ThriftHiveMetastore_get_database_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_database_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_database_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_database_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_database_req_pargs() noexcept; + const GetDatabaseRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_database_req_result__isset { + _ThriftHiveMetastore_get_database_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_database_req_result__isset; + +class ThriftHiveMetastore_get_database_req_result { + public: + + ThriftHiveMetastore_get_database_req_result(const ThriftHiveMetastore_get_database_req_result&); + ThriftHiveMetastore_get_database_req_result& operator=(const ThriftHiveMetastore_get_database_req_result&); + ThriftHiveMetastore_get_database_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_database_req_result() noexcept; + Database success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_database_req_result__isset __isset; + + void __set_success(const Database& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_database_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_database_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_database_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_database_req_presult__isset { + _ThriftHiveMetastore_get_database_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_database_req_presult__isset; + +class ThriftHiveMetastore_get_database_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_database_req_presult() noexcept; + Database* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_database_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_database_args__isset { + _ThriftHiveMetastore_drop_database_args__isset() : name(false), deleteData(false), cascade(false) {} + bool name :1; + bool deleteData :1; + bool cascade :1; +} _ThriftHiveMetastore_drop_database_args__isset; + +class ThriftHiveMetastore_drop_database_args { + public: + + ThriftHiveMetastore_drop_database_args(const ThriftHiveMetastore_drop_database_args&); + ThriftHiveMetastore_drop_database_args& operator=(const ThriftHiveMetastore_drop_database_args&); + ThriftHiveMetastore_drop_database_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_database_args() noexcept; + std::string name; + bool deleteData; + bool cascade; + + _ThriftHiveMetastore_drop_database_args__isset __isset; + + void __set_name(const std::string& val); + + void __set_deleteData(const bool val); + + void __set_cascade(const bool val); + + bool operator == (const ThriftHiveMetastore_drop_database_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_database_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_database_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_database_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_database_pargs() noexcept; + const std::string* name; + const bool* deleteData; + const bool* cascade; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_database_result__isset { + _ThriftHiveMetastore_drop_database_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_database_result__isset; + +class ThriftHiveMetastore_drop_database_result { + public: + + ThriftHiveMetastore_drop_database_result(const ThriftHiveMetastore_drop_database_result&); + ThriftHiveMetastore_drop_database_result& operator=(const ThriftHiveMetastore_drop_database_result&); + ThriftHiveMetastore_drop_database_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_database_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_database_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_database_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_database_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_database_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_database_presult__isset { + _ThriftHiveMetastore_drop_database_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_database_presult__isset; + +class ThriftHiveMetastore_drop_database_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_database_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_database_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_database_req_args__isset { + _ThriftHiveMetastore_drop_database_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_drop_database_req_args__isset; + +class ThriftHiveMetastore_drop_database_req_args { + public: + + ThriftHiveMetastore_drop_database_req_args(const ThriftHiveMetastore_drop_database_req_args&); + ThriftHiveMetastore_drop_database_req_args& operator=(const ThriftHiveMetastore_drop_database_req_args&); + ThriftHiveMetastore_drop_database_req_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_database_req_args() noexcept; + DropDatabaseRequest req; + + _ThriftHiveMetastore_drop_database_req_args__isset __isset; + + void __set_req(const DropDatabaseRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_database_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_database_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_database_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_database_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_database_req_pargs() noexcept; + const DropDatabaseRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_database_req_result__isset { + _ThriftHiveMetastore_drop_database_req_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_database_req_result__isset; + +class ThriftHiveMetastore_drop_database_req_result { + public: + + ThriftHiveMetastore_drop_database_req_result(const ThriftHiveMetastore_drop_database_req_result&); + ThriftHiveMetastore_drop_database_req_result& operator=(const ThriftHiveMetastore_drop_database_req_result&); + ThriftHiveMetastore_drop_database_req_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_database_req_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_database_req_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_database_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_database_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_database_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_database_req_presult__isset { + _ThriftHiveMetastore_drop_database_req_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_database_req_presult__isset; + +class ThriftHiveMetastore_drop_database_req_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_database_req_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_database_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_databases_args__isset { + _ThriftHiveMetastore_get_databases_args__isset() : pattern(false) {} + bool pattern :1; +} _ThriftHiveMetastore_get_databases_args__isset; + +class ThriftHiveMetastore_get_databases_args { + public: + + ThriftHiveMetastore_get_databases_args(const ThriftHiveMetastore_get_databases_args&); + ThriftHiveMetastore_get_databases_args& operator=(const ThriftHiveMetastore_get_databases_args&); + ThriftHiveMetastore_get_databases_args() noexcept; + + virtual ~ThriftHiveMetastore_get_databases_args() noexcept; + std::string pattern; + + _ThriftHiveMetastore_get_databases_args__isset __isset; + + void __set_pattern(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_databases_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_databases_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_databases_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_databases_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_databases_pargs() noexcept; + const std::string* pattern; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_databases_result__isset { + _ThriftHiveMetastore_get_databases_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_databases_result__isset; + +class ThriftHiveMetastore_get_databases_result { + public: + + ThriftHiveMetastore_get_databases_result(const ThriftHiveMetastore_get_databases_result&); + ThriftHiveMetastore_get_databases_result& operator=(const ThriftHiveMetastore_get_databases_result&); + ThriftHiveMetastore_get_databases_result() noexcept; + + virtual ~ThriftHiveMetastore_get_databases_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_databases_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_databases_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_databases_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_databases_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_databases_presult__isset { + _ThriftHiveMetastore_get_databases_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_databases_presult__isset; + +class ThriftHiveMetastore_get_databases_presult { + public: + + + virtual ~ThriftHiveMetastore_get_databases_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_databases_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_all_databases_args { + public: + + ThriftHiveMetastore_get_all_databases_args(const ThriftHiveMetastore_get_all_databases_args&) noexcept; + ThriftHiveMetastore_get_all_databases_args& operator=(const ThriftHiveMetastore_get_all_databases_args&) noexcept; + ThriftHiveMetastore_get_all_databases_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_databases_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_all_databases_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_all_databases_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_databases_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_databases_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_databases_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_databases_result__isset { + _ThriftHiveMetastore_get_all_databases_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_databases_result__isset; + +class ThriftHiveMetastore_get_all_databases_result { + public: + + ThriftHiveMetastore_get_all_databases_result(const ThriftHiveMetastore_get_all_databases_result&); + ThriftHiveMetastore_get_all_databases_result& operator=(const ThriftHiveMetastore_get_all_databases_result&); + ThriftHiveMetastore_get_all_databases_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_databases_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_all_databases_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_databases_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_databases_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_databases_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_databases_presult__isset { + _ThriftHiveMetastore_get_all_databases_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_databases_presult__isset; + +class ThriftHiveMetastore_get_all_databases_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_databases_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_all_databases_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_database_args__isset { + _ThriftHiveMetastore_alter_database_args__isset() : dbname(false), db(false) {} + bool dbname :1; + bool db :1; +} _ThriftHiveMetastore_alter_database_args__isset; + +class ThriftHiveMetastore_alter_database_args { + public: + + ThriftHiveMetastore_alter_database_args(const ThriftHiveMetastore_alter_database_args&); + ThriftHiveMetastore_alter_database_args& operator=(const ThriftHiveMetastore_alter_database_args&); + ThriftHiveMetastore_alter_database_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_database_args() noexcept; + std::string dbname; + Database db; + + _ThriftHiveMetastore_alter_database_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_db(const Database& val); + + bool operator == (const ThriftHiveMetastore_alter_database_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_database_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_database_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_database_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_database_pargs() noexcept; + const std::string* dbname; + const Database* db; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_database_result__isset { + _ThriftHiveMetastore_alter_database_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_database_result__isset; + +class ThriftHiveMetastore_alter_database_result { + public: + + ThriftHiveMetastore_alter_database_result(const ThriftHiveMetastore_alter_database_result&); + ThriftHiveMetastore_alter_database_result& operator=(const ThriftHiveMetastore_alter_database_result&); + ThriftHiveMetastore_alter_database_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_database_result() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_database_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_alter_database_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_database_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_database_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_database_presult__isset { + _ThriftHiveMetastore_alter_database_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_database_presult__isset; + +class ThriftHiveMetastore_alter_database_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_database_presult() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_database_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_database_req_args__isset { + _ThriftHiveMetastore_alter_database_req_args__isset() : alterDbReq(false) {} + bool alterDbReq :1; +} _ThriftHiveMetastore_alter_database_req_args__isset; + +class ThriftHiveMetastore_alter_database_req_args { + public: + + ThriftHiveMetastore_alter_database_req_args(const ThriftHiveMetastore_alter_database_req_args&); + ThriftHiveMetastore_alter_database_req_args& operator=(const ThriftHiveMetastore_alter_database_req_args&); + ThriftHiveMetastore_alter_database_req_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_database_req_args() noexcept; + AlterDatabaseRequest alterDbReq; + + _ThriftHiveMetastore_alter_database_req_args__isset __isset; + + void __set_alterDbReq(const AlterDatabaseRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_database_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_database_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_database_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_database_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_database_req_pargs() noexcept; + const AlterDatabaseRequest* alterDbReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_database_req_result__isset { + _ThriftHiveMetastore_alter_database_req_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_database_req_result__isset; + +class ThriftHiveMetastore_alter_database_req_result { + public: + + ThriftHiveMetastore_alter_database_req_result(const ThriftHiveMetastore_alter_database_req_result&); + ThriftHiveMetastore_alter_database_req_result& operator=(const ThriftHiveMetastore_alter_database_req_result&); + ThriftHiveMetastore_alter_database_req_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_database_req_result() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_database_req_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_alter_database_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_database_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_database_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_database_req_presult__isset { + _ThriftHiveMetastore_alter_database_req_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_database_req_presult__isset; + +class ThriftHiveMetastore_alter_database_req_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_database_req_presult() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_database_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_dataconnector_req_args__isset { + _ThriftHiveMetastore_create_dataconnector_req_args__isset() : connectorReq(false) {} + bool connectorReq :1; +} _ThriftHiveMetastore_create_dataconnector_req_args__isset; + +class ThriftHiveMetastore_create_dataconnector_req_args { + public: + + ThriftHiveMetastore_create_dataconnector_req_args(const ThriftHiveMetastore_create_dataconnector_req_args&); + ThriftHiveMetastore_create_dataconnector_req_args& operator=(const ThriftHiveMetastore_create_dataconnector_req_args&); + ThriftHiveMetastore_create_dataconnector_req_args() noexcept; + + virtual ~ThriftHiveMetastore_create_dataconnector_req_args() noexcept; + CreateDataConnectorRequest connectorReq; + + _ThriftHiveMetastore_create_dataconnector_req_args__isset __isset; + + void __set_connectorReq(const CreateDataConnectorRequest& val); + + bool operator == (const ThriftHiveMetastore_create_dataconnector_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_dataconnector_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_dataconnector_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_dataconnector_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_dataconnector_req_pargs() noexcept; + const CreateDataConnectorRequest* connectorReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_dataconnector_req_result__isset { + _ThriftHiveMetastore_create_dataconnector_req_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_dataconnector_req_result__isset; + +class ThriftHiveMetastore_create_dataconnector_req_result { + public: + + ThriftHiveMetastore_create_dataconnector_req_result(const ThriftHiveMetastore_create_dataconnector_req_result&); + ThriftHiveMetastore_create_dataconnector_req_result& operator=(const ThriftHiveMetastore_create_dataconnector_req_result&); + ThriftHiveMetastore_create_dataconnector_req_result() noexcept; + + virtual ~ThriftHiveMetastore_create_dataconnector_req_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_dataconnector_req_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_dataconnector_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_dataconnector_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_dataconnector_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_dataconnector_req_presult__isset { + _ThriftHiveMetastore_create_dataconnector_req_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_dataconnector_req_presult__isset; + +class ThriftHiveMetastore_create_dataconnector_req_presult { + public: + + + virtual ~ThriftHiveMetastore_create_dataconnector_req_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_dataconnector_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_dataconnector_req_args__isset { + _ThriftHiveMetastore_get_dataconnector_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_dataconnector_req_args__isset; + +class ThriftHiveMetastore_get_dataconnector_req_args { + public: + + ThriftHiveMetastore_get_dataconnector_req_args(const ThriftHiveMetastore_get_dataconnector_req_args&); + ThriftHiveMetastore_get_dataconnector_req_args& operator=(const ThriftHiveMetastore_get_dataconnector_req_args&); + ThriftHiveMetastore_get_dataconnector_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_dataconnector_req_args() noexcept; + GetDataConnectorRequest request; + + _ThriftHiveMetastore_get_dataconnector_req_args__isset __isset; + + void __set_request(const GetDataConnectorRequest& val); + + bool operator == (const ThriftHiveMetastore_get_dataconnector_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_dataconnector_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_dataconnector_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_dataconnector_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_dataconnector_req_pargs() noexcept; + const GetDataConnectorRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_dataconnector_req_result__isset { + _ThriftHiveMetastore_get_dataconnector_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_dataconnector_req_result__isset; + +class ThriftHiveMetastore_get_dataconnector_req_result { + public: + + ThriftHiveMetastore_get_dataconnector_req_result(const ThriftHiveMetastore_get_dataconnector_req_result&); + ThriftHiveMetastore_get_dataconnector_req_result& operator=(const ThriftHiveMetastore_get_dataconnector_req_result&); + ThriftHiveMetastore_get_dataconnector_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_dataconnector_req_result() noexcept; + DataConnector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_dataconnector_req_result__isset __isset; + + void __set_success(const DataConnector& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_dataconnector_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_dataconnector_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_dataconnector_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_dataconnector_req_presult__isset { + _ThriftHiveMetastore_get_dataconnector_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_dataconnector_req_presult__isset; + +class ThriftHiveMetastore_get_dataconnector_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_dataconnector_req_presult() noexcept; + DataConnector* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_dataconnector_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_dataconnector_req_args__isset { + _ThriftHiveMetastore_drop_dataconnector_req_args__isset() : dropDcReq(false) {} + bool dropDcReq :1; +} _ThriftHiveMetastore_drop_dataconnector_req_args__isset; + +class ThriftHiveMetastore_drop_dataconnector_req_args { + public: + + ThriftHiveMetastore_drop_dataconnector_req_args(const ThriftHiveMetastore_drop_dataconnector_req_args&); + ThriftHiveMetastore_drop_dataconnector_req_args& operator=(const ThriftHiveMetastore_drop_dataconnector_req_args&); + ThriftHiveMetastore_drop_dataconnector_req_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_dataconnector_req_args() noexcept; + DropDataConnectorRequest dropDcReq; + + _ThriftHiveMetastore_drop_dataconnector_req_args__isset __isset; + + void __set_dropDcReq(const DropDataConnectorRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_dataconnector_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_dataconnector_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_dataconnector_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_dataconnector_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_dataconnector_req_pargs() noexcept; + const DropDataConnectorRequest* dropDcReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_dataconnector_req_result__isset { + _ThriftHiveMetastore_drop_dataconnector_req_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_dataconnector_req_result__isset; + +class ThriftHiveMetastore_drop_dataconnector_req_result { + public: + + ThriftHiveMetastore_drop_dataconnector_req_result(const ThriftHiveMetastore_drop_dataconnector_req_result&); + ThriftHiveMetastore_drop_dataconnector_req_result& operator=(const ThriftHiveMetastore_drop_dataconnector_req_result&); + ThriftHiveMetastore_drop_dataconnector_req_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_dataconnector_req_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_dataconnector_req_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_dataconnector_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_dataconnector_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_dataconnector_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_dataconnector_req_presult__isset { + _ThriftHiveMetastore_drop_dataconnector_req_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_dataconnector_req_presult__isset; + +class ThriftHiveMetastore_drop_dataconnector_req_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_dataconnector_req_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_dataconnector_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_dataconnectors_args { + public: + + ThriftHiveMetastore_get_dataconnectors_args(const ThriftHiveMetastore_get_dataconnectors_args&) noexcept; + ThriftHiveMetastore_get_dataconnectors_args& operator=(const ThriftHiveMetastore_get_dataconnectors_args&) noexcept; + ThriftHiveMetastore_get_dataconnectors_args() noexcept; + + virtual ~ThriftHiveMetastore_get_dataconnectors_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_dataconnectors_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_dataconnectors_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_dataconnectors_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_dataconnectors_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_dataconnectors_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_dataconnectors_result__isset { + _ThriftHiveMetastore_get_dataconnectors_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_dataconnectors_result__isset; + +class ThriftHiveMetastore_get_dataconnectors_result { + public: + + ThriftHiveMetastore_get_dataconnectors_result(const ThriftHiveMetastore_get_dataconnectors_result&); + ThriftHiveMetastore_get_dataconnectors_result& operator=(const ThriftHiveMetastore_get_dataconnectors_result&); + ThriftHiveMetastore_get_dataconnectors_result() noexcept; + + virtual ~ThriftHiveMetastore_get_dataconnectors_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_dataconnectors_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_dataconnectors_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_dataconnectors_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_dataconnectors_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_dataconnectors_presult__isset { + _ThriftHiveMetastore_get_dataconnectors_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_dataconnectors_presult__isset; + +class ThriftHiveMetastore_get_dataconnectors_presult { + public: + + + virtual ~ThriftHiveMetastore_get_dataconnectors_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_dataconnectors_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_dataconnector_req_args__isset { + _ThriftHiveMetastore_alter_dataconnector_req_args__isset() : alterReq(false) {} + bool alterReq :1; +} _ThriftHiveMetastore_alter_dataconnector_req_args__isset; + +class ThriftHiveMetastore_alter_dataconnector_req_args { + public: + + ThriftHiveMetastore_alter_dataconnector_req_args(const ThriftHiveMetastore_alter_dataconnector_req_args&); + ThriftHiveMetastore_alter_dataconnector_req_args& operator=(const ThriftHiveMetastore_alter_dataconnector_req_args&); + ThriftHiveMetastore_alter_dataconnector_req_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_dataconnector_req_args() noexcept; + AlterDataConnectorRequest alterReq; + + _ThriftHiveMetastore_alter_dataconnector_req_args__isset __isset; + + void __set_alterReq(const AlterDataConnectorRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_dataconnector_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_dataconnector_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_dataconnector_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_dataconnector_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_dataconnector_req_pargs() noexcept; + const AlterDataConnectorRequest* alterReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_dataconnector_req_result__isset { + _ThriftHiveMetastore_alter_dataconnector_req_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_dataconnector_req_result__isset; + +class ThriftHiveMetastore_alter_dataconnector_req_result { + public: + + ThriftHiveMetastore_alter_dataconnector_req_result(const ThriftHiveMetastore_alter_dataconnector_req_result&); + ThriftHiveMetastore_alter_dataconnector_req_result& operator=(const ThriftHiveMetastore_alter_dataconnector_req_result&); + ThriftHiveMetastore_alter_dataconnector_req_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_dataconnector_req_result() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_dataconnector_req_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_alter_dataconnector_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_dataconnector_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_dataconnector_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_dataconnector_req_presult__isset { + _ThriftHiveMetastore_alter_dataconnector_req_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_dataconnector_req_presult__isset; + +class ThriftHiveMetastore_alter_dataconnector_req_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_dataconnector_req_presult() noexcept; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_alter_dataconnector_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_type_args__isset { + _ThriftHiveMetastore_get_type_args__isset() : name(false) {} + bool name :1; +} _ThriftHiveMetastore_get_type_args__isset; + +class ThriftHiveMetastore_get_type_args { + public: + + ThriftHiveMetastore_get_type_args(const ThriftHiveMetastore_get_type_args&); + ThriftHiveMetastore_get_type_args& operator=(const ThriftHiveMetastore_get_type_args&); + ThriftHiveMetastore_get_type_args() noexcept; + + virtual ~ThriftHiveMetastore_get_type_args() noexcept; + std::string name; + + _ThriftHiveMetastore_get_type_args__isset __isset; + + void __set_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_type_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_type_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_type_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_type_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_type_pargs() noexcept; + const std::string* name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_type_result__isset { + _ThriftHiveMetastore_get_type_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_type_result__isset; + +class ThriftHiveMetastore_get_type_result { + public: + + ThriftHiveMetastore_get_type_result(const ThriftHiveMetastore_get_type_result&); + ThriftHiveMetastore_get_type_result& operator=(const ThriftHiveMetastore_get_type_result&); + ThriftHiveMetastore_get_type_result() noexcept; + + virtual ~ThriftHiveMetastore_get_type_result() noexcept; + Type success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_type_result__isset __isset; + + void __set_success(const Type& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_type_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_type_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_type_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_type_presult__isset { + _ThriftHiveMetastore_get_type_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_type_presult__isset; + +class ThriftHiveMetastore_get_type_presult { + public: + + + virtual ~ThriftHiveMetastore_get_type_presult() noexcept; + Type* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_type_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_type_args__isset { + _ThriftHiveMetastore_create_type_args__isset() : type(false) {} + bool type :1; +} _ThriftHiveMetastore_create_type_args__isset; + +class ThriftHiveMetastore_create_type_args { + public: + + ThriftHiveMetastore_create_type_args(const ThriftHiveMetastore_create_type_args&); + ThriftHiveMetastore_create_type_args& operator=(const ThriftHiveMetastore_create_type_args&); + ThriftHiveMetastore_create_type_args() noexcept; + + virtual ~ThriftHiveMetastore_create_type_args() noexcept; + Type type; + + _ThriftHiveMetastore_create_type_args__isset __isset; + + void __set_type(const Type& val); + + bool operator == (const ThriftHiveMetastore_create_type_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_type_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_type_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_type_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_type_pargs() noexcept; + const Type* type; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_type_result__isset { + _ThriftHiveMetastore_create_type_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_type_result__isset; + +class ThriftHiveMetastore_create_type_result { + public: + + ThriftHiveMetastore_create_type_result(const ThriftHiveMetastore_create_type_result&); + ThriftHiveMetastore_create_type_result& operator=(const ThriftHiveMetastore_create_type_result&); + ThriftHiveMetastore_create_type_result() noexcept; + + virtual ~ThriftHiveMetastore_create_type_result() noexcept; + bool success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_type_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_type_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_type_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_type_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_type_presult__isset { + _ThriftHiveMetastore_create_type_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_type_presult__isset; + +class ThriftHiveMetastore_create_type_presult { + public: + + + virtual ~ThriftHiveMetastore_create_type_presult() noexcept; + bool* success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_type_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_type_args__isset { + _ThriftHiveMetastore_drop_type_args__isset() : type(false) {} + bool type :1; +} _ThriftHiveMetastore_drop_type_args__isset; + +class ThriftHiveMetastore_drop_type_args { + public: + + ThriftHiveMetastore_drop_type_args(const ThriftHiveMetastore_drop_type_args&); + ThriftHiveMetastore_drop_type_args& operator=(const ThriftHiveMetastore_drop_type_args&); + ThriftHiveMetastore_drop_type_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_type_args() noexcept; + std::string type; + + _ThriftHiveMetastore_drop_type_args__isset __isset; + + void __set_type(const std::string& val); + + bool operator == (const ThriftHiveMetastore_drop_type_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_type_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_type_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_type_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_type_pargs() noexcept; + const std::string* type; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_type_result__isset { + _ThriftHiveMetastore_drop_type_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_type_result__isset; + +class ThriftHiveMetastore_drop_type_result { + public: + + ThriftHiveMetastore_drop_type_result(const ThriftHiveMetastore_drop_type_result&); + ThriftHiveMetastore_drop_type_result& operator=(const ThriftHiveMetastore_drop_type_result&); + ThriftHiveMetastore_drop_type_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_type_result() noexcept; + bool success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_drop_type_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_drop_type_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_type_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_type_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_type_presult__isset { + _ThriftHiveMetastore_drop_type_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_type_presult__isset; + +class ThriftHiveMetastore_drop_type_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_type_presult() noexcept; + bool* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_drop_type_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_type_all_args__isset { + _ThriftHiveMetastore_get_type_all_args__isset() : name(false) {} + bool name :1; +} _ThriftHiveMetastore_get_type_all_args__isset; + +class ThriftHiveMetastore_get_type_all_args { + public: + + ThriftHiveMetastore_get_type_all_args(const ThriftHiveMetastore_get_type_all_args&); + ThriftHiveMetastore_get_type_all_args& operator=(const ThriftHiveMetastore_get_type_all_args&); + ThriftHiveMetastore_get_type_all_args() noexcept; + + virtual ~ThriftHiveMetastore_get_type_all_args() noexcept; + std::string name; + + _ThriftHiveMetastore_get_type_all_args__isset __isset; + + void __set_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_type_all_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_type_all_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_type_all_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_type_all_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_type_all_pargs() noexcept; + const std::string* name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_type_all_result__isset { + _ThriftHiveMetastore_get_type_all_result__isset() : success(false), o2(false) {} + bool success :1; + bool o2 :1; +} _ThriftHiveMetastore_get_type_all_result__isset; + +class ThriftHiveMetastore_get_type_all_result { + public: + + ThriftHiveMetastore_get_type_all_result(const ThriftHiveMetastore_get_type_all_result&); + ThriftHiveMetastore_get_type_all_result& operator=(const ThriftHiveMetastore_get_type_all_result&); + ThriftHiveMetastore_get_type_all_result() noexcept; + + virtual ~ThriftHiveMetastore_get_type_all_result() noexcept; + std::map success; + MetaException o2; + + _ThriftHiveMetastore_get_type_all_result__isset __isset; + + void __set_success(const std::map & val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_type_all_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_type_all_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_type_all_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_type_all_presult__isset { + _ThriftHiveMetastore_get_type_all_presult__isset() : success(false), o2(false) {} + bool success :1; + bool o2 :1; +} _ThriftHiveMetastore_get_type_all_presult__isset; + +class ThriftHiveMetastore_get_type_all_presult { + public: + + + virtual ~ThriftHiveMetastore_get_type_all_presult() noexcept; + std::map * success; + MetaException o2; + + _ThriftHiveMetastore_get_type_all_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_fields_args__isset { + _ThriftHiveMetastore_get_fields_args__isset() : db_name(false), table_name(false) {} + bool db_name :1; + bool table_name :1; +} _ThriftHiveMetastore_get_fields_args__isset; + +class ThriftHiveMetastore_get_fields_args { + public: + + ThriftHiveMetastore_get_fields_args(const ThriftHiveMetastore_get_fields_args&); + ThriftHiveMetastore_get_fields_args& operator=(const ThriftHiveMetastore_get_fields_args&); + ThriftHiveMetastore_get_fields_args() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_args() noexcept; + std::string db_name; + std::string table_name; + + _ThriftHiveMetastore_get_fields_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_table_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_fields_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_fields_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_fields_pargs() noexcept; + const std::string* db_name; + const std::string* table_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_result__isset { + _ThriftHiveMetastore_get_fields_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_result__isset; + +class ThriftHiveMetastore_get_fields_result { + public: + + ThriftHiveMetastore_get_fields_result(const ThriftHiveMetastore_get_fields_result&); + ThriftHiveMetastore_get_fields_result& operator=(const ThriftHiveMetastore_get_fields_result&); + ThriftHiveMetastore_get_fields_result() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_result() noexcept; + std::vector success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_fields_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_presult__isset { + _ThriftHiveMetastore_get_fields_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_presult__isset; + +class ThriftHiveMetastore_get_fields_presult { + public: + + + virtual ~ThriftHiveMetastore_get_fields_presult() noexcept; + std::vector * success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_fields_with_environment_context_args__isset { + _ThriftHiveMetastore_get_fields_with_environment_context_args__isset() : db_name(false), table_name(false), environment_context(false) {} + bool db_name :1; + bool table_name :1; + bool environment_context :1; +} _ThriftHiveMetastore_get_fields_with_environment_context_args__isset; + +class ThriftHiveMetastore_get_fields_with_environment_context_args { + public: + + ThriftHiveMetastore_get_fields_with_environment_context_args(const ThriftHiveMetastore_get_fields_with_environment_context_args&); + ThriftHiveMetastore_get_fields_with_environment_context_args& operator=(const ThriftHiveMetastore_get_fields_with_environment_context_args&); + ThriftHiveMetastore_get_fields_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_with_environment_context_args() noexcept; + std::string db_name; + std::string table_name; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_get_fields_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_get_fields_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_fields_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_fields_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* table_name; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_with_environment_context_result__isset { + _ThriftHiveMetastore_get_fields_with_environment_context_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_with_environment_context_result__isset; + +class ThriftHiveMetastore_get_fields_with_environment_context_result { + public: + + ThriftHiveMetastore_get_fields_with_environment_context_result(const ThriftHiveMetastore_get_fields_with_environment_context_result&); + ThriftHiveMetastore_get_fields_with_environment_context_result& operator=(const ThriftHiveMetastore_get_fields_with_environment_context_result&); + ThriftHiveMetastore_get_fields_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_with_environment_context_result() noexcept; + std::vector success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_with_environment_context_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_fields_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_with_environment_context_presult__isset { + _ThriftHiveMetastore_get_fields_with_environment_context_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_with_environment_context_presult__isset; + +class ThriftHiveMetastore_get_fields_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_get_fields_with_environment_context_presult() noexcept; + std::vector * success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_fields_req_args__isset { + _ThriftHiveMetastore_get_fields_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_fields_req_args__isset; + +class ThriftHiveMetastore_get_fields_req_args { + public: + + ThriftHiveMetastore_get_fields_req_args(const ThriftHiveMetastore_get_fields_req_args&); + ThriftHiveMetastore_get_fields_req_args& operator=(const ThriftHiveMetastore_get_fields_req_args&); + ThriftHiveMetastore_get_fields_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_req_args() noexcept; + GetFieldsRequest req; + + _ThriftHiveMetastore_get_fields_req_args__isset __isset; + + void __set_req(const GetFieldsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_fields_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_fields_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_fields_req_pargs() noexcept; + const GetFieldsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_req_result__isset { + _ThriftHiveMetastore_get_fields_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_req_result__isset; + +class ThriftHiveMetastore_get_fields_req_result { + public: + + ThriftHiveMetastore_get_fields_req_result(const ThriftHiveMetastore_get_fields_req_result&); + ThriftHiveMetastore_get_fields_req_result& operator=(const ThriftHiveMetastore_get_fields_req_result&); + ThriftHiveMetastore_get_fields_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_fields_req_result() noexcept; + GetFieldsResponse success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_req_result__isset __isset; + + void __set_success(const GetFieldsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_fields_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_fields_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_fields_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_fields_req_presult__isset { + _ThriftHiveMetastore_get_fields_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_fields_req_presult__isset; + +class ThriftHiveMetastore_get_fields_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_fields_req_presult() noexcept; + GetFieldsResponse* success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_fields_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_args__isset { + _ThriftHiveMetastore_get_schema_args__isset() : db_name(false), table_name(false) {} + bool db_name :1; + bool table_name :1; +} _ThriftHiveMetastore_get_schema_args__isset; + +class ThriftHiveMetastore_get_schema_args { + public: + + ThriftHiveMetastore_get_schema_args(const ThriftHiveMetastore_get_schema_args&); + ThriftHiveMetastore_get_schema_args& operator=(const ThriftHiveMetastore_get_schema_args&); + ThriftHiveMetastore_get_schema_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_args() noexcept; + std::string db_name; + std::string table_name; + + _ThriftHiveMetastore_get_schema_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_table_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_schema_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_pargs() noexcept; + const std::string* db_name; + const std::string* table_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_result__isset { + _ThriftHiveMetastore_get_schema_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_result__isset; + +class ThriftHiveMetastore_get_schema_result { + public: + + ThriftHiveMetastore_get_schema_result(const ThriftHiveMetastore_get_schema_result&); + ThriftHiveMetastore_get_schema_result& operator=(const ThriftHiveMetastore_get_schema_result&); + ThriftHiveMetastore_get_schema_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_result() noexcept; + std::vector success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_presult__isset { + _ThriftHiveMetastore_get_schema_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_presult__isset; + +class ThriftHiveMetastore_get_schema_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_presult() noexcept; + std::vector * success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_with_environment_context_args__isset { + _ThriftHiveMetastore_get_schema_with_environment_context_args__isset() : db_name(false), table_name(false), environment_context(false) {} + bool db_name :1; + bool table_name :1; + bool environment_context :1; +} _ThriftHiveMetastore_get_schema_with_environment_context_args__isset; + +class ThriftHiveMetastore_get_schema_with_environment_context_args { + public: + + ThriftHiveMetastore_get_schema_with_environment_context_args(const ThriftHiveMetastore_get_schema_with_environment_context_args&); + ThriftHiveMetastore_get_schema_with_environment_context_args& operator=(const ThriftHiveMetastore_get_schema_with_environment_context_args&); + ThriftHiveMetastore_get_schema_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_with_environment_context_args() noexcept; + std::string db_name; + std::string table_name; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_get_schema_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_get_schema_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* table_name; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_with_environment_context_result__isset { + _ThriftHiveMetastore_get_schema_with_environment_context_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_with_environment_context_result__isset; + +class ThriftHiveMetastore_get_schema_with_environment_context_result { + public: + + ThriftHiveMetastore_get_schema_with_environment_context_result(const ThriftHiveMetastore_get_schema_with_environment_context_result&); + ThriftHiveMetastore_get_schema_with_environment_context_result& operator=(const ThriftHiveMetastore_get_schema_with_environment_context_result&); + ThriftHiveMetastore_get_schema_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_with_environment_context_result() noexcept; + std::vector success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_with_environment_context_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_with_environment_context_presult__isset { + _ThriftHiveMetastore_get_schema_with_environment_context_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_with_environment_context_presult__isset; + +class ThriftHiveMetastore_get_schema_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_with_environment_context_presult() noexcept; + std::vector * success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_req_args__isset { + _ThriftHiveMetastore_get_schema_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_schema_req_args__isset; + +class ThriftHiveMetastore_get_schema_req_args { + public: + + ThriftHiveMetastore_get_schema_req_args(const ThriftHiveMetastore_get_schema_req_args&); + ThriftHiveMetastore_get_schema_req_args& operator=(const ThriftHiveMetastore_get_schema_req_args&); + ThriftHiveMetastore_get_schema_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_req_args() noexcept; + GetSchemaRequest req; + + _ThriftHiveMetastore_get_schema_req_args__isset __isset; + + void __set_req(const GetSchemaRequest& val); + + bool operator == (const ThriftHiveMetastore_get_schema_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_req_pargs() noexcept; + const GetSchemaRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_req_result__isset { + _ThriftHiveMetastore_get_schema_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_req_result__isset; + +class ThriftHiveMetastore_get_schema_req_result { + public: + + ThriftHiveMetastore_get_schema_req_result(const ThriftHiveMetastore_get_schema_req_result&); + ThriftHiveMetastore_get_schema_req_result& operator=(const ThriftHiveMetastore_get_schema_req_result&); + ThriftHiveMetastore_get_schema_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_req_result() noexcept; + GetSchemaResponse success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_req_result__isset __isset; + + void __set_success(const GetSchemaResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const UnknownTableException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_req_presult__isset { + _ThriftHiveMetastore_get_schema_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_schema_req_presult__isset; + +class ThriftHiveMetastore_get_schema_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_req_presult() noexcept; + GetSchemaResponse* success; + MetaException o1; + UnknownTableException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_schema_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_table_args__isset { + _ThriftHiveMetastore_create_table_args__isset() : tbl(false) {} + bool tbl :1; +} _ThriftHiveMetastore_create_table_args__isset; + +class ThriftHiveMetastore_create_table_args { + public: + + ThriftHiveMetastore_create_table_args(const ThriftHiveMetastore_create_table_args&); + ThriftHiveMetastore_create_table_args& operator=(const ThriftHiveMetastore_create_table_args&); + ThriftHiveMetastore_create_table_args() noexcept; + + virtual ~ThriftHiveMetastore_create_table_args() noexcept; + Table tbl; + + _ThriftHiveMetastore_create_table_args__isset __isset; + + void __set_tbl(const Table& val); + + bool operator == (const ThriftHiveMetastore_create_table_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_table_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_table_pargs() noexcept; + const Table* tbl; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_result__isset { + _ThriftHiveMetastore_create_table_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_result__isset; + +class ThriftHiveMetastore_create_table_result { + public: + + ThriftHiveMetastore_create_table_result(const ThriftHiveMetastore_create_table_result&); + ThriftHiveMetastore_create_table_result& operator=(const ThriftHiveMetastore_create_table_result&); + ThriftHiveMetastore_create_table_result() noexcept; + + virtual ~ThriftHiveMetastore_create_table_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_create_table_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_presult__isset { + _ThriftHiveMetastore_create_table_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_presult__isset; + +class ThriftHiveMetastore_create_table_presult { + public: + + + virtual ~ThriftHiveMetastore_create_table_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_environment_context_args__isset { + _ThriftHiveMetastore_create_table_with_environment_context_args__isset() : tbl(false), environment_context(false) {} + bool tbl :1; + bool environment_context :1; +} _ThriftHiveMetastore_create_table_with_environment_context_args__isset; + +class ThriftHiveMetastore_create_table_with_environment_context_args { + public: + + ThriftHiveMetastore_create_table_with_environment_context_args(const ThriftHiveMetastore_create_table_with_environment_context_args&); + ThriftHiveMetastore_create_table_with_environment_context_args& operator=(const ThriftHiveMetastore_create_table_with_environment_context_args&); + ThriftHiveMetastore_create_table_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_create_table_with_environment_context_args() noexcept; + Table tbl; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_create_table_with_environment_context_args__isset __isset; + + void __set_tbl(const Table& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_create_table_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_table_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_table_with_environment_context_pargs() noexcept; + const Table* tbl; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_environment_context_result__isset { + _ThriftHiveMetastore_create_table_with_environment_context_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_with_environment_context_result__isset; + +class ThriftHiveMetastore_create_table_with_environment_context_result { + public: + + ThriftHiveMetastore_create_table_with_environment_context_result(const ThriftHiveMetastore_create_table_with_environment_context_result&); + ThriftHiveMetastore_create_table_with_environment_context_result& operator=(const ThriftHiveMetastore_create_table_with_environment_context_result&); + ThriftHiveMetastore_create_table_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_create_table_with_environment_context_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_with_environment_context_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_create_table_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_environment_context_presult__isset { + _ThriftHiveMetastore_create_table_with_environment_context_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_with_environment_context_presult__isset; + +class ThriftHiveMetastore_create_table_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_create_table_with_environment_context_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_constraints_args__isset { + _ThriftHiveMetastore_create_table_with_constraints_args__isset() : tbl(false), primaryKeys(false), foreignKeys(false), uniqueConstraints(false), notNullConstraints(false), defaultConstraints(false), checkConstraints(false) {} + bool tbl :1; + bool primaryKeys :1; + bool foreignKeys :1; + bool uniqueConstraints :1; + bool notNullConstraints :1; + bool defaultConstraints :1; + bool checkConstraints :1; +} _ThriftHiveMetastore_create_table_with_constraints_args__isset; + +class ThriftHiveMetastore_create_table_with_constraints_args { + public: + + ThriftHiveMetastore_create_table_with_constraints_args(const ThriftHiveMetastore_create_table_with_constraints_args&); + ThriftHiveMetastore_create_table_with_constraints_args& operator=(const ThriftHiveMetastore_create_table_with_constraints_args&); + ThriftHiveMetastore_create_table_with_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_create_table_with_constraints_args() noexcept; + Table tbl; + std::vector primaryKeys; + std::vector foreignKeys; + std::vector uniqueConstraints; + std::vector notNullConstraints; + std::vector defaultConstraints; + std::vector checkConstraints; + + _ThriftHiveMetastore_create_table_with_constraints_args__isset __isset; + + void __set_tbl(const Table& val); + + void __set_primaryKeys(const std::vector & val); + + void __set_foreignKeys(const std::vector & val); + + void __set_uniqueConstraints(const std::vector & val); + + void __set_notNullConstraints(const std::vector & val); + + void __set_defaultConstraints(const std::vector & val); + + void __set_checkConstraints(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_create_table_with_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_with_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_with_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_table_with_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_table_with_constraints_pargs() noexcept; + const Table* tbl; + const std::vector * primaryKeys; + const std::vector * foreignKeys; + const std::vector * uniqueConstraints; + const std::vector * notNullConstraints; + const std::vector * defaultConstraints; + const std::vector * checkConstraints; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_constraints_result__isset { + _ThriftHiveMetastore_create_table_with_constraints_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_with_constraints_result__isset; + +class ThriftHiveMetastore_create_table_with_constraints_result { + public: + + ThriftHiveMetastore_create_table_with_constraints_result(const ThriftHiveMetastore_create_table_with_constraints_result&); + ThriftHiveMetastore_create_table_with_constraints_result& operator=(const ThriftHiveMetastore_create_table_with_constraints_result&); + ThriftHiveMetastore_create_table_with_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_create_table_with_constraints_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_with_constraints_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_create_table_with_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_with_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_with_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_with_constraints_presult__isset { + _ThriftHiveMetastore_create_table_with_constraints_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_with_constraints_presult__isset; + +class ThriftHiveMetastore_create_table_with_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_create_table_with_constraints_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_with_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_table_req_args__isset { + _ThriftHiveMetastore_create_table_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_table_req_args__isset; + +class ThriftHiveMetastore_create_table_req_args { + public: + + ThriftHiveMetastore_create_table_req_args(const ThriftHiveMetastore_create_table_req_args&); + ThriftHiveMetastore_create_table_req_args& operator=(const ThriftHiveMetastore_create_table_req_args&); + ThriftHiveMetastore_create_table_req_args() noexcept; + + virtual ~ThriftHiveMetastore_create_table_req_args() noexcept; + CreateTableRequest request; + + _ThriftHiveMetastore_create_table_req_args__isset __isset; + + void __set_request(const CreateTableRequest& val); + + bool operator == (const ThriftHiveMetastore_create_table_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_table_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_table_req_pargs() noexcept; + const CreateTableRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_req_result__isset { + _ThriftHiveMetastore_create_table_req_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_req_result__isset; + +class ThriftHiveMetastore_create_table_req_result { + public: + + ThriftHiveMetastore_create_table_req_result(const ThriftHiveMetastore_create_table_req_result&); + ThriftHiveMetastore_create_table_req_result& operator=(const ThriftHiveMetastore_create_table_req_result&); + ThriftHiveMetastore_create_table_req_result() noexcept; + + virtual ~ThriftHiveMetastore_create_table_req_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_req_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_create_table_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_table_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_table_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_table_req_presult__isset { + _ThriftHiveMetastore_create_table_req_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_table_req_presult__isset; + +class ThriftHiveMetastore_create_table_req_presult { + public: + + + virtual ~ThriftHiveMetastore_create_table_req_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_table_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_constraint_args__isset { + _ThriftHiveMetastore_drop_constraint_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_drop_constraint_args__isset; + +class ThriftHiveMetastore_drop_constraint_args { + public: + + ThriftHiveMetastore_drop_constraint_args(const ThriftHiveMetastore_drop_constraint_args&); + ThriftHiveMetastore_drop_constraint_args& operator=(const ThriftHiveMetastore_drop_constraint_args&); + ThriftHiveMetastore_drop_constraint_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_constraint_args() noexcept; + DropConstraintRequest req; + + _ThriftHiveMetastore_drop_constraint_args__isset __isset; + + void __set_req(const DropConstraintRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_constraint_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_constraint_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_constraint_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_constraint_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_constraint_pargs() noexcept; + const DropConstraintRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_constraint_result__isset { + _ThriftHiveMetastore_drop_constraint_result__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_constraint_result__isset; + +class ThriftHiveMetastore_drop_constraint_result { + public: + + ThriftHiveMetastore_drop_constraint_result(const ThriftHiveMetastore_drop_constraint_result&); + ThriftHiveMetastore_drop_constraint_result& operator=(const ThriftHiveMetastore_drop_constraint_result&); + ThriftHiveMetastore_drop_constraint_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_constraint_result() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_constraint_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_constraint_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_constraint_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_constraint_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_constraint_presult__isset { + _ThriftHiveMetastore_drop_constraint_presult__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_constraint_presult__isset; + +class ThriftHiveMetastore_drop_constraint_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_constraint_presult() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_constraint_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_primary_key_args__isset { + _ThriftHiveMetastore_add_primary_key_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_primary_key_args__isset; + +class ThriftHiveMetastore_add_primary_key_args { + public: + + ThriftHiveMetastore_add_primary_key_args(const ThriftHiveMetastore_add_primary_key_args&); + ThriftHiveMetastore_add_primary_key_args& operator=(const ThriftHiveMetastore_add_primary_key_args&); + ThriftHiveMetastore_add_primary_key_args() noexcept; + + virtual ~ThriftHiveMetastore_add_primary_key_args() noexcept; + AddPrimaryKeyRequest req; + + _ThriftHiveMetastore_add_primary_key_args__isset __isset; + + void __set_req(const AddPrimaryKeyRequest& val); + + bool operator == (const ThriftHiveMetastore_add_primary_key_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_primary_key_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_primary_key_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_primary_key_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_primary_key_pargs() noexcept; + const AddPrimaryKeyRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_primary_key_result__isset { + _ThriftHiveMetastore_add_primary_key_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_primary_key_result__isset; + +class ThriftHiveMetastore_add_primary_key_result { + public: + + ThriftHiveMetastore_add_primary_key_result(const ThriftHiveMetastore_add_primary_key_result&); + ThriftHiveMetastore_add_primary_key_result& operator=(const ThriftHiveMetastore_add_primary_key_result&); + ThriftHiveMetastore_add_primary_key_result() noexcept; + + virtual ~ThriftHiveMetastore_add_primary_key_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_primary_key_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_primary_key_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_primary_key_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_primary_key_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_primary_key_presult__isset { + _ThriftHiveMetastore_add_primary_key_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_primary_key_presult__isset; + +class ThriftHiveMetastore_add_primary_key_presult { + public: + + + virtual ~ThriftHiveMetastore_add_primary_key_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_primary_key_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_foreign_key_args__isset { + _ThriftHiveMetastore_add_foreign_key_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_foreign_key_args__isset; + +class ThriftHiveMetastore_add_foreign_key_args { + public: + + ThriftHiveMetastore_add_foreign_key_args(const ThriftHiveMetastore_add_foreign_key_args&); + ThriftHiveMetastore_add_foreign_key_args& operator=(const ThriftHiveMetastore_add_foreign_key_args&); + ThriftHiveMetastore_add_foreign_key_args() noexcept; + + virtual ~ThriftHiveMetastore_add_foreign_key_args() noexcept; + AddForeignKeyRequest req; + + _ThriftHiveMetastore_add_foreign_key_args__isset __isset; + + void __set_req(const AddForeignKeyRequest& val); + + bool operator == (const ThriftHiveMetastore_add_foreign_key_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_foreign_key_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_foreign_key_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_foreign_key_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_foreign_key_pargs() noexcept; + const AddForeignKeyRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_foreign_key_result__isset { + _ThriftHiveMetastore_add_foreign_key_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_foreign_key_result__isset; + +class ThriftHiveMetastore_add_foreign_key_result { + public: + + ThriftHiveMetastore_add_foreign_key_result(const ThriftHiveMetastore_add_foreign_key_result&); + ThriftHiveMetastore_add_foreign_key_result& operator=(const ThriftHiveMetastore_add_foreign_key_result&); + ThriftHiveMetastore_add_foreign_key_result() noexcept; + + virtual ~ThriftHiveMetastore_add_foreign_key_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_foreign_key_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_foreign_key_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_foreign_key_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_foreign_key_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_foreign_key_presult__isset { + _ThriftHiveMetastore_add_foreign_key_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_foreign_key_presult__isset; + +class ThriftHiveMetastore_add_foreign_key_presult { + public: + + + virtual ~ThriftHiveMetastore_add_foreign_key_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_foreign_key_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_unique_constraint_args__isset { + _ThriftHiveMetastore_add_unique_constraint_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_unique_constraint_args__isset; + +class ThriftHiveMetastore_add_unique_constraint_args { + public: + + ThriftHiveMetastore_add_unique_constraint_args(const ThriftHiveMetastore_add_unique_constraint_args&); + ThriftHiveMetastore_add_unique_constraint_args& operator=(const ThriftHiveMetastore_add_unique_constraint_args&); + ThriftHiveMetastore_add_unique_constraint_args() noexcept; + + virtual ~ThriftHiveMetastore_add_unique_constraint_args() noexcept; + AddUniqueConstraintRequest req; + + _ThriftHiveMetastore_add_unique_constraint_args__isset __isset; + + void __set_req(const AddUniqueConstraintRequest& val); + + bool operator == (const ThriftHiveMetastore_add_unique_constraint_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_unique_constraint_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_unique_constraint_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_unique_constraint_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_unique_constraint_pargs() noexcept; + const AddUniqueConstraintRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_unique_constraint_result__isset { + _ThriftHiveMetastore_add_unique_constraint_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_unique_constraint_result__isset; + +class ThriftHiveMetastore_add_unique_constraint_result { + public: + + ThriftHiveMetastore_add_unique_constraint_result(const ThriftHiveMetastore_add_unique_constraint_result&); + ThriftHiveMetastore_add_unique_constraint_result& operator=(const ThriftHiveMetastore_add_unique_constraint_result&); + ThriftHiveMetastore_add_unique_constraint_result() noexcept; + + virtual ~ThriftHiveMetastore_add_unique_constraint_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_unique_constraint_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_unique_constraint_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_unique_constraint_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_unique_constraint_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_unique_constraint_presult__isset { + _ThriftHiveMetastore_add_unique_constraint_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_unique_constraint_presult__isset; + +class ThriftHiveMetastore_add_unique_constraint_presult { + public: + + + virtual ~ThriftHiveMetastore_add_unique_constraint_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_unique_constraint_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_not_null_constraint_args__isset { + _ThriftHiveMetastore_add_not_null_constraint_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_not_null_constraint_args__isset; + +class ThriftHiveMetastore_add_not_null_constraint_args { + public: + + ThriftHiveMetastore_add_not_null_constraint_args(const ThriftHiveMetastore_add_not_null_constraint_args&); + ThriftHiveMetastore_add_not_null_constraint_args& operator=(const ThriftHiveMetastore_add_not_null_constraint_args&); + ThriftHiveMetastore_add_not_null_constraint_args() noexcept; + + virtual ~ThriftHiveMetastore_add_not_null_constraint_args() noexcept; + AddNotNullConstraintRequest req; + + _ThriftHiveMetastore_add_not_null_constraint_args__isset __isset; + + void __set_req(const AddNotNullConstraintRequest& val); + + bool operator == (const ThriftHiveMetastore_add_not_null_constraint_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_not_null_constraint_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_not_null_constraint_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_not_null_constraint_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_not_null_constraint_pargs() noexcept; + const AddNotNullConstraintRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_not_null_constraint_result__isset { + _ThriftHiveMetastore_add_not_null_constraint_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_not_null_constraint_result__isset; + +class ThriftHiveMetastore_add_not_null_constraint_result { + public: + + ThriftHiveMetastore_add_not_null_constraint_result(const ThriftHiveMetastore_add_not_null_constraint_result&); + ThriftHiveMetastore_add_not_null_constraint_result& operator=(const ThriftHiveMetastore_add_not_null_constraint_result&); + ThriftHiveMetastore_add_not_null_constraint_result() noexcept; + + virtual ~ThriftHiveMetastore_add_not_null_constraint_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_not_null_constraint_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_not_null_constraint_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_not_null_constraint_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_not_null_constraint_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_not_null_constraint_presult__isset { + _ThriftHiveMetastore_add_not_null_constraint_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_not_null_constraint_presult__isset; + +class ThriftHiveMetastore_add_not_null_constraint_presult { + public: + + + virtual ~ThriftHiveMetastore_add_not_null_constraint_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_not_null_constraint_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_default_constraint_args__isset { + _ThriftHiveMetastore_add_default_constraint_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_default_constraint_args__isset; + +class ThriftHiveMetastore_add_default_constraint_args { + public: + + ThriftHiveMetastore_add_default_constraint_args(const ThriftHiveMetastore_add_default_constraint_args&); + ThriftHiveMetastore_add_default_constraint_args& operator=(const ThriftHiveMetastore_add_default_constraint_args&); + ThriftHiveMetastore_add_default_constraint_args() noexcept; + + virtual ~ThriftHiveMetastore_add_default_constraint_args() noexcept; + AddDefaultConstraintRequest req; + + _ThriftHiveMetastore_add_default_constraint_args__isset __isset; + + void __set_req(const AddDefaultConstraintRequest& val); + + bool operator == (const ThriftHiveMetastore_add_default_constraint_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_default_constraint_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_default_constraint_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_default_constraint_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_default_constraint_pargs() noexcept; + const AddDefaultConstraintRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_default_constraint_result__isset { + _ThriftHiveMetastore_add_default_constraint_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_default_constraint_result__isset; + +class ThriftHiveMetastore_add_default_constraint_result { + public: + + ThriftHiveMetastore_add_default_constraint_result(const ThriftHiveMetastore_add_default_constraint_result&); + ThriftHiveMetastore_add_default_constraint_result& operator=(const ThriftHiveMetastore_add_default_constraint_result&); + ThriftHiveMetastore_add_default_constraint_result() noexcept; + + virtual ~ThriftHiveMetastore_add_default_constraint_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_default_constraint_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_default_constraint_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_default_constraint_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_default_constraint_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_default_constraint_presult__isset { + _ThriftHiveMetastore_add_default_constraint_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_default_constraint_presult__isset; + +class ThriftHiveMetastore_add_default_constraint_presult { + public: + + + virtual ~ThriftHiveMetastore_add_default_constraint_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_default_constraint_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_check_constraint_args__isset { + _ThriftHiveMetastore_add_check_constraint_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_add_check_constraint_args__isset; + +class ThriftHiveMetastore_add_check_constraint_args { + public: + + ThriftHiveMetastore_add_check_constraint_args(const ThriftHiveMetastore_add_check_constraint_args&); + ThriftHiveMetastore_add_check_constraint_args& operator=(const ThriftHiveMetastore_add_check_constraint_args&); + ThriftHiveMetastore_add_check_constraint_args() noexcept; + + virtual ~ThriftHiveMetastore_add_check_constraint_args() noexcept; + AddCheckConstraintRequest req; + + _ThriftHiveMetastore_add_check_constraint_args__isset __isset; + + void __set_req(const AddCheckConstraintRequest& val); + + bool operator == (const ThriftHiveMetastore_add_check_constraint_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_check_constraint_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_check_constraint_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_check_constraint_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_check_constraint_pargs() noexcept; + const AddCheckConstraintRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_check_constraint_result__isset { + _ThriftHiveMetastore_add_check_constraint_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_check_constraint_result__isset; + +class ThriftHiveMetastore_add_check_constraint_result { + public: + + ThriftHiveMetastore_add_check_constraint_result(const ThriftHiveMetastore_add_check_constraint_result&); + ThriftHiveMetastore_add_check_constraint_result& operator=(const ThriftHiveMetastore_add_check_constraint_result&); + ThriftHiveMetastore_add_check_constraint_result() noexcept; + + virtual ~ThriftHiveMetastore_add_check_constraint_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_check_constraint_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_check_constraint_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_check_constraint_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_check_constraint_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_check_constraint_presult__isset { + _ThriftHiveMetastore_add_check_constraint_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_check_constraint_presult__isset; + +class ThriftHiveMetastore_add_check_constraint_presult { + public: + + + virtual ~ThriftHiveMetastore_add_check_constraint_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_add_check_constraint_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_translate_table_dryrun_args__isset { + _ThriftHiveMetastore_translate_table_dryrun_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_translate_table_dryrun_args__isset; + +class ThriftHiveMetastore_translate_table_dryrun_args { + public: + + ThriftHiveMetastore_translate_table_dryrun_args(const ThriftHiveMetastore_translate_table_dryrun_args&); + ThriftHiveMetastore_translate_table_dryrun_args& operator=(const ThriftHiveMetastore_translate_table_dryrun_args&); + ThriftHiveMetastore_translate_table_dryrun_args() noexcept; + + virtual ~ThriftHiveMetastore_translate_table_dryrun_args() noexcept; + CreateTableRequest request; + + _ThriftHiveMetastore_translate_table_dryrun_args__isset __isset; + + void __set_request(const CreateTableRequest& val); + + bool operator == (const ThriftHiveMetastore_translate_table_dryrun_args & rhs) const; + bool operator != (const ThriftHiveMetastore_translate_table_dryrun_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_translate_table_dryrun_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_translate_table_dryrun_pargs { + public: + + + virtual ~ThriftHiveMetastore_translate_table_dryrun_pargs() noexcept; + const CreateTableRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_translate_table_dryrun_result__isset { + _ThriftHiveMetastore_translate_table_dryrun_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_translate_table_dryrun_result__isset; + +class ThriftHiveMetastore_translate_table_dryrun_result { + public: + + ThriftHiveMetastore_translate_table_dryrun_result(const ThriftHiveMetastore_translate_table_dryrun_result&); + ThriftHiveMetastore_translate_table_dryrun_result& operator=(const ThriftHiveMetastore_translate_table_dryrun_result&); + ThriftHiveMetastore_translate_table_dryrun_result() noexcept; + + virtual ~ThriftHiveMetastore_translate_table_dryrun_result() noexcept; + Table success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_translate_table_dryrun_result__isset __isset; + + void __set_success(const Table& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_translate_table_dryrun_result & rhs) const; + bool operator != (const ThriftHiveMetastore_translate_table_dryrun_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_translate_table_dryrun_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_translate_table_dryrun_presult__isset { + _ThriftHiveMetastore_translate_table_dryrun_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_translate_table_dryrun_presult__isset; + +class ThriftHiveMetastore_translate_table_dryrun_presult { + public: + + + virtual ~ThriftHiveMetastore_translate_table_dryrun_presult() noexcept; + Table* success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_translate_table_dryrun_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_table_args__isset { + _ThriftHiveMetastore_drop_table_args__isset() : dbname(false), name(false), deleteData(false) {} + bool dbname :1; + bool name :1; + bool deleteData :1; +} _ThriftHiveMetastore_drop_table_args__isset; + +class ThriftHiveMetastore_drop_table_args { + public: + + ThriftHiveMetastore_drop_table_args(const ThriftHiveMetastore_drop_table_args&); + ThriftHiveMetastore_drop_table_args& operator=(const ThriftHiveMetastore_drop_table_args&); + ThriftHiveMetastore_drop_table_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_args() noexcept; + std::string dbname; + std::string name; + bool deleteData; + + _ThriftHiveMetastore_drop_table_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_name(const std::string& val); + + void __set_deleteData(const bool val); + + bool operator == (const ThriftHiveMetastore_drop_table_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_table_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_table_pargs() noexcept; + const std::string* dbname; + const std::string* name; + const bool* deleteData; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_result__isset { + _ThriftHiveMetastore_drop_table_result__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_result__isset; + +class ThriftHiveMetastore_drop_table_result { + public: + + ThriftHiveMetastore_drop_table_result(const ThriftHiveMetastore_drop_table_result&); + ThriftHiveMetastore_drop_table_result& operator=(const ThriftHiveMetastore_drop_table_result&); + ThriftHiveMetastore_drop_table_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_result() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_table_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_presult__isset { + _ThriftHiveMetastore_drop_table_presult__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_presult__isset; + +class ThriftHiveMetastore_drop_table_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_table_presult() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_table_with_environment_context_args__isset { + _ThriftHiveMetastore_drop_table_with_environment_context_args__isset() : dbname(false), name(false), deleteData(false), environment_context(false) {} + bool dbname :1; + bool name :1; + bool deleteData :1; + bool environment_context :1; +} _ThriftHiveMetastore_drop_table_with_environment_context_args__isset; + +class ThriftHiveMetastore_drop_table_with_environment_context_args { + public: + + ThriftHiveMetastore_drop_table_with_environment_context_args(const ThriftHiveMetastore_drop_table_with_environment_context_args&); + ThriftHiveMetastore_drop_table_with_environment_context_args& operator=(const ThriftHiveMetastore_drop_table_with_environment_context_args&); + ThriftHiveMetastore_drop_table_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_with_environment_context_args() noexcept; + std::string dbname; + std::string name; + bool deleteData; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_drop_table_with_environment_context_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_name(const std::string& val); + + void __set_deleteData(const bool val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_drop_table_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_table_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_table_with_environment_context_pargs() noexcept; + const std::string* dbname; + const std::string* name; + const bool* deleteData; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_with_environment_context_result__isset { + _ThriftHiveMetastore_drop_table_with_environment_context_result__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_with_environment_context_result__isset; + +class ThriftHiveMetastore_drop_table_with_environment_context_result { + public: + + ThriftHiveMetastore_drop_table_with_environment_context_result(const ThriftHiveMetastore_drop_table_with_environment_context_result&); + ThriftHiveMetastore_drop_table_with_environment_context_result& operator=(const ThriftHiveMetastore_drop_table_with_environment_context_result&); + ThriftHiveMetastore_drop_table_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_with_environment_context_result() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_with_environment_context_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_table_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_with_environment_context_presult__isset { + _ThriftHiveMetastore_drop_table_with_environment_context_presult__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_with_environment_context_presult__isset; + +class ThriftHiveMetastore_drop_table_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_table_with_environment_context_presult() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_table_req_args__isset { + _ThriftHiveMetastore_drop_table_req_args__isset() : dropTableReq(false) {} + bool dropTableReq :1; +} _ThriftHiveMetastore_drop_table_req_args__isset; + +class ThriftHiveMetastore_drop_table_req_args { + public: + + ThriftHiveMetastore_drop_table_req_args(const ThriftHiveMetastore_drop_table_req_args&); + ThriftHiveMetastore_drop_table_req_args& operator=(const ThriftHiveMetastore_drop_table_req_args&); + ThriftHiveMetastore_drop_table_req_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_req_args() noexcept; + DropTableRequest dropTableReq; + + _ThriftHiveMetastore_drop_table_req_args__isset __isset; + + void __set_dropTableReq(const DropTableRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_table_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_table_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_table_req_pargs() noexcept; + const DropTableRequest* dropTableReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_req_result__isset { + _ThriftHiveMetastore_drop_table_req_result__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_req_result__isset; + +class ThriftHiveMetastore_drop_table_req_result { + public: + + ThriftHiveMetastore_drop_table_req_result(const ThriftHiveMetastore_drop_table_req_result&); + ThriftHiveMetastore_drop_table_req_result& operator=(const ThriftHiveMetastore_drop_table_req_result&); + ThriftHiveMetastore_drop_table_req_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_table_req_result() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_req_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_table_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_table_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_table_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_table_req_presult__isset { + _ThriftHiveMetastore_drop_table_req_presult__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_table_req_presult__isset; + +class ThriftHiveMetastore_drop_table_req_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_table_req_presult() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_table_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_args__isset { + _ThriftHiveMetastore_truncate_table_args__isset() : dbName(false), tableName(false), partNames(false) {} + bool dbName :1; + bool tableName :1; + bool partNames :1; +} _ThriftHiveMetastore_truncate_table_args__isset; + +class ThriftHiveMetastore_truncate_table_args { + public: + + ThriftHiveMetastore_truncate_table_args(const ThriftHiveMetastore_truncate_table_args&); + ThriftHiveMetastore_truncate_table_args& operator=(const ThriftHiveMetastore_truncate_table_args&); + ThriftHiveMetastore_truncate_table_args() noexcept; + + virtual ~ThriftHiveMetastore_truncate_table_args() noexcept; + std::string dbName; + std::string tableName; + std::vector partNames; + + _ThriftHiveMetastore_truncate_table_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partNames(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_truncate_table_args & rhs) const; + bool operator != (const ThriftHiveMetastore_truncate_table_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_truncate_table_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_truncate_table_pargs { + public: + + + virtual ~ThriftHiveMetastore_truncate_table_pargs() noexcept; + const std::string* dbName; + const std::string* tableName; + const std::vector * partNames; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_result__isset { + _ThriftHiveMetastore_truncate_table_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_truncate_table_result__isset; + +class ThriftHiveMetastore_truncate_table_result { + public: + + ThriftHiveMetastore_truncate_table_result(const ThriftHiveMetastore_truncate_table_result&); + ThriftHiveMetastore_truncate_table_result& operator=(const ThriftHiveMetastore_truncate_table_result&); + ThriftHiveMetastore_truncate_table_result() noexcept; + + virtual ~ThriftHiveMetastore_truncate_table_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_truncate_table_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_truncate_table_result & rhs) const; + bool operator != (const ThriftHiveMetastore_truncate_table_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_truncate_table_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_presult__isset { + _ThriftHiveMetastore_truncate_table_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_truncate_table_presult__isset; + +class ThriftHiveMetastore_truncate_table_presult { + public: + + + virtual ~ThriftHiveMetastore_truncate_table_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_truncate_table_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_req_args__isset { + _ThriftHiveMetastore_truncate_table_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_truncate_table_req_args__isset; + +class ThriftHiveMetastore_truncate_table_req_args { + public: + + ThriftHiveMetastore_truncate_table_req_args(const ThriftHiveMetastore_truncate_table_req_args&); + ThriftHiveMetastore_truncate_table_req_args& operator=(const ThriftHiveMetastore_truncate_table_req_args&); + ThriftHiveMetastore_truncate_table_req_args() noexcept; + + virtual ~ThriftHiveMetastore_truncate_table_req_args() noexcept; + TruncateTableRequest req; + + _ThriftHiveMetastore_truncate_table_req_args__isset __isset; + + void __set_req(const TruncateTableRequest& val); + + bool operator == (const ThriftHiveMetastore_truncate_table_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_truncate_table_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_truncate_table_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_truncate_table_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_truncate_table_req_pargs() noexcept; + const TruncateTableRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_req_result__isset { + _ThriftHiveMetastore_truncate_table_req_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_truncate_table_req_result__isset; + +class ThriftHiveMetastore_truncate_table_req_result { + public: + + ThriftHiveMetastore_truncate_table_req_result(const ThriftHiveMetastore_truncate_table_req_result&); + ThriftHiveMetastore_truncate_table_req_result& operator=(const ThriftHiveMetastore_truncate_table_req_result&); + ThriftHiveMetastore_truncate_table_req_result() noexcept; + + virtual ~ThriftHiveMetastore_truncate_table_req_result() noexcept; + TruncateTableResponse success; + MetaException o1; + + _ThriftHiveMetastore_truncate_table_req_result__isset __isset; + + void __set_success(const TruncateTableResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_truncate_table_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_truncate_table_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_truncate_table_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_truncate_table_req_presult__isset { + _ThriftHiveMetastore_truncate_table_req_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_truncate_table_req_presult__isset; + +class ThriftHiveMetastore_truncate_table_req_presult { + public: + + + virtual ~ThriftHiveMetastore_truncate_table_req_presult() noexcept; + TruncateTableResponse* success; + MetaException o1; + + _ThriftHiveMetastore_truncate_table_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_tables_args__isset { + _ThriftHiveMetastore_get_tables_args__isset() : db_name(false), pattern(false) {} + bool db_name :1; + bool pattern :1; +} _ThriftHiveMetastore_get_tables_args__isset; + +class ThriftHiveMetastore_get_tables_args { + public: + + ThriftHiveMetastore_get_tables_args(const ThriftHiveMetastore_get_tables_args&); + ThriftHiveMetastore_get_tables_args& operator=(const ThriftHiveMetastore_get_tables_args&); + ThriftHiveMetastore_get_tables_args() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_args() noexcept; + std::string db_name; + std::string pattern; + + _ThriftHiveMetastore_get_tables_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_pattern(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_tables_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_tables_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_tables_pargs() noexcept; + const std::string* db_name; + const std::string* pattern; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_result__isset { + _ThriftHiveMetastore_get_tables_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_result__isset; + +class ThriftHiveMetastore_get_tables_result { + public: + + ThriftHiveMetastore_get_tables_result(const ThriftHiveMetastore_get_tables_result&); + ThriftHiveMetastore_get_tables_result& operator=(const ThriftHiveMetastore_get_tables_result&); + ThriftHiveMetastore_get_tables_result() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_tables_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_presult__isset { + _ThriftHiveMetastore_get_tables_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_presult__isset; + +class ThriftHiveMetastore_get_tables_presult { + public: + + + virtual ~ThriftHiveMetastore_get_tables_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_tables_by_type_args__isset { + _ThriftHiveMetastore_get_tables_by_type_args__isset() : db_name(false), pattern(false), tableType(false) {} + bool db_name :1; + bool pattern :1; + bool tableType :1; +} _ThriftHiveMetastore_get_tables_by_type_args__isset; + +class ThriftHiveMetastore_get_tables_by_type_args { + public: + + ThriftHiveMetastore_get_tables_by_type_args(const ThriftHiveMetastore_get_tables_by_type_args&); + ThriftHiveMetastore_get_tables_by_type_args& operator=(const ThriftHiveMetastore_get_tables_by_type_args&); + ThriftHiveMetastore_get_tables_by_type_args() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_by_type_args() noexcept; + std::string db_name; + std::string pattern; + std::string tableType; + + _ThriftHiveMetastore_get_tables_by_type_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_pattern(const std::string& val); + + void __set_tableType(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_tables_by_type_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_by_type_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_by_type_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_tables_by_type_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_tables_by_type_pargs() noexcept; + const std::string* db_name; + const std::string* pattern; + const std::string* tableType; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_by_type_result__isset { + _ThriftHiveMetastore_get_tables_by_type_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_by_type_result__isset; + +class ThriftHiveMetastore_get_tables_by_type_result { + public: + + ThriftHiveMetastore_get_tables_by_type_result(const ThriftHiveMetastore_get_tables_by_type_result&); + ThriftHiveMetastore_get_tables_by_type_result& operator=(const ThriftHiveMetastore_get_tables_by_type_result&); + ThriftHiveMetastore_get_tables_by_type_result() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_by_type_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_by_type_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_tables_by_type_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_by_type_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_by_type_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_by_type_presult__isset { + _ThriftHiveMetastore_get_tables_by_type_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_by_type_presult__isset; + +class ThriftHiveMetastore_get_tables_by_type_presult { + public: + + + virtual ~ThriftHiveMetastore_get_tables_by_type_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_by_type_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args { + public: + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args(const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args&) noexcept; + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args& operator=(const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args&) noexcept; + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result__isset { + _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result__isset; + +class ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result { + public: + + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result(const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result&); + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result& operator=(const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result&); + ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result() noexcept; + std::vector
success; + MetaException o1; + + _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result__isset __isset; + + void __set_success(const std::vector
& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult__isset { + _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult__isset; + +class ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult() noexcept; + std::vector
* success; + MetaException o1; + + _ThriftHiveMetastore_get_all_materialized_view_objects_for_rewriting_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_materialized_views_for_rewriting_args__isset { + _ThriftHiveMetastore_get_materialized_views_for_rewriting_args__isset() : db_name(false) {} + bool db_name :1; +} _ThriftHiveMetastore_get_materialized_views_for_rewriting_args__isset; + +class ThriftHiveMetastore_get_materialized_views_for_rewriting_args { + public: + + ThriftHiveMetastore_get_materialized_views_for_rewriting_args(const ThriftHiveMetastore_get_materialized_views_for_rewriting_args&); + ThriftHiveMetastore_get_materialized_views_for_rewriting_args& operator=(const ThriftHiveMetastore_get_materialized_views_for_rewriting_args&); + ThriftHiveMetastore_get_materialized_views_for_rewriting_args() noexcept; + + virtual ~ThriftHiveMetastore_get_materialized_views_for_rewriting_args() noexcept; + std::string db_name; + + _ThriftHiveMetastore_get_materialized_views_for_rewriting_args__isset __isset; + + void __set_db_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_materialized_views_for_rewriting_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_materialized_views_for_rewriting_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_materialized_views_for_rewriting_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_materialized_views_for_rewriting_pargs() noexcept; + const std::string* db_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_materialized_views_for_rewriting_result__isset { + _ThriftHiveMetastore_get_materialized_views_for_rewriting_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_materialized_views_for_rewriting_result__isset; + +class ThriftHiveMetastore_get_materialized_views_for_rewriting_result { + public: + + ThriftHiveMetastore_get_materialized_views_for_rewriting_result(const ThriftHiveMetastore_get_materialized_views_for_rewriting_result&); + ThriftHiveMetastore_get_materialized_views_for_rewriting_result& operator=(const ThriftHiveMetastore_get_materialized_views_for_rewriting_result&); + ThriftHiveMetastore_get_materialized_views_for_rewriting_result() noexcept; + + virtual ~ThriftHiveMetastore_get_materialized_views_for_rewriting_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_materialized_views_for_rewriting_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_materialized_views_for_rewriting_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_materialized_views_for_rewriting_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_materialized_views_for_rewriting_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_materialized_views_for_rewriting_presult__isset { + _ThriftHiveMetastore_get_materialized_views_for_rewriting_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_materialized_views_for_rewriting_presult__isset; + +class ThriftHiveMetastore_get_materialized_views_for_rewriting_presult { + public: + + + virtual ~ThriftHiveMetastore_get_materialized_views_for_rewriting_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_materialized_views_for_rewriting_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_meta_args__isset { + _ThriftHiveMetastore_get_table_meta_args__isset() : db_patterns(false), tbl_patterns(false), tbl_types(false) {} + bool db_patterns :1; + bool tbl_patterns :1; + bool tbl_types :1; +} _ThriftHiveMetastore_get_table_meta_args__isset; + +class ThriftHiveMetastore_get_table_meta_args { + public: + + ThriftHiveMetastore_get_table_meta_args(const ThriftHiveMetastore_get_table_meta_args&); + ThriftHiveMetastore_get_table_meta_args& operator=(const ThriftHiveMetastore_get_table_meta_args&); + ThriftHiveMetastore_get_table_meta_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_meta_args() noexcept; + std::string db_patterns; + std::string tbl_patterns; + std::vector tbl_types; + + _ThriftHiveMetastore_get_table_meta_args__isset __isset; + + void __set_db_patterns(const std::string& val); + + void __set_tbl_patterns(const std::string& val); + + void __set_tbl_types(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_table_meta_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_meta_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_meta_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_meta_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_meta_pargs() noexcept; + const std::string* db_patterns; + const std::string* tbl_patterns; + const std::vector * tbl_types; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_meta_result__isset { + _ThriftHiveMetastore_get_table_meta_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_table_meta_result__isset; + +class ThriftHiveMetastore_get_table_meta_result { + public: + + ThriftHiveMetastore_get_table_meta_result(const ThriftHiveMetastore_get_table_meta_result&); + ThriftHiveMetastore_get_table_meta_result& operator=(const ThriftHiveMetastore_get_table_meta_result&); + ThriftHiveMetastore_get_table_meta_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_meta_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_table_meta_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_table_meta_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_meta_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_meta_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_meta_presult__isset { + _ThriftHiveMetastore_get_table_meta_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_table_meta_presult__isset; + +class ThriftHiveMetastore_get_table_meta_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_meta_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_table_meta_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_tables_args__isset { + _ThriftHiveMetastore_get_all_tables_args__isset() : db_name(false) {} + bool db_name :1; +} _ThriftHiveMetastore_get_all_tables_args__isset; + +class ThriftHiveMetastore_get_all_tables_args { + public: + + ThriftHiveMetastore_get_all_tables_args(const ThriftHiveMetastore_get_all_tables_args&); + ThriftHiveMetastore_get_all_tables_args& operator=(const ThriftHiveMetastore_get_all_tables_args&); + ThriftHiveMetastore_get_all_tables_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_tables_args() noexcept; + std::string db_name; + + _ThriftHiveMetastore_get_all_tables_args__isset __isset; + + void __set_db_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_all_tables_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_tables_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_tables_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_tables_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_tables_pargs() noexcept; + const std::string* db_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_tables_result__isset { + _ThriftHiveMetastore_get_all_tables_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_tables_result__isset; + +class ThriftHiveMetastore_get_all_tables_result { + public: + + ThriftHiveMetastore_get_all_tables_result(const ThriftHiveMetastore_get_all_tables_result&); + ThriftHiveMetastore_get_all_tables_result& operator=(const ThriftHiveMetastore_get_all_tables_result&); + ThriftHiveMetastore_get_all_tables_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_tables_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_all_tables_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_tables_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_tables_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_tables_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_tables_presult__isset { + _ThriftHiveMetastore_get_all_tables_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_tables_presult__isset; + +class ThriftHiveMetastore_get_all_tables_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_tables_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_all_tables_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_tables_ext_args__isset { + _ThriftHiveMetastore_get_tables_ext_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_tables_ext_args__isset; + +class ThriftHiveMetastore_get_tables_ext_args { + public: + + ThriftHiveMetastore_get_tables_ext_args(const ThriftHiveMetastore_get_tables_ext_args&); + ThriftHiveMetastore_get_tables_ext_args& operator=(const ThriftHiveMetastore_get_tables_ext_args&); + ThriftHiveMetastore_get_tables_ext_args() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_ext_args() noexcept; + GetTablesExtRequest req; + + _ThriftHiveMetastore_get_tables_ext_args__isset __isset; + + void __set_req(const GetTablesExtRequest& val); + + bool operator == (const ThriftHiveMetastore_get_tables_ext_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_ext_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_ext_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_tables_ext_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_tables_ext_pargs() noexcept; + const GetTablesExtRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_ext_result__isset { + _ThriftHiveMetastore_get_tables_ext_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_ext_result__isset; + +class ThriftHiveMetastore_get_tables_ext_result { + public: + + ThriftHiveMetastore_get_tables_ext_result(const ThriftHiveMetastore_get_tables_ext_result&); + ThriftHiveMetastore_get_tables_ext_result& operator=(const ThriftHiveMetastore_get_tables_ext_result&); + ThriftHiveMetastore_get_tables_ext_result() noexcept; + + virtual ~ThriftHiveMetastore_get_tables_ext_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_ext_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_tables_ext_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_tables_ext_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_tables_ext_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_tables_ext_presult__isset { + _ThriftHiveMetastore_get_tables_ext_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_tables_ext_presult__isset; + +class ThriftHiveMetastore_get_tables_ext_presult { + public: + + + virtual ~ThriftHiveMetastore_get_tables_ext_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_tables_ext_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_req_args__isset { + _ThriftHiveMetastore_get_table_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_table_req_args__isset; + +class ThriftHiveMetastore_get_table_req_args { + public: + + ThriftHiveMetastore_get_table_req_args(const ThriftHiveMetastore_get_table_req_args&); + ThriftHiveMetastore_get_table_req_args& operator=(const ThriftHiveMetastore_get_table_req_args&); + ThriftHiveMetastore_get_table_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_req_args() noexcept; + GetTableRequest req; + + _ThriftHiveMetastore_get_table_req_args__isset __isset; + + void __set_req(const GetTableRequest& val); + + bool operator == (const ThriftHiveMetastore_get_table_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_req_pargs() noexcept; + const GetTableRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_req_result__isset { + _ThriftHiveMetastore_get_table_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_table_req_result__isset; + +class ThriftHiveMetastore_get_table_req_result { + public: + + ThriftHiveMetastore_get_table_req_result(const ThriftHiveMetastore_get_table_req_result&); + ThriftHiveMetastore_get_table_req_result& operator=(const ThriftHiveMetastore_get_table_req_result&); + ThriftHiveMetastore_get_table_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_req_result() noexcept; + GetTableResult success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_table_req_result__isset __isset; + + void __set_success(const GetTableResult& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_table_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_req_presult__isset { + _ThriftHiveMetastore_get_table_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_table_req_presult__isset; + +class ThriftHiveMetastore_get_table_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_req_presult() noexcept; + GetTableResult* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_table_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_objects_by_name_req_args__isset { + _ThriftHiveMetastore_get_table_objects_by_name_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_table_objects_by_name_req_args__isset; + +class ThriftHiveMetastore_get_table_objects_by_name_req_args { + public: + + ThriftHiveMetastore_get_table_objects_by_name_req_args(const ThriftHiveMetastore_get_table_objects_by_name_req_args&); + ThriftHiveMetastore_get_table_objects_by_name_req_args& operator=(const ThriftHiveMetastore_get_table_objects_by_name_req_args&); + ThriftHiveMetastore_get_table_objects_by_name_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_objects_by_name_req_args() noexcept; + GetTablesRequest req; + + _ThriftHiveMetastore_get_table_objects_by_name_req_args__isset __isset; + + void __set_req(const GetTablesRequest& val); + + bool operator == (const ThriftHiveMetastore_get_table_objects_by_name_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_objects_by_name_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_objects_by_name_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_objects_by_name_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_objects_by_name_req_pargs() noexcept; + const GetTablesRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_objects_by_name_req_result__isset { + _ThriftHiveMetastore_get_table_objects_by_name_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_table_objects_by_name_req_result__isset; + +class ThriftHiveMetastore_get_table_objects_by_name_req_result { + public: + + ThriftHiveMetastore_get_table_objects_by_name_req_result(const ThriftHiveMetastore_get_table_objects_by_name_req_result&); + ThriftHiveMetastore_get_table_objects_by_name_req_result& operator=(const ThriftHiveMetastore_get_table_objects_by_name_req_result&); + ThriftHiveMetastore_get_table_objects_by_name_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_objects_by_name_req_result() noexcept; + GetTablesResult success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_table_objects_by_name_req_result__isset __isset; + + void __set_success(const GetTablesResult& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_table_objects_by_name_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_objects_by_name_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_objects_by_name_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_objects_by_name_req_presult__isset { + _ThriftHiveMetastore_get_table_objects_by_name_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_table_objects_by_name_req_presult__isset; + +class ThriftHiveMetastore_get_table_objects_by_name_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_objects_by_name_req_presult() noexcept; + GetTablesResult* success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_table_objects_by_name_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_materialization_invalidation_info_args__isset { + _ThriftHiveMetastore_get_materialization_invalidation_info_args__isset() : creation_metadata(false), validTxnList(false) {} + bool creation_metadata :1; + bool validTxnList :1; +} _ThriftHiveMetastore_get_materialization_invalidation_info_args__isset; + +class ThriftHiveMetastore_get_materialization_invalidation_info_args { + public: + + ThriftHiveMetastore_get_materialization_invalidation_info_args(const ThriftHiveMetastore_get_materialization_invalidation_info_args&); + ThriftHiveMetastore_get_materialization_invalidation_info_args& operator=(const ThriftHiveMetastore_get_materialization_invalidation_info_args&); + ThriftHiveMetastore_get_materialization_invalidation_info_args() noexcept; + + virtual ~ThriftHiveMetastore_get_materialization_invalidation_info_args() noexcept; + CreationMetadata creation_metadata; + std::string validTxnList; + + _ThriftHiveMetastore_get_materialization_invalidation_info_args__isset __isset; + + void __set_creation_metadata(const CreationMetadata& val); + + void __set_validTxnList(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_materialization_invalidation_info_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_materialization_invalidation_info_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_materialization_invalidation_info_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_materialization_invalidation_info_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_materialization_invalidation_info_pargs() noexcept; + const CreationMetadata* creation_metadata; + const std::string* validTxnList; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_materialization_invalidation_info_result__isset { + _ThriftHiveMetastore_get_materialization_invalidation_info_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_materialization_invalidation_info_result__isset; + +class ThriftHiveMetastore_get_materialization_invalidation_info_result { + public: + + ThriftHiveMetastore_get_materialization_invalidation_info_result(const ThriftHiveMetastore_get_materialization_invalidation_info_result&); + ThriftHiveMetastore_get_materialization_invalidation_info_result& operator=(const ThriftHiveMetastore_get_materialization_invalidation_info_result&); + ThriftHiveMetastore_get_materialization_invalidation_info_result() noexcept; + + virtual ~ThriftHiveMetastore_get_materialization_invalidation_info_result() noexcept; + Materialization success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_materialization_invalidation_info_result__isset __isset; + + void __set_success(const Materialization& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_materialization_invalidation_info_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_materialization_invalidation_info_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_materialization_invalidation_info_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_materialization_invalidation_info_presult__isset { + _ThriftHiveMetastore_get_materialization_invalidation_info_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_materialization_invalidation_info_presult__isset; + +class ThriftHiveMetastore_get_materialization_invalidation_info_presult { + public: + + + virtual ~ThriftHiveMetastore_get_materialization_invalidation_info_presult() noexcept; + Materialization* success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_materialization_invalidation_info_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_creation_metadata_args__isset { + _ThriftHiveMetastore_update_creation_metadata_args__isset() : catName(false), dbname(false), tbl_name(false), creation_metadata(false) {} + bool catName :1; + bool dbname :1; + bool tbl_name :1; + bool creation_metadata :1; +} _ThriftHiveMetastore_update_creation_metadata_args__isset; + +class ThriftHiveMetastore_update_creation_metadata_args { + public: + + ThriftHiveMetastore_update_creation_metadata_args(const ThriftHiveMetastore_update_creation_metadata_args&); + ThriftHiveMetastore_update_creation_metadata_args& operator=(const ThriftHiveMetastore_update_creation_metadata_args&); + ThriftHiveMetastore_update_creation_metadata_args() noexcept; + + virtual ~ThriftHiveMetastore_update_creation_metadata_args() noexcept; + std::string catName; + std::string dbname; + std::string tbl_name; + CreationMetadata creation_metadata; + + _ThriftHiveMetastore_update_creation_metadata_args__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbname(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_creation_metadata(const CreationMetadata& val); + + bool operator == (const ThriftHiveMetastore_update_creation_metadata_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_creation_metadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_creation_metadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_creation_metadata_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_creation_metadata_pargs() noexcept; + const std::string* catName; + const std::string* dbname; + const std::string* tbl_name; + const CreationMetadata* creation_metadata; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_creation_metadata_result__isset { + _ThriftHiveMetastore_update_creation_metadata_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_update_creation_metadata_result__isset; + +class ThriftHiveMetastore_update_creation_metadata_result { + public: + + ThriftHiveMetastore_update_creation_metadata_result(const ThriftHiveMetastore_update_creation_metadata_result&); + ThriftHiveMetastore_update_creation_metadata_result& operator=(const ThriftHiveMetastore_update_creation_metadata_result&); + ThriftHiveMetastore_update_creation_metadata_result() noexcept; + + virtual ~ThriftHiveMetastore_update_creation_metadata_result() noexcept; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_update_creation_metadata_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_update_creation_metadata_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_creation_metadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_creation_metadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_creation_metadata_presult__isset { + _ThriftHiveMetastore_update_creation_metadata_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_update_creation_metadata_presult__isset; + +class ThriftHiveMetastore_update_creation_metadata_presult { + public: + + + virtual ~ThriftHiveMetastore_update_creation_metadata_presult() noexcept; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_update_creation_metadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_names_by_filter_args__isset { + _ThriftHiveMetastore_get_table_names_by_filter_args__isset() : dbname(false), filter(false), max_tables(true) {} + bool dbname :1; + bool filter :1; + bool max_tables :1; +} _ThriftHiveMetastore_get_table_names_by_filter_args__isset; + +class ThriftHiveMetastore_get_table_names_by_filter_args { + public: + + ThriftHiveMetastore_get_table_names_by_filter_args(const ThriftHiveMetastore_get_table_names_by_filter_args&); + ThriftHiveMetastore_get_table_names_by_filter_args& operator=(const ThriftHiveMetastore_get_table_names_by_filter_args&); + ThriftHiveMetastore_get_table_names_by_filter_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_names_by_filter_args() noexcept; + std::string dbname; + std::string filter; + int16_t max_tables; + + _ThriftHiveMetastore_get_table_names_by_filter_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_filter(const std::string& val); + + void __set_max_tables(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_table_names_by_filter_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_names_by_filter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_names_by_filter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_names_by_filter_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_names_by_filter_pargs() noexcept; + const std::string* dbname; + const std::string* filter; + const int16_t* max_tables; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_names_by_filter_result__isset { + _ThriftHiveMetastore_get_table_names_by_filter_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_table_names_by_filter_result__isset; + +class ThriftHiveMetastore_get_table_names_by_filter_result { + public: + + ThriftHiveMetastore_get_table_names_by_filter_result(const ThriftHiveMetastore_get_table_names_by_filter_result&); + ThriftHiveMetastore_get_table_names_by_filter_result& operator=(const ThriftHiveMetastore_get_table_names_by_filter_result&); + ThriftHiveMetastore_get_table_names_by_filter_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_names_by_filter_result() noexcept; + std::vector success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_table_names_by_filter_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const UnknownDBException& val); + + bool operator == (const ThriftHiveMetastore_get_table_names_by_filter_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_names_by_filter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_names_by_filter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_names_by_filter_presult__isset { + _ThriftHiveMetastore_get_table_names_by_filter_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_table_names_by_filter_presult__isset; + +class ThriftHiveMetastore_get_table_names_by_filter_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_names_by_filter_presult() noexcept; + std::vector * success; + MetaException o1; + InvalidOperationException o2; + UnknownDBException o3; + + _ThriftHiveMetastore_get_table_names_by_filter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_table_args__isset { + _ThriftHiveMetastore_alter_table_args__isset() : dbname(false), tbl_name(false), new_tbl(false) {} + bool dbname :1; + bool tbl_name :1; + bool new_tbl :1; +} _ThriftHiveMetastore_alter_table_args__isset; + +class ThriftHiveMetastore_alter_table_args { + public: + + ThriftHiveMetastore_alter_table_args(const ThriftHiveMetastore_alter_table_args&); + ThriftHiveMetastore_alter_table_args& operator=(const ThriftHiveMetastore_alter_table_args&); + ThriftHiveMetastore_alter_table_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_args() noexcept; + std::string dbname; + std::string tbl_name; + Table new_tbl; + + _ThriftHiveMetastore_alter_table_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_tbl(const Table& val); + + bool operator == (const ThriftHiveMetastore_alter_table_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_table_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_table_pargs() noexcept; + const std::string* dbname; + const std::string* tbl_name; + const Table* new_tbl; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_result__isset { + _ThriftHiveMetastore_alter_table_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_result__isset; + +class ThriftHiveMetastore_alter_table_result { + public: + + ThriftHiveMetastore_alter_table_result(const ThriftHiveMetastore_alter_table_result&); + ThriftHiveMetastore_alter_table_result& operator=(const ThriftHiveMetastore_alter_table_result&); + ThriftHiveMetastore_alter_table_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_table_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_presult__isset { + _ThriftHiveMetastore_alter_table_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_presult__isset; + +class ThriftHiveMetastore_alter_table_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_table_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_environment_context_args__isset { + _ThriftHiveMetastore_alter_table_with_environment_context_args__isset() : dbname(false), tbl_name(false), new_tbl(false), environment_context(false) {} + bool dbname :1; + bool tbl_name :1; + bool new_tbl :1; + bool environment_context :1; +} _ThriftHiveMetastore_alter_table_with_environment_context_args__isset; + +class ThriftHiveMetastore_alter_table_with_environment_context_args { + public: + + ThriftHiveMetastore_alter_table_with_environment_context_args(const ThriftHiveMetastore_alter_table_with_environment_context_args&); + ThriftHiveMetastore_alter_table_with_environment_context_args& operator=(const ThriftHiveMetastore_alter_table_with_environment_context_args&); + ThriftHiveMetastore_alter_table_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_with_environment_context_args() noexcept; + std::string dbname; + std::string tbl_name; + Table new_tbl; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_alter_table_with_environment_context_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_tbl(const Table& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_alter_table_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_table_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_table_with_environment_context_pargs() noexcept; + const std::string* dbname; + const std::string* tbl_name; + const Table* new_tbl; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_environment_context_result__isset { + _ThriftHiveMetastore_alter_table_with_environment_context_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_with_environment_context_result__isset; + +class ThriftHiveMetastore_alter_table_with_environment_context_result { + public: + + ThriftHiveMetastore_alter_table_with_environment_context_result(const ThriftHiveMetastore_alter_table_with_environment_context_result&); + ThriftHiveMetastore_alter_table_with_environment_context_result& operator=(const ThriftHiveMetastore_alter_table_with_environment_context_result&); + ThriftHiveMetastore_alter_table_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_with_environment_context_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_with_environment_context_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_table_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_environment_context_presult__isset { + _ThriftHiveMetastore_alter_table_with_environment_context_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_with_environment_context_presult__isset; + +class ThriftHiveMetastore_alter_table_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_table_with_environment_context_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_cascade_args__isset { + _ThriftHiveMetastore_alter_table_with_cascade_args__isset() : dbname(false), tbl_name(false), new_tbl(false), cascade(false) {} + bool dbname :1; + bool tbl_name :1; + bool new_tbl :1; + bool cascade :1; +} _ThriftHiveMetastore_alter_table_with_cascade_args__isset; + +class ThriftHiveMetastore_alter_table_with_cascade_args { + public: + + ThriftHiveMetastore_alter_table_with_cascade_args(const ThriftHiveMetastore_alter_table_with_cascade_args&); + ThriftHiveMetastore_alter_table_with_cascade_args& operator=(const ThriftHiveMetastore_alter_table_with_cascade_args&); + ThriftHiveMetastore_alter_table_with_cascade_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_with_cascade_args() noexcept; + std::string dbname; + std::string tbl_name; + Table new_tbl; + bool cascade; + + _ThriftHiveMetastore_alter_table_with_cascade_args__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_tbl(const Table& val); + + void __set_cascade(const bool val); + + bool operator == (const ThriftHiveMetastore_alter_table_with_cascade_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_with_cascade_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_with_cascade_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_table_with_cascade_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_table_with_cascade_pargs() noexcept; + const std::string* dbname; + const std::string* tbl_name; + const Table* new_tbl; + const bool* cascade; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_cascade_result__isset { + _ThriftHiveMetastore_alter_table_with_cascade_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_with_cascade_result__isset; + +class ThriftHiveMetastore_alter_table_with_cascade_result { + public: + + ThriftHiveMetastore_alter_table_with_cascade_result(const ThriftHiveMetastore_alter_table_with_cascade_result&); + ThriftHiveMetastore_alter_table_with_cascade_result& operator=(const ThriftHiveMetastore_alter_table_with_cascade_result&); + ThriftHiveMetastore_alter_table_with_cascade_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_with_cascade_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_with_cascade_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_table_with_cascade_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_with_cascade_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_with_cascade_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_with_cascade_presult__isset { + _ThriftHiveMetastore_alter_table_with_cascade_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_with_cascade_presult__isset; + +class ThriftHiveMetastore_alter_table_with_cascade_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_table_with_cascade_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_with_cascade_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_table_req_args__isset { + _ThriftHiveMetastore_alter_table_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_alter_table_req_args__isset; + +class ThriftHiveMetastore_alter_table_req_args { + public: + + ThriftHiveMetastore_alter_table_req_args(const ThriftHiveMetastore_alter_table_req_args&); + ThriftHiveMetastore_alter_table_req_args& operator=(const ThriftHiveMetastore_alter_table_req_args&); + ThriftHiveMetastore_alter_table_req_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_req_args() noexcept; + AlterTableRequest req; + + _ThriftHiveMetastore_alter_table_req_args__isset __isset; + + void __set_req(const AlterTableRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_table_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_table_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_table_req_pargs() noexcept; + const AlterTableRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_req_result__isset { + _ThriftHiveMetastore_alter_table_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_req_result__isset; + +class ThriftHiveMetastore_alter_table_req_result { + public: + + ThriftHiveMetastore_alter_table_req_result(const ThriftHiveMetastore_alter_table_req_result&); + ThriftHiveMetastore_alter_table_req_result& operator=(const ThriftHiveMetastore_alter_table_req_result&); + ThriftHiveMetastore_alter_table_req_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_table_req_result() noexcept; + AlterTableResponse success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_req_result__isset __isset; + + void __set_success(const AlterTableResponse& val); + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_table_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_table_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_table_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_table_req_presult__isset { + _ThriftHiveMetastore_alter_table_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_table_req_presult__isset; + +class ThriftHiveMetastore_alter_table_req_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_table_req_presult() noexcept; + AlterTableResponse* success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_table_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_partition_args__isset { + _ThriftHiveMetastore_add_partition_args__isset() : new_part(false) {} + bool new_part :1; +} _ThriftHiveMetastore_add_partition_args__isset; + +class ThriftHiveMetastore_add_partition_args { + public: + + ThriftHiveMetastore_add_partition_args(const ThriftHiveMetastore_add_partition_args&); + ThriftHiveMetastore_add_partition_args& operator=(const ThriftHiveMetastore_add_partition_args&); + ThriftHiveMetastore_add_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_add_partition_args() noexcept; + Partition new_part; + + _ThriftHiveMetastore_add_partition_args__isset __isset; + + void __set_new_part(const Partition& val); + + bool operator == (const ThriftHiveMetastore_add_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_partition_pargs() noexcept; + const Partition* new_part; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partition_result__isset { + _ThriftHiveMetastore_add_partition_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partition_result__isset; + +class ThriftHiveMetastore_add_partition_result { + public: + + ThriftHiveMetastore_add_partition_result(const ThriftHiveMetastore_add_partition_result&); + ThriftHiveMetastore_add_partition_result& operator=(const ThriftHiveMetastore_add_partition_result&); + ThriftHiveMetastore_add_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_add_partition_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partition_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partition_presult__isset { + _ThriftHiveMetastore_add_partition_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partition_presult__isset; + +class ThriftHiveMetastore_add_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_add_partition_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_partition_with_environment_context_args__isset { + _ThriftHiveMetastore_add_partition_with_environment_context_args__isset() : new_part(false), environment_context(false) {} + bool new_part :1; + bool environment_context :1; +} _ThriftHiveMetastore_add_partition_with_environment_context_args__isset; + +class ThriftHiveMetastore_add_partition_with_environment_context_args { + public: + + ThriftHiveMetastore_add_partition_with_environment_context_args(const ThriftHiveMetastore_add_partition_with_environment_context_args&); + ThriftHiveMetastore_add_partition_with_environment_context_args& operator=(const ThriftHiveMetastore_add_partition_with_environment_context_args&); + ThriftHiveMetastore_add_partition_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_add_partition_with_environment_context_args() noexcept; + Partition new_part; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_add_partition_with_environment_context_args__isset __isset; + + void __set_new_part(const Partition& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_add_partition_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partition_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partition_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_partition_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_partition_with_environment_context_pargs() noexcept; + const Partition* new_part; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partition_with_environment_context_result__isset { + _ThriftHiveMetastore_add_partition_with_environment_context_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partition_with_environment_context_result__isset; + +class ThriftHiveMetastore_add_partition_with_environment_context_result { + public: + + ThriftHiveMetastore_add_partition_with_environment_context_result(const ThriftHiveMetastore_add_partition_with_environment_context_result&); + ThriftHiveMetastore_add_partition_with_environment_context_result& operator=(const ThriftHiveMetastore_add_partition_with_environment_context_result&); + ThriftHiveMetastore_add_partition_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_add_partition_with_environment_context_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partition_with_environment_context_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_partition_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partition_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partition_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partition_with_environment_context_presult__isset { + _ThriftHiveMetastore_add_partition_with_environment_context_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partition_with_environment_context_presult__isset; + +class ThriftHiveMetastore_add_partition_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_add_partition_with_environment_context_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partition_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_args__isset { + _ThriftHiveMetastore_add_partitions_args__isset() : new_parts(false) {} + bool new_parts :1; +} _ThriftHiveMetastore_add_partitions_args__isset; + +class ThriftHiveMetastore_add_partitions_args { + public: + + ThriftHiveMetastore_add_partitions_args(const ThriftHiveMetastore_add_partitions_args&); + ThriftHiveMetastore_add_partitions_args& operator=(const ThriftHiveMetastore_add_partitions_args&); + ThriftHiveMetastore_add_partitions_args() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_args() noexcept; + std::vector new_parts; + + _ThriftHiveMetastore_add_partitions_args__isset __isset; + + void __set_new_parts(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_add_partitions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_partitions_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_pargs() noexcept; + const std::vector * new_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_result__isset { + _ThriftHiveMetastore_add_partitions_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_result__isset; + +class ThriftHiveMetastore_add_partitions_result { + public: + + ThriftHiveMetastore_add_partitions_result(const ThriftHiveMetastore_add_partitions_result&); + ThriftHiveMetastore_add_partitions_result& operator=(const ThriftHiveMetastore_add_partitions_result&); + ThriftHiveMetastore_add_partitions_result() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_result() noexcept; + int32_t success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_result__isset __isset; + + void __set_success(const int32_t val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_partitions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_presult__isset { + _ThriftHiveMetastore_add_partitions_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_presult__isset; + +class ThriftHiveMetastore_add_partitions_presult { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_presult() noexcept; + int32_t* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_pspec_args__isset { + _ThriftHiveMetastore_add_partitions_pspec_args__isset() : new_parts(false) {} + bool new_parts :1; +} _ThriftHiveMetastore_add_partitions_pspec_args__isset; + +class ThriftHiveMetastore_add_partitions_pspec_args { + public: + + ThriftHiveMetastore_add_partitions_pspec_args(const ThriftHiveMetastore_add_partitions_pspec_args&); + ThriftHiveMetastore_add_partitions_pspec_args& operator=(const ThriftHiveMetastore_add_partitions_pspec_args&); + ThriftHiveMetastore_add_partitions_pspec_args() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_pspec_args() noexcept; + std::vector new_parts; + + _ThriftHiveMetastore_add_partitions_pspec_args__isset __isset; + + void __set_new_parts(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_add_partitions_pspec_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_pspec_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_pspec_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_partitions_pspec_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_pspec_pargs() noexcept; + const std::vector * new_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_pspec_result__isset { + _ThriftHiveMetastore_add_partitions_pspec_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_pspec_result__isset; + +class ThriftHiveMetastore_add_partitions_pspec_result { + public: + + ThriftHiveMetastore_add_partitions_pspec_result(const ThriftHiveMetastore_add_partitions_pspec_result&); + ThriftHiveMetastore_add_partitions_pspec_result& operator=(const ThriftHiveMetastore_add_partitions_pspec_result&); + ThriftHiveMetastore_add_partitions_pspec_result() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_pspec_result() noexcept; + int32_t success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_pspec_result__isset __isset; + + void __set_success(const int32_t val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_partitions_pspec_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_pspec_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_pspec_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_pspec_presult__isset { + _ThriftHiveMetastore_add_partitions_pspec_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_pspec_presult__isset; + +class ThriftHiveMetastore_add_partitions_pspec_presult { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_pspec_presult() noexcept; + int32_t* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_pspec_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_append_partition_args__isset { + _ThriftHiveMetastore_append_partition_args__isset() : db_name(false), tbl_name(false), part_vals(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; +} _ThriftHiveMetastore_append_partition_args__isset; + +class ThriftHiveMetastore_append_partition_args { + public: + + ThriftHiveMetastore_append_partition_args(const ThriftHiveMetastore_append_partition_args&); + ThriftHiveMetastore_append_partition_args& operator=(const ThriftHiveMetastore_append_partition_args&); + ThriftHiveMetastore_append_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + + _ThriftHiveMetastore_append_partition_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_append_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_append_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_append_partition_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_result__isset { + _ThriftHiveMetastore_append_partition_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_result__isset; + +class ThriftHiveMetastore_append_partition_result { + public: + + ThriftHiveMetastore_append_partition_result(const ThriftHiveMetastore_append_partition_result&); + ThriftHiveMetastore_append_partition_result& operator=(const ThriftHiveMetastore_append_partition_result&); + ThriftHiveMetastore_append_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_append_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_presult__isset { + _ThriftHiveMetastore_append_partition_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_presult__isset; + +class ThriftHiveMetastore_append_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_append_partition_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_req_args__isset { + _ThriftHiveMetastore_add_partitions_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_add_partitions_req_args__isset; + +class ThriftHiveMetastore_add_partitions_req_args { + public: + + ThriftHiveMetastore_add_partitions_req_args(const ThriftHiveMetastore_add_partitions_req_args&); + ThriftHiveMetastore_add_partitions_req_args& operator=(const ThriftHiveMetastore_add_partitions_req_args&); + ThriftHiveMetastore_add_partitions_req_args() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_req_args() noexcept; + AddPartitionsRequest request; + + _ThriftHiveMetastore_add_partitions_req_args__isset __isset; + + void __set_request(const AddPartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_add_partitions_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_partitions_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_req_pargs() noexcept; + const AddPartitionsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_req_result__isset { + _ThriftHiveMetastore_add_partitions_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_req_result__isset; + +class ThriftHiveMetastore_add_partitions_req_result { + public: + + ThriftHiveMetastore_add_partitions_req_result(const ThriftHiveMetastore_add_partitions_req_result&); + ThriftHiveMetastore_add_partitions_req_result& operator=(const ThriftHiveMetastore_add_partitions_req_result&); + ThriftHiveMetastore_add_partitions_req_result() noexcept; + + virtual ~ThriftHiveMetastore_add_partitions_req_result() noexcept; + AddPartitionsResult success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_req_result__isset __isset; + + void __set_success(const AddPartitionsResult& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_partitions_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_partitions_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_partitions_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_partitions_req_presult__isset { + _ThriftHiveMetastore_add_partitions_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_partitions_req_presult__isset; + +class ThriftHiveMetastore_add_partitions_req_presult { + public: + + + virtual ~ThriftHiveMetastore_add_partitions_req_presult() noexcept; + AddPartitionsResult* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_add_partitions_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_append_partition_with_environment_context_args__isset { + _ThriftHiveMetastore_append_partition_with_environment_context_args__isset() : db_name(false), tbl_name(false), part_vals(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool environment_context :1; +} _ThriftHiveMetastore_append_partition_with_environment_context_args__isset; + +class ThriftHiveMetastore_append_partition_with_environment_context_args { + public: + + ThriftHiveMetastore_append_partition_with_environment_context_args(const ThriftHiveMetastore_append_partition_with_environment_context_args&); + ThriftHiveMetastore_append_partition_with_environment_context_args& operator=(const ThriftHiveMetastore_append_partition_with_environment_context_args&); + ThriftHiveMetastore_append_partition_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_append_partition_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_append_partition_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_append_partition_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_append_partition_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_with_environment_context_result__isset { + _ThriftHiveMetastore_append_partition_with_environment_context_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_with_environment_context_result__isset; + +class ThriftHiveMetastore_append_partition_with_environment_context_result { + public: + + ThriftHiveMetastore_append_partition_with_environment_context_result(const ThriftHiveMetastore_append_partition_with_environment_context_result&); + ThriftHiveMetastore_append_partition_with_environment_context_result& operator=(const ThriftHiveMetastore_append_partition_with_environment_context_result&); + ThriftHiveMetastore_append_partition_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_with_environment_context_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_with_environment_context_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_append_partition_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_with_environment_context_presult__isset { + _ThriftHiveMetastore_append_partition_with_environment_context_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_with_environment_context_presult__isset; + +class ThriftHiveMetastore_append_partition_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_append_partition_with_environment_context_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_append_partition_req_args__isset { + _ThriftHiveMetastore_append_partition_req_args__isset() : appendPartitionsReq(false) {} + bool appendPartitionsReq :1; +} _ThriftHiveMetastore_append_partition_req_args__isset; + +class ThriftHiveMetastore_append_partition_req_args { + public: + + ThriftHiveMetastore_append_partition_req_args(const ThriftHiveMetastore_append_partition_req_args&); + ThriftHiveMetastore_append_partition_req_args& operator=(const ThriftHiveMetastore_append_partition_req_args&); + ThriftHiveMetastore_append_partition_req_args() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_req_args() noexcept; + AppendPartitionsRequest appendPartitionsReq; + + _ThriftHiveMetastore_append_partition_req_args__isset __isset; + + void __set_appendPartitionsReq(const AppendPartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_append_partition_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_append_partition_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_append_partition_req_pargs() noexcept; + const AppendPartitionsRequest* appendPartitionsReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_req_result__isset { + _ThriftHiveMetastore_append_partition_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_req_result__isset; + +class ThriftHiveMetastore_append_partition_req_result { + public: + + ThriftHiveMetastore_append_partition_req_result(const ThriftHiveMetastore_append_partition_req_result&); + ThriftHiveMetastore_append_partition_req_result& operator=(const ThriftHiveMetastore_append_partition_req_result&); + ThriftHiveMetastore_append_partition_req_result() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_req_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_req_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_append_partition_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_req_presult__isset { + _ThriftHiveMetastore_append_partition_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_req_presult__isset; + +class ThriftHiveMetastore_append_partition_req_presult { + public: + + + virtual ~ThriftHiveMetastore_append_partition_req_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_args__isset { + _ThriftHiveMetastore_append_partition_by_name_args__isset() : db_name(false), tbl_name(false), part_name(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; +} _ThriftHiveMetastore_append_partition_by_name_args__isset; + +class ThriftHiveMetastore_append_partition_by_name_args { + public: + + ThriftHiveMetastore_append_partition_by_name_args(const ThriftHiveMetastore_append_partition_by_name_args&); + ThriftHiveMetastore_append_partition_by_name_args& operator=(const ThriftHiveMetastore_append_partition_by_name_args&); + ThriftHiveMetastore_append_partition_by_name_args() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_by_name_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + + _ThriftHiveMetastore_append_partition_by_name_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_append_partition_by_name_args & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_by_name_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_by_name_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_append_partition_by_name_pargs { + public: + + + virtual ~ThriftHiveMetastore_append_partition_by_name_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_result__isset { + _ThriftHiveMetastore_append_partition_by_name_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_by_name_result__isset; + +class ThriftHiveMetastore_append_partition_by_name_result { + public: + + ThriftHiveMetastore_append_partition_by_name_result(const ThriftHiveMetastore_append_partition_by_name_result&); + ThriftHiveMetastore_append_partition_by_name_result& operator=(const ThriftHiveMetastore_append_partition_by_name_result&); + ThriftHiveMetastore_append_partition_by_name_result() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_by_name_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_by_name_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_append_partition_by_name_result & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_by_name_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_by_name_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_presult__isset { + _ThriftHiveMetastore_append_partition_by_name_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_by_name_presult__isset; + +class ThriftHiveMetastore_append_partition_by_name_presult { + public: + + + virtual ~ThriftHiveMetastore_append_partition_by_name_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_by_name_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_with_environment_context_args__isset { + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_args__isset() : db_name(false), tbl_name(false), part_name(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; + bool environment_context :1; +} _ThriftHiveMetastore_append_partition_by_name_with_environment_context_args__isset; + +class ThriftHiveMetastore_append_partition_by_name_with_environment_context_args { + public: + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_args(const ThriftHiveMetastore_append_partition_by_name_with_environment_context_args&); + ThriftHiveMetastore_append_partition_by_name_with_environment_context_args& operator=(const ThriftHiveMetastore_append_partition_by_name_with_environment_context_args&); + ThriftHiveMetastore_append_partition_by_name_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_by_name_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_append_partition_by_name_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_with_environment_context_result__isset { + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_by_name_with_environment_context_result__isset; + +class ThriftHiveMetastore_append_partition_by_name_with_environment_context_result { + public: + + ThriftHiveMetastore_append_partition_by_name_with_environment_context_result(const ThriftHiveMetastore_append_partition_by_name_with_environment_context_result&); + ThriftHiveMetastore_append_partition_by_name_with_environment_context_result& operator=(const ThriftHiveMetastore_append_partition_by_name_with_environment_context_result&); + ThriftHiveMetastore_append_partition_by_name_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_append_partition_by_name_with_environment_context_result() noexcept; + Partition success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const InvalidObjectException& val); + + void __set_o2(const AlreadyExistsException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_append_partition_by_name_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult__isset { + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult__isset; + +class ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult() noexcept; + Partition* success; + InvalidObjectException o1; + AlreadyExistsException o2; + MetaException o3; + + _ThriftHiveMetastore_append_partition_by_name_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_args__isset { + _ThriftHiveMetastore_drop_partition_args__isset() : db_name(false), tbl_name(false), part_vals(false), deleteData(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool deleteData :1; +} _ThriftHiveMetastore_drop_partition_args__isset; + +class ThriftHiveMetastore_drop_partition_args { + public: + + ThriftHiveMetastore_drop_partition_args(const ThriftHiveMetastore_drop_partition_args&); + ThriftHiveMetastore_drop_partition_args& operator=(const ThriftHiveMetastore_drop_partition_args&); + ThriftHiveMetastore_drop_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + bool deleteData; + + _ThriftHiveMetastore_drop_partition_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_deleteData(const bool val); + + bool operator == (const ThriftHiveMetastore_drop_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const bool* deleteData; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_result__isset { + _ThriftHiveMetastore_drop_partition_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_result__isset; + +class ThriftHiveMetastore_drop_partition_result { + public: + + ThriftHiveMetastore_drop_partition_result(const ThriftHiveMetastore_drop_partition_result&); + ThriftHiveMetastore_drop_partition_result& operator=(const ThriftHiveMetastore_drop_partition_result&); + ThriftHiveMetastore_drop_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_presult__isset { + _ThriftHiveMetastore_drop_partition_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_presult__isset; + +class ThriftHiveMetastore_drop_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_with_environment_context_args__isset { + _ThriftHiveMetastore_drop_partition_with_environment_context_args__isset() : db_name(false), tbl_name(false), part_vals(false), deleteData(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool deleteData :1; + bool environment_context :1; +} _ThriftHiveMetastore_drop_partition_with_environment_context_args__isset; + +class ThriftHiveMetastore_drop_partition_with_environment_context_args { + public: + + ThriftHiveMetastore_drop_partition_with_environment_context_args(const ThriftHiveMetastore_drop_partition_with_environment_context_args&); + ThriftHiveMetastore_drop_partition_with_environment_context_args& operator=(const ThriftHiveMetastore_drop_partition_with_environment_context_args&); + ThriftHiveMetastore_drop_partition_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + bool deleteData; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_drop_partition_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_deleteData(const bool val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partition_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const bool* deleteData; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_with_environment_context_result__isset { + _ThriftHiveMetastore_drop_partition_with_environment_context_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_with_environment_context_result__isset; + +class ThriftHiveMetastore_drop_partition_with_environment_context_result { + public: + + ThriftHiveMetastore_drop_partition_with_environment_context_result(const ThriftHiveMetastore_drop_partition_with_environment_context_result&); + ThriftHiveMetastore_drop_partition_with_environment_context_result& operator=(const ThriftHiveMetastore_drop_partition_with_environment_context_result&); + ThriftHiveMetastore_drop_partition_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_with_environment_context_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_with_environment_context_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_with_environment_context_presult__isset { + _ThriftHiveMetastore_drop_partition_with_environment_context_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_with_environment_context_presult__isset; + +class ThriftHiveMetastore_drop_partition_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_with_environment_context_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_req_args__isset { + _ThriftHiveMetastore_drop_partition_req_args__isset() : dropPartitionReq(false) {} + bool dropPartitionReq :1; +} _ThriftHiveMetastore_drop_partition_req_args__isset; + +class ThriftHiveMetastore_drop_partition_req_args { + public: + + ThriftHiveMetastore_drop_partition_req_args(const ThriftHiveMetastore_drop_partition_req_args&); + ThriftHiveMetastore_drop_partition_req_args& operator=(const ThriftHiveMetastore_drop_partition_req_args&); + ThriftHiveMetastore_drop_partition_req_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_req_args() noexcept; + DropPartitionRequest dropPartitionReq; + + _ThriftHiveMetastore_drop_partition_req_args__isset __isset; + + void __set_dropPartitionReq(const DropPartitionRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partition_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_req_pargs() noexcept; + const DropPartitionRequest* dropPartitionReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_req_result__isset { + _ThriftHiveMetastore_drop_partition_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_req_result__isset; + +class ThriftHiveMetastore_drop_partition_req_result { + public: + + ThriftHiveMetastore_drop_partition_req_result(const ThriftHiveMetastore_drop_partition_req_result&); + ThriftHiveMetastore_drop_partition_req_result& operator=(const ThriftHiveMetastore_drop_partition_req_result&); + ThriftHiveMetastore_drop_partition_req_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_req_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_req_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_req_presult__isset { + _ThriftHiveMetastore_drop_partition_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_req_presult__isset; + +class ThriftHiveMetastore_drop_partition_req_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_req_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_args__isset { + _ThriftHiveMetastore_drop_partition_by_name_args__isset() : db_name(false), tbl_name(false), part_name(false), deleteData(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; + bool deleteData :1; +} _ThriftHiveMetastore_drop_partition_by_name_args__isset; + +class ThriftHiveMetastore_drop_partition_by_name_args { + public: + + ThriftHiveMetastore_drop_partition_by_name_args(const ThriftHiveMetastore_drop_partition_by_name_args&); + ThriftHiveMetastore_drop_partition_by_name_args& operator=(const ThriftHiveMetastore_drop_partition_by_name_args&); + ThriftHiveMetastore_drop_partition_by_name_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_by_name_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + bool deleteData; + + _ThriftHiveMetastore_drop_partition_by_name_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + void __set_deleteData(const bool val); + + bool operator == (const ThriftHiveMetastore_drop_partition_by_name_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_by_name_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_by_name_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partition_by_name_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_by_name_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + const bool* deleteData; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_result__isset { + _ThriftHiveMetastore_drop_partition_by_name_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_by_name_result__isset; + +class ThriftHiveMetastore_drop_partition_by_name_result { + public: + + ThriftHiveMetastore_drop_partition_by_name_result(const ThriftHiveMetastore_drop_partition_by_name_result&); + ThriftHiveMetastore_drop_partition_by_name_result& operator=(const ThriftHiveMetastore_drop_partition_by_name_result&); + ThriftHiveMetastore_drop_partition_by_name_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_by_name_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_by_name_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_by_name_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_by_name_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_by_name_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_presult__isset { + _ThriftHiveMetastore_drop_partition_by_name_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_by_name_presult__isset; + +class ThriftHiveMetastore_drop_partition_by_name_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_by_name_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_by_name_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args__isset { + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args__isset() : db_name(false), tbl_name(false), part_name(false), deleteData(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; + bool deleteData :1; + bool environment_context :1; +} _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args__isset; + +class ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args { + public: + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args(const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args&); + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args& operator=(const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args&); + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + bool deleteData; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + void __set_deleteData(const bool val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + const bool* deleteData; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result__isset { + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result__isset; + +class ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result { + public: + + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result(const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result&); + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result& operator=(const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result&); + ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partition_by_name_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult__isset { + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult__isset; + +class ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partition_by_name_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_partitions_req_args__isset { + _ThriftHiveMetastore_drop_partitions_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_drop_partitions_req_args__isset; + +class ThriftHiveMetastore_drop_partitions_req_args { + public: + + ThriftHiveMetastore_drop_partitions_req_args(const ThriftHiveMetastore_drop_partitions_req_args&); + ThriftHiveMetastore_drop_partitions_req_args& operator=(const ThriftHiveMetastore_drop_partitions_req_args&); + ThriftHiveMetastore_drop_partitions_req_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_partitions_req_args() noexcept; + DropPartitionsRequest req; + + _ThriftHiveMetastore_drop_partitions_req_args__isset __isset; + + void __set_req(const DropPartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_partitions_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partitions_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partitions_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_partitions_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_partitions_req_pargs() noexcept; + const DropPartitionsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partitions_req_result__isset { + _ThriftHiveMetastore_drop_partitions_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partitions_req_result__isset; + +class ThriftHiveMetastore_drop_partitions_req_result { + public: + + ThriftHiveMetastore_drop_partitions_req_result(const ThriftHiveMetastore_drop_partitions_req_result&); + ThriftHiveMetastore_drop_partitions_req_result& operator=(const ThriftHiveMetastore_drop_partitions_req_result&); + ThriftHiveMetastore_drop_partitions_req_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_partitions_req_result() noexcept; + DropPartitionsResult success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partitions_req_result__isset __isset; + + void __set_success(const DropPartitionsResult& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_partitions_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_partitions_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_partitions_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_partitions_req_presult__isset { + _ThriftHiveMetastore_drop_partitions_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_partitions_req_presult__isset; + +class ThriftHiveMetastore_drop_partitions_req_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_partitions_req_presult() noexcept; + DropPartitionsResult* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_partitions_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_args__isset { + _ThriftHiveMetastore_get_partition_args__isset() : db_name(false), tbl_name(false), part_vals(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; +} _ThriftHiveMetastore_get_partition_args__isset; + +class ThriftHiveMetastore_get_partition_args { + public: + + ThriftHiveMetastore_get_partition_args(const ThriftHiveMetastore_get_partition_args&); + ThriftHiveMetastore_get_partition_args& operator=(const ThriftHiveMetastore_get_partition_args&); + ThriftHiveMetastore_get_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + + _ThriftHiveMetastore_get_partition_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_result__isset { + _ThriftHiveMetastore_get_partition_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_result__isset; + +class ThriftHiveMetastore_get_partition_result { + public: + + ThriftHiveMetastore_get_partition_result(const ThriftHiveMetastore_get_partition_result&); + ThriftHiveMetastore_get_partition_result& operator=(const ThriftHiveMetastore_get_partition_result&); + ThriftHiveMetastore_get_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_result() noexcept; + Partition success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_presult__isset { + _ThriftHiveMetastore_get_partition_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_presult__isset; + +class ThriftHiveMetastore_get_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_presult() noexcept; + Partition* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_req_args__isset { + _ThriftHiveMetastore_get_partition_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partition_req_args__isset; + +class ThriftHiveMetastore_get_partition_req_args { + public: + + ThriftHiveMetastore_get_partition_req_args(const ThriftHiveMetastore_get_partition_req_args&); + ThriftHiveMetastore_get_partition_req_args& operator=(const ThriftHiveMetastore_get_partition_req_args&); + ThriftHiveMetastore_get_partition_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_req_args() noexcept; + GetPartitionRequest req; + + _ThriftHiveMetastore_get_partition_req_args__isset __isset; + + void __set_req(const GetPartitionRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partition_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_req_pargs() noexcept; + const GetPartitionRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_req_result__isset { + _ThriftHiveMetastore_get_partition_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_req_result__isset; + +class ThriftHiveMetastore_get_partition_req_result { + public: + + ThriftHiveMetastore_get_partition_req_result(const ThriftHiveMetastore_get_partition_req_result&); + ThriftHiveMetastore_get_partition_req_result& operator=(const ThriftHiveMetastore_get_partition_req_result&); + ThriftHiveMetastore_get_partition_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_req_result() noexcept; + GetPartitionResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_req_result__isset __isset; + + void __set_success(const GetPartitionResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_req_presult__isset { + _ThriftHiveMetastore_get_partition_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_req_presult__isset; + +class ThriftHiveMetastore_get_partition_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_req_presult() noexcept; + GetPartitionResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_exchange_partition_args__isset { + _ThriftHiveMetastore_exchange_partition_args__isset() : partitionSpecs(false), source_db(false), source_table_name(false), dest_db(false), dest_table_name(false) {} + bool partitionSpecs :1; + bool source_db :1; + bool source_table_name :1; + bool dest_db :1; + bool dest_table_name :1; +} _ThriftHiveMetastore_exchange_partition_args__isset; + +class ThriftHiveMetastore_exchange_partition_args { + public: + + ThriftHiveMetastore_exchange_partition_args(const ThriftHiveMetastore_exchange_partition_args&); + ThriftHiveMetastore_exchange_partition_args& operator=(const ThriftHiveMetastore_exchange_partition_args&); + ThriftHiveMetastore_exchange_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_exchange_partition_args() noexcept; + std::map partitionSpecs; + std::string source_db; + std::string source_table_name; + std::string dest_db; + std::string dest_table_name; + + _ThriftHiveMetastore_exchange_partition_args__isset __isset; + + void __set_partitionSpecs(const std::map & val); + + void __set_source_db(const std::string& val); + + void __set_source_table_name(const std::string& val); + + void __set_dest_db(const std::string& val); + + void __set_dest_table_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_exchange_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_exchange_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_exchange_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_exchange_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_exchange_partition_pargs() noexcept; + const std::map * partitionSpecs; + const std::string* source_db; + const std::string* source_table_name; + const std::string* dest_db; + const std::string* dest_table_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_exchange_partition_result__isset { + _ThriftHiveMetastore_exchange_partition_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_exchange_partition_result__isset; + +class ThriftHiveMetastore_exchange_partition_result { + public: + + ThriftHiveMetastore_exchange_partition_result(const ThriftHiveMetastore_exchange_partition_result&); + ThriftHiveMetastore_exchange_partition_result& operator=(const ThriftHiveMetastore_exchange_partition_result&); + ThriftHiveMetastore_exchange_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_exchange_partition_result() noexcept; + Partition success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_exchange_partition_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_exchange_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_exchange_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_exchange_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_exchange_partition_presult__isset { + _ThriftHiveMetastore_exchange_partition_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_exchange_partition_presult__isset; + +class ThriftHiveMetastore_exchange_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_exchange_partition_presult() noexcept; + Partition* success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_exchange_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_exchange_partitions_args__isset { + _ThriftHiveMetastore_exchange_partitions_args__isset() : partitionSpecs(false), source_db(false), source_table_name(false), dest_db(false), dest_table_name(false) {} + bool partitionSpecs :1; + bool source_db :1; + bool source_table_name :1; + bool dest_db :1; + bool dest_table_name :1; +} _ThriftHiveMetastore_exchange_partitions_args__isset; + +class ThriftHiveMetastore_exchange_partitions_args { + public: + + ThriftHiveMetastore_exchange_partitions_args(const ThriftHiveMetastore_exchange_partitions_args&); + ThriftHiveMetastore_exchange_partitions_args& operator=(const ThriftHiveMetastore_exchange_partitions_args&); + ThriftHiveMetastore_exchange_partitions_args() noexcept; + + virtual ~ThriftHiveMetastore_exchange_partitions_args() noexcept; + std::map partitionSpecs; + std::string source_db; + std::string source_table_name; + std::string dest_db; + std::string dest_table_name; + + _ThriftHiveMetastore_exchange_partitions_args__isset __isset; + + void __set_partitionSpecs(const std::map & val); + + void __set_source_db(const std::string& val); + + void __set_source_table_name(const std::string& val); + + void __set_dest_db(const std::string& val); + + void __set_dest_table_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_exchange_partitions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_exchange_partitions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_exchange_partitions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_exchange_partitions_pargs { + public: + + + virtual ~ThriftHiveMetastore_exchange_partitions_pargs() noexcept; + const std::map * partitionSpecs; + const std::string* source_db; + const std::string* source_table_name; + const std::string* dest_db; + const std::string* dest_table_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_exchange_partitions_result__isset { + _ThriftHiveMetastore_exchange_partitions_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_exchange_partitions_result__isset; + +class ThriftHiveMetastore_exchange_partitions_result { + public: + + ThriftHiveMetastore_exchange_partitions_result(const ThriftHiveMetastore_exchange_partitions_result&); + ThriftHiveMetastore_exchange_partitions_result& operator=(const ThriftHiveMetastore_exchange_partitions_result&); + ThriftHiveMetastore_exchange_partitions_result() noexcept; + + virtual ~ThriftHiveMetastore_exchange_partitions_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_exchange_partitions_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_exchange_partitions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_exchange_partitions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_exchange_partitions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_exchange_partitions_presult__isset { + _ThriftHiveMetastore_exchange_partitions_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_exchange_partitions_presult__isset; + +class ThriftHiveMetastore_exchange_partitions_presult { + public: + + + virtual ~ThriftHiveMetastore_exchange_partitions_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_exchange_partitions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_with_auth_args__isset { + _ThriftHiveMetastore_get_partition_with_auth_args__isset() : db_name(false), tbl_name(false), part_vals(false), user_name(false), group_names(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool user_name :1; + bool group_names :1; +} _ThriftHiveMetastore_get_partition_with_auth_args__isset; + +class ThriftHiveMetastore_get_partition_with_auth_args { + public: + + ThriftHiveMetastore_get_partition_with_auth_args(const ThriftHiveMetastore_get_partition_with_auth_args&); + ThriftHiveMetastore_get_partition_with_auth_args& operator=(const ThriftHiveMetastore_get_partition_with_auth_args&); + ThriftHiveMetastore_get_partition_with_auth_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_with_auth_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + std::string user_name; + std::vector group_names; + + _ThriftHiveMetastore_get_partition_with_auth_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_user_name(const std::string& val); + + void __set_group_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_partition_with_auth_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_with_auth_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_with_auth_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_with_auth_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_with_auth_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const std::string* user_name; + const std::vector * group_names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_with_auth_result__isset { + _ThriftHiveMetastore_get_partition_with_auth_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_with_auth_result__isset; + +class ThriftHiveMetastore_get_partition_with_auth_result { + public: + + ThriftHiveMetastore_get_partition_with_auth_result(const ThriftHiveMetastore_get_partition_with_auth_result&); + ThriftHiveMetastore_get_partition_with_auth_result& operator=(const ThriftHiveMetastore_get_partition_with_auth_result&); + ThriftHiveMetastore_get_partition_with_auth_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_with_auth_result() noexcept; + Partition success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_with_auth_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_with_auth_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_with_auth_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_with_auth_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_with_auth_presult__isset { + _ThriftHiveMetastore_get_partition_with_auth_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_with_auth_presult__isset; + +class ThriftHiveMetastore_get_partition_with_auth_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_with_auth_presult() noexcept; + Partition* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_with_auth_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_by_name_args__isset { + _ThriftHiveMetastore_get_partition_by_name_args__isset() : db_name(false), tbl_name(false), part_name(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; +} _ThriftHiveMetastore_get_partition_by_name_args__isset; + +class ThriftHiveMetastore_get_partition_by_name_args { + public: + + ThriftHiveMetastore_get_partition_by_name_args(const ThriftHiveMetastore_get_partition_by_name_args&); + ThriftHiveMetastore_get_partition_by_name_args& operator=(const ThriftHiveMetastore_get_partition_by_name_args&); + ThriftHiveMetastore_get_partition_by_name_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_by_name_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + + _ThriftHiveMetastore_get_partition_by_name_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_partition_by_name_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_by_name_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_by_name_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_by_name_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_by_name_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_by_name_result__isset { + _ThriftHiveMetastore_get_partition_by_name_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_by_name_result__isset; + +class ThriftHiveMetastore_get_partition_by_name_result { + public: + + ThriftHiveMetastore_get_partition_by_name_result(const ThriftHiveMetastore_get_partition_by_name_result&); + ThriftHiveMetastore_get_partition_by_name_result& operator=(const ThriftHiveMetastore_get_partition_by_name_result&); + ThriftHiveMetastore_get_partition_by_name_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_by_name_result() noexcept; + Partition success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_by_name_result__isset __isset; + + void __set_success(const Partition& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_by_name_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_by_name_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_by_name_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_by_name_presult__isset { + _ThriftHiveMetastore_get_partition_by_name_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_by_name_presult__isset; + +class ThriftHiveMetastore_get_partition_by_name_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_by_name_presult() noexcept; + Partition* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_by_name_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_args__isset { + _ThriftHiveMetastore_get_partitions_args__isset() : db_name(false), tbl_name(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partitions_args__isset; + +class ThriftHiveMetastore_get_partitions_args { + public: + + ThriftHiveMetastore_get_partitions_args(const ThriftHiveMetastore_get_partitions_args&); + ThriftHiveMetastore_get_partitions_args& operator=(const ThriftHiveMetastore_get_partitions_args&); + ThriftHiveMetastore_get_partitions_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_args() noexcept; + std::string db_name; + std::string tbl_name; + int16_t max_parts; + + _ThriftHiveMetastore_get_partitions_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_max_parts(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_partitions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const int16_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_result__isset { + _ThriftHiveMetastore_get_partitions_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_result__isset; + +class ThriftHiveMetastore_get_partitions_result { + public: + + ThriftHiveMetastore_get_partitions_result(const ThriftHiveMetastore_get_partitions_result&); + ThriftHiveMetastore_get_partitions_result& operator=(const ThriftHiveMetastore_get_partitions_result&); + ThriftHiveMetastore_get_partitions_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_presult__isset { + _ThriftHiveMetastore_get_partitions_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_presult__isset; + +class ThriftHiveMetastore_get_partitions_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_req_args__isset { + _ThriftHiveMetastore_get_partitions_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_req_args__isset; + +class ThriftHiveMetastore_get_partitions_req_args { + public: + + ThriftHiveMetastore_get_partitions_req_args(const ThriftHiveMetastore_get_partitions_req_args&); + ThriftHiveMetastore_get_partitions_req_args& operator=(const ThriftHiveMetastore_get_partitions_req_args&); + ThriftHiveMetastore_get_partitions_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_req_args() noexcept; + PartitionsRequest req; + + _ThriftHiveMetastore_get_partitions_req_args__isset __isset; + + void __set_req(const PartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_req_pargs() noexcept; + const PartitionsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_req_result__isset { + _ThriftHiveMetastore_get_partitions_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_req_result__isset; + +class ThriftHiveMetastore_get_partitions_req_result { + public: + + ThriftHiveMetastore_get_partitions_req_result(const ThriftHiveMetastore_get_partitions_req_result&); + ThriftHiveMetastore_get_partitions_req_result& operator=(const ThriftHiveMetastore_get_partitions_req_result&); + ThriftHiveMetastore_get_partitions_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_req_result() noexcept; + PartitionsResponse success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_req_result__isset __isset; + + void __set_success(const PartitionsResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_req_presult__isset { + _ThriftHiveMetastore_get_partitions_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_req_presult__isset; + +class ThriftHiveMetastore_get_partitions_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_req_presult() noexcept; + PartitionsResponse* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_auth_args__isset { + _ThriftHiveMetastore_get_partitions_with_auth_args__isset() : db_name(false), tbl_name(false), max_parts(true), user_name(false), group_names(false) {} + bool db_name :1; + bool tbl_name :1; + bool max_parts :1; + bool user_name :1; + bool group_names :1; +} _ThriftHiveMetastore_get_partitions_with_auth_args__isset; + +class ThriftHiveMetastore_get_partitions_with_auth_args { + public: + + ThriftHiveMetastore_get_partitions_with_auth_args(const ThriftHiveMetastore_get_partitions_with_auth_args&); + ThriftHiveMetastore_get_partitions_with_auth_args& operator=(const ThriftHiveMetastore_get_partitions_with_auth_args&); + ThriftHiveMetastore_get_partitions_with_auth_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_with_auth_args() noexcept; + std::string db_name; + std::string tbl_name; + int16_t max_parts; + std::string user_name; + std::vector group_names; + + _ThriftHiveMetastore_get_partitions_with_auth_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_max_parts(const int16_t val); + + void __set_user_name(const std::string& val); + + void __set_group_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_partitions_with_auth_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_with_auth_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_with_auth_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_with_auth_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_with_auth_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const int16_t* max_parts; + const std::string* user_name; + const std::vector * group_names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_auth_result__isset { + _ThriftHiveMetastore_get_partitions_with_auth_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_with_auth_result__isset; + +class ThriftHiveMetastore_get_partitions_with_auth_result { + public: + + ThriftHiveMetastore_get_partitions_with_auth_result(const ThriftHiveMetastore_get_partitions_with_auth_result&); + ThriftHiveMetastore_get_partitions_with_auth_result& operator=(const ThriftHiveMetastore_get_partitions_with_auth_result&); + ThriftHiveMetastore_get_partitions_with_auth_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_with_auth_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_with_auth_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_with_auth_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_with_auth_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_with_auth_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_auth_presult__isset { + _ThriftHiveMetastore_get_partitions_with_auth_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_with_auth_presult__isset; + +class ThriftHiveMetastore_get_partitions_with_auth_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_with_auth_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_with_auth_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_pspec_args__isset { + _ThriftHiveMetastore_get_partitions_pspec_args__isset() : db_name(false), tbl_name(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partitions_pspec_args__isset; + +class ThriftHiveMetastore_get_partitions_pspec_args { + public: + + ThriftHiveMetastore_get_partitions_pspec_args(const ThriftHiveMetastore_get_partitions_pspec_args&); + ThriftHiveMetastore_get_partitions_pspec_args& operator=(const ThriftHiveMetastore_get_partitions_pspec_args&); + ThriftHiveMetastore_get_partitions_pspec_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_pspec_args() noexcept; + std::string db_name; + std::string tbl_name; + int32_t max_parts; + + _ThriftHiveMetastore_get_partitions_pspec_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_max_parts(const int32_t val); + + bool operator == (const ThriftHiveMetastore_get_partitions_pspec_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_pspec_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_pspec_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_pspec_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_pspec_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const int32_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_pspec_result__isset { + _ThriftHiveMetastore_get_partitions_pspec_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_pspec_result__isset; + +class ThriftHiveMetastore_get_partitions_pspec_result { + public: + + ThriftHiveMetastore_get_partitions_pspec_result(const ThriftHiveMetastore_get_partitions_pspec_result&); + ThriftHiveMetastore_get_partitions_pspec_result& operator=(const ThriftHiveMetastore_get_partitions_pspec_result&); + ThriftHiveMetastore_get_partitions_pspec_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_pspec_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_pspec_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_pspec_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_pspec_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_pspec_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_pspec_presult__isset { + _ThriftHiveMetastore_get_partitions_pspec_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_pspec_presult__isset; + +class ThriftHiveMetastore_get_partitions_pspec_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_pspec_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_pspec_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_args__isset { + _ThriftHiveMetastore_get_partition_names_args__isset() : db_name(false), tbl_name(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partition_names_args__isset; + +class ThriftHiveMetastore_get_partition_names_args { + public: + + ThriftHiveMetastore_get_partition_names_args(const ThriftHiveMetastore_get_partition_names_args&); + ThriftHiveMetastore_get_partition_names_args& operator=(const ThriftHiveMetastore_get_partition_names_args&); + ThriftHiveMetastore_get_partition_names_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_args() noexcept; + std::string db_name; + std::string tbl_name; + int16_t max_parts; + + _ThriftHiveMetastore_get_partition_names_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_max_parts(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_names_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const int16_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_result__isset { + _ThriftHiveMetastore_get_partition_names_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_result__isset; + +class ThriftHiveMetastore_get_partition_names_result { + public: + + ThriftHiveMetastore_get_partition_names_result(const ThriftHiveMetastore_get_partition_names_result&); + ThriftHiveMetastore_get_partition_names_result& operator=(const ThriftHiveMetastore_get_partition_names_result&); + ThriftHiveMetastore_get_partition_names_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partition_names_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_presult__isset { + _ThriftHiveMetastore_get_partition_names_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_presult__isset; + +class ThriftHiveMetastore_get_partition_names_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partition_names_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_fetch_partition_names_req_args__isset { + _ThriftHiveMetastore_fetch_partition_names_req_args__isset() : partitionReq(false) {} + bool partitionReq :1; +} _ThriftHiveMetastore_fetch_partition_names_req_args__isset; + +class ThriftHiveMetastore_fetch_partition_names_req_args { + public: + + ThriftHiveMetastore_fetch_partition_names_req_args(const ThriftHiveMetastore_fetch_partition_names_req_args&); + ThriftHiveMetastore_fetch_partition_names_req_args& operator=(const ThriftHiveMetastore_fetch_partition_names_req_args&); + ThriftHiveMetastore_fetch_partition_names_req_args() noexcept; + + virtual ~ThriftHiveMetastore_fetch_partition_names_req_args() noexcept; + PartitionsRequest partitionReq; + + _ThriftHiveMetastore_fetch_partition_names_req_args__isset __isset; + + void __set_partitionReq(const PartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_fetch_partition_names_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_fetch_partition_names_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_fetch_partition_names_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_fetch_partition_names_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_fetch_partition_names_req_pargs() noexcept; + const PartitionsRequest* partitionReq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_fetch_partition_names_req_result__isset { + _ThriftHiveMetastore_fetch_partition_names_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_fetch_partition_names_req_result__isset; + +class ThriftHiveMetastore_fetch_partition_names_req_result { + public: + + ThriftHiveMetastore_fetch_partition_names_req_result(const ThriftHiveMetastore_fetch_partition_names_req_result&); + ThriftHiveMetastore_fetch_partition_names_req_result& operator=(const ThriftHiveMetastore_fetch_partition_names_req_result&); + ThriftHiveMetastore_fetch_partition_names_req_result() noexcept; + + virtual ~ThriftHiveMetastore_fetch_partition_names_req_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_fetch_partition_names_req_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_fetch_partition_names_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_fetch_partition_names_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_fetch_partition_names_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_fetch_partition_names_req_presult__isset { + _ThriftHiveMetastore_fetch_partition_names_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_fetch_partition_names_req_presult__isset; + +class ThriftHiveMetastore_fetch_partition_names_req_presult { + public: + + + virtual ~ThriftHiveMetastore_fetch_partition_names_req_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_fetch_partition_names_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_values_args__isset { + _ThriftHiveMetastore_get_partition_values_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_partition_values_args__isset; + +class ThriftHiveMetastore_get_partition_values_args { + public: + + ThriftHiveMetastore_get_partition_values_args(const ThriftHiveMetastore_get_partition_values_args&); + ThriftHiveMetastore_get_partition_values_args& operator=(const ThriftHiveMetastore_get_partition_values_args&); + ThriftHiveMetastore_get_partition_values_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_values_args() noexcept; + PartitionValuesRequest request; + + _ThriftHiveMetastore_get_partition_values_args__isset __isset; + + void __set_request(const PartitionValuesRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partition_values_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_values_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_values_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_values_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_values_pargs() noexcept; + const PartitionValuesRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_values_result__isset { + _ThriftHiveMetastore_get_partition_values_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_values_result__isset; + +class ThriftHiveMetastore_get_partition_values_result { + public: + + ThriftHiveMetastore_get_partition_values_result(const ThriftHiveMetastore_get_partition_values_result&); + ThriftHiveMetastore_get_partition_values_result& operator=(const ThriftHiveMetastore_get_partition_values_result&); + ThriftHiveMetastore_get_partition_values_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_values_result() noexcept; + PartitionValuesResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_values_result__isset __isset; + + void __set_success(const PartitionValuesResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_values_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_values_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_values_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_values_presult__isset { + _ThriftHiveMetastore_get_partition_values_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_values_presult__isset; + +class ThriftHiveMetastore_get_partition_values_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_values_presult() noexcept; + PartitionValuesResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_values_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_args__isset { + _ThriftHiveMetastore_get_partitions_ps_args__isset() : db_name(false), tbl_name(false), part_vals(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partitions_ps_args__isset; + +class ThriftHiveMetastore_get_partitions_ps_args { + public: + + ThriftHiveMetastore_get_partitions_ps_args(const ThriftHiveMetastore_get_partitions_ps_args&); + ThriftHiveMetastore_get_partitions_ps_args& operator=(const ThriftHiveMetastore_get_partitions_ps_args&); + ThriftHiveMetastore_get_partitions_ps_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + int16_t max_parts; + + _ThriftHiveMetastore_get_partitions_ps_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_max_parts(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_ps_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const int16_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_result__isset { + _ThriftHiveMetastore_get_partitions_ps_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_result__isset; + +class ThriftHiveMetastore_get_partitions_ps_result { + public: + + ThriftHiveMetastore_get_partitions_ps_result(const ThriftHiveMetastore_get_partitions_ps_result&); + ThriftHiveMetastore_get_partitions_ps_result& operator=(const ThriftHiveMetastore_get_partitions_ps_result&); + ThriftHiveMetastore_get_partitions_ps_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_ps_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_presult__isset { + _ThriftHiveMetastore_get_partitions_ps_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_presult__isset; + +class ThriftHiveMetastore_get_partitions_ps_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_ps_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_args__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_args__isset() : db_name(false), tbl_name(false), part_vals(false), max_parts(true), user_name(false), group_names(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool max_parts :1; + bool user_name :1; + bool group_names :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_args__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_args { + public: + + ThriftHiveMetastore_get_partitions_ps_with_auth_args(const ThriftHiveMetastore_get_partitions_ps_with_auth_args&); + ThriftHiveMetastore_get_partitions_ps_with_auth_args& operator=(const ThriftHiveMetastore_get_partitions_ps_with_auth_args&); + ThriftHiveMetastore_get_partitions_ps_with_auth_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + int16_t max_parts; + std::string user_name; + std::vector group_names; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_max_parts(const int16_t val); + + void __set_user_name(const std::string& val); + + void __set_group_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_with_auth_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_with_auth_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_with_auth_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_ps_with_auth_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const int16_t* max_parts; + const std::string* user_name; + const std::vector * group_names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_result__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_result__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_result { + public: + + ThriftHiveMetastore_get_partitions_ps_with_auth_result(const ThriftHiveMetastore_get_partitions_ps_with_auth_result&); + ThriftHiveMetastore_get_partitions_ps_with_auth_result& operator=(const ThriftHiveMetastore_get_partitions_ps_with_auth_result&); + ThriftHiveMetastore_get_partitions_ps_with_auth_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_with_auth_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_with_auth_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_with_auth_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_presult__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_presult__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_req_args__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_req_args__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_req_args { + public: + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_args(const ThriftHiveMetastore_get_partitions_ps_with_auth_req_args&); + ThriftHiveMetastore_get_partitions_ps_with_auth_req_args& operator=(const ThriftHiveMetastore_get_partitions_ps_with_auth_req_args&); + ThriftHiveMetastore_get_partitions_ps_with_auth_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_req_args() noexcept; + GetPartitionsPsWithAuthRequest req; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_args__isset __isset; + + void __set_req(const GetPartitionsPsWithAuthRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_req_pargs() noexcept; + const GetPartitionsPsWithAuthRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_req_result__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_req_result__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_req_result { + public: + + ThriftHiveMetastore_get_partitions_ps_with_auth_req_result(const ThriftHiveMetastore_get_partitions_ps_with_auth_req_result&); + ThriftHiveMetastore_get_partitions_ps_with_auth_req_result& operator=(const ThriftHiveMetastore_get_partitions_ps_with_auth_req_result&); + ThriftHiveMetastore_get_partitions_ps_with_auth_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_req_result() noexcept; + GetPartitionsPsWithAuthResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_result__isset __isset; + + void __set_success(const GetPartitionsPsWithAuthResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_ps_with_auth_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult__isset { + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult__isset; + +class ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult() noexcept; + GetPartitionsPsWithAuthResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_ps_with_auth_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_args__isset { + _ThriftHiveMetastore_get_partition_names_ps_args__isset() : db_name(false), tbl_name(false), part_vals(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partition_names_ps_args__isset; + +class ThriftHiveMetastore_get_partition_names_ps_args { + public: + + ThriftHiveMetastore_get_partition_names_ps_args(const ThriftHiveMetastore_get_partition_names_ps_args&); + ThriftHiveMetastore_get_partition_names_ps_args& operator=(const ThriftHiveMetastore_get_partition_names_ps_args&); + ThriftHiveMetastore_get_partition_names_ps_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_ps_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + int16_t max_parts; + + _ThriftHiveMetastore_get_partition_names_ps_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_max_parts(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_ps_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_ps_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_ps_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_names_ps_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_ps_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const int16_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_result__isset { + _ThriftHiveMetastore_get_partition_names_ps_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_ps_result__isset; + +class ThriftHiveMetastore_get_partition_names_ps_result { + public: + + ThriftHiveMetastore_get_partition_names_ps_result(const ThriftHiveMetastore_get_partition_names_ps_result&); + ThriftHiveMetastore_get_partition_names_ps_result& operator=(const ThriftHiveMetastore_get_partition_names_ps_result&); + ThriftHiveMetastore_get_partition_names_ps_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_ps_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_ps_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_ps_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_ps_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_ps_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_presult__isset { + _ThriftHiveMetastore_get_partition_names_ps_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_ps_presult__isset; + +class ThriftHiveMetastore_get_partition_names_ps_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_ps_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_ps_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_req_args__isset { + _ThriftHiveMetastore_get_partition_names_ps_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partition_names_ps_req_args__isset; + +class ThriftHiveMetastore_get_partition_names_ps_req_args { + public: + + ThriftHiveMetastore_get_partition_names_ps_req_args(const ThriftHiveMetastore_get_partition_names_ps_req_args&); + ThriftHiveMetastore_get_partition_names_ps_req_args& operator=(const ThriftHiveMetastore_get_partition_names_ps_req_args&); + ThriftHiveMetastore_get_partition_names_ps_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_ps_req_args() noexcept; + GetPartitionNamesPsRequest req; + + _ThriftHiveMetastore_get_partition_names_ps_req_args__isset __isset; + + void __set_req(const GetPartitionNamesPsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_ps_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_ps_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_ps_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_names_ps_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_ps_req_pargs() noexcept; + const GetPartitionNamesPsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_req_result__isset { + _ThriftHiveMetastore_get_partition_names_ps_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_ps_req_result__isset; + +class ThriftHiveMetastore_get_partition_names_ps_req_result { + public: + + ThriftHiveMetastore_get_partition_names_ps_req_result(const ThriftHiveMetastore_get_partition_names_ps_req_result&); + ThriftHiveMetastore_get_partition_names_ps_req_result& operator=(const ThriftHiveMetastore_get_partition_names_ps_req_result&); + ThriftHiveMetastore_get_partition_names_ps_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_ps_req_result() noexcept; + GetPartitionNamesPsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_ps_req_result__isset __isset; + + void __set_success(const GetPartitionNamesPsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_ps_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_ps_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_ps_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_ps_req_presult__isset { + _ThriftHiveMetastore_get_partition_names_ps_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_ps_req_presult__isset; + +class ThriftHiveMetastore_get_partition_names_ps_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_ps_req_presult() noexcept; + GetPartitionNamesPsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_ps_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_req_args__isset { + _ThriftHiveMetastore_get_partition_names_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partition_names_req_args__isset; + +class ThriftHiveMetastore_get_partition_names_req_args { + public: + + ThriftHiveMetastore_get_partition_names_req_args(const ThriftHiveMetastore_get_partition_names_req_args&); + ThriftHiveMetastore_get_partition_names_req_args& operator=(const ThriftHiveMetastore_get_partition_names_req_args&); + ThriftHiveMetastore_get_partition_names_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_req_args() noexcept; + PartitionsByExprRequest req; + + _ThriftHiveMetastore_get_partition_names_req_args__isset __isset; + + void __set_req(const PartitionsByExprRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_names_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_req_pargs() noexcept; + const PartitionsByExprRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_req_result__isset { + _ThriftHiveMetastore_get_partition_names_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_req_result__isset; + +class ThriftHiveMetastore_get_partition_names_req_result { + public: + + ThriftHiveMetastore_get_partition_names_req_result(const ThriftHiveMetastore_get_partition_names_req_result&); + ThriftHiveMetastore_get_partition_names_req_result& operator=(const ThriftHiveMetastore_get_partition_names_req_result&); + ThriftHiveMetastore_get_partition_names_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_names_req_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_req_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_names_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_names_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_names_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_names_req_presult__isset { + _ThriftHiveMetastore_get_partition_names_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partition_names_req_presult__isset; + +class ThriftHiveMetastore_get_partition_names_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_names_req_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partition_names_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_args__isset { + _ThriftHiveMetastore_get_partitions_by_filter_args__isset() : db_name(false), tbl_name(false), filter(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool filter :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_partitions_by_filter_args__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_args { + public: + + ThriftHiveMetastore_get_partitions_by_filter_args(const ThriftHiveMetastore_get_partitions_by_filter_args&); + ThriftHiveMetastore_get_partitions_by_filter_args& operator=(const ThriftHiveMetastore_get_partitions_by_filter_args&); + ThriftHiveMetastore_get_partitions_by_filter_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string filter; + int16_t max_parts; + + _ThriftHiveMetastore_get_partitions_by_filter_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_filter(const std::string& val); + + void __set_max_parts(const int16_t val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_filter_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_filter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_filter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_by_filter_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* filter; + const int16_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_result__isset { + _ThriftHiveMetastore_get_partitions_by_filter_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_filter_result__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_result { + public: + + ThriftHiveMetastore_get_partitions_by_filter_result(const ThriftHiveMetastore_get_partitions_by_filter_result&); + ThriftHiveMetastore_get_partitions_by_filter_result& operator=(const ThriftHiveMetastore_get_partitions_by_filter_result&); + ThriftHiveMetastore_get_partitions_by_filter_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_filter_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_filter_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_filter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_filter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_presult__isset { + _ThriftHiveMetastore_get_partitions_by_filter_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_filter_presult__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_filter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_req_args__isset { + _ThriftHiveMetastore_get_partitions_by_filter_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_by_filter_req_args__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_req_args { + public: + + ThriftHiveMetastore_get_partitions_by_filter_req_args(const ThriftHiveMetastore_get_partitions_by_filter_req_args&); + ThriftHiveMetastore_get_partitions_by_filter_req_args& operator=(const ThriftHiveMetastore_get_partitions_by_filter_req_args&); + ThriftHiveMetastore_get_partitions_by_filter_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_req_args() noexcept; + GetPartitionsByFilterRequest req; + + _ThriftHiveMetastore_get_partitions_by_filter_req_args__isset __isset; + + void __set_req(const GetPartitionsByFilterRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_filter_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_filter_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_filter_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_by_filter_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_req_pargs() noexcept; + const GetPartitionsByFilterRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_req_result__isset { + _ThriftHiveMetastore_get_partitions_by_filter_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_filter_req_result__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_req_result { + public: + + ThriftHiveMetastore_get_partitions_by_filter_req_result(const ThriftHiveMetastore_get_partitions_by_filter_req_result&); + ThriftHiveMetastore_get_partitions_by_filter_req_result& operator=(const ThriftHiveMetastore_get_partitions_by_filter_req_result&); + ThriftHiveMetastore_get_partitions_by_filter_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_req_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_filter_req_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_filter_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_filter_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_filter_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_filter_req_presult__isset { + _ThriftHiveMetastore_get_partitions_by_filter_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_filter_req_presult__isset; + +class ThriftHiveMetastore_get_partitions_by_filter_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_filter_req_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_filter_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_part_specs_by_filter_args__isset { + _ThriftHiveMetastore_get_part_specs_by_filter_args__isset() : db_name(false), tbl_name(false), filter(false), max_parts(true) {} + bool db_name :1; + bool tbl_name :1; + bool filter :1; + bool max_parts :1; +} _ThriftHiveMetastore_get_part_specs_by_filter_args__isset; + +class ThriftHiveMetastore_get_part_specs_by_filter_args { + public: + + ThriftHiveMetastore_get_part_specs_by_filter_args(const ThriftHiveMetastore_get_part_specs_by_filter_args&); + ThriftHiveMetastore_get_part_specs_by_filter_args& operator=(const ThriftHiveMetastore_get_part_specs_by_filter_args&); + ThriftHiveMetastore_get_part_specs_by_filter_args() noexcept; + + virtual ~ThriftHiveMetastore_get_part_specs_by_filter_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string filter; + int32_t max_parts; + + _ThriftHiveMetastore_get_part_specs_by_filter_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_filter(const std::string& val); + + void __set_max_parts(const int32_t val); + + bool operator == (const ThriftHiveMetastore_get_part_specs_by_filter_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_part_specs_by_filter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_part_specs_by_filter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_part_specs_by_filter_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_part_specs_by_filter_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* filter; + const int32_t* max_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_part_specs_by_filter_result__isset { + _ThriftHiveMetastore_get_part_specs_by_filter_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_part_specs_by_filter_result__isset; + +class ThriftHiveMetastore_get_part_specs_by_filter_result { + public: + + ThriftHiveMetastore_get_part_specs_by_filter_result(const ThriftHiveMetastore_get_part_specs_by_filter_result&); + ThriftHiveMetastore_get_part_specs_by_filter_result& operator=(const ThriftHiveMetastore_get_part_specs_by_filter_result&); + ThriftHiveMetastore_get_part_specs_by_filter_result() noexcept; + + virtual ~ThriftHiveMetastore_get_part_specs_by_filter_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_part_specs_by_filter_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_part_specs_by_filter_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_part_specs_by_filter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_part_specs_by_filter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_part_specs_by_filter_presult__isset { + _ThriftHiveMetastore_get_part_specs_by_filter_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_part_specs_by_filter_presult__isset; + +class ThriftHiveMetastore_get_part_specs_by_filter_presult { + public: + + + virtual ~ThriftHiveMetastore_get_part_specs_by_filter_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_part_specs_by_filter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_expr_args__isset { + _ThriftHiveMetastore_get_partitions_by_expr_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_by_expr_args__isset; + +class ThriftHiveMetastore_get_partitions_by_expr_args { + public: + + ThriftHiveMetastore_get_partitions_by_expr_args(const ThriftHiveMetastore_get_partitions_by_expr_args&); + ThriftHiveMetastore_get_partitions_by_expr_args& operator=(const ThriftHiveMetastore_get_partitions_by_expr_args&); + ThriftHiveMetastore_get_partitions_by_expr_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_expr_args() noexcept; + PartitionsByExprRequest req; + + _ThriftHiveMetastore_get_partitions_by_expr_args__isset __isset; + + void __set_req(const PartitionsByExprRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_expr_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_expr_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_expr_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_by_expr_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_expr_pargs() noexcept; + const PartitionsByExprRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_expr_result__isset { + _ThriftHiveMetastore_get_partitions_by_expr_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_expr_result__isset; + +class ThriftHiveMetastore_get_partitions_by_expr_result { + public: + + ThriftHiveMetastore_get_partitions_by_expr_result(const ThriftHiveMetastore_get_partitions_by_expr_result&); + ThriftHiveMetastore_get_partitions_by_expr_result& operator=(const ThriftHiveMetastore_get_partitions_by_expr_result&); + ThriftHiveMetastore_get_partitions_by_expr_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_expr_result() noexcept; + PartitionsByExprResult success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_expr_result__isset __isset; + + void __set_success(const PartitionsByExprResult& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_expr_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_expr_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_expr_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_expr_presult__isset { + _ThriftHiveMetastore_get_partitions_by_expr_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_by_expr_presult__isset; + +class ThriftHiveMetastore_get_partitions_by_expr_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_expr_presult() noexcept; + PartitionsByExprResult* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_by_expr_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_spec_by_expr_args__isset { + _ThriftHiveMetastore_get_partitions_spec_by_expr_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_spec_by_expr_args__isset; + +class ThriftHiveMetastore_get_partitions_spec_by_expr_args { + public: + + ThriftHiveMetastore_get_partitions_spec_by_expr_args(const ThriftHiveMetastore_get_partitions_spec_by_expr_args&); + ThriftHiveMetastore_get_partitions_spec_by_expr_args& operator=(const ThriftHiveMetastore_get_partitions_spec_by_expr_args&); + ThriftHiveMetastore_get_partitions_spec_by_expr_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_spec_by_expr_args() noexcept; + PartitionsByExprRequest req; + + _ThriftHiveMetastore_get_partitions_spec_by_expr_args__isset __isset; + + void __set_req(const PartitionsByExprRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_spec_by_expr_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_spec_by_expr_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_spec_by_expr_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_spec_by_expr_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_spec_by_expr_pargs() noexcept; + const PartitionsByExprRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_spec_by_expr_result__isset { + _ThriftHiveMetastore_get_partitions_spec_by_expr_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_spec_by_expr_result__isset; + +class ThriftHiveMetastore_get_partitions_spec_by_expr_result { + public: + + ThriftHiveMetastore_get_partitions_spec_by_expr_result(const ThriftHiveMetastore_get_partitions_spec_by_expr_result&); + ThriftHiveMetastore_get_partitions_spec_by_expr_result& operator=(const ThriftHiveMetastore_get_partitions_spec_by_expr_result&); + ThriftHiveMetastore_get_partitions_spec_by_expr_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_spec_by_expr_result() noexcept; + PartitionsSpecByExprResult success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_spec_by_expr_result__isset __isset; + + void __set_success(const PartitionsSpecByExprResult& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_spec_by_expr_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_spec_by_expr_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_spec_by_expr_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_spec_by_expr_presult__isset { + _ThriftHiveMetastore_get_partitions_spec_by_expr_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_spec_by_expr_presult__isset; + +class ThriftHiveMetastore_get_partitions_spec_by_expr_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_spec_by_expr_presult() noexcept; + PartitionsSpecByExprResult* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_partitions_spec_by_expr_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset() : db_name(false), tbl_name(false), filter(false) {} + bool db_name :1; + bool tbl_name :1; + bool filter :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_args { + public: + + ThriftHiveMetastore_get_num_partitions_by_filter_args(const ThriftHiveMetastore_get_num_partitions_by_filter_args&); + ThriftHiveMetastore_get_num_partitions_by_filter_args& operator=(const ThriftHiveMetastore_get_num_partitions_by_filter_args&); + ThriftHiveMetastore_get_num_partitions_by_filter_args() noexcept; + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string filter; + + _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_filter(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_num_partitions_by_filter_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_num_partitions_by_filter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_num_partitions_by_filter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_num_partitions_by_filter_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* filter; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_result { + public: + + ThriftHiveMetastore_get_num_partitions_by_filter_result(const ThriftHiveMetastore_get_num_partitions_by_filter_result&); + ThriftHiveMetastore_get_num_partitions_by_filter_result& operator=(const ThriftHiveMetastore_get_num_partitions_by_filter_result&); + ThriftHiveMetastore_get_num_partitions_by_filter_result() noexcept; + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_result() noexcept; + int32_t success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset __isset; + + void __set_success(const int32_t val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_num_partitions_by_filter_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_num_partitions_by_filter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_num_partitions_by_filter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_presult { + public: + + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_presult() noexcept; + int32_t* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_args__isset { + _ThriftHiveMetastore_get_partitions_by_names_args__isset() : db_name(false), tbl_name(false), names(false) {} + bool db_name :1; + bool tbl_name :1; + bool names :1; +} _ThriftHiveMetastore_get_partitions_by_names_args__isset; + +class ThriftHiveMetastore_get_partitions_by_names_args { + public: + + ThriftHiveMetastore_get_partitions_by_names_args(const ThriftHiveMetastore_get_partitions_by_names_args&); + ThriftHiveMetastore_get_partitions_by_names_args& operator=(const ThriftHiveMetastore_get_partitions_by_names_args&); + ThriftHiveMetastore_get_partitions_by_names_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_names_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector names; + + _ThriftHiveMetastore_get_partitions_by_names_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_names_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_names_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_names_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_by_names_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_names_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_result__isset { + _ThriftHiveMetastore_get_partitions_by_names_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_partitions_by_names_result__isset; + +class ThriftHiveMetastore_get_partitions_by_names_result { + public: + + ThriftHiveMetastore_get_partitions_by_names_result(const ThriftHiveMetastore_get_partitions_by_names_result&); + ThriftHiveMetastore_get_partitions_by_names_result& operator=(const ThriftHiveMetastore_get_partitions_by_names_result&); + ThriftHiveMetastore_get_partitions_by_names_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_names_result() noexcept; + std::vector success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + + _ThriftHiveMetastore_get_partitions_by_names_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_names_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_names_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_names_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_presult__isset { + _ThriftHiveMetastore_get_partitions_by_names_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_partitions_by_names_presult__isset; + +class ThriftHiveMetastore_get_partitions_by_names_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_names_presult() noexcept; + std::vector * success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + + _ThriftHiveMetastore_get_partitions_by_names_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_req_args__isset { + _ThriftHiveMetastore_get_partitions_by_names_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_partitions_by_names_req_args__isset; + +class ThriftHiveMetastore_get_partitions_by_names_req_args { + public: + + ThriftHiveMetastore_get_partitions_by_names_req_args(const ThriftHiveMetastore_get_partitions_by_names_req_args&); + ThriftHiveMetastore_get_partitions_by_names_req_args& operator=(const ThriftHiveMetastore_get_partitions_by_names_req_args&); + ThriftHiveMetastore_get_partitions_by_names_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_names_req_args() noexcept; + GetPartitionsByNamesRequest req; + + _ThriftHiveMetastore_get_partitions_by_names_req_args__isset __isset; + + void __set_req(const GetPartitionsByNamesRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_names_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_names_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_names_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_by_names_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_names_req_pargs() noexcept; + const GetPartitionsByNamesRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_req_result__isset { + _ThriftHiveMetastore_get_partitions_by_names_req_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_partitions_by_names_req_result__isset; + +class ThriftHiveMetastore_get_partitions_by_names_req_result { + public: + + ThriftHiveMetastore_get_partitions_by_names_req_result(const ThriftHiveMetastore_get_partitions_by_names_req_result&); + ThriftHiveMetastore_get_partitions_by_names_req_result& operator=(const ThriftHiveMetastore_get_partitions_by_names_req_result&); + ThriftHiveMetastore_get_partitions_by_names_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_by_names_req_result() noexcept; + GetPartitionsByNamesResult success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + + _ThriftHiveMetastore_get_partitions_by_names_req_result__isset __isset; + + void __set_success(const GetPartitionsByNamesResult& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_by_names_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_by_names_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_by_names_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset { + _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset; + +class ThriftHiveMetastore_get_partitions_by_names_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_by_names_req_presult() noexcept; + GetPartitionsByNamesResult* success; + MetaException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + + _ThriftHiveMetastore_get_partitions_by_names_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_properties_args__isset { + _ThriftHiveMetastore_get_properties_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_properties_args__isset; + +class ThriftHiveMetastore_get_properties_args { + public: + + ThriftHiveMetastore_get_properties_args(const ThriftHiveMetastore_get_properties_args&); + ThriftHiveMetastore_get_properties_args& operator=(const ThriftHiveMetastore_get_properties_args&); + ThriftHiveMetastore_get_properties_args() noexcept; + + virtual ~ThriftHiveMetastore_get_properties_args() noexcept; + PropertyGetRequest req; + + _ThriftHiveMetastore_get_properties_args__isset __isset; + + void __set_req(const PropertyGetRequest& val); + + bool operator == (const ThriftHiveMetastore_get_properties_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_properties_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_properties_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_properties_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_properties_pargs() noexcept; + const PropertyGetRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_properties_result__isset { + _ThriftHiveMetastore_get_properties_result__isset() : success(false), e1(false), e2(false) {} + bool success :1; + bool e1 :1; + bool e2 :1; +} _ThriftHiveMetastore_get_properties_result__isset; + +class ThriftHiveMetastore_get_properties_result { + public: + + ThriftHiveMetastore_get_properties_result(const ThriftHiveMetastore_get_properties_result&); + ThriftHiveMetastore_get_properties_result& operator=(const ThriftHiveMetastore_get_properties_result&); + ThriftHiveMetastore_get_properties_result() noexcept; + + virtual ~ThriftHiveMetastore_get_properties_result() noexcept; + PropertyGetResponse success; + MetaException e1; + NoSuchObjectException e2; + + _ThriftHiveMetastore_get_properties_result__isset __isset; + + void __set_success(const PropertyGetResponse& val); + + void __set_e1(const MetaException& val); + + void __set_e2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_properties_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_properties_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_properties_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_properties_presult__isset { + _ThriftHiveMetastore_get_properties_presult__isset() : success(false), e1(false), e2(false) {} + bool success :1; + bool e1 :1; + bool e2 :1; +} _ThriftHiveMetastore_get_properties_presult__isset; + +class ThriftHiveMetastore_get_properties_presult { + public: + + + virtual ~ThriftHiveMetastore_get_properties_presult() noexcept; + PropertyGetResponse* success; + MetaException e1; + NoSuchObjectException e2; + + _ThriftHiveMetastore_get_properties_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_set_properties_args__isset { + _ThriftHiveMetastore_set_properties_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_set_properties_args__isset; + +class ThriftHiveMetastore_set_properties_args { + public: + + ThriftHiveMetastore_set_properties_args(const ThriftHiveMetastore_set_properties_args&); + ThriftHiveMetastore_set_properties_args& operator=(const ThriftHiveMetastore_set_properties_args&); + ThriftHiveMetastore_set_properties_args() noexcept; + + virtual ~ThriftHiveMetastore_set_properties_args() noexcept; + PropertySetRequest req; + + _ThriftHiveMetastore_set_properties_args__isset __isset; + + void __set_req(const PropertySetRequest& val); + + bool operator == (const ThriftHiveMetastore_set_properties_args & rhs) const; + bool operator != (const ThriftHiveMetastore_set_properties_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_properties_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_properties_pargs { + public: + + + virtual ~ThriftHiveMetastore_set_properties_pargs() noexcept; + const PropertySetRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_properties_result__isset { + _ThriftHiveMetastore_set_properties_result__isset() : success(false), e1(false), e2(false) {} + bool success :1; + bool e1 :1; + bool e2 :1; +} _ThriftHiveMetastore_set_properties_result__isset; + +class ThriftHiveMetastore_set_properties_result { + public: + + ThriftHiveMetastore_set_properties_result(const ThriftHiveMetastore_set_properties_result&); + ThriftHiveMetastore_set_properties_result& operator=(const ThriftHiveMetastore_set_properties_result&); + ThriftHiveMetastore_set_properties_result() noexcept; + + virtual ~ThriftHiveMetastore_set_properties_result() noexcept; + bool success; + MetaException e1; + NoSuchObjectException e2; + + _ThriftHiveMetastore_set_properties_result__isset __isset; + + void __set_success(const bool val); + + void __set_e1(const MetaException& val); + + void __set_e2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_set_properties_result & rhs) const; + bool operator != (const ThriftHiveMetastore_set_properties_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_properties_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_properties_presult__isset { + _ThriftHiveMetastore_set_properties_presult__isset() : success(false), e1(false), e2(false) {} + bool success :1; + bool e1 :1; + bool e2 :1; +} _ThriftHiveMetastore_set_properties_presult__isset; + +class ThriftHiveMetastore_set_properties_presult { + public: + + + virtual ~ThriftHiveMetastore_set_properties_presult() noexcept; + bool* success; + MetaException e1; + NoSuchObjectException e2; + + _ThriftHiveMetastore_set_properties_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_args__isset { + _ThriftHiveMetastore_alter_partition_args__isset() : db_name(false), tbl_name(false), new_part(false) {} + bool db_name :1; + bool tbl_name :1; + bool new_part :1; +} _ThriftHiveMetastore_alter_partition_args__isset; + +class ThriftHiveMetastore_alter_partition_args { + public: + + ThriftHiveMetastore_alter_partition_args(const ThriftHiveMetastore_alter_partition_args&); + ThriftHiveMetastore_alter_partition_args& operator=(const ThriftHiveMetastore_alter_partition_args&); + ThriftHiveMetastore_alter_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_partition_args() noexcept; + std::string db_name; + std::string tbl_name; + Partition new_part; + + _ThriftHiveMetastore_alter_partition_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_part(const Partition& val); + + bool operator == (const ThriftHiveMetastore_alter_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_partition_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const Partition* new_part; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_result__isset { + _ThriftHiveMetastore_alter_partition_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partition_result__isset; + +class ThriftHiveMetastore_alter_partition_result { + public: + + ThriftHiveMetastore_alter_partition_result(const ThriftHiveMetastore_alter_partition_result&); + ThriftHiveMetastore_alter_partition_result& operator=(const ThriftHiveMetastore_alter_partition_result&); + ThriftHiveMetastore_alter_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_partition_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partition_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_presult__isset { + _ThriftHiveMetastore_alter_partition_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partition_presult__isset; + +class ThriftHiveMetastore_alter_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_partition_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_args__isset { + _ThriftHiveMetastore_alter_partitions_args__isset() : db_name(false), tbl_name(false), new_parts(false) {} + bool db_name :1; + bool tbl_name :1; + bool new_parts :1; +} _ThriftHiveMetastore_alter_partitions_args__isset; + +class ThriftHiveMetastore_alter_partitions_args { + public: + + ThriftHiveMetastore_alter_partitions_args(const ThriftHiveMetastore_alter_partitions_args&); + ThriftHiveMetastore_alter_partitions_args& operator=(const ThriftHiveMetastore_alter_partitions_args&); + ThriftHiveMetastore_alter_partitions_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector new_parts; + + _ThriftHiveMetastore_alter_partitions_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_parts(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_partitions_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * new_parts; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_result__isset { + _ThriftHiveMetastore_alter_partitions_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_result__isset; + +class ThriftHiveMetastore_alter_partitions_result { + public: + + ThriftHiveMetastore_alter_partitions_result(const ThriftHiveMetastore_alter_partitions_result&); + ThriftHiveMetastore_alter_partitions_result& operator=(const ThriftHiveMetastore_alter_partitions_result&); + ThriftHiveMetastore_alter_partitions_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_presult__isset { + _ThriftHiveMetastore_alter_partitions_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_presult__isset; + +class ThriftHiveMetastore_alter_partitions_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_with_environment_context_args__isset { + _ThriftHiveMetastore_alter_partitions_with_environment_context_args__isset() : db_name(false), tbl_name(false), new_parts(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool new_parts :1; + bool environment_context :1; +} _ThriftHiveMetastore_alter_partitions_with_environment_context_args__isset; + +class ThriftHiveMetastore_alter_partitions_with_environment_context_args { + public: + + ThriftHiveMetastore_alter_partitions_with_environment_context_args(const ThriftHiveMetastore_alter_partitions_with_environment_context_args&); + ThriftHiveMetastore_alter_partitions_with_environment_context_args& operator=(const ThriftHiveMetastore_alter_partitions_with_environment_context_args&); + ThriftHiveMetastore_alter_partitions_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector new_parts; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_alter_partitions_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_parts(const std::vector & val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_partitions_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * new_parts; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_with_environment_context_result__isset { + _ThriftHiveMetastore_alter_partitions_with_environment_context_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_with_environment_context_result__isset; + +class ThriftHiveMetastore_alter_partitions_with_environment_context_result { + public: + + ThriftHiveMetastore_alter_partitions_with_environment_context_result(const ThriftHiveMetastore_alter_partitions_with_environment_context_result&); + ThriftHiveMetastore_alter_partitions_with_environment_context_result& operator=(const ThriftHiveMetastore_alter_partitions_with_environment_context_result&); + ThriftHiveMetastore_alter_partitions_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_with_environment_context_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_with_environment_context_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_with_environment_context_presult__isset { + _ThriftHiveMetastore_alter_partitions_with_environment_context_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_with_environment_context_presult__isset; + +class ThriftHiveMetastore_alter_partitions_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_with_environment_context_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_req_args__isset { + _ThriftHiveMetastore_alter_partitions_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_alter_partitions_req_args__isset; + +class ThriftHiveMetastore_alter_partitions_req_args { + public: + + ThriftHiveMetastore_alter_partitions_req_args(const ThriftHiveMetastore_alter_partitions_req_args&); + ThriftHiveMetastore_alter_partitions_req_args& operator=(const ThriftHiveMetastore_alter_partitions_req_args&); + ThriftHiveMetastore_alter_partitions_req_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_req_args() noexcept; + AlterPartitionsRequest req; + + _ThriftHiveMetastore_alter_partitions_req_args__isset __isset; + + void __set_req(const AlterPartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_partitions_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_req_pargs() noexcept; + const AlterPartitionsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_req_result__isset { + _ThriftHiveMetastore_alter_partitions_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_req_result__isset; + +class ThriftHiveMetastore_alter_partitions_req_result { + public: + + ThriftHiveMetastore_alter_partitions_req_result(const ThriftHiveMetastore_alter_partitions_req_result&); + ThriftHiveMetastore_alter_partitions_req_result& operator=(const ThriftHiveMetastore_alter_partitions_req_result&); + ThriftHiveMetastore_alter_partitions_req_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_partitions_req_result() noexcept; + AlterPartitionsResponse success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_req_result__isset __isset; + + void __set_success(const AlterPartitionsResponse& val); + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_partitions_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partitions_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partitions_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partitions_req_presult__isset { + _ThriftHiveMetastore_alter_partitions_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partitions_req_presult__isset; + +class ThriftHiveMetastore_alter_partitions_req_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_partitions_req_presult() noexcept; + AlterPartitionsResponse* success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partitions_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_with_environment_context_args__isset { + _ThriftHiveMetastore_alter_partition_with_environment_context_args__isset() : db_name(false), tbl_name(false), new_part(false), environment_context(false) {} + bool db_name :1; + bool tbl_name :1; + bool new_part :1; + bool environment_context :1; +} _ThriftHiveMetastore_alter_partition_with_environment_context_args__isset; + +class ThriftHiveMetastore_alter_partition_with_environment_context_args { + public: + + ThriftHiveMetastore_alter_partition_with_environment_context_args(const ThriftHiveMetastore_alter_partition_with_environment_context_args&); + ThriftHiveMetastore_alter_partition_with_environment_context_args& operator=(const ThriftHiveMetastore_alter_partition_with_environment_context_args&); + ThriftHiveMetastore_alter_partition_with_environment_context_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_partition_with_environment_context_args() noexcept; + std::string db_name; + std::string tbl_name; + Partition new_part; + EnvironmentContext environment_context; + + _ThriftHiveMetastore_alter_partition_with_environment_context_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_new_part(const Partition& val); + + void __set_environment_context(const EnvironmentContext& val); + + bool operator == (const ThriftHiveMetastore_alter_partition_with_environment_context_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partition_with_environment_context_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partition_with_environment_context_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_partition_with_environment_context_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_partition_with_environment_context_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const Partition* new_part; + const EnvironmentContext* environment_context; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_with_environment_context_result__isset { + _ThriftHiveMetastore_alter_partition_with_environment_context_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partition_with_environment_context_result__isset; + +class ThriftHiveMetastore_alter_partition_with_environment_context_result { + public: + + ThriftHiveMetastore_alter_partition_with_environment_context_result(const ThriftHiveMetastore_alter_partition_with_environment_context_result&); + ThriftHiveMetastore_alter_partition_with_environment_context_result& operator=(const ThriftHiveMetastore_alter_partition_with_environment_context_result&); + ThriftHiveMetastore_alter_partition_with_environment_context_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_partition_with_environment_context_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partition_with_environment_context_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_partition_with_environment_context_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_partition_with_environment_context_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_partition_with_environment_context_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_partition_with_environment_context_presult__isset { + _ThriftHiveMetastore_alter_partition_with_environment_context_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_partition_with_environment_context_presult__isset; + +class ThriftHiveMetastore_alter_partition_with_environment_context_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_partition_with_environment_context_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_partition_with_environment_context_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_args__isset { + _ThriftHiveMetastore_rename_partition_args__isset() : db_name(false), tbl_name(false), part_vals(false), new_part(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool new_part :1; +} _ThriftHiveMetastore_rename_partition_args__isset; + +class ThriftHiveMetastore_rename_partition_args { + public: + + ThriftHiveMetastore_rename_partition_args(const ThriftHiveMetastore_rename_partition_args&); + ThriftHiveMetastore_rename_partition_args& operator=(const ThriftHiveMetastore_rename_partition_args&); + ThriftHiveMetastore_rename_partition_args() noexcept; + + virtual ~ThriftHiveMetastore_rename_partition_args() noexcept; + std::string db_name; + std::string tbl_name; + std::vector part_vals; + Partition new_part; + + _ThriftHiveMetastore_rename_partition_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::vector & val); + + void __set_new_part(const Partition& val); + + bool operator == (const ThriftHiveMetastore_rename_partition_args & rhs) const; + bool operator != (const ThriftHiveMetastore_rename_partition_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_rename_partition_pargs { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::vector * part_vals; + const Partition* new_part; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_result__isset { + _ThriftHiveMetastore_rename_partition_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_rename_partition_result__isset; + +class ThriftHiveMetastore_rename_partition_result { + public: + + ThriftHiveMetastore_rename_partition_result(const ThriftHiveMetastore_rename_partition_result&); + ThriftHiveMetastore_rename_partition_result& operator=(const ThriftHiveMetastore_rename_partition_result&); + ThriftHiveMetastore_rename_partition_result() noexcept; + + virtual ~ThriftHiveMetastore_rename_partition_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_rename_partition_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_rename_partition_result & rhs) const; + bool operator != (const ThriftHiveMetastore_rename_partition_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_presult__isset { + _ThriftHiveMetastore_rename_partition_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_rename_partition_presult__isset; + +class ThriftHiveMetastore_rename_partition_presult { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_rename_partition_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_req_args__isset { + _ThriftHiveMetastore_rename_partition_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_rename_partition_req_args__isset; + +class ThriftHiveMetastore_rename_partition_req_args { + public: + + ThriftHiveMetastore_rename_partition_req_args(const ThriftHiveMetastore_rename_partition_req_args&); + ThriftHiveMetastore_rename_partition_req_args& operator=(const ThriftHiveMetastore_rename_partition_req_args&); + ThriftHiveMetastore_rename_partition_req_args() noexcept; + + virtual ~ThriftHiveMetastore_rename_partition_req_args() noexcept; + RenamePartitionRequest req; + + _ThriftHiveMetastore_rename_partition_req_args__isset __isset; + + void __set_req(const RenamePartitionRequest& val); + + bool operator == (const ThriftHiveMetastore_rename_partition_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_rename_partition_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_rename_partition_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_req_pargs() noexcept; + const RenamePartitionRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_req_result__isset { + _ThriftHiveMetastore_rename_partition_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_rename_partition_req_result__isset; + +class ThriftHiveMetastore_rename_partition_req_result { + public: + + ThriftHiveMetastore_rename_partition_req_result(const ThriftHiveMetastore_rename_partition_req_result&); + ThriftHiveMetastore_rename_partition_req_result& operator=(const ThriftHiveMetastore_rename_partition_req_result&); + ThriftHiveMetastore_rename_partition_req_result() noexcept; + + virtual ~ThriftHiveMetastore_rename_partition_req_result() noexcept; + RenamePartitionResponse success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_rename_partition_req_result__isset __isset; + + void __set_success(const RenamePartitionResponse& val); + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_rename_partition_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_rename_partition_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_rename_partition_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_rename_partition_req_presult__isset { + _ThriftHiveMetastore_rename_partition_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_rename_partition_req_presult__isset; + +class ThriftHiveMetastore_rename_partition_req_presult { + public: + + + virtual ~ThriftHiveMetastore_rename_partition_req_presult() noexcept; + RenamePartitionResponse* success; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_rename_partition_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset() : part_vals(false), throw_exception(false) {} + bool part_vals :1; + bool throw_exception :1; +} _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_args { + public: + + ThriftHiveMetastore_partition_name_has_valid_characters_args(const ThriftHiveMetastore_partition_name_has_valid_characters_args&); + ThriftHiveMetastore_partition_name_has_valid_characters_args& operator=(const ThriftHiveMetastore_partition_name_has_valid_characters_args&); + ThriftHiveMetastore_partition_name_has_valid_characters_args() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_args() noexcept; + std::vector part_vals; + bool throw_exception; + + _ThriftHiveMetastore_partition_name_has_valid_characters_args__isset __isset; + + void __set_part_vals(const std::vector & val); + + void __set_throw_exception(const bool val); + + bool operator == (const ThriftHiveMetastore_partition_name_has_valid_characters_args & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_has_valid_characters_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_has_valid_characters_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_partition_name_has_valid_characters_pargs { + public: + + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_pargs() noexcept; + const std::vector * part_vals; + const bool* throw_exception; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_result { + public: + + ThriftHiveMetastore_partition_name_has_valid_characters_result(const ThriftHiveMetastore_partition_name_has_valid_characters_result&); + ThriftHiveMetastore_partition_name_has_valid_characters_result& operator=(const ThriftHiveMetastore_partition_name_has_valid_characters_result&); + ThriftHiveMetastore_partition_name_has_valid_characters_result() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_has_valid_characters_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_partition_name_has_valid_characters_result & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_has_valid_characters_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_has_valid_characters_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset { + _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset; + +class ThriftHiveMetastore_partition_name_has_valid_characters_presult { + public: + + + virtual ~ThriftHiveMetastore_partition_name_has_valid_characters_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_has_valid_characters_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_config_value_args__isset { + _ThriftHiveMetastore_get_config_value_args__isset() : name(false), defaultValue(false) {} + bool name :1; + bool defaultValue :1; +} _ThriftHiveMetastore_get_config_value_args__isset; + +class ThriftHiveMetastore_get_config_value_args { + public: + + ThriftHiveMetastore_get_config_value_args(const ThriftHiveMetastore_get_config_value_args&); + ThriftHiveMetastore_get_config_value_args& operator=(const ThriftHiveMetastore_get_config_value_args&); + ThriftHiveMetastore_get_config_value_args() noexcept; + + virtual ~ThriftHiveMetastore_get_config_value_args() noexcept; + std::string name; + std::string defaultValue; + + _ThriftHiveMetastore_get_config_value_args__isset __isset; + + void __set_name(const std::string& val); + + void __set_defaultValue(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_config_value_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_config_value_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_config_value_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_config_value_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_config_value_pargs() noexcept; + const std::string* name; + const std::string* defaultValue; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_config_value_result__isset { + _ThriftHiveMetastore_get_config_value_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_config_value_result__isset; + +class ThriftHiveMetastore_get_config_value_result { + public: + + ThriftHiveMetastore_get_config_value_result(const ThriftHiveMetastore_get_config_value_result&); + ThriftHiveMetastore_get_config_value_result& operator=(const ThriftHiveMetastore_get_config_value_result&); + ThriftHiveMetastore_get_config_value_result() noexcept; + + virtual ~ThriftHiveMetastore_get_config_value_result() noexcept; + std::string success; + ConfigValSecurityException o1; + + _ThriftHiveMetastore_get_config_value_result__isset __isset; + + void __set_success(const std::string& val); + + void __set_o1(const ConfigValSecurityException& val); + + bool operator == (const ThriftHiveMetastore_get_config_value_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_config_value_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_config_value_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_config_value_presult__isset { + _ThriftHiveMetastore_get_config_value_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_config_value_presult__isset; + +class ThriftHiveMetastore_get_config_value_presult { + public: + + + virtual ~ThriftHiveMetastore_get_config_value_presult() noexcept; + std::string* success; + ConfigValSecurityException o1; + + _ThriftHiveMetastore_get_config_value_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_vals_args__isset { + _ThriftHiveMetastore_partition_name_to_vals_args__isset() : part_name(false) {} + bool part_name :1; +} _ThriftHiveMetastore_partition_name_to_vals_args__isset; + +class ThriftHiveMetastore_partition_name_to_vals_args { + public: + + ThriftHiveMetastore_partition_name_to_vals_args(const ThriftHiveMetastore_partition_name_to_vals_args&); + ThriftHiveMetastore_partition_name_to_vals_args& operator=(const ThriftHiveMetastore_partition_name_to_vals_args&); + ThriftHiveMetastore_partition_name_to_vals_args() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_to_vals_args() noexcept; + std::string part_name; + + _ThriftHiveMetastore_partition_name_to_vals_args__isset __isset; + + void __set_part_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_partition_name_to_vals_args & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_to_vals_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_to_vals_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_partition_name_to_vals_pargs { + public: + + + virtual ~ThriftHiveMetastore_partition_name_to_vals_pargs() noexcept; + const std::string* part_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_vals_result__isset { + _ThriftHiveMetastore_partition_name_to_vals_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_to_vals_result__isset; + +class ThriftHiveMetastore_partition_name_to_vals_result { + public: + + ThriftHiveMetastore_partition_name_to_vals_result(const ThriftHiveMetastore_partition_name_to_vals_result&); + ThriftHiveMetastore_partition_name_to_vals_result& operator=(const ThriftHiveMetastore_partition_name_to_vals_result&); + ThriftHiveMetastore_partition_name_to_vals_result() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_to_vals_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_to_vals_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_partition_name_to_vals_result & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_to_vals_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_to_vals_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_vals_presult__isset { + _ThriftHiveMetastore_partition_name_to_vals_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_to_vals_presult__isset; + +class ThriftHiveMetastore_partition_name_to_vals_presult { + public: + + + virtual ~ThriftHiveMetastore_partition_name_to_vals_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_to_vals_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_spec_args__isset { + _ThriftHiveMetastore_partition_name_to_spec_args__isset() : part_name(false) {} + bool part_name :1; +} _ThriftHiveMetastore_partition_name_to_spec_args__isset; + +class ThriftHiveMetastore_partition_name_to_spec_args { + public: + + ThriftHiveMetastore_partition_name_to_spec_args(const ThriftHiveMetastore_partition_name_to_spec_args&); + ThriftHiveMetastore_partition_name_to_spec_args& operator=(const ThriftHiveMetastore_partition_name_to_spec_args&); + ThriftHiveMetastore_partition_name_to_spec_args() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_to_spec_args() noexcept; + std::string part_name; + + _ThriftHiveMetastore_partition_name_to_spec_args__isset __isset; + + void __set_part_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_partition_name_to_spec_args & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_to_spec_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_to_spec_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_partition_name_to_spec_pargs { + public: + + + virtual ~ThriftHiveMetastore_partition_name_to_spec_pargs() noexcept; + const std::string* part_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_spec_result__isset { + _ThriftHiveMetastore_partition_name_to_spec_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_to_spec_result__isset; + +class ThriftHiveMetastore_partition_name_to_spec_result { + public: + + ThriftHiveMetastore_partition_name_to_spec_result(const ThriftHiveMetastore_partition_name_to_spec_result&); + ThriftHiveMetastore_partition_name_to_spec_result& operator=(const ThriftHiveMetastore_partition_name_to_spec_result&); + ThriftHiveMetastore_partition_name_to_spec_result() noexcept; + + virtual ~ThriftHiveMetastore_partition_name_to_spec_result() noexcept; + std::map success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_to_spec_result__isset __isset; + + void __set_success(const std::map & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_partition_name_to_spec_result & rhs) const; + bool operator != (const ThriftHiveMetastore_partition_name_to_spec_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_partition_name_to_spec_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_partition_name_to_spec_presult__isset { + _ThriftHiveMetastore_partition_name_to_spec_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_partition_name_to_spec_presult__isset; + +class ThriftHiveMetastore_partition_name_to_spec_presult { + public: + + + virtual ~ThriftHiveMetastore_partition_name_to_spec_presult() noexcept; + std::map * success; + MetaException o1; + + _ThriftHiveMetastore_partition_name_to_spec_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_markPartitionForEvent_args__isset { + _ThriftHiveMetastore_markPartitionForEvent_args__isset() : db_name(false), tbl_name(false), part_vals(false), eventType(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool eventType :1; +} _ThriftHiveMetastore_markPartitionForEvent_args__isset; + +class ThriftHiveMetastore_markPartitionForEvent_args { + public: + + ThriftHiveMetastore_markPartitionForEvent_args(const ThriftHiveMetastore_markPartitionForEvent_args&); + ThriftHiveMetastore_markPartitionForEvent_args& operator=(const ThriftHiveMetastore_markPartitionForEvent_args&); + ThriftHiveMetastore_markPartitionForEvent_args() noexcept; + + virtual ~ThriftHiveMetastore_markPartitionForEvent_args() noexcept; + std::string db_name; + std::string tbl_name; + std::map part_vals; + /** + * + * @see PartitionEventType + */ + PartitionEventType::type eventType; + + _ThriftHiveMetastore_markPartitionForEvent_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::map & val); + + void __set_eventType(const PartitionEventType::type val); + + bool operator == (const ThriftHiveMetastore_markPartitionForEvent_args & rhs) const; + bool operator != (const ThriftHiveMetastore_markPartitionForEvent_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_markPartitionForEvent_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_markPartitionForEvent_pargs { + public: + + + virtual ~ThriftHiveMetastore_markPartitionForEvent_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::map * part_vals; + /** + * + * @see PartitionEventType + */ + const PartitionEventType::type* eventType; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_markPartitionForEvent_result__isset { + _ThriftHiveMetastore_markPartitionForEvent_result__isset() : o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; + bool o5 :1; + bool o6 :1; +} _ThriftHiveMetastore_markPartitionForEvent_result__isset; + +class ThriftHiveMetastore_markPartitionForEvent_result { + public: + + ThriftHiveMetastore_markPartitionForEvent_result(const ThriftHiveMetastore_markPartitionForEvent_result&); + ThriftHiveMetastore_markPartitionForEvent_result& operator=(const ThriftHiveMetastore_markPartitionForEvent_result&); + ThriftHiveMetastore_markPartitionForEvent_result() noexcept; + + virtual ~ThriftHiveMetastore_markPartitionForEvent_result() noexcept; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_markPartitionForEvent_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const UnknownDBException& val); + + void __set_o4(const UnknownTableException& val); + + void __set_o5(const UnknownPartitionException& val); + + void __set_o6(const InvalidPartitionException& val); + + bool operator == (const ThriftHiveMetastore_markPartitionForEvent_result & rhs) const; + bool operator != (const ThriftHiveMetastore_markPartitionForEvent_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_markPartitionForEvent_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_markPartitionForEvent_presult__isset { + _ThriftHiveMetastore_markPartitionForEvent_presult__isset() : o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; + bool o5 :1; + bool o6 :1; +} _ThriftHiveMetastore_markPartitionForEvent_presult__isset; + +class ThriftHiveMetastore_markPartitionForEvent_presult { + public: + + + virtual ~ThriftHiveMetastore_markPartitionForEvent_presult() noexcept; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_markPartitionForEvent_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset() : db_name(false), tbl_name(false), part_vals(false), eventType(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_vals :1; + bool eventType :1; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_args { + public: + + ThriftHiveMetastore_isPartitionMarkedForEvent_args(const ThriftHiveMetastore_isPartitionMarkedForEvent_args&); + ThriftHiveMetastore_isPartitionMarkedForEvent_args& operator=(const ThriftHiveMetastore_isPartitionMarkedForEvent_args&); + ThriftHiveMetastore_isPartitionMarkedForEvent_args() noexcept; + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_args() noexcept; + std::string db_name; + std::string tbl_name; + std::map part_vals; + /** + * + * @see PartitionEventType + */ + PartitionEventType::type eventType; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_vals(const std::map & val); + + void __set_eventType(const PartitionEventType::type val); + + bool operator == (const ThriftHiveMetastore_isPartitionMarkedForEvent_args & rhs) const; + bool operator != (const ThriftHiveMetastore_isPartitionMarkedForEvent_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_isPartitionMarkedForEvent_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_isPartitionMarkedForEvent_pargs { + public: + + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::map * part_vals; + /** + * + * @see PartitionEventType + */ + const PartitionEventType::type* eventType; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; + bool o5 :1; + bool o6 :1; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_result { + public: + + ThriftHiveMetastore_isPartitionMarkedForEvent_result(const ThriftHiveMetastore_isPartitionMarkedForEvent_result&); + ThriftHiveMetastore_isPartitionMarkedForEvent_result& operator=(const ThriftHiveMetastore_isPartitionMarkedForEvent_result&); + ThriftHiveMetastore_isPartitionMarkedForEvent_result() noexcept; + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_result() noexcept; + bool success; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const UnknownDBException& val); + + void __set_o4(const UnknownTableException& val); + + void __set_o5(const UnknownPartitionException& val); + + void __set_o6(const InvalidPartitionException& val); + + bool operator == (const ThriftHiveMetastore_isPartitionMarkedForEvent_result & rhs) const; + bool operator != (const ThriftHiveMetastore_isPartitionMarkedForEvent_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_isPartitionMarkedForEvent_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset { + _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false), o5(false), o6(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; + bool o5 :1; + bool o6 :1; +} _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset; + +class ThriftHiveMetastore_isPartitionMarkedForEvent_presult { + public: + + + virtual ~ThriftHiveMetastore_isPartitionMarkedForEvent_presult() noexcept; + bool* success; + MetaException o1; + NoSuchObjectException o2; + UnknownDBException o3; + UnknownTableException o4; + UnknownPartitionException o5; + InvalidPartitionException o6; + + _ThriftHiveMetastore_isPartitionMarkedForEvent_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_primary_keys_args__isset { + _ThriftHiveMetastore_get_primary_keys_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_primary_keys_args__isset; + +class ThriftHiveMetastore_get_primary_keys_args { + public: + + ThriftHiveMetastore_get_primary_keys_args(const ThriftHiveMetastore_get_primary_keys_args&); + ThriftHiveMetastore_get_primary_keys_args& operator=(const ThriftHiveMetastore_get_primary_keys_args&); + ThriftHiveMetastore_get_primary_keys_args() noexcept; + + virtual ~ThriftHiveMetastore_get_primary_keys_args() noexcept; + PrimaryKeysRequest request; + + _ThriftHiveMetastore_get_primary_keys_args__isset __isset; + + void __set_request(const PrimaryKeysRequest& val); + + bool operator == (const ThriftHiveMetastore_get_primary_keys_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_primary_keys_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_primary_keys_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_primary_keys_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_primary_keys_pargs() noexcept; + const PrimaryKeysRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_primary_keys_result__isset { + _ThriftHiveMetastore_get_primary_keys_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_primary_keys_result__isset; + +class ThriftHiveMetastore_get_primary_keys_result { + public: + + ThriftHiveMetastore_get_primary_keys_result(const ThriftHiveMetastore_get_primary_keys_result&); + ThriftHiveMetastore_get_primary_keys_result& operator=(const ThriftHiveMetastore_get_primary_keys_result&); + ThriftHiveMetastore_get_primary_keys_result() noexcept; + + virtual ~ThriftHiveMetastore_get_primary_keys_result() noexcept; + PrimaryKeysResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_primary_keys_result__isset __isset; + + void __set_success(const PrimaryKeysResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_primary_keys_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_primary_keys_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_primary_keys_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_primary_keys_presult__isset { + _ThriftHiveMetastore_get_primary_keys_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_primary_keys_presult__isset; + +class ThriftHiveMetastore_get_primary_keys_presult { + public: + + + virtual ~ThriftHiveMetastore_get_primary_keys_presult() noexcept; + PrimaryKeysResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_primary_keys_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_foreign_keys_args__isset { + _ThriftHiveMetastore_get_foreign_keys_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_foreign_keys_args__isset; + +class ThriftHiveMetastore_get_foreign_keys_args { + public: + + ThriftHiveMetastore_get_foreign_keys_args(const ThriftHiveMetastore_get_foreign_keys_args&); + ThriftHiveMetastore_get_foreign_keys_args& operator=(const ThriftHiveMetastore_get_foreign_keys_args&); + ThriftHiveMetastore_get_foreign_keys_args() noexcept; + + virtual ~ThriftHiveMetastore_get_foreign_keys_args() noexcept; + ForeignKeysRequest request; + + _ThriftHiveMetastore_get_foreign_keys_args__isset __isset; + + void __set_request(const ForeignKeysRequest& val); + + bool operator == (const ThriftHiveMetastore_get_foreign_keys_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_foreign_keys_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_foreign_keys_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_foreign_keys_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_foreign_keys_pargs() noexcept; + const ForeignKeysRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_foreign_keys_result__isset { + _ThriftHiveMetastore_get_foreign_keys_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_foreign_keys_result__isset; + +class ThriftHiveMetastore_get_foreign_keys_result { + public: + + ThriftHiveMetastore_get_foreign_keys_result(const ThriftHiveMetastore_get_foreign_keys_result&); + ThriftHiveMetastore_get_foreign_keys_result& operator=(const ThriftHiveMetastore_get_foreign_keys_result&); + ThriftHiveMetastore_get_foreign_keys_result() noexcept; + + virtual ~ThriftHiveMetastore_get_foreign_keys_result() noexcept; + ForeignKeysResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_foreign_keys_result__isset __isset; + + void __set_success(const ForeignKeysResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_foreign_keys_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_foreign_keys_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_foreign_keys_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_foreign_keys_presult__isset { + _ThriftHiveMetastore_get_foreign_keys_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_foreign_keys_presult__isset; + +class ThriftHiveMetastore_get_foreign_keys_presult { + public: + + + virtual ~ThriftHiveMetastore_get_foreign_keys_presult() noexcept; + ForeignKeysResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_foreign_keys_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_unique_constraints_args__isset { + _ThriftHiveMetastore_get_unique_constraints_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_unique_constraints_args__isset; + +class ThriftHiveMetastore_get_unique_constraints_args { + public: + + ThriftHiveMetastore_get_unique_constraints_args(const ThriftHiveMetastore_get_unique_constraints_args&); + ThriftHiveMetastore_get_unique_constraints_args& operator=(const ThriftHiveMetastore_get_unique_constraints_args&); + ThriftHiveMetastore_get_unique_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_get_unique_constraints_args() noexcept; + UniqueConstraintsRequest request; + + _ThriftHiveMetastore_get_unique_constraints_args__isset __isset; + + void __set_request(const UniqueConstraintsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_unique_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_unique_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_unique_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_unique_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_unique_constraints_pargs() noexcept; + const UniqueConstraintsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_unique_constraints_result__isset { + _ThriftHiveMetastore_get_unique_constraints_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_unique_constraints_result__isset; + +class ThriftHiveMetastore_get_unique_constraints_result { + public: + + ThriftHiveMetastore_get_unique_constraints_result(const ThriftHiveMetastore_get_unique_constraints_result&); + ThriftHiveMetastore_get_unique_constraints_result& operator=(const ThriftHiveMetastore_get_unique_constraints_result&); + ThriftHiveMetastore_get_unique_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_get_unique_constraints_result() noexcept; + UniqueConstraintsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_unique_constraints_result__isset __isset; + + void __set_success(const UniqueConstraintsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_unique_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_unique_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_unique_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_unique_constraints_presult__isset { + _ThriftHiveMetastore_get_unique_constraints_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_unique_constraints_presult__isset; + +class ThriftHiveMetastore_get_unique_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_get_unique_constraints_presult() noexcept; + UniqueConstraintsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_unique_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_not_null_constraints_args__isset { + _ThriftHiveMetastore_get_not_null_constraints_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_not_null_constraints_args__isset; + +class ThriftHiveMetastore_get_not_null_constraints_args { + public: + + ThriftHiveMetastore_get_not_null_constraints_args(const ThriftHiveMetastore_get_not_null_constraints_args&); + ThriftHiveMetastore_get_not_null_constraints_args& operator=(const ThriftHiveMetastore_get_not_null_constraints_args&); + ThriftHiveMetastore_get_not_null_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_get_not_null_constraints_args() noexcept; + NotNullConstraintsRequest request; + + _ThriftHiveMetastore_get_not_null_constraints_args__isset __isset; + + void __set_request(const NotNullConstraintsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_not_null_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_not_null_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_not_null_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_not_null_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_not_null_constraints_pargs() noexcept; + const NotNullConstraintsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_not_null_constraints_result__isset { + _ThriftHiveMetastore_get_not_null_constraints_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_not_null_constraints_result__isset; + +class ThriftHiveMetastore_get_not_null_constraints_result { + public: + + ThriftHiveMetastore_get_not_null_constraints_result(const ThriftHiveMetastore_get_not_null_constraints_result&); + ThriftHiveMetastore_get_not_null_constraints_result& operator=(const ThriftHiveMetastore_get_not_null_constraints_result&); + ThriftHiveMetastore_get_not_null_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_get_not_null_constraints_result() noexcept; + NotNullConstraintsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_not_null_constraints_result__isset __isset; + + void __set_success(const NotNullConstraintsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_not_null_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_not_null_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_not_null_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_not_null_constraints_presult__isset { + _ThriftHiveMetastore_get_not_null_constraints_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_not_null_constraints_presult__isset; + +class ThriftHiveMetastore_get_not_null_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_get_not_null_constraints_presult() noexcept; + NotNullConstraintsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_not_null_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_default_constraints_args__isset { + _ThriftHiveMetastore_get_default_constraints_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_default_constraints_args__isset; + +class ThriftHiveMetastore_get_default_constraints_args { + public: + + ThriftHiveMetastore_get_default_constraints_args(const ThriftHiveMetastore_get_default_constraints_args&); + ThriftHiveMetastore_get_default_constraints_args& operator=(const ThriftHiveMetastore_get_default_constraints_args&); + ThriftHiveMetastore_get_default_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_get_default_constraints_args() noexcept; + DefaultConstraintsRequest request; + + _ThriftHiveMetastore_get_default_constraints_args__isset __isset; + + void __set_request(const DefaultConstraintsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_default_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_default_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_default_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_default_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_default_constraints_pargs() noexcept; + const DefaultConstraintsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_default_constraints_result__isset { + _ThriftHiveMetastore_get_default_constraints_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_default_constraints_result__isset; + +class ThriftHiveMetastore_get_default_constraints_result { + public: + + ThriftHiveMetastore_get_default_constraints_result(const ThriftHiveMetastore_get_default_constraints_result&); + ThriftHiveMetastore_get_default_constraints_result& operator=(const ThriftHiveMetastore_get_default_constraints_result&); + ThriftHiveMetastore_get_default_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_get_default_constraints_result() noexcept; + DefaultConstraintsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_default_constraints_result__isset __isset; + + void __set_success(const DefaultConstraintsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_default_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_default_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_default_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_default_constraints_presult__isset { + _ThriftHiveMetastore_get_default_constraints_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_default_constraints_presult__isset; + +class ThriftHiveMetastore_get_default_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_get_default_constraints_presult() noexcept; + DefaultConstraintsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_default_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_check_constraints_args__isset { + _ThriftHiveMetastore_get_check_constraints_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_check_constraints_args__isset; + +class ThriftHiveMetastore_get_check_constraints_args { + public: + + ThriftHiveMetastore_get_check_constraints_args(const ThriftHiveMetastore_get_check_constraints_args&); + ThriftHiveMetastore_get_check_constraints_args& operator=(const ThriftHiveMetastore_get_check_constraints_args&); + ThriftHiveMetastore_get_check_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_get_check_constraints_args() noexcept; + CheckConstraintsRequest request; + + _ThriftHiveMetastore_get_check_constraints_args__isset __isset; + + void __set_request(const CheckConstraintsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_check_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_check_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_check_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_check_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_check_constraints_pargs() noexcept; + const CheckConstraintsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_check_constraints_result__isset { + _ThriftHiveMetastore_get_check_constraints_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_check_constraints_result__isset; + +class ThriftHiveMetastore_get_check_constraints_result { + public: + + ThriftHiveMetastore_get_check_constraints_result(const ThriftHiveMetastore_get_check_constraints_result&); + ThriftHiveMetastore_get_check_constraints_result& operator=(const ThriftHiveMetastore_get_check_constraints_result&); + ThriftHiveMetastore_get_check_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_get_check_constraints_result() noexcept; + CheckConstraintsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_check_constraints_result__isset __isset; + + void __set_success(const CheckConstraintsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_check_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_check_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_check_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_check_constraints_presult__isset { + _ThriftHiveMetastore_get_check_constraints_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_check_constraints_presult__isset; + +class ThriftHiveMetastore_get_check_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_get_check_constraints_presult() noexcept; + CheckConstraintsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_check_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_table_constraints_args__isset { + _ThriftHiveMetastore_get_all_table_constraints_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_all_table_constraints_args__isset; + +class ThriftHiveMetastore_get_all_table_constraints_args { + public: + + ThriftHiveMetastore_get_all_table_constraints_args(const ThriftHiveMetastore_get_all_table_constraints_args&); + ThriftHiveMetastore_get_all_table_constraints_args& operator=(const ThriftHiveMetastore_get_all_table_constraints_args&); + ThriftHiveMetastore_get_all_table_constraints_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_table_constraints_args() noexcept; + AllTableConstraintsRequest request; + + _ThriftHiveMetastore_get_all_table_constraints_args__isset __isset; + + void __set_request(const AllTableConstraintsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_all_table_constraints_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_table_constraints_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_table_constraints_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_table_constraints_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_table_constraints_pargs() noexcept; + const AllTableConstraintsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_table_constraints_result__isset { + _ThriftHiveMetastore_get_all_table_constraints_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_all_table_constraints_result__isset; + +class ThriftHiveMetastore_get_all_table_constraints_result { + public: + + ThriftHiveMetastore_get_all_table_constraints_result(const ThriftHiveMetastore_get_all_table_constraints_result&); + ThriftHiveMetastore_get_all_table_constraints_result& operator=(const ThriftHiveMetastore_get_all_table_constraints_result&); + ThriftHiveMetastore_get_all_table_constraints_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_table_constraints_result() noexcept; + AllTableConstraintsResponse success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_all_table_constraints_result__isset __isset; + + void __set_success(const AllTableConstraintsResponse& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_all_table_constraints_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_table_constraints_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_table_constraints_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_table_constraints_presult__isset { + _ThriftHiveMetastore_get_all_table_constraints_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_all_table_constraints_presult__isset; + +class ThriftHiveMetastore_get_all_table_constraints_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_table_constraints_presult() noexcept; + AllTableConstraintsResponse* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_all_table_constraints_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_args__isset { + _ThriftHiveMetastore_update_table_column_statistics_args__isset() : stats_obj(false) {} + bool stats_obj :1; +} _ThriftHiveMetastore_update_table_column_statistics_args__isset; + +class ThriftHiveMetastore_update_table_column_statistics_args { + public: + + ThriftHiveMetastore_update_table_column_statistics_args(const ThriftHiveMetastore_update_table_column_statistics_args&); + ThriftHiveMetastore_update_table_column_statistics_args& operator=(const ThriftHiveMetastore_update_table_column_statistics_args&); + ThriftHiveMetastore_update_table_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_update_table_column_statistics_args() noexcept; + ColumnStatistics stats_obj; + + _ThriftHiveMetastore_update_table_column_statistics_args__isset __isset; + + void __set_stats_obj(const ColumnStatistics& val); + + bool operator == (const ThriftHiveMetastore_update_table_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_table_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_table_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_table_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_table_column_statistics_pargs() noexcept; + const ColumnStatistics* stats_obj; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_result__isset { + _ThriftHiveMetastore_update_table_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_table_column_statistics_result__isset; + +class ThriftHiveMetastore_update_table_column_statistics_result { + public: + + ThriftHiveMetastore_update_table_column_statistics_result(const ThriftHiveMetastore_update_table_column_statistics_result&); + ThriftHiveMetastore_update_table_column_statistics_result& operator=(const ThriftHiveMetastore_update_table_column_statistics_result&); + ThriftHiveMetastore_update_table_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_update_table_column_statistics_result() noexcept; + bool success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_table_column_statistics_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_update_table_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_table_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_table_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_presult__isset { + _ThriftHiveMetastore_update_table_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_table_column_statistics_presult__isset; + +class ThriftHiveMetastore_update_table_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_update_table_column_statistics_presult() noexcept; + bool* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_table_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_args__isset { + _ThriftHiveMetastore_update_partition_column_statistics_args__isset() : stats_obj(false) {} + bool stats_obj :1; +} _ThriftHiveMetastore_update_partition_column_statistics_args__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_args { + public: + + ThriftHiveMetastore_update_partition_column_statistics_args(const ThriftHiveMetastore_update_partition_column_statistics_args&); + ThriftHiveMetastore_update_partition_column_statistics_args& operator=(const ThriftHiveMetastore_update_partition_column_statistics_args&); + ThriftHiveMetastore_update_partition_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_args() noexcept; + ColumnStatistics stats_obj; + + _ThriftHiveMetastore_update_partition_column_statistics_args__isset __isset; + + void __set_stats_obj(const ColumnStatistics& val); + + bool operator == (const ThriftHiveMetastore_update_partition_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_partition_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_partition_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_partition_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_pargs() noexcept; + const ColumnStatistics* stats_obj; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_result__isset { + _ThriftHiveMetastore_update_partition_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_partition_column_statistics_result__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_result { + public: + + ThriftHiveMetastore_update_partition_column_statistics_result(const ThriftHiveMetastore_update_partition_column_statistics_result&); + ThriftHiveMetastore_update_partition_column_statistics_result& operator=(const ThriftHiveMetastore_update_partition_column_statistics_result&); + ThriftHiveMetastore_update_partition_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_result() noexcept; + bool success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_partition_column_statistics_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_update_partition_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_partition_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_partition_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_presult__isset { + _ThriftHiveMetastore_update_partition_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_partition_column_statistics_presult__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_presult() noexcept; + bool* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_partition_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_req_args__isset { + _ThriftHiveMetastore_update_table_column_statistics_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_update_table_column_statistics_req_args__isset; + +class ThriftHiveMetastore_update_table_column_statistics_req_args { + public: + + ThriftHiveMetastore_update_table_column_statistics_req_args(const ThriftHiveMetastore_update_table_column_statistics_req_args&); + ThriftHiveMetastore_update_table_column_statistics_req_args& operator=(const ThriftHiveMetastore_update_table_column_statistics_req_args&); + ThriftHiveMetastore_update_table_column_statistics_req_args() noexcept; + + virtual ~ThriftHiveMetastore_update_table_column_statistics_req_args() noexcept; + SetPartitionsStatsRequest req; + + _ThriftHiveMetastore_update_table_column_statistics_req_args__isset __isset; + + void __set_req(const SetPartitionsStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_update_table_column_statistics_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_table_column_statistics_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_table_column_statistics_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_table_column_statistics_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_table_column_statistics_req_pargs() noexcept; + const SetPartitionsStatsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_req_result__isset { + _ThriftHiveMetastore_update_table_column_statistics_req_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_table_column_statistics_req_result__isset; + +class ThriftHiveMetastore_update_table_column_statistics_req_result { + public: + + ThriftHiveMetastore_update_table_column_statistics_req_result(const ThriftHiveMetastore_update_table_column_statistics_req_result&); + ThriftHiveMetastore_update_table_column_statistics_req_result& operator=(const ThriftHiveMetastore_update_table_column_statistics_req_result&); + ThriftHiveMetastore_update_table_column_statistics_req_result() noexcept; + + virtual ~ThriftHiveMetastore_update_table_column_statistics_req_result() noexcept; + SetPartitionsStatsResponse success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_table_column_statistics_req_result__isset __isset; + + void __set_success(const SetPartitionsStatsResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_update_table_column_statistics_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_table_column_statistics_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_table_column_statistics_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_table_column_statistics_req_presult__isset { + _ThriftHiveMetastore_update_table_column_statistics_req_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_table_column_statistics_req_presult__isset; + +class ThriftHiveMetastore_update_table_column_statistics_req_presult { + public: + + + virtual ~ThriftHiveMetastore_update_table_column_statistics_req_presult() noexcept; + SetPartitionsStatsResponse* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_table_column_statistics_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_req_args__isset { + _ThriftHiveMetastore_update_partition_column_statistics_req_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_update_partition_column_statistics_req_args__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_req_args { + public: + + ThriftHiveMetastore_update_partition_column_statistics_req_args(const ThriftHiveMetastore_update_partition_column_statistics_req_args&); + ThriftHiveMetastore_update_partition_column_statistics_req_args& operator=(const ThriftHiveMetastore_update_partition_column_statistics_req_args&); + ThriftHiveMetastore_update_partition_column_statistics_req_args() noexcept; + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_req_args() noexcept; + SetPartitionsStatsRequest req; + + _ThriftHiveMetastore_update_partition_column_statistics_req_args__isset __isset; + + void __set_req(const SetPartitionsStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_update_partition_column_statistics_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_partition_column_statistics_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_partition_column_statistics_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_partition_column_statistics_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_req_pargs() noexcept; + const SetPartitionsStatsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_req_result__isset { + _ThriftHiveMetastore_update_partition_column_statistics_req_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_partition_column_statistics_req_result__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_req_result { + public: + + ThriftHiveMetastore_update_partition_column_statistics_req_result(const ThriftHiveMetastore_update_partition_column_statistics_req_result&); + ThriftHiveMetastore_update_partition_column_statistics_req_result& operator=(const ThriftHiveMetastore_update_partition_column_statistics_req_result&); + ThriftHiveMetastore_update_partition_column_statistics_req_result() noexcept; + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_req_result() noexcept; + SetPartitionsStatsResponse success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_partition_column_statistics_req_result__isset __isset; + + void __set_success(const SetPartitionsStatsResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_update_partition_column_statistics_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_partition_column_statistics_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_partition_column_statistics_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_partition_column_statistics_req_presult__isset { + _ThriftHiveMetastore_update_partition_column_statistics_req_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_update_partition_column_statistics_req_presult__isset; + +class ThriftHiveMetastore_update_partition_column_statistics_req_presult { + public: + + + virtual ~ThriftHiveMetastore_update_partition_column_statistics_req_presult() noexcept; + SetPartitionsStatsResponse* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_update_partition_column_statistics_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_transaction_statistics_args__isset { + _ThriftHiveMetastore_update_transaction_statistics_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_update_transaction_statistics_args__isset; + +class ThriftHiveMetastore_update_transaction_statistics_args { + public: + + ThriftHiveMetastore_update_transaction_statistics_args(const ThriftHiveMetastore_update_transaction_statistics_args&) noexcept; + ThriftHiveMetastore_update_transaction_statistics_args& operator=(const ThriftHiveMetastore_update_transaction_statistics_args&) noexcept; + ThriftHiveMetastore_update_transaction_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_update_transaction_statistics_args() noexcept; + UpdateTransactionalStatsRequest req; + + _ThriftHiveMetastore_update_transaction_statistics_args__isset __isset; + + void __set_req(const UpdateTransactionalStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_update_transaction_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_transaction_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_transaction_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_transaction_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_transaction_statistics_pargs() noexcept; + const UpdateTransactionalStatsRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_transaction_statistics_result__isset { + _ThriftHiveMetastore_update_transaction_statistics_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_update_transaction_statistics_result__isset; + +class ThriftHiveMetastore_update_transaction_statistics_result { + public: + + ThriftHiveMetastore_update_transaction_statistics_result(const ThriftHiveMetastore_update_transaction_statistics_result&); + ThriftHiveMetastore_update_transaction_statistics_result& operator=(const ThriftHiveMetastore_update_transaction_statistics_result&); + ThriftHiveMetastore_update_transaction_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_update_transaction_statistics_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_update_transaction_statistics_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_update_transaction_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_transaction_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_transaction_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_transaction_statistics_presult__isset { + _ThriftHiveMetastore_update_transaction_statistics_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_update_transaction_statistics_presult__isset; + +class ThriftHiveMetastore_update_transaction_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_update_transaction_statistics_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_update_transaction_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_column_statistics_args__isset { + _ThriftHiveMetastore_get_table_column_statistics_args__isset() : db_name(false), tbl_name(false), col_name(false) {} + bool db_name :1; + bool tbl_name :1; + bool col_name :1; +} _ThriftHiveMetastore_get_table_column_statistics_args__isset; + +class ThriftHiveMetastore_get_table_column_statistics_args { + public: + + ThriftHiveMetastore_get_table_column_statistics_args(const ThriftHiveMetastore_get_table_column_statistics_args&); + ThriftHiveMetastore_get_table_column_statistics_args& operator=(const ThriftHiveMetastore_get_table_column_statistics_args&); + ThriftHiveMetastore_get_table_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_column_statistics_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string col_name; + + _ThriftHiveMetastore_get_table_column_statistics_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_col_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_table_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_column_statistics_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* col_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_column_statistics_result__isset { + _ThriftHiveMetastore_get_table_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_get_table_column_statistics_result__isset; + +class ThriftHiveMetastore_get_table_column_statistics_result { + public: + + ThriftHiveMetastore_get_table_column_statistics_result(const ThriftHiveMetastore_get_table_column_statistics_result&); + ThriftHiveMetastore_get_table_column_statistics_result& operator=(const ThriftHiveMetastore_get_table_column_statistics_result&); + ThriftHiveMetastore_get_table_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_column_statistics_result() noexcept; + ColumnStatistics success; + NoSuchObjectException o1; + MetaException o2; + InvalidInputException o3; + InvalidObjectException o4; + + _ThriftHiveMetastore_get_table_column_statistics_result__isset __isset; + + void __set_success(const ColumnStatistics& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + void __set_o3(const InvalidInputException& val); + + void __set_o4(const InvalidObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_table_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_column_statistics_presult__isset { + _ThriftHiveMetastore_get_table_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_get_table_column_statistics_presult__isset; + +class ThriftHiveMetastore_get_table_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_column_statistics_presult() noexcept; + ColumnStatistics* success; + NoSuchObjectException o1; + MetaException o2; + InvalidInputException o3; + InvalidObjectException o4; + + _ThriftHiveMetastore_get_table_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partition_column_statistics_args__isset { + _ThriftHiveMetastore_get_partition_column_statistics_args__isset() : db_name(false), tbl_name(false), part_name(false), col_name(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; + bool col_name :1; +} _ThriftHiveMetastore_get_partition_column_statistics_args__isset; + +class ThriftHiveMetastore_get_partition_column_statistics_args { + public: + + ThriftHiveMetastore_get_partition_column_statistics_args(const ThriftHiveMetastore_get_partition_column_statistics_args&); + ThriftHiveMetastore_get_partition_column_statistics_args& operator=(const ThriftHiveMetastore_get_partition_column_statistics_args&); + ThriftHiveMetastore_get_partition_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_column_statistics_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + std::string col_name; + + _ThriftHiveMetastore_get_partition_column_statistics_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + void __set_col_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_partition_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partition_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partition_column_statistics_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + const std::string* col_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_column_statistics_result__isset { + _ThriftHiveMetastore_get_partition_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_get_partition_column_statistics_result__isset; + +class ThriftHiveMetastore_get_partition_column_statistics_result { + public: + + ThriftHiveMetastore_get_partition_column_statistics_result(const ThriftHiveMetastore_get_partition_column_statistics_result&); + ThriftHiveMetastore_get_partition_column_statistics_result& operator=(const ThriftHiveMetastore_get_partition_column_statistics_result&); + ThriftHiveMetastore_get_partition_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partition_column_statistics_result() noexcept; + ColumnStatistics success; + NoSuchObjectException o1; + MetaException o2; + InvalidInputException o3; + InvalidObjectException o4; + + _ThriftHiveMetastore_get_partition_column_statistics_result__isset __isset; + + void __set_success(const ColumnStatistics& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + void __set_o3(const InvalidInputException& val); + + void __set_o4(const InvalidObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_partition_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partition_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partition_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partition_column_statistics_presult__isset { + _ThriftHiveMetastore_get_partition_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_get_partition_column_statistics_presult__isset; + +class ThriftHiveMetastore_get_partition_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partition_column_statistics_presult() noexcept; + ColumnStatistics* success; + NoSuchObjectException o1; + MetaException o2; + InvalidInputException o3; + InvalidObjectException o4; + + _ThriftHiveMetastore_get_partition_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_table_statistics_req_args__isset { + _ThriftHiveMetastore_get_table_statistics_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_table_statistics_req_args__isset; + +class ThriftHiveMetastore_get_table_statistics_req_args { + public: + + ThriftHiveMetastore_get_table_statistics_req_args(const ThriftHiveMetastore_get_table_statistics_req_args&); + ThriftHiveMetastore_get_table_statistics_req_args& operator=(const ThriftHiveMetastore_get_table_statistics_req_args&); + ThriftHiveMetastore_get_table_statistics_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_table_statistics_req_args() noexcept; + TableStatsRequest request; + + _ThriftHiveMetastore_get_table_statistics_req_args__isset __isset; + + void __set_request(const TableStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_table_statistics_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_statistics_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_statistics_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_table_statistics_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_table_statistics_req_pargs() noexcept; + const TableStatsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_statistics_req_result__isset { + _ThriftHiveMetastore_get_table_statistics_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_table_statistics_req_result__isset; + +class ThriftHiveMetastore_get_table_statistics_req_result { + public: + + ThriftHiveMetastore_get_table_statistics_req_result(const ThriftHiveMetastore_get_table_statistics_req_result&); + ThriftHiveMetastore_get_table_statistics_req_result& operator=(const ThriftHiveMetastore_get_table_statistics_req_result&); + ThriftHiveMetastore_get_table_statistics_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_table_statistics_req_result() noexcept; + TableStatsResult success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_table_statistics_req_result__isset __isset; + + void __set_success(const TableStatsResult& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_table_statistics_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_table_statistics_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_table_statistics_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_table_statistics_req_presult__isset { + _ThriftHiveMetastore_get_table_statistics_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_table_statistics_req_presult__isset; + +class ThriftHiveMetastore_get_table_statistics_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_table_statistics_req_presult() noexcept; + TableStatsResult* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_table_statistics_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_statistics_req_args__isset { + _ThriftHiveMetastore_get_partitions_statistics_req_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_partitions_statistics_req_args__isset; + +class ThriftHiveMetastore_get_partitions_statistics_req_args { + public: + + ThriftHiveMetastore_get_partitions_statistics_req_args(const ThriftHiveMetastore_get_partitions_statistics_req_args&); + ThriftHiveMetastore_get_partitions_statistics_req_args& operator=(const ThriftHiveMetastore_get_partitions_statistics_req_args&); + ThriftHiveMetastore_get_partitions_statistics_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_statistics_req_args() noexcept; + PartitionsStatsRequest request; + + _ThriftHiveMetastore_get_partitions_statistics_req_args__isset __isset; + + void __set_request(const PartitionsStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_statistics_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_statistics_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_statistics_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_statistics_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_statistics_req_pargs() noexcept; + const PartitionsStatsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_statistics_req_result__isset { + _ThriftHiveMetastore_get_partitions_statistics_req_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_statistics_req_result__isset; + +class ThriftHiveMetastore_get_partitions_statistics_req_result { + public: + + ThriftHiveMetastore_get_partitions_statistics_req_result(const ThriftHiveMetastore_get_partitions_statistics_req_result&); + ThriftHiveMetastore_get_partitions_statistics_req_result& operator=(const ThriftHiveMetastore_get_partitions_statistics_req_result&); + ThriftHiveMetastore_get_partitions_statistics_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_statistics_req_result() noexcept; + PartitionsStatsResult success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_statistics_req_result__isset __isset; + + void __set_success(const PartitionsStatsResult& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_statistics_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_statistics_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_statistics_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_statistics_req_presult__isset { + _ThriftHiveMetastore_get_partitions_statistics_req_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_partitions_statistics_req_presult__isset; + +class ThriftHiveMetastore_get_partitions_statistics_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_statistics_req_presult() noexcept; + PartitionsStatsResult* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_partitions_statistics_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_aggr_stats_for_args__isset { + _ThriftHiveMetastore_get_aggr_stats_for_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_aggr_stats_for_args__isset; + +class ThriftHiveMetastore_get_aggr_stats_for_args { + public: + + ThriftHiveMetastore_get_aggr_stats_for_args(const ThriftHiveMetastore_get_aggr_stats_for_args&); + ThriftHiveMetastore_get_aggr_stats_for_args& operator=(const ThriftHiveMetastore_get_aggr_stats_for_args&); + ThriftHiveMetastore_get_aggr_stats_for_args() noexcept; + + virtual ~ThriftHiveMetastore_get_aggr_stats_for_args() noexcept; + PartitionsStatsRequest request; + + _ThriftHiveMetastore_get_aggr_stats_for_args__isset __isset; + + void __set_request(const PartitionsStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_aggr_stats_for_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_aggr_stats_for_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_aggr_stats_for_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_aggr_stats_for_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_aggr_stats_for_pargs() noexcept; + const PartitionsStatsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_aggr_stats_for_result__isset { + _ThriftHiveMetastore_get_aggr_stats_for_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_aggr_stats_for_result__isset; + +class ThriftHiveMetastore_get_aggr_stats_for_result { + public: + + ThriftHiveMetastore_get_aggr_stats_for_result(const ThriftHiveMetastore_get_aggr_stats_for_result&); + ThriftHiveMetastore_get_aggr_stats_for_result& operator=(const ThriftHiveMetastore_get_aggr_stats_for_result&); + ThriftHiveMetastore_get_aggr_stats_for_result() noexcept; + + virtual ~ThriftHiveMetastore_get_aggr_stats_for_result() noexcept; + AggrStats success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_aggr_stats_for_result__isset __isset; + + void __set_success(const AggrStats& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_aggr_stats_for_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_aggr_stats_for_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_aggr_stats_for_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_aggr_stats_for_presult__isset { + _ThriftHiveMetastore_get_aggr_stats_for_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_aggr_stats_for_presult__isset; + +class ThriftHiveMetastore_get_aggr_stats_for_presult { + public: + + + virtual ~ThriftHiveMetastore_get_aggr_stats_for_presult() noexcept; + AggrStats* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_aggr_stats_for_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_set_aggr_stats_for_args__isset { + _ThriftHiveMetastore_set_aggr_stats_for_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_set_aggr_stats_for_args__isset; + +class ThriftHiveMetastore_set_aggr_stats_for_args { + public: + + ThriftHiveMetastore_set_aggr_stats_for_args(const ThriftHiveMetastore_set_aggr_stats_for_args&); + ThriftHiveMetastore_set_aggr_stats_for_args& operator=(const ThriftHiveMetastore_set_aggr_stats_for_args&); + ThriftHiveMetastore_set_aggr_stats_for_args() noexcept; + + virtual ~ThriftHiveMetastore_set_aggr_stats_for_args() noexcept; + SetPartitionsStatsRequest request; + + _ThriftHiveMetastore_set_aggr_stats_for_args__isset __isset; + + void __set_request(const SetPartitionsStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_set_aggr_stats_for_args & rhs) const; + bool operator != (const ThriftHiveMetastore_set_aggr_stats_for_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_aggr_stats_for_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_aggr_stats_for_pargs { + public: + + + virtual ~ThriftHiveMetastore_set_aggr_stats_for_pargs() noexcept; + const SetPartitionsStatsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_aggr_stats_for_result__isset { + _ThriftHiveMetastore_set_aggr_stats_for_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_set_aggr_stats_for_result__isset; + +class ThriftHiveMetastore_set_aggr_stats_for_result { + public: + + ThriftHiveMetastore_set_aggr_stats_for_result(const ThriftHiveMetastore_set_aggr_stats_for_result&); + ThriftHiveMetastore_set_aggr_stats_for_result& operator=(const ThriftHiveMetastore_set_aggr_stats_for_result&); + ThriftHiveMetastore_set_aggr_stats_for_result() noexcept; + + virtual ~ThriftHiveMetastore_set_aggr_stats_for_result() noexcept; + bool success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_set_aggr_stats_for_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_set_aggr_stats_for_result & rhs) const; + bool operator != (const ThriftHiveMetastore_set_aggr_stats_for_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_aggr_stats_for_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_aggr_stats_for_presult__isset { + _ThriftHiveMetastore_set_aggr_stats_for_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_set_aggr_stats_for_presult__isset; + +class ThriftHiveMetastore_set_aggr_stats_for_presult { + public: + + + virtual ~ThriftHiveMetastore_set_aggr_stats_for_presult() noexcept; + bool* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_set_aggr_stats_for_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_delete_partition_column_statistics_args__isset { + _ThriftHiveMetastore_delete_partition_column_statistics_args__isset() : db_name(false), tbl_name(false), part_name(false), col_name(false), engine(false) {} + bool db_name :1; + bool tbl_name :1; + bool part_name :1; + bool col_name :1; + bool engine :1; +} _ThriftHiveMetastore_delete_partition_column_statistics_args__isset; + +class ThriftHiveMetastore_delete_partition_column_statistics_args { + public: + + ThriftHiveMetastore_delete_partition_column_statistics_args(const ThriftHiveMetastore_delete_partition_column_statistics_args&); + ThriftHiveMetastore_delete_partition_column_statistics_args& operator=(const ThriftHiveMetastore_delete_partition_column_statistics_args&); + ThriftHiveMetastore_delete_partition_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_delete_partition_column_statistics_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string part_name; + std::string col_name; + std::string engine; + + _ThriftHiveMetastore_delete_partition_column_statistics_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_part_name(const std::string& val); + + void __set_col_name(const std::string& val); + + void __set_engine(const std::string& val); + + bool operator == (const ThriftHiveMetastore_delete_partition_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_delete_partition_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_delete_partition_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_delete_partition_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_delete_partition_column_statistics_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* part_name; + const std::string* col_name; + const std::string* engine; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_delete_partition_column_statistics_result__isset { + _ThriftHiveMetastore_delete_partition_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_delete_partition_column_statistics_result__isset; + +class ThriftHiveMetastore_delete_partition_column_statistics_result { + public: + + ThriftHiveMetastore_delete_partition_column_statistics_result(const ThriftHiveMetastore_delete_partition_column_statistics_result&); + ThriftHiveMetastore_delete_partition_column_statistics_result& operator=(const ThriftHiveMetastore_delete_partition_column_statistics_result&); + ThriftHiveMetastore_delete_partition_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_delete_partition_column_statistics_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_delete_partition_column_statistics_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_delete_partition_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_delete_partition_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_delete_partition_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_delete_partition_column_statistics_presult__isset { + _ThriftHiveMetastore_delete_partition_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_delete_partition_column_statistics_presult__isset; + +class ThriftHiveMetastore_delete_partition_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_delete_partition_column_statistics_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_delete_partition_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_delete_table_column_statistics_args__isset { + _ThriftHiveMetastore_delete_table_column_statistics_args__isset() : db_name(false), tbl_name(false), col_name(false), engine(false) {} + bool db_name :1; + bool tbl_name :1; + bool col_name :1; + bool engine :1; +} _ThriftHiveMetastore_delete_table_column_statistics_args__isset; + +class ThriftHiveMetastore_delete_table_column_statistics_args { + public: + + ThriftHiveMetastore_delete_table_column_statistics_args(const ThriftHiveMetastore_delete_table_column_statistics_args&); + ThriftHiveMetastore_delete_table_column_statistics_args& operator=(const ThriftHiveMetastore_delete_table_column_statistics_args&); + ThriftHiveMetastore_delete_table_column_statistics_args() noexcept; + + virtual ~ThriftHiveMetastore_delete_table_column_statistics_args() noexcept; + std::string db_name; + std::string tbl_name; + std::string col_name; + std::string engine; + + _ThriftHiveMetastore_delete_table_column_statistics_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_col_name(const std::string& val); + + void __set_engine(const std::string& val); + + bool operator == (const ThriftHiveMetastore_delete_table_column_statistics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_delete_table_column_statistics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_delete_table_column_statistics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_delete_table_column_statistics_pargs { + public: + + + virtual ~ThriftHiveMetastore_delete_table_column_statistics_pargs() noexcept; + const std::string* db_name; + const std::string* tbl_name; + const std::string* col_name; + const std::string* engine; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_delete_table_column_statistics_result__isset { + _ThriftHiveMetastore_delete_table_column_statistics_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_delete_table_column_statistics_result__isset; + +class ThriftHiveMetastore_delete_table_column_statistics_result { + public: + + ThriftHiveMetastore_delete_table_column_statistics_result(const ThriftHiveMetastore_delete_table_column_statistics_result&); + ThriftHiveMetastore_delete_table_column_statistics_result& operator=(const ThriftHiveMetastore_delete_table_column_statistics_result&); + ThriftHiveMetastore_delete_table_column_statistics_result() noexcept; + + virtual ~ThriftHiveMetastore_delete_table_column_statistics_result() noexcept; + bool success; + NoSuchObjectException o1; + MetaException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_delete_table_column_statistics_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_delete_table_column_statistics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_delete_table_column_statistics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_delete_table_column_statistics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_delete_table_column_statistics_presult__isset { + _ThriftHiveMetastore_delete_table_column_statistics_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_delete_table_column_statistics_presult__isset; + +class ThriftHiveMetastore_delete_table_column_statistics_presult { + public: + + + virtual ~ThriftHiveMetastore_delete_table_column_statistics_presult() noexcept; + bool* success; + NoSuchObjectException o1; + MetaException o2; + InvalidObjectException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_delete_table_column_statistics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_function_args__isset { + _ThriftHiveMetastore_create_function_args__isset() : func(false) {} + bool func :1; +} _ThriftHiveMetastore_create_function_args__isset; + +class ThriftHiveMetastore_create_function_args { + public: + + ThriftHiveMetastore_create_function_args(const ThriftHiveMetastore_create_function_args&); + ThriftHiveMetastore_create_function_args& operator=(const ThriftHiveMetastore_create_function_args&); + ThriftHiveMetastore_create_function_args() noexcept; + + virtual ~ThriftHiveMetastore_create_function_args() noexcept; + Function func; + + _ThriftHiveMetastore_create_function_args__isset __isset; + + void __set_func(const Function& val); + + bool operator == (const ThriftHiveMetastore_create_function_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_function_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_function_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_function_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_function_pargs() noexcept; + const Function* func; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_function_result__isset { + _ThriftHiveMetastore_create_function_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_function_result__isset; + +class ThriftHiveMetastore_create_function_result { + public: + + ThriftHiveMetastore_create_function_result(const ThriftHiveMetastore_create_function_result&); + ThriftHiveMetastore_create_function_result& operator=(const ThriftHiveMetastore_create_function_result&); + ThriftHiveMetastore_create_function_result() noexcept; + + virtual ~ThriftHiveMetastore_create_function_result() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_function_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + void __set_o4(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_create_function_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_function_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_function_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_function_presult__isset { + _ThriftHiveMetastore_create_function_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_function_presult__isset; + +class ThriftHiveMetastore_create_function_presult { + public: + + + virtual ~ThriftHiveMetastore_create_function_presult() noexcept; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + NoSuchObjectException o4; + + _ThriftHiveMetastore_create_function_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_function_args__isset { + _ThriftHiveMetastore_drop_function_args__isset() : dbName(false), funcName(false) {} + bool dbName :1; + bool funcName :1; +} _ThriftHiveMetastore_drop_function_args__isset; + +class ThriftHiveMetastore_drop_function_args { + public: + + ThriftHiveMetastore_drop_function_args(const ThriftHiveMetastore_drop_function_args&); + ThriftHiveMetastore_drop_function_args& operator=(const ThriftHiveMetastore_drop_function_args&); + ThriftHiveMetastore_drop_function_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_function_args() noexcept; + std::string dbName; + std::string funcName; + + _ThriftHiveMetastore_drop_function_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_funcName(const std::string& val); + + bool operator == (const ThriftHiveMetastore_drop_function_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_function_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_function_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_function_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_function_pargs() noexcept; + const std::string* dbName; + const std::string* funcName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_function_result__isset { + _ThriftHiveMetastore_drop_function_result__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_function_result__isset; + +class ThriftHiveMetastore_drop_function_result { + public: + + ThriftHiveMetastore_drop_function_result(const ThriftHiveMetastore_drop_function_result&); + ThriftHiveMetastore_drop_function_result& operator=(const ThriftHiveMetastore_drop_function_result&); + ThriftHiveMetastore_drop_function_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_function_result() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_function_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_function_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_function_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_function_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_function_presult__isset { + _ThriftHiveMetastore_drop_function_presult__isset() : o1(false), o3(false) {} + bool o1 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_function_presult__isset; + +class ThriftHiveMetastore_drop_function_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_function_presult() noexcept; + NoSuchObjectException o1; + MetaException o3; + + _ThriftHiveMetastore_drop_function_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_function_args__isset { + _ThriftHiveMetastore_alter_function_args__isset() : dbName(false), funcName(false), newFunc(false) {} + bool dbName :1; + bool funcName :1; + bool newFunc :1; +} _ThriftHiveMetastore_alter_function_args__isset; + +class ThriftHiveMetastore_alter_function_args { + public: + + ThriftHiveMetastore_alter_function_args(const ThriftHiveMetastore_alter_function_args&); + ThriftHiveMetastore_alter_function_args& operator=(const ThriftHiveMetastore_alter_function_args&); + ThriftHiveMetastore_alter_function_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_function_args() noexcept; + std::string dbName; + std::string funcName; + Function newFunc; + + _ThriftHiveMetastore_alter_function_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_funcName(const std::string& val); + + void __set_newFunc(const Function& val); + + bool operator == (const ThriftHiveMetastore_alter_function_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_function_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_function_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_function_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_function_pargs() noexcept; + const std::string* dbName; + const std::string* funcName; + const Function* newFunc; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_function_result__isset { + _ThriftHiveMetastore_alter_function_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_function_result__isset; + +class ThriftHiveMetastore_alter_function_result { + public: + + ThriftHiveMetastore_alter_function_result(const ThriftHiveMetastore_alter_function_result&); + ThriftHiveMetastore_alter_function_result& operator=(const ThriftHiveMetastore_alter_function_result&); + ThriftHiveMetastore_alter_function_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_function_result() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_function_result__isset __isset; + + void __set_o1(const InvalidOperationException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_function_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_function_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_function_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_function_presult__isset { + _ThriftHiveMetastore_alter_function_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_function_presult__isset; + +class ThriftHiveMetastore_alter_function_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_function_presult() noexcept; + InvalidOperationException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_function_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_functions_args__isset { + _ThriftHiveMetastore_get_functions_args__isset() : dbName(false), pattern(false) {} + bool dbName :1; + bool pattern :1; +} _ThriftHiveMetastore_get_functions_args__isset; + +class ThriftHiveMetastore_get_functions_args { + public: + + ThriftHiveMetastore_get_functions_args(const ThriftHiveMetastore_get_functions_args&); + ThriftHiveMetastore_get_functions_args& operator=(const ThriftHiveMetastore_get_functions_args&); + ThriftHiveMetastore_get_functions_args() noexcept; + + virtual ~ThriftHiveMetastore_get_functions_args() noexcept; + std::string dbName; + std::string pattern; + + _ThriftHiveMetastore_get_functions_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_pattern(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_functions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_functions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_functions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_functions_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_functions_pargs() noexcept; + const std::string* dbName; + const std::string* pattern; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_functions_result__isset { + _ThriftHiveMetastore_get_functions_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_functions_result__isset; + +class ThriftHiveMetastore_get_functions_result { + public: + + ThriftHiveMetastore_get_functions_result(const ThriftHiveMetastore_get_functions_result&); + ThriftHiveMetastore_get_functions_result& operator=(const ThriftHiveMetastore_get_functions_result&); + ThriftHiveMetastore_get_functions_result() noexcept; + + virtual ~ThriftHiveMetastore_get_functions_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_functions_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_functions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_functions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_functions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_functions_presult__isset { + _ThriftHiveMetastore_get_functions_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_functions_presult__isset; + +class ThriftHiveMetastore_get_functions_presult { + public: + + + virtual ~ThriftHiveMetastore_get_functions_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_functions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_function_args__isset { + _ThriftHiveMetastore_get_function_args__isset() : dbName(false), funcName(false) {} + bool dbName :1; + bool funcName :1; +} _ThriftHiveMetastore_get_function_args__isset; + +class ThriftHiveMetastore_get_function_args { + public: + + ThriftHiveMetastore_get_function_args(const ThriftHiveMetastore_get_function_args&); + ThriftHiveMetastore_get_function_args& operator=(const ThriftHiveMetastore_get_function_args&); + ThriftHiveMetastore_get_function_args() noexcept; + + virtual ~ThriftHiveMetastore_get_function_args() noexcept; + std::string dbName; + std::string funcName; + + _ThriftHiveMetastore_get_function_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_funcName(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_function_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_function_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_function_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_function_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_function_pargs() noexcept; + const std::string* dbName; + const std::string* funcName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_function_result__isset { + _ThriftHiveMetastore_get_function_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_function_result__isset; + +class ThriftHiveMetastore_get_function_result { + public: + + ThriftHiveMetastore_get_function_result(const ThriftHiveMetastore_get_function_result&); + ThriftHiveMetastore_get_function_result& operator=(const ThriftHiveMetastore_get_function_result&); + ThriftHiveMetastore_get_function_result() noexcept; + + virtual ~ThriftHiveMetastore_get_function_result() noexcept; + Function success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_function_result__isset __isset; + + void __set_success(const Function& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_function_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_function_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_function_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_function_presult__isset { + _ThriftHiveMetastore_get_function_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_function_presult__isset; + +class ThriftHiveMetastore_get_function_presult { + public: + + + virtual ~ThriftHiveMetastore_get_function_presult() noexcept; + Function* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_function_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_all_functions_args { + public: + + ThriftHiveMetastore_get_all_functions_args(const ThriftHiveMetastore_get_all_functions_args&) noexcept; + ThriftHiveMetastore_get_all_functions_args& operator=(const ThriftHiveMetastore_get_all_functions_args&) noexcept; + ThriftHiveMetastore_get_all_functions_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_functions_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_all_functions_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_all_functions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_functions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_functions_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_functions_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_functions_result__isset { + _ThriftHiveMetastore_get_all_functions_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_functions_result__isset; + +class ThriftHiveMetastore_get_all_functions_result { + public: + + ThriftHiveMetastore_get_all_functions_result(const ThriftHiveMetastore_get_all_functions_result&); + ThriftHiveMetastore_get_all_functions_result& operator=(const ThriftHiveMetastore_get_all_functions_result&); + ThriftHiveMetastore_get_all_functions_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_functions_result() noexcept; + GetAllFunctionsResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_all_functions_result__isset __isset; + + void __set_success(const GetAllFunctionsResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_functions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_functions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_functions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_functions_presult__isset { + _ThriftHiveMetastore_get_all_functions_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_functions_presult__isset; + +class ThriftHiveMetastore_get_all_functions_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_functions_presult() noexcept; + GetAllFunctionsResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_all_functions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_role_args__isset { + _ThriftHiveMetastore_create_role_args__isset() : role(false) {} + bool role :1; +} _ThriftHiveMetastore_create_role_args__isset; + +class ThriftHiveMetastore_create_role_args { + public: + + ThriftHiveMetastore_create_role_args(const ThriftHiveMetastore_create_role_args&); + ThriftHiveMetastore_create_role_args& operator=(const ThriftHiveMetastore_create_role_args&); + ThriftHiveMetastore_create_role_args() noexcept; + + virtual ~ThriftHiveMetastore_create_role_args() noexcept; + Role role; + + _ThriftHiveMetastore_create_role_args__isset __isset; + + void __set_role(const Role& val); + + bool operator == (const ThriftHiveMetastore_create_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_role_pargs() noexcept; + const Role* role; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_role_result__isset { + _ThriftHiveMetastore_create_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_create_role_result__isset; + +class ThriftHiveMetastore_create_role_result { + public: + + ThriftHiveMetastore_create_role_result(const ThriftHiveMetastore_create_role_result&); + ThriftHiveMetastore_create_role_result& operator=(const ThriftHiveMetastore_create_role_result&); + ThriftHiveMetastore_create_role_result() noexcept; + + virtual ~ThriftHiveMetastore_create_role_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_create_role_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_role_presult__isset { + _ThriftHiveMetastore_create_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_create_role_presult__isset; + +class ThriftHiveMetastore_create_role_presult { + public: + + + virtual ~ThriftHiveMetastore_create_role_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_create_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_role_args__isset { + _ThriftHiveMetastore_drop_role_args__isset() : role_name(false) {} + bool role_name :1; +} _ThriftHiveMetastore_drop_role_args__isset; + +class ThriftHiveMetastore_drop_role_args { + public: + + ThriftHiveMetastore_drop_role_args(const ThriftHiveMetastore_drop_role_args&); + ThriftHiveMetastore_drop_role_args& operator=(const ThriftHiveMetastore_drop_role_args&); + ThriftHiveMetastore_drop_role_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_role_args() noexcept; + std::string role_name; + + _ThriftHiveMetastore_drop_role_args__isset __isset; + + void __set_role_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_drop_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_role_pargs() noexcept; + const std::string* role_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_role_result__isset { + _ThriftHiveMetastore_drop_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_drop_role_result__isset; + +class ThriftHiveMetastore_drop_role_result { + public: + + ThriftHiveMetastore_drop_role_result(const ThriftHiveMetastore_drop_role_result&); + ThriftHiveMetastore_drop_role_result& operator=(const ThriftHiveMetastore_drop_role_result&); + ThriftHiveMetastore_drop_role_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_role_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_drop_role_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_role_presult__isset { + _ThriftHiveMetastore_drop_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_drop_role_presult__isset; + +class ThriftHiveMetastore_drop_role_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_role_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_drop_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_role_names_args { + public: + + ThriftHiveMetastore_get_role_names_args(const ThriftHiveMetastore_get_role_names_args&) noexcept; + ThriftHiveMetastore_get_role_names_args& operator=(const ThriftHiveMetastore_get_role_names_args&) noexcept; + ThriftHiveMetastore_get_role_names_args() noexcept; + + virtual ~ThriftHiveMetastore_get_role_names_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_role_names_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_role_names_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_role_names_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_role_names_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_role_names_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_role_names_result__isset { + _ThriftHiveMetastore_get_role_names_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_role_names_result__isset; + +class ThriftHiveMetastore_get_role_names_result { + public: + + ThriftHiveMetastore_get_role_names_result(const ThriftHiveMetastore_get_role_names_result&); + ThriftHiveMetastore_get_role_names_result& operator=(const ThriftHiveMetastore_get_role_names_result&); + ThriftHiveMetastore_get_role_names_result() noexcept; + + virtual ~ThriftHiveMetastore_get_role_names_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_role_names_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_role_names_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_role_names_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_role_names_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_role_names_presult__isset { + _ThriftHiveMetastore_get_role_names_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_role_names_presult__isset; + +class ThriftHiveMetastore_get_role_names_presult { + public: + + + virtual ~ThriftHiveMetastore_get_role_names_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_role_names_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_grant_role_args__isset { + _ThriftHiveMetastore_grant_role_args__isset() : role_name(false), principal_name(false), principal_type(false), grantor(false), grantorType(false), grant_option(false) {} + bool role_name :1; + bool principal_name :1; + bool principal_type :1; + bool grantor :1; + bool grantorType :1; + bool grant_option :1; +} _ThriftHiveMetastore_grant_role_args__isset; + +class ThriftHiveMetastore_grant_role_args { + public: + + ThriftHiveMetastore_grant_role_args(const ThriftHiveMetastore_grant_role_args&); + ThriftHiveMetastore_grant_role_args& operator=(const ThriftHiveMetastore_grant_role_args&); + ThriftHiveMetastore_grant_role_args() noexcept; + + virtual ~ThriftHiveMetastore_grant_role_args() noexcept; + std::string role_name; + std::string principal_name; + /** + * + * @see PrincipalType + */ + PrincipalType::type principal_type; + std::string grantor; + /** + * + * @see PrincipalType + */ + PrincipalType::type grantorType; + bool grant_option; + + _ThriftHiveMetastore_grant_role_args__isset __isset; + + void __set_role_name(const std::string& val); + + void __set_principal_name(const std::string& val); + + void __set_principal_type(const PrincipalType::type val); + + void __set_grantor(const std::string& val); + + void __set_grantorType(const PrincipalType::type val); + + void __set_grant_option(const bool val); + + bool operator == (const ThriftHiveMetastore_grant_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_grant_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_grant_role_pargs() noexcept; + const std::string* role_name; + const std::string* principal_name; + /** + * + * @see PrincipalType + */ + const PrincipalType::type* principal_type; + const std::string* grantor; + /** + * + * @see PrincipalType + */ + const PrincipalType::type* grantorType; + const bool* grant_option; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_role_result__isset { + _ThriftHiveMetastore_grant_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_role_result__isset; + +class ThriftHiveMetastore_grant_role_result { + public: + + ThriftHiveMetastore_grant_role_result(const ThriftHiveMetastore_grant_role_result&); + ThriftHiveMetastore_grant_role_result& operator=(const ThriftHiveMetastore_grant_role_result&); + ThriftHiveMetastore_grant_role_result() noexcept; + + virtual ~ThriftHiveMetastore_grant_role_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_grant_role_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_grant_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_role_presult__isset { + _ThriftHiveMetastore_grant_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_role_presult__isset; + +class ThriftHiveMetastore_grant_role_presult { + public: + + + virtual ~ThriftHiveMetastore_grant_role_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_grant_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_revoke_role_args__isset { + _ThriftHiveMetastore_revoke_role_args__isset() : role_name(false), principal_name(false), principal_type(false) {} + bool role_name :1; + bool principal_name :1; + bool principal_type :1; +} _ThriftHiveMetastore_revoke_role_args__isset; + +class ThriftHiveMetastore_revoke_role_args { + public: + + ThriftHiveMetastore_revoke_role_args(const ThriftHiveMetastore_revoke_role_args&); + ThriftHiveMetastore_revoke_role_args& operator=(const ThriftHiveMetastore_revoke_role_args&); + ThriftHiveMetastore_revoke_role_args() noexcept; + + virtual ~ThriftHiveMetastore_revoke_role_args() noexcept; + std::string role_name; + std::string principal_name; + /** + * + * @see PrincipalType + */ + PrincipalType::type principal_type; + + _ThriftHiveMetastore_revoke_role_args__isset __isset; + + void __set_role_name(const std::string& val); + + void __set_principal_name(const std::string& val); + + void __set_principal_type(const PrincipalType::type val); + + bool operator == (const ThriftHiveMetastore_revoke_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_revoke_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_revoke_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_revoke_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_revoke_role_pargs() noexcept; + const std::string* role_name; + const std::string* principal_name; + /** + * + * @see PrincipalType + */ + const PrincipalType::type* principal_type; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_revoke_role_result__isset { + _ThriftHiveMetastore_revoke_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_revoke_role_result__isset; + +class ThriftHiveMetastore_revoke_role_result { + public: + + ThriftHiveMetastore_revoke_role_result(const ThriftHiveMetastore_revoke_role_result&); + ThriftHiveMetastore_revoke_role_result& operator=(const ThriftHiveMetastore_revoke_role_result&); + ThriftHiveMetastore_revoke_role_result() noexcept; + + virtual ~ThriftHiveMetastore_revoke_role_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_revoke_role_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_revoke_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_revoke_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_revoke_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_revoke_role_presult__isset { + _ThriftHiveMetastore_revoke_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_revoke_role_presult__isset; + +class ThriftHiveMetastore_revoke_role_presult { + public: + + + virtual ~ThriftHiveMetastore_revoke_role_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_revoke_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_list_roles_args__isset { + _ThriftHiveMetastore_list_roles_args__isset() : principal_name(false), principal_type(false) {} + bool principal_name :1; + bool principal_type :1; +} _ThriftHiveMetastore_list_roles_args__isset; + +class ThriftHiveMetastore_list_roles_args { + public: + + ThriftHiveMetastore_list_roles_args(const ThriftHiveMetastore_list_roles_args&); + ThriftHiveMetastore_list_roles_args& operator=(const ThriftHiveMetastore_list_roles_args&); + ThriftHiveMetastore_list_roles_args() noexcept; + + virtual ~ThriftHiveMetastore_list_roles_args() noexcept; + std::string principal_name; + /** + * + * @see PrincipalType + */ + PrincipalType::type principal_type; + + _ThriftHiveMetastore_list_roles_args__isset __isset; + + void __set_principal_name(const std::string& val); + + void __set_principal_type(const PrincipalType::type val); + + bool operator == (const ThriftHiveMetastore_list_roles_args & rhs) const; + bool operator != (const ThriftHiveMetastore_list_roles_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_list_roles_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_list_roles_pargs { + public: + + + virtual ~ThriftHiveMetastore_list_roles_pargs() noexcept; + const std::string* principal_name; + /** + * + * @see PrincipalType + */ + const PrincipalType::type* principal_type; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_list_roles_result__isset { + _ThriftHiveMetastore_list_roles_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_list_roles_result__isset; + +class ThriftHiveMetastore_list_roles_result { + public: + + ThriftHiveMetastore_list_roles_result(const ThriftHiveMetastore_list_roles_result&); + ThriftHiveMetastore_list_roles_result& operator=(const ThriftHiveMetastore_list_roles_result&); + ThriftHiveMetastore_list_roles_result() noexcept; + + virtual ~ThriftHiveMetastore_list_roles_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_list_roles_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_list_roles_result & rhs) const; + bool operator != (const ThriftHiveMetastore_list_roles_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_list_roles_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_list_roles_presult__isset { + _ThriftHiveMetastore_list_roles_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_list_roles_presult__isset; + +class ThriftHiveMetastore_list_roles_presult { + public: + + + virtual ~ThriftHiveMetastore_list_roles_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_list_roles_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_role_args__isset { + _ThriftHiveMetastore_grant_revoke_role_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_grant_revoke_role_args__isset; + +class ThriftHiveMetastore_grant_revoke_role_args { + public: + + ThriftHiveMetastore_grant_revoke_role_args(const ThriftHiveMetastore_grant_revoke_role_args&); + ThriftHiveMetastore_grant_revoke_role_args& operator=(const ThriftHiveMetastore_grant_revoke_role_args&); + ThriftHiveMetastore_grant_revoke_role_args() noexcept; + + virtual ~ThriftHiveMetastore_grant_revoke_role_args() noexcept; + GrantRevokeRoleRequest request; + + _ThriftHiveMetastore_grant_revoke_role_args__isset __isset; + + void __set_request(const GrantRevokeRoleRequest& val); + + bool operator == (const ThriftHiveMetastore_grant_revoke_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_revoke_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_revoke_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_grant_revoke_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_grant_revoke_role_pargs() noexcept; + const GrantRevokeRoleRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_role_result__isset { + _ThriftHiveMetastore_grant_revoke_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_revoke_role_result__isset; + +class ThriftHiveMetastore_grant_revoke_role_result { + public: + + ThriftHiveMetastore_grant_revoke_role_result(const ThriftHiveMetastore_grant_revoke_role_result&); + ThriftHiveMetastore_grant_revoke_role_result& operator=(const ThriftHiveMetastore_grant_revoke_role_result&); + ThriftHiveMetastore_grant_revoke_role_result() noexcept; + + virtual ~ThriftHiveMetastore_grant_revoke_role_result() noexcept; + GrantRevokeRoleResponse success; + MetaException o1; + + _ThriftHiveMetastore_grant_revoke_role_result__isset __isset; + + void __set_success(const GrantRevokeRoleResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_grant_revoke_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_revoke_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_revoke_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_role_presult__isset { + _ThriftHiveMetastore_grant_revoke_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_revoke_role_presult__isset; + +class ThriftHiveMetastore_grant_revoke_role_presult { + public: + + + virtual ~ThriftHiveMetastore_grant_revoke_role_presult() noexcept; + GrantRevokeRoleResponse* success; + MetaException o1; + + _ThriftHiveMetastore_grant_revoke_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_principals_in_role_args__isset { + _ThriftHiveMetastore_get_principals_in_role_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_principals_in_role_args__isset; + +class ThriftHiveMetastore_get_principals_in_role_args { + public: + + ThriftHiveMetastore_get_principals_in_role_args(const ThriftHiveMetastore_get_principals_in_role_args&); + ThriftHiveMetastore_get_principals_in_role_args& operator=(const ThriftHiveMetastore_get_principals_in_role_args&); + ThriftHiveMetastore_get_principals_in_role_args() noexcept; + + virtual ~ThriftHiveMetastore_get_principals_in_role_args() noexcept; + GetPrincipalsInRoleRequest request; + + _ThriftHiveMetastore_get_principals_in_role_args__isset __isset; + + void __set_request(const GetPrincipalsInRoleRequest& val); + + bool operator == (const ThriftHiveMetastore_get_principals_in_role_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_principals_in_role_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_principals_in_role_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_principals_in_role_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_principals_in_role_pargs() noexcept; + const GetPrincipalsInRoleRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_principals_in_role_result__isset { + _ThriftHiveMetastore_get_principals_in_role_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_principals_in_role_result__isset; + +class ThriftHiveMetastore_get_principals_in_role_result { + public: + + ThriftHiveMetastore_get_principals_in_role_result(const ThriftHiveMetastore_get_principals_in_role_result&); + ThriftHiveMetastore_get_principals_in_role_result& operator=(const ThriftHiveMetastore_get_principals_in_role_result&); + ThriftHiveMetastore_get_principals_in_role_result() noexcept; + + virtual ~ThriftHiveMetastore_get_principals_in_role_result() noexcept; + GetPrincipalsInRoleResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_principals_in_role_result__isset __isset; + + void __set_success(const GetPrincipalsInRoleResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_principals_in_role_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_principals_in_role_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_principals_in_role_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_principals_in_role_presult__isset { + _ThriftHiveMetastore_get_principals_in_role_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_principals_in_role_presult__isset; + +class ThriftHiveMetastore_get_principals_in_role_presult { + public: + + + virtual ~ThriftHiveMetastore_get_principals_in_role_presult() noexcept; + GetPrincipalsInRoleResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_principals_in_role_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_role_grants_for_principal_args__isset { + _ThriftHiveMetastore_get_role_grants_for_principal_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_role_grants_for_principal_args__isset; + +class ThriftHiveMetastore_get_role_grants_for_principal_args { + public: + + ThriftHiveMetastore_get_role_grants_for_principal_args(const ThriftHiveMetastore_get_role_grants_for_principal_args&); + ThriftHiveMetastore_get_role_grants_for_principal_args& operator=(const ThriftHiveMetastore_get_role_grants_for_principal_args&); + ThriftHiveMetastore_get_role_grants_for_principal_args() noexcept; + + virtual ~ThriftHiveMetastore_get_role_grants_for_principal_args() noexcept; + GetRoleGrantsForPrincipalRequest request; + + _ThriftHiveMetastore_get_role_grants_for_principal_args__isset __isset; + + void __set_request(const GetRoleGrantsForPrincipalRequest& val); + + bool operator == (const ThriftHiveMetastore_get_role_grants_for_principal_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_role_grants_for_principal_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_role_grants_for_principal_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_role_grants_for_principal_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_role_grants_for_principal_pargs() noexcept; + const GetRoleGrantsForPrincipalRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_role_grants_for_principal_result__isset { + _ThriftHiveMetastore_get_role_grants_for_principal_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_role_grants_for_principal_result__isset; + +class ThriftHiveMetastore_get_role_grants_for_principal_result { + public: + + ThriftHiveMetastore_get_role_grants_for_principal_result(const ThriftHiveMetastore_get_role_grants_for_principal_result&); + ThriftHiveMetastore_get_role_grants_for_principal_result& operator=(const ThriftHiveMetastore_get_role_grants_for_principal_result&); + ThriftHiveMetastore_get_role_grants_for_principal_result() noexcept; + + virtual ~ThriftHiveMetastore_get_role_grants_for_principal_result() noexcept; + GetRoleGrantsForPrincipalResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_role_grants_for_principal_result__isset __isset; + + void __set_success(const GetRoleGrantsForPrincipalResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_role_grants_for_principal_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_role_grants_for_principal_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_role_grants_for_principal_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_role_grants_for_principal_presult__isset { + _ThriftHiveMetastore_get_role_grants_for_principal_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_role_grants_for_principal_presult__isset; + +class ThriftHiveMetastore_get_role_grants_for_principal_presult { + public: + + + virtual ~ThriftHiveMetastore_get_role_grants_for_principal_presult() noexcept; + GetRoleGrantsForPrincipalResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_role_grants_for_principal_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_privilege_set_args__isset { + _ThriftHiveMetastore_get_privilege_set_args__isset() : hiveObject(false), user_name(false), group_names(false) {} + bool hiveObject :1; + bool user_name :1; + bool group_names :1; +} _ThriftHiveMetastore_get_privilege_set_args__isset; + +class ThriftHiveMetastore_get_privilege_set_args { + public: + + ThriftHiveMetastore_get_privilege_set_args(const ThriftHiveMetastore_get_privilege_set_args&); + ThriftHiveMetastore_get_privilege_set_args& operator=(const ThriftHiveMetastore_get_privilege_set_args&); + ThriftHiveMetastore_get_privilege_set_args() noexcept; + + virtual ~ThriftHiveMetastore_get_privilege_set_args() noexcept; + HiveObjectRef hiveObject; + std::string user_name; + std::vector group_names; + + _ThriftHiveMetastore_get_privilege_set_args__isset __isset; + + void __set_hiveObject(const HiveObjectRef& val); + + void __set_user_name(const std::string& val); + + void __set_group_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_privilege_set_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_privilege_set_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_privilege_set_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_privilege_set_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_privilege_set_pargs() noexcept; + const HiveObjectRef* hiveObject; + const std::string* user_name; + const std::vector * group_names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_privilege_set_result__isset { + _ThriftHiveMetastore_get_privilege_set_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_privilege_set_result__isset; + +class ThriftHiveMetastore_get_privilege_set_result { + public: + + ThriftHiveMetastore_get_privilege_set_result(const ThriftHiveMetastore_get_privilege_set_result&); + ThriftHiveMetastore_get_privilege_set_result& operator=(const ThriftHiveMetastore_get_privilege_set_result&); + ThriftHiveMetastore_get_privilege_set_result() noexcept; + + virtual ~ThriftHiveMetastore_get_privilege_set_result() noexcept; + PrincipalPrivilegeSet success; + MetaException o1; + + _ThriftHiveMetastore_get_privilege_set_result__isset __isset; + + void __set_success(const PrincipalPrivilegeSet& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_privilege_set_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_privilege_set_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_privilege_set_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_privilege_set_presult__isset { + _ThriftHiveMetastore_get_privilege_set_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_privilege_set_presult__isset; + +class ThriftHiveMetastore_get_privilege_set_presult { + public: + + + virtual ~ThriftHiveMetastore_get_privilege_set_presult() noexcept; + PrincipalPrivilegeSet* success; + MetaException o1; + + _ThriftHiveMetastore_get_privilege_set_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_list_privileges_args__isset { + _ThriftHiveMetastore_list_privileges_args__isset() : principal_name(false), principal_type(false), hiveObject(false) {} + bool principal_name :1; + bool principal_type :1; + bool hiveObject :1; +} _ThriftHiveMetastore_list_privileges_args__isset; + +class ThriftHiveMetastore_list_privileges_args { + public: + + ThriftHiveMetastore_list_privileges_args(const ThriftHiveMetastore_list_privileges_args&); + ThriftHiveMetastore_list_privileges_args& operator=(const ThriftHiveMetastore_list_privileges_args&); + ThriftHiveMetastore_list_privileges_args() noexcept; + + virtual ~ThriftHiveMetastore_list_privileges_args() noexcept; + std::string principal_name; + /** + * + * @see PrincipalType + */ + PrincipalType::type principal_type; + HiveObjectRef hiveObject; + + _ThriftHiveMetastore_list_privileges_args__isset __isset; + + void __set_principal_name(const std::string& val); + + void __set_principal_type(const PrincipalType::type val); + + void __set_hiveObject(const HiveObjectRef& val); + + bool operator == (const ThriftHiveMetastore_list_privileges_args & rhs) const; + bool operator != (const ThriftHiveMetastore_list_privileges_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_list_privileges_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_list_privileges_pargs { + public: + + + virtual ~ThriftHiveMetastore_list_privileges_pargs() noexcept; + const std::string* principal_name; + /** + * + * @see PrincipalType + */ + const PrincipalType::type* principal_type; + const HiveObjectRef* hiveObject; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_list_privileges_result__isset { + _ThriftHiveMetastore_list_privileges_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_list_privileges_result__isset; + +class ThriftHiveMetastore_list_privileges_result { + public: + + ThriftHiveMetastore_list_privileges_result(const ThriftHiveMetastore_list_privileges_result&); + ThriftHiveMetastore_list_privileges_result& operator=(const ThriftHiveMetastore_list_privileges_result&); + ThriftHiveMetastore_list_privileges_result() noexcept; + + virtual ~ThriftHiveMetastore_list_privileges_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_list_privileges_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_list_privileges_result & rhs) const; + bool operator != (const ThriftHiveMetastore_list_privileges_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_list_privileges_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_list_privileges_presult__isset { + _ThriftHiveMetastore_list_privileges_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_list_privileges_presult__isset; + +class ThriftHiveMetastore_list_privileges_presult { + public: + + + virtual ~ThriftHiveMetastore_list_privileges_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_list_privileges_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_grant_privileges_args__isset { + _ThriftHiveMetastore_grant_privileges_args__isset() : privileges(false) {} + bool privileges :1; +} _ThriftHiveMetastore_grant_privileges_args__isset; + +class ThriftHiveMetastore_grant_privileges_args { + public: + + ThriftHiveMetastore_grant_privileges_args(const ThriftHiveMetastore_grant_privileges_args&); + ThriftHiveMetastore_grant_privileges_args& operator=(const ThriftHiveMetastore_grant_privileges_args&); + ThriftHiveMetastore_grant_privileges_args() noexcept; + + virtual ~ThriftHiveMetastore_grant_privileges_args() noexcept; + PrivilegeBag privileges; + + _ThriftHiveMetastore_grant_privileges_args__isset __isset; + + void __set_privileges(const PrivilegeBag& val); + + bool operator == (const ThriftHiveMetastore_grant_privileges_args & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_privileges_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_privileges_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_grant_privileges_pargs { + public: + + + virtual ~ThriftHiveMetastore_grant_privileges_pargs() noexcept; + const PrivilegeBag* privileges; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_privileges_result__isset { + _ThriftHiveMetastore_grant_privileges_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_privileges_result__isset; + +class ThriftHiveMetastore_grant_privileges_result { + public: + + ThriftHiveMetastore_grant_privileges_result(const ThriftHiveMetastore_grant_privileges_result&); + ThriftHiveMetastore_grant_privileges_result& operator=(const ThriftHiveMetastore_grant_privileges_result&); + ThriftHiveMetastore_grant_privileges_result() noexcept; + + virtual ~ThriftHiveMetastore_grant_privileges_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_grant_privileges_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_grant_privileges_result & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_privileges_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_privileges_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_privileges_presult__isset { + _ThriftHiveMetastore_grant_privileges_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_privileges_presult__isset; + +class ThriftHiveMetastore_grant_privileges_presult { + public: + + + virtual ~ThriftHiveMetastore_grant_privileges_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_grant_privileges_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_revoke_privileges_args__isset { + _ThriftHiveMetastore_revoke_privileges_args__isset() : privileges(false) {} + bool privileges :1; +} _ThriftHiveMetastore_revoke_privileges_args__isset; + +class ThriftHiveMetastore_revoke_privileges_args { + public: + + ThriftHiveMetastore_revoke_privileges_args(const ThriftHiveMetastore_revoke_privileges_args&); + ThriftHiveMetastore_revoke_privileges_args& operator=(const ThriftHiveMetastore_revoke_privileges_args&); + ThriftHiveMetastore_revoke_privileges_args() noexcept; + + virtual ~ThriftHiveMetastore_revoke_privileges_args() noexcept; + PrivilegeBag privileges; + + _ThriftHiveMetastore_revoke_privileges_args__isset __isset; + + void __set_privileges(const PrivilegeBag& val); + + bool operator == (const ThriftHiveMetastore_revoke_privileges_args & rhs) const; + bool operator != (const ThriftHiveMetastore_revoke_privileges_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_revoke_privileges_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_revoke_privileges_pargs { + public: + + + virtual ~ThriftHiveMetastore_revoke_privileges_pargs() noexcept; + const PrivilegeBag* privileges; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_revoke_privileges_result__isset { + _ThriftHiveMetastore_revoke_privileges_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_revoke_privileges_result__isset; + +class ThriftHiveMetastore_revoke_privileges_result { + public: + + ThriftHiveMetastore_revoke_privileges_result(const ThriftHiveMetastore_revoke_privileges_result&); + ThriftHiveMetastore_revoke_privileges_result& operator=(const ThriftHiveMetastore_revoke_privileges_result&); + ThriftHiveMetastore_revoke_privileges_result() noexcept; + + virtual ~ThriftHiveMetastore_revoke_privileges_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_revoke_privileges_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_revoke_privileges_result & rhs) const; + bool operator != (const ThriftHiveMetastore_revoke_privileges_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_revoke_privileges_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_revoke_privileges_presult__isset { + _ThriftHiveMetastore_revoke_privileges_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_revoke_privileges_presult__isset; + +class ThriftHiveMetastore_revoke_privileges_presult { + public: + + + virtual ~ThriftHiveMetastore_revoke_privileges_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_revoke_privileges_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_privileges_args__isset { + _ThriftHiveMetastore_grant_revoke_privileges_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_grant_revoke_privileges_args__isset; + +class ThriftHiveMetastore_grant_revoke_privileges_args { + public: + + ThriftHiveMetastore_grant_revoke_privileges_args(const ThriftHiveMetastore_grant_revoke_privileges_args&); + ThriftHiveMetastore_grant_revoke_privileges_args& operator=(const ThriftHiveMetastore_grant_revoke_privileges_args&); + ThriftHiveMetastore_grant_revoke_privileges_args() noexcept; + + virtual ~ThriftHiveMetastore_grant_revoke_privileges_args() noexcept; + GrantRevokePrivilegeRequest request; + + _ThriftHiveMetastore_grant_revoke_privileges_args__isset __isset; + + void __set_request(const GrantRevokePrivilegeRequest& val); + + bool operator == (const ThriftHiveMetastore_grant_revoke_privileges_args & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_revoke_privileges_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_revoke_privileges_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_grant_revoke_privileges_pargs { + public: + + + virtual ~ThriftHiveMetastore_grant_revoke_privileges_pargs() noexcept; + const GrantRevokePrivilegeRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_privileges_result__isset { + _ThriftHiveMetastore_grant_revoke_privileges_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_revoke_privileges_result__isset; + +class ThriftHiveMetastore_grant_revoke_privileges_result { + public: + + ThriftHiveMetastore_grant_revoke_privileges_result(const ThriftHiveMetastore_grant_revoke_privileges_result&); + ThriftHiveMetastore_grant_revoke_privileges_result& operator=(const ThriftHiveMetastore_grant_revoke_privileges_result&); + ThriftHiveMetastore_grant_revoke_privileges_result() noexcept; + + virtual ~ThriftHiveMetastore_grant_revoke_privileges_result() noexcept; + GrantRevokePrivilegeResponse success; + MetaException o1; + + _ThriftHiveMetastore_grant_revoke_privileges_result__isset __isset; + + void __set_success(const GrantRevokePrivilegeResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_grant_revoke_privileges_result & rhs) const; + bool operator != (const ThriftHiveMetastore_grant_revoke_privileges_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_grant_revoke_privileges_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_grant_revoke_privileges_presult__isset { + _ThriftHiveMetastore_grant_revoke_privileges_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_grant_revoke_privileges_presult__isset; + +class ThriftHiveMetastore_grant_revoke_privileges_presult { + public: + + + virtual ~ThriftHiveMetastore_grant_revoke_privileges_presult() noexcept; + GrantRevokePrivilegeResponse* success; + MetaException o1; + + _ThriftHiveMetastore_grant_revoke_privileges_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_refresh_privileges_args__isset { + _ThriftHiveMetastore_refresh_privileges_args__isset() : objToRefresh(false), authorizer(false), grantRequest(false) {} + bool objToRefresh :1; + bool authorizer :1; + bool grantRequest :1; +} _ThriftHiveMetastore_refresh_privileges_args__isset; + +class ThriftHiveMetastore_refresh_privileges_args { + public: + + ThriftHiveMetastore_refresh_privileges_args(const ThriftHiveMetastore_refresh_privileges_args&); + ThriftHiveMetastore_refresh_privileges_args& operator=(const ThriftHiveMetastore_refresh_privileges_args&); + ThriftHiveMetastore_refresh_privileges_args() noexcept; + + virtual ~ThriftHiveMetastore_refresh_privileges_args() noexcept; + HiveObjectRef objToRefresh; + std::string authorizer; + GrantRevokePrivilegeRequest grantRequest; + + _ThriftHiveMetastore_refresh_privileges_args__isset __isset; + + void __set_objToRefresh(const HiveObjectRef& val); + + void __set_authorizer(const std::string& val); + + void __set_grantRequest(const GrantRevokePrivilegeRequest& val); + + bool operator == (const ThriftHiveMetastore_refresh_privileges_args & rhs) const; + bool operator != (const ThriftHiveMetastore_refresh_privileges_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_refresh_privileges_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_refresh_privileges_pargs { + public: + + + virtual ~ThriftHiveMetastore_refresh_privileges_pargs() noexcept; + const HiveObjectRef* objToRefresh; + const std::string* authorizer; + const GrantRevokePrivilegeRequest* grantRequest; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_refresh_privileges_result__isset { + _ThriftHiveMetastore_refresh_privileges_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_refresh_privileges_result__isset; + +class ThriftHiveMetastore_refresh_privileges_result { + public: + + ThriftHiveMetastore_refresh_privileges_result(const ThriftHiveMetastore_refresh_privileges_result&); + ThriftHiveMetastore_refresh_privileges_result& operator=(const ThriftHiveMetastore_refresh_privileges_result&); + ThriftHiveMetastore_refresh_privileges_result() noexcept; + + virtual ~ThriftHiveMetastore_refresh_privileges_result() noexcept; + GrantRevokePrivilegeResponse success; + MetaException o1; + + _ThriftHiveMetastore_refresh_privileges_result__isset __isset; + + void __set_success(const GrantRevokePrivilegeResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_refresh_privileges_result & rhs) const; + bool operator != (const ThriftHiveMetastore_refresh_privileges_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_refresh_privileges_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_refresh_privileges_presult__isset { + _ThriftHiveMetastore_refresh_privileges_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_refresh_privileges_presult__isset; + +class ThriftHiveMetastore_refresh_privileges_presult { + public: + + + virtual ~ThriftHiveMetastore_refresh_privileges_presult() noexcept; + GrantRevokePrivilegeResponse* success; + MetaException o1; + + _ThriftHiveMetastore_refresh_privileges_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_set_ugi_args__isset { + _ThriftHiveMetastore_set_ugi_args__isset() : user_name(false), group_names(false) {} + bool user_name :1; + bool group_names :1; +} _ThriftHiveMetastore_set_ugi_args__isset; + +class ThriftHiveMetastore_set_ugi_args { + public: + + ThriftHiveMetastore_set_ugi_args(const ThriftHiveMetastore_set_ugi_args&); + ThriftHiveMetastore_set_ugi_args& operator=(const ThriftHiveMetastore_set_ugi_args&); + ThriftHiveMetastore_set_ugi_args() noexcept; + + virtual ~ThriftHiveMetastore_set_ugi_args() noexcept; + std::string user_name; + std::vector group_names; + + _ThriftHiveMetastore_set_ugi_args__isset __isset; + + void __set_user_name(const std::string& val); + + void __set_group_names(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_set_ugi_args & rhs) const; + bool operator != (const ThriftHiveMetastore_set_ugi_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_ugi_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_ugi_pargs { + public: + + + virtual ~ThriftHiveMetastore_set_ugi_pargs() noexcept; + const std::string* user_name; + const std::vector * group_names; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_ugi_result__isset { + _ThriftHiveMetastore_set_ugi_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_set_ugi_result__isset; + +class ThriftHiveMetastore_set_ugi_result { + public: + + ThriftHiveMetastore_set_ugi_result(const ThriftHiveMetastore_set_ugi_result&); + ThriftHiveMetastore_set_ugi_result& operator=(const ThriftHiveMetastore_set_ugi_result&); + ThriftHiveMetastore_set_ugi_result() noexcept; + + virtual ~ThriftHiveMetastore_set_ugi_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_set_ugi_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_set_ugi_result & rhs) const; + bool operator != (const ThriftHiveMetastore_set_ugi_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_ugi_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_ugi_presult__isset { + _ThriftHiveMetastore_set_ugi_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_set_ugi_presult__isset; + +class ThriftHiveMetastore_set_ugi_presult { + public: + + + virtual ~ThriftHiveMetastore_set_ugi_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_set_ugi_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_args__isset { + _ThriftHiveMetastore_get_delegation_token_args__isset() : token_owner(false), renewer_kerberos_principal_name(false) {} + bool token_owner :1; + bool renewer_kerberos_principal_name :1; +} _ThriftHiveMetastore_get_delegation_token_args__isset; + +class ThriftHiveMetastore_get_delegation_token_args { + public: + + ThriftHiveMetastore_get_delegation_token_args(const ThriftHiveMetastore_get_delegation_token_args&); + ThriftHiveMetastore_get_delegation_token_args& operator=(const ThriftHiveMetastore_get_delegation_token_args&); + ThriftHiveMetastore_get_delegation_token_args() noexcept; + + virtual ~ThriftHiveMetastore_get_delegation_token_args() noexcept; + std::string token_owner; + std::string renewer_kerberos_principal_name; + + _ThriftHiveMetastore_get_delegation_token_args__isset __isset; + + void __set_token_owner(const std::string& val); + + void __set_renewer_kerberos_principal_name(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_delegation_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_pargs() noexcept; + const std::string* token_owner; + const std::string* renewer_kerberos_principal_name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_result__isset { + _ThriftHiveMetastore_get_delegation_token_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_delegation_token_result__isset; + +class ThriftHiveMetastore_get_delegation_token_result { + public: + + ThriftHiveMetastore_get_delegation_token_result(const ThriftHiveMetastore_get_delegation_token_result&); + ThriftHiveMetastore_get_delegation_token_result& operator=(const ThriftHiveMetastore_get_delegation_token_result&); + ThriftHiveMetastore_get_delegation_token_result() noexcept; + + virtual ~ThriftHiveMetastore_get_delegation_token_result() noexcept; + std::string success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_result__isset __isset; + + void __set_success(const std::string& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_delegation_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_delegation_token_presult__isset { + _ThriftHiveMetastore_get_delegation_token_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_delegation_token_presult__isset; + +class ThriftHiveMetastore_get_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_get_delegation_token_presult() noexcept; + std::string* success; + MetaException o1; + + _ThriftHiveMetastore_get_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_args__isset { + _ThriftHiveMetastore_renew_delegation_token_args__isset() : token_str_form(false) {} + bool token_str_form :1; +} _ThriftHiveMetastore_renew_delegation_token_args__isset; + +class ThriftHiveMetastore_renew_delegation_token_args { + public: + + ThriftHiveMetastore_renew_delegation_token_args(const ThriftHiveMetastore_renew_delegation_token_args&); + ThriftHiveMetastore_renew_delegation_token_args& operator=(const ThriftHiveMetastore_renew_delegation_token_args&); + ThriftHiveMetastore_renew_delegation_token_args() noexcept; + + virtual ~ThriftHiveMetastore_renew_delegation_token_args() noexcept; + std::string token_str_form; + + _ThriftHiveMetastore_renew_delegation_token_args__isset __isset; + + void __set_token_str_form(const std::string& val); + + bool operator == (const ThriftHiveMetastore_renew_delegation_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_renew_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_renew_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_renew_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_renew_delegation_token_pargs() noexcept; + const std::string* token_str_form; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_result__isset { + _ThriftHiveMetastore_renew_delegation_token_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_renew_delegation_token_result__isset; + +class ThriftHiveMetastore_renew_delegation_token_result { + public: + + ThriftHiveMetastore_renew_delegation_token_result(const ThriftHiveMetastore_renew_delegation_token_result&); + ThriftHiveMetastore_renew_delegation_token_result& operator=(const ThriftHiveMetastore_renew_delegation_token_result&); + ThriftHiveMetastore_renew_delegation_token_result() noexcept; + + virtual ~ThriftHiveMetastore_renew_delegation_token_result() noexcept; + int64_t success; + MetaException o1; + + _ThriftHiveMetastore_renew_delegation_token_result__isset __isset; + + void __set_success(const int64_t val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_renew_delegation_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_renew_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_renew_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_renew_delegation_token_presult__isset { + _ThriftHiveMetastore_renew_delegation_token_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_renew_delegation_token_presult__isset; + +class ThriftHiveMetastore_renew_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_renew_delegation_token_presult() noexcept; + int64_t* success; + MetaException o1; + + _ThriftHiveMetastore_renew_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_args__isset { + _ThriftHiveMetastore_cancel_delegation_token_args__isset() : token_str_form(false) {} + bool token_str_form :1; +} _ThriftHiveMetastore_cancel_delegation_token_args__isset; + +class ThriftHiveMetastore_cancel_delegation_token_args { + public: + + ThriftHiveMetastore_cancel_delegation_token_args(const ThriftHiveMetastore_cancel_delegation_token_args&); + ThriftHiveMetastore_cancel_delegation_token_args& operator=(const ThriftHiveMetastore_cancel_delegation_token_args&); + ThriftHiveMetastore_cancel_delegation_token_args() noexcept; + + virtual ~ThriftHiveMetastore_cancel_delegation_token_args() noexcept; + std::string token_str_form; + + _ThriftHiveMetastore_cancel_delegation_token_args__isset __isset; + + void __set_token_str_form(const std::string& val); + + bool operator == (const ThriftHiveMetastore_cancel_delegation_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_cancel_delegation_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cancel_delegation_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_cancel_delegation_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_cancel_delegation_token_pargs() noexcept; + const std::string* token_str_form; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_result__isset { + _ThriftHiveMetastore_cancel_delegation_token_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_cancel_delegation_token_result__isset; + +class ThriftHiveMetastore_cancel_delegation_token_result { + public: + + ThriftHiveMetastore_cancel_delegation_token_result(const ThriftHiveMetastore_cancel_delegation_token_result&); + ThriftHiveMetastore_cancel_delegation_token_result& operator=(const ThriftHiveMetastore_cancel_delegation_token_result&); + ThriftHiveMetastore_cancel_delegation_token_result() noexcept; + + virtual ~ThriftHiveMetastore_cancel_delegation_token_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_cancel_delegation_token_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_cancel_delegation_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_cancel_delegation_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cancel_delegation_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cancel_delegation_token_presult__isset { + _ThriftHiveMetastore_cancel_delegation_token_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_cancel_delegation_token_presult__isset; + +class ThriftHiveMetastore_cancel_delegation_token_presult { + public: + + + virtual ~ThriftHiveMetastore_cancel_delegation_token_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_cancel_delegation_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_token_args__isset { + _ThriftHiveMetastore_add_token_args__isset() : token_identifier(false), delegation_token(false) {} + bool token_identifier :1; + bool delegation_token :1; +} _ThriftHiveMetastore_add_token_args__isset; + +class ThriftHiveMetastore_add_token_args { + public: + + ThriftHiveMetastore_add_token_args(const ThriftHiveMetastore_add_token_args&); + ThriftHiveMetastore_add_token_args& operator=(const ThriftHiveMetastore_add_token_args&); + ThriftHiveMetastore_add_token_args() noexcept; + + virtual ~ThriftHiveMetastore_add_token_args() noexcept; + std::string token_identifier; + std::string delegation_token; + + _ThriftHiveMetastore_add_token_args__isset __isset; + + void __set_token_identifier(const std::string& val); + + void __set_delegation_token(const std::string& val); + + bool operator == (const ThriftHiveMetastore_add_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_token_pargs() noexcept; + const std::string* token_identifier; + const std::string* delegation_token; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_token_result__isset { + _ThriftHiveMetastore_add_token_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_token_result__isset; + +class ThriftHiveMetastore_add_token_result { + public: + + ThriftHiveMetastore_add_token_result(const ThriftHiveMetastore_add_token_result&) noexcept; + ThriftHiveMetastore_add_token_result& operator=(const ThriftHiveMetastore_add_token_result&) noexcept; + ThriftHiveMetastore_add_token_result() noexcept; + + virtual ~ThriftHiveMetastore_add_token_result() noexcept; + bool success; + + _ThriftHiveMetastore_add_token_result__isset __isset; + + void __set_success(const bool val); + + bool operator == (const ThriftHiveMetastore_add_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_token_presult__isset { + _ThriftHiveMetastore_add_token_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_token_presult__isset; + +class ThriftHiveMetastore_add_token_presult { + public: + + + virtual ~ThriftHiveMetastore_add_token_presult() noexcept; + bool* success; + + _ThriftHiveMetastore_add_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_remove_token_args__isset { + _ThriftHiveMetastore_remove_token_args__isset() : token_identifier(false) {} + bool token_identifier :1; +} _ThriftHiveMetastore_remove_token_args__isset; + +class ThriftHiveMetastore_remove_token_args { + public: + + ThriftHiveMetastore_remove_token_args(const ThriftHiveMetastore_remove_token_args&); + ThriftHiveMetastore_remove_token_args& operator=(const ThriftHiveMetastore_remove_token_args&); + ThriftHiveMetastore_remove_token_args() noexcept; + + virtual ~ThriftHiveMetastore_remove_token_args() noexcept; + std::string token_identifier; + + _ThriftHiveMetastore_remove_token_args__isset __isset; + + void __set_token_identifier(const std::string& val); + + bool operator == (const ThriftHiveMetastore_remove_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_remove_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_remove_token_pargs() noexcept; + const std::string* token_identifier; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_token_result__isset { + _ThriftHiveMetastore_remove_token_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_remove_token_result__isset; + +class ThriftHiveMetastore_remove_token_result { + public: + + ThriftHiveMetastore_remove_token_result(const ThriftHiveMetastore_remove_token_result&) noexcept; + ThriftHiveMetastore_remove_token_result& operator=(const ThriftHiveMetastore_remove_token_result&) noexcept; + ThriftHiveMetastore_remove_token_result() noexcept; + + virtual ~ThriftHiveMetastore_remove_token_result() noexcept; + bool success; + + _ThriftHiveMetastore_remove_token_result__isset __isset; + + void __set_success(const bool val); + + bool operator == (const ThriftHiveMetastore_remove_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_token_presult__isset { + _ThriftHiveMetastore_remove_token_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_remove_token_presult__isset; + +class ThriftHiveMetastore_remove_token_presult { + public: + + + virtual ~ThriftHiveMetastore_remove_token_presult() noexcept; + bool* success; + + _ThriftHiveMetastore_remove_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_token_args__isset { + _ThriftHiveMetastore_get_token_args__isset() : token_identifier(false) {} + bool token_identifier :1; +} _ThriftHiveMetastore_get_token_args__isset; + +class ThriftHiveMetastore_get_token_args { + public: + + ThriftHiveMetastore_get_token_args(const ThriftHiveMetastore_get_token_args&); + ThriftHiveMetastore_get_token_args& operator=(const ThriftHiveMetastore_get_token_args&); + ThriftHiveMetastore_get_token_args() noexcept; + + virtual ~ThriftHiveMetastore_get_token_args() noexcept; + std::string token_identifier; + + _ThriftHiveMetastore_get_token_args__isset __isset; + + void __set_token_identifier(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_token_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_token_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_token_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_token_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_token_pargs() noexcept; + const std::string* token_identifier; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_token_result__isset { + _ThriftHiveMetastore_get_token_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_token_result__isset; + +class ThriftHiveMetastore_get_token_result { + public: + + ThriftHiveMetastore_get_token_result(const ThriftHiveMetastore_get_token_result&); + ThriftHiveMetastore_get_token_result& operator=(const ThriftHiveMetastore_get_token_result&); + ThriftHiveMetastore_get_token_result() noexcept; + + virtual ~ThriftHiveMetastore_get_token_result() noexcept; + std::string success; + + _ThriftHiveMetastore_get_token_result__isset __isset; + + void __set_success(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_token_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_token_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_token_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_token_presult__isset { + _ThriftHiveMetastore_get_token_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_token_presult__isset; + +class ThriftHiveMetastore_get_token_presult { + public: + + + virtual ~ThriftHiveMetastore_get_token_presult() noexcept; + std::string* success; + + _ThriftHiveMetastore_get_token_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_all_token_identifiers_args { + public: + + ThriftHiveMetastore_get_all_token_identifiers_args(const ThriftHiveMetastore_get_all_token_identifiers_args&) noexcept; + ThriftHiveMetastore_get_all_token_identifiers_args& operator=(const ThriftHiveMetastore_get_all_token_identifiers_args&) noexcept; + ThriftHiveMetastore_get_all_token_identifiers_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_token_identifiers_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_all_token_identifiers_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_all_token_identifiers_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_token_identifiers_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_token_identifiers_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_token_identifiers_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_token_identifiers_result__isset { + _ThriftHiveMetastore_get_all_token_identifiers_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_all_token_identifiers_result__isset; + +class ThriftHiveMetastore_get_all_token_identifiers_result { + public: + + ThriftHiveMetastore_get_all_token_identifiers_result(const ThriftHiveMetastore_get_all_token_identifiers_result&); + ThriftHiveMetastore_get_all_token_identifiers_result& operator=(const ThriftHiveMetastore_get_all_token_identifiers_result&); + ThriftHiveMetastore_get_all_token_identifiers_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_token_identifiers_result() noexcept; + std::vector success; + + _ThriftHiveMetastore_get_all_token_identifiers_result__isset __isset; + + void __set_success(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_all_token_identifiers_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_token_identifiers_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_token_identifiers_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_token_identifiers_presult__isset { + _ThriftHiveMetastore_get_all_token_identifiers_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_all_token_identifiers_presult__isset; + +class ThriftHiveMetastore_get_all_token_identifiers_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_token_identifiers_presult() noexcept; + std::vector * success; + + _ThriftHiveMetastore_get_all_token_identifiers_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_master_key_args__isset { + _ThriftHiveMetastore_add_master_key_args__isset() : key(false) {} + bool key :1; +} _ThriftHiveMetastore_add_master_key_args__isset; + +class ThriftHiveMetastore_add_master_key_args { + public: + + ThriftHiveMetastore_add_master_key_args(const ThriftHiveMetastore_add_master_key_args&); + ThriftHiveMetastore_add_master_key_args& operator=(const ThriftHiveMetastore_add_master_key_args&); + ThriftHiveMetastore_add_master_key_args() noexcept; + + virtual ~ThriftHiveMetastore_add_master_key_args() noexcept; + std::string key; + + _ThriftHiveMetastore_add_master_key_args__isset __isset; + + void __set_key(const std::string& val); + + bool operator == (const ThriftHiveMetastore_add_master_key_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_master_key_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_master_key_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_master_key_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_master_key_pargs() noexcept; + const std::string* key; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_master_key_result__isset { + _ThriftHiveMetastore_add_master_key_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_add_master_key_result__isset; + +class ThriftHiveMetastore_add_master_key_result { + public: + + ThriftHiveMetastore_add_master_key_result(const ThriftHiveMetastore_add_master_key_result&); + ThriftHiveMetastore_add_master_key_result& operator=(const ThriftHiveMetastore_add_master_key_result&); + ThriftHiveMetastore_add_master_key_result() noexcept; + + virtual ~ThriftHiveMetastore_add_master_key_result() noexcept; + int32_t success; + MetaException o1; + + _ThriftHiveMetastore_add_master_key_result__isset __isset; + + void __set_success(const int32_t val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_master_key_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_master_key_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_master_key_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_master_key_presult__isset { + _ThriftHiveMetastore_add_master_key_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_add_master_key_presult__isset; + +class ThriftHiveMetastore_add_master_key_presult { + public: + + + virtual ~ThriftHiveMetastore_add_master_key_presult() noexcept; + int32_t* success; + MetaException o1; + + _ThriftHiveMetastore_add_master_key_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_master_key_args__isset { + _ThriftHiveMetastore_update_master_key_args__isset() : seq_number(false), key(false) {} + bool seq_number :1; + bool key :1; +} _ThriftHiveMetastore_update_master_key_args__isset; + +class ThriftHiveMetastore_update_master_key_args { + public: + + ThriftHiveMetastore_update_master_key_args(const ThriftHiveMetastore_update_master_key_args&); + ThriftHiveMetastore_update_master_key_args& operator=(const ThriftHiveMetastore_update_master_key_args&); + ThriftHiveMetastore_update_master_key_args() noexcept; + + virtual ~ThriftHiveMetastore_update_master_key_args() noexcept; + int32_t seq_number; + std::string key; + + _ThriftHiveMetastore_update_master_key_args__isset __isset; + + void __set_seq_number(const int32_t val); + + void __set_key(const std::string& val); + + bool operator == (const ThriftHiveMetastore_update_master_key_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_master_key_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_master_key_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_master_key_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_master_key_pargs() noexcept; + const int32_t* seq_number; + const std::string* key; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_master_key_result__isset { + _ThriftHiveMetastore_update_master_key_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_update_master_key_result__isset; + +class ThriftHiveMetastore_update_master_key_result { + public: + + ThriftHiveMetastore_update_master_key_result(const ThriftHiveMetastore_update_master_key_result&); + ThriftHiveMetastore_update_master_key_result& operator=(const ThriftHiveMetastore_update_master_key_result&); + ThriftHiveMetastore_update_master_key_result() noexcept; + + virtual ~ThriftHiveMetastore_update_master_key_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_update_master_key_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_update_master_key_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_master_key_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_master_key_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_master_key_presult__isset { + _ThriftHiveMetastore_update_master_key_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_update_master_key_presult__isset; + +class ThriftHiveMetastore_update_master_key_presult { + public: + + + virtual ~ThriftHiveMetastore_update_master_key_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_update_master_key_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_remove_master_key_args__isset { + _ThriftHiveMetastore_remove_master_key_args__isset() : key_seq(false) {} + bool key_seq :1; +} _ThriftHiveMetastore_remove_master_key_args__isset; + +class ThriftHiveMetastore_remove_master_key_args { + public: + + ThriftHiveMetastore_remove_master_key_args(const ThriftHiveMetastore_remove_master_key_args&) noexcept; + ThriftHiveMetastore_remove_master_key_args& operator=(const ThriftHiveMetastore_remove_master_key_args&) noexcept; + ThriftHiveMetastore_remove_master_key_args() noexcept; + + virtual ~ThriftHiveMetastore_remove_master_key_args() noexcept; + int32_t key_seq; + + _ThriftHiveMetastore_remove_master_key_args__isset __isset; + + void __set_key_seq(const int32_t val); + + bool operator == (const ThriftHiveMetastore_remove_master_key_args & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_master_key_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_master_key_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_remove_master_key_pargs { + public: + + + virtual ~ThriftHiveMetastore_remove_master_key_pargs() noexcept; + const int32_t* key_seq; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_master_key_result__isset { + _ThriftHiveMetastore_remove_master_key_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_remove_master_key_result__isset; + +class ThriftHiveMetastore_remove_master_key_result { + public: + + ThriftHiveMetastore_remove_master_key_result(const ThriftHiveMetastore_remove_master_key_result&) noexcept; + ThriftHiveMetastore_remove_master_key_result& operator=(const ThriftHiveMetastore_remove_master_key_result&) noexcept; + ThriftHiveMetastore_remove_master_key_result() noexcept; + + virtual ~ThriftHiveMetastore_remove_master_key_result() noexcept; + bool success; + + _ThriftHiveMetastore_remove_master_key_result__isset __isset; + + void __set_success(const bool val); + + bool operator == (const ThriftHiveMetastore_remove_master_key_result & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_master_key_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_master_key_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_master_key_presult__isset { + _ThriftHiveMetastore_remove_master_key_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_remove_master_key_presult__isset; + +class ThriftHiveMetastore_remove_master_key_presult { + public: + + + virtual ~ThriftHiveMetastore_remove_master_key_presult() noexcept; + bool* success; + + _ThriftHiveMetastore_remove_master_key_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_master_keys_args { + public: + + ThriftHiveMetastore_get_master_keys_args(const ThriftHiveMetastore_get_master_keys_args&) noexcept; + ThriftHiveMetastore_get_master_keys_args& operator=(const ThriftHiveMetastore_get_master_keys_args&) noexcept; + ThriftHiveMetastore_get_master_keys_args() noexcept; + + virtual ~ThriftHiveMetastore_get_master_keys_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_master_keys_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_master_keys_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_master_keys_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_master_keys_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_master_keys_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_master_keys_result__isset { + _ThriftHiveMetastore_get_master_keys_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_master_keys_result__isset; + +class ThriftHiveMetastore_get_master_keys_result { + public: + + ThriftHiveMetastore_get_master_keys_result(const ThriftHiveMetastore_get_master_keys_result&); + ThriftHiveMetastore_get_master_keys_result& operator=(const ThriftHiveMetastore_get_master_keys_result&); + ThriftHiveMetastore_get_master_keys_result() noexcept; + + virtual ~ThriftHiveMetastore_get_master_keys_result() noexcept; + std::vector success; + + _ThriftHiveMetastore_get_master_keys_result__isset __isset; + + void __set_success(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_get_master_keys_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_master_keys_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_master_keys_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_master_keys_presult__isset { + _ThriftHiveMetastore_get_master_keys_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_master_keys_presult__isset; + +class ThriftHiveMetastore_get_master_keys_presult { + public: + + + virtual ~ThriftHiveMetastore_get_master_keys_presult() noexcept; + std::vector * success; + + _ThriftHiveMetastore_get_master_keys_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_open_txns_args { + public: + + ThriftHiveMetastore_get_open_txns_args(const ThriftHiveMetastore_get_open_txns_args&) noexcept; + ThriftHiveMetastore_get_open_txns_args& operator=(const ThriftHiveMetastore_get_open_txns_args&) noexcept; + ThriftHiveMetastore_get_open_txns_args() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_open_txns_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_open_txns_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_result__isset { + _ThriftHiveMetastore_get_open_txns_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_result__isset; + +class ThriftHiveMetastore_get_open_txns_result { + public: + + ThriftHiveMetastore_get_open_txns_result(const ThriftHiveMetastore_get_open_txns_result&); + ThriftHiveMetastore_get_open_txns_result& operator=(const ThriftHiveMetastore_get_open_txns_result&); + ThriftHiveMetastore_get_open_txns_result() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_result() noexcept; + GetOpenTxnsResponse success; + + _ThriftHiveMetastore_get_open_txns_result__isset __isset; + + void __set_success(const GetOpenTxnsResponse& val); + + bool operator == (const ThriftHiveMetastore_get_open_txns_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_presult__isset { + _ThriftHiveMetastore_get_open_txns_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_presult__isset; + +class ThriftHiveMetastore_get_open_txns_presult { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_presult() noexcept; + GetOpenTxnsResponse* success; + + _ThriftHiveMetastore_get_open_txns_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_open_txns_info_args { + public: + + ThriftHiveMetastore_get_open_txns_info_args(const ThriftHiveMetastore_get_open_txns_info_args&) noexcept; + ThriftHiveMetastore_get_open_txns_info_args& operator=(const ThriftHiveMetastore_get_open_txns_info_args&) noexcept; + ThriftHiveMetastore_get_open_txns_info_args() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_info_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_open_txns_info_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_info_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_info_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_open_txns_info_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_info_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_info_result__isset { + _ThriftHiveMetastore_get_open_txns_info_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_info_result__isset; + +class ThriftHiveMetastore_get_open_txns_info_result { + public: + + ThriftHiveMetastore_get_open_txns_info_result(const ThriftHiveMetastore_get_open_txns_info_result&); + ThriftHiveMetastore_get_open_txns_info_result& operator=(const ThriftHiveMetastore_get_open_txns_info_result&); + ThriftHiveMetastore_get_open_txns_info_result() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_info_result() noexcept; + GetOpenTxnsInfoResponse success; + + _ThriftHiveMetastore_get_open_txns_info_result__isset __isset; + + void __set_success(const GetOpenTxnsInfoResponse& val); + + bool operator == (const ThriftHiveMetastore_get_open_txns_info_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_info_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_info_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_info_presult__isset { + _ThriftHiveMetastore_get_open_txns_info_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_info_presult__isset; + +class ThriftHiveMetastore_get_open_txns_info_presult { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_info_presult() noexcept; + GetOpenTxnsInfoResponse* success; + + _ThriftHiveMetastore_get_open_txns_info_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_open_txns_args__isset { + _ThriftHiveMetastore_open_txns_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_open_txns_args__isset; + +class ThriftHiveMetastore_open_txns_args { + public: + + ThriftHiveMetastore_open_txns_args(const ThriftHiveMetastore_open_txns_args&); + ThriftHiveMetastore_open_txns_args& operator=(const ThriftHiveMetastore_open_txns_args&); + ThriftHiveMetastore_open_txns_args() noexcept; + + virtual ~ThriftHiveMetastore_open_txns_args() noexcept; + OpenTxnRequest rqst; + + _ThriftHiveMetastore_open_txns_args__isset __isset; + + void __set_rqst(const OpenTxnRequest& val); + + bool operator == (const ThriftHiveMetastore_open_txns_args & rhs) const; + bool operator != (const ThriftHiveMetastore_open_txns_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_open_txns_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_open_txns_pargs { + public: + + + virtual ~ThriftHiveMetastore_open_txns_pargs() noexcept; + const OpenTxnRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_open_txns_result__isset { + _ThriftHiveMetastore_open_txns_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_open_txns_result__isset; + +class ThriftHiveMetastore_open_txns_result { + public: + + ThriftHiveMetastore_open_txns_result(const ThriftHiveMetastore_open_txns_result&); + ThriftHiveMetastore_open_txns_result& operator=(const ThriftHiveMetastore_open_txns_result&); + ThriftHiveMetastore_open_txns_result() noexcept; + + virtual ~ThriftHiveMetastore_open_txns_result() noexcept; + OpenTxnsResponse success; + + _ThriftHiveMetastore_open_txns_result__isset __isset; + + void __set_success(const OpenTxnsResponse& val); + + bool operator == (const ThriftHiveMetastore_open_txns_result & rhs) const; + bool operator != (const ThriftHiveMetastore_open_txns_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_open_txns_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_open_txns_presult__isset { + _ThriftHiveMetastore_open_txns_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_open_txns_presult__isset; + +class ThriftHiveMetastore_open_txns_presult { + public: + + + virtual ~ThriftHiveMetastore_open_txns_presult() noexcept; + OpenTxnsResponse* success; + + _ThriftHiveMetastore_open_txns_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_abort_txn_args__isset { + _ThriftHiveMetastore_abort_txn_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_abort_txn_args__isset; + +class ThriftHiveMetastore_abort_txn_args { + public: + + ThriftHiveMetastore_abort_txn_args(const ThriftHiveMetastore_abort_txn_args&); + ThriftHiveMetastore_abort_txn_args& operator=(const ThriftHiveMetastore_abort_txn_args&); + ThriftHiveMetastore_abort_txn_args() noexcept; + + virtual ~ThriftHiveMetastore_abort_txn_args() noexcept; + AbortTxnRequest rqst; + + _ThriftHiveMetastore_abort_txn_args__isset __isset; + + void __set_rqst(const AbortTxnRequest& val); + + bool operator == (const ThriftHiveMetastore_abort_txn_args & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_txn_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txn_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_abort_txn_pargs { + public: + + + virtual ~ThriftHiveMetastore_abort_txn_pargs() noexcept; + const AbortTxnRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txn_result__isset { + _ThriftHiveMetastore_abort_txn_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txn_result__isset; + +class ThriftHiveMetastore_abort_txn_result { + public: + + ThriftHiveMetastore_abort_txn_result(const ThriftHiveMetastore_abort_txn_result&); + ThriftHiveMetastore_abort_txn_result& operator=(const ThriftHiveMetastore_abort_txn_result&); + ThriftHiveMetastore_abort_txn_result() noexcept; + + virtual ~ThriftHiveMetastore_abort_txn_result() noexcept; + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txn_result__isset __isset; + + void __set_o1(const NoSuchTxnException& val); + + bool operator == (const ThriftHiveMetastore_abort_txn_result & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_txn_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txn_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txn_presult__isset { + _ThriftHiveMetastore_abort_txn_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txn_presult__isset; + +class ThriftHiveMetastore_abort_txn_presult { + public: + + + virtual ~ThriftHiveMetastore_abort_txn_presult() noexcept; + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txn_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_abort_txns_args__isset { + _ThriftHiveMetastore_abort_txns_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_abort_txns_args__isset; + +class ThriftHiveMetastore_abort_txns_args { + public: + + ThriftHiveMetastore_abort_txns_args(const ThriftHiveMetastore_abort_txns_args&); + ThriftHiveMetastore_abort_txns_args& operator=(const ThriftHiveMetastore_abort_txns_args&); + ThriftHiveMetastore_abort_txns_args() noexcept; + + virtual ~ThriftHiveMetastore_abort_txns_args() noexcept; + AbortTxnsRequest rqst; + + _ThriftHiveMetastore_abort_txns_args__isset __isset; + + void __set_rqst(const AbortTxnsRequest& val); + + bool operator == (const ThriftHiveMetastore_abort_txns_args & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_txns_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txns_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_abort_txns_pargs { + public: + + + virtual ~ThriftHiveMetastore_abort_txns_pargs() noexcept; + const AbortTxnsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txns_result__isset { + _ThriftHiveMetastore_abort_txns_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txns_result__isset; + +class ThriftHiveMetastore_abort_txns_result { + public: + + ThriftHiveMetastore_abort_txns_result(const ThriftHiveMetastore_abort_txns_result&); + ThriftHiveMetastore_abort_txns_result& operator=(const ThriftHiveMetastore_abort_txns_result&); + ThriftHiveMetastore_abort_txns_result() noexcept; + + virtual ~ThriftHiveMetastore_abort_txns_result() noexcept; + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txns_result__isset __isset; + + void __set_o1(const NoSuchTxnException& val); + + bool operator == (const ThriftHiveMetastore_abort_txns_result & rhs) const; + bool operator != (const ThriftHiveMetastore_abort_txns_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txns_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txns_presult__isset { + _ThriftHiveMetastore_abort_txns_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txns_presult__isset; + +class ThriftHiveMetastore_abort_txns_presult { + public: + + + virtual ~ThriftHiveMetastore_abort_txns_presult() noexcept; + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txns_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_commit_txn_args__isset { + _ThriftHiveMetastore_commit_txn_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_commit_txn_args__isset; + +class ThriftHiveMetastore_commit_txn_args { + public: + + ThriftHiveMetastore_commit_txn_args(const ThriftHiveMetastore_commit_txn_args&); + ThriftHiveMetastore_commit_txn_args& operator=(const ThriftHiveMetastore_commit_txn_args&); + ThriftHiveMetastore_commit_txn_args() noexcept; + + virtual ~ThriftHiveMetastore_commit_txn_args() noexcept; + CommitTxnRequest rqst; + + _ThriftHiveMetastore_commit_txn_args__isset __isset; + + void __set_rqst(const CommitTxnRequest& val); + + bool operator == (const ThriftHiveMetastore_commit_txn_args & rhs) const; + bool operator != (const ThriftHiveMetastore_commit_txn_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_commit_txn_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_commit_txn_pargs { + public: + + + virtual ~ThriftHiveMetastore_commit_txn_pargs() noexcept; + const CommitTxnRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_commit_txn_result__isset { + _ThriftHiveMetastore_commit_txn_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_commit_txn_result__isset; + +class ThriftHiveMetastore_commit_txn_result { + public: + + ThriftHiveMetastore_commit_txn_result(const ThriftHiveMetastore_commit_txn_result&); + ThriftHiveMetastore_commit_txn_result& operator=(const ThriftHiveMetastore_commit_txn_result&); + ThriftHiveMetastore_commit_txn_result() noexcept; + + virtual ~ThriftHiveMetastore_commit_txn_result() noexcept; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_commit_txn_result__isset __isset; + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const TxnAbortedException& val); + + bool operator == (const ThriftHiveMetastore_commit_txn_result & rhs) const; + bool operator != (const ThriftHiveMetastore_commit_txn_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_commit_txn_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_commit_txn_presult__isset { + _ThriftHiveMetastore_commit_txn_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_commit_txn_presult__isset; + +class ThriftHiveMetastore_commit_txn_presult { + public: + + + virtual ~ThriftHiveMetastore_commit_txn_presult() noexcept; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_commit_txn_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_latest_txnid_in_conflict_args__isset { + _ThriftHiveMetastore_get_latest_txnid_in_conflict_args__isset() : txnId(false) {} + bool txnId :1; +} _ThriftHiveMetastore_get_latest_txnid_in_conflict_args__isset; + +class ThriftHiveMetastore_get_latest_txnid_in_conflict_args { + public: + + ThriftHiveMetastore_get_latest_txnid_in_conflict_args(const ThriftHiveMetastore_get_latest_txnid_in_conflict_args&) noexcept; + ThriftHiveMetastore_get_latest_txnid_in_conflict_args& operator=(const ThriftHiveMetastore_get_latest_txnid_in_conflict_args&) noexcept; + ThriftHiveMetastore_get_latest_txnid_in_conflict_args() noexcept; + + virtual ~ThriftHiveMetastore_get_latest_txnid_in_conflict_args() noexcept; + int64_t txnId; + + _ThriftHiveMetastore_get_latest_txnid_in_conflict_args__isset __isset; + + void __set_txnId(const int64_t val); + + bool operator == (const ThriftHiveMetastore_get_latest_txnid_in_conflict_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_latest_txnid_in_conflict_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_latest_txnid_in_conflict_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_latest_txnid_in_conflict_pargs() noexcept; + const int64_t* txnId; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_latest_txnid_in_conflict_result__isset { + _ThriftHiveMetastore_get_latest_txnid_in_conflict_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_latest_txnid_in_conflict_result__isset; + +class ThriftHiveMetastore_get_latest_txnid_in_conflict_result { + public: + + ThriftHiveMetastore_get_latest_txnid_in_conflict_result(const ThriftHiveMetastore_get_latest_txnid_in_conflict_result&); + ThriftHiveMetastore_get_latest_txnid_in_conflict_result& operator=(const ThriftHiveMetastore_get_latest_txnid_in_conflict_result&); + ThriftHiveMetastore_get_latest_txnid_in_conflict_result() noexcept; + + virtual ~ThriftHiveMetastore_get_latest_txnid_in_conflict_result() noexcept; + int64_t success; + MetaException o1; + + _ThriftHiveMetastore_get_latest_txnid_in_conflict_result__isset __isset; + + void __set_success(const int64_t val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_latest_txnid_in_conflict_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_latest_txnid_in_conflict_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_latest_txnid_in_conflict_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_latest_txnid_in_conflict_presult__isset { + _ThriftHiveMetastore_get_latest_txnid_in_conflict_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_latest_txnid_in_conflict_presult__isset; + +class ThriftHiveMetastore_get_latest_txnid_in_conflict_presult { + public: + + + virtual ~ThriftHiveMetastore_get_latest_txnid_in_conflict_presult() noexcept; + int64_t* success; + MetaException o1; + + _ThriftHiveMetastore_get_latest_txnid_in_conflict_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_repl_tbl_writeid_state_args__isset { + _ThriftHiveMetastore_repl_tbl_writeid_state_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_repl_tbl_writeid_state_args__isset; + +class ThriftHiveMetastore_repl_tbl_writeid_state_args { + public: + + ThriftHiveMetastore_repl_tbl_writeid_state_args(const ThriftHiveMetastore_repl_tbl_writeid_state_args&); + ThriftHiveMetastore_repl_tbl_writeid_state_args& operator=(const ThriftHiveMetastore_repl_tbl_writeid_state_args&); + ThriftHiveMetastore_repl_tbl_writeid_state_args() noexcept; + + virtual ~ThriftHiveMetastore_repl_tbl_writeid_state_args() noexcept; + ReplTblWriteIdStateRequest rqst; + + _ThriftHiveMetastore_repl_tbl_writeid_state_args__isset __isset; + + void __set_rqst(const ReplTblWriteIdStateRequest& val); + + bool operator == (const ThriftHiveMetastore_repl_tbl_writeid_state_args & rhs) const; + bool operator != (const ThriftHiveMetastore_repl_tbl_writeid_state_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_repl_tbl_writeid_state_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_repl_tbl_writeid_state_pargs { + public: + + + virtual ~ThriftHiveMetastore_repl_tbl_writeid_state_pargs() noexcept; + const ReplTblWriteIdStateRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_repl_tbl_writeid_state_result { + public: + + ThriftHiveMetastore_repl_tbl_writeid_state_result(const ThriftHiveMetastore_repl_tbl_writeid_state_result&) noexcept; + ThriftHiveMetastore_repl_tbl_writeid_state_result& operator=(const ThriftHiveMetastore_repl_tbl_writeid_state_result&) noexcept; + ThriftHiveMetastore_repl_tbl_writeid_state_result() noexcept; + + virtual ~ThriftHiveMetastore_repl_tbl_writeid_state_result() noexcept; + + bool operator == (const ThriftHiveMetastore_repl_tbl_writeid_state_result & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_repl_tbl_writeid_state_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_repl_tbl_writeid_state_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_repl_tbl_writeid_state_presult { + public: + + + virtual ~ThriftHiveMetastore_repl_tbl_writeid_state_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_valid_write_ids_args__isset { + _ThriftHiveMetastore_get_valid_write_ids_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_valid_write_ids_args__isset; + +class ThriftHiveMetastore_get_valid_write_ids_args { + public: + + ThriftHiveMetastore_get_valid_write_ids_args(const ThriftHiveMetastore_get_valid_write_ids_args&); + ThriftHiveMetastore_get_valid_write_ids_args& operator=(const ThriftHiveMetastore_get_valid_write_ids_args&); + ThriftHiveMetastore_get_valid_write_ids_args() noexcept; + + virtual ~ThriftHiveMetastore_get_valid_write_ids_args() noexcept; + GetValidWriteIdsRequest rqst; + + _ThriftHiveMetastore_get_valid_write_ids_args__isset __isset; + + void __set_rqst(const GetValidWriteIdsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_valid_write_ids_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_valid_write_ids_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_valid_write_ids_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_valid_write_ids_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_valid_write_ids_pargs() noexcept; + const GetValidWriteIdsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_valid_write_ids_result__isset { + _ThriftHiveMetastore_get_valid_write_ids_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_valid_write_ids_result__isset; + +class ThriftHiveMetastore_get_valid_write_ids_result { + public: + + ThriftHiveMetastore_get_valid_write_ids_result(const ThriftHiveMetastore_get_valid_write_ids_result&); + ThriftHiveMetastore_get_valid_write_ids_result& operator=(const ThriftHiveMetastore_get_valid_write_ids_result&); + ThriftHiveMetastore_get_valid_write_ids_result() noexcept; + + virtual ~ThriftHiveMetastore_get_valid_write_ids_result() noexcept; + GetValidWriteIdsResponse success; + NoSuchTxnException o1; + MetaException o2; + + _ThriftHiveMetastore_get_valid_write_ids_result__isset __isset; + + void __set_success(const GetValidWriteIdsResponse& val); + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_valid_write_ids_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_valid_write_ids_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_valid_write_ids_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_valid_write_ids_presult__isset { + _ThriftHiveMetastore_get_valid_write_ids_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_valid_write_ids_presult__isset; + +class ThriftHiveMetastore_get_valid_write_ids_presult { + public: + + + virtual ~ThriftHiveMetastore_get_valid_write_ids_presult() noexcept; + GetValidWriteIdsResponse* success; + NoSuchTxnException o1; + MetaException o2; + + _ThriftHiveMetastore_get_valid_write_ids_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_write_ids_to_min_history_args__isset { + _ThriftHiveMetastore_add_write_ids_to_min_history_args__isset() : txnId(false), writeIds(false) {} + bool txnId :1; + bool writeIds :1; +} _ThriftHiveMetastore_add_write_ids_to_min_history_args__isset; + +class ThriftHiveMetastore_add_write_ids_to_min_history_args { + public: + + ThriftHiveMetastore_add_write_ids_to_min_history_args(const ThriftHiveMetastore_add_write_ids_to_min_history_args&); + ThriftHiveMetastore_add_write_ids_to_min_history_args& operator=(const ThriftHiveMetastore_add_write_ids_to_min_history_args&); + ThriftHiveMetastore_add_write_ids_to_min_history_args() noexcept; + + virtual ~ThriftHiveMetastore_add_write_ids_to_min_history_args() noexcept; + int64_t txnId; + std::map writeIds; + + _ThriftHiveMetastore_add_write_ids_to_min_history_args__isset __isset; + + void __set_txnId(const int64_t val); + + void __set_writeIds(const std::map & val); + + bool operator == (const ThriftHiveMetastore_add_write_ids_to_min_history_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_ids_to_min_history_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_ids_to_min_history_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_write_ids_to_min_history_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_write_ids_to_min_history_pargs() noexcept; + const int64_t* txnId; + const std::map * writeIds; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_ids_to_min_history_result__isset { + _ThriftHiveMetastore_add_write_ids_to_min_history_result__isset() : o2(false) {} + bool o2 :1; +} _ThriftHiveMetastore_add_write_ids_to_min_history_result__isset; + +class ThriftHiveMetastore_add_write_ids_to_min_history_result { + public: + + ThriftHiveMetastore_add_write_ids_to_min_history_result(const ThriftHiveMetastore_add_write_ids_to_min_history_result&); + ThriftHiveMetastore_add_write_ids_to_min_history_result& operator=(const ThriftHiveMetastore_add_write_ids_to_min_history_result&); + ThriftHiveMetastore_add_write_ids_to_min_history_result() noexcept; + + virtual ~ThriftHiveMetastore_add_write_ids_to_min_history_result() noexcept; + MetaException o2; + + _ThriftHiveMetastore_add_write_ids_to_min_history_result__isset __isset; + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_write_ids_to_min_history_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_ids_to_min_history_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_ids_to_min_history_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_ids_to_min_history_presult__isset { + _ThriftHiveMetastore_add_write_ids_to_min_history_presult__isset() : o2(false) {} + bool o2 :1; +} _ThriftHiveMetastore_add_write_ids_to_min_history_presult__isset; + +class ThriftHiveMetastore_add_write_ids_to_min_history_presult { + public: + + + virtual ~ThriftHiveMetastore_add_write_ids_to_min_history_presult() noexcept; + MetaException o2; + + _ThriftHiveMetastore_add_write_ids_to_min_history_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_allocate_table_write_ids_args__isset { + _ThriftHiveMetastore_allocate_table_write_ids_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_allocate_table_write_ids_args__isset; + +class ThriftHiveMetastore_allocate_table_write_ids_args { + public: + + ThriftHiveMetastore_allocate_table_write_ids_args(const ThriftHiveMetastore_allocate_table_write_ids_args&); + ThriftHiveMetastore_allocate_table_write_ids_args& operator=(const ThriftHiveMetastore_allocate_table_write_ids_args&); + ThriftHiveMetastore_allocate_table_write_ids_args() noexcept; + + virtual ~ThriftHiveMetastore_allocate_table_write_ids_args() noexcept; + AllocateTableWriteIdsRequest rqst; + + _ThriftHiveMetastore_allocate_table_write_ids_args__isset __isset; + + void __set_rqst(const AllocateTableWriteIdsRequest& val); + + bool operator == (const ThriftHiveMetastore_allocate_table_write_ids_args & rhs) const; + bool operator != (const ThriftHiveMetastore_allocate_table_write_ids_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_allocate_table_write_ids_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_allocate_table_write_ids_pargs { + public: + + + virtual ~ThriftHiveMetastore_allocate_table_write_ids_pargs() noexcept; + const AllocateTableWriteIdsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_allocate_table_write_ids_result__isset { + _ThriftHiveMetastore_allocate_table_write_ids_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_allocate_table_write_ids_result__isset; + +class ThriftHiveMetastore_allocate_table_write_ids_result { + public: + + ThriftHiveMetastore_allocate_table_write_ids_result(const ThriftHiveMetastore_allocate_table_write_ids_result&); + ThriftHiveMetastore_allocate_table_write_ids_result& operator=(const ThriftHiveMetastore_allocate_table_write_ids_result&); + ThriftHiveMetastore_allocate_table_write_ids_result() noexcept; + + virtual ~ThriftHiveMetastore_allocate_table_write_ids_result() noexcept; + AllocateTableWriteIdsResponse success; + NoSuchTxnException o1; + TxnAbortedException o2; + MetaException o3; + + _ThriftHiveMetastore_allocate_table_write_ids_result__isset __isset; + + void __set_success(const AllocateTableWriteIdsResponse& val); + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const TxnAbortedException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_allocate_table_write_ids_result & rhs) const; + bool operator != (const ThriftHiveMetastore_allocate_table_write_ids_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_allocate_table_write_ids_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_allocate_table_write_ids_presult__isset { + _ThriftHiveMetastore_allocate_table_write_ids_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_allocate_table_write_ids_presult__isset; + +class ThriftHiveMetastore_allocate_table_write_ids_presult { + public: + + + virtual ~ThriftHiveMetastore_allocate_table_write_ids_presult() noexcept; + AllocateTableWriteIdsResponse* success; + NoSuchTxnException o1; + TxnAbortedException o2; + MetaException o3; + + _ThriftHiveMetastore_allocate_table_write_ids_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_max_allocated_table_write_id_args__isset { + _ThriftHiveMetastore_get_max_allocated_table_write_id_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_max_allocated_table_write_id_args__isset; + +class ThriftHiveMetastore_get_max_allocated_table_write_id_args { + public: + + ThriftHiveMetastore_get_max_allocated_table_write_id_args(const ThriftHiveMetastore_get_max_allocated_table_write_id_args&); + ThriftHiveMetastore_get_max_allocated_table_write_id_args& operator=(const ThriftHiveMetastore_get_max_allocated_table_write_id_args&); + ThriftHiveMetastore_get_max_allocated_table_write_id_args() noexcept; + + virtual ~ThriftHiveMetastore_get_max_allocated_table_write_id_args() noexcept; + MaxAllocatedTableWriteIdRequest rqst; + + _ThriftHiveMetastore_get_max_allocated_table_write_id_args__isset __isset; + + void __set_rqst(const MaxAllocatedTableWriteIdRequest& val); + + bool operator == (const ThriftHiveMetastore_get_max_allocated_table_write_id_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_max_allocated_table_write_id_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_max_allocated_table_write_id_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_max_allocated_table_write_id_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_max_allocated_table_write_id_pargs() noexcept; + const MaxAllocatedTableWriteIdRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_max_allocated_table_write_id_result__isset { + _ThriftHiveMetastore_get_max_allocated_table_write_id_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_max_allocated_table_write_id_result__isset; + +class ThriftHiveMetastore_get_max_allocated_table_write_id_result { + public: + + ThriftHiveMetastore_get_max_allocated_table_write_id_result(const ThriftHiveMetastore_get_max_allocated_table_write_id_result&); + ThriftHiveMetastore_get_max_allocated_table_write_id_result& operator=(const ThriftHiveMetastore_get_max_allocated_table_write_id_result&); + ThriftHiveMetastore_get_max_allocated_table_write_id_result() noexcept; + + virtual ~ThriftHiveMetastore_get_max_allocated_table_write_id_result() noexcept; + MaxAllocatedTableWriteIdResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_max_allocated_table_write_id_result__isset __isset; + + void __set_success(const MaxAllocatedTableWriteIdResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_max_allocated_table_write_id_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_max_allocated_table_write_id_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_max_allocated_table_write_id_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_max_allocated_table_write_id_presult__isset { + _ThriftHiveMetastore_get_max_allocated_table_write_id_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_max_allocated_table_write_id_presult__isset; + +class ThriftHiveMetastore_get_max_allocated_table_write_id_presult { + public: + + + virtual ~ThriftHiveMetastore_get_max_allocated_table_write_id_presult() noexcept; + MaxAllocatedTableWriteIdResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_max_allocated_table_write_id_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_seed_write_id_args__isset { + _ThriftHiveMetastore_seed_write_id_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_seed_write_id_args__isset; + +class ThriftHiveMetastore_seed_write_id_args { + public: + + ThriftHiveMetastore_seed_write_id_args(const ThriftHiveMetastore_seed_write_id_args&); + ThriftHiveMetastore_seed_write_id_args& operator=(const ThriftHiveMetastore_seed_write_id_args&); + ThriftHiveMetastore_seed_write_id_args() noexcept; + + virtual ~ThriftHiveMetastore_seed_write_id_args() noexcept; + SeedTableWriteIdsRequest rqst; + + _ThriftHiveMetastore_seed_write_id_args__isset __isset; + + void __set_rqst(const SeedTableWriteIdsRequest& val); + + bool operator == (const ThriftHiveMetastore_seed_write_id_args & rhs) const; + bool operator != (const ThriftHiveMetastore_seed_write_id_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_seed_write_id_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_seed_write_id_pargs { + public: + + + virtual ~ThriftHiveMetastore_seed_write_id_pargs() noexcept; + const SeedTableWriteIdsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_seed_write_id_result__isset { + _ThriftHiveMetastore_seed_write_id_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_seed_write_id_result__isset; + +class ThriftHiveMetastore_seed_write_id_result { + public: + + ThriftHiveMetastore_seed_write_id_result(const ThriftHiveMetastore_seed_write_id_result&); + ThriftHiveMetastore_seed_write_id_result& operator=(const ThriftHiveMetastore_seed_write_id_result&); + ThriftHiveMetastore_seed_write_id_result() noexcept; + + virtual ~ThriftHiveMetastore_seed_write_id_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_seed_write_id_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_seed_write_id_result & rhs) const; + bool operator != (const ThriftHiveMetastore_seed_write_id_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_seed_write_id_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_seed_write_id_presult__isset { + _ThriftHiveMetastore_seed_write_id_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_seed_write_id_presult__isset; + +class ThriftHiveMetastore_seed_write_id_presult { + public: + + + virtual ~ThriftHiveMetastore_seed_write_id_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_seed_write_id_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_seed_txn_id_args__isset { + _ThriftHiveMetastore_seed_txn_id_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_seed_txn_id_args__isset; + +class ThriftHiveMetastore_seed_txn_id_args { + public: + + ThriftHiveMetastore_seed_txn_id_args(const ThriftHiveMetastore_seed_txn_id_args&) noexcept; + ThriftHiveMetastore_seed_txn_id_args& operator=(const ThriftHiveMetastore_seed_txn_id_args&) noexcept; + ThriftHiveMetastore_seed_txn_id_args() noexcept; + + virtual ~ThriftHiveMetastore_seed_txn_id_args() noexcept; + SeedTxnIdRequest rqst; + + _ThriftHiveMetastore_seed_txn_id_args__isset __isset; + + void __set_rqst(const SeedTxnIdRequest& val); + + bool operator == (const ThriftHiveMetastore_seed_txn_id_args & rhs) const; + bool operator != (const ThriftHiveMetastore_seed_txn_id_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_seed_txn_id_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_seed_txn_id_pargs { + public: + + + virtual ~ThriftHiveMetastore_seed_txn_id_pargs() noexcept; + const SeedTxnIdRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_seed_txn_id_result__isset { + _ThriftHiveMetastore_seed_txn_id_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_seed_txn_id_result__isset; + +class ThriftHiveMetastore_seed_txn_id_result { + public: + + ThriftHiveMetastore_seed_txn_id_result(const ThriftHiveMetastore_seed_txn_id_result&); + ThriftHiveMetastore_seed_txn_id_result& operator=(const ThriftHiveMetastore_seed_txn_id_result&); + ThriftHiveMetastore_seed_txn_id_result() noexcept; + + virtual ~ThriftHiveMetastore_seed_txn_id_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_seed_txn_id_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_seed_txn_id_result & rhs) const; + bool operator != (const ThriftHiveMetastore_seed_txn_id_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_seed_txn_id_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_seed_txn_id_presult__isset { + _ThriftHiveMetastore_seed_txn_id_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_seed_txn_id_presult__isset; + +class ThriftHiveMetastore_seed_txn_id_presult { + public: + + + virtual ~ThriftHiveMetastore_seed_txn_id_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_seed_txn_id_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_lock_args__isset { + _ThriftHiveMetastore_lock_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_lock_args__isset; + +class ThriftHiveMetastore_lock_args { + public: + + ThriftHiveMetastore_lock_args(const ThriftHiveMetastore_lock_args&); + ThriftHiveMetastore_lock_args& operator=(const ThriftHiveMetastore_lock_args&); + ThriftHiveMetastore_lock_args() noexcept; + + virtual ~ThriftHiveMetastore_lock_args() noexcept; + LockRequest rqst; + + _ThriftHiveMetastore_lock_args__isset __isset; + + void __set_rqst(const LockRequest& val); + + bool operator == (const ThriftHiveMetastore_lock_args & rhs) const; + bool operator != (const ThriftHiveMetastore_lock_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_lock_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_lock_pargs { + public: + + + virtual ~ThriftHiveMetastore_lock_pargs() noexcept; + const LockRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_lock_result__isset { + _ThriftHiveMetastore_lock_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_lock_result__isset; + +class ThriftHiveMetastore_lock_result { + public: + + ThriftHiveMetastore_lock_result(const ThriftHiveMetastore_lock_result&); + ThriftHiveMetastore_lock_result& operator=(const ThriftHiveMetastore_lock_result&); + ThriftHiveMetastore_lock_result() noexcept; + + virtual ~ThriftHiveMetastore_lock_result() noexcept; + LockResponse success; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_lock_result__isset __isset; + + void __set_success(const LockResponse& val); + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const TxnAbortedException& val); + + bool operator == (const ThriftHiveMetastore_lock_result & rhs) const; + bool operator != (const ThriftHiveMetastore_lock_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_lock_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_lock_presult__isset { + _ThriftHiveMetastore_lock_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_lock_presult__isset; + +class ThriftHiveMetastore_lock_presult { + public: + + + virtual ~ThriftHiveMetastore_lock_presult() noexcept; + LockResponse* success; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_lock_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_check_lock_args__isset { + _ThriftHiveMetastore_check_lock_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_check_lock_args__isset; + +class ThriftHiveMetastore_check_lock_args { + public: + + ThriftHiveMetastore_check_lock_args(const ThriftHiveMetastore_check_lock_args&) noexcept; + ThriftHiveMetastore_check_lock_args& operator=(const ThriftHiveMetastore_check_lock_args&) noexcept; + ThriftHiveMetastore_check_lock_args() noexcept; + + virtual ~ThriftHiveMetastore_check_lock_args() noexcept; + CheckLockRequest rqst; + + _ThriftHiveMetastore_check_lock_args__isset __isset; + + void __set_rqst(const CheckLockRequest& val); + + bool operator == (const ThriftHiveMetastore_check_lock_args & rhs) const; + bool operator != (const ThriftHiveMetastore_check_lock_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_check_lock_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_check_lock_pargs { + public: + + + virtual ~ThriftHiveMetastore_check_lock_pargs() noexcept; + const CheckLockRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_check_lock_result__isset { + _ThriftHiveMetastore_check_lock_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_check_lock_result__isset; + +class ThriftHiveMetastore_check_lock_result { + public: + + ThriftHiveMetastore_check_lock_result(const ThriftHiveMetastore_check_lock_result&); + ThriftHiveMetastore_check_lock_result& operator=(const ThriftHiveMetastore_check_lock_result&); + ThriftHiveMetastore_check_lock_result() noexcept; + + virtual ~ThriftHiveMetastore_check_lock_result() noexcept; + LockResponse success; + NoSuchTxnException o1; + TxnAbortedException o2; + NoSuchLockException o3; + + _ThriftHiveMetastore_check_lock_result__isset __isset; + + void __set_success(const LockResponse& val); + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const TxnAbortedException& val); + + void __set_o3(const NoSuchLockException& val); + + bool operator == (const ThriftHiveMetastore_check_lock_result & rhs) const; + bool operator != (const ThriftHiveMetastore_check_lock_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_check_lock_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_check_lock_presult__isset { + _ThriftHiveMetastore_check_lock_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_check_lock_presult__isset; + +class ThriftHiveMetastore_check_lock_presult { + public: + + + virtual ~ThriftHiveMetastore_check_lock_presult() noexcept; + LockResponse* success; + NoSuchTxnException o1; + TxnAbortedException o2; + NoSuchLockException o3; + + _ThriftHiveMetastore_check_lock_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_unlock_args__isset { + _ThriftHiveMetastore_unlock_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_unlock_args__isset; + +class ThriftHiveMetastore_unlock_args { + public: + + ThriftHiveMetastore_unlock_args(const ThriftHiveMetastore_unlock_args&) noexcept; + ThriftHiveMetastore_unlock_args& operator=(const ThriftHiveMetastore_unlock_args&) noexcept; + ThriftHiveMetastore_unlock_args() noexcept; + + virtual ~ThriftHiveMetastore_unlock_args() noexcept; + UnlockRequest rqst; + + _ThriftHiveMetastore_unlock_args__isset __isset; + + void __set_rqst(const UnlockRequest& val); + + bool operator == (const ThriftHiveMetastore_unlock_args & rhs) const; + bool operator != (const ThriftHiveMetastore_unlock_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_unlock_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_unlock_pargs { + public: + + + virtual ~ThriftHiveMetastore_unlock_pargs() noexcept; + const UnlockRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_unlock_result__isset { + _ThriftHiveMetastore_unlock_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_unlock_result__isset; + +class ThriftHiveMetastore_unlock_result { + public: + + ThriftHiveMetastore_unlock_result(const ThriftHiveMetastore_unlock_result&); + ThriftHiveMetastore_unlock_result& operator=(const ThriftHiveMetastore_unlock_result&); + ThriftHiveMetastore_unlock_result() noexcept; + + virtual ~ThriftHiveMetastore_unlock_result() noexcept; + NoSuchLockException o1; + TxnOpenException o2; + + _ThriftHiveMetastore_unlock_result__isset __isset; + + void __set_o1(const NoSuchLockException& val); + + void __set_o2(const TxnOpenException& val); + + bool operator == (const ThriftHiveMetastore_unlock_result & rhs) const; + bool operator != (const ThriftHiveMetastore_unlock_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_unlock_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_unlock_presult__isset { + _ThriftHiveMetastore_unlock_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_unlock_presult__isset; + +class ThriftHiveMetastore_unlock_presult { + public: + + + virtual ~ThriftHiveMetastore_unlock_presult() noexcept; + NoSuchLockException o1; + TxnOpenException o2; + + _ThriftHiveMetastore_unlock_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_show_locks_args__isset { + _ThriftHiveMetastore_show_locks_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_show_locks_args__isset; + +class ThriftHiveMetastore_show_locks_args { + public: + + ThriftHiveMetastore_show_locks_args(const ThriftHiveMetastore_show_locks_args&); + ThriftHiveMetastore_show_locks_args& operator=(const ThriftHiveMetastore_show_locks_args&); + ThriftHiveMetastore_show_locks_args() noexcept; + + virtual ~ThriftHiveMetastore_show_locks_args() noexcept; + ShowLocksRequest rqst; + + _ThriftHiveMetastore_show_locks_args__isset __isset; + + void __set_rqst(const ShowLocksRequest& val); + + bool operator == (const ThriftHiveMetastore_show_locks_args & rhs) const; + bool operator != (const ThriftHiveMetastore_show_locks_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_show_locks_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_show_locks_pargs { + public: + + + virtual ~ThriftHiveMetastore_show_locks_pargs() noexcept; + const ShowLocksRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_show_locks_result__isset { + _ThriftHiveMetastore_show_locks_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_show_locks_result__isset; + +class ThriftHiveMetastore_show_locks_result { + public: + + ThriftHiveMetastore_show_locks_result(const ThriftHiveMetastore_show_locks_result&); + ThriftHiveMetastore_show_locks_result& operator=(const ThriftHiveMetastore_show_locks_result&); + ThriftHiveMetastore_show_locks_result() noexcept; + + virtual ~ThriftHiveMetastore_show_locks_result() noexcept; + ShowLocksResponse success; + + _ThriftHiveMetastore_show_locks_result__isset __isset; + + void __set_success(const ShowLocksResponse& val); + + bool operator == (const ThriftHiveMetastore_show_locks_result & rhs) const; + bool operator != (const ThriftHiveMetastore_show_locks_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_show_locks_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_show_locks_presult__isset { + _ThriftHiveMetastore_show_locks_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_show_locks_presult__isset; + +class ThriftHiveMetastore_show_locks_presult { + public: + + + virtual ~ThriftHiveMetastore_show_locks_presult() noexcept; + ShowLocksResponse* success; + + _ThriftHiveMetastore_show_locks_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_args__isset { + _ThriftHiveMetastore_heartbeat_args__isset() : ids(false) {} + bool ids :1; +} _ThriftHiveMetastore_heartbeat_args__isset; + +class ThriftHiveMetastore_heartbeat_args { + public: + + ThriftHiveMetastore_heartbeat_args(const ThriftHiveMetastore_heartbeat_args&) noexcept; + ThriftHiveMetastore_heartbeat_args& operator=(const ThriftHiveMetastore_heartbeat_args&) noexcept; + ThriftHiveMetastore_heartbeat_args() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_args() noexcept; + HeartbeatRequest ids; + + _ThriftHiveMetastore_heartbeat_args__isset __isset; + + void __set_ids(const HeartbeatRequest& val); + + bool operator == (const ThriftHiveMetastore_heartbeat_args & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_heartbeat_pargs { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_pargs() noexcept; + const HeartbeatRequest* ids; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_result__isset { + _ThriftHiveMetastore_heartbeat_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_heartbeat_result__isset; + +class ThriftHiveMetastore_heartbeat_result { + public: + + ThriftHiveMetastore_heartbeat_result(const ThriftHiveMetastore_heartbeat_result&); + ThriftHiveMetastore_heartbeat_result& operator=(const ThriftHiveMetastore_heartbeat_result&); + ThriftHiveMetastore_heartbeat_result() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_result() noexcept; + NoSuchLockException o1; + NoSuchTxnException o2; + TxnAbortedException o3; + + _ThriftHiveMetastore_heartbeat_result__isset __isset; + + void __set_o1(const NoSuchLockException& val); + + void __set_o2(const NoSuchTxnException& val); + + void __set_o3(const TxnAbortedException& val); + + bool operator == (const ThriftHiveMetastore_heartbeat_result & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_presult__isset { + _ThriftHiveMetastore_heartbeat_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_heartbeat_presult__isset; + +class ThriftHiveMetastore_heartbeat_presult { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_presult() noexcept; + NoSuchLockException o1; + NoSuchTxnException o2; + TxnAbortedException o3; + + _ThriftHiveMetastore_heartbeat_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_txn_range_args__isset { + _ThriftHiveMetastore_heartbeat_txn_range_args__isset() : txns(false) {} + bool txns :1; +} _ThriftHiveMetastore_heartbeat_txn_range_args__isset; + +class ThriftHiveMetastore_heartbeat_txn_range_args { + public: + + ThriftHiveMetastore_heartbeat_txn_range_args(const ThriftHiveMetastore_heartbeat_txn_range_args&) noexcept; + ThriftHiveMetastore_heartbeat_txn_range_args& operator=(const ThriftHiveMetastore_heartbeat_txn_range_args&) noexcept; + ThriftHiveMetastore_heartbeat_txn_range_args() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_txn_range_args() noexcept; + HeartbeatTxnRangeRequest txns; + + _ThriftHiveMetastore_heartbeat_txn_range_args__isset __isset; + + void __set_txns(const HeartbeatTxnRangeRequest& val); + + bool operator == (const ThriftHiveMetastore_heartbeat_txn_range_args & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_txn_range_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_txn_range_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_heartbeat_txn_range_pargs { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_txn_range_pargs() noexcept; + const HeartbeatTxnRangeRequest* txns; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_txn_range_result__isset { + _ThriftHiveMetastore_heartbeat_txn_range_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_heartbeat_txn_range_result__isset; + +class ThriftHiveMetastore_heartbeat_txn_range_result { + public: + + ThriftHiveMetastore_heartbeat_txn_range_result(const ThriftHiveMetastore_heartbeat_txn_range_result&); + ThriftHiveMetastore_heartbeat_txn_range_result& operator=(const ThriftHiveMetastore_heartbeat_txn_range_result&); + ThriftHiveMetastore_heartbeat_txn_range_result() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_txn_range_result() noexcept; + HeartbeatTxnRangeResponse success; + + _ThriftHiveMetastore_heartbeat_txn_range_result__isset __isset; + + void __set_success(const HeartbeatTxnRangeResponse& val); + + bool operator == (const ThriftHiveMetastore_heartbeat_txn_range_result & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_txn_range_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_txn_range_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_txn_range_presult__isset { + _ThriftHiveMetastore_heartbeat_txn_range_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_heartbeat_txn_range_presult__isset; + +class ThriftHiveMetastore_heartbeat_txn_range_presult { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_txn_range_presult() noexcept; + HeartbeatTxnRangeResponse* success; + + _ThriftHiveMetastore_heartbeat_txn_range_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_compact_args__isset { + _ThriftHiveMetastore_compact_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_compact_args__isset; + +class ThriftHiveMetastore_compact_args { + public: + + ThriftHiveMetastore_compact_args(const ThriftHiveMetastore_compact_args&); + ThriftHiveMetastore_compact_args& operator=(const ThriftHiveMetastore_compact_args&); + ThriftHiveMetastore_compact_args() noexcept; + + virtual ~ThriftHiveMetastore_compact_args() noexcept; + CompactionRequest rqst; + + _ThriftHiveMetastore_compact_args__isset __isset; + + void __set_rqst(const CompactionRequest& val); + + bool operator == (const ThriftHiveMetastore_compact_args & rhs) const; + bool operator != (const ThriftHiveMetastore_compact_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_compact_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_compact_pargs { + public: + + + virtual ~ThriftHiveMetastore_compact_pargs() noexcept; + const CompactionRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_compact_result { + public: + + ThriftHiveMetastore_compact_result(const ThriftHiveMetastore_compact_result&) noexcept; + ThriftHiveMetastore_compact_result& operator=(const ThriftHiveMetastore_compact_result&) noexcept; + ThriftHiveMetastore_compact_result() noexcept; + + virtual ~ThriftHiveMetastore_compact_result() noexcept; + + bool operator == (const ThriftHiveMetastore_compact_result & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_compact_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_compact_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_compact_presult { + public: + + + virtual ~ThriftHiveMetastore_compact_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_compact2_args__isset { + _ThriftHiveMetastore_compact2_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_compact2_args__isset; + +class ThriftHiveMetastore_compact2_args { + public: + + ThriftHiveMetastore_compact2_args(const ThriftHiveMetastore_compact2_args&); + ThriftHiveMetastore_compact2_args& operator=(const ThriftHiveMetastore_compact2_args&); + ThriftHiveMetastore_compact2_args() noexcept; + + virtual ~ThriftHiveMetastore_compact2_args() noexcept; + CompactionRequest rqst; + + _ThriftHiveMetastore_compact2_args__isset __isset; + + void __set_rqst(const CompactionRequest& val); + + bool operator == (const ThriftHiveMetastore_compact2_args & rhs) const; + bool operator != (const ThriftHiveMetastore_compact2_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_compact2_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_compact2_pargs { + public: + + + virtual ~ThriftHiveMetastore_compact2_pargs() noexcept; + const CompactionRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_compact2_result__isset { + _ThriftHiveMetastore_compact2_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_compact2_result__isset; + +class ThriftHiveMetastore_compact2_result { + public: + + ThriftHiveMetastore_compact2_result(const ThriftHiveMetastore_compact2_result&); + ThriftHiveMetastore_compact2_result& operator=(const ThriftHiveMetastore_compact2_result&); + ThriftHiveMetastore_compact2_result() noexcept; + + virtual ~ThriftHiveMetastore_compact2_result() noexcept; + CompactionResponse success; + + _ThriftHiveMetastore_compact2_result__isset __isset; + + void __set_success(const CompactionResponse& val); + + bool operator == (const ThriftHiveMetastore_compact2_result & rhs) const; + bool operator != (const ThriftHiveMetastore_compact2_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_compact2_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_compact2_presult__isset { + _ThriftHiveMetastore_compact2_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_compact2_presult__isset; + +class ThriftHiveMetastore_compact2_presult { + public: + + + virtual ~ThriftHiveMetastore_compact2_presult() noexcept; + CompactionResponse* success; + + _ThriftHiveMetastore_compact2_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_show_compact_args__isset { + _ThriftHiveMetastore_show_compact_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_show_compact_args__isset; + +class ThriftHiveMetastore_show_compact_args { + public: + + ThriftHiveMetastore_show_compact_args(const ThriftHiveMetastore_show_compact_args&); + ThriftHiveMetastore_show_compact_args& operator=(const ThriftHiveMetastore_show_compact_args&); + ThriftHiveMetastore_show_compact_args() noexcept; + + virtual ~ThriftHiveMetastore_show_compact_args() noexcept; + ShowCompactRequest rqst; + + _ThriftHiveMetastore_show_compact_args__isset __isset; + + void __set_rqst(const ShowCompactRequest& val); + + bool operator == (const ThriftHiveMetastore_show_compact_args & rhs) const; + bool operator != (const ThriftHiveMetastore_show_compact_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_show_compact_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_show_compact_pargs { + public: + + + virtual ~ThriftHiveMetastore_show_compact_pargs() noexcept; + const ShowCompactRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_show_compact_result__isset { + _ThriftHiveMetastore_show_compact_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_show_compact_result__isset; + +class ThriftHiveMetastore_show_compact_result { + public: + + ThriftHiveMetastore_show_compact_result(const ThriftHiveMetastore_show_compact_result&); + ThriftHiveMetastore_show_compact_result& operator=(const ThriftHiveMetastore_show_compact_result&); + ThriftHiveMetastore_show_compact_result() noexcept; + + virtual ~ThriftHiveMetastore_show_compact_result() noexcept; + ShowCompactResponse success; + + _ThriftHiveMetastore_show_compact_result__isset __isset; + + void __set_success(const ShowCompactResponse& val); + + bool operator == (const ThriftHiveMetastore_show_compact_result & rhs) const; + bool operator != (const ThriftHiveMetastore_show_compact_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_show_compact_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_show_compact_presult__isset { + _ThriftHiveMetastore_show_compact_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_show_compact_presult__isset; + +class ThriftHiveMetastore_show_compact_presult { + public: + + + virtual ~ThriftHiveMetastore_show_compact_presult() noexcept; + ShowCompactResponse* success; + + _ThriftHiveMetastore_show_compact_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_submit_for_cleanup_args__isset { + _ThriftHiveMetastore_submit_for_cleanup_args__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_submit_for_cleanup_args__isset; + +class ThriftHiveMetastore_submit_for_cleanup_args { + public: + + ThriftHiveMetastore_submit_for_cleanup_args(const ThriftHiveMetastore_submit_for_cleanup_args&); + ThriftHiveMetastore_submit_for_cleanup_args& operator=(const ThriftHiveMetastore_submit_for_cleanup_args&); + ThriftHiveMetastore_submit_for_cleanup_args() noexcept; + + virtual ~ThriftHiveMetastore_submit_for_cleanup_args() noexcept; + CompactionRequest o1; + int64_t o2; + int64_t o3; + + _ThriftHiveMetastore_submit_for_cleanup_args__isset __isset; + + void __set_o1(const CompactionRequest& val); + + void __set_o2(const int64_t val); + + void __set_o3(const int64_t val); + + bool operator == (const ThriftHiveMetastore_submit_for_cleanup_args & rhs) const; + bool operator != (const ThriftHiveMetastore_submit_for_cleanup_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_submit_for_cleanup_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_submit_for_cleanup_pargs { + public: + + + virtual ~ThriftHiveMetastore_submit_for_cleanup_pargs() noexcept; + const CompactionRequest* o1; + const int64_t* o2; + const int64_t* o3; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_submit_for_cleanup_result__isset { + _ThriftHiveMetastore_submit_for_cleanup_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_submit_for_cleanup_result__isset; + +class ThriftHiveMetastore_submit_for_cleanup_result { + public: + + ThriftHiveMetastore_submit_for_cleanup_result(const ThriftHiveMetastore_submit_for_cleanup_result&); + ThriftHiveMetastore_submit_for_cleanup_result& operator=(const ThriftHiveMetastore_submit_for_cleanup_result&); + ThriftHiveMetastore_submit_for_cleanup_result() noexcept; + + virtual ~ThriftHiveMetastore_submit_for_cleanup_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_submit_for_cleanup_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_submit_for_cleanup_result & rhs) const; + bool operator != (const ThriftHiveMetastore_submit_for_cleanup_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_submit_for_cleanup_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_submit_for_cleanup_presult__isset { + _ThriftHiveMetastore_submit_for_cleanup_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_submit_for_cleanup_presult__isset; + +class ThriftHiveMetastore_submit_for_cleanup_presult { + public: + + + virtual ~ThriftHiveMetastore_submit_for_cleanup_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_submit_for_cleanup_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_dynamic_partitions_args__isset { + _ThriftHiveMetastore_add_dynamic_partitions_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_add_dynamic_partitions_args__isset; + +class ThriftHiveMetastore_add_dynamic_partitions_args { + public: + + ThriftHiveMetastore_add_dynamic_partitions_args(const ThriftHiveMetastore_add_dynamic_partitions_args&); + ThriftHiveMetastore_add_dynamic_partitions_args& operator=(const ThriftHiveMetastore_add_dynamic_partitions_args&); + ThriftHiveMetastore_add_dynamic_partitions_args() noexcept; + + virtual ~ThriftHiveMetastore_add_dynamic_partitions_args() noexcept; + AddDynamicPartitions rqst; + + _ThriftHiveMetastore_add_dynamic_partitions_args__isset __isset; + + void __set_rqst(const AddDynamicPartitions& val); + + bool operator == (const ThriftHiveMetastore_add_dynamic_partitions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_dynamic_partitions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_dynamic_partitions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_dynamic_partitions_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_dynamic_partitions_pargs() noexcept; + const AddDynamicPartitions* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_dynamic_partitions_result__isset { + _ThriftHiveMetastore_add_dynamic_partitions_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_dynamic_partitions_result__isset; + +class ThriftHiveMetastore_add_dynamic_partitions_result { + public: + + ThriftHiveMetastore_add_dynamic_partitions_result(const ThriftHiveMetastore_add_dynamic_partitions_result&); + ThriftHiveMetastore_add_dynamic_partitions_result& operator=(const ThriftHiveMetastore_add_dynamic_partitions_result&); + ThriftHiveMetastore_add_dynamic_partitions_result() noexcept; + + virtual ~ThriftHiveMetastore_add_dynamic_partitions_result() noexcept; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_add_dynamic_partitions_result__isset __isset; + + void __set_o1(const NoSuchTxnException& val); + + void __set_o2(const TxnAbortedException& val); + + bool operator == (const ThriftHiveMetastore_add_dynamic_partitions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_dynamic_partitions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_dynamic_partitions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_dynamic_partitions_presult__isset { + _ThriftHiveMetastore_add_dynamic_partitions_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_dynamic_partitions_presult__isset; + +class ThriftHiveMetastore_add_dynamic_partitions_presult { + public: + + + virtual ~ThriftHiveMetastore_add_dynamic_partitions_presult() noexcept; + NoSuchTxnException o1; + TxnAbortedException o2; + + _ThriftHiveMetastore_add_dynamic_partitions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact_args__isset { + _ThriftHiveMetastore_find_next_compact_args__isset() : workerId(false) {} + bool workerId :1; +} _ThriftHiveMetastore_find_next_compact_args__isset; + +class ThriftHiveMetastore_find_next_compact_args { + public: + + ThriftHiveMetastore_find_next_compact_args(const ThriftHiveMetastore_find_next_compact_args&); + ThriftHiveMetastore_find_next_compact_args& operator=(const ThriftHiveMetastore_find_next_compact_args&); + ThriftHiveMetastore_find_next_compact_args() noexcept; + + virtual ~ThriftHiveMetastore_find_next_compact_args() noexcept; + std::string workerId; + + _ThriftHiveMetastore_find_next_compact_args__isset __isset; + + void __set_workerId(const std::string& val); + + bool operator == (const ThriftHiveMetastore_find_next_compact_args & rhs) const; + bool operator != (const ThriftHiveMetastore_find_next_compact_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_next_compact_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_find_next_compact_pargs { + public: + + + virtual ~ThriftHiveMetastore_find_next_compact_pargs() noexcept; + const std::string* workerId; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact_result__isset { + _ThriftHiveMetastore_find_next_compact_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_find_next_compact_result__isset; + +class ThriftHiveMetastore_find_next_compact_result { + public: + + ThriftHiveMetastore_find_next_compact_result(const ThriftHiveMetastore_find_next_compact_result&); + ThriftHiveMetastore_find_next_compact_result& operator=(const ThriftHiveMetastore_find_next_compact_result&); + ThriftHiveMetastore_find_next_compact_result() noexcept; + + virtual ~ThriftHiveMetastore_find_next_compact_result() noexcept; + OptionalCompactionInfoStruct success; + MetaException o1; + + _ThriftHiveMetastore_find_next_compact_result__isset __isset; + + void __set_success(const OptionalCompactionInfoStruct& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_find_next_compact_result & rhs) const; + bool operator != (const ThriftHiveMetastore_find_next_compact_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_next_compact_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact_presult__isset { + _ThriftHiveMetastore_find_next_compact_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_find_next_compact_presult__isset; + +class ThriftHiveMetastore_find_next_compact_presult { + public: + + + virtual ~ThriftHiveMetastore_find_next_compact_presult() noexcept; + OptionalCompactionInfoStruct* success; + MetaException o1; + + _ThriftHiveMetastore_find_next_compact_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact2_args__isset { + _ThriftHiveMetastore_find_next_compact2_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_find_next_compact2_args__isset; + +class ThriftHiveMetastore_find_next_compact2_args { + public: + + ThriftHiveMetastore_find_next_compact2_args(const ThriftHiveMetastore_find_next_compact2_args&); + ThriftHiveMetastore_find_next_compact2_args& operator=(const ThriftHiveMetastore_find_next_compact2_args&); + ThriftHiveMetastore_find_next_compact2_args() noexcept; + + virtual ~ThriftHiveMetastore_find_next_compact2_args() noexcept; + FindNextCompactRequest rqst; + + _ThriftHiveMetastore_find_next_compact2_args__isset __isset; + + void __set_rqst(const FindNextCompactRequest& val); + + bool operator == (const ThriftHiveMetastore_find_next_compact2_args & rhs) const; + bool operator != (const ThriftHiveMetastore_find_next_compact2_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_next_compact2_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_find_next_compact2_pargs { + public: + + + virtual ~ThriftHiveMetastore_find_next_compact2_pargs() noexcept; + const FindNextCompactRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact2_result__isset { + _ThriftHiveMetastore_find_next_compact2_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_find_next_compact2_result__isset; + +class ThriftHiveMetastore_find_next_compact2_result { + public: + + ThriftHiveMetastore_find_next_compact2_result(const ThriftHiveMetastore_find_next_compact2_result&); + ThriftHiveMetastore_find_next_compact2_result& operator=(const ThriftHiveMetastore_find_next_compact2_result&); + ThriftHiveMetastore_find_next_compact2_result() noexcept; + + virtual ~ThriftHiveMetastore_find_next_compact2_result() noexcept; + OptionalCompactionInfoStruct success; + MetaException o1; + + _ThriftHiveMetastore_find_next_compact2_result__isset __isset; + + void __set_success(const OptionalCompactionInfoStruct& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_find_next_compact2_result & rhs) const; + bool operator != (const ThriftHiveMetastore_find_next_compact2_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_next_compact2_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_next_compact2_presult__isset { + _ThriftHiveMetastore_find_next_compact2_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_find_next_compact2_presult__isset; + +class ThriftHiveMetastore_find_next_compact2_presult { + public: + + + virtual ~ThriftHiveMetastore_find_next_compact2_presult() noexcept; + OptionalCompactionInfoStruct* success; + MetaException o1; + + _ThriftHiveMetastore_find_next_compact2_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_compactor_state_args__isset { + _ThriftHiveMetastore_update_compactor_state_args__isset() : cr(false), txn_id(false) {} + bool cr :1; + bool txn_id :1; +} _ThriftHiveMetastore_update_compactor_state_args__isset; + +class ThriftHiveMetastore_update_compactor_state_args { + public: + + ThriftHiveMetastore_update_compactor_state_args(const ThriftHiveMetastore_update_compactor_state_args&); + ThriftHiveMetastore_update_compactor_state_args& operator=(const ThriftHiveMetastore_update_compactor_state_args&); + ThriftHiveMetastore_update_compactor_state_args() noexcept; + + virtual ~ThriftHiveMetastore_update_compactor_state_args() noexcept; + CompactionInfoStruct cr; + int64_t txn_id; + + _ThriftHiveMetastore_update_compactor_state_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + void __set_txn_id(const int64_t val); + + bool operator == (const ThriftHiveMetastore_update_compactor_state_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_compactor_state_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_compactor_state_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_compactor_state_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_compactor_state_pargs() noexcept; + const CompactionInfoStruct* cr; + const int64_t* txn_id; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_compactor_state_result { + public: + + ThriftHiveMetastore_update_compactor_state_result(const ThriftHiveMetastore_update_compactor_state_result&) noexcept; + ThriftHiveMetastore_update_compactor_state_result& operator=(const ThriftHiveMetastore_update_compactor_state_result&) noexcept; + ThriftHiveMetastore_update_compactor_state_result() noexcept; + + virtual ~ThriftHiveMetastore_update_compactor_state_result() noexcept; + + bool operator == (const ThriftHiveMetastore_update_compactor_state_result & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_update_compactor_state_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_compactor_state_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_compactor_state_presult { + public: + + + virtual ~ThriftHiveMetastore_update_compactor_state_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_find_columns_with_stats_args__isset { + _ThriftHiveMetastore_find_columns_with_stats_args__isset() : cr(false) {} + bool cr :1; +} _ThriftHiveMetastore_find_columns_with_stats_args__isset; + +class ThriftHiveMetastore_find_columns_with_stats_args { + public: + + ThriftHiveMetastore_find_columns_with_stats_args(const ThriftHiveMetastore_find_columns_with_stats_args&); + ThriftHiveMetastore_find_columns_with_stats_args& operator=(const ThriftHiveMetastore_find_columns_with_stats_args&); + ThriftHiveMetastore_find_columns_with_stats_args() noexcept; + + virtual ~ThriftHiveMetastore_find_columns_with_stats_args() noexcept; + CompactionInfoStruct cr; + + _ThriftHiveMetastore_find_columns_with_stats_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + bool operator == (const ThriftHiveMetastore_find_columns_with_stats_args & rhs) const; + bool operator != (const ThriftHiveMetastore_find_columns_with_stats_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_columns_with_stats_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_find_columns_with_stats_pargs { + public: + + + virtual ~ThriftHiveMetastore_find_columns_with_stats_pargs() noexcept; + const CompactionInfoStruct* cr; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_columns_with_stats_result__isset { + _ThriftHiveMetastore_find_columns_with_stats_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_find_columns_with_stats_result__isset; + +class ThriftHiveMetastore_find_columns_with_stats_result { + public: + + ThriftHiveMetastore_find_columns_with_stats_result(const ThriftHiveMetastore_find_columns_with_stats_result&); + ThriftHiveMetastore_find_columns_with_stats_result& operator=(const ThriftHiveMetastore_find_columns_with_stats_result&); + ThriftHiveMetastore_find_columns_with_stats_result() noexcept; + + virtual ~ThriftHiveMetastore_find_columns_with_stats_result() noexcept; + std::vector success; + + _ThriftHiveMetastore_find_columns_with_stats_result__isset __isset; + + void __set_success(const std::vector & val); + + bool operator == (const ThriftHiveMetastore_find_columns_with_stats_result & rhs) const; + bool operator != (const ThriftHiveMetastore_find_columns_with_stats_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_columns_with_stats_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_columns_with_stats_presult__isset { + _ThriftHiveMetastore_find_columns_with_stats_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_find_columns_with_stats_presult__isset; + +class ThriftHiveMetastore_find_columns_with_stats_presult { + public: + + + virtual ~ThriftHiveMetastore_find_columns_with_stats_presult() noexcept; + std::vector * success; + + _ThriftHiveMetastore_find_columns_with_stats_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_mark_cleaned_args__isset { + _ThriftHiveMetastore_mark_cleaned_args__isset() : cr(false) {} + bool cr :1; +} _ThriftHiveMetastore_mark_cleaned_args__isset; + +class ThriftHiveMetastore_mark_cleaned_args { + public: + + ThriftHiveMetastore_mark_cleaned_args(const ThriftHiveMetastore_mark_cleaned_args&); + ThriftHiveMetastore_mark_cleaned_args& operator=(const ThriftHiveMetastore_mark_cleaned_args&); + ThriftHiveMetastore_mark_cleaned_args() noexcept; + + virtual ~ThriftHiveMetastore_mark_cleaned_args() noexcept; + CompactionInfoStruct cr; + + _ThriftHiveMetastore_mark_cleaned_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + bool operator == (const ThriftHiveMetastore_mark_cleaned_args & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_cleaned_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_cleaned_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_mark_cleaned_pargs { + public: + + + virtual ~ThriftHiveMetastore_mark_cleaned_pargs() noexcept; + const CompactionInfoStruct* cr; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_cleaned_result__isset { + _ThriftHiveMetastore_mark_cleaned_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_cleaned_result__isset; + +class ThriftHiveMetastore_mark_cleaned_result { + public: + + ThriftHiveMetastore_mark_cleaned_result(const ThriftHiveMetastore_mark_cleaned_result&); + ThriftHiveMetastore_mark_cleaned_result& operator=(const ThriftHiveMetastore_mark_cleaned_result&); + ThriftHiveMetastore_mark_cleaned_result() noexcept; + + virtual ~ThriftHiveMetastore_mark_cleaned_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_cleaned_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_mark_cleaned_result & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_cleaned_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_cleaned_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_cleaned_presult__isset { + _ThriftHiveMetastore_mark_cleaned_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_cleaned_presult__isset; + +class ThriftHiveMetastore_mark_cleaned_presult { + public: + + + virtual ~ThriftHiveMetastore_mark_cleaned_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_cleaned_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_mark_compacted_args__isset { + _ThriftHiveMetastore_mark_compacted_args__isset() : cr(false) {} + bool cr :1; +} _ThriftHiveMetastore_mark_compacted_args__isset; + +class ThriftHiveMetastore_mark_compacted_args { + public: + + ThriftHiveMetastore_mark_compacted_args(const ThriftHiveMetastore_mark_compacted_args&); + ThriftHiveMetastore_mark_compacted_args& operator=(const ThriftHiveMetastore_mark_compacted_args&); + ThriftHiveMetastore_mark_compacted_args() noexcept; + + virtual ~ThriftHiveMetastore_mark_compacted_args() noexcept; + CompactionInfoStruct cr; + + _ThriftHiveMetastore_mark_compacted_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + bool operator == (const ThriftHiveMetastore_mark_compacted_args & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_compacted_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_compacted_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_mark_compacted_pargs { + public: + + + virtual ~ThriftHiveMetastore_mark_compacted_pargs() noexcept; + const CompactionInfoStruct* cr; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_compacted_result__isset { + _ThriftHiveMetastore_mark_compacted_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_compacted_result__isset; + +class ThriftHiveMetastore_mark_compacted_result { + public: + + ThriftHiveMetastore_mark_compacted_result(const ThriftHiveMetastore_mark_compacted_result&); + ThriftHiveMetastore_mark_compacted_result& operator=(const ThriftHiveMetastore_mark_compacted_result&); + ThriftHiveMetastore_mark_compacted_result() noexcept; + + virtual ~ThriftHiveMetastore_mark_compacted_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_compacted_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_mark_compacted_result & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_compacted_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_compacted_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_compacted_presult__isset { + _ThriftHiveMetastore_mark_compacted_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_compacted_presult__isset; + +class ThriftHiveMetastore_mark_compacted_presult { + public: + + + virtual ~ThriftHiveMetastore_mark_compacted_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_compacted_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_mark_failed_args__isset { + _ThriftHiveMetastore_mark_failed_args__isset() : cr(false) {} + bool cr :1; +} _ThriftHiveMetastore_mark_failed_args__isset; + +class ThriftHiveMetastore_mark_failed_args { + public: + + ThriftHiveMetastore_mark_failed_args(const ThriftHiveMetastore_mark_failed_args&); + ThriftHiveMetastore_mark_failed_args& operator=(const ThriftHiveMetastore_mark_failed_args&); + ThriftHiveMetastore_mark_failed_args() noexcept; + + virtual ~ThriftHiveMetastore_mark_failed_args() noexcept; + CompactionInfoStruct cr; + + _ThriftHiveMetastore_mark_failed_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + bool operator == (const ThriftHiveMetastore_mark_failed_args & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_failed_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_failed_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_mark_failed_pargs { + public: + + + virtual ~ThriftHiveMetastore_mark_failed_pargs() noexcept; + const CompactionInfoStruct* cr; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_failed_result__isset { + _ThriftHiveMetastore_mark_failed_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_failed_result__isset; + +class ThriftHiveMetastore_mark_failed_result { + public: + + ThriftHiveMetastore_mark_failed_result(const ThriftHiveMetastore_mark_failed_result&); + ThriftHiveMetastore_mark_failed_result& operator=(const ThriftHiveMetastore_mark_failed_result&); + ThriftHiveMetastore_mark_failed_result() noexcept; + + virtual ~ThriftHiveMetastore_mark_failed_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_failed_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_mark_failed_result & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_failed_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_failed_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_failed_presult__isset { + _ThriftHiveMetastore_mark_failed_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_failed_presult__isset; + +class ThriftHiveMetastore_mark_failed_presult { + public: + + + virtual ~ThriftHiveMetastore_mark_failed_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_failed_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_mark_refused_args__isset { + _ThriftHiveMetastore_mark_refused_args__isset() : cr(false) {} + bool cr :1; +} _ThriftHiveMetastore_mark_refused_args__isset; + +class ThriftHiveMetastore_mark_refused_args { + public: + + ThriftHiveMetastore_mark_refused_args(const ThriftHiveMetastore_mark_refused_args&); + ThriftHiveMetastore_mark_refused_args& operator=(const ThriftHiveMetastore_mark_refused_args&); + ThriftHiveMetastore_mark_refused_args() noexcept; + + virtual ~ThriftHiveMetastore_mark_refused_args() noexcept; + CompactionInfoStruct cr; + + _ThriftHiveMetastore_mark_refused_args__isset __isset; + + void __set_cr(const CompactionInfoStruct& val); + + bool operator == (const ThriftHiveMetastore_mark_refused_args & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_refused_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_refused_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_mark_refused_pargs { + public: + + + virtual ~ThriftHiveMetastore_mark_refused_pargs() noexcept; + const CompactionInfoStruct* cr; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_refused_result__isset { + _ThriftHiveMetastore_mark_refused_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_refused_result__isset; + +class ThriftHiveMetastore_mark_refused_result { + public: + + ThriftHiveMetastore_mark_refused_result(const ThriftHiveMetastore_mark_refused_result&); + ThriftHiveMetastore_mark_refused_result& operator=(const ThriftHiveMetastore_mark_refused_result&); + ThriftHiveMetastore_mark_refused_result() noexcept; + + virtual ~ThriftHiveMetastore_mark_refused_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_refused_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_mark_refused_result & rhs) const; + bool operator != (const ThriftHiveMetastore_mark_refused_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_mark_refused_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_mark_refused_presult__isset { + _ThriftHiveMetastore_mark_refused_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_mark_refused_presult__isset; + +class ThriftHiveMetastore_mark_refused_presult { + public: + + + virtual ~ThriftHiveMetastore_mark_refused_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_mark_refused_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_update_compaction_metrics_data_args__isset { + _ThriftHiveMetastore_update_compaction_metrics_data_args__isset() : data(false) {} + bool data :1; +} _ThriftHiveMetastore_update_compaction_metrics_data_args__isset; + +class ThriftHiveMetastore_update_compaction_metrics_data_args { + public: + + ThriftHiveMetastore_update_compaction_metrics_data_args(const ThriftHiveMetastore_update_compaction_metrics_data_args&); + ThriftHiveMetastore_update_compaction_metrics_data_args& operator=(const ThriftHiveMetastore_update_compaction_metrics_data_args&); + ThriftHiveMetastore_update_compaction_metrics_data_args() noexcept; + + virtual ~ThriftHiveMetastore_update_compaction_metrics_data_args() noexcept; + CompactionMetricsDataStruct data; + + _ThriftHiveMetastore_update_compaction_metrics_data_args__isset __isset; + + void __set_data(const CompactionMetricsDataStruct& val); + + bool operator == (const ThriftHiveMetastore_update_compaction_metrics_data_args & rhs) const; + bool operator != (const ThriftHiveMetastore_update_compaction_metrics_data_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_compaction_metrics_data_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_update_compaction_metrics_data_pargs { + public: + + + virtual ~ThriftHiveMetastore_update_compaction_metrics_data_pargs() noexcept; + const CompactionMetricsDataStruct* data; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_compaction_metrics_data_result__isset { + _ThriftHiveMetastore_update_compaction_metrics_data_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_update_compaction_metrics_data_result__isset; + +class ThriftHiveMetastore_update_compaction_metrics_data_result { + public: + + ThriftHiveMetastore_update_compaction_metrics_data_result(const ThriftHiveMetastore_update_compaction_metrics_data_result&); + ThriftHiveMetastore_update_compaction_metrics_data_result& operator=(const ThriftHiveMetastore_update_compaction_metrics_data_result&); + ThriftHiveMetastore_update_compaction_metrics_data_result() noexcept; + + virtual ~ThriftHiveMetastore_update_compaction_metrics_data_result() noexcept; + bool success; + MetaException o1; + + _ThriftHiveMetastore_update_compaction_metrics_data_result__isset __isset; + + void __set_success(const bool val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_update_compaction_metrics_data_result & rhs) const; + bool operator != (const ThriftHiveMetastore_update_compaction_metrics_data_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_update_compaction_metrics_data_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_update_compaction_metrics_data_presult__isset { + _ThriftHiveMetastore_update_compaction_metrics_data_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_update_compaction_metrics_data_presult__isset; + +class ThriftHiveMetastore_update_compaction_metrics_data_presult { + public: + + + virtual ~ThriftHiveMetastore_update_compaction_metrics_data_presult() noexcept; + bool* success; + MetaException o1; + + _ThriftHiveMetastore_update_compaction_metrics_data_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_remove_compaction_metrics_data_args__isset { + _ThriftHiveMetastore_remove_compaction_metrics_data_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_remove_compaction_metrics_data_args__isset; + +class ThriftHiveMetastore_remove_compaction_metrics_data_args { + public: + + ThriftHiveMetastore_remove_compaction_metrics_data_args(const ThriftHiveMetastore_remove_compaction_metrics_data_args&); + ThriftHiveMetastore_remove_compaction_metrics_data_args& operator=(const ThriftHiveMetastore_remove_compaction_metrics_data_args&); + ThriftHiveMetastore_remove_compaction_metrics_data_args() noexcept; + + virtual ~ThriftHiveMetastore_remove_compaction_metrics_data_args() noexcept; + CompactionMetricsDataRequest request; + + _ThriftHiveMetastore_remove_compaction_metrics_data_args__isset __isset; + + void __set_request(const CompactionMetricsDataRequest& val); + + bool operator == (const ThriftHiveMetastore_remove_compaction_metrics_data_args & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_compaction_metrics_data_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_compaction_metrics_data_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_remove_compaction_metrics_data_pargs { + public: + + + virtual ~ThriftHiveMetastore_remove_compaction_metrics_data_pargs() noexcept; + const CompactionMetricsDataRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_compaction_metrics_data_result__isset { + _ThriftHiveMetastore_remove_compaction_metrics_data_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_remove_compaction_metrics_data_result__isset; + +class ThriftHiveMetastore_remove_compaction_metrics_data_result { + public: + + ThriftHiveMetastore_remove_compaction_metrics_data_result(const ThriftHiveMetastore_remove_compaction_metrics_data_result&); + ThriftHiveMetastore_remove_compaction_metrics_data_result& operator=(const ThriftHiveMetastore_remove_compaction_metrics_data_result&); + ThriftHiveMetastore_remove_compaction_metrics_data_result() noexcept; + + virtual ~ThriftHiveMetastore_remove_compaction_metrics_data_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_remove_compaction_metrics_data_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_remove_compaction_metrics_data_result & rhs) const; + bool operator != (const ThriftHiveMetastore_remove_compaction_metrics_data_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_remove_compaction_metrics_data_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_remove_compaction_metrics_data_presult__isset { + _ThriftHiveMetastore_remove_compaction_metrics_data_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_remove_compaction_metrics_data_presult__isset; + +class ThriftHiveMetastore_remove_compaction_metrics_data_presult { + public: + + + virtual ~ThriftHiveMetastore_remove_compaction_metrics_data_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_remove_compaction_metrics_data_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_set_hadoop_jobid_args__isset { + _ThriftHiveMetastore_set_hadoop_jobid_args__isset() : jobId(false), cq_id(false) {} + bool jobId :1; + bool cq_id :1; +} _ThriftHiveMetastore_set_hadoop_jobid_args__isset; + +class ThriftHiveMetastore_set_hadoop_jobid_args { + public: + + ThriftHiveMetastore_set_hadoop_jobid_args(const ThriftHiveMetastore_set_hadoop_jobid_args&); + ThriftHiveMetastore_set_hadoop_jobid_args& operator=(const ThriftHiveMetastore_set_hadoop_jobid_args&); + ThriftHiveMetastore_set_hadoop_jobid_args() noexcept; + + virtual ~ThriftHiveMetastore_set_hadoop_jobid_args() noexcept; + std::string jobId; + int64_t cq_id; + + _ThriftHiveMetastore_set_hadoop_jobid_args__isset __isset; + + void __set_jobId(const std::string& val); + + void __set_cq_id(const int64_t val); + + bool operator == (const ThriftHiveMetastore_set_hadoop_jobid_args & rhs) const; + bool operator != (const ThriftHiveMetastore_set_hadoop_jobid_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_hadoop_jobid_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_hadoop_jobid_pargs { + public: + + + virtual ~ThriftHiveMetastore_set_hadoop_jobid_pargs() noexcept; + const std::string* jobId; + const int64_t* cq_id; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_hadoop_jobid_result { + public: + + ThriftHiveMetastore_set_hadoop_jobid_result(const ThriftHiveMetastore_set_hadoop_jobid_result&) noexcept; + ThriftHiveMetastore_set_hadoop_jobid_result& operator=(const ThriftHiveMetastore_set_hadoop_jobid_result&) noexcept; + ThriftHiveMetastore_set_hadoop_jobid_result() noexcept; + + virtual ~ThriftHiveMetastore_set_hadoop_jobid_result() noexcept; + + bool operator == (const ThriftHiveMetastore_set_hadoop_jobid_result & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_set_hadoop_jobid_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_hadoop_jobid_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_hadoop_jobid_presult { + public: + + + virtual ~ThriftHiveMetastore_set_hadoop_jobid_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_latest_committed_compaction_info_args__isset { + _ThriftHiveMetastore_get_latest_committed_compaction_info_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_latest_committed_compaction_info_args__isset; + +class ThriftHiveMetastore_get_latest_committed_compaction_info_args { + public: + + ThriftHiveMetastore_get_latest_committed_compaction_info_args(const ThriftHiveMetastore_get_latest_committed_compaction_info_args&); + ThriftHiveMetastore_get_latest_committed_compaction_info_args& operator=(const ThriftHiveMetastore_get_latest_committed_compaction_info_args&); + ThriftHiveMetastore_get_latest_committed_compaction_info_args() noexcept; + + virtual ~ThriftHiveMetastore_get_latest_committed_compaction_info_args() noexcept; + GetLatestCommittedCompactionInfoRequest rqst; + + _ThriftHiveMetastore_get_latest_committed_compaction_info_args__isset __isset; + + void __set_rqst(const GetLatestCommittedCompactionInfoRequest& val); + + bool operator == (const ThriftHiveMetastore_get_latest_committed_compaction_info_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_latest_committed_compaction_info_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_latest_committed_compaction_info_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_latest_committed_compaction_info_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_latest_committed_compaction_info_pargs() noexcept; + const GetLatestCommittedCompactionInfoRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_latest_committed_compaction_info_result__isset { + _ThriftHiveMetastore_get_latest_committed_compaction_info_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_latest_committed_compaction_info_result__isset; + +class ThriftHiveMetastore_get_latest_committed_compaction_info_result { + public: + + ThriftHiveMetastore_get_latest_committed_compaction_info_result(const ThriftHiveMetastore_get_latest_committed_compaction_info_result&); + ThriftHiveMetastore_get_latest_committed_compaction_info_result& operator=(const ThriftHiveMetastore_get_latest_committed_compaction_info_result&); + ThriftHiveMetastore_get_latest_committed_compaction_info_result() noexcept; + + virtual ~ThriftHiveMetastore_get_latest_committed_compaction_info_result() noexcept; + GetLatestCommittedCompactionInfoResponse success; + + _ThriftHiveMetastore_get_latest_committed_compaction_info_result__isset __isset; + + void __set_success(const GetLatestCommittedCompactionInfoResponse& val); + + bool operator == (const ThriftHiveMetastore_get_latest_committed_compaction_info_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_latest_committed_compaction_info_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_latest_committed_compaction_info_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_latest_committed_compaction_info_presult__isset { + _ThriftHiveMetastore_get_latest_committed_compaction_info_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_latest_committed_compaction_info_presult__isset; + +class ThriftHiveMetastore_get_latest_committed_compaction_info_presult { + public: + + + virtual ~ThriftHiveMetastore_get_latest_committed_compaction_info_presult() noexcept; + GetLatestCommittedCompactionInfoResponse* success; + + _ThriftHiveMetastore_get_latest_committed_compaction_info_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_next_notification_args__isset { + _ThriftHiveMetastore_get_next_notification_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_next_notification_args__isset; + +class ThriftHiveMetastore_get_next_notification_args { + public: + + ThriftHiveMetastore_get_next_notification_args(const ThriftHiveMetastore_get_next_notification_args&); + ThriftHiveMetastore_get_next_notification_args& operator=(const ThriftHiveMetastore_get_next_notification_args&); + ThriftHiveMetastore_get_next_notification_args() noexcept; + + virtual ~ThriftHiveMetastore_get_next_notification_args() noexcept; + NotificationEventRequest rqst; + + _ThriftHiveMetastore_get_next_notification_args__isset __isset; + + void __set_rqst(const NotificationEventRequest& val); + + bool operator == (const ThriftHiveMetastore_get_next_notification_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_next_notification_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_next_notification_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_next_notification_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_next_notification_pargs() noexcept; + const NotificationEventRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_next_notification_result__isset { + _ThriftHiveMetastore_get_next_notification_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_next_notification_result__isset; + +class ThriftHiveMetastore_get_next_notification_result { + public: + + ThriftHiveMetastore_get_next_notification_result(const ThriftHiveMetastore_get_next_notification_result&); + ThriftHiveMetastore_get_next_notification_result& operator=(const ThriftHiveMetastore_get_next_notification_result&); + ThriftHiveMetastore_get_next_notification_result() noexcept; + + virtual ~ThriftHiveMetastore_get_next_notification_result() noexcept; + NotificationEventResponse success; + + _ThriftHiveMetastore_get_next_notification_result__isset __isset; + + void __set_success(const NotificationEventResponse& val); + + bool operator == (const ThriftHiveMetastore_get_next_notification_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_next_notification_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_next_notification_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_next_notification_presult__isset { + _ThriftHiveMetastore_get_next_notification_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_next_notification_presult__isset; + +class ThriftHiveMetastore_get_next_notification_presult { + public: + + + virtual ~ThriftHiveMetastore_get_next_notification_presult() noexcept; + NotificationEventResponse* success; + + _ThriftHiveMetastore_get_next_notification_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_current_notificationEventId_args { + public: + + ThriftHiveMetastore_get_current_notificationEventId_args(const ThriftHiveMetastore_get_current_notificationEventId_args&) noexcept; + ThriftHiveMetastore_get_current_notificationEventId_args& operator=(const ThriftHiveMetastore_get_current_notificationEventId_args&) noexcept; + ThriftHiveMetastore_get_current_notificationEventId_args() noexcept; + + virtual ~ThriftHiveMetastore_get_current_notificationEventId_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_current_notificationEventId_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_current_notificationEventId_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_current_notificationEventId_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_current_notificationEventId_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_current_notificationEventId_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_current_notificationEventId_result__isset { + _ThriftHiveMetastore_get_current_notificationEventId_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_current_notificationEventId_result__isset; + +class ThriftHiveMetastore_get_current_notificationEventId_result { + public: + + ThriftHiveMetastore_get_current_notificationEventId_result(const ThriftHiveMetastore_get_current_notificationEventId_result&) noexcept; + ThriftHiveMetastore_get_current_notificationEventId_result& operator=(const ThriftHiveMetastore_get_current_notificationEventId_result&) noexcept; + ThriftHiveMetastore_get_current_notificationEventId_result() noexcept; + + virtual ~ThriftHiveMetastore_get_current_notificationEventId_result() noexcept; + CurrentNotificationEventId success; + + _ThriftHiveMetastore_get_current_notificationEventId_result__isset __isset; + + void __set_success(const CurrentNotificationEventId& val); + + bool operator == (const ThriftHiveMetastore_get_current_notificationEventId_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_current_notificationEventId_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_current_notificationEventId_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_current_notificationEventId_presult__isset { + _ThriftHiveMetastore_get_current_notificationEventId_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_current_notificationEventId_presult__isset; + +class ThriftHiveMetastore_get_current_notificationEventId_presult { + public: + + + virtual ~ThriftHiveMetastore_get_current_notificationEventId_presult() noexcept; + CurrentNotificationEventId* success; + + _ThriftHiveMetastore_get_current_notificationEventId_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_notification_events_count_args__isset { + _ThriftHiveMetastore_get_notification_events_count_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_notification_events_count_args__isset; + +class ThriftHiveMetastore_get_notification_events_count_args { + public: + + ThriftHiveMetastore_get_notification_events_count_args(const ThriftHiveMetastore_get_notification_events_count_args&); + ThriftHiveMetastore_get_notification_events_count_args& operator=(const ThriftHiveMetastore_get_notification_events_count_args&); + ThriftHiveMetastore_get_notification_events_count_args() noexcept; + + virtual ~ThriftHiveMetastore_get_notification_events_count_args() noexcept; + NotificationEventsCountRequest rqst; + + _ThriftHiveMetastore_get_notification_events_count_args__isset __isset; + + void __set_rqst(const NotificationEventsCountRequest& val); + + bool operator == (const ThriftHiveMetastore_get_notification_events_count_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_notification_events_count_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_notification_events_count_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_notification_events_count_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_notification_events_count_pargs() noexcept; + const NotificationEventsCountRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_notification_events_count_result__isset { + _ThriftHiveMetastore_get_notification_events_count_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_notification_events_count_result__isset; + +class ThriftHiveMetastore_get_notification_events_count_result { + public: + + ThriftHiveMetastore_get_notification_events_count_result(const ThriftHiveMetastore_get_notification_events_count_result&) noexcept; + ThriftHiveMetastore_get_notification_events_count_result& operator=(const ThriftHiveMetastore_get_notification_events_count_result&) noexcept; + ThriftHiveMetastore_get_notification_events_count_result() noexcept; + + virtual ~ThriftHiveMetastore_get_notification_events_count_result() noexcept; + NotificationEventsCountResponse success; + + _ThriftHiveMetastore_get_notification_events_count_result__isset __isset; + + void __set_success(const NotificationEventsCountResponse& val); + + bool operator == (const ThriftHiveMetastore_get_notification_events_count_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_notification_events_count_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_notification_events_count_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_notification_events_count_presult__isset { + _ThriftHiveMetastore_get_notification_events_count_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_notification_events_count_presult__isset; + +class ThriftHiveMetastore_get_notification_events_count_presult { + public: + + + virtual ~ThriftHiveMetastore_get_notification_events_count_presult() noexcept; + NotificationEventsCountResponse* success; + + _ThriftHiveMetastore_get_notification_events_count_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_fire_listener_event_args__isset { + _ThriftHiveMetastore_fire_listener_event_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_fire_listener_event_args__isset; + +class ThriftHiveMetastore_fire_listener_event_args { + public: + + ThriftHiveMetastore_fire_listener_event_args(const ThriftHiveMetastore_fire_listener_event_args&); + ThriftHiveMetastore_fire_listener_event_args& operator=(const ThriftHiveMetastore_fire_listener_event_args&); + ThriftHiveMetastore_fire_listener_event_args() noexcept; + + virtual ~ThriftHiveMetastore_fire_listener_event_args() noexcept; + FireEventRequest rqst; + + _ThriftHiveMetastore_fire_listener_event_args__isset __isset; + + void __set_rqst(const FireEventRequest& val); + + bool operator == (const ThriftHiveMetastore_fire_listener_event_args & rhs) const; + bool operator != (const ThriftHiveMetastore_fire_listener_event_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_fire_listener_event_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_fire_listener_event_pargs { + public: + + + virtual ~ThriftHiveMetastore_fire_listener_event_pargs() noexcept; + const FireEventRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_fire_listener_event_result__isset { + _ThriftHiveMetastore_fire_listener_event_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_fire_listener_event_result__isset; + +class ThriftHiveMetastore_fire_listener_event_result { + public: + + ThriftHiveMetastore_fire_listener_event_result(const ThriftHiveMetastore_fire_listener_event_result&); + ThriftHiveMetastore_fire_listener_event_result& operator=(const ThriftHiveMetastore_fire_listener_event_result&); + ThriftHiveMetastore_fire_listener_event_result() noexcept; + + virtual ~ThriftHiveMetastore_fire_listener_event_result() noexcept; + FireEventResponse success; + + _ThriftHiveMetastore_fire_listener_event_result__isset __isset; + + void __set_success(const FireEventResponse& val); + + bool operator == (const ThriftHiveMetastore_fire_listener_event_result & rhs) const; + bool operator != (const ThriftHiveMetastore_fire_listener_event_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_fire_listener_event_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_fire_listener_event_presult__isset { + _ThriftHiveMetastore_fire_listener_event_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_fire_listener_event_presult__isset; + +class ThriftHiveMetastore_fire_listener_event_presult { + public: + + + virtual ~ThriftHiveMetastore_fire_listener_event_presult() noexcept; + FireEventResponse* success; + + _ThriftHiveMetastore_fire_listener_event_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_flushCache_args { + public: + + ThriftHiveMetastore_flushCache_args(const ThriftHiveMetastore_flushCache_args&) noexcept; + ThriftHiveMetastore_flushCache_args& operator=(const ThriftHiveMetastore_flushCache_args&) noexcept; + ThriftHiveMetastore_flushCache_args() noexcept; + + virtual ~ThriftHiveMetastore_flushCache_args() noexcept; + + bool operator == (const ThriftHiveMetastore_flushCache_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_flushCache_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_flushCache_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_flushCache_pargs { + public: + + + virtual ~ThriftHiveMetastore_flushCache_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_flushCache_result { + public: + + ThriftHiveMetastore_flushCache_result(const ThriftHiveMetastore_flushCache_result&) noexcept; + ThriftHiveMetastore_flushCache_result& operator=(const ThriftHiveMetastore_flushCache_result&) noexcept; + ThriftHiveMetastore_flushCache_result() noexcept; + + virtual ~ThriftHiveMetastore_flushCache_result() noexcept; + + bool operator == (const ThriftHiveMetastore_flushCache_result & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_flushCache_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_flushCache_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_flushCache_presult { + public: + + + virtual ~ThriftHiveMetastore_flushCache_presult() noexcept; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_args__isset { + _ThriftHiveMetastore_add_write_notification_log_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_add_write_notification_log_args__isset; + +class ThriftHiveMetastore_add_write_notification_log_args { + public: + + ThriftHiveMetastore_add_write_notification_log_args(const ThriftHiveMetastore_add_write_notification_log_args&); + ThriftHiveMetastore_add_write_notification_log_args& operator=(const ThriftHiveMetastore_add_write_notification_log_args&); + ThriftHiveMetastore_add_write_notification_log_args() noexcept; + + virtual ~ThriftHiveMetastore_add_write_notification_log_args() noexcept; + WriteNotificationLogRequest rqst; + + _ThriftHiveMetastore_add_write_notification_log_args__isset __isset; + + void __set_rqst(const WriteNotificationLogRequest& val); + + bool operator == (const ThriftHiveMetastore_add_write_notification_log_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_notification_log_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_notification_log_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_write_notification_log_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_write_notification_log_pargs() noexcept; + const WriteNotificationLogRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_result__isset { + _ThriftHiveMetastore_add_write_notification_log_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_write_notification_log_result__isset; + +class ThriftHiveMetastore_add_write_notification_log_result { + public: + + ThriftHiveMetastore_add_write_notification_log_result(const ThriftHiveMetastore_add_write_notification_log_result&) noexcept; + ThriftHiveMetastore_add_write_notification_log_result& operator=(const ThriftHiveMetastore_add_write_notification_log_result&) noexcept; + ThriftHiveMetastore_add_write_notification_log_result() noexcept; + + virtual ~ThriftHiveMetastore_add_write_notification_log_result() noexcept; + WriteNotificationLogResponse success; + + _ThriftHiveMetastore_add_write_notification_log_result__isset __isset; + + void __set_success(const WriteNotificationLogResponse& val); + + bool operator == (const ThriftHiveMetastore_add_write_notification_log_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_notification_log_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_notification_log_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_presult__isset { + _ThriftHiveMetastore_add_write_notification_log_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_write_notification_log_presult__isset; + +class ThriftHiveMetastore_add_write_notification_log_presult { + public: + + + virtual ~ThriftHiveMetastore_add_write_notification_log_presult() noexcept; + WriteNotificationLogResponse* success; + + _ThriftHiveMetastore_add_write_notification_log_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_in_batch_args__isset { + _ThriftHiveMetastore_add_write_notification_log_in_batch_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_add_write_notification_log_in_batch_args__isset; + +class ThriftHiveMetastore_add_write_notification_log_in_batch_args { + public: + + ThriftHiveMetastore_add_write_notification_log_in_batch_args(const ThriftHiveMetastore_add_write_notification_log_in_batch_args&); + ThriftHiveMetastore_add_write_notification_log_in_batch_args& operator=(const ThriftHiveMetastore_add_write_notification_log_in_batch_args&); + ThriftHiveMetastore_add_write_notification_log_in_batch_args() noexcept; + + virtual ~ThriftHiveMetastore_add_write_notification_log_in_batch_args() noexcept; + WriteNotificationLogBatchRequest rqst; + + _ThriftHiveMetastore_add_write_notification_log_in_batch_args__isset __isset; + + void __set_rqst(const WriteNotificationLogBatchRequest& val); + + bool operator == (const ThriftHiveMetastore_add_write_notification_log_in_batch_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_notification_log_in_batch_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_notification_log_in_batch_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_write_notification_log_in_batch_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_write_notification_log_in_batch_pargs() noexcept; + const WriteNotificationLogBatchRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_in_batch_result__isset { + _ThriftHiveMetastore_add_write_notification_log_in_batch_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_write_notification_log_in_batch_result__isset; + +class ThriftHiveMetastore_add_write_notification_log_in_batch_result { + public: + + ThriftHiveMetastore_add_write_notification_log_in_batch_result(const ThriftHiveMetastore_add_write_notification_log_in_batch_result&) noexcept; + ThriftHiveMetastore_add_write_notification_log_in_batch_result& operator=(const ThriftHiveMetastore_add_write_notification_log_in_batch_result&) noexcept; + ThriftHiveMetastore_add_write_notification_log_in_batch_result() noexcept; + + virtual ~ThriftHiveMetastore_add_write_notification_log_in_batch_result() noexcept; + WriteNotificationLogBatchResponse success; + + _ThriftHiveMetastore_add_write_notification_log_in_batch_result__isset __isset; + + void __set_success(const WriteNotificationLogBatchResponse& val); + + bool operator == (const ThriftHiveMetastore_add_write_notification_log_in_batch_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_write_notification_log_in_batch_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_write_notification_log_in_batch_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_write_notification_log_in_batch_presult__isset { + _ThriftHiveMetastore_add_write_notification_log_in_batch_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_add_write_notification_log_in_batch_presult__isset; + +class ThriftHiveMetastore_add_write_notification_log_in_batch_presult { + public: + + + virtual ~ThriftHiveMetastore_add_write_notification_log_in_batch_presult() noexcept; + WriteNotificationLogBatchResponse* success; + + _ThriftHiveMetastore_add_write_notification_log_in_batch_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_cm_recycle_args__isset { + _ThriftHiveMetastore_cm_recycle_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_cm_recycle_args__isset; + +class ThriftHiveMetastore_cm_recycle_args { + public: + + ThriftHiveMetastore_cm_recycle_args(const ThriftHiveMetastore_cm_recycle_args&); + ThriftHiveMetastore_cm_recycle_args& operator=(const ThriftHiveMetastore_cm_recycle_args&); + ThriftHiveMetastore_cm_recycle_args() noexcept; + + virtual ~ThriftHiveMetastore_cm_recycle_args() noexcept; + CmRecycleRequest request; + + _ThriftHiveMetastore_cm_recycle_args__isset __isset; + + void __set_request(const CmRecycleRequest& val); + + bool operator == (const ThriftHiveMetastore_cm_recycle_args & rhs) const; + bool operator != (const ThriftHiveMetastore_cm_recycle_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cm_recycle_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_cm_recycle_pargs { + public: + + + virtual ~ThriftHiveMetastore_cm_recycle_pargs() noexcept; + const CmRecycleRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cm_recycle_result__isset { + _ThriftHiveMetastore_cm_recycle_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_cm_recycle_result__isset; + +class ThriftHiveMetastore_cm_recycle_result { + public: + + ThriftHiveMetastore_cm_recycle_result(const ThriftHiveMetastore_cm_recycle_result&); + ThriftHiveMetastore_cm_recycle_result& operator=(const ThriftHiveMetastore_cm_recycle_result&); + ThriftHiveMetastore_cm_recycle_result() noexcept; + + virtual ~ThriftHiveMetastore_cm_recycle_result() noexcept; + CmRecycleResponse success; + MetaException o1; + + _ThriftHiveMetastore_cm_recycle_result__isset __isset; + + void __set_success(const CmRecycleResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_cm_recycle_result & rhs) const; + bool operator != (const ThriftHiveMetastore_cm_recycle_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cm_recycle_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cm_recycle_presult__isset { + _ThriftHiveMetastore_cm_recycle_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_cm_recycle_presult__isset; + +class ThriftHiveMetastore_cm_recycle_presult { + public: + + + virtual ~ThriftHiveMetastore_cm_recycle_presult() noexcept; + CmRecycleResponse* success; + MetaException o1; + + _ThriftHiveMetastore_cm_recycle_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_by_expr_args__isset { + _ThriftHiveMetastore_get_file_metadata_by_expr_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_file_metadata_by_expr_args__isset; + +class ThriftHiveMetastore_get_file_metadata_by_expr_args { + public: + + ThriftHiveMetastore_get_file_metadata_by_expr_args(const ThriftHiveMetastore_get_file_metadata_by_expr_args&); + ThriftHiveMetastore_get_file_metadata_by_expr_args& operator=(const ThriftHiveMetastore_get_file_metadata_by_expr_args&); + ThriftHiveMetastore_get_file_metadata_by_expr_args() noexcept; + + virtual ~ThriftHiveMetastore_get_file_metadata_by_expr_args() noexcept; + GetFileMetadataByExprRequest req; + + _ThriftHiveMetastore_get_file_metadata_by_expr_args__isset __isset; + + void __set_req(const GetFileMetadataByExprRequest& val); + + bool operator == (const ThriftHiveMetastore_get_file_metadata_by_expr_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_file_metadata_by_expr_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_file_metadata_by_expr_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_file_metadata_by_expr_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_file_metadata_by_expr_pargs() noexcept; + const GetFileMetadataByExprRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_by_expr_result__isset { + _ThriftHiveMetastore_get_file_metadata_by_expr_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_file_metadata_by_expr_result__isset; + +class ThriftHiveMetastore_get_file_metadata_by_expr_result { + public: + + ThriftHiveMetastore_get_file_metadata_by_expr_result(const ThriftHiveMetastore_get_file_metadata_by_expr_result&); + ThriftHiveMetastore_get_file_metadata_by_expr_result& operator=(const ThriftHiveMetastore_get_file_metadata_by_expr_result&); + ThriftHiveMetastore_get_file_metadata_by_expr_result() noexcept; + + virtual ~ThriftHiveMetastore_get_file_metadata_by_expr_result() noexcept; + GetFileMetadataByExprResult success; + + _ThriftHiveMetastore_get_file_metadata_by_expr_result__isset __isset; + + void __set_success(const GetFileMetadataByExprResult& val); + + bool operator == (const ThriftHiveMetastore_get_file_metadata_by_expr_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_file_metadata_by_expr_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_file_metadata_by_expr_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_by_expr_presult__isset { + _ThriftHiveMetastore_get_file_metadata_by_expr_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_file_metadata_by_expr_presult__isset; + +class ThriftHiveMetastore_get_file_metadata_by_expr_presult { + public: + + + virtual ~ThriftHiveMetastore_get_file_metadata_by_expr_presult() noexcept; + GetFileMetadataByExprResult* success; + + _ThriftHiveMetastore_get_file_metadata_by_expr_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_args__isset { + _ThriftHiveMetastore_get_file_metadata_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_get_file_metadata_args__isset; + +class ThriftHiveMetastore_get_file_metadata_args { + public: + + ThriftHiveMetastore_get_file_metadata_args(const ThriftHiveMetastore_get_file_metadata_args&); + ThriftHiveMetastore_get_file_metadata_args& operator=(const ThriftHiveMetastore_get_file_metadata_args&); + ThriftHiveMetastore_get_file_metadata_args() noexcept; + + virtual ~ThriftHiveMetastore_get_file_metadata_args() noexcept; + GetFileMetadataRequest req; + + _ThriftHiveMetastore_get_file_metadata_args__isset __isset; + + void __set_req(const GetFileMetadataRequest& val); + + bool operator == (const ThriftHiveMetastore_get_file_metadata_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_file_metadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_file_metadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_file_metadata_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_file_metadata_pargs() noexcept; + const GetFileMetadataRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_result__isset { + _ThriftHiveMetastore_get_file_metadata_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_file_metadata_result__isset; + +class ThriftHiveMetastore_get_file_metadata_result { + public: + + ThriftHiveMetastore_get_file_metadata_result(const ThriftHiveMetastore_get_file_metadata_result&); + ThriftHiveMetastore_get_file_metadata_result& operator=(const ThriftHiveMetastore_get_file_metadata_result&); + ThriftHiveMetastore_get_file_metadata_result() noexcept; + + virtual ~ThriftHiveMetastore_get_file_metadata_result() noexcept; + GetFileMetadataResult success; + + _ThriftHiveMetastore_get_file_metadata_result__isset __isset; + + void __set_success(const GetFileMetadataResult& val); + + bool operator == (const ThriftHiveMetastore_get_file_metadata_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_file_metadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_file_metadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_file_metadata_presult__isset { + _ThriftHiveMetastore_get_file_metadata_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_file_metadata_presult__isset; + +class ThriftHiveMetastore_get_file_metadata_presult { + public: + + + virtual ~ThriftHiveMetastore_get_file_metadata_presult() noexcept; + GetFileMetadataResult* success; + + _ThriftHiveMetastore_get_file_metadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_put_file_metadata_args__isset { + _ThriftHiveMetastore_put_file_metadata_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_put_file_metadata_args__isset; + +class ThriftHiveMetastore_put_file_metadata_args { + public: + + ThriftHiveMetastore_put_file_metadata_args(const ThriftHiveMetastore_put_file_metadata_args&); + ThriftHiveMetastore_put_file_metadata_args& operator=(const ThriftHiveMetastore_put_file_metadata_args&); + ThriftHiveMetastore_put_file_metadata_args() noexcept; + + virtual ~ThriftHiveMetastore_put_file_metadata_args() noexcept; + PutFileMetadataRequest req; + + _ThriftHiveMetastore_put_file_metadata_args__isset __isset; + + void __set_req(const PutFileMetadataRequest& val); + + bool operator == (const ThriftHiveMetastore_put_file_metadata_args & rhs) const; + bool operator != (const ThriftHiveMetastore_put_file_metadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_put_file_metadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_put_file_metadata_pargs { + public: + + + virtual ~ThriftHiveMetastore_put_file_metadata_pargs() noexcept; + const PutFileMetadataRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_put_file_metadata_result__isset { + _ThriftHiveMetastore_put_file_metadata_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_put_file_metadata_result__isset; + +class ThriftHiveMetastore_put_file_metadata_result { + public: + + ThriftHiveMetastore_put_file_metadata_result(const ThriftHiveMetastore_put_file_metadata_result&) noexcept; + ThriftHiveMetastore_put_file_metadata_result& operator=(const ThriftHiveMetastore_put_file_metadata_result&) noexcept; + ThriftHiveMetastore_put_file_metadata_result() noexcept; + + virtual ~ThriftHiveMetastore_put_file_metadata_result() noexcept; + PutFileMetadataResult success; + + _ThriftHiveMetastore_put_file_metadata_result__isset __isset; + + void __set_success(const PutFileMetadataResult& val); + + bool operator == (const ThriftHiveMetastore_put_file_metadata_result & rhs) const; + bool operator != (const ThriftHiveMetastore_put_file_metadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_put_file_metadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_put_file_metadata_presult__isset { + _ThriftHiveMetastore_put_file_metadata_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_put_file_metadata_presult__isset; + +class ThriftHiveMetastore_put_file_metadata_presult { + public: + + + virtual ~ThriftHiveMetastore_put_file_metadata_presult() noexcept; + PutFileMetadataResult* success; + + _ThriftHiveMetastore_put_file_metadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_clear_file_metadata_args__isset { + _ThriftHiveMetastore_clear_file_metadata_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_clear_file_metadata_args__isset; + +class ThriftHiveMetastore_clear_file_metadata_args { + public: + + ThriftHiveMetastore_clear_file_metadata_args(const ThriftHiveMetastore_clear_file_metadata_args&); + ThriftHiveMetastore_clear_file_metadata_args& operator=(const ThriftHiveMetastore_clear_file_metadata_args&); + ThriftHiveMetastore_clear_file_metadata_args() noexcept; + + virtual ~ThriftHiveMetastore_clear_file_metadata_args() noexcept; + ClearFileMetadataRequest req; + + _ThriftHiveMetastore_clear_file_metadata_args__isset __isset; + + void __set_req(const ClearFileMetadataRequest& val); + + bool operator == (const ThriftHiveMetastore_clear_file_metadata_args & rhs) const; + bool operator != (const ThriftHiveMetastore_clear_file_metadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_clear_file_metadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_clear_file_metadata_pargs { + public: + + + virtual ~ThriftHiveMetastore_clear_file_metadata_pargs() noexcept; + const ClearFileMetadataRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_clear_file_metadata_result__isset { + _ThriftHiveMetastore_clear_file_metadata_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_clear_file_metadata_result__isset; + +class ThriftHiveMetastore_clear_file_metadata_result { + public: + + ThriftHiveMetastore_clear_file_metadata_result(const ThriftHiveMetastore_clear_file_metadata_result&) noexcept; + ThriftHiveMetastore_clear_file_metadata_result& operator=(const ThriftHiveMetastore_clear_file_metadata_result&) noexcept; + ThriftHiveMetastore_clear_file_metadata_result() noexcept; + + virtual ~ThriftHiveMetastore_clear_file_metadata_result() noexcept; + ClearFileMetadataResult success; + + _ThriftHiveMetastore_clear_file_metadata_result__isset __isset; + + void __set_success(const ClearFileMetadataResult& val); + + bool operator == (const ThriftHiveMetastore_clear_file_metadata_result & rhs) const; + bool operator != (const ThriftHiveMetastore_clear_file_metadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_clear_file_metadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_clear_file_metadata_presult__isset { + _ThriftHiveMetastore_clear_file_metadata_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_clear_file_metadata_presult__isset; + +class ThriftHiveMetastore_clear_file_metadata_presult { + public: + + + virtual ~ThriftHiveMetastore_clear_file_metadata_presult() noexcept; + ClearFileMetadataResult* success; + + _ThriftHiveMetastore_clear_file_metadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_cache_file_metadata_args__isset { + _ThriftHiveMetastore_cache_file_metadata_args__isset() : req(false) {} + bool req :1; +} _ThriftHiveMetastore_cache_file_metadata_args__isset; + +class ThriftHiveMetastore_cache_file_metadata_args { + public: + + ThriftHiveMetastore_cache_file_metadata_args(const ThriftHiveMetastore_cache_file_metadata_args&); + ThriftHiveMetastore_cache_file_metadata_args& operator=(const ThriftHiveMetastore_cache_file_metadata_args&); + ThriftHiveMetastore_cache_file_metadata_args() noexcept; + + virtual ~ThriftHiveMetastore_cache_file_metadata_args() noexcept; + CacheFileMetadataRequest req; + + _ThriftHiveMetastore_cache_file_metadata_args__isset __isset; + + void __set_req(const CacheFileMetadataRequest& val); + + bool operator == (const ThriftHiveMetastore_cache_file_metadata_args & rhs) const; + bool operator != (const ThriftHiveMetastore_cache_file_metadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cache_file_metadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_cache_file_metadata_pargs { + public: + + + virtual ~ThriftHiveMetastore_cache_file_metadata_pargs() noexcept; + const CacheFileMetadataRequest* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cache_file_metadata_result__isset { + _ThriftHiveMetastore_cache_file_metadata_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_cache_file_metadata_result__isset; + +class ThriftHiveMetastore_cache_file_metadata_result { + public: + + ThriftHiveMetastore_cache_file_metadata_result(const ThriftHiveMetastore_cache_file_metadata_result&) noexcept; + ThriftHiveMetastore_cache_file_metadata_result& operator=(const ThriftHiveMetastore_cache_file_metadata_result&) noexcept; + ThriftHiveMetastore_cache_file_metadata_result() noexcept; + + virtual ~ThriftHiveMetastore_cache_file_metadata_result() noexcept; + CacheFileMetadataResult success; + + _ThriftHiveMetastore_cache_file_metadata_result__isset __isset; + + void __set_success(const CacheFileMetadataResult& val); + + bool operator == (const ThriftHiveMetastore_cache_file_metadata_result & rhs) const; + bool operator != (const ThriftHiveMetastore_cache_file_metadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_cache_file_metadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_cache_file_metadata_presult__isset { + _ThriftHiveMetastore_cache_file_metadata_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_cache_file_metadata_presult__isset; + +class ThriftHiveMetastore_cache_file_metadata_presult { + public: + + + virtual ~ThriftHiveMetastore_cache_file_metadata_presult() noexcept; + CacheFileMetadataResult* success; + + _ThriftHiveMetastore_cache_file_metadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHiveMetastore_get_metastore_db_uuid_args { + public: + + ThriftHiveMetastore_get_metastore_db_uuid_args(const ThriftHiveMetastore_get_metastore_db_uuid_args&) noexcept; + ThriftHiveMetastore_get_metastore_db_uuid_args& operator=(const ThriftHiveMetastore_get_metastore_db_uuid_args&) noexcept; + ThriftHiveMetastore_get_metastore_db_uuid_args() noexcept; + + virtual ~ThriftHiveMetastore_get_metastore_db_uuid_args() noexcept; + + bool operator == (const ThriftHiveMetastore_get_metastore_db_uuid_args & /* rhs */) const; + bool operator != (const ThriftHiveMetastore_get_metastore_db_uuid_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_metastore_db_uuid_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_metastore_db_uuid_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_metastore_db_uuid_pargs() noexcept; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_metastore_db_uuid_result__isset { + _ThriftHiveMetastore_get_metastore_db_uuid_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_metastore_db_uuid_result__isset; + +class ThriftHiveMetastore_get_metastore_db_uuid_result { + public: + + ThriftHiveMetastore_get_metastore_db_uuid_result(const ThriftHiveMetastore_get_metastore_db_uuid_result&); + ThriftHiveMetastore_get_metastore_db_uuid_result& operator=(const ThriftHiveMetastore_get_metastore_db_uuid_result&); + ThriftHiveMetastore_get_metastore_db_uuid_result() noexcept; + + virtual ~ThriftHiveMetastore_get_metastore_db_uuid_result() noexcept; + std::string success; + MetaException o1; + + _ThriftHiveMetastore_get_metastore_db_uuid_result__isset __isset; + + void __set_success(const std::string& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_metastore_db_uuid_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_metastore_db_uuid_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_metastore_db_uuid_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_metastore_db_uuid_presult__isset { + _ThriftHiveMetastore_get_metastore_db_uuid_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_metastore_db_uuid_presult__isset; + +class ThriftHiveMetastore_get_metastore_db_uuid_presult { + public: + + + virtual ~ThriftHiveMetastore_get_metastore_db_uuid_presult() noexcept; + std::string* success; + MetaException o1; + + _ThriftHiveMetastore_get_metastore_db_uuid_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_resource_plan_args__isset { + _ThriftHiveMetastore_create_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_resource_plan_args__isset; + +class ThriftHiveMetastore_create_resource_plan_args { + public: + + ThriftHiveMetastore_create_resource_plan_args(const ThriftHiveMetastore_create_resource_plan_args&); + ThriftHiveMetastore_create_resource_plan_args& operator=(const ThriftHiveMetastore_create_resource_plan_args&); + ThriftHiveMetastore_create_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_create_resource_plan_args() noexcept; + WMCreateResourcePlanRequest request; + + _ThriftHiveMetastore_create_resource_plan_args__isset __isset; + + void __set_request(const WMCreateResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_create_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_resource_plan_pargs() noexcept; + const WMCreateResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_resource_plan_result__isset { + _ThriftHiveMetastore_create_resource_plan_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_resource_plan_result__isset; + +class ThriftHiveMetastore_create_resource_plan_result { + public: + + ThriftHiveMetastore_create_resource_plan_result(const ThriftHiveMetastore_create_resource_plan_result&); + ThriftHiveMetastore_create_resource_plan_result& operator=(const ThriftHiveMetastore_create_resource_plan_result&); + ThriftHiveMetastore_create_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_create_resource_plan_result() noexcept; + WMCreateResourcePlanResponse success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_resource_plan_result__isset __isset; + + void __set_success(const WMCreateResourcePlanResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_resource_plan_presult__isset { + _ThriftHiveMetastore_create_resource_plan_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_resource_plan_presult__isset; + +class ThriftHiveMetastore_create_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_create_resource_plan_presult() noexcept; + WMCreateResourcePlanResponse* success; + AlreadyExistsException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_resource_plan_args__isset { + _ThriftHiveMetastore_get_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_resource_plan_args__isset; + +class ThriftHiveMetastore_get_resource_plan_args { + public: + + ThriftHiveMetastore_get_resource_plan_args(const ThriftHiveMetastore_get_resource_plan_args&); + ThriftHiveMetastore_get_resource_plan_args& operator=(const ThriftHiveMetastore_get_resource_plan_args&); + ThriftHiveMetastore_get_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_get_resource_plan_args() noexcept; + WMGetResourcePlanRequest request; + + _ThriftHiveMetastore_get_resource_plan_args__isset __isset; + + void __set_request(const WMGetResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_get_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_resource_plan_pargs() noexcept; + const WMGetResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_resource_plan_result__isset { + _ThriftHiveMetastore_get_resource_plan_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_resource_plan_result__isset; + +class ThriftHiveMetastore_get_resource_plan_result { + public: + + ThriftHiveMetastore_get_resource_plan_result(const ThriftHiveMetastore_get_resource_plan_result&); + ThriftHiveMetastore_get_resource_plan_result& operator=(const ThriftHiveMetastore_get_resource_plan_result&); + ThriftHiveMetastore_get_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_get_resource_plan_result() noexcept; + WMGetResourcePlanResponse success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_resource_plan_result__isset __isset; + + void __set_success(const WMGetResourcePlanResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_resource_plan_presult__isset { + _ThriftHiveMetastore_get_resource_plan_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_resource_plan_presult__isset; + +class ThriftHiveMetastore_get_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_get_resource_plan_presult() noexcept; + WMGetResourcePlanResponse* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_active_resource_plan_args__isset { + _ThriftHiveMetastore_get_active_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_active_resource_plan_args__isset; + +class ThriftHiveMetastore_get_active_resource_plan_args { + public: + + ThriftHiveMetastore_get_active_resource_plan_args(const ThriftHiveMetastore_get_active_resource_plan_args&); + ThriftHiveMetastore_get_active_resource_plan_args& operator=(const ThriftHiveMetastore_get_active_resource_plan_args&); + ThriftHiveMetastore_get_active_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_get_active_resource_plan_args() noexcept; + WMGetActiveResourcePlanRequest request; + + _ThriftHiveMetastore_get_active_resource_plan_args__isset __isset; + + void __set_request(const WMGetActiveResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_get_active_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_active_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_active_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_active_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_active_resource_plan_pargs() noexcept; + const WMGetActiveResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_active_resource_plan_result__isset { + _ThriftHiveMetastore_get_active_resource_plan_result__isset() : success(false), o2(false) {} + bool success :1; + bool o2 :1; +} _ThriftHiveMetastore_get_active_resource_plan_result__isset; + +class ThriftHiveMetastore_get_active_resource_plan_result { + public: + + ThriftHiveMetastore_get_active_resource_plan_result(const ThriftHiveMetastore_get_active_resource_plan_result&); + ThriftHiveMetastore_get_active_resource_plan_result& operator=(const ThriftHiveMetastore_get_active_resource_plan_result&); + ThriftHiveMetastore_get_active_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_get_active_resource_plan_result() noexcept; + WMGetActiveResourcePlanResponse success; + MetaException o2; + + _ThriftHiveMetastore_get_active_resource_plan_result__isset __isset; + + void __set_success(const WMGetActiveResourcePlanResponse& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_active_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_active_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_active_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_active_resource_plan_presult__isset { + _ThriftHiveMetastore_get_active_resource_plan_presult__isset() : success(false), o2(false) {} + bool success :1; + bool o2 :1; +} _ThriftHiveMetastore_get_active_resource_plan_presult__isset; + +class ThriftHiveMetastore_get_active_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_get_active_resource_plan_presult() noexcept; + WMGetActiveResourcePlanResponse* success; + MetaException o2; + + _ThriftHiveMetastore_get_active_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_resource_plans_args__isset { + _ThriftHiveMetastore_get_all_resource_plans_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_all_resource_plans_args__isset; + +class ThriftHiveMetastore_get_all_resource_plans_args { + public: + + ThriftHiveMetastore_get_all_resource_plans_args(const ThriftHiveMetastore_get_all_resource_plans_args&); + ThriftHiveMetastore_get_all_resource_plans_args& operator=(const ThriftHiveMetastore_get_all_resource_plans_args&); + ThriftHiveMetastore_get_all_resource_plans_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_resource_plans_args() noexcept; + WMGetAllResourcePlanRequest request; + + _ThriftHiveMetastore_get_all_resource_plans_args__isset __isset; + + void __set_request(const WMGetAllResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_get_all_resource_plans_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_resource_plans_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_resource_plans_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_resource_plans_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_resource_plans_pargs() noexcept; + const WMGetAllResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_resource_plans_result__isset { + _ThriftHiveMetastore_get_all_resource_plans_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_resource_plans_result__isset; + +class ThriftHiveMetastore_get_all_resource_plans_result { + public: + + ThriftHiveMetastore_get_all_resource_plans_result(const ThriftHiveMetastore_get_all_resource_plans_result&); + ThriftHiveMetastore_get_all_resource_plans_result& operator=(const ThriftHiveMetastore_get_all_resource_plans_result&); + ThriftHiveMetastore_get_all_resource_plans_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_resource_plans_result() noexcept; + WMGetAllResourcePlanResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_all_resource_plans_result__isset __isset; + + void __set_success(const WMGetAllResourcePlanResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_resource_plans_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_resource_plans_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_resource_plans_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_resource_plans_presult__isset { + _ThriftHiveMetastore_get_all_resource_plans_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_resource_plans_presult__isset; + +class ThriftHiveMetastore_get_all_resource_plans_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_resource_plans_presult() noexcept; + WMGetAllResourcePlanResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_all_resource_plans_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_resource_plan_args__isset { + _ThriftHiveMetastore_alter_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_alter_resource_plan_args__isset; + +class ThriftHiveMetastore_alter_resource_plan_args { + public: + + ThriftHiveMetastore_alter_resource_plan_args(const ThriftHiveMetastore_alter_resource_plan_args&); + ThriftHiveMetastore_alter_resource_plan_args& operator=(const ThriftHiveMetastore_alter_resource_plan_args&); + ThriftHiveMetastore_alter_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_resource_plan_args() noexcept; + WMAlterResourcePlanRequest request; + + _ThriftHiveMetastore_alter_resource_plan_args__isset __isset; + + void __set_request(const WMAlterResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_resource_plan_pargs() noexcept; + const WMAlterResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_resource_plan_result__isset { + _ThriftHiveMetastore_alter_resource_plan_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_resource_plan_result__isset; + +class ThriftHiveMetastore_alter_resource_plan_result { + public: + + ThriftHiveMetastore_alter_resource_plan_result(const ThriftHiveMetastore_alter_resource_plan_result&); + ThriftHiveMetastore_alter_resource_plan_result& operator=(const ThriftHiveMetastore_alter_resource_plan_result&); + ThriftHiveMetastore_alter_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_resource_plan_result() noexcept; + WMAlterResourcePlanResponse success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_resource_plan_result__isset __isset; + + void __set_success(const WMAlterResourcePlanResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_resource_plan_presult__isset { + _ThriftHiveMetastore_alter_resource_plan_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_resource_plan_presult__isset; + +class ThriftHiveMetastore_alter_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_resource_plan_presult() noexcept; + WMAlterResourcePlanResponse* success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_validate_resource_plan_args__isset { + _ThriftHiveMetastore_validate_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_validate_resource_plan_args__isset; + +class ThriftHiveMetastore_validate_resource_plan_args { + public: + + ThriftHiveMetastore_validate_resource_plan_args(const ThriftHiveMetastore_validate_resource_plan_args&); + ThriftHiveMetastore_validate_resource_plan_args& operator=(const ThriftHiveMetastore_validate_resource_plan_args&); + ThriftHiveMetastore_validate_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_validate_resource_plan_args() noexcept; + WMValidateResourcePlanRequest request; + + _ThriftHiveMetastore_validate_resource_plan_args__isset __isset; + + void __set_request(const WMValidateResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_validate_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_validate_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_validate_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_validate_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_validate_resource_plan_pargs() noexcept; + const WMValidateResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_validate_resource_plan_result__isset { + _ThriftHiveMetastore_validate_resource_plan_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_validate_resource_plan_result__isset; + +class ThriftHiveMetastore_validate_resource_plan_result { + public: + + ThriftHiveMetastore_validate_resource_plan_result(const ThriftHiveMetastore_validate_resource_plan_result&); + ThriftHiveMetastore_validate_resource_plan_result& operator=(const ThriftHiveMetastore_validate_resource_plan_result&); + ThriftHiveMetastore_validate_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_validate_resource_plan_result() noexcept; + WMValidateResourcePlanResponse success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_validate_resource_plan_result__isset __isset; + + void __set_success(const WMValidateResourcePlanResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_validate_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_validate_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_validate_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_validate_resource_plan_presult__isset { + _ThriftHiveMetastore_validate_resource_plan_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_validate_resource_plan_presult__isset; + +class ThriftHiveMetastore_validate_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_validate_resource_plan_presult() noexcept; + WMValidateResourcePlanResponse* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_validate_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_resource_plan_args__isset { + _ThriftHiveMetastore_drop_resource_plan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_resource_plan_args__isset; + +class ThriftHiveMetastore_drop_resource_plan_args { + public: + + ThriftHiveMetastore_drop_resource_plan_args(const ThriftHiveMetastore_drop_resource_plan_args&); + ThriftHiveMetastore_drop_resource_plan_args& operator=(const ThriftHiveMetastore_drop_resource_plan_args&); + ThriftHiveMetastore_drop_resource_plan_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_resource_plan_args() noexcept; + WMDropResourcePlanRequest request; + + _ThriftHiveMetastore_drop_resource_plan_args__isset __isset; + + void __set_request(const WMDropResourcePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_resource_plan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_resource_plan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_resource_plan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_resource_plan_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_resource_plan_pargs() noexcept; + const WMDropResourcePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_resource_plan_result__isset { + _ThriftHiveMetastore_drop_resource_plan_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_resource_plan_result__isset; + +class ThriftHiveMetastore_drop_resource_plan_result { + public: + + ThriftHiveMetastore_drop_resource_plan_result(const ThriftHiveMetastore_drop_resource_plan_result&); + ThriftHiveMetastore_drop_resource_plan_result& operator=(const ThriftHiveMetastore_drop_resource_plan_result&); + ThriftHiveMetastore_drop_resource_plan_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_resource_plan_result() noexcept; + WMDropResourcePlanResponse success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_resource_plan_result__isset __isset; + + void __set_success(const WMDropResourcePlanResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_resource_plan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_resource_plan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_resource_plan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_resource_plan_presult__isset { + _ThriftHiveMetastore_drop_resource_plan_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_resource_plan_presult__isset; + +class ThriftHiveMetastore_drop_resource_plan_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_resource_plan_presult() noexcept; + WMDropResourcePlanResponse* success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_resource_plan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_wm_trigger_args__isset { + _ThriftHiveMetastore_create_wm_trigger_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_wm_trigger_args__isset; + +class ThriftHiveMetastore_create_wm_trigger_args { + public: + + ThriftHiveMetastore_create_wm_trigger_args(const ThriftHiveMetastore_create_wm_trigger_args&); + ThriftHiveMetastore_create_wm_trigger_args& operator=(const ThriftHiveMetastore_create_wm_trigger_args&); + ThriftHiveMetastore_create_wm_trigger_args() noexcept; + + virtual ~ThriftHiveMetastore_create_wm_trigger_args() noexcept; + WMCreateTriggerRequest request; + + _ThriftHiveMetastore_create_wm_trigger_args__isset __isset; + + void __set_request(const WMCreateTriggerRequest& val); + + bool operator == (const ThriftHiveMetastore_create_wm_trigger_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_wm_trigger_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_wm_trigger_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_wm_trigger_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_wm_trigger_pargs() noexcept; + const WMCreateTriggerRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_wm_trigger_result__isset { + _ThriftHiveMetastore_create_wm_trigger_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_wm_trigger_result__isset; + +class ThriftHiveMetastore_create_wm_trigger_result { + public: + + ThriftHiveMetastore_create_wm_trigger_result(const ThriftHiveMetastore_create_wm_trigger_result&); + ThriftHiveMetastore_create_wm_trigger_result& operator=(const ThriftHiveMetastore_create_wm_trigger_result&); + ThriftHiveMetastore_create_wm_trigger_result() noexcept; + + virtual ~ThriftHiveMetastore_create_wm_trigger_result() noexcept; + WMCreateTriggerResponse success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_wm_trigger_result__isset __isset; + + void __set_success(const WMCreateTriggerResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_wm_trigger_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_wm_trigger_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_wm_trigger_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_wm_trigger_presult__isset { + _ThriftHiveMetastore_create_wm_trigger_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_wm_trigger_presult__isset; + +class ThriftHiveMetastore_create_wm_trigger_presult { + public: + + + virtual ~ThriftHiveMetastore_create_wm_trigger_presult() noexcept; + WMCreateTriggerResponse* success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_wm_trigger_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_trigger_args__isset { + _ThriftHiveMetastore_alter_wm_trigger_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_alter_wm_trigger_args__isset; + +class ThriftHiveMetastore_alter_wm_trigger_args { + public: + + ThriftHiveMetastore_alter_wm_trigger_args(const ThriftHiveMetastore_alter_wm_trigger_args&); + ThriftHiveMetastore_alter_wm_trigger_args& operator=(const ThriftHiveMetastore_alter_wm_trigger_args&); + ThriftHiveMetastore_alter_wm_trigger_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_wm_trigger_args() noexcept; + WMAlterTriggerRequest request; + + _ThriftHiveMetastore_alter_wm_trigger_args__isset __isset; + + void __set_request(const WMAlterTriggerRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_wm_trigger_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_wm_trigger_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_wm_trigger_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_wm_trigger_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_wm_trigger_pargs() noexcept; + const WMAlterTriggerRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_trigger_result__isset { + _ThriftHiveMetastore_alter_wm_trigger_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_wm_trigger_result__isset; + +class ThriftHiveMetastore_alter_wm_trigger_result { + public: + + ThriftHiveMetastore_alter_wm_trigger_result(const ThriftHiveMetastore_alter_wm_trigger_result&); + ThriftHiveMetastore_alter_wm_trigger_result& operator=(const ThriftHiveMetastore_alter_wm_trigger_result&); + ThriftHiveMetastore_alter_wm_trigger_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_wm_trigger_result() noexcept; + WMAlterTriggerResponse success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_wm_trigger_result__isset __isset; + + void __set_success(const WMAlterTriggerResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_wm_trigger_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_wm_trigger_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_wm_trigger_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_trigger_presult__isset { + _ThriftHiveMetastore_alter_wm_trigger_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_alter_wm_trigger_presult__isset; + +class ThriftHiveMetastore_alter_wm_trigger_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_wm_trigger_presult() noexcept; + WMAlterTriggerResponse* success; + NoSuchObjectException o1; + InvalidObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_alter_wm_trigger_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_trigger_args__isset { + _ThriftHiveMetastore_drop_wm_trigger_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_wm_trigger_args__isset; + +class ThriftHiveMetastore_drop_wm_trigger_args { + public: + + ThriftHiveMetastore_drop_wm_trigger_args(const ThriftHiveMetastore_drop_wm_trigger_args&); + ThriftHiveMetastore_drop_wm_trigger_args& operator=(const ThriftHiveMetastore_drop_wm_trigger_args&); + ThriftHiveMetastore_drop_wm_trigger_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_trigger_args() noexcept; + WMDropTriggerRequest request; + + _ThriftHiveMetastore_drop_wm_trigger_args__isset __isset; + + void __set_request(const WMDropTriggerRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_trigger_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_trigger_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_trigger_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_wm_trigger_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_trigger_pargs() noexcept; + const WMDropTriggerRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_trigger_result__isset { + _ThriftHiveMetastore_drop_wm_trigger_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_trigger_result__isset; + +class ThriftHiveMetastore_drop_wm_trigger_result { + public: + + ThriftHiveMetastore_drop_wm_trigger_result(const ThriftHiveMetastore_drop_wm_trigger_result&); + ThriftHiveMetastore_drop_wm_trigger_result& operator=(const ThriftHiveMetastore_drop_wm_trigger_result&); + ThriftHiveMetastore_drop_wm_trigger_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_trigger_result() noexcept; + WMDropTriggerResponse success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_trigger_result__isset __isset; + + void __set_success(const WMDropTriggerResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_trigger_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_trigger_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_trigger_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_trigger_presult__isset { + _ThriftHiveMetastore_drop_wm_trigger_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_trigger_presult__isset; + +class ThriftHiveMetastore_drop_wm_trigger_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_trigger_presult() noexcept; + WMDropTriggerResponse* success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_trigger_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_triggers_for_resourceplan_args__isset { + _ThriftHiveMetastore_get_triggers_for_resourceplan_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_triggers_for_resourceplan_args__isset; + +class ThriftHiveMetastore_get_triggers_for_resourceplan_args { + public: + + ThriftHiveMetastore_get_triggers_for_resourceplan_args(const ThriftHiveMetastore_get_triggers_for_resourceplan_args&); + ThriftHiveMetastore_get_triggers_for_resourceplan_args& operator=(const ThriftHiveMetastore_get_triggers_for_resourceplan_args&); + ThriftHiveMetastore_get_triggers_for_resourceplan_args() noexcept; + + virtual ~ThriftHiveMetastore_get_triggers_for_resourceplan_args() noexcept; + WMGetTriggersForResourePlanRequest request; + + _ThriftHiveMetastore_get_triggers_for_resourceplan_args__isset __isset; + + void __set_request(const WMGetTriggersForResourePlanRequest& val); + + bool operator == (const ThriftHiveMetastore_get_triggers_for_resourceplan_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_triggers_for_resourceplan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_triggers_for_resourceplan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_triggers_for_resourceplan_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_triggers_for_resourceplan_pargs() noexcept; + const WMGetTriggersForResourePlanRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_triggers_for_resourceplan_result__isset { + _ThriftHiveMetastore_get_triggers_for_resourceplan_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_triggers_for_resourceplan_result__isset; + +class ThriftHiveMetastore_get_triggers_for_resourceplan_result { + public: + + ThriftHiveMetastore_get_triggers_for_resourceplan_result(const ThriftHiveMetastore_get_triggers_for_resourceplan_result&); + ThriftHiveMetastore_get_triggers_for_resourceplan_result& operator=(const ThriftHiveMetastore_get_triggers_for_resourceplan_result&); + ThriftHiveMetastore_get_triggers_for_resourceplan_result() noexcept; + + virtual ~ThriftHiveMetastore_get_triggers_for_resourceplan_result() noexcept; + WMGetTriggersForResourePlanResponse success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_triggers_for_resourceplan_result__isset __isset; + + void __set_success(const WMGetTriggersForResourePlanResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_triggers_for_resourceplan_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_triggers_for_resourceplan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_triggers_for_resourceplan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_triggers_for_resourceplan_presult__isset { + _ThriftHiveMetastore_get_triggers_for_resourceplan_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_triggers_for_resourceplan_presult__isset; + +class ThriftHiveMetastore_get_triggers_for_resourceplan_presult { + public: + + + virtual ~ThriftHiveMetastore_get_triggers_for_resourceplan_presult() noexcept; + WMGetTriggersForResourePlanResponse* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_triggers_for_resourceplan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_wm_pool_args__isset { + _ThriftHiveMetastore_create_wm_pool_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_wm_pool_args__isset; + +class ThriftHiveMetastore_create_wm_pool_args { + public: + + ThriftHiveMetastore_create_wm_pool_args(const ThriftHiveMetastore_create_wm_pool_args&); + ThriftHiveMetastore_create_wm_pool_args& operator=(const ThriftHiveMetastore_create_wm_pool_args&); + ThriftHiveMetastore_create_wm_pool_args() noexcept; + + virtual ~ThriftHiveMetastore_create_wm_pool_args() noexcept; + WMCreatePoolRequest request; + + _ThriftHiveMetastore_create_wm_pool_args__isset __isset; + + void __set_request(const WMCreatePoolRequest& val); + + bool operator == (const ThriftHiveMetastore_create_wm_pool_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_wm_pool_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_wm_pool_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_wm_pool_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_wm_pool_pargs() noexcept; + const WMCreatePoolRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_wm_pool_result__isset { + _ThriftHiveMetastore_create_wm_pool_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_wm_pool_result__isset; + +class ThriftHiveMetastore_create_wm_pool_result { + public: + + ThriftHiveMetastore_create_wm_pool_result(const ThriftHiveMetastore_create_wm_pool_result&); + ThriftHiveMetastore_create_wm_pool_result& operator=(const ThriftHiveMetastore_create_wm_pool_result&); + ThriftHiveMetastore_create_wm_pool_result() noexcept; + + virtual ~ThriftHiveMetastore_create_wm_pool_result() noexcept; + WMCreatePoolResponse success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_wm_pool_result__isset __isset; + + void __set_success(const WMCreatePoolResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_wm_pool_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_wm_pool_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_wm_pool_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_wm_pool_presult__isset { + _ThriftHiveMetastore_create_wm_pool_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_wm_pool_presult__isset; + +class ThriftHiveMetastore_create_wm_pool_presult { + public: + + + virtual ~ThriftHiveMetastore_create_wm_pool_presult() noexcept; + WMCreatePoolResponse* success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_wm_pool_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_pool_args__isset { + _ThriftHiveMetastore_alter_wm_pool_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_alter_wm_pool_args__isset; + +class ThriftHiveMetastore_alter_wm_pool_args { + public: + + ThriftHiveMetastore_alter_wm_pool_args(const ThriftHiveMetastore_alter_wm_pool_args&); + ThriftHiveMetastore_alter_wm_pool_args& operator=(const ThriftHiveMetastore_alter_wm_pool_args&); + ThriftHiveMetastore_alter_wm_pool_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_wm_pool_args() noexcept; + WMAlterPoolRequest request; + + _ThriftHiveMetastore_alter_wm_pool_args__isset __isset; + + void __set_request(const WMAlterPoolRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_wm_pool_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_wm_pool_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_wm_pool_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_wm_pool_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_wm_pool_pargs() noexcept; + const WMAlterPoolRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_pool_result__isset { + _ThriftHiveMetastore_alter_wm_pool_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_alter_wm_pool_result__isset; + +class ThriftHiveMetastore_alter_wm_pool_result { + public: + + ThriftHiveMetastore_alter_wm_pool_result(const ThriftHiveMetastore_alter_wm_pool_result&); + ThriftHiveMetastore_alter_wm_pool_result& operator=(const ThriftHiveMetastore_alter_wm_pool_result&); + ThriftHiveMetastore_alter_wm_pool_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_wm_pool_result() noexcept; + WMAlterPoolResponse success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_alter_wm_pool_result__isset __isset; + + void __set_success(const WMAlterPoolResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_wm_pool_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_wm_pool_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_wm_pool_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_wm_pool_presult__isset { + _ThriftHiveMetastore_alter_wm_pool_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_alter_wm_pool_presult__isset; + +class ThriftHiveMetastore_alter_wm_pool_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_wm_pool_presult() noexcept; + WMAlterPoolResponse* success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_alter_wm_pool_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_pool_args__isset { + _ThriftHiveMetastore_drop_wm_pool_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_wm_pool_args__isset; + +class ThriftHiveMetastore_drop_wm_pool_args { + public: + + ThriftHiveMetastore_drop_wm_pool_args(const ThriftHiveMetastore_drop_wm_pool_args&); + ThriftHiveMetastore_drop_wm_pool_args& operator=(const ThriftHiveMetastore_drop_wm_pool_args&); + ThriftHiveMetastore_drop_wm_pool_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_pool_args() noexcept; + WMDropPoolRequest request; + + _ThriftHiveMetastore_drop_wm_pool_args__isset __isset; + + void __set_request(const WMDropPoolRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_pool_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_pool_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_pool_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_wm_pool_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_pool_pargs() noexcept; + const WMDropPoolRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_pool_result__isset { + _ThriftHiveMetastore_drop_wm_pool_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_pool_result__isset; + +class ThriftHiveMetastore_drop_wm_pool_result { + public: + + ThriftHiveMetastore_drop_wm_pool_result(const ThriftHiveMetastore_drop_wm_pool_result&); + ThriftHiveMetastore_drop_wm_pool_result& operator=(const ThriftHiveMetastore_drop_wm_pool_result&); + ThriftHiveMetastore_drop_wm_pool_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_pool_result() noexcept; + WMDropPoolResponse success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_pool_result__isset __isset; + + void __set_success(const WMDropPoolResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_pool_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_pool_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_pool_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_pool_presult__isset { + _ThriftHiveMetastore_drop_wm_pool_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_pool_presult__isset; + +class ThriftHiveMetastore_drop_wm_pool_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_pool_presult() noexcept; + WMDropPoolResponse* success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_pool_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_or_update_wm_mapping_args__isset { + _ThriftHiveMetastore_create_or_update_wm_mapping_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_or_update_wm_mapping_args__isset; + +class ThriftHiveMetastore_create_or_update_wm_mapping_args { + public: + + ThriftHiveMetastore_create_or_update_wm_mapping_args(const ThriftHiveMetastore_create_or_update_wm_mapping_args&); + ThriftHiveMetastore_create_or_update_wm_mapping_args& operator=(const ThriftHiveMetastore_create_or_update_wm_mapping_args&); + ThriftHiveMetastore_create_or_update_wm_mapping_args() noexcept; + + virtual ~ThriftHiveMetastore_create_or_update_wm_mapping_args() noexcept; + WMCreateOrUpdateMappingRequest request; + + _ThriftHiveMetastore_create_or_update_wm_mapping_args__isset __isset; + + void __set_request(const WMCreateOrUpdateMappingRequest& val); + + bool operator == (const ThriftHiveMetastore_create_or_update_wm_mapping_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_or_update_wm_mapping_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_or_update_wm_mapping_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_or_update_wm_mapping_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_or_update_wm_mapping_pargs() noexcept; + const WMCreateOrUpdateMappingRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_or_update_wm_mapping_result__isset { + _ThriftHiveMetastore_create_or_update_wm_mapping_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_or_update_wm_mapping_result__isset; + +class ThriftHiveMetastore_create_or_update_wm_mapping_result { + public: + + ThriftHiveMetastore_create_or_update_wm_mapping_result(const ThriftHiveMetastore_create_or_update_wm_mapping_result&); + ThriftHiveMetastore_create_or_update_wm_mapping_result& operator=(const ThriftHiveMetastore_create_or_update_wm_mapping_result&); + ThriftHiveMetastore_create_or_update_wm_mapping_result() noexcept; + + virtual ~ThriftHiveMetastore_create_or_update_wm_mapping_result() noexcept; + WMCreateOrUpdateMappingResponse success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_or_update_wm_mapping_result__isset __isset; + + void __set_success(const WMCreateOrUpdateMappingResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_or_update_wm_mapping_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_or_update_wm_mapping_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_or_update_wm_mapping_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_or_update_wm_mapping_presult__isset { + _ThriftHiveMetastore_create_or_update_wm_mapping_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_or_update_wm_mapping_presult__isset; + +class ThriftHiveMetastore_create_or_update_wm_mapping_presult { + public: + + + virtual ~ThriftHiveMetastore_create_or_update_wm_mapping_presult() noexcept; + WMCreateOrUpdateMappingResponse* success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_or_update_wm_mapping_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_mapping_args__isset { + _ThriftHiveMetastore_drop_wm_mapping_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_wm_mapping_args__isset; + +class ThriftHiveMetastore_drop_wm_mapping_args { + public: + + ThriftHiveMetastore_drop_wm_mapping_args(const ThriftHiveMetastore_drop_wm_mapping_args&); + ThriftHiveMetastore_drop_wm_mapping_args& operator=(const ThriftHiveMetastore_drop_wm_mapping_args&); + ThriftHiveMetastore_drop_wm_mapping_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_mapping_args() noexcept; + WMDropMappingRequest request; + + _ThriftHiveMetastore_drop_wm_mapping_args__isset __isset; + + void __set_request(const WMDropMappingRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_mapping_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_mapping_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_mapping_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_wm_mapping_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_mapping_pargs() noexcept; + const WMDropMappingRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_mapping_result__isset { + _ThriftHiveMetastore_drop_wm_mapping_result__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_mapping_result__isset; + +class ThriftHiveMetastore_drop_wm_mapping_result { + public: + + ThriftHiveMetastore_drop_wm_mapping_result(const ThriftHiveMetastore_drop_wm_mapping_result&); + ThriftHiveMetastore_drop_wm_mapping_result& operator=(const ThriftHiveMetastore_drop_wm_mapping_result&); + ThriftHiveMetastore_drop_wm_mapping_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_wm_mapping_result() noexcept; + WMDropMappingResponse success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_mapping_result__isset __isset; + + void __set_success(const WMDropMappingResponse& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_wm_mapping_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_wm_mapping_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_wm_mapping_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_wm_mapping_presult__isset { + _ThriftHiveMetastore_drop_wm_mapping_presult__isset() : success(false), o1(false), o2(false), o3(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_wm_mapping_presult__isset; + +class ThriftHiveMetastore_drop_wm_mapping_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_wm_mapping_presult() noexcept; + WMDropMappingResponse* success; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_wm_mapping_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args__isset { + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args__isset; + +class ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args { + public: + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args(const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args&); + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args& operator=(const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args&); + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args() noexcept; + + virtual ~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args() noexcept; + WMCreateOrDropTriggerToPoolMappingRequest request; + + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args__isset __isset; + + void __set_request(const WMCreateOrDropTriggerToPoolMappingRequest& val); + + bool operator == (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_pargs() noexcept; + const WMCreateOrDropTriggerToPoolMappingRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result__isset { + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result__isset; + +class ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result { + public: + + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result(const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result&); + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result& operator=(const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result&); + ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result() noexcept; + + virtual ~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result() noexcept; + WMCreateOrDropTriggerToPoolMappingResponse success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result__isset __isset; + + void __set_success(const WMCreateOrDropTriggerToPoolMappingResponse& val); + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const InvalidObjectException& val); + + void __set_o4(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult__isset { + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult__isset() : success(false), o1(false), o2(false), o3(false), o4(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult__isset; + +class ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult { + public: + + + virtual ~ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult() noexcept; + WMCreateOrDropTriggerToPoolMappingResponse* success; + AlreadyExistsException o1; + NoSuchObjectException o2; + InvalidObjectException o3; + MetaException o4; + + _ThriftHiveMetastore_create_or_drop_wm_trigger_to_pool_mapping_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_ischema_args__isset { + _ThriftHiveMetastore_create_ischema_args__isset() : schema(false) {} + bool schema :1; +} _ThriftHiveMetastore_create_ischema_args__isset; + +class ThriftHiveMetastore_create_ischema_args { + public: + + ThriftHiveMetastore_create_ischema_args(const ThriftHiveMetastore_create_ischema_args&); + ThriftHiveMetastore_create_ischema_args& operator=(const ThriftHiveMetastore_create_ischema_args&); + ThriftHiveMetastore_create_ischema_args() noexcept; + + virtual ~ThriftHiveMetastore_create_ischema_args() noexcept; + ISchema schema; + + _ThriftHiveMetastore_create_ischema_args__isset __isset; + + void __set_schema(const ISchema& val); + + bool operator == (const ThriftHiveMetastore_create_ischema_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_ischema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_ischema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_ischema_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_ischema_pargs() noexcept; + const ISchema* schema; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_ischema_result__isset { + _ThriftHiveMetastore_create_ischema_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_ischema_result__isset; + +class ThriftHiveMetastore_create_ischema_result { + public: + + ThriftHiveMetastore_create_ischema_result(const ThriftHiveMetastore_create_ischema_result&); + ThriftHiveMetastore_create_ischema_result& operator=(const ThriftHiveMetastore_create_ischema_result&); + ThriftHiveMetastore_create_ischema_result() noexcept; + + virtual ~ThriftHiveMetastore_create_ischema_result() noexcept; + AlreadyExistsException o1; + NoSuchObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_ischema_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_ischema_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_ischema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_ischema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_ischema_presult__isset { + _ThriftHiveMetastore_create_ischema_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_create_ischema_presult__isset; + +class ThriftHiveMetastore_create_ischema_presult { + public: + + + virtual ~ThriftHiveMetastore_create_ischema_presult() noexcept; + AlreadyExistsException o1; + NoSuchObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_create_ischema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_alter_ischema_args__isset { + _ThriftHiveMetastore_alter_ischema_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_alter_ischema_args__isset; + +class ThriftHiveMetastore_alter_ischema_args { + public: + + ThriftHiveMetastore_alter_ischema_args(const ThriftHiveMetastore_alter_ischema_args&); + ThriftHiveMetastore_alter_ischema_args& operator=(const ThriftHiveMetastore_alter_ischema_args&); + ThriftHiveMetastore_alter_ischema_args() noexcept; + + virtual ~ThriftHiveMetastore_alter_ischema_args() noexcept; + AlterISchemaRequest rqst; + + _ThriftHiveMetastore_alter_ischema_args__isset __isset; + + void __set_rqst(const AlterISchemaRequest& val); + + bool operator == (const ThriftHiveMetastore_alter_ischema_args & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_ischema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_ischema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_alter_ischema_pargs { + public: + + + virtual ~ThriftHiveMetastore_alter_ischema_pargs() noexcept; + const AlterISchemaRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_ischema_result__isset { + _ThriftHiveMetastore_alter_ischema_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_ischema_result__isset; + +class ThriftHiveMetastore_alter_ischema_result { + public: + + ThriftHiveMetastore_alter_ischema_result(const ThriftHiveMetastore_alter_ischema_result&); + ThriftHiveMetastore_alter_ischema_result& operator=(const ThriftHiveMetastore_alter_ischema_result&); + ThriftHiveMetastore_alter_ischema_result() noexcept; + + virtual ~ThriftHiveMetastore_alter_ischema_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_ischema_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_alter_ischema_result & rhs) const; + bool operator != (const ThriftHiveMetastore_alter_ischema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_alter_ischema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_alter_ischema_presult__isset { + _ThriftHiveMetastore_alter_ischema_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_alter_ischema_presult__isset; + +class ThriftHiveMetastore_alter_ischema_presult { + public: + + + virtual ~ThriftHiveMetastore_alter_ischema_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_alter_ischema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_ischema_args__isset { + _ThriftHiveMetastore_get_ischema_args__isset() : name(false) {} + bool name :1; +} _ThriftHiveMetastore_get_ischema_args__isset; + +class ThriftHiveMetastore_get_ischema_args { + public: + + ThriftHiveMetastore_get_ischema_args(const ThriftHiveMetastore_get_ischema_args&); + ThriftHiveMetastore_get_ischema_args& operator=(const ThriftHiveMetastore_get_ischema_args&); + ThriftHiveMetastore_get_ischema_args() noexcept; + + virtual ~ThriftHiveMetastore_get_ischema_args() noexcept; + ISchemaName name; + + _ThriftHiveMetastore_get_ischema_args__isset __isset; + + void __set_name(const ISchemaName& val); + + bool operator == (const ThriftHiveMetastore_get_ischema_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_ischema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_ischema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_ischema_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_ischema_pargs() noexcept; + const ISchemaName* name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_ischema_result__isset { + _ThriftHiveMetastore_get_ischema_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_ischema_result__isset; + +class ThriftHiveMetastore_get_ischema_result { + public: + + ThriftHiveMetastore_get_ischema_result(const ThriftHiveMetastore_get_ischema_result&); + ThriftHiveMetastore_get_ischema_result& operator=(const ThriftHiveMetastore_get_ischema_result&); + ThriftHiveMetastore_get_ischema_result() noexcept; + + virtual ~ThriftHiveMetastore_get_ischema_result() noexcept; + ISchema success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_ischema_result__isset __isset; + + void __set_success(const ISchema& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_ischema_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_ischema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_ischema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_ischema_presult__isset { + _ThriftHiveMetastore_get_ischema_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_ischema_presult__isset; + +class ThriftHiveMetastore_get_ischema_presult { + public: + + + virtual ~ThriftHiveMetastore_get_ischema_presult() noexcept; + ISchema* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_ischema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_ischema_args__isset { + _ThriftHiveMetastore_drop_ischema_args__isset() : name(false) {} + bool name :1; +} _ThriftHiveMetastore_drop_ischema_args__isset; + +class ThriftHiveMetastore_drop_ischema_args { + public: + + ThriftHiveMetastore_drop_ischema_args(const ThriftHiveMetastore_drop_ischema_args&); + ThriftHiveMetastore_drop_ischema_args& operator=(const ThriftHiveMetastore_drop_ischema_args&); + ThriftHiveMetastore_drop_ischema_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_ischema_args() noexcept; + ISchemaName name; + + _ThriftHiveMetastore_drop_ischema_args__isset __isset; + + void __set_name(const ISchemaName& val); + + bool operator == (const ThriftHiveMetastore_drop_ischema_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_ischema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_ischema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_ischema_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_ischema_pargs() noexcept; + const ISchemaName* name; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_ischema_result__isset { + _ThriftHiveMetastore_drop_ischema_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_ischema_result__isset; + +class ThriftHiveMetastore_drop_ischema_result { + public: + + ThriftHiveMetastore_drop_ischema_result(const ThriftHiveMetastore_drop_ischema_result&); + ThriftHiveMetastore_drop_ischema_result& operator=(const ThriftHiveMetastore_drop_ischema_result&); + ThriftHiveMetastore_drop_ischema_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_ischema_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_ischema_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_ischema_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_ischema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_ischema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_ischema_presult__isset { + _ThriftHiveMetastore_drop_ischema_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_drop_ischema_presult__isset; + +class ThriftHiveMetastore_drop_ischema_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_ischema_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_drop_ischema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_schema_version_args__isset { + _ThriftHiveMetastore_add_schema_version_args__isset() : schemaVersion(false) {} + bool schemaVersion :1; +} _ThriftHiveMetastore_add_schema_version_args__isset; + +class ThriftHiveMetastore_add_schema_version_args { + public: + + ThriftHiveMetastore_add_schema_version_args(const ThriftHiveMetastore_add_schema_version_args&); + ThriftHiveMetastore_add_schema_version_args& operator=(const ThriftHiveMetastore_add_schema_version_args&); + ThriftHiveMetastore_add_schema_version_args() noexcept; + + virtual ~ThriftHiveMetastore_add_schema_version_args() noexcept; + SchemaVersion schemaVersion; + + _ThriftHiveMetastore_add_schema_version_args__isset __isset; + + void __set_schemaVersion(const SchemaVersion& val); + + bool operator == (const ThriftHiveMetastore_add_schema_version_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_schema_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_schema_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_schema_version_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_schema_version_pargs() noexcept; + const SchemaVersion* schemaVersion; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_schema_version_result__isset { + _ThriftHiveMetastore_add_schema_version_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_schema_version_result__isset; + +class ThriftHiveMetastore_add_schema_version_result { + public: + + ThriftHiveMetastore_add_schema_version_result(const ThriftHiveMetastore_add_schema_version_result&); + ThriftHiveMetastore_add_schema_version_result& operator=(const ThriftHiveMetastore_add_schema_version_result&); + ThriftHiveMetastore_add_schema_version_result() noexcept; + + virtual ~ThriftHiveMetastore_add_schema_version_result() noexcept; + AlreadyExistsException o1; + NoSuchObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_add_schema_version_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_schema_version_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_schema_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_schema_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_schema_version_presult__isset { + _ThriftHiveMetastore_add_schema_version_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_add_schema_version_presult__isset; + +class ThriftHiveMetastore_add_schema_version_presult { + public: + + + virtual ~ThriftHiveMetastore_add_schema_version_presult() noexcept; + AlreadyExistsException o1; + NoSuchObjectException o2; + MetaException o3; + + _ThriftHiveMetastore_add_schema_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_version_args__isset { + _ThriftHiveMetastore_get_schema_version_args__isset() : schemaVersion(false) {} + bool schemaVersion :1; +} _ThriftHiveMetastore_get_schema_version_args__isset; + +class ThriftHiveMetastore_get_schema_version_args { + public: + + ThriftHiveMetastore_get_schema_version_args(const ThriftHiveMetastore_get_schema_version_args&); + ThriftHiveMetastore_get_schema_version_args& operator=(const ThriftHiveMetastore_get_schema_version_args&); + ThriftHiveMetastore_get_schema_version_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_version_args() noexcept; + SchemaVersionDescriptor schemaVersion; + + _ThriftHiveMetastore_get_schema_version_args__isset __isset; + + void __set_schemaVersion(const SchemaVersionDescriptor& val); + + bool operator == (const ThriftHiveMetastore_get_schema_version_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_version_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_version_pargs() noexcept; + const SchemaVersionDescriptor* schemaVersion; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_version_result__isset { + _ThriftHiveMetastore_get_schema_version_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_version_result__isset; + +class ThriftHiveMetastore_get_schema_version_result { + public: + + ThriftHiveMetastore_get_schema_version_result(const ThriftHiveMetastore_get_schema_version_result&); + ThriftHiveMetastore_get_schema_version_result& operator=(const ThriftHiveMetastore_get_schema_version_result&); + ThriftHiveMetastore_get_schema_version_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_version_result() noexcept; + SchemaVersion success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_version_result__isset __isset; + + void __set_success(const SchemaVersion& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_version_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_version_presult__isset { + _ThriftHiveMetastore_get_schema_version_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_version_presult__isset; + +class ThriftHiveMetastore_get_schema_version_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_version_presult() noexcept; + SchemaVersion* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_latest_version_args__isset { + _ThriftHiveMetastore_get_schema_latest_version_args__isset() : schemaName(false) {} + bool schemaName :1; +} _ThriftHiveMetastore_get_schema_latest_version_args__isset; + +class ThriftHiveMetastore_get_schema_latest_version_args { + public: + + ThriftHiveMetastore_get_schema_latest_version_args(const ThriftHiveMetastore_get_schema_latest_version_args&); + ThriftHiveMetastore_get_schema_latest_version_args& operator=(const ThriftHiveMetastore_get_schema_latest_version_args&); + ThriftHiveMetastore_get_schema_latest_version_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_latest_version_args() noexcept; + ISchemaName schemaName; + + _ThriftHiveMetastore_get_schema_latest_version_args__isset __isset; + + void __set_schemaName(const ISchemaName& val); + + bool operator == (const ThriftHiveMetastore_get_schema_latest_version_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_latest_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_latest_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_latest_version_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_latest_version_pargs() noexcept; + const ISchemaName* schemaName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_latest_version_result__isset { + _ThriftHiveMetastore_get_schema_latest_version_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_latest_version_result__isset; + +class ThriftHiveMetastore_get_schema_latest_version_result { + public: + + ThriftHiveMetastore_get_schema_latest_version_result(const ThriftHiveMetastore_get_schema_latest_version_result&); + ThriftHiveMetastore_get_schema_latest_version_result& operator=(const ThriftHiveMetastore_get_schema_latest_version_result&); + ThriftHiveMetastore_get_schema_latest_version_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_latest_version_result() noexcept; + SchemaVersion success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_latest_version_result__isset __isset; + + void __set_success(const SchemaVersion& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_latest_version_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_latest_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_latest_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_latest_version_presult__isset { + _ThriftHiveMetastore_get_schema_latest_version_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_latest_version_presult__isset; + +class ThriftHiveMetastore_get_schema_latest_version_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_latest_version_presult() noexcept; + SchemaVersion* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_latest_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schema_all_versions_args__isset { + _ThriftHiveMetastore_get_schema_all_versions_args__isset() : schemaName(false) {} + bool schemaName :1; +} _ThriftHiveMetastore_get_schema_all_versions_args__isset; + +class ThriftHiveMetastore_get_schema_all_versions_args { + public: + + ThriftHiveMetastore_get_schema_all_versions_args(const ThriftHiveMetastore_get_schema_all_versions_args&); + ThriftHiveMetastore_get_schema_all_versions_args& operator=(const ThriftHiveMetastore_get_schema_all_versions_args&); + ThriftHiveMetastore_get_schema_all_versions_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_all_versions_args() noexcept; + ISchemaName schemaName; + + _ThriftHiveMetastore_get_schema_all_versions_args__isset __isset; + + void __set_schemaName(const ISchemaName& val); + + bool operator == (const ThriftHiveMetastore_get_schema_all_versions_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_all_versions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_all_versions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schema_all_versions_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schema_all_versions_pargs() noexcept; + const ISchemaName* schemaName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_all_versions_result__isset { + _ThriftHiveMetastore_get_schema_all_versions_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_all_versions_result__isset; + +class ThriftHiveMetastore_get_schema_all_versions_result { + public: + + ThriftHiveMetastore_get_schema_all_versions_result(const ThriftHiveMetastore_get_schema_all_versions_result&); + ThriftHiveMetastore_get_schema_all_versions_result& operator=(const ThriftHiveMetastore_get_schema_all_versions_result&); + ThriftHiveMetastore_get_schema_all_versions_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schema_all_versions_result() noexcept; + std::vector success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_all_versions_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_schema_all_versions_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schema_all_versions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schema_all_versions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schema_all_versions_presult__isset { + _ThriftHiveMetastore_get_schema_all_versions_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_schema_all_versions_presult__isset; + +class ThriftHiveMetastore_get_schema_all_versions_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schema_all_versions_presult() noexcept; + std::vector * success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_schema_all_versions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_schema_version_args__isset { + _ThriftHiveMetastore_drop_schema_version_args__isset() : schemaVersion(false) {} + bool schemaVersion :1; +} _ThriftHiveMetastore_drop_schema_version_args__isset; + +class ThriftHiveMetastore_drop_schema_version_args { + public: + + ThriftHiveMetastore_drop_schema_version_args(const ThriftHiveMetastore_drop_schema_version_args&); + ThriftHiveMetastore_drop_schema_version_args& operator=(const ThriftHiveMetastore_drop_schema_version_args&); + ThriftHiveMetastore_drop_schema_version_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_schema_version_args() noexcept; + SchemaVersionDescriptor schemaVersion; + + _ThriftHiveMetastore_drop_schema_version_args__isset __isset; + + void __set_schemaVersion(const SchemaVersionDescriptor& val); + + bool operator == (const ThriftHiveMetastore_drop_schema_version_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_schema_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_schema_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_schema_version_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_schema_version_pargs() noexcept; + const SchemaVersionDescriptor* schemaVersion; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_schema_version_result__isset { + _ThriftHiveMetastore_drop_schema_version_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_schema_version_result__isset; + +class ThriftHiveMetastore_drop_schema_version_result { + public: + + ThriftHiveMetastore_drop_schema_version_result(const ThriftHiveMetastore_drop_schema_version_result&); + ThriftHiveMetastore_drop_schema_version_result& operator=(const ThriftHiveMetastore_drop_schema_version_result&); + ThriftHiveMetastore_drop_schema_version_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_schema_version_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_schema_version_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_schema_version_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_schema_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_schema_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_schema_version_presult__isset { + _ThriftHiveMetastore_drop_schema_version_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_drop_schema_version_presult__isset; + +class ThriftHiveMetastore_drop_schema_version_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_schema_version_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_drop_schema_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_schemas_by_cols_args__isset { + _ThriftHiveMetastore_get_schemas_by_cols_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_schemas_by_cols_args__isset; + +class ThriftHiveMetastore_get_schemas_by_cols_args { + public: + + ThriftHiveMetastore_get_schemas_by_cols_args(const ThriftHiveMetastore_get_schemas_by_cols_args&); + ThriftHiveMetastore_get_schemas_by_cols_args& operator=(const ThriftHiveMetastore_get_schemas_by_cols_args&); + ThriftHiveMetastore_get_schemas_by_cols_args() noexcept; + + virtual ~ThriftHiveMetastore_get_schemas_by_cols_args() noexcept; + FindSchemasByColsRqst rqst; + + _ThriftHiveMetastore_get_schemas_by_cols_args__isset __isset; + + void __set_rqst(const FindSchemasByColsRqst& val); + + bool operator == (const ThriftHiveMetastore_get_schemas_by_cols_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schemas_by_cols_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schemas_by_cols_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_schemas_by_cols_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_schemas_by_cols_pargs() noexcept; + const FindSchemasByColsRqst* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schemas_by_cols_result__isset { + _ThriftHiveMetastore_get_schemas_by_cols_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_schemas_by_cols_result__isset; + +class ThriftHiveMetastore_get_schemas_by_cols_result { + public: + + ThriftHiveMetastore_get_schemas_by_cols_result(const ThriftHiveMetastore_get_schemas_by_cols_result&); + ThriftHiveMetastore_get_schemas_by_cols_result& operator=(const ThriftHiveMetastore_get_schemas_by_cols_result&); + ThriftHiveMetastore_get_schemas_by_cols_result() noexcept; + + virtual ~ThriftHiveMetastore_get_schemas_by_cols_result() noexcept; + FindSchemasByColsResp success; + MetaException o1; + + _ThriftHiveMetastore_get_schemas_by_cols_result__isset __isset; + + void __set_success(const FindSchemasByColsResp& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_schemas_by_cols_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_schemas_by_cols_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_schemas_by_cols_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_schemas_by_cols_presult__isset { + _ThriftHiveMetastore_get_schemas_by_cols_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_schemas_by_cols_presult__isset; + +class ThriftHiveMetastore_get_schemas_by_cols_presult { + public: + + + virtual ~ThriftHiveMetastore_get_schemas_by_cols_presult() noexcept; + FindSchemasByColsResp* success; + MetaException o1; + + _ThriftHiveMetastore_get_schemas_by_cols_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_map_schema_version_to_serde_args__isset { + _ThriftHiveMetastore_map_schema_version_to_serde_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_map_schema_version_to_serde_args__isset; + +class ThriftHiveMetastore_map_schema_version_to_serde_args { + public: + + ThriftHiveMetastore_map_schema_version_to_serde_args(const ThriftHiveMetastore_map_schema_version_to_serde_args&); + ThriftHiveMetastore_map_schema_version_to_serde_args& operator=(const ThriftHiveMetastore_map_schema_version_to_serde_args&); + ThriftHiveMetastore_map_schema_version_to_serde_args() noexcept; + + virtual ~ThriftHiveMetastore_map_schema_version_to_serde_args() noexcept; + MapSchemaVersionToSerdeRequest rqst; + + _ThriftHiveMetastore_map_schema_version_to_serde_args__isset __isset; + + void __set_rqst(const MapSchemaVersionToSerdeRequest& val); + + bool operator == (const ThriftHiveMetastore_map_schema_version_to_serde_args & rhs) const; + bool operator != (const ThriftHiveMetastore_map_schema_version_to_serde_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_map_schema_version_to_serde_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_map_schema_version_to_serde_pargs { + public: + + + virtual ~ThriftHiveMetastore_map_schema_version_to_serde_pargs() noexcept; + const MapSchemaVersionToSerdeRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_map_schema_version_to_serde_result__isset { + _ThriftHiveMetastore_map_schema_version_to_serde_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_map_schema_version_to_serde_result__isset; + +class ThriftHiveMetastore_map_schema_version_to_serde_result { + public: + + ThriftHiveMetastore_map_schema_version_to_serde_result(const ThriftHiveMetastore_map_schema_version_to_serde_result&); + ThriftHiveMetastore_map_schema_version_to_serde_result& operator=(const ThriftHiveMetastore_map_schema_version_to_serde_result&); + ThriftHiveMetastore_map_schema_version_to_serde_result() noexcept; + + virtual ~ThriftHiveMetastore_map_schema_version_to_serde_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_map_schema_version_to_serde_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_map_schema_version_to_serde_result & rhs) const; + bool operator != (const ThriftHiveMetastore_map_schema_version_to_serde_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_map_schema_version_to_serde_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_map_schema_version_to_serde_presult__isset { + _ThriftHiveMetastore_map_schema_version_to_serde_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_map_schema_version_to_serde_presult__isset; + +class ThriftHiveMetastore_map_schema_version_to_serde_presult { + public: + + + virtual ~ThriftHiveMetastore_map_schema_version_to_serde_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_map_schema_version_to_serde_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_set_schema_version_state_args__isset { + _ThriftHiveMetastore_set_schema_version_state_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_set_schema_version_state_args__isset; + +class ThriftHiveMetastore_set_schema_version_state_args { + public: + + ThriftHiveMetastore_set_schema_version_state_args(const ThriftHiveMetastore_set_schema_version_state_args&); + ThriftHiveMetastore_set_schema_version_state_args& operator=(const ThriftHiveMetastore_set_schema_version_state_args&); + ThriftHiveMetastore_set_schema_version_state_args() noexcept; + + virtual ~ThriftHiveMetastore_set_schema_version_state_args() noexcept; + SetSchemaVersionStateRequest rqst; + + _ThriftHiveMetastore_set_schema_version_state_args__isset __isset; + + void __set_rqst(const SetSchemaVersionStateRequest& val); + + bool operator == (const ThriftHiveMetastore_set_schema_version_state_args & rhs) const; + bool operator != (const ThriftHiveMetastore_set_schema_version_state_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_schema_version_state_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_set_schema_version_state_pargs { + public: + + + virtual ~ThriftHiveMetastore_set_schema_version_state_pargs() noexcept; + const SetSchemaVersionStateRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_schema_version_state_result__isset { + _ThriftHiveMetastore_set_schema_version_state_result__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_set_schema_version_state_result__isset; + +class ThriftHiveMetastore_set_schema_version_state_result { + public: + + ThriftHiveMetastore_set_schema_version_state_result(const ThriftHiveMetastore_set_schema_version_state_result&); + ThriftHiveMetastore_set_schema_version_state_result& operator=(const ThriftHiveMetastore_set_schema_version_state_result&); + ThriftHiveMetastore_set_schema_version_state_result() noexcept; + + virtual ~ThriftHiveMetastore_set_schema_version_state_result() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_set_schema_version_state_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const InvalidOperationException& val); + + void __set_o3(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_set_schema_version_state_result & rhs) const; + bool operator != (const ThriftHiveMetastore_set_schema_version_state_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_set_schema_version_state_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_set_schema_version_state_presult__isset { + _ThriftHiveMetastore_set_schema_version_state_presult__isset() : o1(false), o2(false), o3(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; +} _ThriftHiveMetastore_set_schema_version_state_presult__isset; + +class ThriftHiveMetastore_set_schema_version_state_presult { + public: + + + virtual ~ThriftHiveMetastore_set_schema_version_state_presult() noexcept; + NoSuchObjectException o1; + InvalidOperationException o2; + MetaException o3; + + _ThriftHiveMetastore_set_schema_version_state_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_serde_args__isset { + _ThriftHiveMetastore_add_serde_args__isset() : serde(false) {} + bool serde :1; +} _ThriftHiveMetastore_add_serde_args__isset; + +class ThriftHiveMetastore_add_serde_args { + public: + + ThriftHiveMetastore_add_serde_args(const ThriftHiveMetastore_add_serde_args&); + ThriftHiveMetastore_add_serde_args& operator=(const ThriftHiveMetastore_add_serde_args&); + ThriftHiveMetastore_add_serde_args() noexcept; + + virtual ~ThriftHiveMetastore_add_serde_args() noexcept; + SerDeInfo serde; + + _ThriftHiveMetastore_add_serde_args__isset __isset; + + void __set_serde(const SerDeInfo& val); + + bool operator == (const ThriftHiveMetastore_add_serde_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_serde_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_serde_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_serde_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_serde_pargs() noexcept; + const SerDeInfo* serde; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_serde_result__isset { + _ThriftHiveMetastore_add_serde_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_serde_result__isset; + +class ThriftHiveMetastore_add_serde_result { + public: + + ThriftHiveMetastore_add_serde_result(const ThriftHiveMetastore_add_serde_result&); + ThriftHiveMetastore_add_serde_result& operator=(const ThriftHiveMetastore_add_serde_result&); + ThriftHiveMetastore_add_serde_result() noexcept; + + virtual ~ThriftHiveMetastore_add_serde_result() noexcept; + AlreadyExistsException o1; + MetaException o2; + + _ThriftHiveMetastore_add_serde_result__isset __isset; + + void __set_o1(const AlreadyExistsException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_serde_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_serde_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_serde_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_serde_presult__isset { + _ThriftHiveMetastore_add_serde_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_add_serde_presult__isset; + +class ThriftHiveMetastore_add_serde_presult { + public: + + + virtual ~ThriftHiveMetastore_add_serde_presult() noexcept; + AlreadyExistsException o1; + MetaException o2; + + _ThriftHiveMetastore_add_serde_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_serde_args__isset { + _ThriftHiveMetastore_get_serde_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_serde_args__isset; + +class ThriftHiveMetastore_get_serde_args { + public: + + ThriftHiveMetastore_get_serde_args(const ThriftHiveMetastore_get_serde_args&); + ThriftHiveMetastore_get_serde_args& operator=(const ThriftHiveMetastore_get_serde_args&); + ThriftHiveMetastore_get_serde_args() noexcept; + + virtual ~ThriftHiveMetastore_get_serde_args() noexcept; + GetSerdeRequest rqst; + + _ThriftHiveMetastore_get_serde_args__isset __isset; + + void __set_rqst(const GetSerdeRequest& val); + + bool operator == (const ThriftHiveMetastore_get_serde_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_serde_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_serde_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_serde_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_serde_pargs() noexcept; + const GetSerdeRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_serde_result__isset { + _ThriftHiveMetastore_get_serde_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_serde_result__isset; + +class ThriftHiveMetastore_get_serde_result { + public: + + ThriftHiveMetastore_get_serde_result(const ThriftHiveMetastore_get_serde_result&); + ThriftHiveMetastore_get_serde_result& operator=(const ThriftHiveMetastore_get_serde_result&); + ThriftHiveMetastore_get_serde_result() noexcept; + + virtual ~ThriftHiveMetastore_get_serde_result() noexcept; + SerDeInfo success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_serde_result__isset __isset; + + void __set_success(const SerDeInfo& val); + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_serde_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_serde_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_serde_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_serde_presult__isset { + _ThriftHiveMetastore_get_serde_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_serde_presult__isset; + +class ThriftHiveMetastore_get_serde_presult { + public: + + + virtual ~ThriftHiveMetastore_get_serde_presult() noexcept; + SerDeInfo* success; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_get_serde_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_lock_materialization_rebuild_args__isset { + _ThriftHiveMetastore_get_lock_materialization_rebuild_args__isset() : dbName(false), tableName(false), txnId(false) {} + bool dbName :1; + bool tableName :1; + bool txnId :1; +} _ThriftHiveMetastore_get_lock_materialization_rebuild_args__isset; + +class ThriftHiveMetastore_get_lock_materialization_rebuild_args { + public: + + ThriftHiveMetastore_get_lock_materialization_rebuild_args(const ThriftHiveMetastore_get_lock_materialization_rebuild_args&); + ThriftHiveMetastore_get_lock_materialization_rebuild_args& operator=(const ThriftHiveMetastore_get_lock_materialization_rebuild_args&); + ThriftHiveMetastore_get_lock_materialization_rebuild_args() noexcept; + + virtual ~ThriftHiveMetastore_get_lock_materialization_rebuild_args() noexcept; + std::string dbName; + std::string tableName; + int64_t txnId; + + _ThriftHiveMetastore_get_lock_materialization_rebuild_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_txnId(const int64_t val); + + bool operator == (const ThriftHiveMetastore_get_lock_materialization_rebuild_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_lock_materialization_rebuild_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_lock_materialization_rebuild_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_lock_materialization_rebuild_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_lock_materialization_rebuild_pargs() noexcept; + const std::string* dbName; + const std::string* tableName; + const int64_t* txnId; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_lock_materialization_rebuild_result__isset { + _ThriftHiveMetastore_get_lock_materialization_rebuild_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_lock_materialization_rebuild_result__isset; + +class ThriftHiveMetastore_get_lock_materialization_rebuild_result { + public: + + ThriftHiveMetastore_get_lock_materialization_rebuild_result(const ThriftHiveMetastore_get_lock_materialization_rebuild_result&); + ThriftHiveMetastore_get_lock_materialization_rebuild_result& operator=(const ThriftHiveMetastore_get_lock_materialization_rebuild_result&); + ThriftHiveMetastore_get_lock_materialization_rebuild_result() noexcept; + + virtual ~ThriftHiveMetastore_get_lock_materialization_rebuild_result() noexcept; + LockResponse success; + + _ThriftHiveMetastore_get_lock_materialization_rebuild_result__isset __isset; + + void __set_success(const LockResponse& val); + + bool operator == (const ThriftHiveMetastore_get_lock_materialization_rebuild_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_lock_materialization_rebuild_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_lock_materialization_rebuild_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_lock_materialization_rebuild_presult__isset { + _ThriftHiveMetastore_get_lock_materialization_rebuild_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_lock_materialization_rebuild_presult__isset; + +class ThriftHiveMetastore_get_lock_materialization_rebuild_presult { + public: + + + virtual ~ThriftHiveMetastore_get_lock_materialization_rebuild_presult() noexcept; + LockResponse* success; + + _ThriftHiveMetastore_get_lock_materialization_rebuild_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args__isset { + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args__isset() : dbName(false), tableName(false), txnId(false) {} + bool dbName :1; + bool tableName :1; + bool txnId :1; +} _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args__isset; + +class ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args { + public: + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args(const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args&); + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args& operator=(const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args&); + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args() noexcept; + std::string dbName; + std::string tableName; + int64_t txnId; + + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_txnId(const int64_t val); + + bool operator == (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_pargs() noexcept; + const std::string* dbName; + const std::string* tableName; + const int64_t* txnId; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result__isset { + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result__isset; + +class ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result { + public: + + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result(const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result&) noexcept; + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result& operator=(const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result&) noexcept; + ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result() noexcept; + + virtual ~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result() noexcept; + bool success; + + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result__isset __isset; + + void __set_success(const bool val); + + bool operator == (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result & rhs) const; + bool operator != (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult__isset { + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult__isset; + +class ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult { + public: + + + virtual ~ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult() noexcept; + bool* success; + + _ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_runtime_stats_args__isset { + _ThriftHiveMetastore_add_runtime_stats_args__isset() : stat(false) {} + bool stat :1; +} _ThriftHiveMetastore_add_runtime_stats_args__isset; + +class ThriftHiveMetastore_add_runtime_stats_args { + public: + + ThriftHiveMetastore_add_runtime_stats_args(const ThriftHiveMetastore_add_runtime_stats_args&); + ThriftHiveMetastore_add_runtime_stats_args& operator=(const ThriftHiveMetastore_add_runtime_stats_args&); + ThriftHiveMetastore_add_runtime_stats_args() noexcept; + + virtual ~ThriftHiveMetastore_add_runtime_stats_args() noexcept; + RuntimeStat stat; + + _ThriftHiveMetastore_add_runtime_stats_args__isset __isset; + + void __set_stat(const RuntimeStat& val); + + bool operator == (const ThriftHiveMetastore_add_runtime_stats_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_runtime_stats_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_runtime_stats_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_runtime_stats_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_runtime_stats_pargs() noexcept; + const RuntimeStat* stat; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_runtime_stats_result__isset { + _ThriftHiveMetastore_add_runtime_stats_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_runtime_stats_result__isset; + +class ThriftHiveMetastore_add_runtime_stats_result { + public: + + ThriftHiveMetastore_add_runtime_stats_result(const ThriftHiveMetastore_add_runtime_stats_result&); + ThriftHiveMetastore_add_runtime_stats_result& operator=(const ThriftHiveMetastore_add_runtime_stats_result&); + ThriftHiveMetastore_add_runtime_stats_result() noexcept; + + virtual ~ThriftHiveMetastore_add_runtime_stats_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_runtime_stats_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_runtime_stats_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_runtime_stats_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_runtime_stats_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_runtime_stats_presult__isset { + _ThriftHiveMetastore_add_runtime_stats_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_runtime_stats_presult__isset; + +class ThriftHiveMetastore_add_runtime_stats_presult { + public: + + + virtual ~ThriftHiveMetastore_add_runtime_stats_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_runtime_stats_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_runtime_stats_args__isset { + _ThriftHiveMetastore_get_runtime_stats_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_runtime_stats_args__isset; + +class ThriftHiveMetastore_get_runtime_stats_args { + public: + + ThriftHiveMetastore_get_runtime_stats_args(const ThriftHiveMetastore_get_runtime_stats_args&) noexcept; + ThriftHiveMetastore_get_runtime_stats_args& operator=(const ThriftHiveMetastore_get_runtime_stats_args&) noexcept; + ThriftHiveMetastore_get_runtime_stats_args() noexcept; + + virtual ~ThriftHiveMetastore_get_runtime_stats_args() noexcept; + GetRuntimeStatsRequest rqst; + + _ThriftHiveMetastore_get_runtime_stats_args__isset __isset; + + void __set_rqst(const GetRuntimeStatsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_runtime_stats_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_runtime_stats_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_runtime_stats_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_runtime_stats_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_runtime_stats_pargs() noexcept; + const GetRuntimeStatsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_runtime_stats_result__isset { + _ThriftHiveMetastore_get_runtime_stats_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_runtime_stats_result__isset; + +class ThriftHiveMetastore_get_runtime_stats_result { + public: + + ThriftHiveMetastore_get_runtime_stats_result(const ThriftHiveMetastore_get_runtime_stats_result&); + ThriftHiveMetastore_get_runtime_stats_result& operator=(const ThriftHiveMetastore_get_runtime_stats_result&); + ThriftHiveMetastore_get_runtime_stats_result() noexcept; + + virtual ~ThriftHiveMetastore_get_runtime_stats_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_runtime_stats_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_runtime_stats_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_runtime_stats_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_runtime_stats_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_runtime_stats_presult__isset { + _ThriftHiveMetastore_get_runtime_stats_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_runtime_stats_presult__isset; + +class ThriftHiveMetastore_get_runtime_stats_presult { + public: + + + virtual ~ThriftHiveMetastore_get_runtime_stats_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_runtime_stats_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_specs_args__isset { + _ThriftHiveMetastore_get_partitions_with_specs_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_partitions_with_specs_args__isset; + +class ThriftHiveMetastore_get_partitions_with_specs_args { + public: + + ThriftHiveMetastore_get_partitions_with_specs_args(const ThriftHiveMetastore_get_partitions_with_specs_args&); + ThriftHiveMetastore_get_partitions_with_specs_args& operator=(const ThriftHiveMetastore_get_partitions_with_specs_args&); + ThriftHiveMetastore_get_partitions_with_specs_args() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_with_specs_args() noexcept; + GetPartitionsRequest request; + + _ThriftHiveMetastore_get_partitions_with_specs_args__isset __isset; + + void __set_request(const GetPartitionsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_with_specs_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_with_specs_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_with_specs_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_partitions_with_specs_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_with_specs_pargs() noexcept; + const GetPartitionsRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_specs_result__isset { + _ThriftHiveMetastore_get_partitions_with_specs_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_partitions_with_specs_result__isset; + +class ThriftHiveMetastore_get_partitions_with_specs_result { + public: + + ThriftHiveMetastore_get_partitions_with_specs_result(const ThriftHiveMetastore_get_partitions_with_specs_result&); + ThriftHiveMetastore_get_partitions_with_specs_result& operator=(const ThriftHiveMetastore_get_partitions_with_specs_result&); + ThriftHiveMetastore_get_partitions_with_specs_result() noexcept; + + virtual ~ThriftHiveMetastore_get_partitions_with_specs_result() noexcept; + GetPartitionsResponse success; + MetaException o1; + + _ThriftHiveMetastore_get_partitions_with_specs_result__isset __isset; + + void __set_success(const GetPartitionsResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_partitions_with_specs_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_partitions_with_specs_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_partitions_with_specs_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_partitions_with_specs_presult__isset { + _ThriftHiveMetastore_get_partitions_with_specs_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_partitions_with_specs_presult__isset; + +class ThriftHiveMetastore_get_partitions_with_specs_presult { + public: + + + virtual ~ThriftHiveMetastore_get_partitions_with_specs_presult() noexcept; + GetPartitionsResponse* success; + MetaException o1; + + _ThriftHiveMetastore_get_partitions_with_specs_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_poll_args__isset { + _ThriftHiveMetastore_scheduled_query_poll_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_scheduled_query_poll_args__isset; + +class ThriftHiveMetastore_scheduled_query_poll_args { + public: + + ThriftHiveMetastore_scheduled_query_poll_args(const ThriftHiveMetastore_scheduled_query_poll_args&); + ThriftHiveMetastore_scheduled_query_poll_args& operator=(const ThriftHiveMetastore_scheduled_query_poll_args&); + ThriftHiveMetastore_scheduled_query_poll_args() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_poll_args() noexcept; + ScheduledQueryPollRequest request; + + _ThriftHiveMetastore_scheduled_query_poll_args__isset __isset; + + void __set_request(const ScheduledQueryPollRequest& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_poll_args & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_poll_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_poll_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_scheduled_query_poll_pargs { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_poll_pargs() noexcept; + const ScheduledQueryPollRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_poll_result__isset { + _ThriftHiveMetastore_scheduled_query_poll_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_scheduled_query_poll_result__isset; + +class ThriftHiveMetastore_scheduled_query_poll_result { + public: + + ThriftHiveMetastore_scheduled_query_poll_result(const ThriftHiveMetastore_scheduled_query_poll_result&); + ThriftHiveMetastore_scheduled_query_poll_result& operator=(const ThriftHiveMetastore_scheduled_query_poll_result&); + ThriftHiveMetastore_scheduled_query_poll_result() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_poll_result() noexcept; + ScheduledQueryPollResponse success; + MetaException o1; + + _ThriftHiveMetastore_scheduled_query_poll_result__isset __isset; + + void __set_success(const ScheduledQueryPollResponse& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_poll_result & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_poll_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_poll_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_poll_presult__isset { + _ThriftHiveMetastore_scheduled_query_poll_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_scheduled_query_poll_presult__isset; + +class ThriftHiveMetastore_scheduled_query_poll_presult { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_poll_presult() noexcept; + ScheduledQueryPollResponse* success; + MetaException o1; + + _ThriftHiveMetastore_scheduled_query_poll_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_maintenance_args__isset { + _ThriftHiveMetastore_scheduled_query_maintenance_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_scheduled_query_maintenance_args__isset; + +class ThriftHiveMetastore_scheduled_query_maintenance_args { + public: + + ThriftHiveMetastore_scheduled_query_maintenance_args(const ThriftHiveMetastore_scheduled_query_maintenance_args&); + ThriftHiveMetastore_scheduled_query_maintenance_args& operator=(const ThriftHiveMetastore_scheduled_query_maintenance_args&); + ThriftHiveMetastore_scheduled_query_maintenance_args() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_maintenance_args() noexcept; + ScheduledQueryMaintenanceRequest request; + + _ThriftHiveMetastore_scheduled_query_maintenance_args__isset __isset; + + void __set_request(const ScheduledQueryMaintenanceRequest& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_maintenance_args & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_maintenance_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_maintenance_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_scheduled_query_maintenance_pargs { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_maintenance_pargs() noexcept; + const ScheduledQueryMaintenanceRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_maintenance_result__isset { + _ThriftHiveMetastore_scheduled_query_maintenance_result__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_scheduled_query_maintenance_result__isset; + +class ThriftHiveMetastore_scheduled_query_maintenance_result { + public: + + ThriftHiveMetastore_scheduled_query_maintenance_result(const ThriftHiveMetastore_scheduled_query_maintenance_result&); + ThriftHiveMetastore_scheduled_query_maintenance_result& operator=(const ThriftHiveMetastore_scheduled_query_maintenance_result&); + ThriftHiveMetastore_scheduled_query_maintenance_result() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_maintenance_result() noexcept; + MetaException o1; + NoSuchObjectException o2; + AlreadyExistsException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_scheduled_query_maintenance_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + void __set_o3(const AlreadyExistsException& val); + + void __set_o4(const InvalidInputException& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_maintenance_result & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_maintenance_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_maintenance_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_maintenance_presult__isset { + _ThriftHiveMetastore_scheduled_query_maintenance_presult__isset() : o1(false), o2(false), o3(false), o4(false) {} + bool o1 :1; + bool o2 :1; + bool o3 :1; + bool o4 :1; +} _ThriftHiveMetastore_scheduled_query_maintenance_presult__isset; + +class ThriftHiveMetastore_scheduled_query_maintenance_presult { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_maintenance_presult() noexcept; + MetaException o1; + NoSuchObjectException o2; + AlreadyExistsException o3; + InvalidInputException o4; + + _ThriftHiveMetastore_scheduled_query_maintenance_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_progress_args__isset { + _ThriftHiveMetastore_scheduled_query_progress_args__isset() : info(false) {} + bool info :1; +} _ThriftHiveMetastore_scheduled_query_progress_args__isset; + +class ThriftHiveMetastore_scheduled_query_progress_args { + public: + + ThriftHiveMetastore_scheduled_query_progress_args(const ThriftHiveMetastore_scheduled_query_progress_args&); + ThriftHiveMetastore_scheduled_query_progress_args& operator=(const ThriftHiveMetastore_scheduled_query_progress_args&); + ThriftHiveMetastore_scheduled_query_progress_args() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_progress_args() noexcept; + ScheduledQueryProgressInfo info; + + _ThriftHiveMetastore_scheduled_query_progress_args__isset __isset; + + void __set_info(const ScheduledQueryProgressInfo& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_progress_args & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_progress_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_progress_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_scheduled_query_progress_pargs { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_progress_pargs() noexcept; + const ScheduledQueryProgressInfo* info; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_progress_result__isset { + _ThriftHiveMetastore_scheduled_query_progress_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_scheduled_query_progress_result__isset; + +class ThriftHiveMetastore_scheduled_query_progress_result { + public: + + ThriftHiveMetastore_scheduled_query_progress_result(const ThriftHiveMetastore_scheduled_query_progress_result&); + ThriftHiveMetastore_scheduled_query_progress_result& operator=(const ThriftHiveMetastore_scheduled_query_progress_result&); + ThriftHiveMetastore_scheduled_query_progress_result() noexcept; + + virtual ~ThriftHiveMetastore_scheduled_query_progress_result() noexcept; + MetaException o1; + InvalidOperationException o2; + + _ThriftHiveMetastore_scheduled_query_progress_result__isset __isset; + + void __set_o1(const MetaException& val); + + void __set_o2(const InvalidOperationException& val); + + bool operator == (const ThriftHiveMetastore_scheduled_query_progress_result & rhs) const; + bool operator != (const ThriftHiveMetastore_scheduled_query_progress_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_scheduled_query_progress_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_scheduled_query_progress_presult__isset { + _ThriftHiveMetastore_scheduled_query_progress_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_scheduled_query_progress_presult__isset; + +class ThriftHiveMetastore_scheduled_query_progress_presult { + public: + + + virtual ~ThriftHiveMetastore_scheduled_query_progress_presult() noexcept; + MetaException o1; + InvalidOperationException o2; + + _ThriftHiveMetastore_scheduled_query_progress_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_scheduled_query_args__isset { + _ThriftHiveMetastore_get_scheduled_query_args__isset() : scheduleKey(false) {} + bool scheduleKey :1; +} _ThriftHiveMetastore_get_scheduled_query_args__isset; + +class ThriftHiveMetastore_get_scheduled_query_args { + public: + + ThriftHiveMetastore_get_scheduled_query_args(const ThriftHiveMetastore_get_scheduled_query_args&); + ThriftHiveMetastore_get_scheduled_query_args& operator=(const ThriftHiveMetastore_get_scheduled_query_args&); + ThriftHiveMetastore_get_scheduled_query_args() noexcept; + + virtual ~ThriftHiveMetastore_get_scheduled_query_args() noexcept; + ScheduledQueryKey scheduleKey; + + _ThriftHiveMetastore_get_scheduled_query_args__isset __isset; + + void __set_scheduleKey(const ScheduledQueryKey& val); + + bool operator == (const ThriftHiveMetastore_get_scheduled_query_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_scheduled_query_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_scheduled_query_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_scheduled_query_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_scheduled_query_pargs() noexcept; + const ScheduledQueryKey* scheduleKey; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_scheduled_query_result__isset { + _ThriftHiveMetastore_get_scheduled_query_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_scheduled_query_result__isset; + +class ThriftHiveMetastore_get_scheduled_query_result { + public: + + ThriftHiveMetastore_get_scheduled_query_result(const ThriftHiveMetastore_get_scheduled_query_result&); + ThriftHiveMetastore_get_scheduled_query_result& operator=(const ThriftHiveMetastore_get_scheduled_query_result&); + ThriftHiveMetastore_get_scheduled_query_result() noexcept; + + virtual ~ThriftHiveMetastore_get_scheduled_query_result() noexcept; + ScheduledQuery success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_scheduled_query_result__isset __isset; + + void __set_success(const ScheduledQuery& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_scheduled_query_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_scheduled_query_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_scheduled_query_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_scheduled_query_presult__isset { + _ThriftHiveMetastore_get_scheduled_query_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_scheduled_query_presult__isset; + +class ThriftHiveMetastore_get_scheduled_query_presult { + public: + + + virtual ~ThriftHiveMetastore_get_scheduled_query_presult() noexcept; + ScheduledQuery* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_scheduled_query_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_replication_metrics_args__isset { + _ThriftHiveMetastore_add_replication_metrics_args__isset() : replicationMetricList(false) {} + bool replicationMetricList :1; +} _ThriftHiveMetastore_add_replication_metrics_args__isset; + +class ThriftHiveMetastore_add_replication_metrics_args { + public: + + ThriftHiveMetastore_add_replication_metrics_args(const ThriftHiveMetastore_add_replication_metrics_args&); + ThriftHiveMetastore_add_replication_metrics_args& operator=(const ThriftHiveMetastore_add_replication_metrics_args&); + ThriftHiveMetastore_add_replication_metrics_args() noexcept; + + virtual ~ThriftHiveMetastore_add_replication_metrics_args() noexcept; + ReplicationMetricList replicationMetricList; + + _ThriftHiveMetastore_add_replication_metrics_args__isset __isset; + + void __set_replicationMetricList(const ReplicationMetricList& val); + + bool operator == (const ThriftHiveMetastore_add_replication_metrics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_replication_metrics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_replication_metrics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_replication_metrics_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_replication_metrics_pargs() noexcept; + const ReplicationMetricList* replicationMetricList; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_replication_metrics_result__isset { + _ThriftHiveMetastore_add_replication_metrics_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_replication_metrics_result__isset; + +class ThriftHiveMetastore_add_replication_metrics_result { + public: + + ThriftHiveMetastore_add_replication_metrics_result(const ThriftHiveMetastore_add_replication_metrics_result&); + ThriftHiveMetastore_add_replication_metrics_result& operator=(const ThriftHiveMetastore_add_replication_metrics_result&); + ThriftHiveMetastore_add_replication_metrics_result() noexcept; + + virtual ~ThriftHiveMetastore_add_replication_metrics_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_replication_metrics_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_replication_metrics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_replication_metrics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_replication_metrics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_replication_metrics_presult__isset { + _ThriftHiveMetastore_add_replication_metrics_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_replication_metrics_presult__isset; + +class ThriftHiveMetastore_add_replication_metrics_presult { + public: + + + virtual ~ThriftHiveMetastore_add_replication_metrics_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_replication_metrics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_replication_metrics_args__isset { + _ThriftHiveMetastore_get_replication_metrics_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_get_replication_metrics_args__isset; + +class ThriftHiveMetastore_get_replication_metrics_args { + public: + + ThriftHiveMetastore_get_replication_metrics_args(const ThriftHiveMetastore_get_replication_metrics_args&); + ThriftHiveMetastore_get_replication_metrics_args& operator=(const ThriftHiveMetastore_get_replication_metrics_args&); + ThriftHiveMetastore_get_replication_metrics_args() noexcept; + + virtual ~ThriftHiveMetastore_get_replication_metrics_args() noexcept; + GetReplicationMetricsRequest rqst; + + _ThriftHiveMetastore_get_replication_metrics_args__isset __isset; + + void __set_rqst(const GetReplicationMetricsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_replication_metrics_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_replication_metrics_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_replication_metrics_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_replication_metrics_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_replication_metrics_pargs() noexcept; + const GetReplicationMetricsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_replication_metrics_result__isset { + _ThriftHiveMetastore_get_replication_metrics_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_replication_metrics_result__isset; + +class ThriftHiveMetastore_get_replication_metrics_result { + public: + + ThriftHiveMetastore_get_replication_metrics_result(const ThriftHiveMetastore_get_replication_metrics_result&); + ThriftHiveMetastore_get_replication_metrics_result& operator=(const ThriftHiveMetastore_get_replication_metrics_result&); + ThriftHiveMetastore_get_replication_metrics_result() noexcept; + + virtual ~ThriftHiveMetastore_get_replication_metrics_result() noexcept; + ReplicationMetricList success; + MetaException o1; + + _ThriftHiveMetastore_get_replication_metrics_result__isset __isset; + + void __set_success(const ReplicationMetricList& val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_replication_metrics_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_replication_metrics_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_replication_metrics_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_replication_metrics_presult__isset { + _ThriftHiveMetastore_get_replication_metrics_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_replication_metrics_presult__isset; + +class ThriftHiveMetastore_get_replication_metrics_presult { + public: + + + virtual ~ThriftHiveMetastore_get_replication_metrics_presult() noexcept; + ReplicationMetricList* success; + MetaException o1; + + _ThriftHiveMetastore_get_replication_metrics_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_req_args__isset { + _ThriftHiveMetastore_get_open_txns_req_args__isset() : getOpenTxnsRequest(false) {} + bool getOpenTxnsRequest :1; +} _ThriftHiveMetastore_get_open_txns_req_args__isset; + +class ThriftHiveMetastore_get_open_txns_req_args { + public: + + ThriftHiveMetastore_get_open_txns_req_args(const ThriftHiveMetastore_get_open_txns_req_args&); + ThriftHiveMetastore_get_open_txns_req_args& operator=(const ThriftHiveMetastore_get_open_txns_req_args&); + ThriftHiveMetastore_get_open_txns_req_args() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_req_args() noexcept; + GetOpenTxnsRequest getOpenTxnsRequest; + + _ThriftHiveMetastore_get_open_txns_req_args__isset __isset; + + void __set_getOpenTxnsRequest(const GetOpenTxnsRequest& val); + + bool operator == (const ThriftHiveMetastore_get_open_txns_req_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_req_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_req_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_open_txns_req_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_req_pargs() noexcept; + const GetOpenTxnsRequest* getOpenTxnsRequest; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_req_result__isset { + _ThriftHiveMetastore_get_open_txns_req_result__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_req_result__isset; + +class ThriftHiveMetastore_get_open_txns_req_result { + public: + + ThriftHiveMetastore_get_open_txns_req_result(const ThriftHiveMetastore_get_open_txns_req_result&); + ThriftHiveMetastore_get_open_txns_req_result& operator=(const ThriftHiveMetastore_get_open_txns_req_result&); + ThriftHiveMetastore_get_open_txns_req_result() noexcept; + + virtual ~ThriftHiveMetastore_get_open_txns_req_result() noexcept; + GetOpenTxnsResponse success; + + _ThriftHiveMetastore_get_open_txns_req_result__isset __isset; + + void __set_success(const GetOpenTxnsResponse& val); + + bool operator == (const ThriftHiveMetastore_get_open_txns_req_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_open_txns_req_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_open_txns_req_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_open_txns_req_presult__isset { + _ThriftHiveMetastore_get_open_txns_req_presult__isset() : success(false) {} + bool success :1; +} _ThriftHiveMetastore_get_open_txns_req_presult__isset; + +class ThriftHiveMetastore_get_open_txns_req_presult { + public: + + + virtual ~ThriftHiveMetastore_get_open_txns_req_presult() noexcept; + GetOpenTxnsResponse* success; + + _ThriftHiveMetastore_get_open_txns_req_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_create_stored_procedure_args__isset { + _ThriftHiveMetastore_create_stored_procedure_args__isset() : proc(false) {} + bool proc :1; +} _ThriftHiveMetastore_create_stored_procedure_args__isset; + +class ThriftHiveMetastore_create_stored_procedure_args { + public: + + ThriftHiveMetastore_create_stored_procedure_args(const ThriftHiveMetastore_create_stored_procedure_args&); + ThriftHiveMetastore_create_stored_procedure_args& operator=(const ThriftHiveMetastore_create_stored_procedure_args&); + ThriftHiveMetastore_create_stored_procedure_args() noexcept; + + virtual ~ThriftHiveMetastore_create_stored_procedure_args() noexcept; + StoredProcedure proc; + + _ThriftHiveMetastore_create_stored_procedure_args__isset __isset; + + void __set_proc(const StoredProcedure& val); + + bool operator == (const ThriftHiveMetastore_create_stored_procedure_args & rhs) const; + bool operator != (const ThriftHiveMetastore_create_stored_procedure_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_stored_procedure_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_create_stored_procedure_pargs { + public: + + + virtual ~ThriftHiveMetastore_create_stored_procedure_pargs() noexcept; + const StoredProcedure* proc; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_stored_procedure_result__isset { + _ThriftHiveMetastore_create_stored_procedure_result__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_create_stored_procedure_result__isset; + +class ThriftHiveMetastore_create_stored_procedure_result { + public: + + ThriftHiveMetastore_create_stored_procedure_result(const ThriftHiveMetastore_create_stored_procedure_result&); + ThriftHiveMetastore_create_stored_procedure_result& operator=(const ThriftHiveMetastore_create_stored_procedure_result&); + ThriftHiveMetastore_create_stored_procedure_result() noexcept; + + virtual ~ThriftHiveMetastore_create_stored_procedure_result() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_create_stored_procedure_result__isset __isset; + + void __set_o1(const NoSuchObjectException& val); + + void __set_o2(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_create_stored_procedure_result & rhs) const; + bool operator != (const ThriftHiveMetastore_create_stored_procedure_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_create_stored_procedure_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_create_stored_procedure_presult__isset { + _ThriftHiveMetastore_create_stored_procedure_presult__isset() : o1(false), o2(false) {} + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_create_stored_procedure_presult__isset; + +class ThriftHiveMetastore_create_stored_procedure_presult { + public: + + + virtual ~ThriftHiveMetastore_create_stored_procedure_presult() noexcept; + NoSuchObjectException o1; + MetaException o2; + + _ThriftHiveMetastore_create_stored_procedure_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_stored_procedure_args__isset { + _ThriftHiveMetastore_get_stored_procedure_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_stored_procedure_args__isset; + +class ThriftHiveMetastore_get_stored_procedure_args { + public: + + ThriftHiveMetastore_get_stored_procedure_args(const ThriftHiveMetastore_get_stored_procedure_args&); + ThriftHiveMetastore_get_stored_procedure_args& operator=(const ThriftHiveMetastore_get_stored_procedure_args&); + ThriftHiveMetastore_get_stored_procedure_args() noexcept; + + virtual ~ThriftHiveMetastore_get_stored_procedure_args() noexcept; + StoredProcedureRequest request; + + _ThriftHiveMetastore_get_stored_procedure_args__isset __isset; + + void __set_request(const StoredProcedureRequest& val); + + bool operator == (const ThriftHiveMetastore_get_stored_procedure_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_stored_procedure_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_stored_procedure_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_stored_procedure_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_stored_procedure_pargs() noexcept; + const StoredProcedureRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_stored_procedure_result__isset { + _ThriftHiveMetastore_get_stored_procedure_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_stored_procedure_result__isset; + +class ThriftHiveMetastore_get_stored_procedure_result { + public: + + ThriftHiveMetastore_get_stored_procedure_result(const ThriftHiveMetastore_get_stored_procedure_result&); + ThriftHiveMetastore_get_stored_procedure_result& operator=(const ThriftHiveMetastore_get_stored_procedure_result&); + ThriftHiveMetastore_get_stored_procedure_result() noexcept; + + virtual ~ThriftHiveMetastore_get_stored_procedure_result() noexcept; + StoredProcedure success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_stored_procedure_result__isset __isset; + + void __set_success(const StoredProcedure& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_stored_procedure_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_stored_procedure_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_stored_procedure_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_stored_procedure_presult__isset { + _ThriftHiveMetastore_get_stored_procedure_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_stored_procedure_presult__isset; + +class ThriftHiveMetastore_get_stored_procedure_presult { + public: + + + virtual ~ThriftHiveMetastore_get_stored_procedure_presult() noexcept; + StoredProcedure* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_stored_procedure_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_stored_procedure_args__isset { + _ThriftHiveMetastore_drop_stored_procedure_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_stored_procedure_args__isset; + +class ThriftHiveMetastore_drop_stored_procedure_args { + public: + + ThriftHiveMetastore_drop_stored_procedure_args(const ThriftHiveMetastore_drop_stored_procedure_args&); + ThriftHiveMetastore_drop_stored_procedure_args& operator=(const ThriftHiveMetastore_drop_stored_procedure_args&); + ThriftHiveMetastore_drop_stored_procedure_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_stored_procedure_args() noexcept; + StoredProcedureRequest request; + + _ThriftHiveMetastore_drop_stored_procedure_args__isset __isset; + + void __set_request(const StoredProcedureRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_stored_procedure_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_stored_procedure_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_stored_procedure_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_stored_procedure_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_stored_procedure_pargs() noexcept; + const StoredProcedureRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_stored_procedure_result__isset { + _ThriftHiveMetastore_drop_stored_procedure_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_drop_stored_procedure_result__isset; + +class ThriftHiveMetastore_drop_stored_procedure_result { + public: + + ThriftHiveMetastore_drop_stored_procedure_result(const ThriftHiveMetastore_drop_stored_procedure_result&); + ThriftHiveMetastore_drop_stored_procedure_result& operator=(const ThriftHiveMetastore_drop_stored_procedure_result&); + ThriftHiveMetastore_drop_stored_procedure_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_stored_procedure_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_drop_stored_procedure_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_stored_procedure_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_stored_procedure_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_stored_procedure_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_stored_procedure_presult__isset { + _ThriftHiveMetastore_drop_stored_procedure_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_drop_stored_procedure_presult__isset; + +class ThriftHiveMetastore_drop_stored_procedure_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_stored_procedure_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_drop_stored_procedure_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_stored_procedures_args__isset { + _ThriftHiveMetastore_get_all_stored_procedures_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_all_stored_procedures_args__isset; + +class ThriftHiveMetastore_get_all_stored_procedures_args { + public: + + ThriftHiveMetastore_get_all_stored_procedures_args(const ThriftHiveMetastore_get_all_stored_procedures_args&); + ThriftHiveMetastore_get_all_stored_procedures_args& operator=(const ThriftHiveMetastore_get_all_stored_procedures_args&); + ThriftHiveMetastore_get_all_stored_procedures_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_stored_procedures_args() noexcept; + ListStoredProcedureRequest request; + + _ThriftHiveMetastore_get_all_stored_procedures_args__isset __isset; + + void __set_request(const ListStoredProcedureRequest& val); + + bool operator == (const ThriftHiveMetastore_get_all_stored_procedures_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_stored_procedures_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_stored_procedures_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_stored_procedures_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_stored_procedures_pargs() noexcept; + const ListStoredProcedureRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_stored_procedures_result__isset { + _ThriftHiveMetastore_get_all_stored_procedures_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_stored_procedures_result__isset; + +class ThriftHiveMetastore_get_all_stored_procedures_result { + public: + + ThriftHiveMetastore_get_all_stored_procedures_result(const ThriftHiveMetastore_get_all_stored_procedures_result&); + ThriftHiveMetastore_get_all_stored_procedures_result& operator=(const ThriftHiveMetastore_get_all_stored_procedures_result&); + ThriftHiveMetastore_get_all_stored_procedures_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_stored_procedures_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_all_stored_procedures_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_stored_procedures_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_stored_procedures_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_stored_procedures_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_stored_procedures_presult__isset { + _ThriftHiveMetastore_get_all_stored_procedures_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_stored_procedures_presult__isset; + +class ThriftHiveMetastore_get_all_stored_procedures_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_stored_procedures_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_all_stored_procedures_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_find_package_args__isset { + _ThriftHiveMetastore_find_package_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_find_package_args__isset; + +class ThriftHiveMetastore_find_package_args { + public: + + ThriftHiveMetastore_find_package_args(const ThriftHiveMetastore_find_package_args&); + ThriftHiveMetastore_find_package_args& operator=(const ThriftHiveMetastore_find_package_args&); + ThriftHiveMetastore_find_package_args() noexcept; + + virtual ~ThriftHiveMetastore_find_package_args() noexcept; + GetPackageRequest request; + + _ThriftHiveMetastore_find_package_args__isset __isset; + + void __set_request(const GetPackageRequest& val); + + bool operator == (const ThriftHiveMetastore_find_package_args & rhs) const; + bool operator != (const ThriftHiveMetastore_find_package_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_package_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_find_package_pargs { + public: + + + virtual ~ThriftHiveMetastore_find_package_pargs() noexcept; + const GetPackageRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_package_result__isset { + _ThriftHiveMetastore_find_package_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_find_package_result__isset; + +class ThriftHiveMetastore_find_package_result { + public: + + ThriftHiveMetastore_find_package_result(const ThriftHiveMetastore_find_package_result&); + ThriftHiveMetastore_find_package_result& operator=(const ThriftHiveMetastore_find_package_result&); + ThriftHiveMetastore_find_package_result() noexcept; + + virtual ~ThriftHiveMetastore_find_package_result() noexcept; + Package success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_find_package_result__isset __isset; + + void __set_success(const Package& val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_find_package_result & rhs) const; + bool operator != (const ThriftHiveMetastore_find_package_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_find_package_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_find_package_presult__isset { + _ThriftHiveMetastore_find_package_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_find_package_presult__isset; + +class ThriftHiveMetastore_find_package_presult { + public: + + + virtual ~ThriftHiveMetastore_find_package_presult() noexcept; + Package* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_find_package_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_add_package_args__isset { + _ThriftHiveMetastore_add_package_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_add_package_args__isset; + +class ThriftHiveMetastore_add_package_args { + public: + + ThriftHiveMetastore_add_package_args(const ThriftHiveMetastore_add_package_args&); + ThriftHiveMetastore_add_package_args& operator=(const ThriftHiveMetastore_add_package_args&); + ThriftHiveMetastore_add_package_args() noexcept; + + virtual ~ThriftHiveMetastore_add_package_args() noexcept; + AddPackageRequest request; + + _ThriftHiveMetastore_add_package_args__isset __isset; + + void __set_request(const AddPackageRequest& val); + + bool operator == (const ThriftHiveMetastore_add_package_args & rhs) const; + bool operator != (const ThriftHiveMetastore_add_package_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_package_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_add_package_pargs { + public: + + + virtual ~ThriftHiveMetastore_add_package_pargs() noexcept; + const AddPackageRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_package_result__isset { + _ThriftHiveMetastore_add_package_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_package_result__isset; + +class ThriftHiveMetastore_add_package_result { + public: + + ThriftHiveMetastore_add_package_result(const ThriftHiveMetastore_add_package_result&); + ThriftHiveMetastore_add_package_result& operator=(const ThriftHiveMetastore_add_package_result&); + ThriftHiveMetastore_add_package_result() noexcept; + + virtual ~ThriftHiveMetastore_add_package_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_package_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_add_package_result & rhs) const; + bool operator != (const ThriftHiveMetastore_add_package_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_add_package_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_add_package_presult__isset { + _ThriftHiveMetastore_add_package_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_add_package_presult__isset; + +class ThriftHiveMetastore_add_package_presult { + public: + + + virtual ~ThriftHiveMetastore_add_package_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_add_package_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_packages_args__isset { + _ThriftHiveMetastore_get_all_packages_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_all_packages_args__isset; + +class ThriftHiveMetastore_get_all_packages_args { + public: + + ThriftHiveMetastore_get_all_packages_args(const ThriftHiveMetastore_get_all_packages_args&); + ThriftHiveMetastore_get_all_packages_args& operator=(const ThriftHiveMetastore_get_all_packages_args&); + ThriftHiveMetastore_get_all_packages_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_packages_args() noexcept; + ListPackageRequest request; + + _ThriftHiveMetastore_get_all_packages_args__isset __isset; + + void __set_request(const ListPackageRequest& val); + + bool operator == (const ThriftHiveMetastore_get_all_packages_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_packages_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_packages_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_packages_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_packages_pargs() noexcept; + const ListPackageRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_packages_result__isset { + _ThriftHiveMetastore_get_all_packages_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_packages_result__isset; + +class ThriftHiveMetastore_get_all_packages_result { + public: + + ThriftHiveMetastore_get_all_packages_result(const ThriftHiveMetastore_get_all_packages_result&); + ThriftHiveMetastore_get_all_packages_result& operator=(const ThriftHiveMetastore_get_all_packages_result&); + ThriftHiveMetastore_get_all_packages_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_packages_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_all_packages_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_packages_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_packages_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_packages_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_packages_presult__isset { + _ThriftHiveMetastore_get_all_packages_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_packages_presult__isset; + +class ThriftHiveMetastore_get_all_packages_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_packages_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_all_packages_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_drop_package_args__isset { + _ThriftHiveMetastore_drop_package_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_drop_package_args__isset; + +class ThriftHiveMetastore_drop_package_args { + public: + + ThriftHiveMetastore_drop_package_args(const ThriftHiveMetastore_drop_package_args&); + ThriftHiveMetastore_drop_package_args& operator=(const ThriftHiveMetastore_drop_package_args&); + ThriftHiveMetastore_drop_package_args() noexcept; + + virtual ~ThriftHiveMetastore_drop_package_args() noexcept; + DropPackageRequest request; + + _ThriftHiveMetastore_drop_package_args__isset __isset; + + void __set_request(const DropPackageRequest& val); + + bool operator == (const ThriftHiveMetastore_drop_package_args & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_package_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_package_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_drop_package_pargs { + public: + + + virtual ~ThriftHiveMetastore_drop_package_pargs() noexcept; + const DropPackageRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_package_result__isset { + _ThriftHiveMetastore_drop_package_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_drop_package_result__isset; + +class ThriftHiveMetastore_drop_package_result { + public: + + ThriftHiveMetastore_drop_package_result(const ThriftHiveMetastore_drop_package_result&); + ThriftHiveMetastore_drop_package_result& operator=(const ThriftHiveMetastore_drop_package_result&); + ThriftHiveMetastore_drop_package_result() noexcept; + + virtual ~ThriftHiveMetastore_drop_package_result() noexcept; + MetaException o1; + + _ThriftHiveMetastore_drop_package_result__isset __isset; + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_drop_package_result & rhs) const; + bool operator != (const ThriftHiveMetastore_drop_package_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_drop_package_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_drop_package_presult__isset { + _ThriftHiveMetastore_drop_package_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_drop_package_presult__isset; + +class ThriftHiveMetastore_drop_package_presult { + public: + + + virtual ~ThriftHiveMetastore_drop_package_presult() noexcept; + MetaException o1; + + _ThriftHiveMetastore_drop_package_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHiveMetastore_get_all_write_event_info_args__isset { + _ThriftHiveMetastore_get_all_write_event_info_args__isset() : request(false) {} + bool request :1; +} _ThriftHiveMetastore_get_all_write_event_info_args__isset; + +class ThriftHiveMetastore_get_all_write_event_info_args { + public: + + ThriftHiveMetastore_get_all_write_event_info_args(const ThriftHiveMetastore_get_all_write_event_info_args&); + ThriftHiveMetastore_get_all_write_event_info_args& operator=(const ThriftHiveMetastore_get_all_write_event_info_args&); + ThriftHiveMetastore_get_all_write_event_info_args() noexcept; + + virtual ~ThriftHiveMetastore_get_all_write_event_info_args() noexcept; + GetAllWriteEventInfoRequest request; + + _ThriftHiveMetastore_get_all_write_event_info_args__isset __isset; + + void __set_request(const GetAllWriteEventInfoRequest& val); + + bool operator == (const ThriftHiveMetastore_get_all_write_event_info_args & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_write_event_info_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_write_event_info_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_all_write_event_info_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_all_write_event_info_pargs() noexcept; + const GetAllWriteEventInfoRequest* request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_write_event_info_result__isset { + _ThriftHiveMetastore_get_all_write_event_info_result__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_write_event_info_result__isset; + +class ThriftHiveMetastore_get_all_write_event_info_result { + public: + + ThriftHiveMetastore_get_all_write_event_info_result(const ThriftHiveMetastore_get_all_write_event_info_result&); + ThriftHiveMetastore_get_all_write_event_info_result& operator=(const ThriftHiveMetastore_get_all_write_event_info_result&); + ThriftHiveMetastore_get_all_write_event_info_result() noexcept; + + virtual ~ThriftHiveMetastore_get_all_write_event_info_result() noexcept; + std::vector success; + MetaException o1; + + _ThriftHiveMetastore_get_all_write_event_info_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_o1(const MetaException& val); + + bool operator == (const ThriftHiveMetastore_get_all_write_event_info_result & rhs) const; + bool operator != (const ThriftHiveMetastore_get_all_write_event_info_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_all_write_event_info_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_all_write_event_info_presult__isset { + _ThriftHiveMetastore_get_all_write_event_info_presult__isset() : success(false), o1(false) {} + bool success :1; + bool o1 :1; +} _ThriftHiveMetastore_get_all_write_event_info_presult__isset; + +class ThriftHiveMetastore_get_all_write_event_info_presult { + public: + + + virtual ~ThriftHiveMetastore_get_all_write_event_info_presult() noexcept; + std::vector * success; + MetaException o1; + + _ThriftHiveMetastore_get_all_write_event_info_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public ::facebook::fb303::FacebookServiceClient { + public: + ThriftHiveMetastoreClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) : + ::facebook::fb303::FacebookServiceClient(prot, prot) {} + ThriftHiveMetastoreClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) : ::facebook::fb303::FacebookServiceClient(iprot, oprot) {} + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) override; + void send_abort_Compactions(const AbortCompactionRequest& rqst); + void recv_abort_Compactions(AbortCompactResponse& _return); + void getMetaConf(std::string& _return, const std::string& key) override; + void send_getMetaConf(const std::string& key); + void recv_getMetaConf(std::string& _return); + void setMetaConf(const std::string& key, const std::string& value) override; + void send_setMetaConf(const std::string& key, const std::string& value); + void recv_setMetaConf(); + void create_catalog(const CreateCatalogRequest& catalog) override; + void send_create_catalog(const CreateCatalogRequest& catalog); + void recv_create_catalog(); + void alter_catalog(const AlterCatalogRequest& rqst) override; + void send_alter_catalog(const AlterCatalogRequest& rqst); + void recv_alter_catalog(); + void get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) override; + void send_get_catalog(const GetCatalogRequest& catName); + void recv_get_catalog(GetCatalogResponse& _return); + void get_catalogs(GetCatalogsResponse& _return) override; + void send_get_catalogs(); + void recv_get_catalogs(GetCatalogsResponse& _return); + void drop_catalog(const DropCatalogRequest& catName) override; + void send_drop_catalog(const DropCatalogRequest& catName); + void recv_drop_catalog(); + void create_database(const Database& database) override; + void send_create_database(const Database& database); + void recv_create_database(); + void create_database_req(const CreateDatabaseRequest& createDatabaseRequest) override; + void send_create_database_req(const CreateDatabaseRequest& createDatabaseRequest); + void recv_create_database_req(); + void get_database(Database& _return, const std::string& name) override; + void send_get_database(const std::string& name); + void recv_get_database(Database& _return); + void get_database_req(Database& _return, const GetDatabaseRequest& request) override; + void send_get_database_req(const GetDatabaseRequest& request); + void recv_get_database_req(Database& _return); + void drop_database(const std::string& name, const bool deleteData, const bool cascade) override; + void send_drop_database(const std::string& name, const bool deleteData, const bool cascade); + void recv_drop_database(); + void drop_database_req(const DropDatabaseRequest& req) override; + void send_drop_database_req(const DropDatabaseRequest& req); + void recv_drop_database_req(); + void get_databases(std::vector & _return, const std::string& pattern) override; + void send_get_databases(const std::string& pattern); + void recv_get_databases(std::vector & _return); + void get_all_databases(std::vector & _return) override; + void send_get_all_databases(); + void recv_get_all_databases(std::vector & _return); + void alter_database(const std::string& dbname, const Database& db) override; + void send_alter_database(const std::string& dbname, const Database& db); + void recv_alter_database(); + void alter_database_req(const AlterDatabaseRequest& alterDbReq) override; + void send_alter_database_req(const AlterDatabaseRequest& alterDbReq); + void recv_alter_database_req(); + void create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) override; + void send_create_dataconnector_req(const CreateDataConnectorRequest& connectorReq); + void recv_create_dataconnector_req(); + void get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) override; + void send_get_dataconnector_req(const GetDataConnectorRequest& request); + void recv_get_dataconnector_req(DataConnector& _return); + void drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) override; + void send_drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq); + void recv_drop_dataconnector_req(); + void get_dataconnectors(std::vector & _return) override; + void send_get_dataconnectors(); + void recv_get_dataconnectors(std::vector & _return); + void alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) override; + void send_alter_dataconnector_req(const AlterDataConnectorRequest& alterReq); + void recv_alter_dataconnector_req(); + void get_type(Type& _return, const std::string& name) override; + void send_get_type(const std::string& name); + void recv_get_type(Type& _return); + bool create_type(const Type& type) override; + void send_create_type(const Type& type); + bool recv_create_type(); + bool drop_type(const std::string& type) override; + void send_drop_type(const std::string& type); + bool recv_drop_type(); + void get_type_all(std::map & _return, const std::string& name) override; + void send_get_type_all(const std::string& name); + void recv_get_type_all(std::map & _return); + void get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) override; + void send_get_fields(const std::string& db_name, const std::string& table_name); + void recv_get_fields(std::vector & _return); + void get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override; + void send_get_fields_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context); + void recv_get_fields_with_environment_context(std::vector & _return); + void get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) override; + void send_get_fields_req(const GetFieldsRequest& req); + void recv_get_fields_req(GetFieldsResponse& _return); + void get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) override; + void send_get_schema(const std::string& db_name, const std::string& table_name); + void recv_get_schema(std::vector & _return); + void get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override; + void send_get_schema_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context); + void recv_get_schema_with_environment_context(std::vector & _return); + void get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) override; + void send_get_schema_req(const GetSchemaRequest& req); + void recv_get_schema_req(GetSchemaResponse& _return); + void create_table(const Table& tbl) override; + void send_create_table(const Table& tbl); + void recv_create_table(); + void create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) override; + void send_create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context); + void recv_create_table_with_environment_context(); + void create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) override; + void send_create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints); + void recv_create_table_with_constraints(); + void create_table_req(const CreateTableRequest& request) override; + void send_create_table_req(const CreateTableRequest& request); + void recv_create_table_req(); + void drop_constraint(const DropConstraintRequest& req) override; + void send_drop_constraint(const DropConstraintRequest& req); + void recv_drop_constraint(); + void add_primary_key(const AddPrimaryKeyRequest& req) override; + void send_add_primary_key(const AddPrimaryKeyRequest& req); + void recv_add_primary_key(); + void add_foreign_key(const AddForeignKeyRequest& req) override; + void send_add_foreign_key(const AddForeignKeyRequest& req); + void recv_add_foreign_key(); + void add_unique_constraint(const AddUniqueConstraintRequest& req) override; + void send_add_unique_constraint(const AddUniqueConstraintRequest& req); + void recv_add_unique_constraint(); + void add_not_null_constraint(const AddNotNullConstraintRequest& req) override; + void send_add_not_null_constraint(const AddNotNullConstraintRequest& req); + void recv_add_not_null_constraint(); + void add_default_constraint(const AddDefaultConstraintRequest& req) override; + void send_add_default_constraint(const AddDefaultConstraintRequest& req); + void recv_add_default_constraint(); + void add_check_constraint(const AddCheckConstraintRequest& req) override; + void send_add_check_constraint(const AddCheckConstraintRequest& req); + void recv_add_check_constraint(); + void translate_table_dryrun(Table& _return, const CreateTableRequest& request) override; + void send_translate_table_dryrun(const CreateTableRequest& request); + void recv_translate_table_dryrun(Table& _return); + void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) override; + void send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData); + void recv_drop_table(); + void drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) override; + void send_drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context); + void recv_drop_table_with_environment_context(); + void drop_table_req(const DropTableRequest& dropTableReq) override; + void send_drop_table_req(const DropTableRequest& dropTableReq); + void recv_drop_table_req(); + void truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) override; + void send_truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames); + void recv_truncate_table(); + void truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) override; + void send_truncate_table_req(const TruncateTableRequest& req); + void recv_truncate_table_req(TruncateTableResponse& _return); + void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) override; + void send_get_tables(const std::string& db_name, const std::string& pattern); + void recv_get_tables(std::vector & _return); + void get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) override; + void send_get_tables_by_type(const std::string& db_name, const std::string& pattern, const std::string& tableType); + void recv_get_tables_by_type(std::vector & _return); + void get_all_materialized_view_objects_for_rewriting(std::vector
& _return) override; + void send_get_all_materialized_view_objects_for_rewriting(); + void recv_get_all_materialized_view_objects_for_rewriting(std::vector
& _return); + void get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) override; + void send_get_materialized_views_for_rewriting(const std::string& db_name); + void recv_get_materialized_views_for_rewriting(std::vector & _return); + void get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) override; + void send_get_table_meta(const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types); + void recv_get_table_meta(std::vector & _return); + void get_all_tables(std::vector & _return, const std::string& db_name) override; + void send_get_all_tables(const std::string& db_name); + void recv_get_all_tables(std::vector & _return); + void get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) override; + void send_get_tables_ext(const GetTablesExtRequest& req); + void recv_get_tables_ext(std::vector & _return); + void get_table_req(GetTableResult& _return, const GetTableRequest& req) override; + void send_get_table_req(const GetTableRequest& req); + void recv_get_table_req(GetTableResult& _return); + void get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) override; + void send_get_table_objects_by_name_req(const GetTablesRequest& req); + void recv_get_table_objects_by_name_req(GetTablesResult& _return); + void get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) override; + void send_get_materialization_invalidation_info(const CreationMetadata& creation_metadata, const std::string& validTxnList); + void recv_get_materialization_invalidation_info(Materialization& _return); + void update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) override; + void send_update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata); + void recv_update_creation_metadata(); + void get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) override; + void send_get_table_names_by_filter(const std::string& dbname, const std::string& filter, const int16_t max_tables); + void recv_get_table_names_by_filter(std::vector & _return); + void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) override; + void send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl); + void recv_alter_table(); + void alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) override; + void send_alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context); + void recv_alter_table_with_environment_context(); + void alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) override; + void send_alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade); + void recv_alter_table_with_cascade(); + void alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) override; + void send_alter_table_req(const AlterTableRequest& req); + void recv_alter_table_req(AlterTableResponse& _return); + void add_partition(Partition& _return, const Partition& new_part) override; + void send_add_partition(const Partition& new_part); + void recv_add_partition(Partition& _return); + void add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) override; + void send_add_partition_with_environment_context(const Partition& new_part, const EnvironmentContext& environment_context); + void recv_add_partition_with_environment_context(Partition& _return); + int32_t add_partitions(const std::vector & new_parts) override; + void send_add_partitions(const std::vector & new_parts); + int32_t recv_add_partitions(); + int32_t add_partitions_pspec(const std::vector & new_parts) override; + void send_add_partitions_pspec(const std::vector & new_parts); + int32_t recv_add_partitions_pspec(); + void append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override; + void send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals); + void recv_append_partition(Partition& _return); + void add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) override; + void send_add_partitions_req(const AddPartitionsRequest& request); + void recv_add_partitions_req(AddPartitionsResult& _return); + void append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) override; + void send_append_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context); + void recv_append_partition_with_environment_context(Partition& _return); + void append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) override; + void send_append_partition_req(const AppendPartitionsRequest& appendPartitionsReq); + void recv_append_partition_req(Partition& _return); + void append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override; + void send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name); + void recv_append_partition_by_name(Partition& _return); + void append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) override; + void send_append_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context); + void recv_append_partition_by_name_with_environment_context(Partition& _return); + bool drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) override; + void send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData); + bool recv_drop_partition(); + bool drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) override; + void send_drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context); + bool recv_drop_partition_with_environment_context(); + bool drop_partition_req(const DropPartitionRequest& dropPartitionReq) override; + void send_drop_partition_req(const DropPartitionRequest& dropPartitionReq); + bool recv_drop_partition_req(); + bool drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) override; + void send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData); + bool recv_drop_partition_by_name(); + bool drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) override; + void send_drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context); + bool recv_drop_partition_by_name_with_environment_context(); + void drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) override; + void send_drop_partitions_req(const DropPartitionsRequest& req); + void recv_drop_partitions_req(DropPartitionsResult& _return); + void get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override; + void send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals); + void recv_get_partition(Partition& _return); + void get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) override; + void send_get_partition_req(const GetPartitionRequest& req); + void recv_get_partition_req(GetPartitionResponse& _return); + void exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override; + void send_exchange_partition(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name); + void recv_exchange_partition(Partition& _return); + void exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override; + void send_exchange_partitions(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name); + void recv_exchange_partitions(std::vector & _return); + void get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) override; + void send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names); + void recv_get_partition_with_auth(Partition& _return); + void get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override; + void send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name); + void recv_get_partition_by_name(Partition& _return); + void get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override; + void send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts); + void recv_get_partitions(std::vector & _return); + void get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) override; + void send_get_partitions_req(const PartitionsRequest& req); + void recv_get_partitions_req(PartitionsResponse& _return); + void get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override; + void send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names); + void recv_get_partitions_with_auth(std::vector & _return); + void get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) override; + void send_get_partitions_pspec(const std::string& db_name, const std::string& tbl_name, const int32_t max_parts); + void recv_get_partitions_pspec(std::vector & _return); + void get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override; + void send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts); + void recv_get_partition_names(std::vector & _return); + void fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) override; + void send_fetch_partition_names_req(const PartitionsRequest& partitionReq); + void recv_fetch_partition_names_req(std::vector & _return); + void get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) override; + void send_get_partition_values(const PartitionValuesRequest& request); + void recv_get_partition_values(PartitionValuesResponse& _return); + void get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override; + void send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts); + void recv_get_partitions_ps(std::vector & _return); + void get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override; + void send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names); + void recv_get_partitions_ps_with_auth(std::vector & _return); + void get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) override; + void send_get_partitions_ps_with_auth_req(const GetPartitionsPsWithAuthRequest& req); + void recv_get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return); + void get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override; + void send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts); + void recv_get_partition_names_ps(std::vector & _return); + void get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) override; + void send_get_partition_names_ps_req(const GetPartitionNamesPsRequest& req); + void recv_get_partition_names_ps_req(GetPartitionNamesPsResponse& _return); + void get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) override; + void send_get_partition_names_req(const PartitionsByExprRequest& req); + void recv_get_partition_names_req(std::vector & _return); + void get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) override; + void send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts); + void recv_get_partitions_by_filter(std::vector & _return); + void get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) override; + void send_get_partitions_by_filter_req(const GetPartitionsByFilterRequest& req); + void recv_get_partitions_by_filter_req(std::vector & _return); + void get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) override; + void send_get_part_specs_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts); + void recv_get_part_specs_by_filter(std::vector & _return); + void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) override; + void send_get_partitions_by_expr(const PartitionsByExprRequest& req); + void recv_get_partitions_by_expr(PartitionsByExprResult& _return); + void get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) override; + void send_get_partitions_spec_by_expr(const PartitionsByExprRequest& req); + void recv_get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return); + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) override; + void send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + int32_t recv_get_num_partitions_by_filter(); + void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) override; + void send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names); + void recv_get_partitions_by_names(std::vector & _return); + void get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) override; + void send_get_partitions_by_names_req(const GetPartitionsByNamesRequest& req); + void recv_get_partitions_by_names_req(GetPartitionsByNamesResult& _return); + void get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) override; + void send_get_properties(const PropertyGetRequest& req); + void recv_get_properties(PropertyGetResponse& _return); + bool set_properties(const PropertySetRequest& req) override; + void send_set_properties(const PropertySetRequest& req); + bool recv_set_properties(); + void alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) override; + void send_alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part); + void recv_alter_partition(); + void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) override; + void send_alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts); + void recv_alter_partitions(); + void alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) override; + void send_alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context); + void recv_alter_partitions_with_environment_context(); + void alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) override; + void send_alter_partitions_req(const AlterPartitionsRequest& req); + void recv_alter_partitions_req(AlterPartitionsResponse& _return); + void alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) override; + void send_alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context); + void recv_alter_partition_with_environment_context(); + void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) override; + void send_rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part); + void recv_rename_partition(); + void rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) override; + void send_rename_partition_req(const RenamePartitionRequest& req); + void recv_rename_partition_req(RenamePartitionResponse& _return); + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) override; + void send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception); + bool recv_partition_name_has_valid_characters(); + void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) override; + void send_get_config_value(const std::string& name, const std::string& defaultValue); + void recv_get_config_value(std::string& _return); + void partition_name_to_vals(std::vector & _return, const std::string& part_name) override; + void send_partition_name_to_vals(const std::string& part_name); + void recv_partition_name_to_vals(std::vector & _return); + void partition_name_to_spec(std::map & _return, const std::string& part_name) override; + void send_partition_name_to_spec(const std::string& part_name); + void recv_partition_name_to_spec(std::map & _return); + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override; + void send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + void recv_markPartitionForEvent(); + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override; + void send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + bool recv_isPartitionMarkedForEvent(); + void get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) override; + void send_get_primary_keys(const PrimaryKeysRequest& request); + void recv_get_primary_keys(PrimaryKeysResponse& _return); + void get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) override; + void send_get_foreign_keys(const ForeignKeysRequest& request); + void recv_get_foreign_keys(ForeignKeysResponse& _return); + void get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) override; + void send_get_unique_constraints(const UniqueConstraintsRequest& request); + void recv_get_unique_constraints(UniqueConstraintsResponse& _return); + void get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) override; + void send_get_not_null_constraints(const NotNullConstraintsRequest& request); + void recv_get_not_null_constraints(NotNullConstraintsResponse& _return); + void get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) override; + void send_get_default_constraints(const DefaultConstraintsRequest& request); + void recv_get_default_constraints(DefaultConstraintsResponse& _return); + void get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) override; + void send_get_check_constraints(const CheckConstraintsRequest& request); + void recv_get_check_constraints(CheckConstraintsResponse& _return); + void get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) override; + void send_get_all_table_constraints(const AllTableConstraintsRequest& request); + void recv_get_all_table_constraints(AllTableConstraintsResponse& _return); + bool update_table_column_statistics(const ColumnStatistics& stats_obj) override; + void send_update_table_column_statistics(const ColumnStatistics& stats_obj); + bool recv_update_table_column_statistics(); + bool update_partition_column_statistics(const ColumnStatistics& stats_obj) override; + void send_update_partition_column_statistics(const ColumnStatistics& stats_obj); + bool recv_update_partition_column_statistics(); + void update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override; + void send_update_table_column_statistics_req(const SetPartitionsStatsRequest& req); + void recv_update_table_column_statistics_req(SetPartitionsStatsResponse& _return); + void update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override; + void send_update_partition_column_statistics_req(const SetPartitionsStatsRequest& req); + void recv_update_partition_column_statistics_req(SetPartitionsStatsResponse& _return); + void update_transaction_statistics(const UpdateTransactionalStatsRequest& req) override; + void send_update_transaction_statistics(const UpdateTransactionalStatsRequest& req); + void recv_update_transaction_statistics(); + void get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) override; + void send_get_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name); + void recv_get_table_column_statistics(ColumnStatistics& _return); + void get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) override; + void send_get_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name); + void recv_get_partition_column_statistics(ColumnStatistics& _return); + void get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) override; + void send_get_table_statistics_req(const TableStatsRequest& request); + void recv_get_table_statistics_req(TableStatsResult& _return); + void get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) override; + void send_get_partitions_statistics_req(const PartitionsStatsRequest& request); + void recv_get_partitions_statistics_req(PartitionsStatsResult& _return); + void get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) override; + void send_get_aggr_stats_for(const PartitionsStatsRequest& request); + void recv_get_aggr_stats_for(AggrStats& _return); + bool set_aggr_stats_for(const SetPartitionsStatsRequest& request) override; + void send_set_aggr_stats_for(const SetPartitionsStatsRequest& request); + bool recv_set_aggr_stats_for(); + bool delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) override; + void send_delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine); + bool recv_delete_partition_column_statistics(); + bool delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) override; + void send_delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine); + bool recv_delete_table_column_statistics(); + void create_function(const Function& func) override; + void send_create_function(const Function& func); + void recv_create_function(); + void drop_function(const std::string& dbName, const std::string& funcName) override; + void send_drop_function(const std::string& dbName, const std::string& funcName); + void recv_drop_function(); + void alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) override; + void send_alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc); + void recv_alter_function(); + void get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) override; + void send_get_functions(const std::string& dbName, const std::string& pattern); + void recv_get_functions(std::vector & _return); + void get_function(Function& _return, const std::string& dbName, const std::string& funcName) override; + void send_get_function(const std::string& dbName, const std::string& funcName); + void recv_get_function(Function& _return); + void get_all_functions(GetAllFunctionsResponse& _return) override; + void send_get_all_functions(); + void recv_get_all_functions(GetAllFunctionsResponse& _return); + bool create_role(const Role& role) override; + void send_create_role(const Role& role); + bool recv_create_role(); + bool drop_role(const std::string& role_name) override; + void send_drop_role(const std::string& role_name); + bool recv_drop_role(); + void get_role_names(std::vector & _return) override; + void send_get_role_names(); + void recv_get_role_names(std::vector & _return); + bool grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) override; + void send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option); + bool recv_grant_role(); + bool revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) override; + void send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type); + bool recv_revoke_role(); + void list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) override; + void send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type); + void recv_list_roles(std::vector & _return); + void grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) override; + void send_grant_revoke_role(const GrantRevokeRoleRequest& request); + void recv_grant_revoke_role(GrantRevokeRoleResponse& _return); + void get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) override; + void send_get_principals_in_role(const GetPrincipalsInRoleRequest& request); + void recv_get_principals_in_role(GetPrincipalsInRoleResponse& _return); + void get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) override; + void send_get_role_grants_for_principal(const GetRoleGrantsForPrincipalRequest& request); + void recv_get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return); + void get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) override; + void send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names); + void recv_get_privilege_set(PrincipalPrivilegeSet& _return); + void list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) override; + void send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject); + void recv_list_privileges(std::vector & _return); + bool grant_privileges(const PrivilegeBag& privileges) override; + void send_grant_privileges(const PrivilegeBag& privileges); + bool recv_grant_privileges(); + bool revoke_privileges(const PrivilegeBag& privileges) override; + void send_revoke_privileges(const PrivilegeBag& privileges); + bool recv_revoke_privileges(); + void grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) override; + void send_grant_revoke_privileges(const GrantRevokePrivilegeRequest& request); + void recv_grant_revoke_privileges(GrantRevokePrivilegeResponse& _return); + void refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) override; + void send_refresh_privileges(const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest); + void recv_refresh_privileges(GrantRevokePrivilegeResponse& _return); + void set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) override; + void send_set_ugi(const std::string& user_name, const std::vector & group_names); + void recv_set_ugi(std::vector & _return); + void get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) override; + void send_get_delegation_token(const std::string& token_owner, const std::string& renewer_kerberos_principal_name); + void recv_get_delegation_token(std::string& _return); + int64_t renew_delegation_token(const std::string& token_str_form) override; + void send_renew_delegation_token(const std::string& token_str_form); + int64_t recv_renew_delegation_token(); + void cancel_delegation_token(const std::string& token_str_form) override; + void send_cancel_delegation_token(const std::string& token_str_form); + void recv_cancel_delegation_token(); + bool add_token(const std::string& token_identifier, const std::string& delegation_token) override; + void send_add_token(const std::string& token_identifier, const std::string& delegation_token); + bool recv_add_token(); + bool remove_token(const std::string& token_identifier) override; + void send_remove_token(const std::string& token_identifier); + bool recv_remove_token(); + void get_token(std::string& _return, const std::string& token_identifier) override; + void send_get_token(const std::string& token_identifier); + void recv_get_token(std::string& _return); + void get_all_token_identifiers(std::vector & _return) override; + void send_get_all_token_identifiers(); + void recv_get_all_token_identifiers(std::vector & _return); + int32_t add_master_key(const std::string& key) override; + void send_add_master_key(const std::string& key); + int32_t recv_add_master_key(); + void update_master_key(const int32_t seq_number, const std::string& key) override; + void send_update_master_key(const int32_t seq_number, const std::string& key); + void recv_update_master_key(); + bool remove_master_key(const int32_t key_seq) override; + void send_remove_master_key(const int32_t key_seq); + bool recv_remove_master_key(); + void get_master_keys(std::vector & _return) override; + void send_get_master_keys(); + void recv_get_master_keys(std::vector & _return); + void get_open_txns(GetOpenTxnsResponse& _return) override; + void send_get_open_txns(); + void recv_get_open_txns(GetOpenTxnsResponse& _return); + void get_open_txns_info(GetOpenTxnsInfoResponse& _return) override; + void send_get_open_txns_info(); + void recv_get_open_txns_info(GetOpenTxnsInfoResponse& _return); + void open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) override; + void send_open_txns(const OpenTxnRequest& rqst); + void recv_open_txns(OpenTxnsResponse& _return); + void abort_txn(const AbortTxnRequest& rqst) override; + void send_abort_txn(const AbortTxnRequest& rqst); + void recv_abort_txn(); + void abort_txns(const AbortTxnsRequest& rqst) override; + void send_abort_txns(const AbortTxnsRequest& rqst); + void recv_abort_txns(); + void commit_txn(const CommitTxnRequest& rqst) override; + void send_commit_txn(const CommitTxnRequest& rqst); + void recv_commit_txn(); + int64_t get_latest_txnid_in_conflict(const int64_t txnId) override; + void send_get_latest_txnid_in_conflict(const int64_t txnId); + int64_t recv_get_latest_txnid_in_conflict(); + void repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) override; + void send_repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst); + void recv_repl_tbl_writeid_state(); + void get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) override; + void send_get_valid_write_ids(const GetValidWriteIdsRequest& rqst); + void recv_get_valid_write_ids(GetValidWriteIdsResponse& _return); + void add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) override; + void send_add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds); + void recv_add_write_ids_to_min_history(); + void allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) override; + void send_allocate_table_write_ids(const AllocateTableWriteIdsRequest& rqst); + void recv_allocate_table_write_ids(AllocateTableWriteIdsResponse& _return); + void get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) override; + void send_get_max_allocated_table_write_id(const MaxAllocatedTableWriteIdRequest& rqst); + void recv_get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return); + void seed_write_id(const SeedTableWriteIdsRequest& rqst) override; + void send_seed_write_id(const SeedTableWriteIdsRequest& rqst); + void recv_seed_write_id(); + void seed_txn_id(const SeedTxnIdRequest& rqst) override; + void send_seed_txn_id(const SeedTxnIdRequest& rqst); + void recv_seed_txn_id(); + void lock(LockResponse& _return, const LockRequest& rqst) override; + void send_lock(const LockRequest& rqst); + void recv_lock(LockResponse& _return); + void check_lock(LockResponse& _return, const CheckLockRequest& rqst) override; + void send_check_lock(const CheckLockRequest& rqst); + void recv_check_lock(LockResponse& _return); + void unlock(const UnlockRequest& rqst) override; + void send_unlock(const UnlockRequest& rqst); + void recv_unlock(); + void show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) override; + void send_show_locks(const ShowLocksRequest& rqst); + void recv_show_locks(ShowLocksResponse& _return); + void heartbeat(const HeartbeatRequest& ids) override; + void send_heartbeat(const HeartbeatRequest& ids); + void recv_heartbeat(); + void heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) override; + void send_heartbeat_txn_range(const HeartbeatTxnRangeRequest& txns); + void recv_heartbeat_txn_range(HeartbeatTxnRangeResponse& _return); + void compact(const CompactionRequest& rqst) override; + void send_compact(const CompactionRequest& rqst); + void recv_compact(); + void compact2(CompactionResponse& _return, const CompactionRequest& rqst) override; + void send_compact2(const CompactionRequest& rqst); + void recv_compact2(CompactionResponse& _return); + void show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) override; + void send_show_compact(const ShowCompactRequest& rqst); + void recv_show_compact(ShowCompactResponse& _return); + bool submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) override; + void send_submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3); + bool recv_submit_for_cleanup(); + void add_dynamic_partitions(const AddDynamicPartitions& rqst) override; + void send_add_dynamic_partitions(const AddDynamicPartitions& rqst); + void recv_add_dynamic_partitions(); + void find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) override; + void send_find_next_compact(const std::string& workerId); + void recv_find_next_compact(OptionalCompactionInfoStruct& _return); + void find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) override; + void send_find_next_compact2(const FindNextCompactRequest& rqst); + void recv_find_next_compact2(OptionalCompactionInfoStruct& _return); + void update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) override; + void send_update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id); + void recv_update_compactor_state(); + void find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) override; + void send_find_columns_with_stats(const CompactionInfoStruct& cr); + void recv_find_columns_with_stats(std::vector & _return); + void mark_cleaned(const CompactionInfoStruct& cr) override; + void send_mark_cleaned(const CompactionInfoStruct& cr); + void recv_mark_cleaned(); + void mark_compacted(const CompactionInfoStruct& cr) override; + void send_mark_compacted(const CompactionInfoStruct& cr); + void recv_mark_compacted(); + void mark_failed(const CompactionInfoStruct& cr) override; + void send_mark_failed(const CompactionInfoStruct& cr); + void recv_mark_failed(); + void mark_refused(const CompactionInfoStruct& cr) override; + void send_mark_refused(const CompactionInfoStruct& cr); + void recv_mark_refused(); + bool update_compaction_metrics_data(const CompactionMetricsDataStruct& data) override; + void send_update_compaction_metrics_data(const CompactionMetricsDataStruct& data); + bool recv_update_compaction_metrics_data(); + void remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) override; + void send_remove_compaction_metrics_data(const CompactionMetricsDataRequest& request); + void recv_remove_compaction_metrics_data(); + void set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) override; + void send_set_hadoop_jobid(const std::string& jobId, const int64_t cq_id); + void recv_set_hadoop_jobid(); + void get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) override; + void send_get_latest_committed_compaction_info(const GetLatestCommittedCompactionInfoRequest& rqst); + void recv_get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return); + void get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) override; + void send_get_next_notification(const NotificationEventRequest& rqst); + void recv_get_next_notification(NotificationEventResponse& _return); + void get_current_notificationEventId(CurrentNotificationEventId& _return) override; + void send_get_current_notificationEventId(); + void recv_get_current_notificationEventId(CurrentNotificationEventId& _return); + void get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) override; + void send_get_notification_events_count(const NotificationEventsCountRequest& rqst); + void recv_get_notification_events_count(NotificationEventsCountResponse& _return); + void fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) override; + void send_fire_listener_event(const FireEventRequest& rqst); + void recv_fire_listener_event(FireEventResponse& _return); + void flushCache() override; + void send_flushCache(); + void recv_flushCache(); + void add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) override; + void send_add_write_notification_log(const WriteNotificationLogRequest& rqst); + void recv_add_write_notification_log(WriteNotificationLogResponse& _return); + void add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) override; + void send_add_write_notification_log_in_batch(const WriteNotificationLogBatchRequest& rqst); + void recv_add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return); + void cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) override; + void send_cm_recycle(const CmRecycleRequest& request); + void recv_cm_recycle(CmRecycleResponse& _return); + void get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) override; + void send_get_file_metadata_by_expr(const GetFileMetadataByExprRequest& req); + void recv_get_file_metadata_by_expr(GetFileMetadataByExprResult& _return); + void get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) override; + void send_get_file_metadata(const GetFileMetadataRequest& req); + void recv_get_file_metadata(GetFileMetadataResult& _return); + void put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) override; + void send_put_file_metadata(const PutFileMetadataRequest& req); + void recv_put_file_metadata(PutFileMetadataResult& _return); + void clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) override; + void send_clear_file_metadata(const ClearFileMetadataRequest& req); + void recv_clear_file_metadata(ClearFileMetadataResult& _return); + void cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) override; + void send_cache_file_metadata(const CacheFileMetadataRequest& req); + void recv_cache_file_metadata(CacheFileMetadataResult& _return); + void get_metastore_db_uuid(std::string& _return) override; + void send_get_metastore_db_uuid(); + void recv_get_metastore_db_uuid(std::string& _return); + void create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) override; + void send_create_resource_plan(const WMCreateResourcePlanRequest& request); + void recv_create_resource_plan(WMCreateResourcePlanResponse& _return); + void get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) override; + void send_get_resource_plan(const WMGetResourcePlanRequest& request); + void recv_get_resource_plan(WMGetResourcePlanResponse& _return); + void get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) override; + void send_get_active_resource_plan(const WMGetActiveResourcePlanRequest& request); + void recv_get_active_resource_plan(WMGetActiveResourcePlanResponse& _return); + void get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) override; + void send_get_all_resource_plans(const WMGetAllResourcePlanRequest& request); + void recv_get_all_resource_plans(WMGetAllResourcePlanResponse& _return); + void alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) override; + void send_alter_resource_plan(const WMAlterResourcePlanRequest& request); + void recv_alter_resource_plan(WMAlterResourcePlanResponse& _return); + void validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) override; + void send_validate_resource_plan(const WMValidateResourcePlanRequest& request); + void recv_validate_resource_plan(WMValidateResourcePlanResponse& _return); + void drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) override; + void send_drop_resource_plan(const WMDropResourcePlanRequest& request); + void recv_drop_resource_plan(WMDropResourcePlanResponse& _return); + void create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) override; + void send_create_wm_trigger(const WMCreateTriggerRequest& request); + void recv_create_wm_trigger(WMCreateTriggerResponse& _return); + void alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) override; + void send_alter_wm_trigger(const WMAlterTriggerRequest& request); + void recv_alter_wm_trigger(WMAlterTriggerResponse& _return); + void drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) override; + void send_drop_wm_trigger(const WMDropTriggerRequest& request); + void recv_drop_wm_trigger(WMDropTriggerResponse& _return); + void get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) override; + void send_get_triggers_for_resourceplan(const WMGetTriggersForResourePlanRequest& request); + void recv_get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return); + void create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) override; + void send_create_wm_pool(const WMCreatePoolRequest& request); + void recv_create_wm_pool(WMCreatePoolResponse& _return); + void alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) override; + void send_alter_wm_pool(const WMAlterPoolRequest& request); + void recv_alter_wm_pool(WMAlterPoolResponse& _return); + void drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) override; + void send_drop_wm_pool(const WMDropPoolRequest& request); + void recv_drop_wm_pool(WMDropPoolResponse& _return); + void create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) override; + void send_create_or_update_wm_mapping(const WMCreateOrUpdateMappingRequest& request); + void recv_create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return); + void drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) override; + void send_drop_wm_mapping(const WMDropMappingRequest& request); + void recv_drop_wm_mapping(WMDropMappingResponse& _return); + void create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) override; + void send_create_or_drop_wm_trigger_to_pool_mapping(const WMCreateOrDropTriggerToPoolMappingRequest& request); + void recv_create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return); + void create_ischema(const ISchema& schema) override; + void send_create_ischema(const ISchema& schema); + void recv_create_ischema(); + void alter_ischema(const AlterISchemaRequest& rqst) override; + void send_alter_ischema(const AlterISchemaRequest& rqst); + void recv_alter_ischema(); + void get_ischema(ISchema& _return, const ISchemaName& name) override; + void send_get_ischema(const ISchemaName& name); + void recv_get_ischema(ISchema& _return); + void drop_ischema(const ISchemaName& name) override; + void send_drop_ischema(const ISchemaName& name); + void recv_drop_ischema(); + void add_schema_version(const SchemaVersion& schemaVersion) override; + void send_add_schema_version(const SchemaVersion& schemaVersion); + void recv_add_schema_version(); + void get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) override; + void send_get_schema_version(const SchemaVersionDescriptor& schemaVersion); + void recv_get_schema_version(SchemaVersion& _return); + void get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) override; + void send_get_schema_latest_version(const ISchemaName& schemaName); + void recv_get_schema_latest_version(SchemaVersion& _return); + void get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) override; + void send_get_schema_all_versions(const ISchemaName& schemaName); + void recv_get_schema_all_versions(std::vector & _return); + void drop_schema_version(const SchemaVersionDescriptor& schemaVersion) override; + void send_drop_schema_version(const SchemaVersionDescriptor& schemaVersion); + void recv_drop_schema_version(); + void get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) override; + void send_get_schemas_by_cols(const FindSchemasByColsRqst& rqst); + void recv_get_schemas_by_cols(FindSchemasByColsResp& _return); + void map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) override; + void send_map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst); + void recv_map_schema_version_to_serde(); + void set_schema_version_state(const SetSchemaVersionStateRequest& rqst) override; + void send_set_schema_version_state(const SetSchemaVersionStateRequest& rqst); + void recv_set_schema_version_state(); + void add_serde(const SerDeInfo& serde) override; + void send_add_serde(const SerDeInfo& serde); + void recv_add_serde(); + void get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) override; + void send_get_serde(const GetSerdeRequest& rqst); + void recv_get_serde(SerDeInfo& _return); + void get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) override; + void send_get_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId); + void recv_get_lock_materialization_rebuild(LockResponse& _return); + bool heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) override; + void send_heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId); + bool recv_heartbeat_lock_materialization_rebuild(); + void add_runtime_stats(const RuntimeStat& stat) override; + void send_add_runtime_stats(const RuntimeStat& stat); + void recv_add_runtime_stats(); + void get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) override; + void send_get_runtime_stats(const GetRuntimeStatsRequest& rqst); + void recv_get_runtime_stats(std::vector & _return); + void get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) override; + void send_get_partitions_with_specs(const GetPartitionsRequest& request); + void recv_get_partitions_with_specs(GetPartitionsResponse& _return); + void scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) override; + void send_scheduled_query_poll(const ScheduledQueryPollRequest& request); + void recv_scheduled_query_poll(ScheduledQueryPollResponse& _return); + void scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) override; + void send_scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request); + void recv_scheduled_query_maintenance(); + void scheduled_query_progress(const ScheduledQueryProgressInfo& info) override; + void send_scheduled_query_progress(const ScheduledQueryProgressInfo& info); + void recv_scheduled_query_progress(); + void get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) override; + void send_get_scheduled_query(const ScheduledQueryKey& scheduleKey); + void recv_get_scheduled_query(ScheduledQuery& _return); + void add_replication_metrics(const ReplicationMetricList& replicationMetricList) override; + void send_add_replication_metrics(const ReplicationMetricList& replicationMetricList); + void recv_add_replication_metrics(); + void get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) override; + void send_get_replication_metrics(const GetReplicationMetricsRequest& rqst); + void recv_get_replication_metrics(ReplicationMetricList& _return); + void get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) override; + void send_get_open_txns_req(const GetOpenTxnsRequest& getOpenTxnsRequest); + void recv_get_open_txns_req(GetOpenTxnsResponse& _return); + void create_stored_procedure(const StoredProcedure& proc) override; + void send_create_stored_procedure(const StoredProcedure& proc); + void recv_create_stored_procedure(); + void get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) override; + void send_get_stored_procedure(const StoredProcedureRequest& request); + void recv_get_stored_procedure(StoredProcedure& _return); + void drop_stored_procedure(const StoredProcedureRequest& request) override; + void send_drop_stored_procedure(const StoredProcedureRequest& request); + void recv_drop_stored_procedure(); + void get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) override; + void send_get_all_stored_procedures(const ListStoredProcedureRequest& request); + void recv_get_all_stored_procedures(std::vector & _return); + void find_package(Package& _return, const GetPackageRequest& request) override; + void send_find_package(const GetPackageRequest& request); + void recv_find_package(Package& _return); + void add_package(const AddPackageRequest& request) override; + void send_add_package(const AddPackageRequest& request); + void recv_add_package(); + void get_all_packages(std::vector & _return, const ListPackageRequest& request) override; + void send_get_all_packages(const ListPackageRequest& request); + void recv_get_all_packages(std::vector & _return); + void drop_package(const DropPackageRequest& request) override; + void send_drop_package(const DropPackageRequest& request); + void recv_drop_package(); + void get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) override; + void send_get_all_write_event_info(const GetAllWriteEventInfoRequest& request); + void recv_get_all_write_event_info(std::vector & _return); +}; + +class ThriftHiveMetastoreProcessor : public ::facebook::fb303::FacebookServiceProcessor { + protected: + ::std::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) override; + private: + typedef void (ThriftHiveMetastoreProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_abort_Compactions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_setMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_catalogs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_catalog(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_databases(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_databases(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_database_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_dataconnectors(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_dataconnector_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_type_all(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_fields(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_fields_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_fields_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_table_with_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_primary_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_foreign_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_unique_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_not_null_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_default_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_check_constraint(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_translate_table_dryrun(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_truncate_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_truncate_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_tables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_tables_by_type(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_materialized_view_objects_for_rewriting(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_materialized_views_for_rewriting(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_meta(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_tables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_tables_ext(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_objects_by_name_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_materialization_invalidation_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_creation_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_names_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_table(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_table_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_table_with_cascade(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_table_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_partitions_pspec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_append_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_append_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_append_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_append_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_append_partition_by_name_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partition_by_name_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_exchange_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_exchange_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_by_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_pspec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_fetch_partition_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_values(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_ps(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_ps_with_auth(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_ps_with_auth_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_names_ps(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_names_ps_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_by_filter_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_part_specs_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_spec_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_num_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_by_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_by_names_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_properties(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_properties(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_partitions_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_partitions_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_partition_with_environment_context(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_rename_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_rename_partition_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_partition_name_has_valid_characters(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_config_value(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_partition_name_to_vals(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_partition_name_to_spec(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_markPartitionForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_isPartitionMarkedForEvent(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_primary_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_foreign_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_unique_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_not_null_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_default_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_check_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_table_constraints(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_table_column_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_partition_column_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_transaction_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_table_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_statistics_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_aggr_stats_for(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_aggr_stats_for(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_delete_partition_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_delete_table_column_statistics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_functions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_function(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_functions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_role_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_grant_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_revoke_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_list_roles(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_grant_revoke_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_principals_in_role(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_role_grants_for_principal(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_privilege_set(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_list_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_grant_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_revoke_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_grant_revoke_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_refresh_privileges(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_ugi(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_renew_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_cancel_delegation_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_token(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_token_identifiers(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove_master_key(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_master_keys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_open_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_open_txns_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_open_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_abort_txn(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_abort_txns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_commit_txn(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_latest_txnid_in_conflict(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_repl_tbl_writeid_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_valid_write_ids(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_write_ids_to_min_history(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_allocate_table_write_ids(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_max_allocated_table_write_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_seed_write_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_seed_txn_id(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_lock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_check_lock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_unlock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_show_locks(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_heartbeat(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_heartbeat_txn_range(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_compact2(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_show_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_submit_for_cleanup(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_dynamic_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_find_next_compact(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_find_next_compact2(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_compactor_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_find_columns_with_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_mark_cleaned(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_mark_compacted(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_mark_failed(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_mark_refused(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_update_compaction_metrics_data(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove_compaction_metrics_data(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_hadoop_jobid(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_latest_committed_compaction_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_next_notification(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_current_notificationEventId(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_notification_events_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_fire_listener_event(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_flushCache(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_write_notification_log(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_write_notification_log_in_batch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_cm_recycle(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_file_metadata_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_put_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_clear_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_cache_file_metadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_metastore_db_uuid(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_active_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_resource_plans(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_validate_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_resource_plan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_wm_trigger(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_triggers_for_resourceplan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_wm_pool(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_or_update_wm_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_wm_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_or_drop_wm_trigger_to_pool_mapping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_alter_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_ischema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema_latest_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schema_all_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_schema_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_schemas_by_cols(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_map_schema_version_to_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_schema_version_state(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_serde(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_lock_materialization_rebuild(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_heartbeat_lock_materialization_rebuild(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_runtime_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_runtime_stats(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_partitions_with_specs(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_scheduled_query_poll(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_scheduled_query_maintenance(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_scheduled_query_progress(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_scheduled_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_replication_metrics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_replication_metrics(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_open_txns_req(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_create_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_stored_procedure(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_stored_procedures(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_find_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_packages(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_drop_package(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_all_write_event_info(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + ThriftHiveMetastoreProcessor(::std::shared_ptr iface) : + ::facebook::fb303::FacebookServiceProcessor(iface), + iface_(iface) { + processMap_["abort_Compactions"] = &ThriftHiveMetastoreProcessor::process_abort_Compactions; + processMap_["getMetaConf"] = &ThriftHiveMetastoreProcessor::process_getMetaConf; + processMap_["setMetaConf"] = &ThriftHiveMetastoreProcessor::process_setMetaConf; + processMap_["create_catalog"] = &ThriftHiveMetastoreProcessor::process_create_catalog; + processMap_["alter_catalog"] = &ThriftHiveMetastoreProcessor::process_alter_catalog; + processMap_["get_catalog"] = &ThriftHiveMetastoreProcessor::process_get_catalog; + processMap_["get_catalogs"] = &ThriftHiveMetastoreProcessor::process_get_catalogs; + processMap_["drop_catalog"] = &ThriftHiveMetastoreProcessor::process_drop_catalog; + processMap_["create_database"] = &ThriftHiveMetastoreProcessor::process_create_database; + processMap_["create_database_req"] = &ThriftHiveMetastoreProcessor::process_create_database_req; + processMap_["get_database"] = &ThriftHiveMetastoreProcessor::process_get_database; + processMap_["get_database_req"] = &ThriftHiveMetastoreProcessor::process_get_database_req; + processMap_["drop_database"] = &ThriftHiveMetastoreProcessor::process_drop_database; + processMap_["drop_database_req"] = &ThriftHiveMetastoreProcessor::process_drop_database_req; + processMap_["get_databases"] = &ThriftHiveMetastoreProcessor::process_get_databases; + processMap_["get_all_databases"] = &ThriftHiveMetastoreProcessor::process_get_all_databases; + processMap_["alter_database"] = &ThriftHiveMetastoreProcessor::process_alter_database; + processMap_["alter_database_req"] = &ThriftHiveMetastoreProcessor::process_alter_database_req; + processMap_["create_dataconnector_req"] = &ThriftHiveMetastoreProcessor::process_create_dataconnector_req; + processMap_["get_dataconnector_req"] = &ThriftHiveMetastoreProcessor::process_get_dataconnector_req; + processMap_["drop_dataconnector_req"] = &ThriftHiveMetastoreProcessor::process_drop_dataconnector_req; + processMap_["get_dataconnectors"] = &ThriftHiveMetastoreProcessor::process_get_dataconnectors; + processMap_["alter_dataconnector_req"] = &ThriftHiveMetastoreProcessor::process_alter_dataconnector_req; + processMap_["get_type"] = &ThriftHiveMetastoreProcessor::process_get_type; + processMap_["create_type"] = &ThriftHiveMetastoreProcessor::process_create_type; + processMap_["drop_type"] = &ThriftHiveMetastoreProcessor::process_drop_type; + processMap_["get_type_all"] = &ThriftHiveMetastoreProcessor::process_get_type_all; + processMap_["get_fields"] = &ThriftHiveMetastoreProcessor::process_get_fields; + processMap_["get_fields_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_get_fields_with_environment_context; + processMap_["get_fields_req"] = &ThriftHiveMetastoreProcessor::process_get_fields_req; + processMap_["get_schema"] = &ThriftHiveMetastoreProcessor::process_get_schema; + processMap_["get_schema_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_get_schema_with_environment_context; + processMap_["get_schema_req"] = &ThriftHiveMetastoreProcessor::process_get_schema_req; + processMap_["create_table"] = &ThriftHiveMetastoreProcessor::process_create_table; + processMap_["create_table_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_create_table_with_environment_context; + processMap_["create_table_with_constraints"] = &ThriftHiveMetastoreProcessor::process_create_table_with_constraints; + processMap_["create_table_req"] = &ThriftHiveMetastoreProcessor::process_create_table_req; + processMap_["drop_constraint"] = &ThriftHiveMetastoreProcessor::process_drop_constraint; + processMap_["add_primary_key"] = &ThriftHiveMetastoreProcessor::process_add_primary_key; + processMap_["add_foreign_key"] = &ThriftHiveMetastoreProcessor::process_add_foreign_key; + processMap_["add_unique_constraint"] = &ThriftHiveMetastoreProcessor::process_add_unique_constraint; + processMap_["add_not_null_constraint"] = &ThriftHiveMetastoreProcessor::process_add_not_null_constraint; + processMap_["add_default_constraint"] = &ThriftHiveMetastoreProcessor::process_add_default_constraint; + processMap_["add_check_constraint"] = &ThriftHiveMetastoreProcessor::process_add_check_constraint; + processMap_["translate_table_dryrun"] = &ThriftHiveMetastoreProcessor::process_translate_table_dryrun; + processMap_["drop_table"] = &ThriftHiveMetastoreProcessor::process_drop_table; + processMap_["drop_table_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_drop_table_with_environment_context; + processMap_["drop_table_req"] = &ThriftHiveMetastoreProcessor::process_drop_table_req; + processMap_["truncate_table"] = &ThriftHiveMetastoreProcessor::process_truncate_table; + processMap_["truncate_table_req"] = &ThriftHiveMetastoreProcessor::process_truncate_table_req; + processMap_["get_tables"] = &ThriftHiveMetastoreProcessor::process_get_tables; + processMap_["get_tables_by_type"] = &ThriftHiveMetastoreProcessor::process_get_tables_by_type; + processMap_["get_all_materialized_view_objects_for_rewriting"] = &ThriftHiveMetastoreProcessor::process_get_all_materialized_view_objects_for_rewriting; + processMap_["get_materialized_views_for_rewriting"] = &ThriftHiveMetastoreProcessor::process_get_materialized_views_for_rewriting; + processMap_["get_table_meta"] = &ThriftHiveMetastoreProcessor::process_get_table_meta; + processMap_["get_all_tables"] = &ThriftHiveMetastoreProcessor::process_get_all_tables; + processMap_["get_tables_ext"] = &ThriftHiveMetastoreProcessor::process_get_tables_ext; + processMap_["get_table_req"] = &ThriftHiveMetastoreProcessor::process_get_table_req; + processMap_["get_table_objects_by_name_req"] = &ThriftHiveMetastoreProcessor::process_get_table_objects_by_name_req; + processMap_["get_materialization_invalidation_info"] = &ThriftHiveMetastoreProcessor::process_get_materialization_invalidation_info; + processMap_["update_creation_metadata"] = &ThriftHiveMetastoreProcessor::process_update_creation_metadata; + processMap_["get_table_names_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_table_names_by_filter; + processMap_["alter_table"] = &ThriftHiveMetastoreProcessor::process_alter_table; + processMap_["alter_table_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_alter_table_with_environment_context; + processMap_["alter_table_with_cascade"] = &ThriftHiveMetastoreProcessor::process_alter_table_with_cascade; + processMap_["alter_table_req"] = &ThriftHiveMetastoreProcessor::process_alter_table_req; + processMap_["add_partition"] = &ThriftHiveMetastoreProcessor::process_add_partition; + processMap_["add_partition_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_add_partition_with_environment_context; + processMap_["add_partitions"] = &ThriftHiveMetastoreProcessor::process_add_partitions; + processMap_["add_partitions_pspec"] = &ThriftHiveMetastoreProcessor::process_add_partitions_pspec; + processMap_["append_partition"] = &ThriftHiveMetastoreProcessor::process_append_partition; + processMap_["add_partitions_req"] = &ThriftHiveMetastoreProcessor::process_add_partitions_req; + processMap_["append_partition_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_append_partition_with_environment_context; + processMap_["append_partition_req"] = &ThriftHiveMetastoreProcessor::process_append_partition_req; + processMap_["append_partition_by_name"] = &ThriftHiveMetastoreProcessor::process_append_partition_by_name; + processMap_["append_partition_by_name_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_append_partition_by_name_with_environment_context; + processMap_["drop_partition"] = &ThriftHiveMetastoreProcessor::process_drop_partition; + processMap_["drop_partition_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_drop_partition_with_environment_context; + processMap_["drop_partition_req"] = &ThriftHiveMetastoreProcessor::process_drop_partition_req; + processMap_["drop_partition_by_name"] = &ThriftHiveMetastoreProcessor::process_drop_partition_by_name; + processMap_["drop_partition_by_name_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_drop_partition_by_name_with_environment_context; + processMap_["drop_partitions_req"] = &ThriftHiveMetastoreProcessor::process_drop_partitions_req; + processMap_["get_partition"] = &ThriftHiveMetastoreProcessor::process_get_partition; + processMap_["get_partition_req"] = &ThriftHiveMetastoreProcessor::process_get_partition_req; + processMap_["exchange_partition"] = &ThriftHiveMetastoreProcessor::process_exchange_partition; + processMap_["exchange_partitions"] = &ThriftHiveMetastoreProcessor::process_exchange_partitions; + processMap_["get_partition_with_auth"] = &ThriftHiveMetastoreProcessor::process_get_partition_with_auth; + processMap_["get_partition_by_name"] = &ThriftHiveMetastoreProcessor::process_get_partition_by_name; + processMap_["get_partitions"] = &ThriftHiveMetastoreProcessor::process_get_partitions; + processMap_["get_partitions_req"] = &ThriftHiveMetastoreProcessor::process_get_partitions_req; + processMap_["get_partitions_with_auth"] = &ThriftHiveMetastoreProcessor::process_get_partitions_with_auth; + processMap_["get_partitions_pspec"] = &ThriftHiveMetastoreProcessor::process_get_partitions_pspec; + processMap_["get_partition_names"] = &ThriftHiveMetastoreProcessor::process_get_partition_names; + processMap_["fetch_partition_names_req"] = &ThriftHiveMetastoreProcessor::process_fetch_partition_names_req; + processMap_["get_partition_values"] = &ThriftHiveMetastoreProcessor::process_get_partition_values; + processMap_["get_partitions_ps"] = &ThriftHiveMetastoreProcessor::process_get_partitions_ps; + processMap_["get_partitions_ps_with_auth"] = &ThriftHiveMetastoreProcessor::process_get_partitions_ps_with_auth; + processMap_["get_partitions_ps_with_auth_req"] = &ThriftHiveMetastoreProcessor::process_get_partitions_ps_with_auth_req; + processMap_["get_partition_names_ps"] = &ThriftHiveMetastoreProcessor::process_get_partition_names_ps; + processMap_["get_partition_names_ps_req"] = &ThriftHiveMetastoreProcessor::process_get_partition_names_ps_req; + processMap_["get_partition_names_req"] = &ThriftHiveMetastoreProcessor::process_get_partition_names_req; + processMap_["get_partitions_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_filter; + processMap_["get_partitions_by_filter_req"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_filter_req; + processMap_["get_part_specs_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_part_specs_by_filter; + processMap_["get_partitions_by_expr"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_expr; + processMap_["get_partitions_spec_by_expr"] = &ThriftHiveMetastoreProcessor::process_get_partitions_spec_by_expr; + processMap_["get_num_partitions_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_num_partitions_by_filter; + processMap_["get_partitions_by_names"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_names; + processMap_["get_partitions_by_names_req"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_names_req; + processMap_["get_properties"] = &ThriftHiveMetastoreProcessor::process_get_properties; + processMap_["set_properties"] = &ThriftHiveMetastoreProcessor::process_set_properties; + processMap_["alter_partition"] = &ThriftHiveMetastoreProcessor::process_alter_partition; + processMap_["alter_partitions"] = &ThriftHiveMetastoreProcessor::process_alter_partitions; + processMap_["alter_partitions_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_alter_partitions_with_environment_context; + processMap_["alter_partitions_req"] = &ThriftHiveMetastoreProcessor::process_alter_partitions_req; + processMap_["alter_partition_with_environment_context"] = &ThriftHiveMetastoreProcessor::process_alter_partition_with_environment_context; + processMap_["rename_partition"] = &ThriftHiveMetastoreProcessor::process_rename_partition; + processMap_["rename_partition_req"] = &ThriftHiveMetastoreProcessor::process_rename_partition_req; + processMap_["partition_name_has_valid_characters"] = &ThriftHiveMetastoreProcessor::process_partition_name_has_valid_characters; + processMap_["get_config_value"] = &ThriftHiveMetastoreProcessor::process_get_config_value; + processMap_["partition_name_to_vals"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_vals; + processMap_["partition_name_to_spec"] = &ThriftHiveMetastoreProcessor::process_partition_name_to_spec; + processMap_["markPartitionForEvent"] = &ThriftHiveMetastoreProcessor::process_markPartitionForEvent; + processMap_["isPartitionMarkedForEvent"] = &ThriftHiveMetastoreProcessor::process_isPartitionMarkedForEvent; + processMap_["get_primary_keys"] = &ThriftHiveMetastoreProcessor::process_get_primary_keys; + processMap_["get_foreign_keys"] = &ThriftHiveMetastoreProcessor::process_get_foreign_keys; + processMap_["get_unique_constraints"] = &ThriftHiveMetastoreProcessor::process_get_unique_constraints; + processMap_["get_not_null_constraints"] = &ThriftHiveMetastoreProcessor::process_get_not_null_constraints; + processMap_["get_default_constraints"] = &ThriftHiveMetastoreProcessor::process_get_default_constraints; + processMap_["get_check_constraints"] = &ThriftHiveMetastoreProcessor::process_get_check_constraints; + processMap_["get_all_table_constraints"] = &ThriftHiveMetastoreProcessor::process_get_all_table_constraints; + processMap_["update_table_column_statistics"] = &ThriftHiveMetastoreProcessor::process_update_table_column_statistics; + processMap_["update_partition_column_statistics"] = &ThriftHiveMetastoreProcessor::process_update_partition_column_statistics; + processMap_["update_table_column_statistics_req"] = &ThriftHiveMetastoreProcessor::process_update_table_column_statistics_req; + processMap_["update_partition_column_statistics_req"] = &ThriftHiveMetastoreProcessor::process_update_partition_column_statistics_req; + processMap_["update_transaction_statistics"] = &ThriftHiveMetastoreProcessor::process_update_transaction_statistics; + processMap_["get_table_column_statistics"] = &ThriftHiveMetastoreProcessor::process_get_table_column_statistics; + processMap_["get_partition_column_statistics"] = &ThriftHiveMetastoreProcessor::process_get_partition_column_statistics; + processMap_["get_table_statistics_req"] = &ThriftHiveMetastoreProcessor::process_get_table_statistics_req; + processMap_["get_partitions_statistics_req"] = &ThriftHiveMetastoreProcessor::process_get_partitions_statistics_req; + processMap_["get_aggr_stats_for"] = &ThriftHiveMetastoreProcessor::process_get_aggr_stats_for; + processMap_["set_aggr_stats_for"] = &ThriftHiveMetastoreProcessor::process_set_aggr_stats_for; + processMap_["delete_partition_column_statistics"] = &ThriftHiveMetastoreProcessor::process_delete_partition_column_statistics; + processMap_["delete_table_column_statistics"] = &ThriftHiveMetastoreProcessor::process_delete_table_column_statistics; + processMap_["create_function"] = &ThriftHiveMetastoreProcessor::process_create_function; + processMap_["drop_function"] = &ThriftHiveMetastoreProcessor::process_drop_function; + processMap_["alter_function"] = &ThriftHiveMetastoreProcessor::process_alter_function; + processMap_["get_functions"] = &ThriftHiveMetastoreProcessor::process_get_functions; + processMap_["get_function"] = &ThriftHiveMetastoreProcessor::process_get_function; + processMap_["get_all_functions"] = &ThriftHiveMetastoreProcessor::process_get_all_functions; + processMap_["create_role"] = &ThriftHiveMetastoreProcessor::process_create_role; + processMap_["drop_role"] = &ThriftHiveMetastoreProcessor::process_drop_role; + processMap_["get_role_names"] = &ThriftHiveMetastoreProcessor::process_get_role_names; + processMap_["grant_role"] = &ThriftHiveMetastoreProcessor::process_grant_role; + processMap_["revoke_role"] = &ThriftHiveMetastoreProcessor::process_revoke_role; + processMap_["list_roles"] = &ThriftHiveMetastoreProcessor::process_list_roles; + processMap_["grant_revoke_role"] = &ThriftHiveMetastoreProcessor::process_grant_revoke_role; + processMap_["get_principals_in_role"] = &ThriftHiveMetastoreProcessor::process_get_principals_in_role; + processMap_["get_role_grants_for_principal"] = &ThriftHiveMetastoreProcessor::process_get_role_grants_for_principal; + processMap_["get_privilege_set"] = &ThriftHiveMetastoreProcessor::process_get_privilege_set; + processMap_["list_privileges"] = &ThriftHiveMetastoreProcessor::process_list_privileges; + processMap_["grant_privileges"] = &ThriftHiveMetastoreProcessor::process_grant_privileges; + processMap_["revoke_privileges"] = &ThriftHiveMetastoreProcessor::process_revoke_privileges; + processMap_["grant_revoke_privileges"] = &ThriftHiveMetastoreProcessor::process_grant_revoke_privileges; + processMap_["refresh_privileges"] = &ThriftHiveMetastoreProcessor::process_refresh_privileges; + processMap_["set_ugi"] = &ThriftHiveMetastoreProcessor::process_set_ugi; + processMap_["get_delegation_token"] = &ThriftHiveMetastoreProcessor::process_get_delegation_token; + processMap_["renew_delegation_token"] = &ThriftHiveMetastoreProcessor::process_renew_delegation_token; + processMap_["cancel_delegation_token"] = &ThriftHiveMetastoreProcessor::process_cancel_delegation_token; + processMap_["add_token"] = &ThriftHiveMetastoreProcessor::process_add_token; + processMap_["remove_token"] = &ThriftHiveMetastoreProcessor::process_remove_token; + processMap_["get_token"] = &ThriftHiveMetastoreProcessor::process_get_token; + processMap_["get_all_token_identifiers"] = &ThriftHiveMetastoreProcessor::process_get_all_token_identifiers; + processMap_["add_master_key"] = &ThriftHiveMetastoreProcessor::process_add_master_key; + processMap_["update_master_key"] = &ThriftHiveMetastoreProcessor::process_update_master_key; + processMap_["remove_master_key"] = &ThriftHiveMetastoreProcessor::process_remove_master_key; + processMap_["get_master_keys"] = &ThriftHiveMetastoreProcessor::process_get_master_keys; + processMap_["get_open_txns"] = &ThriftHiveMetastoreProcessor::process_get_open_txns; + processMap_["get_open_txns_info"] = &ThriftHiveMetastoreProcessor::process_get_open_txns_info; + processMap_["open_txns"] = &ThriftHiveMetastoreProcessor::process_open_txns; + processMap_["abort_txn"] = &ThriftHiveMetastoreProcessor::process_abort_txn; + processMap_["abort_txns"] = &ThriftHiveMetastoreProcessor::process_abort_txns; + processMap_["commit_txn"] = &ThriftHiveMetastoreProcessor::process_commit_txn; + processMap_["get_latest_txnid_in_conflict"] = &ThriftHiveMetastoreProcessor::process_get_latest_txnid_in_conflict; + processMap_["repl_tbl_writeid_state"] = &ThriftHiveMetastoreProcessor::process_repl_tbl_writeid_state; + processMap_["get_valid_write_ids"] = &ThriftHiveMetastoreProcessor::process_get_valid_write_ids; + processMap_["add_write_ids_to_min_history"] = &ThriftHiveMetastoreProcessor::process_add_write_ids_to_min_history; + processMap_["allocate_table_write_ids"] = &ThriftHiveMetastoreProcessor::process_allocate_table_write_ids; + processMap_["get_max_allocated_table_write_id"] = &ThriftHiveMetastoreProcessor::process_get_max_allocated_table_write_id; + processMap_["seed_write_id"] = &ThriftHiveMetastoreProcessor::process_seed_write_id; + processMap_["seed_txn_id"] = &ThriftHiveMetastoreProcessor::process_seed_txn_id; + processMap_["lock"] = &ThriftHiveMetastoreProcessor::process_lock; + processMap_["check_lock"] = &ThriftHiveMetastoreProcessor::process_check_lock; + processMap_["unlock"] = &ThriftHiveMetastoreProcessor::process_unlock; + processMap_["show_locks"] = &ThriftHiveMetastoreProcessor::process_show_locks; + processMap_["heartbeat"] = &ThriftHiveMetastoreProcessor::process_heartbeat; + processMap_["heartbeat_txn_range"] = &ThriftHiveMetastoreProcessor::process_heartbeat_txn_range; + processMap_["compact"] = &ThriftHiveMetastoreProcessor::process_compact; + processMap_["compact2"] = &ThriftHiveMetastoreProcessor::process_compact2; + processMap_["show_compact"] = &ThriftHiveMetastoreProcessor::process_show_compact; + processMap_["submit_for_cleanup"] = &ThriftHiveMetastoreProcessor::process_submit_for_cleanup; + processMap_["add_dynamic_partitions"] = &ThriftHiveMetastoreProcessor::process_add_dynamic_partitions; + processMap_["find_next_compact"] = &ThriftHiveMetastoreProcessor::process_find_next_compact; + processMap_["find_next_compact2"] = &ThriftHiveMetastoreProcessor::process_find_next_compact2; + processMap_["update_compactor_state"] = &ThriftHiveMetastoreProcessor::process_update_compactor_state; + processMap_["find_columns_with_stats"] = &ThriftHiveMetastoreProcessor::process_find_columns_with_stats; + processMap_["mark_cleaned"] = &ThriftHiveMetastoreProcessor::process_mark_cleaned; + processMap_["mark_compacted"] = &ThriftHiveMetastoreProcessor::process_mark_compacted; + processMap_["mark_failed"] = &ThriftHiveMetastoreProcessor::process_mark_failed; + processMap_["mark_refused"] = &ThriftHiveMetastoreProcessor::process_mark_refused; + processMap_["update_compaction_metrics_data"] = &ThriftHiveMetastoreProcessor::process_update_compaction_metrics_data; + processMap_["remove_compaction_metrics_data"] = &ThriftHiveMetastoreProcessor::process_remove_compaction_metrics_data; + processMap_["set_hadoop_jobid"] = &ThriftHiveMetastoreProcessor::process_set_hadoop_jobid; + processMap_["get_latest_committed_compaction_info"] = &ThriftHiveMetastoreProcessor::process_get_latest_committed_compaction_info; + processMap_["get_next_notification"] = &ThriftHiveMetastoreProcessor::process_get_next_notification; + processMap_["get_current_notificationEventId"] = &ThriftHiveMetastoreProcessor::process_get_current_notificationEventId; + processMap_["get_notification_events_count"] = &ThriftHiveMetastoreProcessor::process_get_notification_events_count; + processMap_["fire_listener_event"] = &ThriftHiveMetastoreProcessor::process_fire_listener_event; + processMap_["flushCache"] = &ThriftHiveMetastoreProcessor::process_flushCache; + processMap_["add_write_notification_log"] = &ThriftHiveMetastoreProcessor::process_add_write_notification_log; + processMap_["add_write_notification_log_in_batch"] = &ThriftHiveMetastoreProcessor::process_add_write_notification_log_in_batch; + processMap_["cm_recycle"] = &ThriftHiveMetastoreProcessor::process_cm_recycle; + processMap_["get_file_metadata_by_expr"] = &ThriftHiveMetastoreProcessor::process_get_file_metadata_by_expr; + processMap_["get_file_metadata"] = &ThriftHiveMetastoreProcessor::process_get_file_metadata; + processMap_["put_file_metadata"] = &ThriftHiveMetastoreProcessor::process_put_file_metadata; + processMap_["clear_file_metadata"] = &ThriftHiveMetastoreProcessor::process_clear_file_metadata; + processMap_["cache_file_metadata"] = &ThriftHiveMetastoreProcessor::process_cache_file_metadata; + processMap_["get_metastore_db_uuid"] = &ThriftHiveMetastoreProcessor::process_get_metastore_db_uuid; + processMap_["create_resource_plan"] = &ThriftHiveMetastoreProcessor::process_create_resource_plan; + processMap_["get_resource_plan"] = &ThriftHiveMetastoreProcessor::process_get_resource_plan; + processMap_["get_active_resource_plan"] = &ThriftHiveMetastoreProcessor::process_get_active_resource_plan; + processMap_["get_all_resource_plans"] = &ThriftHiveMetastoreProcessor::process_get_all_resource_plans; + processMap_["alter_resource_plan"] = &ThriftHiveMetastoreProcessor::process_alter_resource_plan; + processMap_["validate_resource_plan"] = &ThriftHiveMetastoreProcessor::process_validate_resource_plan; + processMap_["drop_resource_plan"] = &ThriftHiveMetastoreProcessor::process_drop_resource_plan; + processMap_["create_wm_trigger"] = &ThriftHiveMetastoreProcessor::process_create_wm_trigger; + processMap_["alter_wm_trigger"] = &ThriftHiveMetastoreProcessor::process_alter_wm_trigger; + processMap_["drop_wm_trigger"] = &ThriftHiveMetastoreProcessor::process_drop_wm_trigger; + processMap_["get_triggers_for_resourceplan"] = &ThriftHiveMetastoreProcessor::process_get_triggers_for_resourceplan; + processMap_["create_wm_pool"] = &ThriftHiveMetastoreProcessor::process_create_wm_pool; + processMap_["alter_wm_pool"] = &ThriftHiveMetastoreProcessor::process_alter_wm_pool; + processMap_["drop_wm_pool"] = &ThriftHiveMetastoreProcessor::process_drop_wm_pool; + processMap_["create_or_update_wm_mapping"] = &ThriftHiveMetastoreProcessor::process_create_or_update_wm_mapping; + processMap_["drop_wm_mapping"] = &ThriftHiveMetastoreProcessor::process_drop_wm_mapping; + processMap_["create_or_drop_wm_trigger_to_pool_mapping"] = &ThriftHiveMetastoreProcessor::process_create_or_drop_wm_trigger_to_pool_mapping; + processMap_["create_ischema"] = &ThriftHiveMetastoreProcessor::process_create_ischema; + processMap_["alter_ischema"] = &ThriftHiveMetastoreProcessor::process_alter_ischema; + processMap_["get_ischema"] = &ThriftHiveMetastoreProcessor::process_get_ischema; + processMap_["drop_ischema"] = &ThriftHiveMetastoreProcessor::process_drop_ischema; + processMap_["add_schema_version"] = &ThriftHiveMetastoreProcessor::process_add_schema_version; + processMap_["get_schema_version"] = &ThriftHiveMetastoreProcessor::process_get_schema_version; + processMap_["get_schema_latest_version"] = &ThriftHiveMetastoreProcessor::process_get_schema_latest_version; + processMap_["get_schema_all_versions"] = &ThriftHiveMetastoreProcessor::process_get_schema_all_versions; + processMap_["drop_schema_version"] = &ThriftHiveMetastoreProcessor::process_drop_schema_version; + processMap_["get_schemas_by_cols"] = &ThriftHiveMetastoreProcessor::process_get_schemas_by_cols; + processMap_["map_schema_version_to_serde"] = &ThriftHiveMetastoreProcessor::process_map_schema_version_to_serde; + processMap_["set_schema_version_state"] = &ThriftHiveMetastoreProcessor::process_set_schema_version_state; + processMap_["add_serde"] = &ThriftHiveMetastoreProcessor::process_add_serde; + processMap_["get_serde"] = &ThriftHiveMetastoreProcessor::process_get_serde; + processMap_["get_lock_materialization_rebuild"] = &ThriftHiveMetastoreProcessor::process_get_lock_materialization_rebuild; + processMap_["heartbeat_lock_materialization_rebuild"] = &ThriftHiveMetastoreProcessor::process_heartbeat_lock_materialization_rebuild; + processMap_["add_runtime_stats"] = &ThriftHiveMetastoreProcessor::process_add_runtime_stats; + processMap_["get_runtime_stats"] = &ThriftHiveMetastoreProcessor::process_get_runtime_stats; + processMap_["get_partitions_with_specs"] = &ThriftHiveMetastoreProcessor::process_get_partitions_with_specs; + processMap_["scheduled_query_poll"] = &ThriftHiveMetastoreProcessor::process_scheduled_query_poll; + processMap_["scheduled_query_maintenance"] = &ThriftHiveMetastoreProcessor::process_scheduled_query_maintenance; + processMap_["scheduled_query_progress"] = &ThriftHiveMetastoreProcessor::process_scheduled_query_progress; + processMap_["get_scheduled_query"] = &ThriftHiveMetastoreProcessor::process_get_scheduled_query; + processMap_["add_replication_metrics"] = &ThriftHiveMetastoreProcessor::process_add_replication_metrics; + processMap_["get_replication_metrics"] = &ThriftHiveMetastoreProcessor::process_get_replication_metrics; + processMap_["get_open_txns_req"] = &ThriftHiveMetastoreProcessor::process_get_open_txns_req; + processMap_["create_stored_procedure"] = &ThriftHiveMetastoreProcessor::process_create_stored_procedure; + processMap_["get_stored_procedure"] = &ThriftHiveMetastoreProcessor::process_get_stored_procedure; + processMap_["drop_stored_procedure"] = &ThriftHiveMetastoreProcessor::process_drop_stored_procedure; + processMap_["get_all_stored_procedures"] = &ThriftHiveMetastoreProcessor::process_get_all_stored_procedures; + processMap_["find_package"] = &ThriftHiveMetastoreProcessor::process_find_package; + processMap_["add_package"] = &ThriftHiveMetastoreProcessor::process_add_package; + processMap_["get_all_packages"] = &ThriftHiveMetastoreProcessor::process_get_all_packages; + processMap_["drop_package"] = &ThriftHiveMetastoreProcessor::process_drop_package; + processMap_["get_all_write_event_info"] = &ThriftHiveMetastoreProcessor::process_get_all_write_event_info; + } + + virtual ~ThriftHiveMetastoreProcessor() {} +}; + +class ThriftHiveMetastoreProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + ThriftHiveMetastoreProcessorFactory(const ::std::shared_ptr< ThriftHiveMetastoreIfFactory >& handlerFactory) noexcept : + handlerFactory_(handlerFactory) {} + + ::std::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) override; + + protected: + ::std::shared_ptr< ThriftHiveMetastoreIfFactory > handlerFactory_; +}; + +class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, public ::facebook::fb303::FacebookServiceMultiface { + public: + ThriftHiveMetastoreMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + std::vector >::iterator iter; + for (iter = ifaces.begin(); iter != ifaces.end(); ++iter) { + ::facebook::fb303::FacebookServiceMultiface::add(*iter); + } + } + virtual ~ThriftHiveMetastoreMultiface() {} + protected: + std::vector > ifaces_; + ThriftHiveMetastoreMultiface() {} + void add(::std::shared_ptr iface) { + ::facebook::fb303::FacebookServiceMultiface::add(iface); + ifaces_.push_back(iface); + } + public: + void abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->abort_Compactions(_return, rqst); + } + ifaces_[i]->abort_Compactions(_return, rqst); + return; + } + + void getMetaConf(std::string& _return, const std::string& key) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getMetaConf(_return, key); + } + ifaces_[i]->getMetaConf(_return, key); + return; + } + + void setMetaConf(const std::string& key, const std::string& value) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->setMetaConf(key, value); + } + ifaces_[i]->setMetaConf(key, value); + } + + void create_catalog(const CreateCatalogRequest& catalog) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_catalog(catalog); + } + ifaces_[i]->create_catalog(catalog); + } + + void alter_catalog(const AlterCatalogRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_catalog(rqst); + } + ifaces_[i]->alter_catalog(rqst); + } + + void get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_catalog(_return, catName); + } + ifaces_[i]->get_catalog(_return, catName); + return; + } + + void get_catalogs(GetCatalogsResponse& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_catalogs(_return); + } + ifaces_[i]->get_catalogs(_return); + return; + } + + void drop_catalog(const DropCatalogRequest& catName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_catalog(catName); + } + ifaces_[i]->drop_catalog(catName); + } + + void create_database(const Database& database) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_database(database); + } + ifaces_[i]->create_database(database); + } + + void create_database_req(const CreateDatabaseRequest& createDatabaseRequest) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_database_req(createDatabaseRequest); + } + ifaces_[i]->create_database_req(createDatabaseRequest); + } + + void get_database(Database& _return, const std::string& name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_database(_return, name); + } + ifaces_[i]->get_database(_return, name); + return; + } + + void get_database_req(Database& _return, const GetDatabaseRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_database_req(_return, request); + } + ifaces_[i]->get_database_req(_return, request); + return; + } + + void drop_database(const std::string& name, const bool deleteData, const bool cascade) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_database(name, deleteData, cascade); + } + ifaces_[i]->drop_database(name, deleteData, cascade); + } + + void drop_database_req(const DropDatabaseRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_database_req(req); + } + ifaces_[i]->drop_database_req(req); + } + + void get_databases(std::vector & _return, const std::string& pattern) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_databases(_return, pattern); + } + ifaces_[i]->get_databases(_return, pattern); + return; + } + + void get_all_databases(std::vector & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_databases(_return); + } + ifaces_[i]->get_all_databases(_return); + return; + } + + void alter_database(const std::string& dbname, const Database& db) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_database(dbname, db); + } + ifaces_[i]->alter_database(dbname, db); + } + + void alter_database_req(const AlterDatabaseRequest& alterDbReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_database_req(alterDbReq); + } + ifaces_[i]->alter_database_req(alterDbReq); + } + + void create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_dataconnector_req(connectorReq); + } + ifaces_[i]->create_dataconnector_req(connectorReq); + } + + void get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_dataconnector_req(_return, request); + } + ifaces_[i]->get_dataconnector_req(_return, request); + return; + } + + void drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_dataconnector_req(dropDcReq); + } + ifaces_[i]->drop_dataconnector_req(dropDcReq); + } + + void get_dataconnectors(std::vector & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_dataconnectors(_return); + } + ifaces_[i]->get_dataconnectors(_return); + return; + } + + void alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_dataconnector_req(alterReq); + } + ifaces_[i]->alter_dataconnector_req(alterReq); + } + + void get_type(Type& _return, const std::string& name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_type(_return, name); + } + ifaces_[i]->get_type(_return, name); + return; + } + + bool create_type(const Type& type) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_type(type); + } + return ifaces_[i]->create_type(type); + } + + bool drop_type(const std::string& type) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_type(type); + } + return ifaces_[i]->drop_type(type); + } + + void get_type_all(std::map & _return, const std::string& name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_type_all(_return, name); + } + ifaces_[i]->get_type_all(_return, name); + return; + } + + void get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_fields(_return, db_name, table_name); + } + ifaces_[i]->get_fields(_return, db_name, table_name); + return; + } + + void get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_fields_with_environment_context(_return, db_name, table_name, environment_context); + } + ifaces_[i]->get_fields_with_environment_context(_return, db_name, table_name, environment_context); + return; + } + + void get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_fields_req(_return, req); + } + ifaces_[i]->get_fields_req(_return, req); + return; + } + + void get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema(_return, db_name, table_name); + } + ifaces_[i]->get_schema(_return, db_name, table_name); + return; + } + + void get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema_with_environment_context(_return, db_name, table_name, environment_context); + } + ifaces_[i]->get_schema_with_environment_context(_return, db_name, table_name, environment_context); + return; + } + + void get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema_req(_return, req); + } + ifaces_[i]->get_schema_req(_return, req); + return; + } + + void create_table(const Table& tbl) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_table(tbl); + } + ifaces_[i]->create_table(tbl); + } + + void create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_table_with_environment_context(tbl, environment_context); + } + ifaces_[i]->create_table_with_environment_context(tbl, environment_context); + } + + void create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_table_with_constraints(tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); + } + ifaces_[i]->create_table_with_constraints(tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); + } + + void create_table_req(const CreateTableRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_table_req(request); + } + ifaces_[i]->create_table_req(request); + } + + void drop_constraint(const DropConstraintRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_constraint(req); + } + ifaces_[i]->drop_constraint(req); + } + + void add_primary_key(const AddPrimaryKeyRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_primary_key(req); + } + ifaces_[i]->add_primary_key(req); + } + + void add_foreign_key(const AddForeignKeyRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_foreign_key(req); + } + ifaces_[i]->add_foreign_key(req); + } + + void add_unique_constraint(const AddUniqueConstraintRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_unique_constraint(req); + } + ifaces_[i]->add_unique_constraint(req); + } + + void add_not_null_constraint(const AddNotNullConstraintRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_not_null_constraint(req); + } + ifaces_[i]->add_not_null_constraint(req); + } + + void add_default_constraint(const AddDefaultConstraintRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_default_constraint(req); + } + ifaces_[i]->add_default_constraint(req); + } + + void add_check_constraint(const AddCheckConstraintRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_check_constraint(req); + } + ifaces_[i]->add_check_constraint(req); + } + + void translate_table_dryrun(Table& _return, const CreateTableRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->translate_table_dryrun(_return, request); + } + ifaces_[i]->translate_table_dryrun(_return, request); + return; + } + + void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_table(dbname, name, deleteData); + } + ifaces_[i]->drop_table(dbname, name, deleteData); + } + + void drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_table_with_environment_context(dbname, name, deleteData, environment_context); + } + ifaces_[i]->drop_table_with_environment_context(dbname, name, deleteData, environment_context); + } + + void drop_table_req(const DropTableRequest& dropTableReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_table_req(dropTableReq); + } + ifaces_[i]->drop_table_req(dropTableReq); + } + + void truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->truncate_table(dbName, tableName, partNames); + } + ifaces_[i]->truncate_table(dbName, tableName, partNames); + } + + void truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->truncate_table_req(_return, req); + } + ifaces_[i]->truncate_table_req(_return, req); + return; + } + + void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_tables(_return, db_name, pattern); + } + ifaces_[i]->get_tables(_return, db_name, pattern); + return; + } + + void get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_tables_by_type(_return, db_name, pattern, tableType); + } + ifaces_[i]->get_tables_by_type(_return, db_name, pattern, tableType); + return; + } + + void get_all_materialized_view_objects_for_rewriting(std::vector
& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_materialized_view_objects_for_rewriting(_return); + } + ifaces_[i]->get_all_materialized_view_objects_for_rewriting(_return); + return; + } + + void get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_materialized_views_for_rewriting(_return, db_name); + } + ifaces_[i]->get_materialized_views_for_rewriting(_return, db_name); + return; + } + + void get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_meta(_return, db_patterns, tbl_patterns, tbl_types); + } + ifaces_[i]->get_table_meta(_return, db_patterns, tbl_patterns, tbl_types); + return; + } + + void get_all_tables(std::vector & _return, const std::string& db_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_tables(_return, db_name); + } + ifaces_[i]->get_all_tables(_return, db_name); + return; + } + + void get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_tables_ext(_return, req); + } + ifaces_[i]->get_tables_ext(_return, req); + return; + } + + void get_table_req(GetTableResult& _return, const GetTableRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_req(_return, req); + } + ifaces_[i]->get_table_req(_return, req); + return; + } + + void get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_objects_by_name_req(_return, req); + } + ifaces_[i]->get_table_objects_by_name_req(_return, req); + return; + } + + void get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_materialization_invalidation_info(_return, creation_metadata, validTxnList); + } + ifaces_[i]->get_materialization_invalidation_info(_return, creation_metadata, validTxnList); + return; + } + + void update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_creation_metadata(catName, dbname, tbl_name, creation_metadata); + } + ifaces_[i]->update_creation_metadata(catName, dbname, tbl_name, creation_metadata); + } + + void get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_names_by_filter(_return, dbname, filter, max_tables); + } + ifaces_[i]->get_table_names_by_filter(_return, dbname, filter, max_tables); + return; + } + + void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_table(dbname, tbl_name, new_tbl); + } + ifaces_[i]->alter_table(dbname, tbl_name, new_tbl); + } + + void alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_table_with_environment_context(dbname, tbl_name, new_tbl, environment_context); + } + ifaces_[i]->alter_table_with_environment_context(dbname, tbl_name, new_tbl, environment_context); + } + + void alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_table_with_cascade(dbname, tbl_name, new_tbl, cascade); + } + ifaces_[i]->alter_table_with_cascade(dbname, tbl_name, new_tbl, cascade); + } + + void alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_table_req(_return, req); + } + ifaces_[i]->alter_table_req(_return, req); + return; + } + + void add_partition(Partition& _return, const Partition& new_part) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_partition(_return, new_part); + } + ifaces_[i]->add_partition(_return, new_part); + return; + } + + void add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_partition_with_environment_context(_return, new_part, environment_context); + } + ifaces_[i]->add_partition_with_environment_context(_return, new_part, environment_context); + return; + } + + int32_t add_partitions(const std::vector & new_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_partitions(new_parts); + } + return ifaces_[i]->add_partitions(new_parts); + } + + int32_t add_partitions_pspec(const std::vector & new_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_partitions_pspec(new_parts); + } + return ifaces_[i]->add_partitions_pspec(new_parts); + } + + void append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->append_partition(_return, db_name, tbl_name, part_vals); + } + ifaces_[i]->append_partition(_return, db_name, tbl_name, part_vals); + return; + } + + void add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_partitions_req(_return, request); + } + ifaces_[i]->add_partitions_req(_return, request); + return; + } + + void append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->append_partition_with_environment_context(_return, db_name, tbl_name, part_vals, environment_context); + } + ifaces_[i]->append_partition_with_environment_context(_return, db_name, tbl_name, part_vals, environment_context); + return; + } + + void append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->append_partition_req(_return, appendPartitionsReq); + } + ifaces_[i]->append_partition_req(_return, appendPartitionsReq); + return; + } + + void append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->append_partition_by_name(_return, db_name, tbl_name, part_name); + } + ifaces_[i]->append_partition_by_name(_return, db_name, tbl_name, part_name); + return; + } + + void append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->append_partition_by_name_with_environment_context(_return, db_name, tbl_name, part_name, environment_context); + } + ifaces_[i]->append_partition_by_name_with_environment_context(_return, db_name, tbl_name, part_name, environment_context); + return; + } + + bool drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partition(db_name, tbl_name, part_vals, deleteData); + } + return ifaces_[i]->drop_partition(db_name, tbl_name, part_vals, deleteData); + } + + bool drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partition_with_environment_context(db_name, tbl_name, part_vals, deleteData, environment_context); + } + return ifaces_[i]->drop_partition_with_environment_context(db_name, tbl_name, part_vals, deleteData, environment_context); + } + + bool drop_partition_req(const DropPartitionRequest& dropPartitionReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partition_req(dropPartitionReq); + } + return ifaces_[i]->drop_partition_req(dropPartitionReq); + } + + bool drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partition_by_name(db_name, tbl_name, part_name, deleteData); + } + return ifaces_[i]->drop_partition_by_name(db_name, tbl_name, part_name, deleteData); + } + + bool drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context); + } + return ifaces_[i]->drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context); + } + + void drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_partitions_req(_return, req); + } + ifaces_[i]->drop_partitions_req(_return, req); + return; + } + + void get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition(_return, db_name, tbl_name, part_vals); + } + ifaces_[i]->get_partition(_return, db_name, tbl_name, part_vals); + return; + } + + void get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_req(_return, req); + } + ifaces_[i]->get_partition_req(_return, req); + return; + } + + void exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->exchange_partition(_return, partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + } + ifaces_[i]->exchange_partition(_return, partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + return; + } + + void exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->exchange_partitions(_return, partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + } + ifaces_[i]->exchange_partitions(_return, partitionSpecs, source_db, source_table_name, dest_db, dest_table_name); + return; + } + + void get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_with_auth(_return, db_name, tbl_name, part_vals, user_name, group_names); + } + ifaces_[i]->get_partition_with_auth(_return, db_name, tbl_name, part_vals, user_name, group_names); + return; + } + + void get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_by_name(_return, db_name, tbl_name, part_name); + } + ifaces_[i]->get_partition_by_name(_return, db_name, tbl_name, part_name); + return; + } + + void get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions(_return, db_name, tbl_name, max_parts); + } + ifaces_[i]->get_partitions(_return, db_name, tbl_name, max_parts); + return; + } + + void get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_req(_return, req); + } + ifaces_[i]->get_partitions_req(_return, req); + return; + } + + void get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_with_auth(_return, db_name, tbl_name, max_parts, user_name, group_names); + } + ifaces_[i]->get_partitions_with_auth(_return, db_name, tbl_name, max_parts, user_name, group_names); + return; + } + + void get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_pspec(_return, db_name, tbl_name, max_parts); + } + ifaces_[i]->get_partitions_pspec(_return, db_name, tbl_name, max_parts); + return; + } + + void get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_names(_return, db_name, tbl_name, max_parts); + } + ifaces_[i]->get_partition_names(_return, db_name, tbl_name, max_parts); + return; + } + + void fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->fetch_partition_names_req(_return, partitionReq); + } + ifaces_[i]->fetch_partition_names_req(_return, partitionReq); + return; + } + + void get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_values(_return, request); + } + ifaces_[i]->get_partition_values(_return, request); + return; + } + + void get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_ps(_return, db_name, tbl_name, part_vals, max_parts); + } + ifaces_[i]->get_partitions_ps(_return, db_name, tbl_name, part_vals, max_parts); + return; + } + + void get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_ps_with_auth(_return, db_name, tbl_name, part_vals, max_parts, user_name, group_names); + } + ifaces_[i]->get_partitions_ps_with_auth(_return, db_name, tbl_name, part_vals, max_parts, user_name, group_names); + return; + } + + void get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_ps_with_auth_req(_return, req); + } + ifaces_[i]->get_partitions_ps_with_auth_req(_return, req); + return; + } + + void get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_names_ps(_return, db_name, tbl_name, part_vals, max_parts); + } + ifaces_[i]->get_partition_names_ps(_return, db_name, tbl_name, part_vals, max_parts); + return; + } + + void get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_names_ps_req(_return, req); + } + ifaces_[i]->get_partition_names_ps_req(_return, req); + return; + } + + void get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_names_req(_return, req); + } + ifaces_[i]->get_partition_names_req(_return, req); + return; + } + + void get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_by_filter(_return, db_name, tbl_name, filter, max_parts); + } + ifaces_[i]->get_partitions_by_filter(_return, db_name, tbl_name, filter, max_parts); + return; + } + + void get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_by_filter_req(_return, req); + } + ifaces_[i]->get_partitions_by_filter_req(_return, req); + return; + } + + void get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_part_specs_by_filter(_return, db_name, tbl_name, filter, max_parts); + } + ifaces_[i]->get_part_specs_by_filter(_return, db_name, tbl_name, filter, max_parts); + return; + } + + void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_by_expr(_return, req); + } + ifaces_[i]->get_partitions_by_expr(_return, req); + return; + } + + void get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_spec_by_expr(_return, req); + } + ifaces_[i]->get_partitions_spec_by_expr(_return, req); + return; + } + + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_num_partitions_by_filter(db_name, tbl_name, filter); + } + return ifaces_[i]->get_num_partitions_by_filter(db_name, tbl_name, filter); + } + + void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_by_names(_return, db_name, tbl_name, names); + } + ifaces_[i]->get_partitions_by_names(_return, db_name, tbl_name, names); + return; + } + + void get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_by_names_req(_return, req); + } + ifaces_[i]->get_partitions_by_names_req(_return, req); + return; + } + + void get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_properties(_return, req); + } + ifaces_[i]->get_properties(_return, req); + return; + } + + bool set_properties(const PropertySetRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->set_properties(req); + } + return ifaces_[i]->set_properties(req); + } + + void alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_partition(db_name, tbl_name, new_part); + } + ifaces_[i]->alter_partition(db_name, tbl_name, new_part); + } + + void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_partitions(db_name, tbl_name, new_parts); + } + ifaces_[i]->alter_partitions(db_name, tbl_name, new_parts); + } + + void alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context); + } + ifaces_[i]->alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context); + } + + void alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_partitions_req(_return, req); + } + ifaces_[i]->alter_partitions_req(_return, req); + return; + } + + void alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context); + } + ifaces_[i]->alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context); + } + + void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->rename_partition(db_name, tbl_name, part_vals, new_part); + } + ifaces_[i]->rename_partition(db_name, tbl_name, part_vals, new_part); + } + + void rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->rename_partition_req(_return, req); + } + ifaces_[i]->rename_partition_req(_return, req); + return; + } + + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->partition_name_has_valid_characters(part_vals, throw_exception); + } + return ifaces_[i]->partition_name_has_valid_characters(part_vals, throw_exception); + } + + void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_config_value(_return, name, defaultValue); + } + ifaces_[i]->get_config_value(_return, name, defaultValue); + return; + } + + void partition_name_to_vals(std::vector & _return, const std::string& part_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->partition_name_to_vals(_return, part_name); + } + ifaces_[i]->partition_name_to_vals(_return, part_name); + return; + } + + void partition_name_to_spec(std::map & _return, const std::string& part_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->partition_name_to_spec(_return, part_name); + } + ifaces_[i]->partition_name_to_spec(_return, part_name); + return; + } + + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + } + ifaces_[i]->markPartitionForEvent(db_name, tbl_name, part_vals, eventType); + } + + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + } + return ifaces_[i]->isPartitionMarkedForEvent(db_name, tbl_name, part_vals, eventType); + } + + void get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_primary_keys(_return, request); + } + ifaces_[i]->get_primary_keys(_return, request); + return; + } + + void get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_foreign_keys(_return, request); + } + ifaces_[i]->get_foreign_keys(_return, request); + return; + } + + void get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_unique_constraints(_return, request); + } + ifaces_[i]->get_unique_constraints(_return, request); + return; + } + + void get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_not_null_constraints(_return, request); + } + ifaces_[i]->get_not_null_constraints(_return, request); + return; + } + + void get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_default_constraints(_return, request); + } + ifaces_[i]->get_default_constraints(_return, request); + return; + } + + void get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_check_constraints(_return, request); + } + ifaces_[i]->get_check_constraints(_return, request); + return; + } + + void get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_table_constraints(_return, request); + } + ifaces_[i]->get_all_table_constraints(_return, request); + return; + } + + bool update_table_column_statistics(const ColumnStatistics& stats_obj) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_table_column_statistics(stats_obj); + } + return ifaces_[i]->update_table_column_statistics(stats_obj); + } + + bool update_partition_column_statistics(const ColumnStatistics& stats_obj) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_partition_column_statistics(stats_obj); + } + return ifaces_[i]->update_partition_column_statistics(stats_obj); + } + + void update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_table_column_statistics_req(_return, req); + } + ifaces_[i]->update_table_column_statistics_req(_return, req); + return; + } + + void update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_partition_column_statistics_req(_return, req); + } + ifaces_[i]->update_partition_column_statistics_req(_return, req); + return; + } + + void update_transaction_statistics(const UpdateTransactionalStatsRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_transaction_statistics(req); + } + ifaces_[i]->update_transaction_statistics(req); + } + + void get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_column_statistics(_return, db_name, tbl_name, col_name); + } + ifaces_[i]->get_table_column_statistics(_return, db_name, tbl_name, col_name); + return; + } + + void get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partition_column_statistics(_return, db_name, tbl_name, part_name, col_name); + } + ifaces_[i]->get_partition_column_statistics(_return, db_name, tbl_name, part_name, col_name); + return; + } + + void get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_table_statistics_req(_return, request); + } + ifaces_[i]->get_table_statistics_req(_return, request); + return; + } + + void get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_statistics_req(_return, request); + } + ifaces_[i]->get_partitions_statistics_req(_return, request); + return; + } + + void get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_aggr_stats_for(_return, request); + } + ifaces_[i]->get_aggr_stats_for(_return, request); + return; + } + + bool set_aggr_stats_for(const SetPartitionsStatsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->set_aggr_stats_for(request); + } + return ifaces_[i]->set_aggr_stats_for(request); + } + + bool delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->delete_partition_column_statistics(db_name, tbl_name, part_name, col_name, engine); + } + return ifaces_[i]->delete_partition_column_statistics(db_name, tbl_name, part_name, col_name, engine); + } + + bool delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->delete_table_column_statistics(db_name, tbl_name, col_name, engine); + } + return ifaces_[i]->delete_table_column_statistics(db_name, tbl_name, col_name, engine); + } + + void create_function(const Function& func) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_function(func); + } + ifaces_[i]->create_function(func); + } + + void drop_function(const std::string& dbName, const std::string& funcName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_function(dbName, funcName); + } + ifaces_[i]->drop_function(dbName, funcName); + } + + void alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_function(dbName, funcName, newFunc); + } + ifaces_[i]->alter_function(dbName, funcName, newFunc); + } + + void get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_functions(_return, dbName, pattern); + } + ifaces_[i]->get_functions(_return, dbName, pattern); + return; + } + + void get_function(Function& _return, const std::string& dbName, const std::string& funcName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_function(_return, dbName, funcName); + } + ifaces_[i]->get_function(_return, dbName, funcName); + return; + } + + void get_all_functions(GetAllFunctionsResponse& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_functions(_return); + } + ifaces_[i]->get_all_functions(_return); + return; + } + + bool create_role(const Role& role) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_role(role); + } + return ifaces_[i]->create_role(role); + } + + bool drop_role(const std::string& role_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_role(role_name); + } + return ifaces_[i]->drop_role(role_name); + } + + void get_role_names(std::vector & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_role_names(_return); + } + ifaces_[i]->get_role_names(_return); + return; + } + + bool grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); + } + return ifaces_[i]->grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option); + } + + bool revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->revoke_role(role_name, principal_name, principal_type); + } + return ifaces_[i]->revoke_role(role_name, principal_name, principal_type); + } + + void list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->list_roles(_return, principal_name, principal_type); + } + ifaces_[i]->list_roles(_return, principal_name, principal_type); + return; + } + + void grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->grant_revoke_role(_return, request); + } + ifaces_[i]->grant_revoke_role(_return, request); + return; + } + + void get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_principals_in_role(_return, request); + } + ifaces_[i]->get_principals_in_role(_return, request); + return; + } + + void get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_role_grants_for_principal(_return, request); + } + ifaces_[i]->get_role_grants_for_principal(_return, request); + return; + } + + void get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_privilege_set(_return, hiveObject, user_name, group_names); + } + ifaces_[i]->get_privilege_set(_return, hiveObject, user_name, group_names); + return; + } + + void list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->list_privileges(_return, principal_name, principal_type, hiveObject); + } + ifaces_[i]->list_privileges(_return, principal_name, principal_type, hiveObject); + return; + } + + bool grant_privileges(const PrivilegeBag& privileges) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->grant_privileges(privileges); + } + return ifaces_[i]->grant_privileges(privileges); + } + + bool revoke_privileges(const PrivilegeBag& privileges) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->revoke_privileges(privileges); + } + return ifaces_[i]->revoke_privileges(privileges); + } + + void grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->grant_revoke_privileges(_return, request); + } + ifaces_[i]->grant_revoke_privileges(_return, request); + return; + } + + void refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->refresh_privileges(_return, objToRefresh, authorizer, grantRequest); + } + ifaces_[i]->refresh_privileges(_return, objToRefresh, authorizer, grantRequest); + return; + } + + void set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->set_ugi(_return, user_name, group_names); + } + ifaces_[i]->set_ugi(_return, user_name, group_names); + return; + } + + void get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_delegation_token(_return, token_owner, renewer_kerberos_principal_name); + } + ifaces_[i]->get_delegation_token(_return, token_owner, renewer_kerberos_principal_name); + return; + } + + int64_t renew_delegation_token(const std::string& token_str_form) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->renew_delegation_token(token_str_form); + } + return ifaces_[i]->renew_delegation_token(token_str_form); + } + + void cancel_delegation_token(const std::string& token_str_form) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->cancel_delegation_token(token_str_form); + } + ifaces_[i]->cancel_delegation_token(token_str_form); + } + + bool add_token(const std::string& token_identifier, const std::string& delegation_token) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_token(token_identifier, delegation_token); + } + return ifaces_[i]->add_token(token_identifier, delegation_token); + } + + bool remove_token(const std::string& token_identifier) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->remove_token(token_identifier); + } + return ifaces_[i]->remove_token(token_identifier); + } + + void get_token(std::string& _return, const std::string& token_identifier) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_token(_return, token_identifier); + } + ifaces_[i]->get_token(_return, token_identifier); + return; + } + + void get_all_token_identifiers(std::vector & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_token_identifiers(_return); + } + ifaces_[i]->get_all_token_identifiers(_return); + return; + } + + int32_t add_master_key(const std::string& key) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_master_key(key); + } + return ifaces_[i]->add_master_key(key); + } + + void update_master_key(const int32_t seq_number, const std::string& key) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_master_key(seq_number, key); + } + ifaces_[i]->update_master_key(seq_number, key); + } + + bool remove_master_key(const int32_t key_seq) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->remove_master_key(key_seq); + } + return ifaces_[i]->remove_master_key(key_seq); + } + + void get_master_keys(std::vector & _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_master_keys(_return); + } + ifaces_[i]->get_master_keys(_return); + return; + } + + void get_open_txns(GetOpenTxnsResponse& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_open_txns(_return); + } + ifaces_[i]->get_open_txns(_return); + return; + } + + void get_open_txns_info(GetOpenTxnsInfoResponse& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_open_txns_info(_return); + } + ifaces_[i]->get_open_txns_info(_return); + return; + } + + void open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->open_txns(_return, rqst); + } + ifaces_[i]->open_txns(_return, rqst); + return; + } + + void abort_txn(const AbortTxnRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->abort_txn(rqst); + } + ifaces_[i]->abort_txn(rqst); + } + + void abort_txns(const AbortTxnsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->abort_txns(rqst); + } + ifaces_[i]->abort_txns(rqst); + } + + void commit_txn(const CommitTxnRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->commit_txn(rqst); + } + ifaces_[i]->commit_txn(rqst); + } + + int64_t get_latest_txnid_in_conflict(const int64_t txnId) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_latest_txnid_in_conflict(txnId); + } + return ifaces_[i]->get_latest_txnid_in_conflict(txnId); + } + + void repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->repl_tbl_writeid_state(rqst); + } + ifaces_[i]->repl_tbl_writeid_state(rqst); + } + + void get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_valid_write_ids(_return, rqst); + } + ifaces_[i]->get_valid_write_ids(_return, rqst); + return; + } + + void add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_write_ids_to_min_history(txnId, writeIds); + } + ifaces_[i]->add_write_ids_to_min_history(txnId, writeIds); + } + + void allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->allocate_table_write_ids(_return, rqst); + } + ifaces_[i]->allocate_table_write_ids(_return, rqst); + return; + } + + void get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_max_allocated_table_write_id(_return, rqst); + } + ifaces_[i]->get_max_allocated_table_write_id(_return, rqst); + return; + } + + void seed_write_id(const SeedTableWriteIdsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->seed_write_id(rqst); + } + ifaces_[i]->seed_write_id(rqst); + } + + void seed_txn_id(const SeedTxnIdRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->seed_txn_id(rqst); + } + ifaces_[i]->seed_txn_id(rqst); + } + + void lock(LockResponse& _return, const LockRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->lock(_return, rqst); + } + ifaces_[i]->lock(_return, rqst); + return; + } + + void check_lock(LockResponse& _return, const CheckLockRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->check_lock(_return, rqst); + } + ifaces_[i]->check_lock(_return, rqst); + return; + } + + void unlock(const UnlockRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->unlock(rqst); + } + ifaces_[i]->unlock(rqst); + } + + void show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->show_locks(_return, rqst); + } + ifaces_[i]->show_locks(_return, rqst); + return; + } + + void heartbeat(const HeartbeatRequest& ids) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->heartbeat(ids); + } + ifaces_[i]->heartbeat(ids); + } + + void heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->heartbeat_txn_range(_return, txns); + } + ifaces_[i]->heartbeat_txn_range(_return, txns); + return; + } + + void compact(const CompactionRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->compact(rqst); + } + ifaces_[i]->compact(rqst); + } + + void compact2(CompactionResponse& _return, const CompactionRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->compact2(_return, rqst); + } + ifaces_[i]->compact2(_return, rqst); + return; + } + + void show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->show_compact(_return, rqst); + } + ifaces_[i]->show_compact(_return, rqst); + return; + } + + bool submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->submit_for_cleanup(o1, o2, o3); + } + return ifaces_[i]->submit_for_cleanup(o1, o2, o3); + } + + void add_dynamic_partitions(const AddDynamicPartitions& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_dynamic_partitions(rqst); + } + ifaces_[i]->add_dynamic_partitions(rqst); + } + + void find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->find_next_compact(_return, workerId); + } + ifaces_[i]->find_next_compact(_return, workerId); + return; + } + + void find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->find_next_compact2(_return, rqst); + } + ifaces_[i]->find_next_compact2(_return, rqst); + return; + } + + void update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_compactor_state(cr, txn_id); + } + ifaces_[i]->update_compactor_state(cr, txn_id); + } + + void find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->find_columns_with_stats(_return, cr); + } + ifaces_[i]->find_columns_with_stats(_return, cr); + return; + } + + void mark_cleaned(const CompactionInfoStruct& cr) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->mark_cleaned(cr); + } + ifaces_[i]->mark_cleaned(cr); + } + + void mark_compacted(const CompactionInfoStruct& cr) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->mark_compacted(cr); + } + ifaces_[i]->mark_compacted(cr); + } + + void mark_failed(const CompactionInfoStruct& cr) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->mark_failed(cr); + } + ifaces_[i]->mark_failed(cr); + } + + void mark_refused(const CompactionInfoStruct& cr) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->mark_refused(cr); + } + ifaces_[i]->mark_refused(cr); + } + + bool update_compaction_metrics_data(const CompactionMetricsDataStruct& data) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->update_compaction_metrics_data(data); + } + return ifaces_[i]->update_compaction_metrics_data(data); + } + + void remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->remove_compaction_metrics_data(request); + } + ifaces_[i]->remove_compaction_metrics_data(request); + } + + void set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->set_hadoop_jobid(jobId, cq_id); + } + ifaces_[i]->set_hadoop_jobid(jobId, cq_id); + } + + void get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_latest_committed_compaction_info(_return, rqst); + } + ifaces_[i]->get_latest_committed_compaction_info(_return, rqst); + return; + } + + void get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_next_notification(_return, rqst); + } + ifaces_[i]->get_next_notification(_return, rqst); + return; + } + + void get_current_notificationEventId(CurrentNotificationEventId& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_current_notificationEventId(_return); + } + ifaces_[i]->get_current_notificationEventId(_return); + return; + } + + void get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_notification_events_count(_return, rqst); + } + ifaces_[i]->get_notification_events_count(_return, rqst); + return; + } + + void fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->fire_listener_event(_return, rqst); + } + ifaces_[i]->fire_listener_event(_return, rqst); + return; + } + + void flushCache() override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->flushCache(); + } + ifaces_[i]->flushCache(); + } + + void add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_write_notification_log(_return, rqst); + } + ifaces_[i]->add_write_notification_log(_return, rqst); + return; + } + + void add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_write_notification_log_in_batch(_return, rqst); + } + ifaces_[i]->add_write_notification_log_in_batch(_return, rqst); + return; + } + + void cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->cm_recycle(_return, request); + } + ifaces_[i]->cm_recycle(_return, request); + return; + } + + void get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_file_metadata_by_expr(_return, req); + } + ifaces_[i]->get_file_metadata_by_expr(_return, req); + return; + } + + void get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_file_metadata(_return, req); + } + ifaces_[i]->get_file_metadata(_return, req); + return; + } + + void put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->put_file_metadata(_return, req); + } + ifaces_[i]->put_file_metadata(_return, req); + return; + } + + void clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->clear_file_metadata(_return, req); + } + ifaces_[i]->clear_file_metadata(_return, req); + return; + } + + void cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->cache_file_metadata(_return, req); + } + ifaces_[i]->cache_file_metadata(_return, req); + return; + } + + void get_metastore_db_uuid(std::string& _return) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_metastore_db_uuid(_return); + } + ifaces_[i]->get_metastore_db_uuid(_return); + return; + } + + void create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_resource_plan(_return, request); + } + ifaces_[i]->create_resource_plan(_return, request); + return; + } + + void get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_resource_plan(_return, request); + } + ifaces_[i]->get_resource_plan(_return, request); + return; + } + + void get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_active_resource_plan(_return, request); + } + ifaces_[i]->get_active_resource_plan(_return, request); + return; + } + + void get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_resource_plans(_return, request); + } + ifaces_[i]->get_all_resource_plans(_return, request); + return; + } + + void alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_resource_plan(_return, request); + } + ifaces_[i]->alter_resource_plan(_return, request); + return; + } + + void validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->validate_resource_plan(_return, request); + } + ifaces_[i]->validate_resource_plan(_return, request); + return; + } + + void drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_resource_plan(_return, request); + } + ifaces_[i]->drop_resource_plan(_return, request); + return; + } + + void create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_wm_trigger(_return, request); + } + ifaces_[i]->create_wm_trigger(_return, request); + return; + } + + void alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_wm_trigger(_return, request); + } + ifaces_[i]->alter_wm_trigger(_return, request); + return; + } + + void drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_wm_trigger(_return, request); + } + ifaces_[i]->drop_wm_trigger(_return, request); + return; + } + + void get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_triggers_for_resourceplan(_return, request); + } + ifaces_[i]->get_triggers_for_resourceplan(_return, request); + return; + } + + void create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_wm_pool(_return, request); + } + ifaces_[i]->create_wm_pool(_return, request); + return; + } + + void alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_wm_pool(_return, request); + } + ifaces_[i]->alter_wm_pool(_return, request); + return; + } + + void drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_wm_pool(_return, request); + } + ifaces_[i]->drop_wm_pool(_return, request); + return; + } + + void create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_or_update_wm_mapping(_return, request); + } + ifaces_[i]->create_or_update_wm_mapping(_return, request); + return; + } + + void drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_wm_mapping(_return, request); + } + ifaces_[i]->drop_wm_mapping(_return, request); + return; + } + + void create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_or_drop_wm_trigger_to_pool_mapping(_return, request); + } + ifaces_[i]->create_or_drop_wm_trigger_to_pool_mapping(_return, request); + return; + } + + void create_ischema(const ISchema& schema) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_ischema(schema); + } + ifaces_[i]->create_ischema(schema); + } + + void alter_ischema(const AlterISchemaRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->alter_ischema(rqst); + } + ifaces_[i]->alter_ischema(rqst); + } + + void get_ischema(ISchema& _return, const ISchemaName& name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_ischema(_return, name); + } + ifaces_[i]->get_ischema(_return, name); + return; + } + + void drop_ischema(const ISchemaName& name) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_ischema(name); + } + ifaces_[i]->drop_ischema(name); + } + + void add_schema_version(const SchemaVersion& schemaVersion) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_schema_version(schemaVersion); + } + ifaces_[i]->add_schema_version(schemaVersion); + } + + void get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema_version(_return, schemaVersion); + } + ifaces_[i]->get_schema_version(_return, schemaVersion); + return; + } + + void get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema_latest_version(_return, schemaName); + } + ifaces_[i]->get_schema_latest_version(_return, schemaName); + return; + } + + void get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schema_all_versions(_return, schemaName); + } + ifaces_[i]->get_schema_all_versions(_return, schemaName); + return; + } + + void drop_schema_version(const SchemaVersionDescriptor& schemaVersion) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_schema_version(schemaVersion); + } + ifaces_[i]->drop_schema_version(schemaVersion); + } + + void get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_schemas_by_cols(_return, rqst); + } + ifaces_[i]->get_schemas_by_cols(_return, rqst); + return; + } + + void map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->map_schema_version_to_serde(rqst); + } + ifaces_[i]->map_schema_version_to_serde(rqst); + } + + void set_schema_version_state(const SetSchemaVersionStateRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->set_schema_version_state(rqst); + } + ifaces_[i]->set_schema_version_state(rqst); + } + + void add_serde(const SerDeInfo& serde) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_serde(serde); + } + ifaces_[i]->add_serde(serde); + } + + void get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_serde(_return, rqst); + } + ifaces_[i]->get_serde(_return, rqst); + return; + } + + void get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_lock_materialization_rebuild(_return, dbName, tableName, txnId); + } + ifaces_[i]->get_lock_materialization_rebuild(_return, dbName, tableName, txnId); + return; + } + + bool heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->heartbeat_lock_materialization_rebuild(dbName, tableName, txnId); + } + return ifaces_[i]->heartbeat_lock_materialization_rebuild(dbName, tableName, txnId); + } + + void add_runtime_stats(const RuntimeStat& stat) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_runtime_stats(stat); + } + ifaces_[i]->add_runtime_stats(stat); + } + + void get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_runtime_stats(_return, rqst); + } + ifaces_[i]->get_runtime_stats(_return, rqst); + return; + } + + void get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_partitions_with_specs(_return, request); + } + ifaces_[i]->get_partitions_with_specs(_return, request); + return; + } + + void scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->scheduled_query_poll(_return, request); + } + ifaces_[i]->scheduled_query_poll(_return, request); + return; + } + + void scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->scheduled_query_maintenance(request); + } + ifaces_[i]->scheduled_query_maintenance(request); + } + + void scheduled_query_progress(const ScheduledQueryProgressInfo& info) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->scheduled_query_progress(info); + } + ifaces_[i]->scheduled_query_progress(info); + } + + void get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_scheduled_query(_return, scheduleKey); + } + ifaces_[i]->get_scheduled_query(_return, scheduleKey); + return; + } + + void add_replication_metrics(const ReplicationMetricList& replicationMetricList) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_replication_metrics(replicationMetricList); + } + ifaces_[i]->add_replication_metrics(replicationMetricList); + } + + void get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_replication_metrics(_return, rqst); + } + ifaces_[i]->get_replication_metrics(_return, rqst); + return; + } + + void get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_open_txns_req(_return, getOpenTxnsRequest); + } + ifaces_[i]->get_open_txns_req(_return, getOpenTxnsRequest); + return; + } + + void create_stored_procedure(const StoredProcedure& proc) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->create_stored_procedure(proc); + } + ifaces_[i]->create_stored_procedure(proc); + } + + void get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_stored_procedure(_return, request); + } + ifaces_[i]->get_stored_procedure(_return, request); + return; + } + + void drop_stored_procedure(const StoredProcedureRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_stored_procedure(request); + } + ifaces_[i]->drop_stored_procedure(request); + } + + void get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_stored_procedures(_return, request); + } + ifaces_[i]->get_all_stored_procedures(_return, request); + return; + } + + void find_package(Package& _return, const GetPackageRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->find_package(_return, request); + } + ifaces_[i]->find_package(_return, request); + return; + } + + void add_package(const AddPackageRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->add_package(request); + } + ifaces_[i]->add_package(request); + } + + void get_all_packages(std::vector & _return, const ListPackageRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_packages(_return, request); + } + ifaces_[i]->get_all_packages(_return, request); + return; + } + + void drop_package(const DropPackageRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->drop_package(request); + } + ifaces_[i]->drop_package(request); + } + + void get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) override { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_all_write_event_info(_return, request); + } + ifaces_[i]->get_all_write_event_info(_return, request); + return; + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class ThriftHiveMetastoreConcurrentClient : virtual public ThriftHiveMetastoreIf, public ::facebook::fb303::FacebookServiceConcurrentClient { + public: + ThriftHiveMetastoreConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> prot, std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync) : + ::facebook::fb303::FacebookServiceConcurrentClient(prot, prot, sync) {} + ThriftHiveMetastoreConcurrentClient(std::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, std::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot, std::shared_ptr< ::apache::thrift::async::TConcurrentClientSyncInfo> sync) : ::facebook::fb303::FacebookServiceConcurrentClient(iprot, oprot, sync) {} + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + std::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void abort_Compactions(AbortCompactResponse& _return, const AbortCompactionRequest& rqst) override; + int32_t send_abort_Compactions(const AbortCompactionRequest& rqst); + void recv_abort_Compactions(AbortCompactResponse& _return, const int32_t seqid); + void getMetaConf(std::string& _return, const std::string& key) override; + int32_t send_getMetaConf(const std::string& key); + void recv_getMetaConf(std::string& _return, const int32_t seqid); + void setMetaConf(const std::string& key, const std::string& value) override; + int32_t send_setMetaConf(const std::string& key, const std::string& value); + void recv_setMetaConf(const int32_t seqid); + void create_catalog(const CreateCatalogRequest& catalog) override; + int32_t send_create_catalog(const CreateCatalogRequest& catalog); + void recv_create_catalog(const int32_t seqid); + void alter_catalog(const AlterCatalogRequest& rqst) override; + int32_t send_alter_catalog(const AlterCatalogRequest& rqst); + void recv_alter_catalog(const int32_t seqid); + void get_catalog(GetCatalogResponse& _return, const GetCatalogRequest& catName) override; + int32_t send_get_catalog(const GetCatalogRequest& catName); + void recv_get_catalog(GetCatalogResponse& _return, const int32_t seqid); + void get_catalogs(GetCatalogsResponse& _return) override; + int32_t send_get_catalogs(); + void recv_get_catalogs(GetCatalogsResponse& _return, const int32_t seqid); + void drop_catalog(const DropCatalogRequest& catName) override; + int32_t send_drop_catalog(const DropCatalogRequest& catName); + void recv_drop_catalog(const int32_t seqid); + void create_database(const Database& database) override; + int32_t send_create_database(const Database& database); + void recv_create_database(const int32_t seqid); + void create_database_req(const CreateDatabaseRequest& createDatabaseRequest) override; + int32_t send_create_database_req(const CreateDatabaseRequest& createDatabaseRequest); + void recv_create_database_req(const int32_t seqid); + void get_database(Database& _return, const std::string& name) override; + int32_t send_get_database(const std::string& name); + void recv_get_database(Database& _return, const int32_t seqid); + void get_database_req(Database& _return, const GetDatabaseRequest& request) override; + int32_t send_get_database_req(const GetDatabaseRequest& request); + void recv_get_database_req(Database& _return, const int32_t seqid); + void drop_database(const std::string& name, const bool deleteData, const bool cascade) override; + int32_t send_drop_database(const std::string& name, const bool deleteData, const bool cascade); + void recv_drop_database(const int32_t seqid); + void drop_database_req(const DropDatabaseRequest& req) override; + int32_t send_drop_database_req(const DropDatabaseRequest& req); + void recv_drop_database_req(const int32_t seqid); + void get_databases(std::vector & _return, const std::string& pattern) override; + int32_t send_get_databases(const std::string& pattern); + void recv_get_databases(std::vector & _return, const int32_t seqid); + void get_all_databases(std::vector & _return) override; + int32_t send_get_all_databases(); + void recv_get_all_databases(std::vector & _return, const int32_t seqid); + void alter_database(const std::string& dbname, const Database& db) override; + int32_t send_alter_database(const std::string& dbname, const Database& db); + void recv_alter_database(const int32_t seqid); + void alter_database_req(const AlterDatabaseRequest& alterDbReq) override; + int32_t send_alter_database_req(const AlterDatabaseRequest& alterDbReq); + void recv_alter_database_req(const int32_t seqid); + void create_dataconnector_req(const CreateDataConnectorRequest& connectorReq) override; + int32_t send_create_dataconnector_req(const CreateDataConnectorRequest& connectorReq); + void recv_create_dataconnector_req(const int32_t seqid); + void get_dataconnector_req(DataConnector& _return, const GetDataConnectorRequest& request) override; + int32_t send_get_dataconnector_req(const GetDataConnectorRequest& request); + void recv_get_dataconnector_req(DataConnector& _return, const int32_t seqid); + void drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq) override; + int32_t send_drop_dataconnector_req(const DropDataConnectorRequest& dropDcReq); + void recv_drop_dataconnector_req(const int32_t seqid); + void get_dataconnectors(std::vector & _return) override; + int32_t send_get_dataconnectors(); + void recv_get_dataconnectors(std::vector & _return, const int32_t seqid); + void alter_dataconnector_req(const AlterDataConnectorRequest& alterReq) override; + int32_t send_alter_dataconnector_req(const AlterDataConnectorRequest& alterReq); + void recv_alter_dataconnector_req(const int32_t seqid); + void get_type(Type& _return, const std::string& name) override; + int32_t send_get_type(const std::string& name); + void recv_get_type(Type& _return, const int32_t seqid); + bool create_type(const Type& type) override; + int32_t send_create_type(const Type& type); + bool recv_create_type(const int32_t seqid); + bool drop_type(const std::string& type) override; + int32_t send_drop_type(const std::string& type); + bool recv_drop_type(const int32_t seqid); + void get_type_all(std::map & _return, const std::string& name) override; + int32_t send_get_type_all(const std::string& name); + void recv_get_type_all(std::map & _return, const int32_t seqid); + void get_fields(std::vector & _return, const std::string& db_name, const std::string& table_name) override; + int32_t send_get_fields(const std::string& db_name, const std::string& table_name); + void recv_get_fields(std::vector & _return, const int32_t seqid); + void get_fields_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override; + int32_t send_get_fields_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context); + void recv_get_fields_with_environment_context(std::vector & _return, const int32_t seqid); + void get_fields_req(GetFieldsResponse& _return, const GetFieldsRequest& req) override; + int32_t send_get_fields_req(const GetFieldsRequest& req); + void recv_get_fields_req(GetFieldsResponse& _return, const int32_t seqid); + void get_schema(std::vector & _return, const std::string& db_name, const std::string& table_name) override; + int32_t send_get_schema(const std::string& db_name, const std::string& table_name); + void recv_get_schema(std::vector & _return, const int32_t seqid); + void get_schema_with_environment_context(std::vector & _return, const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context) override; + int32_t send_get_schema_with_environment_context(const std::string& db_name, const std::string& table_name, const EnvironmentContext& environment_context); + void recv_get_schema_with_environment_context(std::vector & _return, const int32_t seqid); + void get_schema_req(GetSchemaResponse& _return, const GetSchemaRequest& req) override; + int32_t send_get_schema_req(const GetSchemaRequest& req); + void recv_get_schema_req(GetSchemaResponse& _return, const int32_t seqid); + void create_table(const Table& tbl) override; + int32_t send_create_table(const Table& tbl); + void recv_create_table(const int32_t seqid); + void create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context) override; + int32_t send_create_table_with_environment_context(const Table& tbl, const EnvironmentContext& environment_context); + void recv_create_table_with_environment_context(const int32_t seqid); + void create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints) override; + int32_t send_create_table_with_constraints(const Table& tbl, const std::vector & primaryKeys, const std::vector & foreignKeys, const std::vector & uniqueConstraints, const std::vector & notNullConstraints, const std::vector & defaultConstraints, const std::vector & checkConstraints); + void recv_create_table_with_constraints(const int32_t seqid); + void create_table_req(const CreateTableRequest& request) override; + int32_t send_create_table_req(const CreateTableRequest& request); + void recv_create_table_req(const int32_t seqid); + void drop_constraint(const DropConstraintRequest& req) override; + int32_t send_drop_constraint(const DropConstraintRequest& req); + void recv_drop_constraint(const int32_t seqid); + void add_primary_key(const AddPrimaryKeyRequest& req) override; + int32_t send_add_primary_key(const AddPrimaryKeyRequest& req); + void recv_add_primary_key(const int32_t seqid); + void add_foreign_key(const AddForeignKeyRequest& req) override; + int32_t send_add_foreign_key(const AddForeignKeyRequest& req); + void recv_add_foreign_key(const int32_t seqid); + void add_unique_constraint(const AddUniqueConstraintRequest& req) override; + int32_t send_add_unique_constraint(const AddUniqueConstraintRequest& req); + void recv_add_unique_constraint(const int32_t seqid); + void add_not_null_constraint(const AddNotNullConstraintRequest& req) override; + int32_t send_add_not_null_constraint(const AddNotNullConstraintRequest& req); + void recv_add_not_null_constraint(const int32_t seqid); + void add_default_constraint(const AddDefaultConstraintRequest& req) override; + int32_t send_add_default_constraint(const AddDefaultConstraintRequest& req); + void recv_add_default_constraint(const int32_t seqid); + void add_check_constraint(const AddCheckConstraintRequest& req) override; + int32_t send_add_check_constraint(const AddCheckConstraintRequest& req); + void recv_add_check_constraint(const int32_t seqid); + void translate_table_dryrun(Table& _return, const CreateTableRequest& request) override; + int32_t send_translate_table_dryrun(const CreateTableRequest& request); + void recv_translate_table_dryrun(Table& _return, const int32_t seqid); + void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) override; + int32_t send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData); + void recv_drop_table(const int32_t seqid); + void drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) override; + int32_t send_drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context); + void recv_drop_table_with_environment_context(const int32_t seqid); + void drop_table_req(const DropTableRequest& dropTableReq) override; + int32_t send_drop_table_req(const DropTableRequest& dropTableReq); + void recv_drop_table_req(const int32_t seqid); + void truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames) override; + int32_t send_truncate_table(const std::string& dbName, const std::string& tableName, const std::vector & partNames); + void recv_truncate_table(const int32_t seqid); + void truncate_table_req(TruncateTableResponse& _return, const TruncateTableRequest& req) override; + int32_t send_truncate_table_req(const TruncateTableRequest& req); + void recv_truncate_table_req(TruncateTableResponse& _return, const int32_t seqid); + void get_tables(std::vector & _return, const std::string& db_name, const std::string& pattern) override; + int32_t send_get_tables(const std::string& db_name, const std::string& pattern); + void recv_get_tables(std::vector & _return, const int32_t seqid); + void get_tables_by_type(std::vector & _return, const std::string& db_name, const std::string& pattern, const std::string& tableType) override; + int32_t send_get_tables_by_type(const std::string& db_name, const std::string& pattern, const std::string& tableType); + void recv_get_tables_by_type(std::vector & _return, const int32_t seqid); + void get_all_materialized_view_objects_for_rewriting(std::vector
& _return) override; + int32_t send_get_all_materialized_view_objects_for_rewriting(); + void recv_get_all_materialized_view_objects_for_rewriting(std::vector
& _return, const int32_t seqid); + void get_materialized_views_for_rewriting(std::vector & _return, const std::string& db_name) override; + int32_t send_get_materialized_views_for_rewriting(const std::string& db_name); + void recv_get_materialized_views_for_rewriting(std::vector & _return, const int32_t seqid); + void get_table_meta(std::vector & _return, const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types) override; + int32_t send_get_table_meta(const std::string& db_patterns, const std::string& tbl_patterns, const std::vector & tbl_types); + void recv_get_table_meta(std::vector & _return, const int32_t seqid); + void get_all_tables(std::vector & _return, const std::string& db_name) override; + int32_t send_get_all_tables(const std::string& db_name); + void recv_get_all_tables(std::vector & _return, const int32_t seqid); + void get_tables_ext(std::vector & _return, const GetTablesExtRequest& req) override; + int32_t send_get_tables_ext(const GetTablesExtRequest& req); + void recv_get_tables_ext(std::vector & _return, const int32_t seqid); + void get_table_req(GetTableResult& _return, const GetTableRequest& req) override; + int32_t send_get_table_req(const GetTableRequest& req); + void recv_get_table_req(GetTableResult& _return, const int32_t seqid); + void get_table_objects_by_name_req(GetTablesResult& _return, const GetTablesRequest& req) override; + int32_t send_get_table_objects_by_name_req(const GetTablesRequest& req); + void recv_get_table_objects_by_name_req(GetTablesResult& _return, const int32_t seqid); + void get_materialization_invalidation_info(Materialization& _return, const CreationMetadata& creation_metadata, const std::string& validTxnList) override; + int32_t send_get_materialization_invalidation_info(const CreationMetadata& creation_metadata, const std::string& validTxnList); + void recv_get_materialization_invalidation_info(Materialization& _return, const int32_t seqid); + void update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata) override; + int32_t send_update_creation_metadata(const std::string& catName, const std::string& dbname, const std::string& tbl_name, const CreationMetadata& creation_metadata); + void recv_update_creation_metadata(const int32_t seqid); + void get_table_names_by_filter(std::vector & _return, const std::string& dbname, const std::string& filter, const int16_t max_tables) override; + int32_t send_get_table_names_by_filter(const std::string& dbname, const std::string& filter, const int16_t max_tables); + void recv_get_table_names_by_filter(std::vector & _return, const int32_t seqid); + void alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl) override; + int32_t send_alter_table(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl); + void recv_alter_table(const int32_t seqid); + void alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context) override; + int32_t send_alter_table_with_environment_context(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const EnvironmentContext& environment_context); + void recv_alter_table_with_environment_context(const int32_t seqid); + void alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade) override; + int32_t send_alter_table_with_cascade(const std::string& dbname, const std::string& tbl_name, const Table& new_tbl, const bool cascade); + void recv_alter_table_with_cascade(const int32_t seqid); + void alter_table_req(AlterTableResponse& _return, const AlterTableRequest& req) override; + int32_t send_alter_table_req(const AlterTableRequest& req); + void recv_alter_table_req(AlterTableResponse& _return, const int32_t seqid); + void add_partition(Partition& _return, const Partition& new_part) override; + int32_t send_add_partition(const Partition& new_part); + void recv_add_partition(Partition& _return, const int32_t seqid); + void add_partition_with_environment_context(Partition& _return, const Partition& new_part, const EnvironmentContext& environment_context) override; + int32_t send_add_partition_with_environment_context(const Partition& new_part, const EnvironmentContext& environment_context); + void recv_add_partition_with_environment_context(Partition& _return, const int32_t seqid); + int32_t add_partitions(const std::vector & new_parts) override; + int32_t send_add_partitions(const std::vector & new_parts); + int32_t recv_add_partitions(const int32_t seqid); + int32_t add_partitions_pspec(const std::vector & new_parts) override; + int32_t send_add_partitions_pspec(const std::vector & new_parts); + int32_t recv_add_partitions_pspec(const int32_t seqid); + void append_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override; + int32_t send_append_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals); + void recv_append_partition(Partition& _return, const int32_t seqid); + void add_partitions_req(AddPartitionsResult& _return, const AddPartitionsRequest& request) override; + int32_t send_add_partitions_req(const AddPartitionsRequest& request); + void recv_add_partitions_req(AddPartitionsResult& _return, const int32_t seqid); + void append_partition_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context) override; + int32_t send_append_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const EnvironmentContext& environment_context); + void recv_append_partition_with_environment_context(Partition& _return, const int32_t seqid); + void append_partition_req(Partition& _return, const AppendPartitionsRequest& appendPartitionsReq) override; + int32_t send_append_partition_req(const AppendPartitionsRequest& appendPartitionsReq); + void recv_append_partition_req(Partition& _return, const int32_t seqid); + void append_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override; + int32_t send_append_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name); + void recv_append_partition_by_name(Partition& _return, const int32_t seqid); + void append_partition_by_name_with_environment_context(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context) override; + int32_t send_append_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const EnvironmentContext& environment_context); + void recv_append_partition_by_name_with_environment_context(Partition& _return, const int32_t seqid); + bool drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData) override; + int32_t send_drop_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData); + bool recv_drop_partition(const int32_t seqid); + bool drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context) override; + int32_t send_drop_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const bool deleteData, const EnvironmentContext& environment_context); + bool recv_drop_partition_with_environment_context(const int32_t seqid); + bool drop_partition_req(const DropPartitionRequest& dropPartitionReq) override; + int32_t send_drop_partition_req(const DropPartitionRequest& dropPartitionReq); + bool recv_drop_partition_req(const int32_t seqid); + bool drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData) override; + int32_t send_drop_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData); + bool recv_drop_partition_by_name(const int32_t seqid); + bool drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context) override; + int32_t send_drop_partition_by_name_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const bool deleteData, const EnvironmentContext& environment_context); + bool recv_drop_partition_by_name_with_environment_context(const int32_t seqid); + void drop_partitions_req(DropPartitionsResult& _return, const DropPartitionsRequest& req) override; + int32_t send_drop_partitions_req(const DropPartitionsRequest& req); + void recv_drop_partitions_req(DropPartitionsResult& _return, const int32_t seqid); + void get_partition(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals) override; + int32_t send_get_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals); + void recv_get_partition(Partition& _return, const int32_t seqid); + void get_partition_req(GetPartitionResponse& _return, const GetPartitionRequest& req) override; + int32_t send_get_partition_req(const GetPartitionRequest& req); + void recv_get_partition_req(GetPartitionResponse& _return, const int32_t seqid); + void exchange_partition(Partition& _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override; + int32_t send_exchange_partition(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name); + void recv_exchange_partition(Partition& _return, const int32_t seqid); + void exchange_partitions(std::vector & _return, const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name) override; + int32_t send_exchange_partitions(const std::map & partitionSpecs, const std::string& source_db, const std::string& source_table_name, const std::string& dest_db, const std::string& dest_table_name); + void recv_exchange_partitions(std::vector & _return, const int32_t seqid); + void get_partition_with_auth(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names) override; + int32_t send_get_partition_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const std::string& user_name, const std::vector & group_names); + void recv_get_partition_with_auth(Partition& _return, const int32_t seqid); + void get_partition_by_name(Partition& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name) override; + int32_t send_get_partition_by_name(const std::string& db_name, const std::string& tbl_name, const std::string& part_name); + void recv_get_partition_by_name(Partition& _return, const int32_t seqid); + void get_partitions(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override; + int32_t send_get_partitions(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts); + void recv_get_partitions(std::vector & _return, const int32_t seqid); + void get_partitions_req(PartitionsResponse& _return, const PartitionsRequest& req) override; + int32_t send_get_partitions_req(const PartitionsRequest& req); + void recv_get_partitions_req(PartitionsResponse& _return, const int32_t seqid); + void get_partitions_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override; + int32_t send_get_partitions_with_auth(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts, const std::string& user_name, const std::vector & group_names); + void recv_get_partitions_with_auth(std::vector & _return, const int32_t seqid); + void get_partitions_pspec(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int32_t max_parts) override; + int32_t send_get_partitions_pspec(const std::string& db_name, const std::string& tbl_name, const int32_t max_parts); + void recv_get_partitions_pspec(std::vector & _return, const int32_t seqid); + void get_partition_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const int16_t max_parts) override; + int32_t send_get_partition_names(const std::string& db_name, const std::string& tbl_name, const int16_t max_parts); + void recv_get_partition_names(std::vector & _return, const int32_t seqid); + void fetch_partition_names_req(std::vector & _return, const PartitionsRequest& partitionReq) override; + int32_t send_fetch_partition_names_req(const PartitionsRequest& partitionReq); + void recv_fetch_partition_names_req(std::vector & _return, const int32_t seqid); + void get_partition_values(PartitionValuesResponse& _return, const PartitionValuesRequest& request) override; + int32_t send_get_partition_values(const PartitionValuesRequest& request); + void recv_get_partition_values(PartitionValuesResponse& _return, const int32_t seqid); + void get_partitions_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override; + int32_t send_get_partitions_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts); + void recv_get_partitions_ps(std::vector & _return, const int32_t seqid); + void get_partitions_ps_with_auth(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names) override; + int32_t send_get_partitions_ps_with_auth(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts, const std::string& user_name, const std::vector & group_names); + void recv_get_partitions_ps_with_auth(std::vector & _return, const int32_t seqid); + void get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const GetPartitionsPsWithAuthRequest& req) override; + int32_t send_get_partitions_ps_with_auth_req(const GetPartitionsPsWithAuthRequest& req); + void recv_get_partitions_ps_with_auth_req(GetPartitionsPsWithAuthResponse& _return, const int32_t seqid); + void get_partition_names_ps(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts) override; + int32_t send_get_partition_names_ps(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const int16_t max_parts); + void recv_get_partition_names_ps(std::vector & _return, const int32_t seqid); + void get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const GetPartitionNamesPsRequest& req) override; + int32_t send_get_partition_names_ps_req(const GetPartitionNamesPsRequest& req); + void recv_get_partition_names_ps_req(GetPartitionNamesPsResponse& _return, const int32_t seqid); + void get_partition_names_req(std::vector & _return, const PartitionsByExprRequest& req) override; + int32_t send_get_partition_names_req(const PartitionsByExprRequest& req); + void recv_get_partition_names_req(std::vector & _return, const int32_t seqid); + void get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) override; + int32_t send_get_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts); + void recv_get_partitions_by_filter(std::vector & _return, const int32_t seqid); + void get_partitions_by_filter_req(std::vector & _return, const GetPartitionsByFilterRequest& req) override; + int32_t send_get_partitions_by_filter_req(const GetPartitionsByFilterRequest& req); + void recv_get_partitions_by_filter_req(std::vector & _return, const int32_t seqid); + void get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) override; + int32_t send_get_part_specs_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts); + void recv_get_part_specs_by_filter(std::vector & _return, const int32_t seqid); + void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) override; + int32_t send_get_partitions_by_expr(const PartitionsByExprRequest& req); + void recv_get_partitions_by_expr(PartitionsByExprResult& _return, const int32_t seqid); + void get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const PartitionsByExprRequest& req) override; + int32_t send_get_partitions_spec_by_expr(const PartitionsByExprRequest& req); + void recv_get_partitions_spec_by_expr(PartitionsSpecByExprResult& _return, const int32_t seqid); + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) override; + int32_t send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + int32_t recv_get_num_partitions_by_filter(const int32_t seqid); + void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) override; + int32_t send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names); + void recv_get_partitions_by_names(std::vector & _return, const int32_t seqid); + void get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const GetPartitionsByNamesRequest& req) override; + int32_t send_get_partitions_by_names_req(const GetPartitionsByNamesRequest& req); + void recv_get_partitions_by_names_req(GetPartitionsByNamesResult& _return, const int32_t seqid); + void get_properties(PropertyGetResponse& _return, const PropertyGetRequest& req) override; + int32_t send_get_properties(const PropertyGetRequest& req); + void recv_get_properties(PropertyGetResponse& _return, const int32_t seqid); + bool set_properties(const PropertySetRequest& req) override; + int32_t send_set_properties(const PropertySetRequest& req); + bool recv_set_properties(const int32_t seqid); + void alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) override; + int32_t send_alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part); + void recv_alter_partition(const int32_t seqid); + void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) override; + int32_t send_alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts); + void recv_alter_partitions(const int32_t seqid); + void alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context) override; + int32_t send_alter_partitions_with_environment_context(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts, const EnvironmentContext& environment_context); + void recv_alter_partitions_with_environment_context(const int32_t seqid); + void alter_partitions_req(AlterPartitionsResponse& _return, const AlterPartitionsRequest& req) override; + int32_t send_alter_partitions_req(const AlterPartitionsRequest& req); + void recv_alter_partitions_req(AlterPartitionsResponse& _return, const int32_t seqid); + void alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context) override; + int32_t send_alter_partition_with_environment_context(const std::string& db_name, const std::string& tbl_name, const Partition& new_part, const EnvironmentContext& environment_context); + void recv_alter_partition_with_environment_context(const int32_t seqid); + void rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part) override; + int32_t send_rename_partition(const std::string& db_name, const std::string& tbl_name, const std::vector & part_vals, const Partition& new_part); + void recv_rename_partition(const int32_t seqid); + void rename_partition_req(RenamePartitionResponse& _return, const RenamePartitionRequest& req) override; + int32_t send_rename_partition_req(const RenamePartitionRequest& req); + void recv_rename_partition_req(RenamePartitionResponse& _return, const int32_t seqid); + bool partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception) override; + int32_t send_partition_name_has_valid_characters(const std::vector & part_vals, const bool throw_exception); + bool recv_partition_name_has_valid_characters(const int32_t seqid); + void get_config_value(std::string& _return, const std::string& name, const std::string& defaultValue) override; + int32_t send_get_config_value(const std::string& name, const std::string& defaultValue); + void recv_get_config_value(std::string& _return, const int32_t seqid); + void partition_name_to_vals(std::vector & _return, const std::string& part_name) override; + int32_t send_partition_name_to_vals(const std::string& part_name); + void recv_partition_name_to_vals(std::vector & _return, const int32_t seqid); + void partition_name_to_spec(std::map & _return, const std::string& part_name) override; + int32_t send_partition_name_to_spec(const std::string& part_name); + void recv_partition_name_to_spec(std::map & _return, const int32_t seqid); + void markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override; + int32_t send_markPartitionForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + void recv_markPartitionForEvent(const int32_t seqid); + bool isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType) override; + int32_t send_isPartitionMarkedForEvent(const std::string& db_name, const std::string& tbl_name, const std::map & part_vals, const PartitionEventType::type eventType); + bool recv_isPartitionMarkedForEvent(const int32_t seqid); + void get_primary_keys(PrimaryKeysResponse& _return, const PrimaryKeysRequest& request) override; + int32_t send_get_primary_keys(const PrimaryKeysRequest& request); + void recv_get_primary_keys(PrimaryKeysResponse& _return, const int32_t seqid); + void get_foreign_keys(ForeignKeysResponse& _return, const ForeignKeysRequest& request) override; + int32_t send_get_foreign_keys(const ForeignKeysRequest& request); + void recv_get_foreign_keys(ForeignKeysResponse& _return, const int32_t seqid); + void get_unique_constraints(UniqueConstraintsResponse& _return, const UniqueConstraintsRequest& request) override; + int32_t send_get_unique_constraints(const UniqueConstraintsRequest& request); + void recv_get_unique_constraints(UniqueConstraintsResponse& _return, const int32_t seqid); + void get_not_null_constraints(NotNullConstraintsResponse& _return, const NotNullConstraintsRequest& request) override; + int32_t send_get_not_null_constraints(const NotNullConstraintsRequest& request); + void recv_get_not_null_constraints(NotNullConstraintsResponse& _return, const int32_t seqid); + void get_default_constraints(DefaultConstraintsResponse& _return, const DefaultConstraintsRequest& request) override; + int32_t send_get_default_constraints(const DefaultConstraintsRequest& request); + void recv_get_default_constraints(DefaultConstraintsResponse& _return, const int32_t seqid); + void get_check_constraints(CheckConstraintsResponse& _return, const CheckConstraintsRequest& request) override; + int32_t send_get_check_constraints(const CheckConstraintsRequest& request); + void recv_get_check_constraints(CheckConstraintsResponse& _return, const int32_t seqid); + void get_all_table_constraints(AllTableConstraintsResponse& _return, const AllTableConstraintsRequest& request) override; + int32_t send_get_all_table_constraints(const AllTableConstraintsRequest& request); + void recv_get_all_table_constraints(AllTableConstraintsResponse& _return, const int32_t seqid); + bool update_table_column_statistics(const ColumnStatistics& stats_obj) override; + int32_t send_update_table_column_statistics(const ColumnStatistics& stats_obj); + bool recv_update_table_column_statistics(const int32_t seqid); + bool update_partition_column_statistics(const ColumnStatistics& stats_obj) override; + int32_t send_update_partition_column_statistics(const ColumnStatistics& stats_obj); + bool recv_update_partition_column_statistics(const int32_t seqid); + void update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override; + int32_t send_update_table_column_statistics_req(const SetPartitionsStatsRequest& req); + void recv_update_table_column_statistics_req(SetPartitionsStatsResponse& _return, const int32_t seqid); + void update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const SetPartitionsStatsRequest& req) override; + int32_t send_update_partition_column_statistics_req(const SetPartitionsStatsRequest& req); + void recv_update_partition_column_statistics_req(SetPartitionsStatsResponse& _return, const int32_t seqid); + void update_transaction_statistics(const UpdateTransactionalStatsRequest& req) override; + int32_t send_update_transaction_statistics(const UpdateTransactionalStatsRequest& req); + void recv_update_transaction_statistics(const int32_t seqid); + void get_table_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& col_name) override; + int32_t send_get_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name); + void recv_get_table_column_statistics(ColumnStatistics& _return, const int32_t seqid); + void get_partition_column_statistics(ColumnStatistics& _return, const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name) override; + int32_t send_get_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name); + void recv_get_partition_column_statistics(ColumnStatistics& _return, const int32_t seqid); + void get_table_statistics_req(TableStatsResult& _return, const TableStatsRequest& request) override; + int32_t send_get_table_statistics_req(const TableStatsRequest& request); + void recv_get_table_statistics_req(TableStatsResult& _return, const int32_t seqid); + void get_partitions_statistics_req(PartitionsStatsResult& _return, const PartitionsStatsRequest& request) override; + int32_t send_get_partitions_statistics_req(const PartitionsStatsRequest& request); + void recv_get_partitions_statistics_req(PartitionsStatsResult& _return, const int32_t seqid); + void get_aggr_stats_for(AggrStats& _return, const PartitionsStatsRequest& request) override; + int32_t send_get_aggr_stats_for(const PartitionsStatsRequest& request); + void recv_get_aggr_stats_for(AggrStats& _return, const int32_t seqid); + bool set_aggr_stats_for(const SetPartitionsStatsRequest& request) override; + int32_t send_set_aggr_stats_for(const SetPartitionsStatsRequest& request); + bool recv_set_aggr_stats_for(const int32_t seqid); + bool delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine) override; + int32_t send_delete_partition_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& part_name, const std::string& col_name, const std::string& engine); + bool recv_delete_partition_column_statistics(const int32_t seqid); + bool delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine) override; + int32_t send_delete_table_column_statistics(const std::string& db_name, const std::string& tbl_name, const std::string& col_name, const std::string& engine); + bool recv_delete_table_column_statistics(const int32_t seqid); + void create_function(const Function& func) override; + int32_t send_create_function(const Function& func); + void recv_create_function(const int32_t seqid); + void drop_function(const std::string& dbName, const std::string& funcName) override; + int32_t send_drop_function(const std::string& dbName, const std::string& funcName); + void recv_drop_function(const int32_t seqid); + void alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc) override; + int32_t send_alter_function(const std::string& dbName, const std::string& funcName, const Function& newFunc); + void recv_alter_function(const int32_t seqid); + void get_functions(std::vector & _return, const std::string& dbName, const std::string& pattern) override; + int32_t send_get_functions(const std::string& dbName, const std::string& pattern); + void recv_get_functions(std::vector & _return, const int32_t seqid); + void get_function(Function& _return, const std::string& dbName, const std::string& funcName) override; + int32_t send_get_function(const std::string& dbName, const std::string& funcName); + void recv_get_function(Function& _return, const int32_t seqid); + void get_all_functions(GetAllFunctionsResponse& _return) override; + int32_t send_get_all_functions(); + void recv_get_all_functions(GetAllFunctionsResponse& _return, const int32_t seqid); + bool create_role(const Role& role) override; + int32_t send_create_role(const Role& role); + bool recv_create_role(const int32_t seqid); + bool drop_role(const std::string& role_name) override; + int32_t send_drop_role(const std::string& role_name); + bool recv_drop_role(const int32_t seqid); + void get_role_names(std::vector & _return) override; + int32_t send_get_role_names(); + void recv_get_role_names(std::vector & _return, const int32_t seqid); + bool grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option) override; + int32_t send_grant_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type, const std::string& grantor, const PrincipalType::type grantorType, const bool grant_option); + bool recv_grant_role(const int32_t seqid); + bool revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type) override; + int32_t send_revoke_role(const std::string& role_name, const std::string& principal_name, const PrincipalType::type principal_type); + bool recv_revoke_role(const int32_t seqid); + void list_roles(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type) override; + int32_t send_list_roles(const std::string& principal_name, const PrincipalType::type principal_type); + void recv_list_roles(std::vector & _return, const int32_t seqid); + void grant_revoke_role(GrantRevokeRoleResponse& _return, const GrantRevokeRoleRequest& request) override; + int32_t send_grant_revoke_role(const GrantRevokeRoleRequest& request); + void recv_grant_revoke_role(GrantRevokeRoleResponse& _return, const int32_t seqid); + void get_principals_in_role(GetPrincipalsInRoleResponse& _return, const GetPrincipalsInRoleRequest& request) override; + int32_t send_get_principals_in_role(const GetPrincipalsInRoleRequest& request); + void recv_get_principals_in_role(GetPrincipalsInRoleResponse& _return, const int32_t seqid); + void get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const GetRoleGrantsForPrincipalRequest& request) override; + int32_t send_get_role_grants_for_principal(const GetRoleGrantsForPrincipalRequest& request); + void recv_get_role_grants_for_principal(GetRoleGrantsForPrincipalResponse& _return, const int32_t seqid); + void get_privilege_set(PrincipalPrivilegeSet& _return, const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names) override; + int32_t send_get_privilege_set(const HiveObjectRef& hiveObject, const std::string& user_name, const std::vector & group_names); + void recv_get_privilege_set(PrincipalPrivilegeSet& _return, const int32_t seqid); + void list_privileges(std::vector & _return, const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject) override; + int32_t send_list_privileges(const std::string& principal_name, const PrincipalType::type principal_type, const HiveObjectRef& hiveObject); + void recv_list_privileges(std::vector & _return, const int32_t seqid); + bool grant_privileges(const PrivilegeBag& privileges) override; + int32_t send_grant_privileges(const PrivilegeBag& privileges); + bool recv_grant_privileges(const int32_t seqid); + bool revoke_privileges(const PrivilegeBag& privileges) override; + int32_t send_revoke_privileges(const PrivilegeBag& privileges); + bool recv_revoke_privileges(const int32_t seqid); + void grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const GrantRevokePrivilegeRequest& request) override; + int32_t send_grant_revoke_privileges(const GrantRevokePrivilegeRequest& request); + void recv_grant_revoke_privileges(GrantRevokePrivilegeResponse& _return, const int32_t seqid); + void refresh_privileges(GrantRevokePrivilegeResponse& _return, const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest) override; + int32_t send_refresh_privileges(const HiveObjectRef& objToRefresh, const std::string& authorizer, const GrantRevokePrivilegeRequest& grantRequest); + void recv_refresh_privileges(GrantRevokePrivilegeResponse& _return, const int32_t seqid); + void set_ugi(std::vector & _return, const std::string& user_name, const std::vector & group_names) override; + int32_t send_set_ugi(const std::string& user_name, const std::vector & group_names); + void recv_set_ugi(std::vector & _return, const int32_t seqid); + void get_delegation_token(std::string& _return, const std::string& token_owner, const std::string& renewer_kerberos_principal_name) override; + int32_t send_get_delegation_token(const std::string& token_owner, const std::string& renewer_kerberos_principal_name); + void recv_get_delegation_token(std::string& _return, const int32_t seqid); + int64_t renew_delegation_token(const std::string& token_str_form) override; + int32_t send_renew_delegation_token(const std::string& token_str_form); + int64_t recv_renew_delegation_token(const int32_t seqid); + void cancel_delegation_token(const std::string& token_str_form) override; + int32_t send_cancel_delegation_token(const std::string& token_str_form); + void recv_cancel_delegation_token(const int32_t seqid); + bool add_token(const std::string& token_identifier, const std::string& delegation_token) override; + int32_t send_add_token(const std::string& token_identifier, const std::string& delegation_token); + bool recv_add_token(const int32_t seqid); + bool remove_token(const std::string& token_identifier) override; + int32_t send_remove_token(const std::string& token_identifier); + bool recv_remove_token(const int32_t seqid); + void get_token(std::string& _return, const std::string& token_identifier) override; + int32_t send_get_token(const std::string& token_identifier); + void recv_get_token(std::string& _return, const int32_t seqid); + void get_all_token_identifiers(std::vector & _return) override; + int32_t send_get_all_token_identifiers(); + void recv_get_all_token_identifiers(std::vector & _return, const int32_t seqid); + int32_t add_master_key(const std::string& key) override; + int32_t send_add_master_key(const std::string& key); + int32_t recv_add_master_key(const int32_t seqid); + void update_master_key(const int32_t seq_number, const std::string& key) override; + int32_t send_update_master_key(const int32_t seq_number, const std::string& key); + void recv_update_master_key(const int32_t seqid); + bool remove_master_key(const int32_t key_seq) override; + int32_t send_remove_master_key(const int32_t key_seq); + bool recv_remove_master_key(const int32_t seqid); + void get_master_keys(std::vector & _return) override; + int32_t send_get_master_keys(); + void recv_get_master_keys(std::vector & _return, const int32_t seqid); + void get_open_txns(GetOpenTxnsResponse& _return) override; + int32_t send_get_open_txns(); + void recv_get_open_txns(GetOpenTxnsResponse& _return, const int32_t seqid); + void get_open_txns_info(GetOpenTxnsInfoResponse& _return) override; + int32_t send_get_open_txns_info(); + void recv_get_open_txns_info(GetOpenTxnsInfoResponse& _return, const int32_t seqid); + void open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) override; + int32_t send_open_txns(const OpenTxnRequest& rqst); + void recv_open_txns(OpenTxnsResponse& _return, const int32_t seqid); + void abort_txn(const AbortTxnRequest& rqst) override; + int32_t send_abort_txn(const AbortTxnRequest& rqst); + void recv_abort_txn(const int32_t seqid); + void abort_txns(const AbortTxnsRequest& rqst) override; + int32_t send_abort_txns(const AbortTxnsRequest& rqst); + void recv_abort_txns(const int32_t seqid); + void commit_txn(const CommitTxnRequest& rqst) override; + int32_t send_commit_txn(const CommitTxnRequest& rqst); + void recv_commit_txn(const int32_t seqid); + int64_t get_latest_txnid_in_conflict(const int64_t txnId) override; + int32_t send_get_latest_txnid_in_conflict(const int64_t txnId); + int64_t recv_get_latest_txnid_in_conflict(const int32_t seqid); + void repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst) override; + int32_t send_repl_tbl_writeid_state(const ReplTblWriteIdStateRequest& rqst); + void recv_repl_tbl_writeid_state(const int32_t seqid); + void get_valid_write_ids(GetValidWriteIdsResponse& _return, const GetValidWriteIdsRequest& rqst) override; + int32_t send_get_valid_write_ids(const GetValidWriteIdsRequest& rqst); + void recv_get_valid_write_ids(GetValidWriteIdsResponse& _return, const int32_t seqid); + void add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds) override; + int32_t send_add_write_ids_to_min_history(const int64_t txnId, const std::map & writeIds); + void recv_add_write_ids_to_min_history(const int32_t seqid); + void allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const AllocateTableWriteIdsRequest& rqst) override; + int32_t send_allocate_table_write_ids(const AllocateTableWriteIdsRequest& rqst); + void recv_allocate_table_write_ids(AllocateTableWriteIdsResponse& _return, const int32_t seqid); + void get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const MaxAllocatedTableWriteIdRequest& rqst) override; + int32_t send_get_max_allocated_table_write_id(const MaxAllocatedTableWriteIdRequest& rqst); + void recv_get_max_allocated_table_write_id(MaxAllocatedTableWriteIdResponse& _return, const int32_t seqid); + void seed_write_id(const SeedTableWriteIdsRequest& rqst) override; + int32_t send_seed_write_id(const SeedTableWriteIdsRequest& rqst); + void recv_seed_write_id(const int32_t seqid); + void seed_txn_id(const SeedTxnIdRequest& rqst) override; + int32_t send_seed_txn_id(const SeedTxnIdRequest& rqst); + void recv_seed_txn_id(const int32_t seqid); + void lock(LockResponse& _return, const LockRequest& rqst) override; + int32_t send_lock(const LockRequest& rqst); + void recv_lock(LockResponse& _return, const int32_t seqid); + void check_lock(LockResponse& _return, const CheckLockRequest& rqst) override; + int32_t send_check_lock(const CheckLockRequest& rqst); + void recv_check_lock(LockResponse& _return, const int32_t seqid); + void unlock(const UnlockRequest& rqst) override; + int32_t send_unlock(const UnlockRequest& rqst); + void recv_unlock(const int32_t seqid); + void show_locks(ShowLocksResponse& _return, const ShowLocksRequest& rqst) override; + int32_t send_show_locks(const ShowLocksRequest& rqst); + void recv_show_locks(ShowLocksResponse& _return, const int32_t seqid); + void heartbeat(const HeartbeatRequest& ids) override; + int32_t send_heartbeat(const HeartbeatRequest& ids); + void recv_heartbeat(const int32_t seqid); + void heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const HeartbeatTxnRangeRequest& txns) override; + int32_t send_heartbeat_txn_range(const HeartbeatTxnRangeRequest& txns); + void recv_heartbeat_txn_range(HeartbeatTxnRangeResponse& _return, const int32_t seqid); + void compact(const CompactionRequest& rqst) override; + int32_t send_compact(const CompactionRequest& rqst); + void recv_compact(const int32_t seqid); + void compact2(CompactionResponse& _return, const CompactionRequest& rqst) override; + int32_t send_compact2(const CompactionRequest& rqst); + void recv_compact2(CompactionResponse& _return, const int32_t seqid); + void show_compact(ShowCompactResponse& _return, const ShowCompactRequest& rqst) override; + int32_t send_show_compact(const ShowCompactRequest& rqst); + void recv_show_compact(ShowCompactResponse& _return, const int32_t seqid); + bool submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3) override; + int32_t send_submit_for_cleanup(const CompactionRequest& o1, const int64_t o2, const int64_t o3); + bool recv_submit_for_cleanup(const int32_t seqid); + void add_dynamic_partitions(const AddDynamicPartitions& rqst) override; + int32_t send_add_dynamic_partitions(const AddDynamicPartitions& rqst); + void recv_add_dynamic_partitions(const int32_t seqid); + void find_next_compact(OptionalCompactionInfoStruct& _return, const std::string& workerId) override; + int32_t send_find_next_compact(const std::string& workerId); + void recv_find_next_compact(OptionalCompactionInfoStruct& _return, const int32_t seqid); + void find_next_compact2(OptionalCompactionInfoStruct& _return, const FindNextCompactRequest& rqst) override; + int32_t send_find_next_compact2(const FindNextCompactRequest& rqst); + void recv_find_next_compact2(OptionalCompactionInfoStruct& _return, const int32_t seqid); + void update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id) override; + int32_t send_update_compactor_state(const CompactionInfoStruct& cr, const int64_t txn_id); + void recv_update_compactor_state(const int32_t seqid); + void find_columns_with_stats(std::vector & _return, const CompactionInfoStruct& cr) override; + int32_t send_find_columns_with_stats(const CompactionInfoStruct& cr); + void recv_find_columns_with_stats(std::vector & _return, const int32_t seqid); + void mark_cleaned(const CompactionInfoStruct& cr) override; + int32_t send_mark_cleaned(const CompactionInfoStruct& cr); + void recv_mark_cleaned(const int32_t seqid); + void mark_compacted(const CompactionInfoStruct& cr) override; + int32_t send_mark_compacted(const CompactionInfoStruct& cr); + void recv_mark_compacted(const int32_t seqid); + void mark_failed(const CompactionInfoStruct& cr) override; + int32_t send_mark_failed(const CompactionInfoStruct& cr); + void recv_mark_failed(const int32_t seqid); + void mark_refused(const CompactionInfoStruct& cr) override; + int32_t send_mark_refused(const CompactionInfoStruct& cr); + void recv_mark_refused(const int32_t seqid); + bool update_compaction_metrics_data(const CompactionMetricsDataStruct& data) override; + int32_t send_update_compaction_metrics_data(const CompactionMetricsDataStruct& data); + bool recv_update_compaction_metrics_data(const int32_t seqid); + void remove_compaction_metrics_data(const CompactionMetricsDataRequest& request) override; + int32_t send_remove_compaction_metrics_data(const CompactionMetricsDataRequest& request); + void recv_remove_compaction_metrics_data(const int32_t seqid); + void set_hadoop_jobid(const std::string& jobId, const int64_t cq_id) override; + int32_t send_set_hadoop_jobid(const std::string& jobId, const int64_t cq_id); + void recv_set_hadoop_jobid(const int32_t seqid); + void get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const GetLatestCommittedCompactionInfoRequest& rqst) override; + int32_t send_get_latest_committed_compaction_info(const GetLatestCommittedCompactionInfoRequest& rqst); + void recv_get_latest_committed_compaction_info(GetLatestCommittedCompactionInfoResponse& _return, const int32_t seqid); + void get_next_notification(NotificationEventResponse& _return, const NotificationEventRequest& rqst) override; + int32_t send_get_next_notification(const NotificationEventRequest& rqst); + void recv_get_next_notification(NotificationEventResponse& _return, const int32_t seqid); + void get_current_notificationEventId(CurrentNotificationEventId& _return) override; + int32_t send_get_current_notificationEventId(); + void recv_get_current_notificationEventId(CurrentNotificationEventId& _return, const int32_t seqid); + void get_notification_events_count(NotificationEventsCountResponse& _return, const NotificationEventsCountRequest& rqst) override; + int32_t send_get_notification_events_count(const NotificationEventsCountRequest& rqst); + void recv_get_notification_events_count(NotificationEventsCountResponse& _return, const int32_t seqid); + void fire_listener_event(FireEventResponse& _return, const FireEventRequest& rqst) override; + int32_t send_fire_listener_event(const FireEventRequest& rqst); + void recv_fire_listener_event(FireEventResponse& _return, const int32_t seqid); + void flushCache() override; + int32_t send_flushCache(); + void recv_flushCache(const int32_t seqid); + void add_write_notification_log(WriteNotificationLogResponse& _return, const WriteNotificationLogRequest& rqst) override; + int32_t send_add_write_notification_log(const WriteNotificationLogRequest& rqst); + void recv_add_write_notification_log(WriteNotificationLogResponse& _return, const int32_t seqid); + void add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const WriteNotificationLogBatchRequest& rqst) override; + int32_t send_add_write_notification_log_in_batch(const WriteNotificationLogBatchRequest& rqst); + void recv_add_write_notification_log_in_batch(WriteNotificationLogBatchResponse& _return, const int32_t seqid); + void cm_recycle(CmRecycleResponse& _return, const CmRecycleRequest& request) override; + int32_t send_cm_recycle(const CmRecycleRequest& request); + void recv_cm_recycle(CmRecycleResponse& _return, const int32_t seqid); + void get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const GetFileMetadataByExprRequest& req) override; + int32_t send_get_file_metadata_by_expr(const GetFileMetadataByExprRequest& req); + void recv_get_file_metadata_by_expr(GetFileMetadataByExprResult& _return, const int32_t seqid); + void get_file_metadata(GetFileMetadataResult& _return, const GetFileMetadataRequest& req) override; + int32_t send_get_file_metadata(const GetFileMetadataRequest& req); + void recv_get_file_metadata(GetFileMetadataResult& _return, const int32_t seqid); + void put_file_metadata(PutFileMetadataResult& _return, const PutFileMetadataRequest& req) override; + int32_t send_put_file_metadata(const PutFileMetadataRequest& req); + void recv_put_file_metadata(PutFileMetadataResult& _return, const int32_t seqid); + void clear_file_metadata(ClearFileMetadataResult& _return, const ClearFileMetadataRequest& req) override; + int32_t send_clear_file_metadata(const ClearFileMetadataRequest& req); + void recv_clear_file_metadata(ClearFileMetadataResult& _return, const int32_t seqid); + void cache_file_metadata(CacheFileMetadataResult& _return, const CacheFileMetadataRequest& req) override; + int32_t send_cache_file_metadata(const CacheFileMetadataRequest& req); + void recv_cache_file_metadata(CacheFileMetadataResult& _return, const int32_t seqid); + void get_metastore_db_uuid(std::string& _return) override; + int32_t send_get_metastore_db_uuid(); + void recv_get_metastore_db_uuid(std::string& _return, const int32_t seqid); + void create_resource_plan(WMCreateResourcePlanResponse& _return, const WMCreateResourcePlanRequest& request) override; + int32_t send_create_resource_plan(const WMCreateResourcePlanRequest& request); + void recv_create_resource_plan(WMCreateResourcePlanResponse& _return, const int32_t seqid); + void get_resource_plan(WMGetResourcePlanResponse& _return, const WMGetResourcePlanRequest& request) override; + int32_t send_get_resource_plan(const WMGetResourcePlanRequest& request); + void recv_get_resource_plan(WMGetResourcePlanResponse& _return, const int32_t seqid); + void get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const WMGetActiveResourcePlanRequest& request) override; + int32_t send_get_active_resource_plan(const WMGetActiveResourcePlanRequest& request); + void recv_get_active_resource_plan(WMGetActiveResourcePlanResponse& _return, const int32_t seqid); + void get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const WMGetAllResourcePlanRequest& request) override; + int32_t send_get_all_resource_plans(const WMGetAllResourcePlanRequest& request); + void recv_get_all_resource_plans(WMGetAllResourcePlanResponse& _return, const int32_t seqid); + void alter_resource_plan(WMAlterResourcePlanResponse& _return, const WMAlterResourcePlanRequest& request) override; + int32_t send_alter_resource_plan(const WMAlterResourcePlanRequest& request); + void recv_alter_resource_plan(WMAlterResourcePlanResponse& _return, const int32_t seqid); + void validate_resource_plan(WMValidateResourcePlanResponse& _return, const WMValidateResourcePlanRequest& request) override; + int32_t send_validate_resource_plan(const WMValidateResourcePlanRequest& request); + void recv_validate_resource_plan(WMValidateResourcePlanResponse& _return, const int32_t seqid); + void drop_resource_plan(WMDropResourcePlanResponse& _return, const WMDropResourcePlanRequest& request) override; + int32_t send_drop_resource_plan(const WMDropResourcePlanRequest& request); + void recv_drop_resource_plan(WMDropResourcePlanResponse& _return, const int32_t seqid); + void create_wm_trigger(WMCreateTriggerResponse& _return, const WMCreateTriggerRequest& request) override; + int32_t send_create_wm_trigger(const WMCreateTriggerRequest& request); + void recv_create_wm_trigger(WMCreateTriggerResponse& _return, const int32_t seqid); + void alter_wm_trigger(WMAlterTriggerResponse& _return, const WMAlterTriggerRequest& request) override; + int32_t send_alter_wm_trigger(const WMAlterTriggerRequest& request); + void recv_alter_wm_trigger(WMAlterTriggerResponse& _return, const int32_t seqid); + void drop_wm_trigger(WMDropTriggerResponse& _return, const WMDropTriggerRequest& request) override; + int32_t send_drop_wm_trigger(const WMDropTriggerRequest& request); + void recv_drop_wm_trigger(WMDropTriggerResponse& _return, const int32_t seqid); + void get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const WMGetTriggersForResourePlanRequest& request) override; + int32_t send_get_triggers_for_resourceplan(const WMGetTriggersForResourePlanRequest& request); + void recv_get_triggers_for_resourceplan(WMGetTriggersForResourePlanResponse& _return, const int32_t seqid); + void create_wm_pool(WMCreatePoolResponse& _return, const WMCreatePoolRequest& request) override; + int32_t send_create_wm_pool(const WMCreatePoolRequest& request); + void recv_create_wm_pool(WMCreatePoolResponse& _return, const int32_t seqid); + void alter_wm_pool(WMAlterPoolResponse& _return, const WMAlterPoolRequest& request) override; + int32_t send_alter_wm_pool(const WMAlterPoolRequest& request); + void recv_alter_wm_pool(WMAlterPoolResponse& _return, const int32_t seqid); + void drop_wm_pool(WMDropPoolResponse& _return, const WMDropPoolRequest& request) override; + int32_t send_drop_wm_pool(const WMDropPoolRequest& request); + void recv_drop_wm_pool(WMDropPoolResponse& _return, const int32_t seqid); + void create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const WMCreateOrUpdateMappingRequest& request) override; + int32_t send_create_or_update_wm_mapping(const WMCreateOrUpdateMappingRequest& request); + void recv_create_or_update_wm_mapping(WMCreateOrUpdateMappingResponse& _return, const int32_t seqid); + void drop_wm_mapping(WMDropMappingResponse& _return, const WMDropMappingRequest& request) override; + int32_t send_drop_wm_mapping(const WMDropMappingRequest& request); + void recv_drop_wm_mapping(WMDropMappingResponse& _return, const int32_t seqid); + void create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const WMCreateOrDropTriggerToPoolMappingRequest& request) override; + int32_t send_create_or_drop_wm_trigger_to_pool_mapping(const WMCreateOrDropTriggerToPoolMappingRequest& request); + void recv_create_or_drop_wm_trigger_to_pool_mapping(WMCreateOrDropTriggerToPoolMappingResponse& _return, const int32_t seqid); + void create_ischema(const ISchema& schema) override; + int32_t send_create_ischema(const ISchema& schema); + void recv_create_ischema(const int32_t seqid); + void alter_ischema(const AlterISchemaRequest& rqst) override; + int32_t send_alter_ischema(const AlterISchemaRequest& rqst); + void recv_alter_ischema(const int32_t seqid); + void get_ischema(ISchema& _return, const ISchemaName& name) override; + int32_t send_get_ischema(const ISchemaName& name); + void recv_get_ischema(ISchema& _return, const int32_t seqid); + void drop_ischema(const ISchemaName& name) override; + int32_t send_drop_ischema(const ISchemaName& name); + void recv_drop_ischema(const int32_t seqid); + void add_schema_version(const SchemaVersion& schemaVersion) override; + int32_t send_add_schema_version(const SchemaVersion& schemaVersion); + void recv_add_schema_version(const int32_t seqid); + void get_schema_version(SchemaVersion& _return, const SchemaVersionDescriptor& schemaVersion) override; + int32_t send_get_schema_version(const SchemaVersionDescriptor& schemaVersion); + void recv_get_schema_version(SchemaVersion& _return, const int32_t seqid); + void get_schema_latest_version(SchemaVersion& _return, const ISchemaName& schemaName) override; + int32_t send_get_schema_latest_version(const ISchemaName& schemaName); + void recv_get_schema_latest_version(SchemaVersion& _return, const int32_t seqid); + void get_schema_all_versions(std::vector & _return, const ISchemaName& schemaName) override; + int32_t send_get_schema_all_versions(const ISchemaName& schemaName); + void recv_get_schema_all_versions(std::vector & _return, const int32_t seqid); + void drop_schema_version(const SchemaVersionDescriptor& schemaVersion) override; + int32_t send_drop_schema_version(const SchemaVersionDescriptor& schemaVersion); + void recv_drop_schema_version(const int32_t seqid); + void get_schemas_by_cols(FindSchemasByColsResp& _return, const FindSchemasByColsRqst& rqst) override; + int32_t send_get_schemas_by_cols(const FindSchemasByColsRqst& rqst); + void recv_get_schemas_by_cols(FindSchemasByColsResp& _return, const int32_t seqid); + void map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst) override; + int32_t send_map_schema_version_to_serde(const MapSchemaVersionToSerdeRequest& rqst); + void recv_map_schema_version_to_serde(const int32_t seqid); + void set_schema_version_state(const SetSchemaVersionStateRequest& rqst) override; + int32_t send_set_schema_version_state(const SetSchemaVersionStateRequest& rqst); + void recv_set_schema_version_state(const int32_t seqid); + void add_serde(const SerDeInfo& serde) override; + int32_t send_add_serde(const SerDeInfo& serde); + void recv_add_serde(const int32_t seqid); + void get_serde(SerDeInfo& _return, const GetSerdeRequest& rqst) override; + int32_t send_get_serde(const GetSerdeRequest& rqst); + void recv_get_serde(SerDeInfo& _return, const int32_t seqid); + void get_lock_materialization_rebuild(LockResponse& _return, const std::string& dbName, const std::string& tableName, const int64_t txnId) override; + int32_t send_get_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId); + void recv_get_lock_materialization_rebuild(LockResponse& _return, const int32_t seqid); + bool heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId) override; + int32_t send_heartbeat_lock_materialization_rebuild(const std::string& dbName, const std::string& tableName, const int64_t txnId); + bool recv_heartbeat_lock_materialization_rebuild(const int32_t seqid); + void add_runtime_stats(const RuntimeStat& stat) override; + int32_t send_add_runtime_stats(const RuntimeStat& stat); + void recv_add_runtime_stats(const int32_t seqid); + void get_runtime_stats(std::vector & _return, const GetRuntimeStatsRequest& rqst) override; + int32_t send_get_runtime_stats(const GetRuntimeStatsRequest& rqst); + void recv_get_runtime_stats(std::vector & _return, const int32_t seqid); + void get_partitions_with_specs(GetPartitionsResponse& _return, const GetPartitionsRequest& request) override; + int32_t send_get_partitions_with_specs(const GetPartitionsRequest& request); + void recv_get_partitions_with_specs(GetPartitionsResponse& _return, const int32_t seqid); + void scheduled_query_poll(ScheduledQueryPollResponse& _return, const ScheduledQueryPollRequest& request) override; + int32_t send_scheduled_query_poll(const ScheduledQueryPollRequest& request); + void recv_scheduled_query_poll(ScheduledQueryPollResponse& _return, const int32_t seqid); + void scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request) override; + int32_t send_scheduled_query_maintenance(const ScheduledQueryMaintenanceRequest& request); + void recv_scheduled_query_maintenance(const int32_t seqid); + void scheduled_query_progress(const ScheduledQueryProgressInfo& info) override; + int32_t send_scheduled_query_progress(const ScheduledQueryProgressInfo& info); + void recv_scheduled_query_progress(const int32_t seqid); + void get_scheduled_query(ScheduledQuery& _return, const ScheduledQueryKey& scheduleKey) override; + int32_t send_get_scheduled_query(const ScheduledQueryKey& scheduleKey); + void recv_get_scheduled_query(ScheduledQuery& _return, const int32_t seqid); + void add_replication_metrics(const ReplicationMetricList& replicationMetricList) override; + int32_t send_add_replication_metrics(const ReplicationMetricList& replicationMetricList); + void recv_add_replication_metrics(const int32_t seqid); + void get_replication_metrics(ReplicationMetricList& _return, const GetReplicationMetricsRequest& rqst) override; + int32_t send_get_replication_metrics(const GetReplicationMetricsRequest& rqst); + void recv_get_replication_metrics(ReplicationMetricList& _return, const int32_t seqid); + void get_open_txns_req(GetOpenTxnsResponse& _return, const GetOpenTxnsRequest& getOpenTxnsRequest) override; + int32_t send_get_open_txns_req(const GetOpenTxnsRequest& getOpenTxnsRequest); + void recv_get_open_txns_req(GetOpenTxnsResponse& _return, const int32_t seqid); + void create_stored_procedure(const StoredProcedure& proc) override; + int32_t send_create_stored_procedure(const StoredProcedure& proc); + void recv_create_stored_procedure(const int32_t seqid); + void get_stored_procedure(StoredProcedure& _return, const StoredProcedureRequest& request) override; + int32_t send_get_stored_procedure(const StoredProcedureRequest& request); + void recv_get_stored_procedure(StoredProcedure& _return, const int32_t seqid); + void drop_stored_procedure(const StoredProcedureRequest& request) override; + int32_t send_drop_stored_procedure(const StoredProcedureRequest& request); + void recv_drop_stored_procedure(const int32_t seqid); + void get_all_stored_procedures(std::vector & _return, const ListStoredProcedureRequest& request) override; + int32_t send_get_all_stored_procedures(const ListStoredProcedureRequest& request); + void recv_get_all_stored_procedures(std::vector & _return, const int32_t seqid); + void find_package(Package& _return, const GetPackageRequest& request) override; + int32_t send_find_package(const GetPackageRequest& request); + void recv_find_package(Package& _return, const int32_t seqid); + void add_package(const AddPackageRequest& request) override; + int32_t send_add_package(const AddPackageRequest& request); + void recv_add_package(const int32_t seqid); + void get_all_packages(std::vector & _return, const ListPackageRequest& request) override; + int32_t send_get_all_packages(const ListPackageRequest& request); + void recv_get_all_packages(std::vector & _return, const int32_t seqid); + void drop_package(const DropPackageRequest& request) override; + int32_t send_drop_package(const DropPackageRequest& request); + void recv_drop_package(const int32_t seqid); + void get_all_write_event_info(std::vector & _return, const GetAllWriteEventInfoRequest& request) override; + int32_t send_get_all_write_event_info(const GetAllWriteEventInfoRequest& request); + void recv_get_all_write_event_info(std::vector & _return, const int32_t seqid); +}; + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + +}}} // namespace + +#endif diff --git a/src/iceberg/catalog/hive/gen-cpp/fb303_types.cpp b/src/iceberg/catalog/hive/gen-cpp/fb303_types.cpp new file mode 100644 index 000000000..3f1ccdf0d --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/fb303_types.cpp @@ -0,0 +1,53 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "fb303_types.h" + +#include +#include + +#include + +namespace facebook { namespace fb303 { + +int _kfb_statusValues[] = { + fb_status::DEAD, + fb_status::STARTING, + fb_status::ALIVE, + fb_status::STOPPING, + fb_status::STOPPED, + fb_status::WARNING +}; +const char* _kfb_statusNames[] = { + "DEAD", + "STARTING", + "ALIVE", + "STOPPING", + "STOPPED", + "WARNING" +}; +const std::map _fb_status_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kfb_statusValues, _kfb_statusNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const fb_status::type& val) { + std::map::const_iterator it = _fb_status_VALUES_TO_NAMES.find(val); + if (it != _fb_status_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const fb_status::type& val) { + std::map::const_iterator it = _fb_status_VALUES_TO_NAMES.find(val); + if (it != _fb_status_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +}} // namespace diff --git a/src/iceberg/catalog/hive/gen-cpp/fb303_types.h b/src/iceberg/catalog/hive/gen-cpp/fb303_types.h new file mode 100644 index 000000000..84df27616 --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/fb303_types.h @@ -0,0 +1,46 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef fb303_TYPES_H +#define fb303_TYPES_H + +#include + +#include +#include +#include +#include +#include + +#include +#include + + +namespace facebook { namespace fb303 { + +/** + * Common status reporting mechanism across all services + */ +struct fb_status { + enum type { + DEAD = 0, + STARTING = 1, + ALIVE = 2, + STOPPING = 3, + STOPPED = 4, + WARNING = 5 + }; +}; + +extern const std::map _fb_status_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const fb_status::type& val); + +std::string to_string(const fb_status::type& val); + +}} // namespace + +#endif diff --git a/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.cpp b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.cpp new file mode 100644 index 000000000..28edb96ea --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.cpp @@ -0,0 +1,105 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "hive_metastore_constants.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +const hive_metastoreConstants g_hive_metastore_constants; + +hive_metastoreConstants::hive_metastoreConstants() { + DDL_TIME = "transient_lastDdlTime"; + + ACCESSTYPE_NONE = 1; + + ACCESSTYPE_READONLY = 2; + + ACCESSTYPE_WRITEONLY = 4; + + ACCESSTYPE_READWRITE = 8; + + HIVE_FILTER_FIELD_OWNER = "hive_filter_field_owner__"; + + HIVE_FILTER_FIELD_PARAMS = "hive_filter_field_params__"; + + HIVE_FILTER_FIELD_LAST_ACCESS = "hive_filter_field_last_access__"; + + HIVE_FILTER_FIELD_TABLE_NAME = "hive_filter_field_tableName__"; + + HIVE_FILTER_FIELD_TABLE_TYPE = "hive_filter_field_tableType__"; + + IS_ARCHIVED = "is_archived"; + + ORIGINAL_LOCATION = "original_location"; + + IS_IMMUTABLE = "immutable"; + + META_TABLE_COLUMNS = "columns"; + + META_TABLE_COLUMN_TYPES = "columns.types"; + + BUCKET_FIELD_NAME = "bucket_field_name"; + + BUCKET_COUNT = "bucket_count"; + + FIELD_TO_DIMENSION = "field_to_dimension"; + + IF_PURGE = "ifPurge"; + + META_TABLE_NAME = "name"; + + META_TABLE_DB = "db"; + + META_TABLE_LOCATION = "location"; + + META_TABLE_SERDE = "serde"; + + META_TABLE_PARTITION_COLUMNS = "partition_columns"; + + META_TABLE_PARTITION_COLUMN_TYPES = "partition_columns.types"; + + FILE_INPUT_FORMAT = "file.inputformat"; + + FILE_OUTPUT_FORMAT = "file.outputformat"; + + META_TABLE_STORAGE = "storage_handler"; + + TABLE_IS_TRANSACTIONAL = "transactional"; + + NO_AUTO_COMPACT = "no_auto_compaction"; + + TABLE_TRANSACTIONAL_PROPERTIES = "transactional_properties"; + + TABLE_BUCKETING_VERSION = "bucketing_version"; + + DRUID_CONFIG_PREFIX = "druid."; + + JDBC_CONFIG_PREFIX = "hive.sql."; + + TABLE_IS_CTAS = "created_with_ctas"; + + TABLE_IS_CTLT = "created_with_ctlt"; + + PARTITION_TRANSFORM_SPEC = "partition_transform_spec"; + + NO_CLEANUP = "no_cleanup"; + + CTAS_LEGACY_CONFIG = "create_table_as_external"; + + DEFAULT_TABLE_TYPE = "defaultTableType"; + + TXN_ID = "txnId"; + + WRITE_ID = "writeId"; + + EXPECTED_PARAMETER_KEY = "expected_parameter_key"; + + EXPECTED_PARAMETER_VALUE = "expected_parameter_value"; + +} + +}}} // namespace + diff --git a/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.h b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.h new file mode 100644 index 000000000..15acc15f0 --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_constants.h @@ -0,0 +1,68 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef hive_metastore_CONSTANTS_H +#define hive_metastore_CONSTANTS_H + +#include "hive_metastore_types.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +class hive_metastoreConstants { + public: + hive_metastoreConstants(); + + std::string DDL_TIME; + int8_t ACCESSTYPE_NONE; + int8_t ACCESSTYPE_READONLY; + int8_t ACCESSTYPE_WRITEONLY; + int8_t ACCESSTYPE_READWRITE; + std::string HIVE_FILTER_FIELD_OWNER; + std::string HIVE_FILTER_FIELD_PARAMS; + std::string HIVE_FILTER_FIELD_LAST_ACCESS; + std::string HIVE_FILTER_FIELD_TABLE_NAME; + std::string HIVE_FILTER_FIELD_TABLE_TYPE; + std::string IS_ARCHIVED; + std::string ORIGINAL_LOCATION; + std::string IS_IMMUTABLE; + std::string META_TABLE_COLUMNS; + std::string META_TABLE_COLUMN_TYPES; + std::string BUCKET_FIELD_NAME; + std::string BUCKET_COUNT; + std::string FIELD_TO_DIMENSION; + std::string IF_PURGE; + std::string META_TABLE_NAME; + std::string META_TABLE_DB; + std::string META_TABLE_LOCATION; + std::string META_TABLE_SERDE; + std::string META_TABLE_PARTITION_COLUMNS; + std::string META_TABLE_PARTITION_COLUMN_TYPES; + std::string FILE_INPUT_FORMAT; + std::string FILE_OUTPUT_FORMAT; + std::string META_TABLE_STORAGE; + std::string TABLE_IS_TRANSACTIONAL; + std::string NO_AUTO_COMPACT; + std::string TABLE_TRANSACTIONAL_PROPERTIES; + std::string TABLE_BUCKETING_VERSION; + std::string DRUID_CONFIG_PREFIX; + std::string JDBC_CONFIG_PREFIX; + std::string TABLE_IS_CTAS; + std::string TABLE_IS_CTLT; + std::string PARTITION_TRANSFORM_SPEC; + std::string NO_CLEANUP; + std::string CTAS_LEGACY_CONFIG; + std::string DEFAULT_TABLE_TYPE; + std::string TXN_ID; + std::string WRITE_ID; + std::string EXPECTED_PARAMETER_KEY; + std::string EXPECTED_PARAMETER_VALUE; +}; + +extern const hive_metastoreConstants g_hive_metastore_constants; + +}}} // namespace + +#endif diff --git a/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.cpp b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.cpp new file mode 100644 index 000000000..362cf060f --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.cpp @@ -0,0 +1,62322 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "hive_metastore_types.h" + +#include +#include + +#include + +namespace Apache { namespace Hadoop { namespace Hive { + +int _kHiveObjectTypeValues[] = { + HiveObjectType::GLOBAL, + HiveObjectType::DATABASE, + HiveObjectType::TABLE, + HiveObjectType::PARTITION, + HiveObjectType::COLUMN, + HiveObjectType::DATACONNECTOR +}; +const char* _kHiveObjectTypeNames[] = { + "GLOBAL", + "DATABASE", + "TABLE", + "PARTITION", + "COLUMN", + "DATACONNECTOR" +}; +const std::map _HiveObjectType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kHiveObjectTypeValues, _kHiveObjectTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const HiveObjectType::type& val) { + std::map::const_iterator it = _HiveObjectType_VALUES_TO_NAMES.find(val); + if (it != _HiveObjectType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const HiveObjectType::type& val) { + std::map::const_iterator it = _HiveObjectType_VALUES_TO_NAMES.find(val); + if (it != _HiveObjectType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kPrincipalTypeValues[] = { + PrincipalType::USER, + PrincipalType::ROLE, + PrincipalType::GROUP +}; +const char* _kPrincipalTypeNames[] = { + "USER", + "ROLE", + "GROUP" +}; +const std::map _PrincipalType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kPrincipalTypeValues, _kPrincipalTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const PrincipalType::type& val) { + std::map::const_iterator it = _PrincipalType_VALUES_TO_NAMES.find(val); + if (it != _PrincipalType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const PrincipalType::type& val) { + std::map::const_iterator it = _PrincipalType_VALUES_TO_NAMES.find(val); + if (it != _PrincipalType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kPartitionEventTypeValues[] = { + PartitionEventType::LOAD_DONE +}; +const char* _kPartitionEventTypeNames[] = { + "LOAD_DONE" +}; +const std::map _PartitionEventType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kPartitionEventTypeValues, _kPartitionEventTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const PartitionEventType::type& val) { + std::map::const_iterator it = _PartitionEventType_VALUES_TO_NAMES.find(val); + if (it != _PartitionEventType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const PartitionEventType::type& val) { + std::map::const_iterator it = _PartitionEventType_VALUES_TO_NAMES.find(val); + if (it != _PartitionEventType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kTxnStateValues[] = { + TxnState::COMMITTED, + TxnState::ABORTED, + TxnState::OPEN +}; +const char* _kTxnStateNames[] = { + "COMMITTED", + "ABORTED", + "OPEN" +}; +const std::map _TxnState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kTxnStateValues, _kTxnStateNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const TxnState::type& val) { + std::map::const_iterator it = _TxnState_VALUES_TO_NAMES.find(val); + if (it != _TxnState_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const TxnState::type& val) { + std::map::const_iterator it = _TxnState_VALUES_TO_NAMES.find(val); + if (it != _TxnState_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kLockLevelValues[] = { + LockLevel::DB, + LockLevel::TABLE, + LockLevel::PARTITION +}; +const char* _kLockLevelNames[] = { + "DB", + "TABLE", + "PARTITION" +}; +const std::map _LockLevel_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kLockLevelValues, _kLockLevelNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const LockLevel::type& val) { + std::map::const_iterator it = _LockLevel_VALUES_TO_NAMES.find(val); + if (it != _LockLevel_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const LockLevel::type& val) { + std::map::const_iterator it = _LockLevel_VALUES_TO_NAMES.find(val); + if (it != _LockLevel_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kLockStateValues[] = { + LockState::ACQUIRED, + LockState::WAITING, + LockState::ABORT, + LockState::NOT_ACQUIRED +}; +const char* _kLockStateNames[] = { + "ACQUIRED", + "WAITING", + "ABORT", + "NOT_ACQUIRED" +}; +const std::map _LockState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kLockStateValues, _kLockStateNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const LockState::type& val) { + std::map::const_iterator it = _LockState_VALUES_TO_NAMES.find(val); + if (it != _LockState_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const LockState::type& val) { + std::map::const_iterator it = _LockState_VALUES_TO_NAMES.find(val); + if (it != _LockState_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kLockTypeValues[] = { + LockType::SHARED_READ, + LockType::SHARED_WRITE, + LockType::EXCLUSIVE, + LockType::EXCL_WRITE +}; +const char* _kLockTypeNames[] = { + "SHARED_READ", + "SHARED_WRITE", + "EXCLUSIVE", + "EXCL_WRITE" +}; +const std::map _LockType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kLockTypeValues, _kLockTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const LockType::type& val) { + std::map::const_iterator it = _LockType_VALUES_TO_NAMES.find(val); + if (it != _LockType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const LockType::type& val) { + std::map::const_iterator it = _LockType_VALUES_TO_NAMES.find(val); + if (it != _LockType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kCompactionTypeValues[] = { + CompactionType::MINOR, + CompactionType::MAJOR, + CompactionType::REBALANCE, + CompactionType::ABORT_TXN_CLEANUP +}; +const char* _kCompactionTypeNames[] = { + "MINOR", + "MAJOR", + "REBALANCE", + "ABORT_TXN_CLEANUP" +}; +const std::map _CompactionType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kCompactionTypeValues, _kCompactionTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const CompactionType::type& val) { + std::map::const_iterator it = _CompactionType_VALUES_TO_NAMES.find(val); + if (it != _CompactionType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const CompactionType::type& val) { + std::map::const_iterator it = _CompactionType_VALUES_TO_NAMES.find(val); + if (it != _CompactionType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kGrantRevokeTypeValues[] = { + GrantRevokeType::GRANT, + GrantRevokeType::REVOKE +}; +const char* _kGrantRevokeTypeNames[] = { + "GRANT", + "REVOKE" +}; +const std::map _GrantRevokeType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kGrantRevokeTypeValues, _kGrantRevokeTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const GrantRevokeType::type& val) { + std::map::const_iterator it = _GrantRevokeType_VALUES_TO_NAMES.find(val); + if (it != _GrantRevokeType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const GrantRevokeType::type& val) { + std::map::const_iterator it = _GrantRevokeType_VALUES_TO_NAMES.find(val); + if (it != _GrantRevokeType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kDataOperationTypeValues[] = { + DataOperationType::SELECT, + DataOperationType::INSERT, + DataOperationType::UPDATE, + DataOperationType::DELETE, + DataOperationType::UNSET, + DataOperationType::NO_TXN +}; +const char* _kDataOperationTypeNames[] = { + "SELECT", + "INSERT", + "UPDATE", + "DELETE", + "UNSET", + "NO_TXN" +}; +const std::map _DataOperationType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kDataOperationTypeValues, _kDataOperationTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const DataOperationType::type& val) { + std::map::const_iterator it = _DataOperationType_VALUES_TO_NAMES.find(val); + if (it != _DataOperationType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const DataOperationType::type& val) { + std::map::const_iterator it = _DataOperationType_VALUES_TO_NAMES.find(val); + if (it != _DataOperationType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kEventRequestTypeValues[] = { + EventRequestType::INSERT, + EventRequestType::UPDATE, + EventRequestType::DELETE +}; +const char* _kEventRequestTypeNames[] = { + "INSERT", + "UPDATE", + "DELETE" +}; +const std::map _EventRequestType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kEventRequestTypeValues, _kEventRequestTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const EventRequestType::type& val) { + std::map::const_iterator it = _EventRequestType_VALUES_TO_NAMES.find(val); + if (it != _EventRequestType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const EventRequestType::type& val) { + std::map::const_iterator it = _EventRequestType_VALUES_TO_NAMES.find(val); + if (it != _EventRequestType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kSerdeTypeValues[] = { + SerdeType::HIVE, + SerdeType::SCHEMA_REGISTRY +}; +const char* _kSerdeTypeNames[] = { + "HIVE", + "SCHEMA_REGISTRY" +}; +const std::map _SerdeType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kSerdeTypeValues, _kSerdeTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const SerdeType::type& val) { + std::map::const_iterator it = _SerdeType_VALUES_TO_NAMES.find(val); + if (it != _SerdeType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const SerdeType::type& val) { + std::map::const_iterator it = _SerdeType_VALUES_TO_NAMES.find(val); + if (it != _SerdeType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kSchemaTypeValues[] = { + SchemaType::HIVE, + SchemaType::AVRO +}; +const char* _kSchemaTypeNames[] = { + "HIVE", + "AVRO" +}; +const std::map _SchemaType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kSchemaTypeValues, _kSchemaTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const SchemaType::type& val) { + std::map::const_iterator it = _SchemaType_VALUES_TO_NAMES.find(val); + if (it != _SchemaType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const SchemaType::type& val) { + std::map::const_iterator it = _SchemaType_VALUES_TO_NAMES.find(val); + if (it != _SchemaType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kSchemaCompatibilityValues[] = { + SchemaCompatibility::NONE, + SchemaCompatibility::BACKWARD, + SchemaCompatibility::FORWARD, + SchemaCompatibility::BOTH +}; +const char* _kSchemaCompatibilityNames[] = { + "NONE", + "BACKWARD", + "FORWARD", + "BOTH" +}; +const std::map _SchemaCompatibility_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kSchemaCompatibilityValues, _kSchemaCompatibilityNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const SchemaCompatibility::type& val) { + std::map::const_iterator it = _SchemaCompatibility_VALUES_TO_NAMES.find(val); + if (it != _SchemaCompatibility_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const SchemaCompatibility::type& val) { + std::map::const_iterator it = _SchemaCompatibility_VALUES_TO_NAMES.find(val); + if (it != _SchemaCompatibility_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kSchemaValidationValues[] = { + SchemaValidation::LATEST, + SchemaValidation::ALL +}; +const char* _kSchemaValidationNames[] = { + "LATEST", + "ALL" +}; +const std::map _SchemaValidation_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kSchemaValidationValues, _kSchemaValidationNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const SchemaValidation::type& val) { + std::map::const_iterator it = _SchemaValidation_VALUES_TO_NAMES.find(val); + if (it != _SchemaValidation_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const SchemaValidation::type& val) { + std::map::const_iterator it = _SchemaValidation_VALUES_TO_NAMES.find(val); + if (it != _SchemaValidation_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kSchemaVersionStateValues[] = { + SchemaVersionState::INITIATED, + SchemaVersionState::START_REVIEW, + SchemaVersionState::CHANGES_REQUIRED, + SchemaVersionState::REVIEWED, + SchemaVersionState::ENABLED, + SchemaVersionState::DISABLED, + SchemaVersionState::ARCHIVED, + SchemaVersionState::DELETED +}; +const char* _kSchemaVersionStateNames[] = { + "INITIATED", + "START_REVIEW", + "CHANGES_REQUIRED", + "REVIEWED", + "ENABLED", + "DISABLED", + "ARCHIVED", + "DELETED" +}; +const std::map _SchemaVersionState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kSchemaVersionStateValues, _kSchemaVersionStateNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const SchemaVersionState::type& val) { + std::map::const_iterator it = _SchemaVersionState_VALUES_TO_NAMES.find(val); + if (it != _SchemaVersionState_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const SchemaVersionState::type& val) { + std::map::const_iterator it = _SchemaVersionState_VALUES_TO_NAMES.find(val); + if (it != _SchemaVersionState_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kDatabaseTypeValues[] = { + DatabaseType::NATIVE, + DatabaseType::REMOTE +}; +const char* _kDatabaseTypeNames[] = { + "NATIVE", + "REMOTE" +}; +const std::map _DatabaseType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kDatabaseTypeValues, _kDatabaseTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const DatabaseType::type& val) { + std::map::const_iterator it = _DatabaseType_VALUES_TO_NAMES.find(val); + if (it != _DatabaseType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const DatabaseType::type& val) { + std::map::const_iterator it = _DatabaseType_VALUES_TO_NAMES.find(val); + if (it != _DatabaseType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kFunctionTypeValues[] = { + FunctionType::JAVA +}; +const char* _kFunctionTypeNames[] = { + "JAVA" +}; +const std::map _FunctionType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kFunctionTypeValues, _kFunctionTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const FunctionType::type& val) { + std::map::const_iterator it = _FunctionType_VALUES_TO_NAMES.find(val); + if (it != _FunctionType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const FunctionType::type& val) { + std::map::const_iterator it = _FunctionType_VALUES_TO_NAMES.find(val); + if (it != _FunctionType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kResourceTypeValues[] = { + ResourceType::JAR, + ResourceType::FILE, + ResourceType::ARCHIVE +}; +const char* _kResourceTypeNames[] = { + "JAR", + "FILE", + "ARCHIVE" +}; +const std::map _ResourceType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kResourceTypeValues, _kResourceTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const ResourceType::type& val) { + std::map::const_iterator it = _ResourceType_VALUES_TO_NAMES.find(val); + if (it != _ResourceType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const ResourceType::type& val) { + std::map::const_iterator it = _ResourceType_VALUES_TO_NAMES.find(val); + if (it != _ResourceType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kTxnTypeValues[] = { + TxnType::DEFAULT, + TxnType::REPL_CREATED, + TxnType::READ_ONLY, + TxnType::COMPACTION, + TxnType::MATER_VIEW_REBUILD, + TxnType::SOFT_DELETE, + TxnType::REBALANCE_COMPACTION +}; +const char* _kTxnTypeNames[] = { + "DEFAULT", + "REPL_CREATED", + "READ_ONLY", + "COMPACTION", + "MATER_VIEW_REBUILD", + "SOFT_DELETE", + "REBALANCE_COMPACTION" +}; +const std::map _TxnType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(7, _kTxnTypeValues, _kTxnTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const TxnType::type& val) { + std::map::const_iterator it = _TxnType_VALUES_TO_NAMES.find(val); + if (it != _TxnType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const TxnType::type& val) { + std::map::const_iterator it = _TxnType_VALUES_TO_NAMES.find(val); + if (it != _TxnType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kGetTablesExtRequestFieldsValues[] = { + GetTablesExtRequestFields::ACCESS_TYPE, + GetTablesExtRequestFields::PROCESSOR_CAPABILITIES, + GetTablesExtRequestFields::ALL +}; +const char* _kGetTablesExtRequestFieldsNames[] = { + "ACCESS_TYPE", + "PROCESSOR_CAPABILITIES", + "ALL" +}; +const std::map _GetTablesExtRequestFields_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kGetTablesExtRequestFieldsValues, _kGetTablesExtRequestFieldsNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const GetTablesExtRequestFields::type& val) { + std::map::const_iterator it = _GetTablesExtRequestFields_VALUES_TO_NAMES.find(val); + if (it != _GetTablesExtRequestFields_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const GetTablesExtRequestFields::type& val) { + std::map::const_iterator it = _GetTablesExtRequestFields_VALUES_TO_NAMES.find(val); + if (it != _GetTablesExtRequestFields_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kCompactionMetricsMetricTypeValues[] = { + CompactionMetricsMetricType::NUM_OBSOLETE_DELTAS, + CompactionMetricsMetricType::NUM_DELTAS, + CompactionMetricsMetricType::NUM_SMALL_DELTAS +}; +const char* _kCompactionMetricsMetricTypeNames[] = { + "NUM_OBSOLETE_DELTAS", + "NUM_DELTAS", + "NUM_SMALL_DELTAS" +}; +const std::map _CompactionMetricsMetricType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kCompactionMetricsMetricTypeValues, _kCompactionMetricsMetricTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const CompactionMetricsMetricType::type& val) { + std::map::const_iterator it = _CompactionMetricsMetricType_VALUES_TO_NAMES.find(val); + if (it != _CompactionMetricsMetricType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const CompactionMetricsMetricType::type& val) { + std::map::const_iterator it = _CompactionMetricsMetricType_VALUES_TO_NAMES.find(val); + if (it != _CompactionMetricsMetricType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kFileMetadataExprTypeValues[] = { + FileMetadataExprType::ORC_SARG +}; +const char* _kFileMetadataExprTypeNames[] = { + "ORC_SARG" +}; +const std::map _FileMetadataExprType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kFileMetadataExprTypeValues, _kFileMetadataExprTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const FileMetadataExprType::type& val) { + std::map::const_iterator it = _FileMetadataExprType_VALUES_TO_NAMES.find(val); + if (it != _FileMetadataExprType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const FileMetadataExprType::type& val) { + std::map::const_iterator it = _FileMetadataExprType_VALUES_TO_NAMES.find(val); + if (it != _FileMetadataExprType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kClientCapabilityValues[] = { + ClientCapability::TEST_CAPABILITY, + ClientCapability::INSERT_ONLY_TABLES +}; +const char* _kClientCapabilityNames[] = { + "TEST_CAPABILITY", + "INSERT_ONLY_TABLES" +}; +const std::map _ClientCapability_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kClientCapabilityValues, _kClientCapabilityNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const ClientCapability::type& val) { + std::map::const_iterator it = _ClientCapability_VALUES_TO_NAMES.find(val); + if (it != _ClientCapability_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const ClientCapability::type& val) { + std::map::const_iterator it = _ClientCapability_VALUES_TO_NAMES.find(val); + if (it != _ClientCapability_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kWMResourcePlanStatusValues[] = { + WMResourcePlanStatus::ACTIVE, + WMResourcePlanStatus::ENABLED, + WMResourcePlanStatus::DISABLED +}; +const char* _kWMResourcePlanStatusNames[] = { + "ACTIVE", + "ENABLED", + "DISABLED" +}; +const std::map _WMResourcePlanStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kWMResourcePlanStatusValues, _kWMResourcePlanStatusNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const WMResourcePlanStatus::type& val) { + std::map::const_iterator it = _WMResourcePlanStatus_VALUES_TO_NAMES.find(val); + if (it != _WMResourcePlanStatus_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const WMResourcePlanStatus::type& val) { + std::map::const_iterator it = _WMResourcePlanStatus_VALUES_TO_NAMES.find(val); + if (it != _WMResourcePlanStatus_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kWMPoolSchedulingPolicyValues[] = { + WMPoolSchedulingPolicy::FAIR, + WMPoolSchedulingPolicy::FIFO +}; +const char* _kWMPoolSchedulingPolicyNames[] = { + "FAIR", + "FIFO" +}; +const std::map _WMPoolSchedulingPolicy_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kWMPoolSchedulingPolicyValues, _kWMPoolSchedulingPolicyNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const WMPoolSchedulingPolicy::type& val) { + std::map::const_iterator it = _WMPoolSchedulingPolicy_VALUES_TO_NAMES.find(val); + if (it != _WMPoolSchedulingPolicy_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const WMPoolSchedulingPolicy::type& val) { + std::map::const_iterator it = _WMPoolSchedulingPolicy_VALUES_TO_NAMES.find(val); + if (it != _WMPoolSchedulingPolicy_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kScheduledQueryMaintenanceRequestTypeValues[] = { + ScheduledQueryMaintenanceRequestType::CREATE, + ScheduledQueryMaintenanceRequestType::ALTER, + ScheduledQueryMaintenanceRequestType::DROP +}; +const char* _kScheduledQueryMaintenanceRequestTypeNames[] = { + "CREATE", + "ALTER", + "DROP" +}; +const std::map _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kScheduledQueryMaintenanceRequestTypeValues, _kScheduledQueryMaintenanceRequestTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryMaintenanceRequestType::type& val) { + std::map::const_iterator it = _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES.find(val); + if (it != _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const ScheduledQueryMaintenanceRequestType::type& val) { + std::map::const_iterator it = _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES.find(val); + if (it != _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kQueryStateValues[] = { + QueryState::INITED, + QueryState::EXECUTING, + QueryState::FAILED, + QueryState::FINISHED, + QueryState::TIMED_OUT, + QueryState::AUTO_DISABLED +}; +const char* _kQueryStateNames[] = { + "INITED", + "EXECUTING", + "FAILED", + "FINISHED", + "TIMED_OUT", + "AUTO_DISABLED" +}; +const std::map _QueryState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kQueryStateValues, _kQueryStateNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const QueryState::type& val) { + std::map::const_iterator it = _QueryState_VALUES_TO_NAMES.find(val); + if (it != _QueryState_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const QueryState::type& val) { + std::map::const_iterator it = _QueryState_VALUES_TO_NAMES.find(val); + if (it != _QueryState_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kPartitionFilterModeValues[] = { + PartitionFilterMode::BY_NAMES, + PartitionFilterMode::BY_VALUES, + PartitionFilterMode::BY_EXPR +}; +const char* _kPartitionFilterModeNames[] = { + "BY_NAMES", + "BY_VALUES", + "BY_EXPR" +}; +const std::map _PartitionFilterMode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kPartitionFilterModeValues, _kPartitionFilterModeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const PartitionFilterMode::type& val) { + std::map::const_iterator it = _PartitionFilterMode_VALUES_TO_NAMES.find(val); + if (it != _PartitionFilterMode_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const PartitionFilterMode::type& val) { + std::map::const_iterator it = _PartitionFilterMode_VALUES_TO_NAMES.find(val); + if (it != _PartitionFilterMode_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + + +Version::~Version() noexcept { +} + +Version::Version() noexcept + : version(), + comments() { +} + +void Version::__set_version(const std::string& val) { + this->version = val; +} + +void Version::__set_comments(const std::string& val) { + this->comments = val; +} +std::ostream& operator<<(std::ostream& out, const Version& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Version::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->version); + this->__isset.version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comments); + this->__isset.comments = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Version::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Version"); + + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->version); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("comments", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->comments); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Version &a, Version &b) noexcept { + using ::std::swap; + swap(a.version, b.version); + swap(a.comments, b.comments); + swap(a.__isset, b.__isset); +} + +bool Version::operator==(const Version & rhs) const +{ + if (!(version == rhs.version)) + return false; + if (!(comments == rhs.comments)) + return false; + return true; +} + +Version::Version(const Version& other0) { + version = other0.version; + comments = other0.comments; + __isset = other0.__isset; +} +Version& Version::operator=(const Version& other1) { + version = other1.version; + comments = other1.comments; + __isset = other1.__isset; + return *this; +} +void Version::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Version("; + out << "version=" << to_string(version); + out << ", " << "comments=" << to_string(comments); + out << ")"; +} + + +FieldSchema::~FieldSchema() noexcept { +} + +FieldSchema::FieldSchema() noexcept + : name(), + type(), + comment() { +} + +void FieldSchema::__set_name(const std::string& val) { + this->name = val; +} + +void FieldSchema::__set_type(const std::string& val) { + this->type = val; +} + +void FieldSchema::__set_comment(const std::string& val) { + this->comment = val; +} +std::ostream& operator<<(std::ostream& out, const FieldSchema& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FieldSchema::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comment); + this->__isset.comment = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FieldSchema::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FieldSchema"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->type); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("comment", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->comment); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FieldSchema &a, FieldSchema &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.type, b.type); + swap(a.comment, b.comment); + swap(a.__isset, b.__isset); +} + +bool FieldSchema::operator==(const FieldSchema & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(type == rhs.type)) + return false; + if (!(comment == rhs.comment)) + return false; + return true; +} + +FieldSchema::FieldSchema(const FieldSchema& other2) { + name = other2.name; + type = other2.type; + comment = other2.comment; + __isset = other2.__isset; +} +FieldSchema& FieldSchema::operator=(const FieldSchema& other3) { + name = other3.name; + type = other3.type; + comment = other3.comment; + __isset = other3.__isset; + return *this; +} +void FieldSchema::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FieldSchema("; + out << "name=" << to_string(name); + out << ", " << "type=" << to_string(type); + out << ", " << "comment=" << to_string(comment); + out << ")"; +} + + +EnvironmentContext::~EnvironmentContext() noexcept { +} + +EnvironmentContext::EnvironmentContext() noexcept { +} + +void EnvironmentContext::__set_properties(const std::map & val) { + this->properties = val; +} +std::ostream& operator<<(std::ostream& out, const EnvironmentContext& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t EnvironmentContext::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->properties.clear(); + uint32_t _size4; + ::apache::thrift::protocol::TType _ktype5; + ::apache::thrift::protocol::TType _vtype6; + xfer += iprot->readMapBegin(_ktype5, _vtype6, _size4); + uint32_t _i8; + for (_i8 = 0; _i8 < _size4; ++_i8) + { + std::string _key9; + xfer += iprot->readString(_key9); + std::string& _val10 = this->properties[_key9]; + xfer += iprot->readString(_val10); + } + xfer += iprot->readMapEnd(); + } + this->__isset.properties = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t EnvironmentContext::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("EnvironmentContext"); + + xfer += oprot->writeFieldBegin("properties", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->properties.size())); + std::map ::const_iterator _iter11; + for (_iter11 = this->properties.begin(); _iter11 != this->properties.end(); ++_iter11) + { + xfer += oprot->writeString(_iter11->first); + xfer += oprot->writeString(_iter11->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(EnvironmentContext &a, EnvironmentContext &b) noexcept { + using ::std::swap; + swap(a.properties, b.properties); + swap(a.__isset, b.__isset); +} + +bool EnvironmentContext::operator==(const EnvironmentContext & rhs) const +{ + if (!(properties == rhs.properties)) + return false; + return true; +} + +EnvironmentContext::EnvironmentContext(const EnvironmentContext& other12) { + properties = other12.properties; + __isset = other12.__isset; +} +EnvironmentContext& EnvironmentContext::operator=(const EnvironmentContext& other13) { + properties = other13.properties; + __isset = other13.__isset; + return *this; +} +void EnvironmentContext::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "EnvironmentContext("; + out << "properties=" << to_string(properties); + out << ")"; +} + + +SQLPrimaryKey::~SQLPrimaryKey() noexcept { +} + +SQLPrimaryKey::SQLPrimaryKey() noexcept + : table_db(), + table_name(), + column_name(), + key_seq(0), + pk_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0), + catName() { +} + +void SQLPrimaryKey::__set_table_db(const std::string& val) { + this->table_db = val; +} + +void SQLPrimaryKey::__set_table_name(const std::string& val) { + this->table_name = val; +} + +void SQLPrimaryKey::__set_column_name(const std::string& val) { + this->column_name = val; +} + +void SQLPrimaryKey::__set_key_seq(const int32_t val) { + this->key_seq = val; +} + +void SQLPrimaryKey::__set_pk_name(const std::string& val) { + this->pk_name = val; +} + +void SQLPrimaryKey::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLPrimaryKey::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLPrimaryKey::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} + +void SQLPrimaryKey::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const SQLPrimaryKey& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLPrimaryKey::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_db); + this->__isset.table_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_name); + this->__isset.column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->key_seq); + this->__isset.key_seq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pk_name); + this->__isset.pk_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLPrimaryKey::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLPrimaryKey"); + + xfer += oprot->writeFieldBegin("table_db", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->table_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->column_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key_seq", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->key_seq); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pk_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->pk_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLPrimaryKey &a, SQLPrimaryKey &b) noexcept { + using ::std::swap; + swap(a.table_db, b.table_db); + swap(a.table_name, b.table_name); + swap(a.column_name, b.column_name); + swap(a.key_seq, b.key_seq); + swap(a.pk_name, b.pk_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool SQLPrimaryKey::operator==(const SQLPrimaryKey & rhs) const +{ + if (!(table_db == rhs.table_db)) + return false; + if (!(table_name == rhs.table_name)) + return false; + if (!(column_name == rhs.column_name)) + return false; + if (!(key_seq == rhs.key_seq)) + return false; + if (!(pk_name == rhs.pk_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +SQLPrimaryKey::SQLPrimaryKey(const SQLPrimaryKey& other14) { + table_db = other14.table_db; + table_name = other14.table_name; + column_name = other14.column_name; + key_seq = other14.key_seq; + pk_name = other14.pk_name; + enable_cstr = other14.enable_cstr; + validate_cstr = other14.validate_cstr; + rely_cstr = other14.rely_cstr; + catName = other14.catName; + __isset = other14.__isset; +} +SQLPrimaryKey& SQLPrimaryKey::operator=(const SQLPrimaryKey& other15) { + table_db = other15.table_db; + table_name = other15.table_name; + column_name = other15.column_name; + key_seq = other15.key_seq; + pk_name = other15.pk_name; + enable_cstr = other15.enable_cstr; + validate_cstr = other15.validate_cstr; + rely_cstr = other15.rely_cstr; + catName = other15.catName; + __isset = other15.__isset; + return *this; +} +void SQLPrimaryKey::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLPrimaryKey("; + out << "table_db=" << to_string(table_db); + out << ", " << "table_name=" << to_string(table_name); + out << ", " << "column_name=" << to_string(column_name); + out << ", " << "key_seq=" << to_string(key_seq); + out << ", " << "pk_name=" << to_string(pk_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +SQLForeignKey::~SQLForeignKey() noexcept { +} + +SQLForeignKey::SQLForeignKey() noexcept + : pktable_db(), + pktable_name(), + pkcolumn_name(), + fktable_db(), + fktable_name(), + fkcolumn_name(), + key_seq(0), + update_rule(0), + delete_rule(0), + fk_name(), + pk_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0), + catName() { +} + +void SQLForeignKey::__set_pktable_db(const std::string& val) { + this->pktable_db = val; +} + +void SQLForeignKey::__set_pktable_name(const std::string& val) { + this->pktable_name = val; +} + +void SQLForeignKey::__set_pkcolumn_name(const std::string& val) { + this->pkcolumn_name = val; +} + +void SQLForeignKey::__set_fktable_db(const std::string& val) { + this->fktable_db = val; +} + +void SQLForeignKey::__set_fktable_name(const std::string& val) { + this->fktable_name = val; +} + +void SQLForeignKey::__set_fkcolumn_name(const std::string& val) { + this->fkcolumn_name = val; +} + +void SQLForeignKey::__set_key_seq(const int32_t val) { + this->key_seq = val; +} + +void SQLForeignKey::__set_update_rule(const int32_t val) { + this->update_rule = val; +} + +void SQLForeignKey::__set_delete_rule(const int32_t val) { + this->delete_rule = val; +} + +void SQLForeignKey::__set_fk_name(const std::string& val) { + this->fk_name = val; +} + +void SQLForeignKey::__set_pk_name(const std::string& val) { + this->pk_name = val; +} + +void SQLForeignKey::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLForeignKey::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLForeignKey::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} + +void SQLForeignKey::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const SQLForeignKey& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLForeignKey::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pktable_db); + this->__isset.pktable_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pktable_name); + this->__isset.pktable_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pkcolumn_name); + this->__isset.pkcolumn_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fktable_db); + this->__isset.fktable_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fktable_name); + this->__isset.fktable_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fkcolumn_name); + this->__isset.fkcolumn_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->key_seq); + this->__isset.key_seq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->update_rule); + this->__isset.update_rule = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->delete_rule); + this->__isset.delete_rule = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fk_name); + this->__isset.fk_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pk_name); + this->__isset.pk_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLForeignKey::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLForeignKey"); + + xfer += oprot->writeFieldBegin("pktable_db", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->pktable_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pktable_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->pktable_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pkcolumn_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->pkcolumn_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("fktable_db", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->fktable_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("fktable_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->fktable_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("fkcolumn_name", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->fkcolumn_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key_seq", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(this->key_seq); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("update_rule", ::apache::thrift::protocol::T_I32, 8); + xfer += oprot->writeI32(this->update_rule); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("delete_rule", ::apache::thrift::protocol::T_I32, 9); + xfer += oprot->writeI32(this->delete_rule); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("fk_name", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->fk_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pk_name", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->pk_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 12); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 13); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 14); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 15); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLForeignKey &a, SQLForeignKey &b) noexcept { + using ::std::swap; + swap(a.pktable_db, b.pktable_db); + swap(a.pktable_name, b.pktable_name); + swap(a.pkcolumn_name, b.pkcolumn_name); + swap(a.fktable_db, b.fktable_db); + swap(a.fktable_name, b.fktable_name); + swap(a.fkcolumn_name, b.fkcolumn_name); + swap(a.key_seq, b.key_seq); + swap(a.update_rule, b.update_rule); + swap(a.delete_rule, b.delete_rule); + swap(a.fk_name, b.fk_name); + swap(a.pk_name, b.pk_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool SQLForeignKey::operator==(const SQLForeignKey & rhs) const +{ + if (!(pktable_db == rhs.pktable_db)) + return false; + if (!(pktable_name == rhs.pktable_name)) + return false; + if (!(pkcolumn_name == rhs.pkcolumn_name)) + return false; + if (!(fktable_db == rhs.fktable_db)) + return false; + if (!(fktable_name == rhs.fktable_name)) + return false; + if (!(fkcolumn_name == rhs.fkcolumn_name)) + return false; + if (!(key_seq == rhs.key_seq)) + return false; + if (!(update_rule == rhs.update_rule)) + return false; + if (!(delete_rule == rhs.delete_rule)) + return false; + if (!(fk_name == rhs.fk_name)) + return false; + if (!(pk_name == rhs.pk_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +SQLForeignKey::SQLForeignKey(const SQLForeignKey& other16) { + pktable_db = other16.pktable_db; + pktable_name = other16.pktable_name; + pkcolumn_name = other16.pkcolumn_name; + fktable_db = other16.fktable_db; + fktable_name = other16.fktable_name; + fkcolumn_name = other16.fkcolumn_name; + key_seq = other16.key_seq; + update_rule = other16.update_rule; + delete_rule = other16.delete_rule; + fk_name = other16.fk_name; + pk_name = other16.pk_name; + enable_cstr = other16.enable_cstr; + validate_cstr = other16.validate_cstr; + rely_cstr = other16.rely_cstr; + catName = other16.catName; + __isset = other16.__isset; +} +SQLForeignKey& SQLForeignKey::operator=(const SQLForeignKey& other17) { + pktable_db = other17.pktable_db; + pktable_name = other17.pktable_name; + pkcolumn_name = other17.pkcolumn_name; + fktable_db = other17.fktable_db; + fktable_name = other17.fktable_name; + fkcolumn_name = other17.fkcolumn_name; + key_seq = other17.key_seq; + update_rule = other17.update_rule; + delete_rule = other17.delete_rule; + fk_name = other17.fk_name; + pk_name = other17.pk_name; + enable_cstr = other17.enable_cstr; + validate_cstr = other17.validate_cstr; + rely_cstr = other17.rely_cstr; + catName = other17.catName; + __isset = other17.__isset; + return *this; +} +void SQLForeignKey::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLForeignKey("; + out << "pktable_db=" << to_string(pktable_db); + out << ", " << "pktable_name=" << to_string(pktable_name); + out << ", " << "pkcolumn_name=" << to_string(pkcolumn_name); + out << ", " << "fktable_db=" << to_string(fktable_db); + out << ", " << "fktable_name=" << to_string(fktable_name); + out << ", " << "fkcolumn_name=" << to_string(fkcolumn_name); + out << ", " << "key_seq=" << to_string(key_seq); + out << ", " << "update_rule=" << to_string(update_rule); + out << ", " << "delete_rule=" << to_string(delete_rule); + out << ", " << "fk_name=" << to_string(fk_name); + out << ", " << "pk_name=" << to_string(pk_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +SQLUniqueConstraint::~SQLUniqueConstraint() noexcept { +} + +SQLUniqueConstraint::SQLUniqueConstraint() noexcept + : catName(), + table_db(), + table_name(), + column_name(), + key_seq(0), + uk_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0) { +} + +void SQLUniqueConstraint::__set_catName(const std::string& val) { + this->catName = val; +} + +void SQLUniqueConstraint::__set_table_db(const std::string& val) { + this->table_db = val; +} + +void SQLUniqueConstraint::__set_table_name(const std::string& val) { + this->table_name = val; +} + +void SQLUniqueConstraint::__set_column_name(const std::string& val) { + this->column_name = val; +} + +void SQLUniqueConstraint::__set_key_seq(const int32_t val) { + this->key_seq = val; +} + +void SQLUniqueConstraint::__set_uk_name(const std::string& val) { + this->uk_name = val; +} + +void SQLUniqueConstraint::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLUniqueConstraint::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLUniqueConstraint::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} +std::ostream& operator<<(std::ostream& out, const SQLUniqueConstraint& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLUniqueConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_db); + this->__isset.table_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_name); + this->__isset.column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->key_seq); + this->__isset.key_seq = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->uk_name); + this->__isset.uk_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLUniqueConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLUniqueConstraint"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->column_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key_seq", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->key_seq); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("uk_name", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->uk_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 9); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLUniqueConstraint &a, SQLUniqueConstraint &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.table_db, b.table_db); + swap(a.table_name, b.table_name); + swap(a.column_name, b.column_name); + swap(a.key_seq, b.key_seq); + swap(a.uk_name, b.uk_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.__isset, b.__isset); +} + +bool SQLUniqueConstraint::operator==(const SQLUniqueConstraint & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(table_db == rhs.table_db)) + return false; + if (!(table_name == rhs.table_name)) + return false; + if (!(column_name == rhs.column_name)) + return false; + if (!(key_seq == rhs.key_seq)) + return false; + if (!(uk_name == rhs.uk_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + return true; +} + +SQLUniqueConstraint::SQLUniqueConstraint(const SQLUniqueConstraint& other18) { + catName = other18.catName; + table_db = other18.table_db; + table_name = other18.table_name; + column_name = other18.column_name; + key_seq = other18.key_seq; + uk_name = other18.uk_name; + enable_cstr = other18.enable_cstr; + validate_cstr = other18.validate_cstr; + rely_cstr = other18.rely_cstr; + __isset = other18.__isset; +} +SQLUniqueConstraint& SQLUniqueConstraint::operator=(const SQLUniqueConstraint& other19) { + catName = other19.catName; + table_db = other19.table_db; + table_name = other19.table_name; + column_name = other19.column_name; + key_seq = other19.key_seq; + uk_name = other19.uk_name; + enable_cstr = other19.enable_cstr; + validate_cstr = other19.validate_cstr; + rely_cstr = other19.rely_cstr; + __isset = other19.__isset; + return *this; +} +void SQLUniqueConstraint::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLUniqueConstraint("; + out << "catName=" << to_string(catName); + out << ", " << "table_db=" << to_string(table_db); + out << ", " << "table_name=" << to_string(table_name); + out << ", " << "column_name=" << to_string(column_name); + out << ", " << "key_seq=" << to_string(key_seq); + out << ", " << "uk_name=" << to_string(uk_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ")"; +} + + +SQLNotNullConstraint::~SQLNotNullConstraint() noexcept { +} + +SQLNotNullConstraint::SQLNotNullConstraint() noexcept + : catName(), + table_db(), + table_name(), + column_name(), + nn_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0) { +} + +void SQLNotNullConstraint::__set_catName(const std::string& val) { + this->catName = val; +} + +void SQLNotNullConstraint::__set_table_db(const std::string& val) { + this->table_db = val; +} + +void SQLNotNullConstraint::__set_table_name(const std::string& val) { + this->table_name = val; +} + +void SQLNotNullConstraint::__set_column_name(const std::string& val) { + this->column_name = val; +} + +void SQLNotNullConstraint::__set_nn_name(const std::string& val) { + this->nn_name = val; +} + +void SQLNotNullConstraint::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLNotNullConstraint::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLNotNullConstraint::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} +std::ostream& operator<<(std::ostream& out, const SQLNotNullConstraint& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLNotNullConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_db); + this->__isset.table_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_name); + this->__isset.column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->nn_name); + this->__isset.nn_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLNotNullConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLNotNullConstraint"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->column_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nn_name", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->nn_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLNotNullConstraint &a, SQLNotNullConstraint &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.table_db, b.table_db); + swap(a.table_name, b.table_name); + swap(a.column_name, b.column_name); + swap(a.nn_name, b.nn_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.__isset, b.__isset); +} + +bool SQLNotNullConstraint::operator==(const SQLNotNullConstraint & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(table_db == rhs.table_db)) + return false; + if (!(table_name == rhs.table_name)) + return false; + if (!(column_name == rhs.column_name)) + return false; + if (!(nn_name == rhs.nn_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + return true; +} + +SQLNotNullConstraint::SQLNotNullConstraint(const SQLNotNullConstraint& other20) { + catName = other20.catName; + table_db = other20.table_db; + table_name = other20.table_name; + column_name = other20.column_name; + nn_name = other20.nn_name; + enable_cstr = other20.enable_cstr; + validate_cstr = other20.validate_cstr; + rely_cstr = other20.rely_cstr; + __isset = other20.__isset; +} +SQLNotNullConstraint& SQLNotNullConstraint::operator=(const SQLNotNullConstraint& other21) { + catName = other21.catName; + table_db = other21.table_db; + table_name = other21.table_name; + column_name = other21.column_name; + nn_name = other21.nn_name; + enable_cstr = other21.enable_cstr; + validate_cstr = other21.validate_cstr; + rely_cstr = other21.rely_cstr; + __isset = other21.__isset; + return *this; +} +void SQLNotNullConstraint::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLNotNullConstraint("; + out << "catName=" << to_string(catName); + out << ", " << "table_db=" << to_string(table_db); + out << ", " << "table_name=" << to_string(table_name); + out << ", " << "column_name=" << to_string(column_name); + out << ", " << "nn_name=" << to_string(nn_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ")"; +} + + +SQLDefaultConstraint::~SQLDefaultConstraint() noexcept { +} + +SQLDefaultConstraint::SQLDefaultConstraint() noexcept + : catName(), + table_db(), + table_name(), + column_name(), + default_value(), + dc_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0) { +} + +void SQLDefaultConstraint::__set_catName(const std::string& val) { + this->catName = val; +} + +void SQLDefaultConstraint::__set_table_db(const std::string& val) { + this->table_db = val; +} + +void SQLDefaultConstraint::__set_table_name(const std::string& val) { + this->table_name = val; +} + +void SQLDefaultConstraint::__set_column_name(const std::string& val) { + this->column_name = val; +} + +void SQLDefaultConstraint::__set_default_value(const std::string& val) { + this->default_value = val; +} + +void SQLDefaultConstraint::__set_dc_name(const std::string& val) { + this->dc_name = val; +} + +void SQLDefaultConstraint::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLDefaultConstraint::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLDefaultConstraint::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} +std::ostream& operator<<(std::ostream& out, const SQLDefaultConstraint& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLDefaultConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_db); + this->__isset.table_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_name); + this->__isset.column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->default_value); + this->__isset.default_value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dc_name); + this->__isset.dc_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLDefaultConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLDefaultConstraint"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->column_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("default_value", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->default_value); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dc_name", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->dc_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 9); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLDefaultConstraint &a, SQLDefaultConstraint &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.table_db, b.table_db); + swap(a.table_name, b.table_name); + swap(a.column_name, b.column_name); + swap(a.default_value, b.default_value); + swap(a.dc_name, b.dc_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.__isset, b.__isset); +} + +bool SQLDefaultConstraint::operator==(const SQLDefaultConstraint & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(table_db == rhs.table_db)) + return false; + if (!(table_name == rhs.table_name)) + return false; + if (!(column_name == rhs.column_name)) + return false; + if (!(default_value == rhs.default_value)) + return false; + if (!(dc_name == rhs.dc_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + return true; +} + +SQLDefaultConstraint::SQLDefaultConstraint(const SQLDefaultConstraint& other22) { + catName = other22.catName; + table_db = other22.table_db; + table_name = other22.table_name; + column_name = other22.column_name; + default_value = other22.default_value; + dc_name = other22.dc_name; + enable_cstr = other22.enable_cstr; + validate_cstr = other22.validate_cstr; + rely_cstr = other22.rely_cstr; + __isset = other22.__isset; +} +SQLDefaultConstraint& SQLDefaultConstraint::operator=(const SQLDefaultConstraint& other23) { + catName = other23.catName; + table_db = other23.table_db; + table_name = other23.table_name; + column_name = other23.column_name; + default_value = other23.default_value; + dc_name = other23.dc_name; + enable_cstr = other23.enable_cstr; + validate_cstr = other23.validate_cstr; + rely_cstr = other23.rely_cstr; + __isset = other23.__isset; + return *this; +} +void SQLDefaultConstraint::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLDefaultConstraint("; + out << "catName=" << to_string(catName); + out << ", " << "table_db=" << to_string(table_db); + out << ", " << "table_name=" << to_string(table_name); + out << ", " << "column_name=" << to_string(column_name); + out << ", " << "default_value=" << to_string(default_value); + out << ", " << "dc_name=" << to_string(dc_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ")"; +} + + +SQLCheckConstraint::~SQLCheckConstraint() noexcept { +} + +SQLCheckConstraint::SQLCheckConstraint() noexcept + : catName(), + table_db(), + table_name(), + column_name(), + check_expression(), + dc_name(), + enable_cstr(0), + validate_cstr(0), + rely_cstr(0) { +} + +void SQLCheckConstraint::__set_catName(const std::string& val) { + this->catName = val; +} + +void SQLCheckConstraint::__set_table_db(const std::string& val) { + this->table_db = val; +} + +void SQLCheckConstraint::__set_table_name(const std::string& val) { + this->table_name = val; +} + +void SQLCheckConstraint::__set_column_name(const std::string& val) { + this->column_name = val; +} + +void SQLCheckConstraint::__set_check_expression(const std::string& val) { + this->check_expression = val; +} + +void SQLCheckConstraint::__set_dc_name(const std::string& val) { + this->dc_name = val; +} + +void SQLCheckConstraint::__set_enable_cstr(const bool val) { + this->enable_cstr = val; +} + +void SQLCheckConstraint::__set_validate_cstr(const bool val) { + this->validate_cstr = val; +} + +void SQLCheckConstraint::__set_rely_cstr(const bool val) { + this->rely_cstr = val; +} +std::ostream& operator<<(std::ostream& out, const SQLCheckConstraint& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLCheckConstraint::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_db); + this->__isset.table_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table_name); + this->__isset.table_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_name); + this->__isset.column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->check_expression); + this->__isset.check_expression = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dc_name); + this->__isset.dc_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enable_cstr); + this->__isset.enable_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->validate_cstr); + this->__isset.validate_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rely_cstr); + this->__isset.rely_cstr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLCheckConstraint::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLCheckConstraint"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->table_db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->column_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("check_expression", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->check_expression); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dc_name", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->dc_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("enable_cstr", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->enable_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validate_cstr", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->validate_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rely_cstr", ::apache::thrift::protocol::T_BOOL, 9); + xfer += oprot->writeBool(this->rely_cstr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLCheckConstraint &a, SQLCheckConstraint &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.table_db, b.table_db); + swap(a.table_name, b.table_name); + swap(a.column_name, b.column_name); + swap(a.check_expression, b.check_expression); + swap(a.dc_name, b.dc_name); + swap(a.enable_cstr, b.enable_cstr); + swap(a.validate_cstr, b.validate_cstr); + swap(a.rely_cstr, b.rely_cstr); + swap(a.__isset, b.__isset); +} + +bool SQLCheckConstraint::operator==(const SQLCheckConstraint & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(table_db == rhs.table_db)) + return false; + if (!(table_name == rhs.table_name)) + return false; + if (!(column_name == rhs.column_name)) + return false; + if (!(check_expression == rhs.check_expression)) + return false; + if (!(dc_name == rhs.dc_name)) + return false; + if (!(enable_cstr == rhs.enable_cstr)) + return false; + if (!(validate_cstr == rhs.validate_cstr)) + return false; + if (!(rely_cstr == rhs.rely_cstr)) + return false; + return true; +} + +SQLCheckConstraint::SQLCheckConstraint(const SQLCheckConstraint& other24) { + catName = other24.catName; + table_db = other24.table_db; + table_name = other24.table_name; + column_name = other24.column_name; + check_expression = other24.check_expression; + dc_name = other24.dc_name; + enable_cstr = other24.enable_cstr; + validate_cstr = other24.validate_cstr; + rely_cstr = other24.rely_cstr; + __isset = other24.__isset; +} +SQLCheckConstraint& SQLCheckConstraint::operator=(const SQLCheckConstraint& other25) { + catName = other25.catName; + table_db = other25.table_db; + table_name = other25.table_name; + column_name = other25.column_name; + check_expression = other25.check_expression; + dc_name = other25.dc_name; + enable_cstr = other25.enable_cstr; + validate_cstr = other25.validate_cstr; + rely_cstr = other25.rely_cstr; + __isset = other25.__isset; + return *this; +} +void SQLCheckConstraint::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLCheckConstraint("; + out << "catName=" << to_string(catName); + out << ", " << "table_db=" << to_string(table_db); + out << ", " << "table_name=" << to_string(table_name); + out << ", " << "column_name=" << to_string(column_name); + out << ", " << "check_expression=" << to_string(check_expression); + out << ", " << "dc_name=" << to_string(dc_name); + out << ", " << "enable_cstr=" << to_string(enable_cstr); + out << ", " << "validate_cstr=" << to_string(validate_cstr); + out << ", " << "rely_cstr=" << to_string(rely_cstr); + out << ")"; +} + + +SQLAllTableConstraints::~SQLAllTableConstraints() noexcept { +} + +SQLAllTableConstraints::SQLAllTableConstraints() noexcept { +} + +void SQLAllTableConstraints::__set_primaryKeys(const std::vector & val) { + this->primaryKeys = val; +__isset.primaryKeys = true; +} + +void SQLAllTableConstraints::__set_foreignKeys(const std::vector & val) { + this->foreignKeys = val; +__isset.foreignKeys = true; +} + +void SQLAllTableConstraints::__set_uniqueConstraints(const std::vector & val) { + this->uniqueConstraints = val; +__isset.uniqueConstraints = true; +} + +void SQLAllTableConstraints::__set_notNullConstraints(const std::vector & val) { + this->notNullConstraints = val; +__isset.notNullConstraints = true; +} + +void SQLAllTableConstraints::__set_defaultConstraints(const std::vector & val) { + this->defaultConstraints = val; +__isset.defaultConstraints = true; +} + +void SQLAllTableConstraints::__set_checkConstraints(const std::vector & val) { + this->checkConstraints = val; +__isset.checkConstraints = true; +} +std::ostream& operator<<(std::ostream& out, const SQLAllTableConstraints& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SQLAllTableConstraints::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->primaryKeys.clear(); + uint32_t _size26; + ::apache::thrift::protocol::TType _etype29; + xfer += iprot->readListBegin(_etype29, _size26); + this->primaryKeys.resize(_size26); + uint32_t _i30; + for (_i30 = 0; _i30 < _size26; ++_i30) + { + xfer += this->primaryKeys[_i30].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.primaryKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->foreignKeys.clear(); + uint32_t _size31; + ::apache::thrift::protocol::TType _etype34; + xfer += iprot->readListBegin(_etype34, _size31); + this->foreignKeys.resize(_size31); + uint32_t _i35; + for (_i35 = 0; _i35 < _size31; ++_i35) + { + xfer += this->foreignKeys[_i35].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.foreignKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->uniqueConstraints.clear(); + uint32_t _size36; + ::apache::thrift::protocol::TType _etype39; + xfer += iprot->readListBegin(_etype39, _size36); + this->uniqueConstraints.resize(_size36); + uint32_t _i40; + for (_i40 = 0; _i40 < _size36; ++_i40) + { + xfer += this->uniqueConstraints[_i40].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.uniqueConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->notNullConstraints.clear(); + uint32_t _size41; + ::apache::thrift::protocol::TType _etype44; + xfer += iprot->readListBegin(_etype44, _size41); + this->notNullConstraints.resize(_size41); + uint32_t _i45; + for (_i45 = 0; _i45 < _size41; ++_i45) + { + xfer += this->notNullConstraints[_i45].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.notNullConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->defaultConstraints.clear(); + uint32_t _size46; + ::apache::thrift::protocol::TType _etype49; + xfer += iprot->readListBegin(_etype49, _size46); + this->defaultConstraints.resize(_size46); + uint32_t _i50; + for (_i50 = 0; _i50 < _size46; ++_i50) + { + xfer += this->defaultConstraints[_i50].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.defaultConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->checkConstraints.clear(); + uint32_t _size51; + ::apache::thrift::protocol::TType _etype54; + xfer += iprot->readListBegin(_etype54, _size51); + this->checkConstraints.resize(_size51); + uint32_t _i55; + for (_i55 = 0; _i55 < _size51; ++_i55) + { + xfer += this->checkConstraints[_i55].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.checkConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SQLAllTableConstraints::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SQLAllTableConstraints"); + + if (this->__isset.primaryKeys) { + xfer += oprot->writeFieldBegin("primaryKeys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->primaryKeys.size())); + std::vector ::const_iterator _iter56; + for (_iter56 = this->primaryKeys.begin(); _iter56 != this->primaryKeys.end(); ++_iter56) + { + xfer += (*_iter56).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.foreignKeys) { + xfer += oprot->writeFieldBegin("foreignKeys", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->foreignKeys.size())); + std::vector ::const_iterator _iter57; + for (_iter57 = this->foreignKeys.begin(); _iter57 != this->foreignKeys.end(); ++_iter57) + { + xfer += (*_iter57).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.uniqueConstraints) { + xfer += oprot->writeFieldBegin("uniqueConstraints", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->uniqueConstraints.size())); + std::vector ::const_iterator _iter58; + for (_iter58 = this->uniqueConstraints.begin(); _iter58 != this->uniqueConstraints.end(); ++_iter58) + { + xfer += (*_iter58).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.notNullConstraints) { + xfer += oprot->writeFieldBegin("notNullConstraints", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->notNullConstraints.size())); + std::vector ::const_iterator _iter59; + for (_iter59 = this->notNullConstraints.begin(); _iter59 != this->notNullConstraints.end(); ++_iter59) + { + xfer += (*_iter59).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.defaultConstraints) { + xfer += oprot->writeFieldBegin("defaultConstraints", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->defaultConstraints.size())); + std::vector ::const_iterator _iter60; + for (_iter60 = this->defaultConstraints.begin(); _iter60 != this->defaultConstraints.end(); ++_iter60) + { + xfer += (*_iter60).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.checkConstraints) { + xfer += oprot->writeFieldBegin("checkConstraints", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->checkConstraints.size())); + std::vector ::const_iterator _iter61; + for (_iter61 = this->checkConstraints.begin(); _iter61 != this->checkConstraints.end(); ++_iter61) + { + xfer += (*_iter61).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SQLAllTableConstraints &a, SQLAllTableConstraints &b) noexcept { + using ::std::swap; + swap(a.primaryKeys, b.primaryKeys); + swap(a.foreignKeys, b.foreignKeys); + swap(a.uniqueConstraints, b.uniqueConstraints); + swap(a.notNullConstraints, b.notNullConstraints); + swap(a.defaultConstraints, b.defaultConstraints); + swap(a.checkConstraints, b.checkConstraints); + swap(a.__isset, b.__isset); +} + +bool SQLAllTableConstraints::operator==(const SQLAllTableConstraints & rhs) const +{ + if (__isset.primaryKeys != rhs.__isset.primaryKeys) + return false; + else if (__isset.primaryKeys && !(primaryKeys == rhs.primaryKeys)) + return false; + if (__isset.foreignKeys != rhs.__isset.foreignKeys) + return false; + else if (__isset.foreignKeys && !(foreignKeys == rhs.foreignKeys)) + return false; + if (__isset.uniqueConstraints != rhs.__isset.uniqueConstraints) + return false; + else if (__isset.uniqueConstraints && !(uniqueConstraints == rhs.uniqueConstraints)) + return false; + if (__isset.notNullConstraints != rhs.__isset.notNullConstraints) + return false; + else if (__isset.notNullConstraints && !(notNullConstraints == rhs.notNullConstraints)) + return false; + if (__isset.defaultConstraints != rhs.__isset.defaultConstraints) + return false; + else if (__isset.defaultConstraints && !(defaultConstraints == rhs.defaultConstraints)) + return false; + if (__isset.checkConstraints != rhs.__isset.checkConstraints) + return false; + else if (__isset.checkConstraints && !(checkConstraints == rhs.checkConstraints)) + return false; + return true; +} + +SQLAllTableConstraints::SQLAllTableConstraints(const SQLAllTableConstraints& other62) { + primaryKeys = other62.primaryKeys; + foreignKeys = other62.foreignKeys; + uniqueConstraints = other62.uniqueConstraints; + notNullConstraints = other62.notNullConstraints; + defaultConstraints = other62.defaultConstraints; + checkConstraints = other62.checkConstraints; + __isset = other62.__isset; +} +SQLAllTableConstraints& SQLAllTableConstraints::operator=(const SQLAllTableConstraints& other63) { + primaryKeys = other63.primaryKeys; + foreignKeys = other63.foreignKeys; + uniqueConstraints = other63.uniqueConstraints; + notNullConstraints = other63.notNullConstraints; + defaultConstraints = other63.defaultConstraints; + checkConstraints = other63.checkConstraints; + __isset = other63.__isset; + return *this; +} +void SQLAllTableConstraints::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SQLAllTableConstraints("; + out << "primaryKeys="; (__isset.primaryKeys ? (out << to_string(primaryKeys)) : (out << "")); + out << ", " << "foreignKeys="; (__isset.foreignKeys ? (out << to_string(foreignKeys)) : (out << "")); + out << ", " << "uniqueConstraints="; (__isset.uniqueConstraints ? (out << to_string(uniqueConstraints)) : (out << "")); + out << ", " << "notNullConstraints="; (__isset.notNullConstraints ? (out << to_string(notNullConstraints)) : (out << "")); + out << ", " << "defaultConstraints="; (__isset.defaultConstraints ? (out << to_string(defaultConstraints)) : (out << "")); + out << ", " << "checkConstraints="; (__isset.checkConstraints ? (out << to_string(checkConstraints)) : (out << "")); + out << ")"; +} + + +Type::~Type() noexcept { +} + +Type::Type() noexcept + : name(), + type1(), + type2() { +} + +void Type::__set_name(const std::string& val) { + this->name = val; +} + +void Type::__set_type1(const std::string& val) { + this->type1 = val; +__isset.type1 = true; +} + +void Type::__set_type2(const std::string& val) { + this->type2 = val; +__isset.type2 = true; +} + +void Type::__set_fields(const std::vector & val) { + this->fields = val; +__isset.fields = true; +} +std::ostream& operator<<(std::ostream& out, const Type& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Type::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type1); + this->__isset.type1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type2); + this->__isset.type2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fields.clear(); + uint32_t _size64; + ::apache::thrift::protocol::TType _etype67; + xfer += iprot->readListBegin(_etype67, _size64); + this->fields.resize(_size64); + uint32_t _i68; + for (_i68 = 0; _i68 < _size64; ++_i68) + { + xfer += this->fields[_i68].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.fields = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Type::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Type"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.type1) { + xfer += oprot->writeFieldBegin("type1", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->type1); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type2) { + xfer += oprot->writeFieldBegin("type2", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->type2); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.fields) { + xfer += oprot->writeFieldBegin("fields", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->fields.size())); + std::vector ::const_iterator _iter69; + for (_iter69 = this->fields.begin(); _iter69 != this->fields.end(); ++_iter69) + { + xfer += (*_iter69).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Type &a, Type &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.type1, b.type1); + swap(a.type2, b.type2); + swap(a.fields, b.fields); + swap(a.__isset, b.__isset); +} + +bool Type::operator==(const Type & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (__isset.type1 != rhs.__isset.type1) + return false; + else if (__isset.type1 && !(type1 == rhs.type1)) + return false; + if (__isset.type2 != rhs.__isset.type2) + return false; + else if (__isset.type2 && !(type2 == rhs.type2)) + return false; + if (__isset.fields != rhs.__isset.fields) + return false; + else if (__isset.fields && !(fields == rhs.fields)) + return false; + return true; +} + +Type::Type(const Type& other70) { + name = other70.name; + type1 = other70.type1; + type2 = other70.type2; + fields = other70.fields; + __isset = other70.__isset; +} +Type& Type::operator=(const Type& other71) { + name = other71.name; + type1 = other71.type1; + type2 = other71.type2; + fields = other71.fields; + __isset = other71.__isset; + return *this; +} +void Type::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Type("; + out << "name=" << to_string(name); + out << ", " << "type1="; (__isset.type1 ? (out << to_string(type1)) : (out << "")); + out << ", " << "type2="; (__isset.type2 ? (out << to_string(type2)) : (out << "")); + out << ", " << "fields="; (__isset.fields ? (out << to_string(fields)) : (out << "")); + out << ")"; +} + + +PropertySetRequest::~PropertySetRequest() noexcept { +} + +PropertySetRequest::PropertySetRequest() noexcept + : nameSpace() { +} + +void PropertySetRequest::__set_nameSpace(const std::string& val) { + this->nameSpace = val; +} + +void PropertySetRequest::__set_propertyMap(const std::map & val) { + this->propertyMap = val; +} +std::ostream& operator<<(std::ostream& out, const PropertySetRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PropertySetRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_nameSpace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->nameSpace); + isset_nameSpace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->propertyMap.clear(); + uint32_t _size72; + ::apache::thrift::protocol::TType _ktype73; + ::apache::thrift::protocol::TType _vtype74; + xfer += iprot->readMapBegin(_ktype73, _vtype74, _size72); + uint32_t _i76; + for (_i76 = 0; _i76 < _size72; ++_i76) + { + std::string _key77; + xfer += iprot->readString(_key77); + std::string& _val78 = this->propertyMap[_key77]; + xfer += iprot->readString(_val78); + } + xfer += iprot->readMapEnd(); + } + this->__isset.propertyMap = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_nameSpace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PropertySetRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PropertySetRequest"); + + xfer += oprot->writeFieldBegin("nameSpace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->nameSpace); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("propertyMap", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->propertyMap.size())); + std::map ::const_iterator _iter79; + for (_iter79 = this->propertyMap.begin(); _iter79 != this->propertyMap.end(); ++_iter79) + { + xfer += oprot->writeString(_iter79->first); + xfer += oprot->writeString(_iter79->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PropertySetRequest &a, PropertySetRequest &b) noexcept { + using ::std::swap; + swap(a.nameSpace, b.nameSpace); + swap(a.propertyMap, b.propertyMap); + swap(a.__isset, b.__isset); +} + +bool PropertySetRequest::operator==(const PropertySetRequest & rhs) const +{ + if (!(nameSpace == rhs.nameSpace)) + return false; + if (!(propertyMap == rhs.propertyMap)) + return false; + return true; +} + +PropertySetRequest::PropertySetRequest(const PropertySetRequest& other80) { + nameSpace = other80.nameSpace; + propertyMap = other80.propertyMap; + __isset = other80.__isset; +} +PropertySetRequest& PropertySetRequest::operator=(const PropertySetRequest& other81) { + nameSpace = other81.nameSpace; + propertyMap = other81.propertyMap; + __isset = other81.__isset; + return *this; +} +void PropertySetRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PropertySetRequest("; + out << "nameSpace=" << to_string(nameSpace); + out << ", " << "propertyMap=" << to_string(propertyMap); + out << ")"; +} + + +PropertyGetRequest::~PropertyGetRequest() noexcept { +} + +PropertyGetRequest::PropertyGetRequest() noexcept + : nameSpace(), + mapPrefix(), + mapPredicate() { +} + +void PropertyGetRequest::__set_nameSpace(const std::string& val) { + this->nameSpace = val; +} + +void PropertyGetRequest::__set_mapPrefix(const std::string& val) { + this->mapPrefix = val; +} + +void PropertyGetRequest::__set_mapPredicate(const std::string& val) { + this->mapPredicate = val; +__isset.mapPredicate = true; +} + +void PropertyGetRequest::__set_mapSelection(const std::vector & val) { + this->mapSelection = val; +__isset.mapSelection = true; +} +std::ostream& operator<<(std::ostream& out, const PropertyGetRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PropertyGetRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_nameSpace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->nameSpace); + isset_nameSpace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->mapPrefix); + this->__isset.mapPrefix = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->mapPredicate); + this->__isset.mapPredicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->mapSelection.clear(); + uint32_t _size82; + ::apache::thrift::protocol::TType _etype85; + xfer += iprot->readListBegin(_etype85, _size82); + this->mapSelection.resize(_size82); + uint32_t _i86; + for (_i86 = 0; _i86 < _size82; ++_i86) + { + xfer += iprot->readString(this->mapSelection[_i86]); + } + xfer += iprot->readListEnd(); + } + this->__isset.mapSelection = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_nameSpace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PropertyGetRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PropertyGetRequest"); + + xfer += oprot->writeFieldBegin("nameSpace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->nameSpace); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("mapPrefix", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->mapPrefix); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.mapPredicate) { + xfer += oprot->writeFieldBegin("mapPredicate", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->mapPredicate); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.mapSelection) { + xfer += oprot->writeFieldBegin("mapSelection", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->mapSelection.size())); + std::vector ::const_iterator _iter87; + for (_iter87 = this->mapSelection.begin(); _iter87 != this->mapSelection.end(); ++_iter87) + { + xfer += oprot->writeString((*_iter87)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PropertyGetRequest &a, PropertyGetRequest &b) noexcept { + using ::std::swap; + swap(a.nameSpace, b.nameSpace); + swap(a.mapPrefix, b.mapPrefix); + swap(a.mapPredicate, b.mapPredicate); + swap(a.mapSelection, b.mapSelection); + swap(a.__isset, b.__isset); +} + +bool PropertyGetRequest::operator==(const PropertyGetRequest & rhs) const +{ + if (!(nameSpace == rhs.nameSpace)) + return false; + if (!(mapPrefix == rhs.mapPrefix)) + return false; + if (__isset.mapPredicate != rhs.__isset.mapPredicate) + return false; + else if (__isset.mapPredicate && !(mapPredicate == rhs.mapPredicate)) + return false; + if (__isset.mapSelection != rhs.__isset.mapSelection) + return false; + else if (__isset.mapSelection && !(mapSelection == rhs.mapSelection)) + return false; + return true; +} + +PropertyGetRequest::PropertyGetRequest(const PropertyGetRequest& other88) { + nameSpace = other88.nameSpace; + mapPrefix = other88.mapPrefix; + mapPredicate = other88.mapPredicate; + mapSelection = other88.mapSelection; + __isset = other88.__isset; +} +PropertyGetRequest& PropertyGetRequest::operator=(const PropertyGetRequest& other89) { + nameSpace = other89.nameSpace; + mapPrefix = other89.mapPrefix; + mapPredicate = other89.mapPredicate; + mapSelection = other89.mapSelection; + __isset = other89.__isset; + return *this; +} +void PropertyGetRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PropertyGetRequest("; + out << "nameSpace=" << to_string(nameSpace); + out << ", " << "mapPrefix=" << to_string(mapPrefix); + out << ", " << "mapPredicate="; (__isset.mapPredicate ? (out << to_string(mapPredicate)) : (out << "")); + out << ", " << "mapSelection="; (__isset.mapSelection ? (out << to_string(mapSelection)) : (out << "")); + out << ")"; +} + + +PropertyGetResponse::~PropertyGetResponse() noexcept { +} + +PropertyGetResponse::PropertyGetResponse() noexcept { +} + +void PropertyGetResponse::__set_properties(const std::map > & val) { + this->properties = val; +} +std::ostream& operator<<(std::ostream& out, const PropertyGetResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PropertyGetResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->properties.clear(); + uint32_t _size90; + ::apache::thrift::protocol::TType _ktype91; + ::apache::thrift::protocol::TType _vtype92; + xfer += iprot->readMapBegin(_ktype91, _vtype92, _size90); + uint32_t _i94; + for (_i94 = 0; _i94 < _size90; ++_i94) + { + std::string _key95; + xfer += iprot->readString(_key95); + std::map & _val96 = this->properties[_key95]; + { + _val96.clear(); + uint32_t _size97; + ::apache::thrift::protocol::TType _ktype98; + ::apache::thrift::protocol::TType _vtype99; + xfer += iprot->readMapBegin(_ktype98, _vtype99, _size97); + uint32_t _i101; + for (_i101 = 0; _i101 < _size97; ++_i101) + { + std::string _key102; + xfer += iprot->readString(_key102); + std::string& _val103 = _val96[_key102]; + xfer += iprot->readString(_val103); + } + xfer += iprot->readMapEnd(); + } + } + xfer += iprot->readMapEnd(); + } + this->__isset.properties = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PropertyGetResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PropertyGetResponse"); + + xfer += oprot->writeFieldBegin("properties", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast(this->properties.size())); + std::map > ::const_iterator _iter104; + for (_iter104 = this->properties.begin(); _iter104 != this->properties.end(); ++_iter104) + { + xfer += oprot->writeString(_iter104->first); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(_iter104->second.size())); + std::map ::const_iterator _iter105; + for (_iter105 = _iter104->second.begin(); _iter105 != _iter104->second.end(); ++_iter105) + { + xfer += oprot->writeString(_iter105->first); + xfer += oprot->writeString(_iter105->second); + } + xfer += oprot->writeMapEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PropertyGetResponse &a, PropertyGetResponse &b) noexcept { + using ::std::swap; + swap(a.properties, b.properties); + swap(a.__isset, b.__isset); +} + +bool PropertyGetResponse::operator==(const PropertyGetResponse & rhs) const +{ + if (!(properties == rhs.properties)) + return false; + return true; +} + +PropertyGetResponse::PropertyGetResponse(const PropertyGetResponse& other106) { + properties = other106.properties; + __isset = other106.__isset; +} +PropertyGetResponse& PropertyGetResponse::operator=(const PropertyGetResponse& other107) { + properties = other107.properties; + __isset = other107.__isset; + return *this; +} +void PropertyGetResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PropertyGetResponse("; + out << "properties=" << to_string(properties); + out << ")"; +} + + +HiveObjectRef::~HiveObjectRef() noexcept { +} + +HiveObjectRef::HiveObjectRef() noexcept + : objectType(static_cast(0)), + dbName(), + objectName(), + columnName(), + catName() { +} + +void HiveObjectRef::__set_objectType(const HiveObjectType::type val) { + this->objectType = val; +} + +void HiveObjectRef::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void HiveObjectRef::__set_objectName(const std::string& val) { + this->objectName = val; +} + +void HiveObjectRef::__set_partValues(const std::vector & val) { + this->partValues = val; +} + +void HiveObjectRef::__set_columnName(const std::string& val) { + this->columnName = val; +} + +void HiveObjectRef::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const HiveObjectRef& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t HiveObjectRef::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast108; + xfer += iprot->readI32(ecast108); + this->objectType = static_cast(ecast108); + this->__isset.objectType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->objectName); + this->__isset.objectName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partValues.clear(); + uint32_t _size109; + ::apache::thrift::protocol::TType _etype112; + xfer += iprot->readListBegin(_etype112, _size109); + this->partValues.resize(_size109); + uint32_t _i113; + for (_i113 = 0; _i113 < _size109; ++_i113) + { + xfer += iprot->readString(this->partValues[_i113]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partValues = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->columnName); + this->__isset.columnName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t HiveObjectRef::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HiveObjectRef"); + + xfer += oprot->writeFieldBegin("objectType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->objectType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("objectName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->objectName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partValues", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partValues.size())); + std::vector ::const_iterator _iter114; + for (_iter114 = this->partValues.begin(); _iter114 != this->partValues.end(); ++_iter114) + { + xfer += oprot->writeString((*_iter114)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->columnName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HiveObjectRef &a, HiveObjectRef &b) noexcept { + using ::std::swap; + swap(a.objectType, b.objectType); + swap(a.dbName, b.dbName); + swap(a.objectName, b.objectName); + swap(a.partValues, b.partValues); + swap(a.columnName, b.columnName); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool HiveObjectRef::operator==(const HiveObjectRef & rhs) const +{ + if (!(objectType == rhs.objectType)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(objectName == rhs.objectName)) + return false; + if (!(partValues == rhs.partValues)) + return false; + if (!(columnName == rhs.columnName)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +HiveObjectRef::HiveObjectRef(const HiveObjectRef& other115) { + objectType = other115.objectType; + dbName = other115.dbName; + objectName = other115.objectName; + partValues = other115.partValues; + columnName = other115.columnName; + catName = other115.catName; + __isset = other115.__isset; +} +HiveObjectRef& HiveObjectRef::operator=(const HiveObjectRef& other116) { + objectType = other116.objectType; + dbName = other116.dbName; + objectName = other116.objectName; + partValues = other116.partValues; + columnName = other116.columnName; + catName = other116.catName; + __isset = other116.__isset; + return *this; +} +void HiveObjectRef::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HiveObjectRef("; + out << "objectType=" << to_string(objectType); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "objectName=" << to_string(objectName); + out << ", " << "partValues=" << to_string(partValues); + out << ", " << "columnName=" << to_string(columnName); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +PrivilegeGrantInfo::~PrivilegeGrantInfo() noexcept { +} + +PrivilegeGrantInfo::PrivilegeGrantInfo() noexcept + : privilege(), + createTime(0), + grantor(), + grantorType(static_cast(0)), + grantOption(0) { +} + +void PrivilegeGrantInfo::__set_privilege(const std::string& val) { + this->privilege = val; +} + +void PrivilegeGrantInfo::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void PrivilegeGrantInfo::__set_grantor(const std::string& val) { + this->grantor = val; +} + +void PrivilegeGrantInfo::__set_grantorType(const PrincipalType::type val) { + this->grantorType = val; +} + +void PrivilegeGrantInfo::__set_grantOption(const bool val) { + this->grantOption = val; +} +std::ostream& operator<<(std::ostream& out, const PrivilegeGrantInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PrivilegeGrantInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->privilege); + this->__isset.privilege = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->grantor); + this->__isset.grantor = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast117; + xfer += iprot->readI32(ecast117); + this->grantorType = static_cast(ecast117); + this->__isset.grantorType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->grantOption); + this->__isset.grantOption = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PrivilegeGrantInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PrivilegeGrantInfo"); + + xfer += oprot->writeFieldBegin("privilege", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->privilege); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantor", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->grantor); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantorType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->grantorType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantOption", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->grantOption); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PrivilegeGrantInfo &a, PrivilegeGrantInfo &b) noexcept { + using ::std::swap; + swap(a.privilege, b.privilege); + swap(a.createTime, b.createTime); + swap(a.grantor, b.grantor); + swap(a.grantorType, b.grantorType); + swap(a.grantOption, b.grantOption); + swap(a.__isset, b.__isset); +} + +bool PrivilegeGrantInfo::operator==(const PrivilegeGrantInfo & rhs) const +{ + if (!(privilege == rhs.privilege)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(grantor == rhs.grantor)) + return false; + if (!(grantorType == rhs.grantorType)) + return false; + if (!(grantOption == rhs.grantOption)) + return false; + return true; +} + +PrivilegeGrantInfo::PrivilegeGrantInfo(const PrivilegeGrantInfo& other118) { + privilege = other118.privilege; + createTime = other118.createTime; + grantor = other118.grantor; + grantorType = other118.grantorType; + grantOption = other118.grantOption; + __isset = other118.__isset; +} +PrivilegeGrantInfo& PrivilegeGrantInfo::operator=(const PrivilegeGrantInfo& other119) { + privilege = other119.privilege; + createTime = other119.createTime; + grantor = other119.grantor; + grantorType = other119.grantorType; + grantOption = other119.grantOption; + __isset = other119.__isset; + return *this; +} +void PrivilegeGrantInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PrivilegeGrantInfo("; + out << "privilege=" << to_string(privilege); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "grantor=" << to_string(grantor); + out << ", " << "grantorType=" << to_string(grantorType); + out << ", " << "grantOption=" << to_string(grantOption); + out << ")"; +} + + +HiveObjectPrivilege::~HiveObjectPrivilege() noexcept { +} + +HiveObjectPrivilege::HiveObjectPrivilege() noexcept + : principalName(), + principalType(static_cast(0)), + authorizer() { +} + +void HiveObjectPrivilege::__set_hiveObject(const HiveObjectRef& val) { + this->hiveObject = val; +} + +void HiveObjectPrivilege::__set_principalName(const std::string& val) { + this->principalName = val; +} + +void HiveObjectPrivilege::__set_principalType(const PrincipalType::type val) { + this->principalType = val; +} + +void HiveObjectPrivilege::__set_grantInfo(const PrivilegeGrantInfo& val) { + this->grantInfo = val; +} + +void HiveObjectPrivilege::__set_authorizer(const std::string& val) { + this->authorizer = val; +} +std::ostream& operator<<(std::ostream& out, const HiveObjectPrivilege& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t HiveObjectPrivilege::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->hiveObject.read(iprot); + this->__isset.hiveObject = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principalName); + this->__isset.principalName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast120; + xfer += iprot->readI32(ecast120); + this->principalType = static_cast(ecast120); + this->__isset.principalType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->grantInfo.read(iprot); + this->__isset.grantInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->authorizer); + this->__isset.authorizer = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t HiveObjectPrivilege::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HiveObjectPrivilege"); + + xfer += oprot->writeFieldBegin("hiveObject", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->hiveObject.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->principalName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalType", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->principalType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantInfo", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->grantInfo.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("authorizer", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->authorizer); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HiveObjectPrivilege &a, HiveObjectPrivilege &b) noexcept { + using ::std::swap; + swap(a.hiveObject, b.hiveObject); + swap(a.principalName, b.principalName); + swap(a.principalType, b.principalType); + swap(a.grantInfo, b.grantInfo); + swap(a.authorizer, b.authorizer); + swap(a.__isset, b.__isset); +} + +bool HiveObjectPrivilege::operator==(const HiveObjectPrivilege & rhs) const +{ + if (!(hiveObject == rhs.hiveObject)) + return false; + if (!(principalName == rhs.principalName)) + return false; + if (!(principalType == rhs.principalType)) + return false; + if (!(grantInfo == rhs.grantInfo)) + return false; + if (!(authorizer == rhs.authorizer)) + return false; + return true; +} + +HiveObjectPrivilege::HiveObjectPrivilege(const HiveObjectPrivilege& other121) { + hiveObject = other121.hiveObject; + principalName = other121.principalName; + principalType = other121.principalType; + grantInfo = other121.grantInfo; + authorizer = other121.authorizer; + __isset = other121.__isset; +} +HiveObjectPrivilege& HiveObjectPrivilege::operator=(const HiveObjectPrivilege& other122) { + hiveObject = other122.hiveObject; + principalName = other122.principalName; + principalType = other122.principalType; + grantInfo = other122.grantInfo; + authorizer = other122.authorizer; + __isset = other122.__isset; + return *this; +} +void HiveObjectPrivilege::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HiveObjectPrivilege("; + out << "hiveObject=" << to_string(hiveObject); + out << ", " << "principalName=" << to_string(principalName); + out << ", " << "principalType=" << to_string(principalType); + out << ", " << "grantInfo=" << to_string(grantInfo); + out << ", " << "authorizer=" << to_string(authorizer); + out << ")"; +} + + +PrivilegeBag::~PrivilegeBag() noexcept { +} + +PrivilegeBag::PrivilegeBag() noexcept { +} + +void PrivilegeBag::__set_privileges(const std::vector & val) { + this->privileges = val; +} +std::ostream& operator<<(std::ostream& out, const PrivilegeBag& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PrivilegeBag::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->privileges.clear(); + uint32_t _size123; + ::apache::thrift::protocol::TType _etype126; + xfer += iprot->readListBegin(_etype126, _size123); + this->privileges.resize(_size123); + uint32_t _i127; + for (_i127 = 0; _i127 < _size123; ++_i127) + { + xfer += this->privileges[_i127].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PrivilegeBag::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PrivilegeBag"); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->privileges.size())); + std::vector ::const_iterator _iter128; + for (_iter128 = this->privileges.begin(); _iter128 != this->privileges.end(); ++_iter128) + { + xfer += (*_iter128).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PrivilegeBag &a, PrivilegeBag &b) noexcept { + using ::std::swap; + swap(a.privileges, b.privileges); + swap(a.__isset, b.__isset); +} + +bool PrivilegeBag::operator==(const PrivilegeBag & rhs) const +{ + if (!(privileges == rhs.privileges)) + return false; + return true; +} + +PrivilegeBag::PrivilegeBag(const PrivilegeBag& other129) { + privileges = other129.privileges; + __isset = other129.__isset; +} +PrivilegeBag& PrivilegeBag::operator=(const PrivilegeBag& other130) { + privileges = other130.privileges; + __isset = other130.__isset; + return *this; +} +void PrivilegeBag::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PrivilegeBag("; + out << "privileges=" << to_string(privileges); + out << ")"; +} + + +PrincipalPrivilegeSet::~PrincipalPrivilegeSet() noexcept { +} + +PrincipalPrivilegeSet::PrincipalPrivilegeSet() noexcept { +} + +void PrincipalPrivilegeSet::__set_userPrivileges(const std::map > & val) { + this->userPrivileges = val; +} + +void PrincipalPrivilegeSet::__set_groupPrivileges(const std::map > & val) { + this->groupPrivileges = val; +} + +void PrincipalPrivilegeSet::__set_rolePrivileges(const std::map > & val) { + this->rolePrivileges = val; +} +std::ostream& operator<<(std::ostream& out, const PrincipalPrivilegeSet& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PrincipalPrivilegeSet::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->userPrivileges.clear(); + uint32_t _size131; + ::apache::thrift::protocol::TType _ktype132; + ::apache::thrift::protocol::TType _vtype133; + xfer += iprot->readMapBegin(_ktype132, _vtype133, _size131); + uint32_t _i135; + for (_i135 = 0; _i135 < _size131; ++_i135) + { + std::string _key136; + xfer += iprot->readString(_key136); + std::vector & _val137 = this->userPrivileges[_key136]; + { + _val137.clear(); + uint32_t _size138; + ::apache::thrift::protocol::TType _etype141; + xfer += iprot->readListBegin(_etype141, _size138); + _val137.resize(_size138); + uint32_t _i142; + for (_i142 = 0; _i142 < _size138; ++_i142) + { + xfer += _val137[_i142].read(iprot); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readMapEnd(); + } + this->__isset.userPrivileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->groupPrivileges.clear(); + uint32_t _size143; + ::apache::thrift::protocol::TType _ktype144; + ::apache::thrift::protocol::TType _vtype145; + xfer += iprot->readMapBegin(_ktype144, _vtype145, _size143); + uint32_t _i147; + for (_i147 = 0; _i147 < _size143; ++_i147) + { + std::string _key148; + xfer += iprot->readString(_key148); + std::vector & _val149 = this->groupPrivileges[_key148]; + { + _val149.clear(); + uint32_t _size150; + ::apache::thrift::protocol::TType _etype153; + xfer += iprot->readListBegin(_etype153, _size150); + _val149.resize(_size150); + uint32_t _i154; + for (_i154 = 0; _i154 < _size150; ++_i154) + { + xfer += _val149[_i154].read(iprot); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readMapEnd(); + } + this->__isset.groupPrivileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->rolePrivileges.clear(); + uint32_t _size155; + ::apache::thrift::protocol::TType _ktype156; + ::apache::thrift::protocol::TType _vtype157; + xfer += iprot->readMapBegin(_ktype156, _vtype157, _size155); + uint32_t _i159; + for (_i159 = 0; _i159 < _size155; ++_i159) + { + std::string _key160; + xfer += iprot->readString(_key160); + std::vector & _val161 = this->rolePrivileges[_key160]; + { + _val161.clear(); + uint32_t _size162; + ::apache::thrift::protocol::TType _etype165; + xfer += iprot->readListBegin(_etype165, _size162); + _val161.resize(_size162); + uint32_t _i166; + for (_i166 = 0; _i166 < _size162; ++_i166) + { + xfer += _val161[_i166].read(iprot); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readMapEnd(); + } + this->__isset.rolePrivileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PrincipalPrivilegeSet::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PrincipalPrivilegeSet"); + + xfer += oprot->writeFieldBegin("userPrivileges", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast(this->userPrivileges.size())); + std::map > ::const_iterator _iter167; + for (_iter167 = this->userPrivileges.begin(); _iter167 != this->userPrivileges.end(); ++_iter167) + { + xfer += oprot->writeString(_iter167->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(_iter167->second.size())); + std::vector ::const_iterator _iter168; + for (_iter168 = _iter167->second.begin(); _iter168 != _iter167->second.end(); ++_iter168) + { + xfer += (*_iter168).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("groupPrivileges", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast(this->groupPrivileges.size())); + std::map > ::const_iterator _iter169; + for (_iter169 = this->groupPrivileges.begin(); _iter169 != this->groupPrivileges.end(); ++_iter169) + { + xfer += oprot->writeString(_iter169->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(_iter169->second.size())); + std::vector ::const_iterator _iter170; + for (_iter170 = _iter169->second.begin(); _iter170 != _iter169->second.end(); ++_iter170) + { + xfer += (*_iter170).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rolePrivileges", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast(this->rolePrivileges.size())); + std::map > ::const_iterator _iter171; + for (_iter171 = this->rolePrivileges.begin(); _iter171 != this->rolePrivileges.end(); ++_iter171) + { + xfer += oprot->writeString(_iter171->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(_iter171->second.size())); + std::vector ::const_iterator _iter172; + for (_iter172 = _iter171->second.begin(); _iter172 != _iter171->second.end(); ++_iter172) + { + xfer += (*_iter172).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PrincipalPrivilegeSet &a, PrincipalPrivilegeSet &b) noexcept { + using ::std::swap; + swap(a.userPrivileges, b.userPrivileges); + swap(a.groupPrivileges, b.groupPrivileges); + swap(a.rolePrivileges, b.rolePrivileges); + swap(a.__isset, b.__isset); +} + +bool PrincipalPrivilegeSet::operator==(const PrincipalPrivilegeSet & rhs) const +{ + if (!(userPrivileges == rhs.userPrivileges)) + return false; + if (!(groupPrivileges == rhs.groupPrivileges)) + return false; + if (!(rolePrivileges == rhs.rolePrivileges)) + return false; + return true; +} + +PrincipalPrivilegeSet::PrincipalPrivilegeSet(const PrincipalPrivilegeSet& other173) { + userPrivileges = other173.userPrivileges; + groupPrivileges = other173.groupPrivileges; + rolePrivileges = other173.rolePrivileges; + __isset = other173.__isset; +} +PrincipalPrivilegeSet& PrincipalPrivilegeSet::operator=(const PrincipalPrivilegeSet& other174) { + userPrivileges = other174.userPrivileges; + groupPrivileges = other174.groupPrivileges; + rolePrivileges = other174.rolePrivileges; + __isset = other174.__isset; + return *this; +} +void PrincipalPrivilegeSet::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PrincipalPrivilegeSet("; + out << "userPrivileges=" << to_string(userPrivileges); + out << ", " << "groupPrivileges=" << to_string(groupPrivileges); + out << ", " << "rolePrivileges=" << to_string(rolePrivileges); + out << ")"; +} + + +GrantRevokePrivilegeRequest::~GrantRevokePrivilegeRequest() noexcept { +} + +GrantRevokePrivilegeRequest::GrantRevokePrivilegeRequest() noexcept + : requestType(static_cast(0)), + revokeGrantOption(0) { +} + +void GrantRevokePrivilegeRequest::__set_requestType(const GrantRevokeType::type val) { + this->requestType = val; +} + +void GrantRevokePrivilegeRequest::__set_privileges(const PrivilegeBag& val) { + this->privileges = val; +} + +void GrantRevokePrivilegeRequest::__set_revokeGrantOption(const bool val) { + this->revokeGrantOption = val; +__isset.revokeGrantOption = true; +} +std::ostream& operator<<(std::ostream& out, const GrantRevokePrivilegeRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GrantRevokePrivilegeRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast175; + xfer += iprot->readI32(ecast175); + this->requestType = static_cast(ecast175); + this->__isset.requestType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->revokeGrantOption); + this->__isset.revokeGrantOption = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GrantRevokePrivilegeRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GrantRevokePrivilegeRequest"); + + xfer += oprot->writeFieldBegin("requestType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->requestType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.revokeGrantOption) { + xfer += oprot->writeFieldBegin("revokeGrantOption", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->revokeGrantOption); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GrantRevokePrivilegeRequest &a, GrantRevokePrivilegeRequest &b) noexcept { + using ::std::swap; + swap(a.requestType, b.requestType); + swap(a.privileges, b.privileges); + swap(a.revokeGrantOption, b.revokeGrantOption); + swap(a.__isset, b.__isset); +} + +bool GrantRevokePrivilegeRequest::operator==(const GrantRevokePrivilegeRequest & rhs) const +{ + if (!(requestType == rhs.requestType)) + return false; + if (!(privileges == rhs.privileges)) + return false; + if (__isset.revokeGrantOption != rhs.__isset.revokeGrantOption) + return false; + else if (__isset.revokeGrantOption && !(revokeGrantOption == rhs.revokeGrantOption)) + return false; + return true; +} + +GrantRevokePrivilegeRequest::GrantRevokePrivilegeRequest(const GrantRevokePrivilegeRequest& other176) { + requestType = other176.requestType; + privileges = other176.privileges; + revokeGrantOption = other176.revokeGrantOption; + __isset = other176.__isset; +} +GrantRevokePrivilegeRequest& GrantRevokePrivilegeRequest::operator=(const GrantRevokePrivilegeRequest& other177) { + requestType = other177.requestType; + privileges = other177.privileges; + revokeGrantOption = other177.revokeGrantOption; + __isset = other177.__isset; + return *this; +} +void GrantRevokePrivilegeRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GrantRevokePrivilegeRequest("; + out << "requestType=" << to_string(requestType); + out << ", " << "privileges=" << to_string(privileges); + out << ", " << "revokeGrantOption="; (__isset.revokeGrantOption ? (out << to_string(revokeGrantOption)) : (out << "")); + out << ")"; +} + + +GrantRevokePrivilegeResponse::~GrantRevokePrivilegeResponse() noexcept { +} + +GrantRevokePrivilegeResponse::GrantRevokePrivilegeResponse() noexcept + : success(0) { +} + +void GrantRevokePrivilegeResponse::__set_success(const bool val) { + this->success = val; +__isset.success = true; +} +std::ostream& operator<<(std::ostream& out, const GrantRevokePrivilegeResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GrantRevokePrivilegeResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GrantRevokePrivilegeResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GrantRevokePrivilegeResponse"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GrantRevokePrivilegeResponse &a, GrantRevokePrivilegeResponse &b) noexcept { + using ::std::swap; + swap(a.success, b.success); + swap(a.__isset, b.__isset); +} + +bool GrantRevokePrivilegeResponse::operator==(const GrantRevokePrivilegeResponse & rhs) const +{ + if (__isset.success != rhs.__isset.success) + return false; + else if (__isset.success && !(success == rhs.success)) + return false; + return true; +} + +GrantRevokePrivilegeResponse::GrantRevokePrivilegeResponse(const GrantRevokePrivilegeResponse& other178) noexcept { + success = other178.success; + __isset = other178.__isset; +} +GrantRevokePrivilegeResponse& GrantRevokePrivilegeResponse::operator=(const GrantRevokePrivilegeResponse& other179) noexcept { + success = other179.success; + __isset = other179.__isset; + return *this; +} +void GrantRevokePrivilegeResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GrantRevokePrivilegeResponse("; + out << "success="; (__isset.success ? (out << to_string(success)) : (out << "")); + out << ")"; +} + + +TruncateTableRequest::~TruncateTableRequest() noexcept { +} + +TruncateTableRequest::TruncateTableRequest() noexcept + : dbName(), + tableName(), + writeId(-1LL), + validWriteIdList() { +} + +void TruncateTableRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void TruncateTableRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void TruncateTableRequest::__set_partNames(const std::vector & val) { + this->partNames = val; +__isset.partNames = true; +} + +void TruncateTableRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void TruncateTableRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void TruncateTableRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} +std::ostream& operator<<(std::ostream& out, const TruncateTableRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TruncateTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partNames.clear(); + uint32_t _size180; + ::apache::thrift::protocol::TType _etype183; + xfer += iprot->readListBegin(_etype183, _size180); + this->partNames.resize(_size180); + uint32_t _i184; + for (_i184 = 0; _i184 < _size180; ++_i184) + { + xfer += iprot->readString(this->partNames[_i184]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TruncateTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TruncateTableRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partNames) { + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partNames.size())); + std::vector ::const_iterator _iter185; + for (_iter185 = this->partNames.begin(); _iter185 != this->partNames.end(); ++_iter185) + { + xfer += oprot->writeString((*_iter185)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TruncateTableRequest &a, TruncateTableRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partNames, b.partNames); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.environmentContext, b.environmentContext); + swap(a.__isset, b.__isset); +} + +bool TruncateTableRequest::operator==(const TruncateTableRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.partNames != rhs.__isset.partNames) + return false; + else if (__isset.partNames && !(partNames == rhs.partNames)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + return true; +} + +TruncateTableRequest::TruncateTableRequest(const TruncateTableRequest& other186) { + dbName = other186.dbName; + tableName = other186.tableName; + partNames = other186.partNames; + writeId = other186.writeId; + validWriteIdList = other186.validWriteIdList; + environmentContext = other186.environmentContext; + __isset = other186.__isset; +} +TruncateTableRequest& TruncateTableRequest::operator=(const TruncateTableRequest& other187) { + dbName = other187.dbName; + tableName = other187.tableName; + partNames = other187.partNames; + writeId = other187.writeId; + validWriteIdList = other187.validWriteIdList; + environmentContext = other187.environmentContext; + __isset = other187.__isset; + return *this; +} +void TruncateTableRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TruncateTableRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "partNames="; (__isset.partNames ? (out << to_string(partNames)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ")"; +} + + +TruncateTableResponse::~TruncateTableResponse() noexcept { +} + +TruncateTableResponse::TruncateTableResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const TruncateTableResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TruncateTableResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TruncateTableResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TruncateTableResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TruncateTableResponse &a, TruncateTableResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool TruncateTableResponse::operator==(const TruncateTableResponse & /* rhs */) const +{ + return true; +} + +TruncateTableResponse::TruncateTableResponse(const TruncateTableResponse& other188) noexcept { + (void) other188; +} +TruncateTableResponse& TruncateTableResponse::operator=(const TruncateTableResponse& other189) noexcept { + (void) other189; + return *this; +} +void TruncateTableResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TruncateTableResponse("; + out << ")"; +} + + +Role::~Role() noexcept { +} + +Role::Role() noexcept + : roleName(), + createTime(0), + ownerName() { +} + +void Role::__set_roleName(const std::string& val) { + this->roleName = val; +} + +void Role::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void Role::__set_ownerName(const std::string& val) { + this->ownerName = val; +} +std::ostream& operator<<(std::ostream& out, const Role& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Role::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->roleName); + this->__isset.roleName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Role::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Role"); + + xfer += oprot->writeFieldBegin("roleName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->roleName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Role &a, Role &b) noexcept { + using ::std::swap; + swap(a.roleName, b.roleName); + swap(a.createTime, b.createTime); + swap(a.ownerName, b.ownerName); + swap(a.__isset, b.__isset); +} + +bool Role::operator==(const Role & rhs) const +{ + if (!(roleName == rhs.roleName)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(ownerName == rhs.ownerName)) + return false; + return true; +} + +Role::Role(const Role& other190) { + roleName = other190.roleName; + createTime = other190.createTime; + ownerName = other190.ownerName; + __isset = other190.__isset; +} +Role& Role::operator=(const Role& other191) { + roleName = other191.roleName; + createTime = other191.createTime; + ownerName = other191.ownerName; + __isset = other191.__isset; + return *this; +} +void Role::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Role("; + out << "roleName=" << to_string(roleName); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "ownerName=" << to_string(ownerName); + out << ")"; +} + + +RolePrincipalGrant::~RolePrincipalGrant() noexcept { +} + +RolePrincipalGrant::RolePrincipalGrant() noexcept + : roleName(), + principalName(), + principalType(static_cast(0)), + grantOption(0), + grantTime(0), + grantorName(), + grantorPrincipalType(static_cast(0)) { +} + +void RolePrincipalGrant::__set_roleName(const std::string& val) { + this->roleName = val; +} + +void RolePrincipalGrant::__set_principalName(const std::string& val) { + this->principalName = val; +} + +void RolePrincipalGrant::__set_principalType(const PrincipalType::type val) { + this->principalType = val; +} + +void RolePrincipalGrant::__set_grantOption(const bool val) { + this->grantOption = val; +} + +void RolePrincipalGrant::__set_grantTime(const int32_t val) { + this->grantTime = val; +} + +void RolePrincipalGrant::__set_grantorName(const std::string& val) { + this->grantorName = val; +} + +void RolePrincipalGrant::__set_grantorPrincipalType(const PrincipalType::type val) { + this->grantorPrincipalType = val; +} +std::ostream& operator<<(std::ostream& out, const RolePrincipalGrant& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t RolePrincipalGrant::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->roleName); + this->__isset.roleName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principalName); + this->__isset.principalName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast192; + xfer += iprot->readI32(ecast192); + this->principalType = static_cast(ecast192); + this->__isset.principalType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->grantOption); + this->__isset.grantOption = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->grantTime); + this->__isset.grantTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->grantorName); + this->__isset.grantorName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast193; + xfer += iprot->readI32(ecast193); + this->grantorPrincipalType = static_cast(ecast193); + this->__isset.grantorPrincipalType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t RolePrincipalGrant::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("RolePrincipalGrant"); + + xfer += oprot->writeFieldBegin("roleName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->roleName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->principalName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalType", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->principalType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantOption", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->grantOption); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantTime", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->grantTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantorName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->grantorName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("grantorPrincipalType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->grantorPrincipalType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(RolePrincipalGrant &a, RolePrincipalGrant &b) noexcept { + using ::std::swap; + swap(a.roleName, b.roleName); + swap(a.principalName, b.principalName); + swap(a.principalType, b.principalType); + swap(a.grantOption, b.grantOption); + swap(a.grantTime, b.grantTime); + swap(a.grantorName, b.grantorName); + swap(a.grantorPrincipalType, b.grantorPrincipalType); + swap(a.__isset, b.__isset); +} + +bool RolePrincipalGrant::operator==(const RolePrincipalGrant & rhs) const +{ + if (!(roleName == rhs.roleName)) + return false; + if (!(principalName == rhs.principalName)) + return false; + if (!(principalType == rhs.principalType)) + return false; + if (!(grantOption == rhs.grantOption)) + return false; + if (!(grantTime == rhs.grantTime)) + return false; + if (!(grantorName == rhs.grantorName)) + return false; + if (!(grantorPrincipalType == rhs.grantorPrincipalType)) + return false; + return true; +} + +RolePrincipalGrant::RolePrincipalGrant(const RolePrincipalGrant& other194) { + roleName = other194.roleName; + principalName = other194.principalName; + principalType = other194.principalType; + grantOption = other194.grantOption; + grantTime = other194.grantTime; + grantorName = other194.grantorName; + grantorPrincipalType = other194.grantorPrincipalType; + __isset = other194.__isset; +} +RolePrincipalGrant& RolePrincipalGrant::operator=(const RolePrincipalGrant& other195) { + roleName = other195.roleName; + principalName = other195.principalName; + principalType = other195.principalType; + grantOption = other195.grantOption; + grantTime = other195.grantTime; + grantorName = other195.grantorName; + grantorPrincipalType = other195.grantorPrincipalType; + __isset = other195.__isset; + return *this; +} +void RolePrincipalGrant::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "RolePrincipalGrant("; + out << "roleName=" << to_string(roleName); + out << ", " << "principalName=" << to_string(principalName); + out << ", " << "principalType=" << to_string(principalType); + out << ", " << "grantOption=" << to_string(grantOption); + out << ", " << "grantTime=" << to_string(grantTime); + out << ", " << "grantorName=" << to_string(grantorName); + out << ", " << "grantorPrincipalType=" << to_string(grantorPrincipalType); + out << ")"; +} + + +GetRoleGrantsForPrincipalRequest::~GetRoleGrantsForPrincipalRequest() noexcept { +} + +GetRoleGrantsForPrincipalRequest::GetRoleGrantsForPrincipalRequest() noexcept + : principal_name(), + principal_type(static_cast(0)) { +} + +void GetRoleGrantsForPrincipalRequest::__set_principal_name(const std::string& val) { + this->principal_name = val; +} + +void GetRoleGrantsForPrincipalRequest::__set_principal_type(const PrincipalType::type val) { + this->principal_type = val; +} +std::ostream& operator<<(std::ostream& out, const GetRoleGrantsForPrincipalRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetRoleGrantsForPrincipalRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_principal_name = false; + bool isset_principal_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principal_name); + isset_principal_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast196; + xfer += iprot->readI32(ecast196); + this->principal_type = static_cast(ecast196); + isset_principal_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_principal_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_principal_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetRoleGrantsForPrincipalRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetRoleGrantsForPrincipalRequest"); + + xfer += oprot->writeFieldBegin("principal_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->principal_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principal_type", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->principal_type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetRoleGrantsForPrincipalRequest &a, GetRoleGrantsForPrincipalRequest &b) noexcept { + using ::std::swap; + swap(a.principal_name, b.principal_name); + swap(a.principal_type, b.principal_type); +} + +bool GetRoleGrantsForPrincipalRequest::operator==(const GetRoleGrantsForPrincipalRequest & rhs) const +{ + if (!(principal_name == rhs.principal_name)) + return false; + if (!(principal_type == rhs.principal_type)) + return false; + return true; +} + +GetRoleGrantsForPrincipalRequest::GetRoleGrantsForPrincipalRequest(const GetRoleGrantsForPrincipalRequest& other197) { + principal_name = other197.principal_name; + principal_type = other197.principal_type; +} +GetRoleGrantsForPrincipalRequest& GetRoleGrantsForPrincipalRequest::operator=(const GetRoleGrantsForPrincipalRequest& other198) { + principal_name = other198.principal_name; + principal_type = other198.principal_type; + return *this; +} +void GetRoleGrantsForPrincipalRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetRoleGrantsForPrincipalRequest("; + out << "principal_name=" << to_string(principal_name); + out << ", " << "principal_type=" << to_string(principal_type); + out << ")"; +} + + +GetRoleGrantsForPrincipalResponse::~GetRoleGrantsForPrincipalResponse() noexcept { +} + +GetRoleGrantsForPrincipalResponse::GetRoleGrantsForPrincipalResponse() noexcept { +} + +void GetRoleGrantsForPrincipalResponse::__set_principalGrants(const std::vector & val) { + this->principalGrants = val; +} +std::ostream& operator<<(std::ostream& out, const GetRoleGrantsForPrincipalResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetRoleGrantsForPrincipalResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_principalGrants = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->principalGrants.clear(); + uint32_t _size199; + ::apache::thrift::protocol::TType _etype202; + xfer += iprot->readListBegin(_etype202, _size199); + this->principalGrants.resize(_size199); + uint32_t _i203; + for (_i203 = 0; _i203 < _size199; ++_i203) + { + xfer += this->principalGrants[_i203].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_principalGrants = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_principalGrants) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetRoleGrantsForPrincipalResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetRoleGrantsForPrincipalResponse"); + + xfer += oprot->writeFieldBegin("principalGrants", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->principalGrants.size())); + std::vector ::const_iterator _iter204; + for (_iter204 = this->principalGrants.begin(); _iter204 != this->principalGrants.end(); ++_iter204) + { + xfer += (*_iter204).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetRoleGrantsForPrincipalResponse &a, GetRoleGrantsForPrincipalResponse &b) noexcept { + using ::std::swap; + swap(a.principalGrants, b.principalGrants); +} + +bool GetRoleGrantsForPrincipalResponse::operator==(const GetRoleGrantsForPrincipalResponse & rhs) const +{ + if (!(principalGrants == rhs.principalGrants)) + return false; + return true; +} + +GetRoleGrantsForPrincipalResponse::GetRoleGrantsForPrincipalResponse(const GetRoleGrantsForPrincipalResponse& other205) { + principalGrants = other205.principalGrants; +} +GetRoleGrantsForPrincipalResponse& GetRoleGrantsForPrincipalResponse::operator=(const GetRoleGrantsForPrincipalResponse& other206) { + principalGrants = other206.principalGrants; + return *this; +} +void GetRoleGrantsForPrincipalResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetRoleGrantsForPrincipalResponse("; + out << "principalGrants=" << to_string(principalGrants); + out << ")"; +} + + +GetPrincipalsInRoleRequest::~GetPrincipalsInRoleRequest() noexcept { +} + +GetPrincipalsInRoleRequest::GetPrincipalsInRoleRequest() noexcept + : roleName() { +} + +void GetPrincipalsInRoleRequest::__set_roleName(const std::string& val) { + this->roleName = val; +} +std::ostream& operator<<(std::ostream& out, const GetPrincipalsInRoleRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPrincipalsInRoleRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_roleName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->roleName); + isset_roleName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_roleName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPrincipalsInRoleRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPrincipalsInRoleRequest"); + + xfer += oprot->writeFieldBegin("roleName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->roleName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPrincipalsInRoleRequest &a, GetPrincipalsInRoleRequest &b) noexcept { + using ::std::swap; + swap(a.roleName, b.roleName); +} + +bool GetPrincipalsInRoleRequest::operator==(const GetPrincipalsInRoleRequest & rhs) const +{ + if (!(roleName == rhs.roleName)) + return false; + return true; +} + +GetPrincipalsInRoleRequest::GetPrincipalsInRoleRequest(const GetPrincipalsInRoleRequest& other207) { + roleName = other207.roleName; +} +GetPrincipalsInRoleRequest& GetPrincipalsInRoleRequest::operator=(const GetPrincipalsInRoleRequest& other208) { + roleName = other208.roleName; + return *this; +} +void GetPrincipalsInRoleRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPrincipalsInRoleRequest("; + out << "roleName=" << to_string(roleName); + out << ")"; +} + + +GetPrincipalsInRoleResponse::~GetPrincipalsInRoleResponse() noexcept { +} + +GetPrincipalsInRoleResponse::GetPrincipalsInRoleResponse() noexcept { +} + +void GetPrincipalsInRoleResponse::__set_principalGrants(const std::vector & val) { + this->principalGrants = val; +} +std::ostream& operator<<(std::ostream& out, const GetPrincipalsInRoleResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPrincipalsInRoleResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_principalGrants = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->principalGrants.clear(); + uint32_t _size209; + ::apache::thrift::protocol::TType _etype212; + xfer += iprot->readListBegin(_etype212, _size209); + this->principalGrants.resize(_size209); + uint32_t _i213; + for (_i213 = 0; _i213 < _size209; ++_i213) + { + xfer += this->principalGrants[_i213].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_principalGrants = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_principalGrants) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPrincipalsInRoleResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPrincipalsInRoleResponse"); + + xfer += oprot->writeFieldBegin("principalGrants", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->principalGrants.size())); + std::vector ::const_iterator _iter214; + for (_iter214 = this->principalGrants.begin(); _iter214 != this->principalGrants.end(); ++_iter214) + { + xfer += (*_iter214).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPrincipalsInRoleResponse &a, GetPrincipalsInRoleResponse &b) noexcept { + using ::std::swap; + swap(a.principalGrants, b.principalGrants); +} + +bool GetPrincipalsInRoleResponse::operator==(const GetPrincipalsInRoleResponse & rhs) const +{ + if (!(principalGrants == rhs.principalGrants)) + return false; + return true; +} + +GetPrincipalsInRoleResponse::GetPrincipalsInRoleResponse(const GetPrincipalsInRoleResponse& other215) { + principalGrants = other215.principalGrants; +} +GetPrincipalsInRoleResponse& GetPrincipalsInRoleResponse::operator=(const GetPrincipalsInRoleResponse& other216) { + principalGrants = other216.principalGrants; + return *this; +} +void GetPrincipalsInRoleResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPrincipalsInRoleResponse("; + out << "principalGrants=" << to_string(principalGrants); + out << ")"; +} + + +GrantRevokeRoleRequest::~GrantRevokeRoleRequest() noexcept { +} + +GrantRevokeRoleRequest::GrantRevokeRoleRequest() noexcept + : requestType(static_cast(0)), + roleName(), + principalName(), + principalType(static_cast(0)), + grantor(), + grantorType(static_cast(0)), + grantOption(0) { +} + +void GrantRevokeRoleRequest::__set_requestType(const GrantRevokeType::type val) { + this->requestType = val; +} + +void GrantRevokeRoleRequest::__set_roleName(const std::string& val) { + this->roleName = val; +} + +void GrantRevokeRoleRequest::__set_principalName(const std::string& val) { + this->principalName = val; +} + +void GrantRevokeRoleRequest::__set_principalType(const PrincipalType::type val) { + this->principalType = val; +} + +void GrantRevokeRoleRequest::__set_grantor(const std::string& val) { + this->grantor = val; +__isset.grantor = true; +} + +void GrantRevokeRoleRequest::__set_grantorType(const PrincipalType::type val) { + this->grantorType = val; +__isset.grantorType = true; +} + +void GrantRevokeRoleRequest::__set_grantOption(const bool val) { + this->grantOption = val; +__isset.grantOption = true; +} +std::ostream& operator<<(std::ostream& out, const GrantRevokeRoleRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GrantRevokeRoleRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast217; + xfer += iprot->readI32(ecast217); + this->requestType = static_cast(ecast217); + this->__isset.requestType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->roleName); + this->__isset.roleName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->principalName); + this->__isset.principalName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast218; + xfer += iprot->readI32(ecast218); + this->principalType = static_cast(ecast218); + this->__isset.principalType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->grantor); + this->__isset.grantor = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast219; + xfer += iprot->readI32(ecast219); + this->grantorType = static_cast(ecast219); + this->__isset.grantorType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->grantOption); + this->__isset.grantOption = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GrantRevokeRoleRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GrantRevokeRoleRequest"); + + xfer += oprot->writeFieldBegin("requestType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->requestType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("roleName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->roleName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->principalName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("principalType", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->principalType)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.grantor) { + xfer += oprot->writeFieldBegin("grantor", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->grantor); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.grantorType) { + xfer += oprot->writeFieldBegin("grantorType", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->grantorType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.grantOption) { + xfer += oprot->writeFieldBegin("grantOption", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->grantOption); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GrantRevokeRoleRequest &a, GrantRevokeRoleRequest &b) noexcept { + using ::std::swap; + swap(a.requestType, b.requestType); + swap(a.roleName, b.roleName); + swap(a.principalName, b.principalName); + swap(a.principalType, b.principalType); + swap(a.grantor, b.grantor); + swap(a.grantorType, b.grantorType); + swap(a.grantOption, b.grantOption); + swap(a.__isset, b.__isset); +} + +bool GrantRevokeRoleRequest::operator==(const GrantRevokeRoleRequest & rhs) const +{ + if (!(requestType == rhs.requestType)) + return false; + if (!(roleName == rhs.roleName)) + return false; + if (!(principalName == rhs.principalName)) + return false; + if (!(principalType == rhs.principalType)) + return false; + if (__isset.grantor != rhs.__isset.grantor) + return false; + else if (__isset.grantor && !(grantor == rhs.grantor)) + return false; + if (__isset.grantorType != rhs.__isset.grantorType) + return false; + else if (__isset.grantorType && !(grantorType == rhs.grantorType)) + return false; + if (__isset.grantOption != rhs.__isset.grantOption) + return false; + else if (__isset.grantOption && !(grantOption == rhs.grantOption)) + return false; + return true; +} + +GrantRevokeRoleRequest::GrantRevokeRoleRequest(const GrantRevokeRoleRequest& other220) { + requestType = other220.requestType; + roleName = other220.roleName; + principalName = other220.principalName; + principalType = other220.principalType; + grantor = other220.grantor; + grantorType = other220.grantorType; + grantOption = other220.grantOption; + __isset = other220.__isset; +} +GrantRevokeRoleRequest& GrantRevokeRoleRequest::operator=(const GrantRevokeRoleRequest& other221) { + requestType = other221.requestType; + roleName = other221.roleName; + principalName = other221.principalName; + principalType = other221.principalType; + grantor = other221.grantor; + grantorType = other221.grantorType; + grantOption = other221.grantOption; + __isset = other221.__isset; + return *this; +} +void GrantRevokeRoleRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GrantRevokeRoleRequest("; + out << "requestType=" << to_string(requestType); + out << ", " << "roleName=" << to_string(roleName); + out << ", " << "principalName=" << to_string(principalName); + out << ", " << "principalType=" << to_string(principalType); + out << ", " << "grantor="; (__isset.grantor ? (out << to_string(grantor)) : (out << "")); + out << ", " << "grantorType="; (__isset.grantorType ? (out << to_string(grantorType)) : (out << "")); + out << ", " << "grantOption="; (__isset.grantOption ? (out << to_string(grantOption)) : (out << "")); + out << ")"; +} + + +GrantRevokeRoleResponse::~GrantRevokeRoleResponse() noexcept { +} + +GrantRevokeRoleResponse::GrantRevokeRoleResponse() noexcept + : success(0) { +} + +void GrantRevokeRoleResponse::__set_success(const bool val) { + this->success = val; +__isset.success = true; +} +std::ostream& operator<<(std::ostream& out, const GrantRevokeRoleResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GrantRevokeRoleResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GrantRevokeRoleResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GrantRevokeRoleResponse"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GrantRevokeRoleResponse &a, GrantRevokeRoleResponse &b) noexcept { + using ::std::swap; + swap(a.success, b.success); + swap(a.__isset, b.__isset); +} + +bool GrantRevokeRoleResponse::operator==(const GrantRevokeRoleResponse & rhs) const +{ + if (__isset.success != rhs.__isset.success) + return false; + else if (__isset.success && !(success == rhs.success)) + return false; + return true; +} + +GrantRevokeRoleResponse::GrantRevokeRoleResponse(const GrantRevokeRoleResponse& other222) noexcept { + success = other222.success; + __isset = other222.__isset; +} +GrantRevokeRoleResponse& GrantRevokeRoleResponse::operator=(const GrantRevokeRoleResponse& other223) noexcept { + success = other223.success; + __isset = other223.__isset; + return *this; +} +void GrantRevokeRoleResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GrantRevokeRoleResponse("; + out << "success="; (__isset.success ? (out << to_string(success)) : (out << "")); + out << ")"; +} + + +Catalog::~Catalog() noexcept { +} + +Catalog::Catalog() noexcept + : name(), + description(), + locationUri(), + createTime(0) { +} + +void Catalog::__set_name(const std::string& val) { + this->name = val; +} + +void Catalog::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} + +void Catalog::__set_locationUri(const std::string& val) { + this->locationUri = val; +} + +void Catalog::__set_createTime(const int32_t val) { + this->createTime = val; +__isset.createTime = true; +} +std::ostream& operator<<(std::ostream& out, const Catalog& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Catalog::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->locationUri); + this->__isset.locationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Catalog::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Catalog"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("locationUri", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->locationUri); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.createTime) { + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Catalog &a, Catalog &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.description, b.description); + swap(a.locationUri, b.locationUri); + swap(a.createTime, b.createTime); + swap(a.__isset, b.__isset); +} + +bool Catalog::operator==(const Catalog & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + if (!(locationUri == rhs.locationUri)) + return false; + if (__isset.createTime != rhs.__isset.createTime) + return false; + else if (__isset.createTime && !(createTime == rhs.createTime)) + return false; + return true; +} + +Catalog::Catalog(const Catalog& other224) { + name = other224.name; + description = other224.description; + locationUri = other224.locationUri; + createTime = other224.createTime; + __isset = other224.__isset; +} +Catalog& Catalog::operator=(const Catalog& other225) { + name = other225.name; + description = other225.description; + locationUri = other225.locationUri; + createTime = other225.createTime; + __isset = other225.__isset; + return *this; +} +void Catalog::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Catalog("; + out << "name=" << to_string(name); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ", " << "locationUri=" << to_string(locationUri); + out << ", " << "createTime="; (__isset.createTime ? (out << to_string(createTime)) : (out << "")); + out << ")"; +} + + +CreateCatalogRequest::~CreateCatalogRequest() noexcept { +} + +CreateCatalogRequest::CreateCatalogRequest() noexcept { +} + +void CreateCatalogRequest::__set_catalog(const Catalog& val) { + this->catalog = val; +} +std::ostream& operator<<(std::ostream& out, const CreateCatalogRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CreateCatalogRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->catalog.read(iprot); + this->__isset.catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t CreateCatalogRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CreateCatalogRequest"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->catalog.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CreateCatalogRequest &a, CreateCatalogRequest &b) noexcept { + using ::std::swap; + swap(a.catalog, b.catalog); + swap(a.__isset, b.__isset); +} + +bool CreateCatalogRequest::operator==(const CreateCatalogRequest & rhs) const +{ + if (!(catalog == rhs.catalog)) + return false; + return true; +} + +CreateCatalogRequest::CreateCatalogRequest(const CreateCatalogRequest& other226) { + catalog = other226.catalog; + __isset = other226.__isset; +} +CreateCatalogRequest& CreateCatalogRequest::operator=(const CreateCatalogRequest& other227) { + catalog = other227.catalog; + __isset = other227.__isset; + return *this; +} +void CreateCatalogRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CreateCatalogRequest("; + out << "catalog=" << to_string(catalog); + out << ")"; +} + + +AlterCatalogRequest::~AlterCatalogRequest() noexcept { +} + +AlterCatalogRequest::AlterCatalogRequest() noexcept + : name() { +} + +void AlterCatalogRequest::__set_name(const std::string& val) { + this->name = val; +} + +void AlterCatalogRequest::__set_newCat(const Catalog& val) { + this->newCat = val; +} +std::ostream& operator<<(std::ostream& out, const AlterCatalogRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterCatalogRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newCat.read(iprot); + this->__isset.newCat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AlterCatalogRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterCatalogRequest"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newCat", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->newCat.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterCatalogRequest &a, AlterCatalogRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.newCat, b.newCat); + swap(a.__isset, b.__isset); +} + +bool AlterCatalogRequest::operator==(const AlterCatalogRequest & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(newCat == rhs.newCat)) + return false; + return true; +} + +AlterCatalogRequest::AlterCatalogRequest(const AlterCatalogRequest& other228) { + name = other228.name; + newCat = other228.newCat; + __isset = other228.__isset; +} +AlterCatalogRequest& AlterCatalogRequest::operator=(const AlterCatalogRequest& other229) { + name = other229.name; + newCat = other229.newCat; + __isset = other229.__isset; + return *this; +} +void AlterCatalogRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterCatalogRequest("; + out << "name=" << to_string(name); + out << ", " << "newCat=" << to_string(newCat); + out << ")"; +} + + +GetCatalogRequest::~GetCatalogRequest() noexcept { +} + +GetCatalogRequest::GetCatalogRequest() noexcept + : name() { +} + +void GetCatalogRequest::__set_name(const std::string& val) { + this->name = val; +} +std::ostream& operator<<(std::ostream& out, const GetCatalogRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetCatalogRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetCatalogRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetCatalogRequest"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetCatalogRequest &a, GetCatalogRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.__isset, b.__isset); +} + +bool GetCatalogRequest::operator==(const GetCatalogRequest & rhs) const +{ + if (!(name == rhs.name)) + return false; + return true; +} + +GetCatalogRequest::GetCatalogRequest(const GetCatalogRequest& other230) { + name = other230.name; + __isset = other230.__isset; +} +GetCatalogRequest& GetCatalogRequest::operator=(const GetCatalogRequest& other231) { + name = other231.name; + __isset = other231.__isset; + return *this; +} +void GetCatalogRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetCatalogRequest("; + out << "name=" << to_string(name); + out << ")"; +} + + +GetCatalogResponse::~GetCatalogResponse() noexcept { +} + +GetCatalogResponse::GetCatalogResponse() noexcept { +} + +void GetCatalogResponse::__set_catalog(const Catalog& val) { + this->catalog = val; +} +std::ostream& operator<<(std::ostream& out, const GetCatalogResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetCatalogResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->catalog.read(iprot); + this->__isset.catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetCatalogResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetCatalogResponse"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->catalog.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetCatalogResponse &a, GetCatalogResponse &b) noexcept { + using ::std::swap; + swap(a.catalog, b.catalog); + swap(a.__isset, b.__isset); +} + +bool GetCatalogResponse::operator==(const GetCatalogResponse & rhs) const +{ + if (!(catalog == rhs.catalog)) + return false; + return true; +} + +GetCatalogResponse::GetCatalogResponse(const GetCatalogResponse& other232) { + catalog = other232.catalog; + __isset = other232.__isset; +} +GetCatalogResponse& GetCatalogResponse::operator=(const GetCatalogResponse& other233) { + catalog = other233.catalog; + __isset = other233.__isset; + return *this; +} +void GetCatalogResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetCatalogResponse("; + out << "catalog=" << to_string(catalog); + out << ")"; +} + + +GetCatalogsResponse::~GetCatalogsResponse() noexcept { +} + +GetCatalogsResponse::GetCatalogsResponse() noexcept { +} + +void GetCatalogsResponse::__set_names(const std::vector & val) { + this->names = val; +} +std::ostream& operator<<(std::ostream& out, const GetCatalogsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetCatalogsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->names.clear(); + uint32_t _size234; + ::apache::thrift::protocol::TType _etype237; + xfer += iprot->readListBegin(_etype237, _size234); + this->names.resize(_size234); + uint32_t _i238; + for (_i238 = 0; _i238 < _size234; ++_i238) + { + xfer += iprot->readString(this->names[_i238]); + } + xfer += iprot->readListEnd(); + } + this->__isset.names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetCatalogsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetCatalogsResponse"); + + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->names.size())); + std::vector ::const_iterator _iter239; + for (_iter239 = this->names.begin(); _iter239 != this->names.end(); ++_iter239) + { + xfer += oprot->writeString((*_iter239)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetCatalogsResponse &a, GetCatalogsResponse &b) noexcept { + using ::std::swap; + swap(a.names, b.names); + swap(a.__isset, b.__isset); +} + +bool GetCatalogsResponse::operator==(const GetCatalogsResponse & rhs) const +{ + if (!(names == rhs.names)) + return false; + return true; +} + +GetCatalogsResponse::GetCatalogsResponse(const GetCatalogsResponse& other240) { + names = other240.names; + __isset = other240.__isset; +} +GetCatalogsResponse& GetCatalogsResponse::operator=(const GetCatalogsResponse& other241) { + names = other241.names; + __isset = other241.__isset; + return *this; +} +void GetCatalogsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetCatalogsResponse("; + out << "names=" << to_string(names); + out << ")"; +} + + +DropCatalogRequest::~DropCatalogRequest() noexcept { +} + +DropCatalogRequest::DropCatalogRequest() noexcept + : name() { +} + +void DropCatalogRequest::__set_name(const std::string& val) { + this->name = val; +} +std::ostream& operator<<(std::ostream& out, const DropCatalogRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropCatalogRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t DropCatalogRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropCatalogRequest"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropCatalogRequest &a, DropCatalogRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.__isset, b.__isset); +} + +bool DropCatalogRequest::operator==(const DropCatalogRequest & rhs) const +{ + if (!(name == rhs.name)) + return false; + return true; +} + +DropCatalogRequest::DropCatalogRequest(const DropCatalogRequest& other242) { + name = other242.name; + __isset = other242.__isset; +} +DropCatalogRequest& DropCatalogRequest::operator=(const DropCatalogRequest& other243) { + name = other243.name; + __isset = other243.__isset; + return *this; +} +void DropCatalogRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropCatalogRequest("; + out << "name=" << to_string(name); + out << ")"; +} + + +Database::~Database() noexcept { +} + +Database::Database() noexcept + : name(), + description(), + locationUri(), + ownerName(), + ownerType(static_cast(0)), + catalogName(), + createTime(0), + managedLocationUri(), + type(static_cast(0)), + connector_name(), + remote_dbname() { +} + +void Database::__set_name(const std::string& val) { + this->name = val; +} + +void Database::__set_description(const std::string& val) { + this->description = val; +} + +void Database::__set_locationUri(const std::string& val) { + this->locationUri = val; +} + +void Database::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void Database::__set_privileges(const PrincipalPrivilegeSet& val) { + this->privileges = val; +__isset.privileges = true; +} + +void Database::__set_ownerName(const std::string& val) { + this->ownerName = val; +__isset.ownerName = true; +} + +void Database::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +__isset.ownerType = true; +} + +void Database::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void Database::__set_createTime(const int32_t val) { + this->createTime = val; +__isset.createTime = true; +} + +void Database::__set_managedLocationUri(const std::string& val) { + this->managedLocationUri = val; +__isset.managedLocationUri = true; +} + +void Database::__set_type(const DatabaseType::type val) { + this->type = val; +__isset.type = true; +} + +void Database::__set_connector_name(const std::string& val) { + this->connector_name = val; +__isset.connector_name = true; +} + +void Database::__set_remote_dbname(const std::string& val) { + this->remote_dbname = val; +__isset.remote_dbname = true; +} +std::ostream& operator<<(std::ostream& out, const Database& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Database::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->locationUri); + this->__isset.locationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size244; + ::apache::thrift::protocol::TType _ktype245; + ::apache::thrift::protocol::TType _vtype246; + xfer += iprot->readMapBegin(_ktype245, _vtype246, _size244); + uint32_t _i248; + for (_i248 = 0; _i248 < _size244; ++_i248) + { + std::string _key249; + xfer += iprot->readString(_key249); + std::string& _val250 = this->parameters[_key249]; + xfer += iprot->readString(_val250); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast251; + xfer += iprot->readI32(ecast251); + this->ownerType = static_cast(ecast251); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->managedLocationUri); + this->__isset.managedLocationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast252; + xfer += iprot->readI32(ecast252); + this->type = static_cast(ecast252); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->connector_name); + this->__isset.connector_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->remote_dbname); + this->__isset.remote_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Database::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Database"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("locationUri", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->locationUri); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter253; + for (_iter253 = this->parameters.begin(); _iter253 != this->parameters.end(); ++_iter253) + { + xfer += oprot->writeString(_iter253->first); + xfer += oprot->writeString(_iter253->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.privileges) { + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerName) { + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerType) { + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.createTime) { + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 9); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.managedLocationUri) { + xfer += oprot->writeFieldBegin("managedLocationUri", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->managedLocationUri); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 11); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.connector_name) { + xfer += oprot->writeFieldBegin("connector_name", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->connector_name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.remote_dbname) { + xfer += oprot->writeFieldBegin("remote_dbname", ::apache::thrift::protocol::T_STRING, 13); + xfer += oprot->writeString(this->remote_dbname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Database &a, Database &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.description, b.description); + swap(a.locationUri, b.locationUri); + swap(a.parameters, b.parameters); + swap(a.privileges, b.privileges); + swap(a.ownerName, b.ownerName); + swap(a.ownerType, b.ownerType); + swap(a.catalogName, b.catalogName); + swap(a.createTime, b.createTime); + swap(a.managedLocationUri, b.managedLocationUri); + swap(a.type, b.type); + swap(a.connector_name, b.connector_name); + swap(a.remote_dbname, b.remote_dbname); + swap(a.__isset, b.__isset); +} + +bool Database::operator==(const Database & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(description == rhs.description)) + return false; + if (!(locationUri == rhs.locationUri)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (__isset.privileges != rhs.__isset.privileges) + return false; + else if (__isset.privileges && !(privileges == rhs.privileges)) + return false; + if (__isset.ownerName != rhs.__isset.ownerName) + return false; + else if (__isset.ownerName && !(ownerName == rhs.ownerName)) + return false; + if (__isset.ownerType != rhs.__isset.ownerType) + return false; + else if (__isset.ownerType && !(ownerType == rhs.ownerType)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.createTime != rhs.__isset.createTime) + return false; + else if (__isset.createTime && !(createTime == rhs.createTime)) + return false; + if (__isset.managedLocationUri != rhs.__isset.managedLocationUri) + return false; + else if (__isset.managedLocationUri && !(managedLocationUri == rhs.managedLocationUri)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + if (__isset.connector_name != rhs.__isset.connector_name) + return false; + else if (__isset.connector_name && !(connector_name == rhs.connector_name)) + return false; + if (__isset.remote_dbname != rhs.__isset.remote_dbname) + return false; + else if (__isset.remote_dbname && !(remote_dbname == rhs.remote_dbname)) + return false; + return true; +} + +Database::Database(const Database& other254) { + name = other254.name; + description = other254.description; + locationUri = other254.locationUri; + parameters = other254.parameters; + privileges = other254.privileges; + ownerName = other254.ownerName; + ownerType = other254.ownerType; + catalogName = other254.catalogName; + createTime = other254.createTime; + managedLocationUri = other254.managedLocationUri; + type = other254.type; + connector_name = other254.connector_name; + remote_dbname = other254.remote_dbname; + __isset = other254.__isset; +} +Database& Database::operator=(const Database& other255) { + name = other255.name; + description = other255.description; + locationUri = other255.locationUri; + parameters = other255.parameters; + privileges = other255.privileges; + ownerName = other255.ownerName; + ownerType = other255.ownerType; + catalogName = other255.catalogName; + createTime = other255.createTime; + managedLocationUri = other255.managedLocationUri; + type = other255.type; + connector_name = other255.connector_name; + remote_dbname = other255.remote_dbname; + __isset = other255.__isset; + return *this; +} +void Database::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Database("; + out << "name=" << to_string(name); + out << ", " << "description=" << to_string(description); + out << ", " << "locationUri=" << to_string(locationUri); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); + out << ", " << "ownerName="; (__isset.ownerName ? (out << to_string(ownerName)) : (out << "")); + out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "createTime="; (__isset.createTime ? (out << to_string(createTime)) : (out << "")); + out << ", " << "managedLocationUri="; (__isset.managedLocationUri ? (out << to_string(managedLocationUri)) : (out << "")); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ", " << "connector_name="; (__isset.connector_name ? (out << to_string(connector_name)) : (out << "")); + out << ", " << "remote_dbname="; (__isset.remote_dbname ? (out << to_string(remote_dbname)) : (out << "")); + out << ")"; +} + + +SerDeInfo::~SerDeInfo() noexcept { +} + +SerDeInfo::SerDeInfo() noexcept + : name(), + serializationLib(), + description(), + serializerClass(), + deserializerClass(), + serdeType(static_cast(0)) { +} + +void SerDeInfo::__set_name(const std::string& val) { + this->name = val; +} + +void SerDeInfo::__set_serializationLib(const std::string& val) { + this->serializationLib = val; +} + +void SerDeInfo::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void SerDeInfo::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} + +void SerDeInfo::__set_serializerClass(const std::string& val) { + this->serializerClass = val; +__isset.serializerClass = true; +} + +void SerDeInfo::__set_deserializerClass(const std::string& val) { + this->deserializerClass = val; +__isset.deserializerClass = true; +} + +void SerDeInfo::__set_serdeType(const SerdeType::type val) { + this->serdeType = val; +__isset.serdeType = true; +} +std::ostream& operator<<(std::ostream& out, const SerDeInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SerDeInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->serializationLib); + this->__isset.serializationLib = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size256; + ::apache::thrift::protocol::TType _ktype257; + ::apache::thrift::protocol::TType _vtype258; + xfer += iprot->readMapBegin(_ktype257, _vtype258, _size256); + uint32_t _i260; + for (_i260 = 0; _i260 < _size256; ++_i260) + { + std::string _key261; + xfer += iprot->readString(_key261); + std::string& _val262 = this->parameters[_key261]; + xfer += iprot->readString(_val262); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->serializerClass); + this->__isset.serializerClass = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->deserializerClass); + this->__isset.deserializerClass = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast263; + xfer += iprot->readI32(ecast263); + this->serdeType = static_cast(ecast263); + this->__isset.serdeType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SerDeInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SerDeInfo"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("serializationLib", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->serializationLib); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter264; + for (_iter264 = this->parameters.begin(); _iter264 != this->parameters.end(); ++_iter264) + { + xfer += oprot->writeString(_iter264->first); + xfer += oprot->writeString(_iter264->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.serializerClass) { + xfer += oprot->writeFieldBegin("serializerClass", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->serializerClass); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.deserializerClass) { + xfer += oprot->writeFieldBegin("deserializerClass", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->deserializerClass); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.serdeType) { + xfer += oprot->writeFieldBegin("serdeType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->serdeType)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SerDeInfo &a, SerDeInfo &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.serializationLib, b.serializationLib); + swap(a.parameters, b.parameters); + swap(a.description, b.description); + swap(a.serializerClass, b.serializerClass); + swap(a.deserializerClass, b.deserializerClass); + swap(a.serdeType, b.serdeType); + swap(a.__isset, b.__isset); +} + +bool SerDeInfo::operator==(const SerDeInfo & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(serializationLib == rhs.serializationLib)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + if (__isset.serializerClass != rhs.__isset.serializerClass) + return false; + else if (__isset.serializerClass && !(serializerClass == rhs.serializerClass)) + return false; + if (__isset.deserializerClass != rhs.__isset.deserializerClass) + return false; + else if (__isset.deserializerClass && !(deserializerClass == rhs.deserializerClass)) + return false; + if (__isset.serdeType != rhs.__isset.serdeType) + return false; + else if (__isset.serdeType && !(serdeType == rhs.serdeType)) + return false; + return true; +} + +SerDeInfo::SerDeInfo(const SerDeInfo& other265) { + name = other265.name; + serializationLib = other265.serializationLib; + parameters = other265.parameters; + description = other265.description; + serializerClass = other265.serializerClass; + deserializerClass = other265.deserializerClass; + serdeType = other265.serdeType; + __isset = other265.__isset; +} +SerDeInfo& SerDeInfo::operator=(const SerDeInfo& other266) { + name = other266.name; + serializationLib = other266.serializationLib; + parameters = other266.parameters; + description = other266.description; + serializerClass = other266.serializerClass; + deserializerClass = other266.deserializerClass; + serdeType = other266.serdeType; + __isset = other266.__isset; + return *this; +} +void SerDeInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SerDeInfo("; + out << "name=" << to_string(name); + out << ", " << "serializationLib=" << to_string(serializationLib); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ", " << "serializerClass="; (__isset.serializerClass ? (out << to_string(serializerClass)) : (out << "")); + out << ", " << "deserializerClass="; (__isset.deserializerClass ? (out << to_string(deserializerClass)) : (out << "")); + out << ", " << "serdeType="; (__isset.serdeType ? (out << to_string(serdeType)) : (out << "")); + out << ")"; +} + + +Order::~Order() noexcept { +} + +Order::Order() noexcept + : col(), + order(0) { +} + +void Order::__set_col(const std::string& val) { + this->col = val; +} + +void Order::__set_order(const int32_t val) { + this->order = val; +} +std::ostream& operator<<(std::ostream& out, const Order& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Order::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->col); + this->__isset.col = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->order); + this->__isset.order = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Order::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Order"); + + xfer += oprot->writeFieldBegin("col", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->col); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("order", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->order); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Order &a, Order &b) noexcept { + using ::std::swap; + swap(a.col, b.col); + swap(a.order, b.order); + swap(a.__isset, b.__isset); +} + +bool Order::operator==(const Order & rhs) const +{ + if (!(col == rhs.col)) + return false; + if (!(order == rhs.order)) + return false; + return true; +} + +Order::Order(const Order& other267) { + col = other267.col; + order = other267.order; + __isset = other267.__isset; +} +Order& Order::operator=(const Order& other268) { + col = other268.col; + order = other268.order; + __isset = other268.__isset; + return *this; +} +void Order::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Order("; + out << "col=" << to_string(col); + out << ", " << "order=" << to_string(order); + out << ")"; +} + + +SkewedInfo::~SkewedInfo() noexcept { +} + +SkewedInfo::SkewedInfo() noexcept { +} + +void SkewedInfo::__set_skewedColNames(const std::vector & val) { + this->skewedColNames = val; +} + +void SkewedInfo::__set_skewedColValues(const std::vector > & val) { + this->skewedColValues = val; +} + +void SkewedInfo::__set_skewedColValueLocationMaps(const std::map , std::string> & val) { + this->skewedColValueLocationMaps = val; +} +std::ostream& operator<<(std::ostream& out, const SkewedInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SkewedInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->skewedColNames.clear(); + uint32_t _size269; + ::apache::thrift::protocol::TType _etype272; + xfer += iprot->readListBegin(_etype272, _size269); + this->skewedColNames.resize(_size269); + uint32_t _i273; + for (_i273 = 0; _i273 < _size269; ++_i273) + { + xfer += iprot->readString(this->skewedColNames[_i273]); + } + xfer += iprot->readListEnd(); + } + this->__isset.skewedColNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->skewedColValues.clear(); + uint32_t _size274; + ::apache::thrift::protocol::TType _etype277; + xfer += iprot->readListBegin(_etype277, _size274); + this->skewedColValues.resize(_size274); + uint32_t _i278; + for (_i278 = 0; _i278 < _size274; ++_i278) + { + { + this->skewedColValues[_i278].clear(); + uint32_t _size279; + ::apache::thrift::protocol::TType _etype282; + xfer += iprot->readListBegin(_etype282, _size279); + this->skewedColValues[_i278].resize(_size279); + uint32_t _i283; + for (_i283 = 0; _i283 < _size279; ++_i283) + { + xfer += iprot->readString(this->skewedColValues[_i278][_i283]); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readListEnd(); + } + this->__isset.skewedColValues = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->skewedColValueLocationMaps.clear(); + uint32_t _size284; + ::apache::thrift::protocol::TType _ktype285; + ::apache::thrift::protocol::TType _vtype286; + xfer += iprot->readMapBegin(_ktype285, _vtype286, _size284); + uint32_t _i288; + for (_i288 = 0; _i288 < _size284; ++_i288) + { + std::vector _key289; + { + _key289.clear(); + uint32_t _size291; + ::apache::thrift::protocol::TType _etype294; + xfer += iprot->readListBegin(_etype294, _size291); + _key289.resize(_size291); + uint32_t _i295; + for (_i295 = 0; _i295 < _size291; ++_i295) + { + xfer += iprot->readString(_key289[_i295]); + } + xfer += iprot->readListEnd(); + } + std::string& _val290 = this->skewedColValueLocationMaps[_key289]; + xfer += iprot->readString(_val290); + } + xfer += iprot->readMapEnd(); + } + this->__isset.skewedColValueLocationMaps = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SkewedInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SkewedInfo"); + + xfer += oprot->writeFieldBegin("skewedColNames", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->skewedColNames.size())); + std::vector ::const_iterator _iter296; + for (_iter296 = this->skewedColNames.begin(); _iter296 != this->skewedColNames.end(); ++_iter296) + { + xfer += oprot->writeString((*_iter296)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("skewedColValues", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_LIST, static_cast(this->skewedColValues.size())); + std::vector > ::const_iterator _iter297; + for (_iter297 = this->skewedColValues.begin(); _iter297 != this->skewedColValues.end(); ++_iter297) + { + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*_iter297).size())); + std::vector ::const_iterator _iter298; + for (_iter298 = (*_iter297).begin(); _iter298 != (*_iter297).end(); ++_iter298) + { + xfer += oprot->writeString((*_iter298)); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("skewedColValueLocationMaps", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_LIST, ::apache::thrift::protocol::T_STRING, static_cast(this->skewedColValueLocationMaps.size())); + std::map , std::string> ::const_iterator _iter299; + for (_iter299 = this->skewedColValueLocationMaps.begin(); _iter299 != this->skewedColValueLocationMaps.end(); ++_iter299) + { + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(_iter299->first.size())); + std::vector ::const_iterator _iter300; + for (_iter300 = _iter299->first.begin(); _iter300 != _iter299->first.end(); ++_iter300) + { + xfer += oprot->writeString((*_iter300)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeString(_iter299->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SkewedInfo &a, SkewedInfo &b) noexcept { + using ::std::swap; + swap(a.skewedColNames, b.skewedColNames); + swap(a.skewedColValues, b.skewedColValues); + swap(a.skewedColValueLocationMaps, b.skewedColValueLocationMaps); + swap(a.__isset, b.__isset); +} + +bool SkewedInfo::operator==(const SkewedInfo & rhs) const +{ + if (!(skewedColNames == rhs.skewedColNames)) + return false; + if (!(skewedColValues == rhs.skewedColValues)) + return false; + if (!(skewedColValueLocationMaps == rhs.skewedColValueLocationMaps)) + return false; + return true; +} + +SkewedInfo::SkewedInfo(const SkewedInfo& other301) { + skewedColNames = other301.skewedColNames; + skewedColValues = other301.skewedColValues; + skewedColValueLocationMaps = other301.skewedColValueLocationMaps; + __isset = other301.__isset; +} +SkewedInfo& SkewedInfo::operator=(const SkewedInfo& other302) { + skewedColNames = other302.skewedColNames; + skewedColValues = other302.skewedColValues; + skewedColValueLocationMaps = other302.skewedColValueLocationMaps; + __isset = other302.__isset; + return *this; +} +void SkewedInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SkewedInfo("; + out << "skewedColNames=" << to_string(skewedColNames); + out << ", " << "skewedColValues=" << to_string(skewedColValues); + out << ", " << "skewedColValueLocationMaps=" << to_string(skewedColValueLocationMaps); + out << ")"; +} + + +StorageDescriptor::~StorageDescriptor() noexcept { +} + +StorageDescriptor::StorageDescriptor() noexcept + : location(), + inputFormat(), + outputFormat(), + compressed(0), + numBuckets(0), + storedAsSubDirectories(0) { +} + +void StorageDescriptor::__set_cols(const std::vector & val) { + this->cols = val; +} + +void StorageDescriptor::__set_location(const std::string& val) { + this->location = val; +} + +void StorageDescriptor::__set_inputFormat(const std::string& val) { + this->inputFormat = val; +} + +void StorageDescriptor::__set_outputFormat(const std::string& val) { + this->outputFormat = val; +} + +void StorageDescriptor::__set_compressed(const bool val) { + this->compressed = val; +} + +void StorageDescriptor::__set_numBuckets(const int32_t val) { + this->numBuckets = val; +} + +void StorageDescriptor::__set_serdeInfo(const SerDeInfo& val) { + this->serdeInfo = val; +} + +void StorageDescriptor::__set_bucketCols(const std::vector & val) { + this->bucketCols = val; +} + +void StorageDescriptor::__set_sortCols(const std::vector & val) { + this->sortCols = val; +} + +void StorageDescriptor::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void StorageDescriptor::__set_skewedInfo(const SkewedInfo& val) { + this->skewedInfo = val; +__isset.skewedInfo = true; +} + +void StorageDescriptor::__set_storedAsSubDirectories(const bool val) { + this->storedAsSubDirectories = val; +__isset.storedAsSubDirectories = true; +} +std::ostream& operator<<(std::ostream& out, const StorageDescriptor& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t StorageDescriptor::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->cols.clear(); + uint32_t _size303; + ::apache::thrift::protocol::TType _etype306; + xfer += iprot->readListBegin(_etype306, _size303); + this->cols.resize(_size303); + uint32_t _i307; + for (_i307 = 0; _i307 < _size303; ++_i307) + { + xfer += this->cols[_i307].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.cols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->location); + this->__isset.location = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->inputFormat); + this->__isset.inputFormat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->outputFormat); + this->__isset.outputFormat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->compressed); + this->__isset.compressed = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->numBuckets); + this->__isset.numBuckets = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->serdeInfo.read(iprot); + this->__isset.serdeInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->bucketCols.clear(); + uint32_t _size308; + ::apache::thrift::protocol::TType _etype311; + xfer += iprot->readListBegin(_etype311, _size308); + this->bucketCols.resize(_size308); + uint32_t _i312; + for (_i312 = 0; _i312 < _size308; ++_i312) + { + xfer += iprot->readString(this->bucketCols[_i312]); + } + xfer += iprot->readListEnd(); + } + this->__isset.bucketCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->sortCols.clear(); + uint32_t _size313; + ::apache::thrift::protocol::TType _etype316; + xfer += iprot->readListBegin(_etype316, _size313); + this->sortCols.resize(_size313); + uint32_t _i317; + for (_i317 = 0; _i317 < _size313; ++_i317) + { + xfer += this->sortCols[_i317].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.sortCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size318; + ::apache::thrift::protocol::TType _ktype319; + ::apache::thrift::protocol::TType _vtype320; + xfer += iprot->readMapBegin(_ktype319, _vtype320, _size318); + uint32_t _i322; + for (_i322 = 0; _i322 < _size318; ++_i322) + { + std::string _key323; + xfer += iprot->readString(_key323); + std::string& _val324 = this->parameters[_key323]; + xfer += iprot->readString(_val324); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->skewedInfo.read(iprot); + this->__isset.skewedInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->storedAsSubDirectories); + this->__isset.storedAsSubDirectories = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t StorageDescriptor::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("StorageDescriptor"); + + xfer += oprot->writeFieldBegin("cols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->cols.size())); + std::vector ::const_iterator _iter325; + for (_iter325 = this->cols.begin(); _iter325 != this->cols.end(); ++_iter325) + { + xfer += (*_iter325).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("location", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->location); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("inputFormat", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->inputFormat); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("outputFormat", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->outputFormat); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("compressed", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->compressed); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numBuckets", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(this->numBuckets); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("serdeInfo", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->serdeInfo.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("bucketCols", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->bucketCols.size())); + std::vector ::const_iterator _iter326; + for (_iter326 = this->bucketCols.begin(); _iter326 != this->bucketCols.end(); ++_iter326) + { + xfer += oprot->writeString((*_iter326)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sortCols", ::apache::thrift::protocol::T_LIST, 9); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->sortCols.size())); + std::vector ::const_iterator _iter327; + for (_iter327 = this->sortCols.begin(); _iter327 != this->sortCols.end(); ++_iter327) + { + xfer += (*_iter327).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 10); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter328; + for (_iter328 = this->parameters.begin(); _iter328 != this->parameters.end(); ++_iter328) + { + xfer += oprot->writeString(_iter328->first); + xfer += oprot->writeString(_iter328->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.skewedInfo) { + xfer += oprot->writeFieldBegin("skewedInfo", ::apache::thrift::protocol::T_STRUCT, 11); + xfer += this->skewedInfo.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.storedAsSubDirectories) { + xfer += oprot->writeFieldBegin("storedAsSubDirectories", ::apache::thrift::protocol::T_BOOL, 12); + xfer += oprot->writeBool(this->storedAsSubDirectories); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(StorageDescriptor &a, StorageDescriptor &b) noexcept { + using ::std::swap; + swap(a.cols, b.cols); + swap(a.location, b.location); + swap(a.inputFormat, b.inputFormat); + swap(a.outputFormat, b.outputFormat); + swap(a.compressed, b.compressed); + swap(a.numBuckets, b.numBuckets); + swap(a.serdeInfo, b.serdeInfo); + swap(a.bucketCols, b.bucketCols); + swap(a.sortCols, b.sortCols); + swap(a.parameters, b.parameters); + swap(a.skewedInfo, b.skewedInfo); + swap(a.storedAsSubDirectories, b.storedAsSubDirectories); + swap(a.__isset, b.__isset); +} + +bool StorageDescriptor::operator==(const StorageDescriptor & rhs) const +{ + if (!(cols == rhs.cols)) + return false; + if (!(location == rhs.location)) + return false; + if (!(inputFormat == rhs.inputFormat)) + return false; + if (!(outputFormat == rhs.outputFormat)) + return false; + if (!(compressed == rhs.compressed)) + return false; + if (!(numBuckets == rhs.numBuckets)) + return false; + if (!(serdeInfo == rhs.serdeInfo)) + return false; + if (!(bucketCols == rhs.bucketCols)) + return false; + if (!(sortCols == rhs.sortCols)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (__isset.skewedInfo != rhs.__isset.skewedInfo) + return false; + else if (__isset.skewedInfo && !(skewedInfo == rhs.skewedInfo)) + return false; + if (__isset.storedAsSubDirectories != rhs.__isset.storedAsSubDirectories) + return false; + else if (__isset.storedAsSubDirectories && !(storedAsSubDirectories == rhs.storedAsSubDirectories)) + return false; + return true; +} + +StorageDescriptor::StorageDescriptor(const StorageDescriptor& other329) { + cols = other329.cols; + location = other329.location; + inputFormat = other329.inputFormat; + outputFormat = other329.outputFormat; + compressed = other329.compressed; + numBuckets = other329.numBuckets; + serdeInfo = other329.serdeInfo; + bucketCols = other329.bucketCols; + sortCols = other329.sortCols; + parameters = other329.parameters; + skewedInfo = other329.skewedInfo; + storedAsSubDirectories = other329.storedAsSubDirectories; + __isset = other329.__isset; +} +StorageDescriptor& StorageDescriptor::operator=(const StorageDescriptor& other330) { + cols = other330.cols; + location = other330.location; + inputFormat = other330.inputFormat; + outputFormat = other330.outputFormat; + compressed = other330.compressed; + numBuckets = other330.numBuckets; + serdeInfo = other330.serdeInfo; + bucketCols = other330.bucketCols; + sortCols = other330.sortCols; + parameters = other330.parameters; + skewedInfo = other330.skewedInfo; + storedAsSubDirectories = other330.storedAsSubDirectories; + __isset = other330.__isset; + return *this; +} +void StorageDescriptor::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "StorageDescriptor("; + out << "cols=" << to_string(cols); + out << ", " << "location=" << to_string(location); + out << ", " << "inputFormat=" << to_string(inputFormat); + out << ", " << "outputFormat=" << to_string(outputFormat); + out << ", " << "compressed=" << to_string(compressed); + out << ", " << "numBuckets=" << to_string(numBuckets); + out << ", " << "serdeInfo=" << to_string(serdeInfo); + out << ", " << "bucketCols=" << to_string(bucketCols); + out << ", " << "sortCols=" << to_string(sortCols); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "skewedInfo="; (__isset.skewedInfo ? (out << to_string(skewedInfo)) : (out << "")); + out << ", " << "storedAsSubDirectories="; (__isset.storedAsSubDirectories ? (out << to_string(storedAsSubDirectories)) : (out << "")); + out << ")"; +} + + +CreationMetadata::~CreationMetadata() noexcept { +} + +CreationMetadata::CreationMetadata() noexcept + : catName(), + dbName(), + tblName(), + validTxnList(), + materializationTime(0) { +} + +void CreationMetadata::__set_catName(const std::string& val) { + this->catName = val; +} + +void CreationMetadata::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void CreationMetadata::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void CreationMetadata::__set_tablesUsed(const std::set & val) { + this->tablesUsed = val; +} + +void CreationMetadata::__set_validTxnList(const std::string& val) { + this->validTxnList = val; +__isset.validTxnList = true; +} + +void CreationMetadata::__set_materializationTime(const int64_t val) { + this->materializationTime = val; +__isset.materializationTime = true; +} + +void CreationMetadata::__set_sourceTables(const std::vector & val) { + this->sourceTables = val; +__isset.sourceTables = true; +} +std::ostream& operator<<(std::ostream& out, const CreationMetadata& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CreationMetadata::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_tablesUsed = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_SET) { + { + this->tablesUsed.clear(); + uint32_t _size331; + ::apache::thrift::protocol::TType _etype334; + xfer += iprot->readSetBegin(_etype334, _size331); + uint32_t _i335; + for (_i335 = 0; _i335 < _size331; ++_i335) + { + std::string _elem336; + xfer += iprot->readString(_elem336); + this->tablesUsed.insert(_elem336); + } + xfer += iprot->readSetEnd(); + } + isset_tablesUsed = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validTxnList); + this->__isset.validTxnList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->materializationTime); + this->__isset.materializationTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->sourceTables.clear(); + uint32_t _size337; + ::apache::thrift::protocol::TType _etype340; + xfer += iprot->readListBegin(_etype340, _size337); + this->sourceTables.resize(_size337); + uint32_t _i341; + for (_i341 = 0; _i341 < _size337; ++_i341) + { + xfer += this->sourceTables[_i341].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.sourceTables = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablesUsed) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CreationMetadata::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CreationMetadata"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablesUsed", ::apache::thrift::protocol::T_SET, 4); + { + xfer += oprot->writeSetBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tablesUsed.size())); + std::set ::const_iterator _iter342; + for (_iter342 = this->tablesUsed.begin(); _iter342 != this->tablesUsed.end(); ++_iter342) + { + xfer += oprot->writeString((*_iter342)); + } + xfer += oprot->writeSetEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validTxnList) { + xfer += oprot->writeFieldBegin("validTxnList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validTxnList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.materializationTime) { + xfer += oprot->writeFieldBegin("materializationTime", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->materializationTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.sourceTables) { + xfer += oprot->writeFieldBegin("sourceTables", ::apache::thrift::protocol::T_LIST, 7); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->sourceTables.size())); + std::vector ::const_iterator _iter343; + for (_iter343 = this->sourceTables.begin(); _iter343 != this->sourceTables.end(); ++_iter343) + { + xfer += (*_iter343).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CreationMetadata &a, CreationMetadata &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.tablesUsed, b.tablesUsed); + swap(a.validTxnList, b.validTxnList); + swap(a.materializationTime, b.materializationTime); + swap(a.sourceTables, b.sourceTables); + swap(a.__isset, b.__isset); +} + +bool CreationMetadata::operator==(const CreationMetadata & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(tablesUsed == rhs.tablesUsed)) + return false; + if (__isset.validTxnList != rhs.__isset.validTxnList) + return false; + else if (__isset.validTxnList && !(validTxnList == rhs.validTxnList)) + return false; + if (__isset.materializationTime != rhs.__isset.materializationTime) + return false; + else if (__isset.materializationTime && !(materializationTime == rhs.materializationTime)) + return false; + if (__isset.sourceTables != rhs.__isset.sourceTables) + return false; + else if (__isset.sourceTables && !(sourceTables == rhs.sourceTables)) + return false; + return true; +} + +CreationMetadata::CreationMetadata(const CreationMetadata& other344) { + catName = other344.catName; + dbName = other344.dbName; + tblName = other344.tblName; + tablesUsed = other344.tablesUsed; + validTxnList = other344.validTxnList; + materializationTime = other344.materializationTime; + sourceTables = other344.sourceTables; + __isset = other344.__isset; +} +CreationMetadata& CreationMetadata::operator=(const CreationMetadata& other345) { + catName = other345.catName; + dbName = other345.dbName; + tblName = other345.tblName; + tablesUsed = other345.tablesUsed; + validTxnList = other345.validTxnList; + materializationTime = other345.materializationTime; + sourceTables = other345.sourceTables; + __isset = other345.__isset; + return *this; +} +void CreationMetadata::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CreationMetadata("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "tablesUsed=" << to_string(tablesUsed); + out << ", " << "validTxnList="; (__isset.validTxnList ? (out << to_string(validTxnList)) : (out << "")); + out << ", " << "materializationTime="; (__isset.materializationTime ? (out << to_string(materializationTime)) : (out << "")); + out << ", " << "sourceTables="; (__isset.sourceTables ? (out << to_string(sourceTables)) : (out << "")); + out << ")"; +} + + +BooleanColumnStatsData::~BooleanColumnStatsData() noexcept { +} + +BooleanColumnStatsData::BooleanColumnStatsData() noexcept + : numTrues(0), + numFalses(0), + numNulls(0), + bitVectors() { +} + +void BooleanColumnStatsData::__set_numTrues(const int64_t val) { + this->numTrues = val; +} + +void BooleanColumnStatsData::__set_numFalses(const int64_t val) { + this->numFalses = val; +} + +void BooleanColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void BooleanColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} +std::ostream& operator<<(std::ostream& out, const BooleanColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t BooleanColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numTrues = false; + bool isset_numFalses = false; + bool isset_numNulls = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numTrues); + isset_numTrues = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numFalses); + isset_numFalses = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numTrues) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numFalses) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t BooleanColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("BooleanColumnStatsData"); + + xfer += oprot->writeFieldBegin("numTrues", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->numTrues); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numFalses", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->numFalses); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(BooleanColumnStatsData &a, BooleanColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.numTrues, b.numTrues); + swap(a.numFalses, b.numFalses); + swap(a.numNulls, b.numNulls); + swap(a.bitVectors, b.bitVectors); + swap(a.__isset, b.__isset); +} + +bool BooleanColumnStatsData::operator==(const BooleanColumnStatsData & rhs) const +{ + if (!(numTrues == rhs.numTrues)) + return false; + if (!(numFalses == rhs.numFalses)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + return true; +} + +BooleanColumnStatsData::BooleanColumnStatsData(const BooleanColumnStatsData& other346) { + numTrues = other346.numTrues; + numFalses = other346.numFalses; + numNulls = other346.numNulls; + bitVectors = other346.bitVectors; + __isset = other346.__isset; +} +BooleanColumnStatsData& BooleanColumnStatsData::operator=(const BooleanColumnStatsData& other347) { + numTrues = other347.numTrues; + numFalses = other347.numFalses; + numNulls = other347.numNulls; + bitVectors = other347.bitVectors; + __isset = other347.__isset; + return *this; +} +void BooleanColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "BooleanColumnStatsData("; + out << "numTrues=" << to_string(numTrues); + out << ", " << "numFalses=" << to_string(numFalses); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ")"; +} + + +DoubleColumnStatsData::~DoubleColumnStatsData() noexcept { +} + +DoubleColumnStatsData::DoubleColumnStatsData() noexcept + : lowValue(0), + highValue(0), + numNulls(0), + numDVs(0), + bitVectors(), + histogram() { +} + +void DoubleColumnStatsData::__set_lowValue(const double val) { + this->lowValue = val; +__isset.lowValue = true; +} + +void DoubleColumnStatsData::__set_highValue(const double val) { + this->highValue = val; +__isset.highValue = true; +} + +void DoubleColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void DoubleColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void DoubleColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} + +void DoubleColumnStatsData::__set_histogram(const std::string& val) { + this->histogram = val; +__isset.histogram = true; +} +std::ostream& operator<<(std::ostream& out, const DoubleColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DoubleColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->lowValue); + this->__isset.lowValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->highValue); + this->__isset.highValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->histogram); + this->__isset.histogram = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DoubleColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DoubleColumnStatsData"); + + if (this->__isset.lowValue) { + xfer += oprot->writeFieldBegin("lowValue", ::apache::thrift::protocol::T_DOUBLE, 1); + xfer += oprot->writeDouble(this->lowValue); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highValue) { + xfer += oprot->writeFieldBegin("highValue", ::apache::thrift::protocol::T_DOUBLE, 2); + xfer += oprot->writeDouble(this->highValue); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.histogram) { + xfer += oprot->writeFieldBegin("histogram", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeBinary(this->histogram); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DoubleColumnStatsData &a, DoubleColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.lowValue, b.lowValue); + swap(a.highValue, b.highValue); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.histogram, b.histogram); + swap(a.__isset, b.__isset); +} + +bool DoubleColumnStatsData::operator==(const DoubleColumnStatsData & rhs) const +{ + if (__isset.lowValue != rhs.__isset.lowValue) + return false; + else if (__isset.lowValue && !(lowValue == rhs.lowValue)) + return false; + if (__isset.highValue != rhs.__isset.highValue) + return false; + else if (__isset.highValue && !(highValue == rhs.highValue)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + if (__isset.histogram != rhs.__isset.histogram) + return false; + else if (__isset.histogram && !(histogram == rhs.histogram)) + return false; + return true; +} + +DoubleColumnStatsData::DoubleColumnStatsData(const DoubleColumnStatsData& other348) { + lowValue = other348.lowValue; + highValue = other348.highValue; + numNulls = other348.numNulls; + numDVs = other348.numDVs; + bitVectors = other348.bitVectors; + histogram = other348.histogram; + __isset = other348.__isset; +} +DoubleColumnStatsData& DoubleColumnStatsData::operator=(const DoubleColumnStatsData& other349) { + lowValue = other349.lowValue; + highValue = other349.highValue; + numNulls = other349.numNulls; + numDVs = other349.numDVs; + bitVectors = other349.bitVectors; + histogram = other349.histogram; + __isset = other349.__isset; + return *this; +} +void DoubleColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DoubleColumnStatsData("; + out << "lowValue="; (__isset.lowValue ? (out << to_string(lowValue)) : (out << "")); + out << ", " << "highValue="; (__isset.highValue ? (out << to_string(highValue)) : (out << "")); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ", " << "histogram="; (__isset.histogram ? (out << to_string(histogram)) : (out << "")); + out << ")"; +} + + +LongColumnStatsData::~LongColumnStatsData() noexcept { +} + +LongColumnStatsData::LongColumnStatsData() noexcept + : lowValue(0), + highValue(0), + numNulls(0), + numDVs(0), + bitVectors(), + histogram() { +} + +void LongColumnStatsData::__set_lowValue(const int64_t val) { + this->lowValue = val; +__isset.lowValue = true; +} + +void LongColumnStatsData::__set_highValue(const int64_t val) { + this->highValue = val; +__isset.highValue = true; +} + +void LongColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void LongColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void LongColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} + +void LongColumnStatsData::__set_histogram(const std::string& val) { + this->histogram = val; +__isset.histogram = true; +} +std::ostream& operator<<(std::ostream& out, const LongColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t LongColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lowValue); + this->__isset.lowValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->highValue); + this->__isset.highValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->histogram); + this->__isset.histogram = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t LongColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("LongColumnStatsData"); + + if (this->__isset.lowValue) { + xfer += oprot->writeFieldBegin("lowValue", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lowValue); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highValue) { + xfer += oprot->writeFieldBegin("highValue", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->highValue); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.histogram) { + xfer += oprot->writeFieldBegin("histogram", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeBinary(this->histogram); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(LongColumnStatsData &a, LongColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.lowValue, b.lowValue); + swap(a.highValue, b.highValue); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.histogram, b.histogram); + swap(a.__isset, b.__isset); +} + +bool LongColumnStatsData::operator==(const LongColumnStatsData & rhs) const +{ + if (__isset.lowValue != rhs.__isset.lowValue) + return false; + else if (__isset.lowValue && !(lowValue == rhs.lowValue)) + return false; + if (__isset.highValue != rhs.__isset.highValue) + return false; + else if (__isset.highValue && !(highValue == rhs.highValue)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + if (__isset.histogram != rhs.__isset.histogram) + return false; + else if (__isset.histogram && !(histogram == rhs.histogram)) + return false; + return true; +} + +LongColumnStatsData::LongColumnStatsData(const LongColumnStatsData& other350) { + lowValue = other350.lowValue; + highValue = other350.highValue; + numNulls = other350.numNulls; + numDVs = other350.numDVs; + bitVectors = other350.bitVectors; + histogram = other350.histogram; + __isset = other350.__isset; +} +LongColumnStatsData& LongColumnStatsData::operator=(const LongColumnStatsData& other351) { + lowValue = other351.lowValue; + highValue = other351.highValue; + numNulls = other351.numNulls; + numDVs = other351.numDVs; + bitVectors = other351.bitVectors; + histogram = other351.histogram; + __isset = other351.__isset; + return *this; +} +void LongColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "LongColumnStatsData("; + out << "lowValue="; (__isset.lowValue ? (out << to_string(lowValue)) : (out << "")); + out << ", " << "highValue="; (__isset.highValue ? (out << to_string(highValue)) : (out << "")); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ", " << "histogram="; (__isset.histogram ? (out << to_string(histogram)) : (out << "")); + out << ")"; +} + + +StringColumnStatsData::~StringColumnStatsData() noexcept { +} + +StringColumnStatsData::StringColumnStatsData() noexcept + : maxColLen(0), + avgColLen(0), + numNulls(0), + numDVs(0), + bitVectors() { +} + +void StringColumnStatsData::__set_maxColLen(const int64_t val) { + this->maxColLen = val; +} + +void StringColumnStatsData::__set_avgColLen(const double val) { + this->avgColLen = val; +} + +void StringColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void StringColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void StringColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} +std::ostream& operator<<(std::ostream& out, const StringColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t StringColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_maxColLen = false; + bool isset_avgColLen = false; + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->maxColLen); + isset_maxColLen = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->avgColLen); + isset_avgColLen = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_maxColLen) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_avgColLen) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t StringColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("StringColumnStatsData"); + + xfer += oprot->writeFieldBegin("maxColLen", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->maxColLen); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("avgColLen", ::apache::thrift::protocol::T_DOUBLE, 2); + xfer += oprot->writeDouble(this->avgColLen); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(StringColumnStatsData &a, StringColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.maxColLen, b.maxColLen); + swap(a.avgColLen, b.avgColLen); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.__isset, b.__isset); +} + +bool StringColumnStatsData::operator==(const StringColumnStatsData & rhs) const +{ + if (!(maxColLen == rhs.maxColLen)) + return false; + if (!(avgColLen == rhs.avgColLen)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + return true; +} + +StringColumnStatsData::StringColumnStatsData(const StringColumnStatsData& other352) { + maxColLen = other352.maxColLen; + avgColLen = other352.avgColLen; + numNulls = other352.numNulls; + numDVs = other352.numDVs; + bitVectors = other352.bitVectors; + __isset = other352.__isset; +} +StringColumnStatsData& StringColumnStatsData::operator=(const StringColumnStatsData& other353) { + maxColLen = other353.maxColLen; + avgColLen = other353.avgColLen; + numNulls = other353.numNulls; + numDVs = other353.numDVs; + bitVectors = other353.bitVectors; + __isset = other353.__isset; + return *this; +} +void StringColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "StringColumnStatsData("; + out << "maxColLen=" << to_string(maxColLen); + out << ", " << "avgColLen=" << to_string(avgColLen); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ")"; +} + + +BinaryColumnStatsData::~BinaryColumnStatsData() noexcept { +} + +BinaryColumnStatsData::BinaryColumnStatsData() noexcept + : maxColLen(0), + avgColLen(0), + numNulls(0), + bitVectors() { +} + +void BinaryColumnStatsData::__set_maxColLen(const int64_t val) { + this->maxColLen = val; +} + +void BinaryColumnStatsData::__set_avgColLen(const double val) { + this->avgColLen = val; +} + +void BinaryColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void BinaryColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} +std::ostream& operator<<(std::ostream& out, const BinaryColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t BinaryColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_maxColLen = false; + bool isset_avgColLen = false; + bool isset_numNulls = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->maxColLen); + isset_maxColLen = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->avgColLen); + isset_avgColLen = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_maxColLen) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_avgColLen) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t BinaryColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("BinaryColumnStatsData"); + + xfer += oprot->writeFieldBegin("maxColLen", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->maxColLen); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("avgColLen", ::apache::thrift::protocol::T_DOUBLE, 2); + xfer += oprot->writeDouble(this->avgColLen); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(BinaryColumnStatsData &a, BinaryColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.maxColLen, b.maxColLen); + swap(a.avgColLen, b.avgColLen); + swap(a.numNulls, b.numNulls); + swap(a.bitVectors, b.bitVectors); + swap(a.__isset, b.__isset); +} + +bool BinaryColumnStatsData::operator==(const BinaryColumnStatsData & rhs) const +{ + if (!(maxColLen == rhs.maxColLen)) + return false; + if (!(avgColLen == rhs.avgColLen)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + return true; +} + +BinaryColumnStatsData::BinaryColumnStatsData(const BinaryColumnStatsData& other354) { + maxColLen = other354.maxColLen; + avgColLen = other354.avgColLen; + numNulls = other354.numNulls; + bitVectors = other354.bitVectors; + __isset = other354.__isset; +} +BinaryColumnStatsData& BinaryColumnStatsData::operator=(const BinaryColumnStatsData& other355) { + maxColLen = other355.maxColLen; + avgColLen = other355.avgColLen; + numNulls = other355.numNulls; + bitVectors = other355.bitVectors; + __isset = other355.__isset; + return *this; +} +void BinaryColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "BinaryColumnStatsData("; + out << "maxColLen=" << to_string(maxColLen); + out << ", " << "avgColLen=" << to_string(avgColLen); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ")"; +} + + +Decimal::~Decimal() noexcept { +} + +Decimal::Decimal() noexcept + : scale(0), + unscaled() { +} + +void Decimal::__set_scale(const int16_t val) { + this->scale = val; +} + +void Decimal::__set_unscaled(const std::string& val) { + this->unscaled = val; +} +std::ostream& operator<<(std::ostream& out, const Decimal& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Decimal::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_scale = false; + bool isset_unscaled = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 3: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->scale); + isset_scale = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->unscaled); + isset_unscaled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_scale) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_unscaled) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Decimal::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Decimal"); + + xfer += oprot->writeFieldBegin("unscaled", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->unscaled); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("scale", ::apache::thrift::protocol::T_I16, 3); + xfer += oprot->writeI16(this->scale); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Decimal &a, Decimal &b) noexcept { + using ::std::swap; + swap(a.scale, b.scale); + swap(a.unscaled, b.unscaled); +} + +bool Decimal::operator==(const Decimal & rhs) const +{ + if (!(scale == rhs.scale)) + return false; + if (!(unscaled == rhs.unscaled)) + return false; + return true; +} + +Decimal::Decimal(const Decimal& other356) { + scale = other356.scale; + unscaled = other356.unscaled; +} +Decimal& Decimal::operator=(const Decimal& other357) { + scale = other357.scale; + unscaled = other357.unscaled; + return *this; +} +void Decimal::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Decimal("; + out << "scale=" << to_string(scale); + out << ", " << "unscaled=" << to_string(unscaled); + out << ")"; +} + + +DecimalColumnStatsData::~DecimalColumnStatsData() noexcept { +} + +DecimalColumnStatsData::DecimalColumnStatsData() noexcept + : numNulls(0), + numDVs(0), + bitVectors(), + histogram() { +} + +void DecimalColumnStatsData::__set_lowValue(const Decimal& val) { + this->lowValue = val; +__isset.lowValue = true; +} + +void DecimalColumnStatsData::__set_highValue(const Decimal& val) { + this->highValue = val; +__isset.highValue = true; +} + +void DecimalColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void DecimalColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void DecimalColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} + +void DecimalColumnStatsData::__set_histogram(const std::string& val) { + this->histogram = val; +__isset.histogram = true; +} +std::ostream& operator<<(std::ostream& out, const DecimalColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DecimalColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->lowValue.read(iprot); + this->__isset.lowValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->highValue.read(iprot); + this->__isset.highValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->histogram); + this->__isset.histogram = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DecimalColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DecimalColumnStatsData"); + + if (this->__isset.lowValue) { + xfer += oprot->writeFieldBegin("lowValue", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->lowValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highValue) { + xfer += oprot->writeFieldBegin("highValue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->highValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.histogram) { + xfer += oprot->writeFieldBegin("histogram", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeBinary(this->histogram); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DecimalColumnStatsData &a, DecimalColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.lowValue, b.lowValue); + swap(a.highValue, b.highValue); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.histogram, b.histogram); + swap(a.__isset, b.__isset); +} + +bool DecimalColumnStatsData::operator==(const DecimalColumnStatsData & rhs) const +{ + if (__isset.lowValue != rhs.__isset.lowValue) + return false; + else if (__isset.lowValue && !(lowValue == rhs.lowValue)) + return false; + if (__isset.highValue != rhs.__isset.highValue) + return false; + else if (__isset.highValue && !(highValue == rhs.highValue)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + if (__isset.histogram != rhs.__isset.histogram) + return false; + else if (__isset.histogram && !(histogram == rhs.histogram)) + return false; + return true; +} + +DecimalColumnStatsData::DecimalColumnStatsData(const DecimalColumnStatsData& other358) { + lowValue = other358.lowValue; + highValue = other358.highValue; + numNulls = other358.numNulls; + numDVs = other358.numDVs; + bitVectors = other358.bitVectors; + histogram = other358.histogram; + __isset = other358.__isset; +} +DecimalColumnStatsData& DecimalColumnStatsData::operator=(const DecimalColumnStatsData& other359) { + lowValue = other359.lowValue; + highValue = other359.highValue; + numNulls = other359.numNulls; + numDVs = other359.numDVs; + bitVectors = other359.bitVectors; + histogram = other359.histogram; + __isset = other359.__isset; + return *this; +} +void DecimalColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DecimalColumnStatsData("; + out << "lowValue="; (__isset.lowValue ? (out << to_string(lowValue)) : (out << "")); + out << ", " << "highValue="; (__isset.highValue ? (out << to_string(highValue)) : (out << "")); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ", " << "histogram="; (__isset.histogram ? (out << to_string(histogram)) : (out << "")); + out << ")"; +} + + +Date::~Date() noexcept { +} + +Date::Date() noexcept + : daysSinceEpoch(0) { +} + +void Date::__set_daysSinceEpoch(const int64_t val) { + this->daysSinceEpoch = val; +} +std::ostream& operator<<(std::ostream& out, const Date& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Date::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_daysSinceEpoch = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->daysSinceEpoch); + isset_daysSinceEpoch = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_daysSinceEpoch) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Date::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Date"); + + xfer += oprot->writeFieldBegin("daysSinceEpoch", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->daysSinceEpoch); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Date &a, Date &b) noexcept { + using ::std::swap; + swap(a.daysSinceEpoch, b.daysSinceEpoch); +} + +bool Date::operator==(const Date & rhs) const +{ + if (!(daysSinceEpoch == rhs.daysSinceEpoch)) + return false; + return true; +} + +Date::Date(const Date& other360) noexcept { + daysSinceEpoch = other360.daysSinceEpoch; +} +Date& Date::operator=(const Date& other361) noexcept { + daysSinceEpoch = other361.daysSinceEpoch; + return *this; +} +void Date::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Date("; + out << "daysSinceEpoch=" << to_string(daysSinceEpoch); + out << ")"; +} + + +DateColumnStatsData::~DateColumnStatsData() noexcept { +} + +DateColumnStatsData::DateColumnStatsData() noexcept + : numNulls(0), + numDVs(0), + bitVectors(), + histogram() { +} + +void DateColumnStatsData::__set_lowValue(const Date& val) { + this->lowValue = val; +__isset.lowValue = true; +} + +void DateColumnStatsData::__set_highValue(const Date& val) { + this->highValue = val; +__isset.highValue = true; +} + +void DateColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void DateColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void DateColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} + +void DateColumnStatsData::__set_histogram(const std::string& val) { + this->histogram = val; +__isset.histogram = true; +} +std::ostream& operator<<(std::ostream& out, const DateColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DateColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->lowValue.read(iprot); + this->__isset.lowValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->highValue.read(iprot); + this->__isset.highValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->histogram); + this->__isset.histogram = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DateColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DateColumnStatsData"); + + if (this->__isset.lowValue) { + xfer += oprot->writeFieldBegin("lowValue", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->lowValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highValue) { + xfer += oprot->writeFieldBegin("highValue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->highValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.histogram) { + xfer += oprot->writeFieldBegin("histogram", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeBinary(this->histogram); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DateColumnStatsData &a, DateColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.lowValue, b.lowValue); + swap(a.highValue, b.highValue); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.histogram, b.histogram); + swap(a.__isset, b.__isset); +} + +bool DateColumnStatsData::operator==(const DateColumnStatsData & rhs) const +{ + if (__isset.lowValue != rhs.__isset.lowValue) + return false; + else if (__isset.lowValue && !(lowValue == rhs.lowValue)) + return false; + if (__isset.highValue != rhs.__isset.highValue) + return false; + else if (__isset.highValue && !(highValue == rhs.highValue)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + if (__isset.histogram != rhs.__isset.histogram) + return false; + else if (__isset.histogram && !(histogram == rhs.histogram)) + return false; + return true; +} + +DateColumnStatsData::DateColumnStatsData(const DateColumnStatsData& other362) { + lowValue = other362.lowValue; + highValue = other362.highValue; + numNulls = other362.numNulls; + numDVs = other362.numDVs; + bitVectors = other362.bitVectors; + histogram = other362.histogram; + __isset = other362.__isset; +} +DateColumnStatsData& DateColumnStatsData::operator=(const DateColumnStatsData& other363) { + lowValue = other363.lowValue; + highValue = other363.highValue; + numNulls = other363.numNulls; + numDVs = other363.numDVs; + bitVectors = other363.bitVectors; + histogram = other363.histogram; + __isset = other363.__isset; + return *this; +} +void DateColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DateColumnStatsData("; + out << "lowValue="; (__isset.lowValue ? (out << to_string(lowValue)) : (out << "")); + out << ", " << "highValue="; (__isset.highValue ? (out << to_string(highValue)) : (out << "")); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ", " << "histogram="; (__isset.histogram ? (out << to_string(histogram)) : (out << "")); + out << ")"; +} + + +Timestamp::~Timestamp() noexcept { +} + +Timestamp::Timestamp() noexcept + : secondsSinceEpoch(0) { +} + +void Timestamp::__set_secondsSinceEpoch(const int64_t val) { + this->secondsSinceEpoch = val; +} +std::ostream& operator<<(std::ostream& out, const Timestamp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Timestamp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_secondsSinceEpoch = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->secondsSinceEpoch); + isset_secondsSinceEpoch = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_secondsSinceEpoch) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Timestamp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Timestamp"); + + xfer += oprot->writeFieldBegin("secondsSinceEpoch", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->secondsSinceEpoch); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Timestamp &a, Timestamp &b) noexcept { + using ::std::swap; + swap(a.secondsSinceEpoch, b.secondsSinceEpoch); +} + +bool Timestamp::operator==(const Timestamp & rhs) const +{ + if (!(secondsSinceEpoch == rhs.secondsSinceEpoch)) + return false; + return true; +} + +Timestamp::Timestamp(const Timestamp& other364) noexcept { + secondsSinceEpoch = other364.secondsSinceEpoch; +} +Timestamp& Timestamp::operator=(const Timestamp& other365) noexcept { + secondsSinceEpoch = other365.secondsSinceEpoch; + return *this; +} +void Timestamp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Timestamp("; + out << "secondsSinceEpoch=" << to_string(secondsSinceEpoch); + out << ")"; +} + + +TimestampColumnStatsData::~TimestampColumnStatsData() noexcept { +} + +TimestampColumnStatsData::TimestampColumnStatsData() noexcept + : numNulls(0), + numDVs(0), + bitVectors(), + histogram() { +} + +void TimestampColumnStatsData::__set_lowValue(const Timestamp& val) { + this->lowValue = val; +__isset.lowValue = true; +} + +void TimestampColumnStatsData::__set_highValue(const Timestamp& val) { + this->highValue = val; +__isset.highValue = true; +} + +void TimestampColumnStatsData::__set_numNulls(const int64_t val) { + this->numNulls = val; +} + +void TimestampColumnStatsData::__set_numDVs(const int64_t val) { + this->numDVs = val; +} + +void TimestampColumnStatsData::__set_bitVectors(const std::string& val) { + this->bitVectors = val; +__isset.bitVectors = true; +} + +void TimestampColumnStatsData::__set_histogram(const std::string& val) { + this->histogram = val; +__isset.histogram = true; +} +std::ostream& operator<<(std::ostream& out, const TimestampColumnStatsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TimestampColumnStatsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_numNulls = false; + bool isset_numDVs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->lowValue.read(iprot); + this->__isset.lowValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->highValue.read(iprot); + this->__isset.highValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numNulls); + isset_numNulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->numDVs); + isset_numDVs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->bitVectors); + this->__isset.bitVectors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->histogram); + this->__isset.histogram = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_numNulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_numDVs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TimestampColumnStatsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TimestampColumnStatsData"); + + if (this->__isset.lowValue) { + xfer += oprot->writeFieldBegin("lowValue", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->lowValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highValue) { + xfer += oprot->writeFieldBegin("highValue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->highValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("numNulls", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->numNulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("numDVs", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->numDVs); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.bitVectors) { + xfer += oprot->writeFieldBegin("bitVectors", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->bitVectors); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.histogram) { + xfer += oprot->writeFieldBegin("histogram", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeBinary(this->histogram); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TimestampColumnStatsData &a, TimestampColumnStatsData &b) noexcept { + using ::std::swap; + swap(a.lowValue, b.lowValue); + swap(a.highValue, b.highValue); + swap(a.numNulls, b.numNulls); + swap(a.numDVs, b.numDVs); + swap(a.bitVectors, b.bitVectors); + swap(a.histogram, b.histogram); + swap(a.__isset, b.__isset); +} + +bool TimestampColumnStatsData::operator==(const TimestampColumnStatsData & rhs) const +{ + if (__isset.lowValue != rhs.__isset.lowValue) + return false; + else if (__isset.lowValue && !(lowValue == rhs.lowValue)) + return false; + if (__isset.highValue != rhs.__isset.highValue) + return false; + else if (__isset.highValue && !(highValue == rhs.highValue)) + return false; + if (!(numNulls == rhs.numNulls)) + return false; + if (!(numDVs == rhs.numDVs)) + return false; + if (__isset.bitVectors != rhs.__isset.bitVectors) + return false; + else if (__isset.bitVectors && !(bitVectors == rhs.bitVectors)) + return false; + if (__isset.histogram != rhs.__isset.histogram) + return false; + else if (__isset.histogram && !(histogram == rhs.histogram)) + return false; + return true; +} + +TimestampColumnStatsData::TimestampColumnStatsData(const TimestampColumnStatsData& other366) { + lowValue = other366.lowValue; + highValue = other366.highValue; + numNulls = other366.numNulls; + numDVs = other366.numDVs; + bitVectors = other366.bitVectors; + histogram = other366.histogram; + __isset = other366.__isset; +} +TimestampColumnStatsData& TimestampColumnStatsData::operator=(const TimestampColumnStatsData& other367) { + lowValue = other367.lowValue; + highValue = other367.highValue; + numNulls = other367.numNulls; + numDVs = other367.numDVs; + bitVectors = other367.bitVectors; + histogram = other367.histogram; + __isset = other367.__isset; + return *this; +} +void TimestampColumnStatsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TimestampColumnStatsData("; + out << "lowValue="; (__isset.lowValue ? (out << to_string(lowValue)) : (out << "")); + out << ", " << "highValue="; (__isset.highValue ? (out << to_string(highValue)) : (out << "")); + out << ", " << "numNulls=" << to_string(numNulls); + out << ", " << "numDVs=" << to_string(numDVs); + out << ", " << "bitVectors="; (__isset.bitVectors ? (out << to_string(bitVectors)) : (out << "")); + out << ", " << "histogram="; (__isset.histogram ? (out << to_string(histogram)) : (out << "")); + out << ")"; +} + + +ColumnStatisticsData::~ColumnStatisticsData() noexcept { +} + +ColumnStatisticsData::ColumnStatisticsData() noexcept { +} + +void ColumnStatisticsData::__set_booleanStats(const BooleanColumnStatsData& val) { + this->booleanStats = val; +__isset.booleanStats = true; +} + +void ColumnStatisticsData::__set_longStats(const LongColumnStatsData& val) { + this->longStats = val; +__isset.longStats = true; +} + +void ColumnStatisticsData::__set_doubleStats(const DoubleColumnStatsData& val) { + this->doubleStats = val; +__isset.doubleStats = true; +} + +void ColumnStatisticsData::__set_stringStats(const StringColumnStatsData& val) { + this->stringStats = val; +__isset.stringStats = true; +} + +void ColumnStatisticsData::__set_binaryStats(const BinaryColumnStatsData& val) { + this->binaryStats = val; +__isset.binaryStats = true; +} + +void ColumnStatisticsData::__set_decimalStats(const DecimalColumnStatsData& val) { + this->decimalStats = val; +__isset.decimalStats = true; +} + +void ColumnStatisticsData::__set_dateStats(const DateColumnStatsData& val) { + this->dateStats = val; +__isset.dateStats = true; +} + +void ColumnStatisticsData::__set_timestampStats(const TimestampColumnStatsData& val) { + this->timestampStats = val; +__isset.timestampStats = true; +} +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ColumnStatisticsData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->booleanStats.read(iprot); + this->__isset.booleanStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->longStats.read(iprot); + this->__isset.longStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->doubleStats.read(iprot); + this->__isset.doubleStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stringStats.read(iprot); + this->__isset.stringStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->binaryStats.read(iprot); + this->__isset.binaryStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->decimalStats.read(iprot); + this->__isset.decimalStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dateStats.read(iprot); + this->__isset.dateStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->timestampStats.read(iprot); + this->__isset.timestampStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ColumnStatisticsData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ColumnStatisticsData"); + + if (this->__isset.booleanStats) { + xfer += oprot->writeFieldBegin("booleanStats", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->booleanStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.longStats) { + xfer += oprot->writeFieldBegin("longStats", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->longStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.doubleStats) { + xfer += oprot->writeFieldBegin("doubleStats", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->doubleStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.stringStats) { + xfer += oprot->writeFieldBegin("stringStats", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->stringStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.binaryStats) { + xfer += oprot->writeFieldBegin("binaryStats", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->binaryStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.decimalStats) { + xfer += oprot->writeFieldBegin("decimalStats", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->decimalStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dateStats) { + xfer += oprot->writeFieldBegin("dateStats", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->dateStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.timestampStats) { + xfer += oprot->writeFieldBegin("timestampStats", ::apache::thrift::protocol::T_STRUCT, 8); + xfer += this->timestampStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ColumnStatisticsData &a, ColumnStatisticsData &b) noexcept { + using ::std::swap; + swap(a.booleanStats, b.booleanStats); + swap(a.longStats, b.longStats); + swap(a.doubleStats, b.doubleStats); + swap(a.stringStats, b.stringStats); + swap(a.binaryStats, b.binaryStats); + swap(a.decimalStats, b.decimalStats); + swap(a.dateStats, b.dateStats); + swap(a.timestampStats, b.timestampStats); + swap(a.__isset, b.__isset); +} + +bool ColumnStatisticsData::operator==(const ColumnStatisticsData & rhs) const +{ + if (__isset.booleanStats != rhs.__isset.booleanStats) + return false; + else if (__isset.booleanStats && !(booleanStats == rhs.booleanStats)) + return false; + if (__isset.longStats != rhs.__isset.longStats) + return false; + else if (__isset.longStats && !(longStats == rhs.longStats)) + return false; + if (__isset.doubleStats != rhs.__isset.doubleStats) + return false; + else if (__isset.doubleStats && !(doubleStats == rhs.doubleStats)) + return false; + if (__isset.stringStats != rhs.__isset.stringStats) + return false; + else if (__isset.stringStats && !(stringStats == rhs.stringStats)) + return false; + if (__isset.binaryStats != rhs.__isset.binaryStats) + return false; + else if (__isset.binaryStats && !(binaryStats == rhs.binaryStats)) + return false; + if (__isset.decimalStats != rhs.__isset.decimalStats) + return false; + else if (__isset.decimalStats && !(decimalStats == rhs.decimalStats)) + return false; + if (__isset.dateStats != rhs.__isset.dateStats) + return false; + else if (__isset.dateStats && !(dateStats == rhs.dateStats)) + return false; + if (__isset.timestampStats != rhs.__isset.timestampStats) + return false; + else if (__isset.timestampStats && !(timestampStats == rhs.timestampStats)) + return false; + return true; +} + +ColumnStatisticsData::ColumnStatisticsData(const ColumnStatisticsData& other368) { + booleanStats = other368.booleanStats; + longStats = other368.longStats; + doubleStats = other368.doubleStats; + stringStats = other368.stringStats; + binaryStats = other368.binaryStats; + decimalStats = other368.decimalStats; + dateStats = other368.dateStats; + timestampStats = other368.timestampStats; + __isset = other368.__isset; +} +ColumnStatisticsData& ColumnStatisticsData::operator=(const ColumnStatisticsData& other369) { + booleanStats = other369.booleanStats; + longStats = other369.longStats; + doubleStats = other369.doubleStats; + stringStats = other369.stringStats; + binaryStats = other369.binaryStats; + decimalStats = other369.decimalStats; + dateStats = other369.dateStats; + timestampStats = other369.timestampStats; + __isset = other369.__isset; + return *this; +} +void ColumnStatisticsData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ColumnStatisticsData("; + out << "booleanStats="; (__isset.booleanStats ? (out << to_string(booleanStats)) : (out << "")); + out << ", " << "longStats="; (__isset.longStats ? (out << to_string(longStats)) : (out << "")); + out << ", " << "doubleStats="; (__isset.doubleStats ? (out << to_string(doubleStats)) : (out << "")); + out << ", " << "stringStats="; (__isset.stringStats ? (out << to_string(stringStats)) : (out << "")); + out << ", " << "binaryStats="; (__isset.binaryStats ? (out << to_string(binaryStats)) : (out << "")); + out << ", " << "decimalStats="; (__isset.decimalStats ? (out << to_string(decimalStats)) : (out << "")); + out << ", " << "dateStats="; (__isset.dateStats ? (out << to_string(dateStats)) : (out << "")); + out << ", " << "timestampStats="; (__isset.timestampStats ? (out << to_string(timestampStats)) : (out << "")); + out << ")"; +} + + +ColumnStatisticsObj::~ColumnStatisticsObj() noexcept { +} + +ColumnStatisticsObj::ColumnStatisticsObj() noexcept + : colName(), + colType() { +} + +void ColumnStatisticsObj::__set_colName(const std::string& val) { + this->colName = val; +} + +void ColumnStatisticsObj::__set_colType(const std::string& val) { + this->colType = val; +} + +void ColumnStatisticsObj::__set_statsData(const ColumnStatisticsData& val) { + this->statsData = val; +} +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsObj& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ColumnStatisticsObj::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_colName = false; + bool isset_colType = false; + bool isset_statsData = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->colName); + isset_colName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->colType); + isset_colType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->statsData.read(iprot); + isset_statsData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_colName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_colType) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_statsData) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnStatisticsObj::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ColumnStatisticsObj"); + + xfer += oprot->writeFieldBegin("colName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->colName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("colType", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->colType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("statsData", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->statsData.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ColumnStatisticsObj &a, ColumnStatisticsObj &b) noexcept { + using ::std::swap; + swap(a.colName, b.colName); + swap(a.colType, b.colType); + swap(a.statsData, b.statsData); +} + +bool ColumnStatisticsObj::operator==(const ColumnStatisticsObj & rhs) const +{ + if (!(colName == rhs.colName)) + return false; + if (!(colType == rhs.colType)) + return false; + if (!(statsData == rhs.statsData)) + return false; + return true; +} + +ColumnStatisticsObj::ColumnStatisticsObj(const ColumnStatisticsObj& other370) { + colName = other370.colName; + colType = other370.colType; + statsData = other370.statsData; +} +ColumnStatisticsObj& ColumnStatisticsObj::operator=(const ColumnStatisticsObj& other371) { + colName = other371.colName; + colType = other371.colType; + statsData = other371.statsData; + return *this; +} +void ColumnStatisticsObj::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ColumnStatisticsObj("; + out << "colName=" << to_string(colName); + out << ", " << "colType=" << to_string(colType); + out << ", " << "statsData=" << to_string(statsData); + out << ")"; +} + + +ColumnStatisticsDesc::~ColumnStatisticsDesc() noexcept { +} + +ColumnStatisticsDesc::ColumnStatisticsDesc() noexcept + : isTblLevel(0), + dbName(), + tableName(), + partName(), + lastAnalyzed(0), + catName() { +} + +void ColumnStatisticsDesc::__set_isTblLevel(const bool val) { + this->isTblLevel = val; +} + +void ColumnStatisticsDesc::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void ColumnStatisticsDesc::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void ColumnStatisticsDesc::__set_partName(const std::string& val) { + this->partName = val; +__isset.partName = true; +} + +void ColumnStatisticsDesc::__set_lastAnalyzed(const int64_t val) { + this->lastAnalyzed = val; +__isset.lastAnalyzed = true; +} + +void ColumnStatisticsDesc::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsDesc& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ColumnStatisticsDesc::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_isTblLevel = false; + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isTblLevel); + isset_isTblLevel = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partName); + this->__isset.partName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastAnalyzed); + this->__isset.lastAnalyzed = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_isTblLevel) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnStatisticsDesc::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ColumnStatisticsDesc"); + + xfer += oprot->writeFieldBegin("isTblLevel", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->isTblLevel); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partName) { + xfer += oprot->writeFieldBegin("partName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->partName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.lastAnalyzed) { + xfer += oprot->writeFieldBegin("lastAnalyzed", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->lastAnalyzed); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ColumnStatisticsDesc &a, ColumnStatisticsDesc &b) noexcept { + using ::std::swap; + swap(a.isTblLevel, b.isTblLevel); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partName, b.partName); + swap(a.lastAnalyzed, b.lastAnalyzed); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool ColumnStatisticsDesc::operator==(const ColumnStatisticsDesc & rhs) const +{ + if (!(isTblLevel == rhs.isTblLevel)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.partName != rhs.__isset.partName) + return false; + else if (__isset.partName && !(partName == rhs.partName)) + return false; + if (__isset.lastAnalyzed != rhs.__isset.lastAnalyzed) + return false; + else if (__isset.lastAnalyzed && !(lastAnalyzed == rhs.lastAnalyzed)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +ColumnStatisticsDesc::ColumnStatisticsDesc(const ColumnStatisticsDesc& other372) { + isTblLevel = other372.isTblLevel; + dbName = other372.dbName; + tableName = other372.tableName; + partName = other372.partName; + lastAnalyzed = other372.lastAnalyzed; + catName = other372.catName; + __isset = other372.__isset; +} +ColumnStatisticsDesc& ColumnStatisticsDesc::operator=(const ColumnStatisticsDesc& other373) { + isTblLevel = other373.isTblLevel; + dbName = other373.dbName; + tableName = other373.tableName; + partName = other373.partName; + lastAnalyzed = other373.lastAnalyzed; + catName = other373.catName; + __isset = other373.__isset; + return *this; +} +void ColumnStatisticsDesc::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ColumnStatisticsDesc("; + out << "isTblLevel=" << to_string(isTblLevel); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "partName="; (__isset.partName ? (out << to_string(partName)) : (out << "")); + out << ", " << "lastAnalyzed="; (__isset.lastAnalyzed ? (out << to_string(lastAnalyzed)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +ColumnStatistics::~ColumnStatistics() noexcept { +} + +ColumnStatistics::ColumnStatistics() : isStatsCompliant(0), + engine("hive") { +} + +void ColumnStatistics::__set_statsDesc(const ColumnStatisticsDesc& val) { + this->statsDesc = val; +} + +void ColumnStatistics::__set_statsObj(const std::vector & val) { + this->statsObj = val; +} + +void ColumnStatistics::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} + +void ColumnStatistics::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} +std::ostream& operator<<(std::ostream& out, const ColumnStatistics& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ColumnStatistics::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_statsDesc = false; + bool isset_statsObj = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->statsDesc.read(iprot); + isset_statsDesc = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->statsObj.clear(); + uint32_t _size374; + ::apache::thrift::protocol::TType _etype377; + xfer += iprot->readListBegin(_etype377, _size374); + this->statsObj.resize(_size374); + uint32_t _i378; + for (_i378 = 0; _i378 < _size374; ++_i378) + { + xfer += this->statsObj[_i378].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_statsObj = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_statsDesc) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_statsObj) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnStatistics::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ColumnStatistics"); + + xfer += oprot->writeFieldBegin("statsDesc", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->statsDesc.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("statsObj", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->statsObj.size())); + std::vector ::const_iterator _iter379; + for (_iter379 = this->statsObj.begin(); _iter379 != this->statsObj.end(); ++_iter379) + { + xfer += (*_iter379).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ColumnStatistics &a, ColumnStatistics &b) noexcept { + using ::std::swap; + swap(a.statsDesc, b.statsDesc); + swap(a.statsObj, b.statsObj); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.engine, b.engine); + swap(a.__isset, b.__isset); +} + +bool ColumnStatistics::operator==(const ColumnStatistics & rhs) const +{ + if (!(statsDesc == rhs.statsDesc)) + return false; + if (!(statsObj == rhs.statsObj)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + return true; +} + +ColumnStatistics::ColumnStatistics(const ColumnStatistics& other380) { + statsDesc = other380.statsDesc; + statsObj = other380.statsObj; + isStatsCompliant = other380.isStatsCompliant; + engine = other380.engine; + __isset = other380.__isset; +} +ColumnStatistics& ColumnStatistics::operator=(const ColumnStatistics& other381) { + statsDesc = other381.statsDesc; + statsObj = other381.statsObj; + isStatsCompliant = other381.isStatsCompliant; + engine = other381.engine; + __isset = other381.__isset; + return *this; +} +void ColumnStatistics::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ColumnStatistics("; + out << "statsDesc=" << to_string(statsDesc); + out << ", " << "statsObj=" << to_string(statsObj); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ")"; +} + + +FileMetadata::~FileMetadata() noexcept { +} + +FileMetadata::FileMetadata() noexcept + : type(1), + version(1) { +} + +void FileMetadata::__set_type(const int8_t val) { + this->type = val; +} + +void FileMetadata::__set_version(const int8_t val) { + this->version = val; +} + +void FileMetadata::__set_data(const std::vector & val) { + this->data = val; +} +std::ostream& operator<<(std::ostream& out, const FileMetadata& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FileMetadata::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BYTE) { + xfer += iprot->readByte(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BYTE) { + xfer += iprot->readByte(this->version); + this->__isset.version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->data.clear(); + uint32_t _size382; + ::apache::thrift::protocol::TType _etype385; + xfer += iprot->readListBegin(_etype385, _size382); + this->data.resize(_size382); + uint32_t _i386; + for (_i386 = 0; _i386 < _size382; ++_i386) + { + xfer += iprot->readBinary(this->data[_i386]); + } + xfer += iprot->readListEnd(); + } + this->__isset.data = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FileMetadata::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FileMetadata"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_BYTE, 1); + xfer += oprot->writeByte(this->type); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_BYTE, 2); + xfer += oprot->writeByte(this->version); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->data.size())); + std::vector ::const_iterator _iter387; + for (_iter387 = this->data.begin(); _iter387 != this->data.end(); ++_iter387) + { + xfer += oprot->writeBinary((*_iter387)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FileMetadata &a, FileMetadata &b) noexcept { + using ::std::swap; + swap(a.type, b.type); + swap(a.version, b.version); + swap(a.data, b.data); + swap(a.__isset, b.__isset); +} + +bool FileMetadata::operator==(const FileMetadata & rhs) const +{ + if (!(type == rhs.type)) + return false; + if (!(version == rhs.version)) + return false; + if (!(data == rhs.data)) + return false; + return true; +} + +FileMetadata::FileMetadata(const FileMetadata& other388) { + type = other388.type; + version = other388.version; + data = other388.data; + __isset = other388.__isset; +} +FileMetadata& FileMetadata::operator=(const FileMetadata& other389) { + type = other389.type; + version = other389.version; + data = other389.data; + __isset = other389.__isset; + return *this; +} +void FileMetadata::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FileMetadata("; + out << "type=" << to_string(type); + out << ", " << "version=" << to_string(version); + out << ", " << "data=" << to_string(data); + out << ")"; +} + + +ObjectDictionary::~ObjectDictionary() noexcept { +} + +ObjectDictionary::ObjectDictionary() noexcept { +} + +void ObjectDictionary::__set_values(const std::map > & val) { + this->values = val; +} +std::ostream& operator<<(std::ostream& out, const ObjectDictionary& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ObjectDictionary::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_values = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->values.clear(); + uint32_t _size390; + ::apache::thrift::protocol::TType _ktype391; + ::apache::thrift::protocol::TType _vtype392; + xfer += iprot->readMapBegin(_ktype391, _vtype392, _size390); + uint32_t _i394; + for (_i394 = 0; _i394 < _size390; ++_i394) + { + std::string _key395; + xfer += iprot->readString(_key395); + std::vector & _val396 = this->values[_key395]; + { + _val396.clear(); + uint32_t _size397; + ::apache::thrift::protocol::TType _etype400; + xfer += iprot->readListBegin(_etype400, _size397); + _val396.resize(_size397); + uint32_t _i401; + for (_i401 = 0; _i401 < _size397; ++_i401) + { + xfer += iprot->readBinary(_val396[_i401]); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readMapEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ObjectDictionary::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ObjectDictionary"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast(this->values.size())); + std::map > ::const_iterator _iter402; + for (_iter402 = this->values.begin(); _iter402 != this->values.end(); ++_iter402) + { + xfer += oprot->writeString(_iter402->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(_iter402->second.size())); + std::vector ::const_iterator _iter403; + for (_iter403 = _iter402->second.begin(); _iter403 != _iter402->second.end(); ++_iter403) + { + xfer += oprot->writeBinary((*_iter403)); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ObjectDictionary &a, ObjectDictionary &b) noexcept { + using ::std::swap; + swap(a.values, b.values); +} + +bool ObjectDictionary::operator==(const ObjectDictionary & rhs) const +{ + if (!(values == rhs.values)) + return false; + return true; +} + +ObjectDictionary::ObjectDictionary(const ObjectDictionary& other404) { + values = other404.values; +} +ObjectDictionary& ObjectDictionary::operator=(const ObjectDictionary& other405) { + values = other405.values; + return *this; +} +void ObjectDictionary::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ObjectDictionary("; + out << "values=" << to_string(values); + out << ")"; +} + + +Table::~Table() noexcept { +} + +Table::Table() noexcept + : tableName(), + dbName(), + owner(), + createTime(0), + lastAccessTime(0), + retention(0), + viewOriginalText(), + viewExpandedText(), + tableType(), + temporary(false), + rewriteEnabled(0), + catName(), + ownerType(static_cast(1)), + writeId(-1LL), + isStatsCompliant(0), + accessType(0), + id(0), + txnId(0) { +} + +void Table::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void Table::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void Table::__set_owner(const std::string& val) { + this->owner = val; +} + +void Table::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void Table::__set_lastAccessTime(const int32_t val) { + this->lastAccessTime = val; +} + +void Table::__set_retention(const int32_t val) { + this->retention = val; +} + +void Table::__set_sd(const StorageDescriptor& val) { + this->sd = val; +} + +void Table::__set_partitionKeys(const std::vector & val) { + this->partitionKeys = val; +} + +void Table::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void Table::__set_viewOriginalText(const std::string& val) { + this->viewOriginalText = val; +} + +void Table::__set_viewExpandedText(const std::string& val) { + this->viewExpandedText = val; +} + +void Table::__set_tableType(const std::string& val) { + this->tableType = val; +} + +void Table::__set_privileges(const PrincipalPrivilegeSet& val) { + this->privileges = val; +__isset.privileges = true; +} + +void Table::__set_temporary(const bool val) { + this->temporary = val; +__isset.temporary = true; +} + +void Table::__set_rewriteEnabled(const bool val) { + this->rewriteEnabled = val; +__isset.rewriteEnabled = true; +} + +void Table::__set_creationMetadata(const CreationMetadata& val) { + this->creationMetadata = val; +__isset.creationMetadata = true; +} + +void Table::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void Table::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +__isset.ownerType = true; +} + +void Table::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void Table::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} + +void Table::__set_colStats(const ColumnStatistics& val) { + this->colStats = val; +__isset.colStats = true; +} + +void Table::__set_accessType(const int8_t val) { + this->accessType = val; +__isset.accessType = true; +} + +void Table::__set_requiredReadCapabilities(const std::vector & val) { + this->requiredReadCapabilities = val; +__isset.requiredReadCapabilities = true; +} + +void Table::__set_requiredWriteCapabilities(const std::vector & val) { + this->requiredWriteCapabilities = val; +__isset.requiredWriteCapabilities = true; +} + +void Table::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void Table::__set_fileMetadata(const FileMetadata& val) { + this->fileMetadata = val; +__isset.fileMetadata = true; +} + +void Table::__set_dictionary(const ObjectDictionary& val) { + this->dictionary = val; +__isset.dictionary = true; +} + +void Table::__set_txnId(const int64_t val) { + this->txnId = val; +__isset.txnId = true; +} +std::ostream& operator<<(std::ostream& out, const Table& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Table::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->owner); + this->__isset.owner = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->lastAccessTime); + this->__isset.lastAccessTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->retention); + this->__isset.retention = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sd.read(iprot); + this->__isset.sd = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionKeys.clear(); + uint32_t _size406; + ::apache::thrift::protocol::TType _etype409; + xfer += iprot->readListBegin(_etype409, _size406); + this->partitionKeys.resize(_size406); + uint32_t _i410; + for (_i410 = 0; _i410 < _size406; ++_i410) + { + xfer += this->partitionKeys[_i410].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size411; + ::apache::thrift::protocol::TType _ktype412; + ::apache::thrift::protocol::TType _vtype413; + xfer += iprot->readMapBegin(_ktype412, _vtype413, _size411); + uint32_t _i415; + for (_i415 = 0; _i415 < _size411; ++_i415) + { + std::string _key416; + xfer += iprot->readString(_key416); + std::string& _val417 = this->parameters[_key416]; + xfer += iprot->readString(_val417); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->viewOriginalText); + this->__isset.viewOriginalText = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->viewExpandedText); + this->__isset.viewExpandedText = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableType); + this->__isset.tableType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->temporary); + this->__isset.temporary = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->rewriteEnabled); + this->__isset.rewriteEnabled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 16: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->creationMetadata.read(iprot); + this->__isset.creationMetadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 17: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 18: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast418; + xfer += iprot->readI32(ecast418); + this->ownerType = static_cast(ecast418); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 19: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 20: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 21: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->colStats.read(iprot); + this->__isset.colStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 22: + if (ftype == ::apache::thrift::protocol::T_BYTE) { + xfer += iprot->readByte(this->accessType); + this->__isset.accessType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 23: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->requiredReadCapabilities.clear(); + uint32_t _size419; + ::apache::thrift::protocol::TType _etype422; + xfer += iprot->readListBegin(_etype422, _size419); + this->requiredReadCapabilities.resize(_size419); + uint32_t _i423; + for (_i423 = 0; _i423 < _size419; ++_i423) + { + xfer += iprot->readString(this->requiredReadCapabilities[_i423]); + } + xfer += iprot->readListEnd(); + } + this->__isset.requiredReadCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 24: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->requiredWriteCapabilities.clear(); + uint32_t _size424; + ::apache::thrift::protocol::TType _etype427; + xfer += iprot->readListBegin(_etype427, _size424); + this->requiredWriteCapabilities.resize(_size424); + uint32_t _i428; + for (_i428 = 0; _i428 < _size424; ++_i428) + { + xfer += iprot->readString(this->requiredWriteCapabilities[_i428]); + } + xfer += iprot->readListEnd(); + } + this->__isset.requiredWriteCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 25: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 26: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->fileMetadata.read(iprot); + this->__isset.fileMetadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 27: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dictionary.read(iprot); + this->__isset.dictionary = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 28: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Table::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Table"); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("owner", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->owner); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("lastAccessTime", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->lastAccessTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("retention", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(this->retention); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sd", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->sd.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partitionKeys", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionKeys.size())); + std::vector ::const_iterator _iter429; + for (_iter429 = this->partitionKeys.begin(); _iter429 != this->partitionKeys.end(); ++_iter429) + { + xfer += (*_iter429).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 9); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter430; + for (_iter430 = this->parameters.begin(); _iter430 != this->parameters.end(); ++_iter430) + { + xfer += oprot->writeString(_iter430->first); + xfer += oprot->writeString(_iter430->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("viewOriginalText", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->viewOriginalText); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("viewExpandedText", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->viewExpandedText); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableType", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->tableType); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.privileges) { + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 13); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.temporary) { + xfer += oprot->writeFieldBegin("temporary", ::apache::thrift::protocol::T_BOOL, 14); + xfer += oprot->writeBool(this->temporary); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.rewriteEnabled) { + xfer += oprot->writeFieldBegin("rewriteEnabled", ::apache::thrift::protocol::T_BOOL, 15); + xfer += oprot->writeBool(this->rewriteEnabled); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.creationMetadata) { + xfer += oprot->writeFieldBegin("creationMetadata", ::apache::thrift::protocol::T_STRUCT, 16); + xfer += this->creationMetadata.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 17); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerType) { + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 18); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 19); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 20); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.colStats) { + xfer += oprot->writeFieldBegin("colStats", ::apache::thrift::protocol::T_STRUCT, 21); + xfer += this->colStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.accessType) { + xfer += oprot->writeFieldBegin("accessType", ::apache::thrift::protocol::T_BYTE, 22); + xfer += oprot->writeByte(this->accessType); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.requiredReadCapabilities) { + xfer += oprot->writeFieldBegin("requiredReadCapabilities", ::apache::thrift::protocol::T_LIST, 23); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->requiredReadCapabilities.size())); + std::vector ::const_iterator _iter431; + for (_iter431 = this->requiredReadCapabilities.begin(); _iter431 != this->requiredReadCapabilities.end(); ++_iter431) + { + xfer += oprot->writeString((*_iter431)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.requiredWriteCapabilities) { + xfer += oprot->writeFieldBegin("requiredWriteCapabilities", ::apache::thrift::protocol::T_LIST, 24); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->requiredWriteCapabilities.size())); + std::vector ::const_iterator _iter432; + for (_iter432 = this->requiredWriteCapabilities.begin(); _iter432 != this->requiredWriteCapabilities.end(); ++_iter432) + { + xfer += oprot->writeString((*_iter432)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 25); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.fileMetadata) { + xfer += oprot->writeFieldBegin("fileMetadata", ::apache::thrift::protocol::T_STRUCT, 26); + xfer += this->fileMetadata.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dictionary) { + xfer += oprot->writeFieldBegin("dictionary", ::apache::thrift::protocol::T_STRUCT, 27); + xfer += this->dictionary.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnId) { + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 28); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Table &a, Table &b) noexcept { + using ::std::swap; + swap(a.tableName, b.tableName); + swap(a.dbName, b.dbName); + swap(a.owner, b.owner); + swap(a.createTime, b.createTime); + swap(a.lastAccessTime, b.lastAccessTime); + swap(a.retention, b.retention); + swap(a.sd, b.sd); + swap(a.partitionKeys, b.partitionKeys); + swap(a.parameters, b.parameters); + swap(a.viewOriginalText, b.viewOriginalText); + swap(a.viewExpandedText, b.viewExpandedText); + swap(a.tableType, b.tableType); + swap(a.privileges, b.privileges); + swap(a.temporary, b.temporary); + swap(a.rewriteEnabled, b.rewriteEnabled); + swap(a.creationMetadata, b.creationMetadata); + swap(a.catName, b.catName); + swap(a.ownerType, b.ownerType); + swap(a.writeId, b.writeId); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.colStats, b.colStats); + swap(a.accessType, b.accessType); + swap(a.requiredReadCapabilities, b.requiredReadCapabilities); + swap(a.requiredWriteCapabilities, b.requiredWriteCapabilities); + swap(a.id, b.id); + swap(a.fileMetadata, b.fileMetadata); + swap(a.dictionary, b.dictionary); + swap(a.txnId, b.txnId); + swap(a.__isset, b.__isset); +} + +bool Table::operator==(const Table & rhs) const +{ + if (!(tableName == rhs.tableName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(owner == rhs.owner)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(lastAccessTime == rhs.lastAccessTime)) + return false; + if (!(retention == rhs.retention)) + return false; + if (!(sd == rhs.sd)) + return false; + if (!(partitionKeys == rhs.partitionKeys)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (!(viewOriginalText == rhs.viewOriginalText)) + return false; + if (!(viewExpandedText == rhs.viewExpandedText)) + return false; + if (!(tableType == rhs.tableType)) + return false; + if (__isset.privileges != rhs.__isset.privileges) + return false; + else if (__isset.privileges && !(privileges == rhs.privileges)) + return false; + if (__isset.temporary != rhs.__isset.temporary) + return false; + else if (__isset.temporary && !(temporary == rhs.temporary)) + return false; + if (__isset.rewriteEnabled != rhs.__isset.rewriteEnabled) + return false; + else if (__isset.rewriteEnabled && !(rewriteEnabled == rhs.rewriteEnabled)) + return false; + if (__isset.creationMetadata != rhs.__isset.creationMetadata) + return false; + else if (__isset.creationMetadata && !(creationMetadata == rhs.creationMetadata)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.ownerType != rhs.__isset.ownerType) + return false; + else if (__isset.ownerType && !(ownerType == rhs.ownerType)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + if (__isset.colStats != rhs.__isset.colStats) + return false; + else if (__isset.colStats && !(colStats == rhs.colStats)) + return false; + if (__isset.accessType != rhs.__isset.accessType) + return false; + else if (__isset.accessType && !(accessType == rhs.accessType)) + return false; + if (__isset.requiredReadCapabilities != rhs.__isset.requiredReadCapabilities) + return false; + else if (__isset.requiredReadCapabilities && !(requiredReadCapabilities == rhs.requiredReadCapabilities)) + return false; + if (__isset.requiredWriteCapabilities != rhs.__isset.requiredWriteCapabilities) + return false; + else if (__isset.requiredWriteCapabilities && !(requiredWriteCapabilities == rhs.requiredWriteCapabilities)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.fileMetadata != rhs.__isset.fileMetadata) + return false; + else if (__isset.fileMetadata && !(fileMetadata == rhs.fileMetadata)) + return false; + if (__isset.dictionary != rhs.__isset.dictionary) + return false; + else if (__isset.dictionary && !(dictionary == rhs.dictionary)) + return false; + if (__isset.txnId != rhs.__isset.txnId) + return false; + else if (__isset.txnId && !(txnId == rhs.txnId)) + return false; + return true; +} + +Table::Table(const Table& other433) { + tableName = other433.tableName; + dbName = other433.dbName; + owner = other433.owner; + createTime = other433.createTime; + lastAccessTime = other433.lastAccessTime; + retention = other433.retention; + sd = other433.sd; + partitionKeys = other433.partitionKeys; + parameters = other433.parameters; + viewOriginalText = other433.viewOriginalText; + viewExpandedText = other433.viewExpandedText; + tableType = other433.tableType; + privileges = other433.privileges; + temporary = other433.temporary; + rewriteEnabled = other433.rewriteEnabled; + creationMetadata = other433.creationMetadata; + catName = other433.catName; + ownerType = other433.ownerType; + writeId = other433.writeId; + isStatsCompliant = other433.isStatsCompliant; + colStats = other433.colStats; + accessType = other433.accessType; + requiredReadCapabilities = other433.requiredReadCapabilities; + requiredWriteCapabilities = other433.requiredWriteCapabilities; + id = other433.id; + fileMetadata = other433.fileMetadata; + dictionary = other433.dictionary; + txnId = other433.txnId; + __isset = other433.__isset; +} +Table& Table::operator=(const Table& other434) { + tableName = other434.tableName; + dbName = other434.dbName; + owner = other434.owner; + createTime = other434.createTime; + lastAccessTime = other434.lastAccessTime; + retention = other434.retention; + sd = other434.sd; + partitionKeys = other434.partitionKeys; + parameters = other434.parameters; + viewOriginalText = other434.viewOriginalText; + viewExpandedText = other434.viewExpandedText; + tableType = other434.tableType; + privileges = other434.privileges; + temporary = other434.temporary; + rewriteEnabled = other434.rewriteEnabled; + creationMetadata = other434.creationMetadata; + catName = other434.catName; + ownerType = other434.ownerType; + writeId = other434.writeId; + isStatsCompliant = other434.isStatsCompliant; + colStats = other434.colStats; + accessType = other434.accessType; + requiredReadCapabilities = other434.requiredReadCapabilities; + requiredWriteCapabilities = other434.requiredWriteCapabilities; + id = other434.id; + fileMetadata = other434.fileMetadata; + dictionary = other434.dictionary; + txnId = other434.txnId; + __isset = other434.__isset; + return *this; +} +void Table::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Table("; + out << "tableName=" << to_string(tableName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "owner=" << to_string(owner); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "lastAccessTime=" << to_string(lastAccessTime); + out << ", " << "retention=" << to_string(retention); + out << ", " << "sd=" << to_string(sd); + out << ", " << "partitionKeys=" << to_string(partitionKeys); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "viewOriginalText=" << to_string(viewOriginalText); + out << ", " << "viewExpandedText=" << to_string(viewExpandedText); + out << ", " << "tableType=" << to_string(tableType); + out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); + out << ", " << "temporary="; (__isset.temporary ? (out << to_string(temporary)) : (out << "")); + out << ", " << "rewriteEnabled="; (__isset.rewriteEnabled ? (out << to_string(rewriteEnabled)) : (out << "")); + out << ", " << "creationMetadata="; (__isset.creationMetadata ? (out << to_string(creationMetadata)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ", " << "colStats="; (__isset.colStats ? (out << to_string(colStats)) : (out << "")); + out << ", " << "accessType="; (__isset.accessType ? (out << to_string(accessType)) : (out << "")); + out << ", " << "requiredReadCapabilities="; (__isset.requiredReadCapabilities ? (out << to_string(requiredReadCapabilities)) : (out << "")); + out << ", " << "requiredWriteCapabilities="; (__isset.requiredWriteCapabilities ? (out << to_string(requiredWriteCapabilities)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "fileMetadata="; (__isset.fileMetadata ? (out << to_string(fileMetadata)) : (out << "")); + out << ", " << "dictionary="; (__isset.dictionary ? (out << to_string(dictionary)) : (out << "")); + out << ", " << "txnId="; (__isset.txnId ? (out << to_string(txnId)) : (out << "")); + out << ")"; +} + + +SourceTable::~SourceTable() noexcept { +} + +SourceTable::SourceTable() noexcept + : insertedCount(0), + updatedCount(0), + deletedCount(0) { +} + +void SourceTable::__set_table(const Table& val) { + this->table = val; +} + +void SourceTable::__set_insertedCount(const int64_t val) { + this->insertedCount = val; +} + +void SourceTable::__set_updatedCount(const int64_t val) { + this->updatedCount = val; +} + +void SourceTable::__set_deletedCount(const int64_t val) { + this->deletedCount = val; +} +std::ostream& operator<<(std::ostream& out, const SourceTable& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SourceTable::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_table = false; + bool isset_insertedCount = false; + bool isset_updatedCount = false; + bool isset_deletedCount = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->table.read(iprot); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->insertedCount); + isset_insertedCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->updatedCount); + isset_updatedCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->deletedCount); + isset_deletedCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_insertedCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_updatedCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_deletedCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SourceTable::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SourceTable"); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->table.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("insertedCount", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->insertedCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("updatedCount", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->updatedCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deletedCount", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->deletedCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SourceTable &a, SourceTable &b) noexcept { + using ::std::swap; + swap(a.table, b.table); + swap(a.insertedCount, b.insertedCount); + swap(a.updatedCount, b.updatedCount); + swap(a.deletedCount, b.deletedCount); +} + +bool SourceTable::operator==(const SourceTable & rhs) const +{ + if (!(table == rhs.table)) + return false; + if (!(insertedCount == rhs.insertedCount)) + return false; + if (!(updatedCount == rhs.updatedCount)) + return false; + if (!(deletedCount == rhs.deletedCount)) + return false; + return true; +} + +SourceTable::SourceTable(const SourceTable& other435) { + table = other435.table; + insertedCount = other435.insertedCount; + updatedCount = other435.updatedCount; + deletedCount = other435.deletedCount; +} +SourceTable& SourceTable::operator=(const SourceTable& other436) { + table = other436.table; + insertedCount = other436.insertedCount; + updatedCount = other436.updatedCount; + deletedCount = other436.deletedCount; + return *this; +} +void SourceTable::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SourceTable("; + out << "table=" << to_string(table); + out << ", " << "insertedCount=" << to_string(insertedCount); + out << ", " << "updatedCount=" << to_string(updatedCount); + out << ", " << "deletedCount=" << to_string(deletedCount); + out << ")"; +} + + +Partition::~Partition() noexcept { +} + +Partition::Partition() noexcept + : dbName(), + tableName(), + createTime(0), + lastAccessTime(0), + catName(), + writeId(-1LL), + isStatsCompliant(0) { +} + +void Partition::__set_values(const std::vector & val) { + this->values = val; +} + +void Partition::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void Partition::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void Partition::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void Partition::__set_lastAccessTime(const int32_t val) { + this->lastAccessTime = val; +} + +void Partition::__set_sd(const StorageDescriptor& val) { + this->sd = val; +} + +void Partition::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void Partition::__set_privileges(const PrincipalPrivilegeSet& val) { + this->privileges = val; +__isset.privileges = true; +} + +void Partition::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void Partition::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void Partition::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} + +void Partition::__set_colStats(const ColumnStatistics& val) { + this->colStats = val; +__isset.colStats = true; +} + +void Partition::__set_fileMetadata(const FileMetadata& val) { + this->fileMetadata = val; +__isset.fileMetadata = true; +} +std::ostream& operator<<(std::ostream& out, const Partition& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Partition::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size437; + ::apache::thrift::protocol::TType _etype440; + xfer += iprot->readListBegin(_etype440, _size437); + this->values.resize(_size437); + uint32_t _i441; + for (_i441 = 0; _i441 < _size437; ++_i441) + { + xfer += iprot->readString(this->values[_i441]); + } + xfer += iprot->readListEnd(); + } + this->__isset.values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->lastAccessTime); + this->__isset.lastAccessTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sd.read(iprot); + this->__isset.sd = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size442; + ::apache::thrift::protocol::TType _ktype443; + ::apache::thrift::protocol::TType _vtype444; + xfer += iprot->readMapBegin(_ktype443, _vtype444, _size442); + uint32_t _i446; + for (_i446 = 0; _i446 < _size442; ++_i446) + { + std::string _key447; + xfer += iprot->readString(_key447); + std::string& _val448 = this->parameters[_key447]; + xfer += iprot->readString(_val448); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->colStats.read(iprot); + this->__isset.colStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->fileMetadata.read(iprot); + this->__isset.fileMetadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Partition::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Partition"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter449; + for (_iter449 = this->values.begin(); _iter449 != this->values.end(); ++_iter449) + { + xfer += oprot->writeString((*_iter449)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("lastAccessTime", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->lastAccessTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sd", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->sd.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 7); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter450; + for (_iter450 = this->parameters.begin(); _iter450 != this->parameters.end(); ++_iter450) + { + xfer += oprot->writeString(_iter450->first); + xfer += oprot->writeString(_iter450->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.privileges) { + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 8); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 10); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 11); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.colStats) { + xfer += oprot->writeFieldBegin("colStats", ::apache::thrift::protocol::T_STRUCT, 12); + xfer += this->colStats.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.fileMetadata) { + xfer += oprot->writeFieldBegin("fileMetadata", ::apache::thrift::protocol::T_STRUCT, 13); + xfer += this->fileMetadata.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Partition &a, Partition &b) noexcept { + using ::std::swap; + swap(a.values, b.values); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.createTime, b.createTime); + swap(a.lastAccessTime, b.lastAccessTime); + swap(a.sd, b.sd); + swap(a.parameters, b.parameters); + swap(a.privileges, b.privileges); + swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.colStats, b.colStats); + swap(a.fileMetadata, b.fileMetadata); + swap(a.__isset, b.__isset); +} + +bool Partition::operator==(const Partition & rhs) const +{ + if (!(values == rhs.values)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(lastAccessTime == rhs.lastAccessTime)) + return false; + if (!(sd == rhs.sd)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (__isset.privileges != rhs.__isset.privileges) + return false; + else if (__isset.privileges && !(privileges == rhs.privileges)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + if (__isset.colStats != rhs.__isset.colStats) + return false; + else if (__isset.colStats && !(colStats == rhs.colStats)) + return false; + if (__isset.fileMetadata != rhs.__isset.fileMetadata) + return false; + else if (__isset.fileMetadata && !(fileMetadata == rhs.fileMetadata)) + return false; + return true; +} + +Partition::Partition(const Partition& other451) { + values = other451.values; + dbName = other451.dbName; + tableName = other451.tableName; + createTime = other451.createTime; + lastAccessTime = other451.lastAccessTime; + sd = other451.sd; + parameters = other451.parameters; + privileges = other451.privileges; + catName = other451.catName; + writeId = other451.writeId; + isStatsCompliant = other451.isStatsCompliant; + colStats = other451.colStats; + fileMetadata = other451.fileMetadata; + __isset = other451.__isset; +} +Partition& Partition::operator=(const Partition& other452) { + values = other452.values; + dbName = other452.dbName; + tableName = other452.tableName; + createTime = other452.createTime; + lastAccessTime = other452.lastAccessTime; + sd = other452.sd; + parameters = other452.parameters; + privileges = other452.privileges; + catName = other452.catName; + writeId = other452.writeId; + isStatsCompliant = other452.isStatsCompliant; + colStats = other452.colStats; + fileMetadata = other452.fileMetadata; + __isset = other452.__isset; + return *this; +} +void Partition::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Partition("; + out << "values=" << to_string(values); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "lastAccessTime=" << to_string(lastAccessTime); + out << ", " << "sd=" << to_string(sd); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ", " << "colStats="; (__isset.colStats ? (out << to_string(colStats)) : (out << "")); + out << ", " << "fileMetadata="; (__isset.fileMetadata ? (out << to_string(fileMetadata)) : (out << "")); + out << ")"; +} + + +PartitionWithoutSD::~PartitionWithoutSD() noexcept { +} + +PartitionWithoutSD::PartitionWithoutSD() noexcept + : createTime(0), + lastAccessTime(0), + relativePath() { +} + +void PartitionWithoutSD::__set_values(const std::vector & val) { + this->values = val; +} + +void PartitionWithoutSD::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void PartitionWithoutSD::__set_lastAccessTime(const int32_t val) { + this->lastAccessTime = val; +} + +void PartitionWithoutSD::__set_relativePath(const std::string& val) { + this->relativePath = val; +} + +void PartitionWithoutSD::__set_parameters(const std::map & val) { + this->parameters = val; +} + +void PartitionWithoutSD::__set_privileges(const PrincipalPrivilegeSet& val) { + this->privileges = val; +__isset.privileges = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionWithoutSD& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionWithoutSD::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size453; + ::apache::thrift::protocol::TType _etype456; + xfer += iprot->readListBegin(_etype456, _size453); + this->values.resize(_size453); + uint32_t _i457; + for (_i457 = 0; _i457 < _size453; ++_i457) + { + xfer += iprot->readString(this->values[_i457]); + } + xfer += iprot->readListEnd(); + } + this->__isset.values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->lastAccessTime); + this->__isset.lastAccessTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->relativePath); + this->__isset.relativePath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size458; + ::apache::thrift::protocol::TType _ktype459; + ::apache::thrift::protocol::TType _vtype460; + xfer += iprot->readMapBegin(_ktype459, _vtype460, _size458); + uint32_t _i462; + for (_i462 = 0; _i462 < _size458; ++_i462) + { + std::string _key463; + xfer += iprot->readString(_key463); + std::string& _val464 = this->parameters[_key463]; + xfer += iprot->readString(_val464); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PartitionWithoutSD::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionWithoutSD"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter465; + for (_iter465 = this->values.begin(); _iter465 != this->values.end(); ++_iter465) + { + xfer += oprot->writeString((*_iter465)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("lastAccessTime", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->lastAccessTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("relativePath", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->relativePath); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 5); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter466; + for (_iter466 = this->parameters.begin(); _iter466 != this->parameters.end(); ++_iter466) + { + xfer += oprot->writeString(_iter466->first); + xfer += oprot->writeString(_iter466->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.privileges) { + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionWithoutSD &a, PartitionWithoutSD &b) noexcept { + using ::std::swap; + swap(a.values, b.values); + swap(a.createTime, b.createTime); + swap(a.lastAccessTime, b.lastAccessTime); + swap(a.relativePath, b.relativePath); + swap(a.parameters, b.parameters); + swap(a.privileges, b.privileges); + swap(a.__isset, b.__isset); +} + +bool PartitionWithoutSD::operator==(const PartitionWithoutSD & rhs) const +{ + if (!(values == rhs.values)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(lastAccessTime == rhs.lastAccessTime)) + return false; + if (!(relativePath == rhs.relativePath)) + return false; + if (!(parameters == rhs.parameters)) + return false; + if (__isset.privileges != rhs.__isset.privileges) + return false; + else if (__isset.privileges && !(privileges == rhs.privileges)) + return false; + return true; +} + +PartitionWithoutSD::PartitionWithoutSD(const PartitionWithoutSD& other467) { + values = other467.values; + createTime = other467.createTime; + lastAccessTime = other467.lastAccessTime; + relativePath = other467.relativePath; + parameters = other467.parameters; + privileges = other467.privileges; + __isset = other467.__isset; +} +PartitionWithoutSD& PartitionWithoutSD::operator=(const PartitionWithoutSD& other468) { + values = other468.values; + createTime = other468.createTime; + lastAccessTime = other468.lastAccessTime; + relativePath = other468.relativePath; + parameters = other468.parameters; + privileges = other468.privileges; + __isset = other468.__isset; + return *this; +} +void PartitionWithoutSD::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionWithoutSD("; + out << "values=" << to_string(values); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "lastAccessTime=" << to_string(lastAccessTime); + out << ", " << "relativePath=" << to_string(relativePath); + out << ", " << "parameters=" << to_string(parameters); + out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); + out << ")"; +} + + +PartitionSpecWithSharedSD::~PartitionSpecWithSharedSD() noexcept { +} + +PartitionSpecWithSharedSD::PartitionSpecWithSharedSD() noexcept { +} + +void PartitionSpecWithSharedSD::__set_partitions(const std::vector & val) { + this->partitions = val; +} + +void PartitionSpecWithSharedSD::__set_sd(const StorageDescriptor& val) { + this->sd = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionSpecWithSharedSD& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionSpecWithSharedSD::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size469; + ::apache::thrift::protocol::TType _etype472; + xfer += iprot->readListBegin(_etype472, _size469); + this->partitions.resize(_size469); + uint32_t _i473; + for (_i473 = 0; _i473 < _size469; ++_i473) + { + xfer += this->partitions[_i473].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sd.read(iprot); + this->__isset.sd = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PartitionSpecWithSharedSD::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionSpecWithSharedSD"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter474; + for (_iter474 = this->partitions.begin(); _iter474 != this->partitions.end(); ++_iter474) + { + xfer += (*_iter474).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sd", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sd.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionSpecWithSharedSD &a, PartitionSpecWithSharedSD &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.sd, b.sd); + swap(a.__isset, b.__isset); +} + +bool PartitionSpecWithSharedSD::operator==(const PartitionSpecWithSharedSD & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + if (!(sd == rhs.sd)) + return false; + return true; +} + +PartitionSpecWithSharedSD::PartitionSpecWithSharedSD(const PartitionSpecWithSharedSD& other475) { + partitions = other475.partitions; + sd = other475.sd; + __isset = other475.__isset; +} +PartitionSpecWithSharedSD& PartitionSpecWithSharedSD::operator=(const PartitionSpecWithSharedSD& other476) { + partitions = other476.partitions; + sd = other476.sd; + __isset = other476.__isset; + return *this; +} +void PartitionSpecWithSharedSD::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionSpecWithSharedSD("; + out << "partitions=" << to_string(partitions); + out << ", " << "sd=" << to_string(sd); + out << ")"; +} + + +PartitionListComposingSpec::~PartitionListComposingSpec() noexcept { +} + +PartitionListComposingSpec::PartitionListComposingSpec() noexcept { +} + +void PartitionListComposingSpec::__set_partitions(const std::vector & val) { + this->partitions = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionListComposingSpec& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionListComposingSpec::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size477; + ::apache::thrift::protocol::TType _etype480; + xfer += iprot->readListBegin(_etype480, _size477); + this->partitions.resize(_size477); + uint32_t _i481; + for (_i481 = 0; _i481 < _size477; ++_i481) + { + xfer += this->partitions[_i481].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PartitionListComposingSpec::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionListComposingSpec"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter482; + for (_iter482 = this->partitions.begin(); _iter482 != this->partitions.end(); ++_iter482) + { + xfer += (*_iter482).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionListComposingSpec &a, PartitionListComposingSpec &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.__isset, b.__isset); +} + +bool PartitionListComposingSpec::operator==(const PartitionListComposingSpec & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + return true; +} + +PartitionListComposingSpec::PartitionListComposingSpec(const PartitionListComposingSpec& other483) { + partitions = other483.partitions; + __isset = other483.__isset; +} +PartitionListComposingSpec& PartitionListComposingSpec::operator=(const PartitionListComposingSpec& other484) { + partitions = other484.partitions; + __isset = other484.__isset; + return *this; +} +void PartitionListComposingSpec::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionListComposingSpec("; + out << "partitions=" << to_string(partitions); + out << ")"; +} + + +PartitionSpec::~PartitionSpec() noexcept { +} + +PartitionSpec::PartitionSpec() noexcept + : dbName(), + tableName(), + rootPath(), + catName(), + writeId(-1LL), + isStatsCompliant(0) { +} + +void PartitionSpec::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void PartitionSpec::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void PartitionSpec::__set_rootPath(const std::string& val) { + this->rootPath = val; +} + +void PartitionSpec::__set_sharedSDPartitionSpec(const PartitionSpecWithSharedSD& val) { + this->sharedSDPartitionSpec = val; +__isset.sharedSDPartitionSpec = true; +} + +void PartitionSpec::__set_partitionList(const PartitionListComposingSpec& val) { + this->partitionList = val; +__isset.partitionList = true; +} + +void PartitionSpec::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PartitionSpec::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void PartitionSpec::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionSpec& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionSpec::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->rootPath); + this->__isset.rootPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sharedSDPartitionSpec.read(iprot); + this->__isset.sharedSDPartitionSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->partitionList.read(iprot); + this->__isset.partitionList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PartitionSpec::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionSpec"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rootPath", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->rootPath); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.sharedSDPartitionSpec) { + xfer += oprot->writeFieldBegin("sharedSDPartitionSpec", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->sharedSDPartitionSpec.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionList) { + xfer += oprot->writeFieldBegin("partitionList", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->partitionList.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionSpec &a, PartitionSpec &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.rootPath, b.rootPath); + swap(a.sharedSDPartitionSpec, b.sharedSDPartitionSpec); + swap(a.partitionList, b.partitionList); + swap(a.catName, b.catName); + swap(a.writeId, b.writeId); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.__isset, b.__isset); +} + +bool PartitionSpec::operator==(const PartitionSpec & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(rootPath == rhs.rootPath)) + return false; + if (__isset.sharedSDPartitionSpec != rhs.__isset.sharedSDPartitionSpec) + return false; + else if (__isset.sharedSDPartitionSpec && !(sharedSDPartitionSpec == rhs.sharedSDPartitionSpec)) + return false; + if (__isset.partitionList != rhs.__isset.partitionList) + return false; + else if (__isset.partitionList && !(partitionList == rhs.partitionList)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + return true; +} + +PartitionSpec::PartitionSpec(const PartitionSpec& other485) { + dbName = other485.dbName; + tableName = other485.tableName; + rootPath = other485.rootPath; + sharedSDPartitionSpec = other485.sharedSDPartitionSpec; + partitionList = other485.partitionList; + catName = other485.catName; + writeId = other485.writeId; + isStatsCompliant = other485.isStatsCompliant; + __isset = other485.__isset; +} +PartitionSpec& PartitionSpec::operator=(const PartitionSpec& other486) { + dbName = other486.dbName; + tableName = other486.tableName; + rootPath = other486.rootPath; + sharedSDPartitionSpec = other486.sharedSDPartitionSpec; + partitionList = other486.partitionList; + catName = other486.catName; + writeId = other486.writeId; + isStatsCompliant = other486.isStatsCompliant; + __isset = other486.__isset; + return *this; +} +void PartitionSpec::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionSpec("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "rootPath=" << to_string(rootPath); + out << ", " << "sharedSDPartitionSpec="; (__isset.sharedSDPartitionSpec ? (out << to_string(sharedSDPartitionSpec)) : (out << "")); + out << ", " << "partitionList="; (__isset.partitionList ? (out << to_string(partitionList)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ")"; +} + + +AggrStats::~AggrStats() noexcept { +} + +AggrStats::AggrStats() noexcept + : partsFound(0), + isStatsCompliant(0) { +} + +void AggrStats::__set_colStats(const std::vector & val) { + this->colStats = val; +} + +void AggrStats::__set_partsFound(const int64_t val) { + this->partsFound = val; +} + +void AggrStats::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} +std::ostream& operator<<(std::ostream& out, const AggrStats& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AggrStats::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_colStats = false; + bool isset_partsFound = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->colStats.clear(); + uint32_t _size487; + ::apache::thrift::protocol::TType _etype490; + xfer += iprot->readListBegin(_etype490, _size487); + this->colStats.resize(_size487); + uint32_t _i491; + for (_i491 = 0; _i491 < _size487; ++_i491) + { + xfer += this->colStats[_i491].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_colStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->partsFound); + isset_partsFound = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_colStats) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partsFound) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AggrStats::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AggrStats"); + + xfer += oprot->writeFieldBegin("colStats", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colStats.size())); + std::vector ::const_iterator _iter492; + for (_iter492 = this->colStats.begin(); _iter492 != this->colStats.end(); ++_iter492) + { + xfer += (*_iter492).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partsFound", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->partsFound); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AggrStats &a, AggrStats &b) noexcept { + using ::std::swap; + swap(a.colStats, b.colStats); + swap(a.partsFound, b.partsFound); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.__isset, b.__isset); +} + +bool AggrStats::operator==(const AggrStats & rhs) const +{ + if (!(colStats == rhs.colStats)) + return false; + if (!(partsFound == rhs.partsFound)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + return true; +} + +AggrStats::AggrStats(const AggrStats& other493) { + colStats = other493.colStats; + partsFound = other493.partsFound; + isStatsCompliant = other493.isStatsCompliant; + __isset = other493.__isset; +} +AggrStats& AggrStats::operator=(const AggrStats& other494) { + colStats = other494.colStats; + partsFound = other494.partsFound; + isStatsCompliant = other494.isStatsCompliant; + __isset = other494.__isset; + return *this; +} +void AggrStats::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AggrStats("; + out << "colStats=" << to_string(colStats); + out << ", " << "partsFound=" << to_string(partsFound); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ")"; +} + + +SetPartitionsStatsRequest::~SetPartitionsStatsRequest() noexcept { +} + +SetPartitionsStatsRequest::SetPartitionsStatsRequest() : needMerge(0), + writeId(-1LL), + validWriteIdList(), + engine("hive") { +} + +void SetPartitionsStatsRequest::__set_colStats(const std::vector & val) { + this->colStats = val; +} + +void SetPartitionsStatsRequest::__set_needMerge(const bool val) { + this->needMerge = val; +__isset.needMerge = true; +} + +void SetPartitionsStatsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void SetPartitionsStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void SetPartitionsStatsRequest::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} +std::ostream& operator<<(std::ostream& out, const SetPartitionsStatsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SetPartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_colStats = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->colStats.clear(); + uint32_t _size495; + ::apache::thrift::protocol::TType _etype498; + xfer += iprot->readListBegin(_etype498, _size495); + this->colStats.resize(_size495); + uint32_t _i499; + for (_i499 = 0; _i499 < _size495; ++_i499) + { + xfer += this->colStats[_i499].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_colStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->needMerge); + this->__isset.needMerge = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_colStats) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SetPartitionsStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SetPartitionsStatsRequest"); + + xfer += oprot->writeFieldBegin("colStats", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colStats.size())); + std::vector ::const_iterator _iter500; + for (_iter500 = this->colStats.begin(); _iter500 != this->colStats.end(); ++_iter500) + { + xfer += (*_iter500).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.needMerge) { + xfer += oprot->writeFieldBegin("needMerge", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->needMerge); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SetPartitionsStatsRequest &a, SetPartitionsStatsRequest &b) noexcept { + using ::std::swap; + swap(a.colStats, b.colStats); + swap(a.needMerge, b.needMerge); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.engine, b.engine); + swap(a.__isset, b.__isset); +} + +bool SetPartitionsStatsRequest::operator==(const SetPartitionsStatsRequest & rhs) const +{ + if (!(colStats == rhs.colStats)) + return false; + if (__isset.needMerge != rhs.__isset.needMerge) + return false; + else if (__isset.needMerge && !(needMerge == rhs.needMerge)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + return true; +} + +SetPartitionsStatsRequest::SetPartitionsStatsRequest(const SetPartitionsStatsRequest& other501) { + colStats = other501.colStats; + needMerge = other501.needMerge; + writeId = other501.writeId; + validWriteIdList = other501.validWriteIdList; + engine = other501.engine; + __isset = other501.__isset; +} +SetPartitionsStatsRequest& SetPartitionsStatsRequest::operator=(const SetPartitionsStatsRequest& other502) { + colStats = other502.colStats; + needMerge = other502.needMerge; + writeId = other502.writeId; + validWriteIdList = other502.validWriteIdList; + engine = other502.engine; + __isset = other502.__isset; + return *this; +} +void SetPartitionsStatsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SetPartitionsStatsRequest("; + out << "colStats=" << to_string(colStats); + out << ", " << "needMerge="; (__isset.needMerge ? (out << to_string(needMerge)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ")"; +} + + +SetPartitionsStatsResponse::~SetPartitionsStatsResponse() noexcept { +} + +SetPartitionsStatsResponse::SetPartitionsStatsResponse() noexcept + : result(0) { +} + +void SetPartitionsStatsResponse::__set_result(const bool val) { + this->result = val; +} +std::ostream& operator<<(std::ostream& out, const SetPartitionsStatsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SetPartitionsStatsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_result = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->result); + isset_result = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_result) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SetPartitionsStatsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SetPartitionsStatsResponse"); + + xfer += oprot->writeFieldBegin("result", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->result); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SetPartitionsStatsResponse &a, SetPartitionsStatsResponse &b) noexcept { + using ::std::swap; + swap(a.result, b.result); +} + +bool SetPartitionsStatsResponse::operator==(const SetPartitionsStatsResponse & rhs) const +{ + if (!(result == rhs.result)) + return false; + return true; +} + +SetPartitionsStatsResponse::SetPartitionsStatsResponse(const SetPartitionsStatsResponse& other503) noexcept { + result = other503.result; +} +SetPartitionsStatsResponse& SetPartitionsStatsResponse::operator=(const SetPartitionsStatsResponse& other504) noexcept { + result = other504.result; + return *this; +} +void SetPartitionsStatsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SetPartitionsStatsResponse("; + out << "result=" << to_string(result); + out << ")"; +} + + +Schema::~Schema() noexcept { +} + +Schema::Schema() noexcept { +} + +void Schema::__set_fieldSchemas(const std::vector & val) { + this->fieldSchemas = val; +} + +void Schema::__set_properties(const std::map & val) { + this->properties = val; +} +std::ostream& operator<<(std::ostream& out, const Schema& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Schema::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fieldSchemas.clear(); + uint32_t _size505; + ::apache::thrift::protocol::TType _etype508; + xfer += iprot->readListBegin(_etype508, _size505); + this->fieldSchemas.resize(_size505); + uint32_t _i509; + for (_i509 = 0; _i509 < _size505; ++_i509) + { + xfer += this->fieldSchemas[_i509].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.fieldSchemas = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->properties.clear(); + uint32_t _size510; + ::apache::thrift::protocol::TType _ktype511; + ::apache::thrift::protocol::TType _vtype512; + xfer += iprot->readMapBegin(_ktype511, _vtype512, _size510); + uint32_t _i514; + for (_i514 = 0; _i514 < _size510; ++_i514) + { + std::string _key515; + xfer += iprot->readString(_key515); + std::string& _val516 = this->properties[_key515]; + xfer += iprot->readString(_val516); + } + xfer += iprot->readMapEnd(); + } + this->__isset.properties = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Schema::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Schema"); + + xfer += oprot->writeFieldBegin("fieldSchemas", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->fieldSchemas.size())); + std::vector ::const_iterator _iter517; + for (_iter517 = this->fieldSchemas.begin(); _iter517 != this->fieldSchemas.end(); ++_iter517) + { + xfer += (*_iter517).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("properties", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->properties.size())); + std::map ::const_iterator _iter518; + for (_iter518 = this->properties.begin(); _iter518 != this->properties.end(); ++_iter518) + { + xfer += oprot->writeString(_iter518->first); + xfer += oprot->writeString(_iter518->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Schema &a, Schema &b) noexcept { + using ::std::swap; + swap(a.fieldSchemas, b.fieldSchemas); + swap(a.properties, b.properties); + swap(a.__isset, b.__isset); +} + +bool Schema::operator==(const Schema & rhs) const +{ + if (!(fieldSchemas == rhs.fieldSchemas)) + return false; + if (!(properties == rhs.properties)) + return false; + return true; +} + +Schema::Schema(const Schema& other519) { + fieldSchemas = other519.fieldSchemas; + properties = other519.properties; + __isset = other519.__isset; +} +Schema& Schema::operator=(const Schema& other520) { + fieldSchemas = other520.fieldSchemas; + properties = other520.properties; + __isset = other520.__isset; + return *this; +} +void Schema::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Schema("; + out << "fieldSchemas=" << to_string(fieldSchemas); + out << ", " << "properties=" << to_string(properties); + out << ")"; +} + + +PrimaryKeysRequest::~PrimaryKeysRequest() noexcept { +} + +PrimaryKeysRequest::PrimaryKeysRequest() noexcept + : db_name(), + tbl_name(), + catName(), + validWriteIdList(), + tableId(-1LL) { +} + +void PrimaryKeysRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void PrimaryKeysRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void PrimaryKeysRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PrimaryKeysRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void PrimaryKeysRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const PrimaryKeysRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PrimaryKeysRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PrimaryKeysRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PrimaryKeysRequest"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PrimaryKeysRequest &a, PrimaryKeysRequest &b) noexcept { + using ::std::swap; + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool PrimaryKeysRequest::operator==(const PrimaryKeysRequest & rhs) const +{ + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +PrimaryKeysRequest::PrimaryKeysRequest(const PrimaryKeysRequest& other521) { + db_name = other521.db_name; + tbl_name = other521.tbl_name; + catName = other521.catName; + validWriteIdList = other521.validWriteIdList; + tableId = other521.tableId; + __isset = other521.__isset; +} +PrimaryKeysRequest& PrimaryKeysRequest::operator=(const PrimaryKeysRequest& other522) { + db_name = other522.db_name; + tbl_name = other522.tbl_name; + catName = other522.catName; + validWriteIdList = other522.validWriteIdList; + tableId = other522.tableId; + __isset = other522.__isset; + return *this; +} +void PrimaryKeysRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PrimaryKeysRequest("; + out << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +PrimaryKeysResponse::~PrimaryKeysResponse() noexcept { +} + +PrimaryKeysResponse::PrimaryKeysResponse() noexcept { +} + +void PrimaryKeysResponse::__set_primaryKeys(const std::vector & val) { + this->primaryKeys = val; +} +std::ostream& operator<<(std::ostream& out, const PrimaryKeysResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PrimaryKeysResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_primaryKeys = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->primaryKeys.clear(); + uint32_t _size523; + ::apache::thrift::protocol::TType _etype526; + xfer += iprot->readListBegin(_etype526, _size523); + this->primaryKeys.resize(_size523); + uint32_t _i527; + for (_i527 = 0; _i527 < _size523; ++_i527) + { + xfer += this->primaryKeys[_i527].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_primaryKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_primaryKeys) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PrimaryKeysResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PrimaryKeysResponse"); + + xfer += oprot->writeFieldBegin("primaryKeys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->primaryKeys.size())); + std::vector ::const_iterator _iter528; + for (_iter528 = this->primaryKeys.begin(); _iter528 != this->primaryKeys.end(); ++_iter528) + { + xfer += (*_iter528).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PrimaryKeysResponse &a, PrimaryKeysResponse &b) noexcept { + using ::std::swap; + swap(a.primaryKeys, b.primaryKeys); +} + +bool PrimaryKeysResponse::operator==(const PrimaryKeysResponse & rhs) const +{ + if (!(primaryKeys == rhs.primaryKeys)) + return false; + return true; +} + +PrimaryKeysResponse::PrimaryKeysResponse(const PrimaryKeysResponse& other529) { + primaryKeys = other529.primaryKeys; +} +PrimaryKeysResponse& PrimaryKeysResponse::operator=(const PrimaryKeysResponse& other530) { + primaryKeys = other530.primaryKeys; + return *this; +} +void PrimaryKeysResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PrimaryKeysResponse("; + out << "primaryKeys=" << to_string(primaryKeys); + out << ")"; +} + + +ForeignKeysRequest::~ForeignKeysRequest() noexcept { +} + +ForeignKeysRequest::ForeignKeysRequest() noexcept + : parent_db_name(), + parent_tbl_name(), + foreign_db_name(), + foreign_tbl_name(), + catName(), + validWriteIdList(), + tableId(-1LL) { +} + +void ForeignKeysRequest::__set_parent_db_name(const std::string& val) { + this->parent_db_name = val; +} + +void ForeignKeysRequest::__set_parent_tbl_name(const std::string& val) { + this->parent_tbl_name = val; +} + +void ForeignKeysRequest::__set_foreign_db_name(const std::string& val) { + this->foreign_db_name = val; +} + +void ForeignKeysRequest::__set_foreign_tbl_name(const std::string& val) { + this->foreign_tbl_name = val; +} + +void ForeignKeysRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void ForeignKeysRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void ForeignKeysRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const ForeignKeysRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ForeignKeysRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parent_db_name); + this->__isset.parent_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parent_tbl_name); + this->__isset.parent_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->foreign_db_name); + this->__isset.foreign_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->foreign_tbl_name); + this->__isset.foreign_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ForeignKeysRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ForeignKeysRequest"); + + xfer += oprot->writeFieldBegin("parent_db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->parent_db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parent_tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->parent_tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("foreign_db_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->foreign_db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("foreign_tbl_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->foreign_tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ForeignKeysRequest &a, ForeignKeysRequest &b) noexcept { + using ::std::swap; + swap(a.parent_db_name, b.parent_db_name); + swap(a.parent_tbl_name, b.parent_tbl_name); + swap(a.foreign_db_name, b.foreign_db_name); + swap(a.foreign_tbl_name, b.foreign_tbl_name); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool ForeignKeysRequest::operator==(const ForeignKeysRequest & rhs) const +{ + if (!(parent_db_name == rhs.parent_db_name)) + return false; + if (!(parent_tbl_name == rhs.parent_tbl_name)) + return false; + if (!(foreign_db_name == rhs.foreign_db_name)) + return false; + if (!(foreign_tbl_name == rhs.foreign_tbl_name)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +ForeignKeysRequest::ForeignKeysRequest(const ForeignKeysRequest& other531) { + parent_db_name = other531.parent_db_name; + parent_tbl_name = other531.parent_tbl_name; + foreign_db_name = other531.foreign_db_name; + foreign_tbl_name = other531.foreign_tbl_name; + catName = other531.catName; + validWriteIdList = other531.validWriteIdList; + tableId = other531.tableId; + __isset = other531.__isset; +} +ForeignKeysRequest& ForeignKeysRequest::operator=(const ForeignKeysRequest& other532) { + parent_db_name = other532.parent_db_name; + parent_tbl_name = other532.parent_tbl_name; + foreign_db_name = other532.foreign_db_name; + foreign_tbl_name = other532.foreign_tbl_name; + catName = other532.catName; + validWriteIdList = other532.validWriteIdList; + tableId = other532.tableId; + __isset = other532.__isset; + return *this; +} +void ForeignKeysRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ForeignKeysRequest("; + out << "parent_db_name=" << to_string(parent_db_name); + out << ", " << "parent_tbl_name=" << to_string(parent_tbl_name); + out << ", " << "foreign_db_name=" << to_string(foreign_db_name); + out << ", " << "foreign_tbl_name=" << to_string(foreign_tbl_name); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +ForeignKeysResponse::~ForeignKeysResponse() noexcept { +} + +ForeignKeysResponse::ForeignKeysResponse() noexcept { +} + +void ForeignKeysResponse::__set_foreignKeys(const std::vector & val) { + this->foreignKeys = val; +} +std::ostream& operator<<(std::ostream& out, const ForeignKeysResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ForeignKeysResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_foreignKeys = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->foreignKeys.clear(); + uint32_t _size533; + ::apache::thrift::protocol::TType _etype536; + xfer += iprot->readListBegin(_etype536, _size533); + this->foreignKeys.resize(_size533); + uint32_t _i537; + for (_i537 = 0; _i537 < _size533; ++_i537) + { + xfer += this->foreignKeys[_i537].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_foreignKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_foreignKeys) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ForeignKeysResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ForeignKeysResponse"); + + xfer += oprot->writeFieldBegin("foreignKeys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->foreignKeys.size())); + std::vector ::const_iterator _iter538; + for (_iter538 = this->foreignKeys.begin(); _iter538 != this->foreignKeys.end(); ++_iter538) + { + xfer += (*_iter538).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ForeignKeysResponse &a, ForeignKeysResponse &b) noexcept { + using ::std::swap; + swap(a.foreignKeys, b.foreignKeys); +} + +bool ForeignKeysResponse::operator==(const ForeignKeysResponse & rhs) const +{ + if (!(foreignKeys == rhs.foreignKeys)) + return false; + return true; +} + +ForeignKeysResponse::ForeignKeysResponse(const ForeignKeysResponse& other539) { + foreignKeys = other539.foreignKeys; +} +ForeignKeysResponse& ForeignKeysResponse::operator=(const ForeignKeysResponse& other540) { + foreignKeys = other540.foreignKeys; + return *this; +} +void ForeignKeysResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ForeignKeysResponse("; + out << "foreignKeys=" << to_string(foreignKeys); + out << ")"; +} + + +UniqueConstraintsRequest::~UniqueConstraintsRequest() noexcept { +} + +UniqueConstraintsRequest::UniqueConstraintsRequest() noexcept + : catName(), + db_name(), + tbl_name(), + validWriteIdList(), + tableId(-1LL) { +} + +void UniqueConstraintsRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void UniqueConstraintsRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void UniqueConstraintsRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void UniqueConstraintsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void UniqueConstraintsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const UniqueConstraintsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UniqueConstraintsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t UniqueConstraintsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UniqueConstraintsRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UniqueConstraintsRequest &a, UniqueConstraintsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool UniqueConstraintsRequest::operator==(const UniqueConstraintsRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +UniqueConstraintsRequest::UniqueConstraintsRequest(const UniqueConstraintsRequest& other541) { + catName = other541.catName; + db_name = other541.db_name; + tbl_name = other541.tbl_name; + validWriteIdList = other541.validWriteIdList; + tableId = other541.tableId; + __isset = other541.__isset; +} +UniqueConstraintsRequest& UniqueConstraintsRequest::operator=(const UniqueConstraintsRequest& other542) { + catName = other542.catName; + db_name = other542.db_name; + tbl_name = other542.tbl_name; + validWriteIdList = other542.validWriteIdList; + tableId = other542.tableId; + __isset = other542.__isset; + return *this; +} +void UniqueConstraintsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UniqueConstraintsRequest("; + out << "catName=" << to_string(catName); + out << ", " << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +UniqueConstraintsResponse::~UniqueConstraintsResponse() noexcept { +} + +UniqueConstraintsResponse::UniqueConstraintsResponse() noexcept { +} + +void UniqueConstraintsResponse::__set_uniqueConstraints(const std::vector & val) { + this->uniqueConstraints = val; +} +std::ostream& operator<<(std::ostream& out, const UniqueConstraintsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UniqueConstraintsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_uniqueConstraints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->uniqueConstraints.clear(); + uint32_t _size543; + ::apache::thrift::protocol::TType _etype546; + xfer += iprot->readListBegin(_etype546, _size543); + this->uniqueConstraints.resize(_size543); + uint32_t _i547; + for (_i547 = 0; _i547 < _size543; ++_i547) + { + xfer += this->uniqueConstraints[_i547].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_uniqueConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_uniqueConstraints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t UniqueConstraintsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UniqueConstraintsResponse"); + + xfer += oprot->writeFieldBegin("uniqueConstraints", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->uniqueConstraints.size())); + std::vector ::const_iterator _iter548; + for (_iter548 = this->uniqueConstraints.begin(); _iter548 != this->uniqueConstraints.end(); ++_iter548) + { + xfer += (*_iter548).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UniqueConstraintsResponse &a, UniqueConstraintsResponse &b) noexcept { + using ::std::swap; + swap(a.uniqueConstraints, b.uniqueConstraints); +} + +bool UniqueConstraintsResponse::operator==(const UniqueConstraintsResponse & rhs) const +{ + if (!(uniqueConstraints == rhs.uniqueConstraints)) + return false; + return true; +} + +UniqueConstraintsResponse::UniqueConstraintsResponse(const UniqueConstraintsResponse& other549) { + uniqueConstraints = other549.uniqueConstraints; +} +UniqueConstraintsResponse& UniqueConstraintsResponse::operator=(const UniqueConstraintsResponse& other550) { + uniqueConstraints = other550.uniqueConstraints; + return *this; +} +void UniqueConstraintsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UniqueConstraintsResponse("; + out << "uniqueConstraints=" << to_string(uniqueConstraints); + out << ")"; +} + + +NotNullConstraintsRequest::~NotNullConstraintsRequest() noexcept { +} + +NotNullConstraintsRequest::NotNullConstraintsRequest() noexcept + : catName(), + db_name(), + tbl_name(), + validWriteIdList(), + tableId(-1LL) { +} + +void NotNullConstraintsRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void NotNullConstraintsRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void NotNullConstraintsRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void NotNullConstraintsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void NotNullConstraintsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const NotNullConstraintsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotNullConstraintsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotNullConstraintsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotNullConstraintsRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotNullConstraintsRequest &a, NotNullConstraintsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool NotNullConstraintsRequest::operator==(const NotNullConstraintsRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +NotNullConstraintsRequest::NotNullConstraintsRequest(const NotNullConstraintsRequest& other551) { + catName = other551.catName; + db_name = other551.db_name; + tbl_name = other551.tbl_name; + validWriteIdList = other551.validWriteIdList; + tableId = other551.tableId; + __isset = other551.__isset; +} +NotNullConstraintsRequest& NotNullConstraintsRequest::operator=(const NotNullConstraintsRequest& other552) { + catName = other552.catName; + db_name = other552.db_name; + tbl_name = other552.tbl_name; + validWriteIdList = other552.validWriteIdList; + tableId = other552.tableId; + __isset = other552.__isset; + return *this; +} +void NotNullConstraintsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotNullConstraintsRequest("; + out << "catName=" << to_string(catName); + out << ", " << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +NotNullConstraintsResponse::~NotNullConstraintsResponse() noexcept { +} + +NotNullConstraintsResponse::NotNullConstraintsResponse() noexcept { +} + +void NotNullConstraintsResponse::__set_notNullConstraints(const std::vector & val) { + this->notNullConstraints = val; +} +std::ostream& operator<<(std::ostream& out, const NotNullConstraintsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotNullConstraintsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_notNullConstraints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->notNullConstraints.clear(); + uint32_t _size553; + ::apache::thrift::protocol::TType _etype556; + xfer += iprot->readListBegin(_etype556, _size553); + this->notNullConstraints.resize(_size553); + uint32_t _i557; + for (_i557 = 0; _i557 < _size553; ++_i557) + { + xfer += this->notNullConstraints[_i557].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_notNullConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_notNullConstraints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotNullConstraintsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotNullConstraintsResponse"); + + xfer += oprot->writeFieldBegin("notNullConstraints", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->notNullConstraints.size())); + std::vector ::const_iterator _iter558; + for (_iter558 = this->notNullConstraints.begin(); _iter558 != this->notNullConstraints.end(); ++_iter558) + { + xfer += (*_iter558).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotNullConstraintsResponse &a, NotNullConstraintsResponse &b) noexcept { + using ::std::swap; + swap(a.notNullConstraints, b.notNullConstraints); +} + +bool NotNullConstraintsResponse::operator==(const NotNullConstraintsResponse & rhs) const +{ + if (!(notNullConstraints == rhs.notNullConstraints)) + return false; + return true; +} + +NotNullConstraintsResponse::NotNullConstraintsResponse(const NotNullConstraintsResponse& other559) { + notNullConstraints = other559.notNullConstraints; +} +NotNullConstraintsResponse& NotNullConstraintsResponse::operator=(const NotNullConstraintsResponse& other560) { + notNullConstraints = other560.notNullConstraints; + return *this; +} +void NotNullConstraintsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotNullConstraintsResponse("; + out << "notNullConstraints=" << to_string(notNullConstraints); + out << ")"; +} + + +DefaultConstraintsRequest::~DefaultConstraintsRequest() noexcept { +} + +DefaultConstraintsRequest::DefaultConstraintsRequest() noexcept + : catName(), + db_name(), + tbl_name(), + validWriteIdList(), + tableId(-1LL) { +} + +void DefaultConstraintsRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void DefaultConstraintsRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void DefaultConstraintsRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void DefaultConstraintsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void DefaultConstraintsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const DefaultConstraintsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DefaultConstraintsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DefaultConstraintsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DefaultConstraintsRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DefaultConstraintsRequest &a, DefaultConstraintsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool DefaultConstraintsRequest::operator==(const DefaultConstraintsRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +DefaultConstraintsRequest::DefaultConstraintsRequest(const DefaultConstraintsRequest& other561) { + catName = other561.catName; + db_name = other561.db_name; + tbl_name = other561.tbl_name; + validWriteIdList = other561.validWriteIdList; + tableId = other561.tableId; + __isset = other561.__isset; +} +DefaultConstraintsRequest& DefaultConstraintsRequest::operator=(const DefaultConstraintsRequest& other562) { + catName = other562.catName; + db_name = other562.db_name; + tbl_name = other562.tbl_name; + validWriteIdList = other562.validWriteIdList; + tableId = other562.tableId; + __isset = other562.__isset; + return *this; +} +void DefaultConstraintsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DefaultConstraintsRequest("; + out << "catName=" << to_string(catName); + out << ", " << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +DefaultConstraintsResponse::~DefaultConstraintsResponse() noexcept { +} + +DefaultConstraintsResponse::DefaultConstraintsResponse() noexcept { +} + +void DefaultConstraintsResponse::__set_defaultConstraints(const std::vector & val) { + this->defaultConstraints = val; +} +std::ostream& operator<<(std::ostream& out, const DefaultConstraintsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DefaultConstraintsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_defaultConstraints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->defaultConstraints.clear(); + uint32_t _size563; + ::apache::thrift::protocol::TType _etype566; + xfer += iprot->readListBegin(_etype566, _size563); + this->defaultConstraints.resize(_size563); + uint32_t _i567; + for (_i567 = 0; _i567 < _size563; ++_i567) + { + xfer += this->defaultConstraints[_i567].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_defaultConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_defaultConstraints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DefaultConstraintsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DefaultConstraintsResponse"); + + xfer += oprot->writeFieldBegin("defaultConstraints", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->defaultConstraints.size())); + std::vector ::const_iterator _iter568; + for (_iter568 = this->defaultConstraints.begin(); _iter568 != this->defaultConstraints.end(); ++_iter568) + { + xfer += (*_iter568).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DefaultConstraintsResponse &a, DefaultConstraintsResponse &b) noexcept { + using ::std::swap; + swap(a.defaultConstraints, b.defaultConstraints); +} + +bool DefaultConstraintsResponse::operator==(const DefaultConstraintsResponse & rhs) const +{ + if (!(defaultConstraints == rhs.defaultConstraints)) + return false; + return true; +} + +DefaultConstraintsResponse::DefaultConstraintsResponse(const DefaultConstraintsResponse& other569) { + defaultConstraints = other569.defaultConstraints; +} +DefaultConstraintsResponse& DefaultConstraintsResponse::operator=(const DefaultConstraintsResponse& other570) { + defaultConstraints = other570.defaultConstraints; + return *this; +} +void DefaultConstraintsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DefaultConstraintsResponse("; + out << "defaultConstraints=" << to_string(defaultConstraints); + out << ")"; +} + + +CheckConstraintsRequest::~CheckConstraintsRequest() noexcept { +} + +CheckConstraintsRequest::CheckConstraintsRequest() noexcept + : catName(), + db_name(), + tbl_name(), + validWriteIdList(), + tableId(-1LL) { +} + +void CheckConstraintsRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void CheckConstraintsRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void CheckConstraintsRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void CheckConstraintsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void CheckConstraintsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const CheckConstraintsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CheckConstraintsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CheckConstraintsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CheckConstraintsRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CheckConstraintsRequest &a, CheckConstraintsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool CheckConstraintsRequest::operator==(const CheckConstraintsRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +CheckConstraintsRequest::CheckConstraintsRequest(const CheckConstraintsRequest& other571) { + catName = other571.catName; + db_name = other571.db_name; + tbl_name = other571.tbl_name; + validWriteIdList = other571.validWriteIdList; + tableId = other571.tableId; + __isset = other571.__isset; +} +CheckConstraintsRequest& CheckConstraintsRequest::operator=(const CheckConstraintsRequest& other572) { + catName = other572.catName; + db_name = other572.db_name; + tbl_name = other572.tbl_name; + validWriteIdList = other572.validWriteIdList; + tableId = other572.tableId; + __isset = other572.__isset; + return *this; +} +void CheckConstraintsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CheckConstraintsRequest("; + out << "catName=" << to_string(catName); + out << ", " << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +CheckConstraintsResponse::~CheckConstraintsResponse() noexcept { +} + +CheckConstraintsResponse::CheckConstraintsResponse() noexcept { +} + +void CheckConstraintsResponse::__set_checkConstraints(const std::vector & val) { + this->checkConstraints = val; +} +std::ostream& operator<<(std::ostream& out, const CheckConstraintsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CheckConstraintsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_checkConstraints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->checkConstraints.clear(); + uint32_t _size573; + ::apache::thrift::protocol::TType _etype576; + xfer += iprot->readListBegin(_etype576, _size573); + this->checkConstraints.resize(_size573); + uint32_t _i577; + for (_i577 = 0; _i577 < _size573; ++_i577) + { + xfer += this->checkConstraints[_i577].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_checkConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_checkConstraints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CheckConstraintsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CheckConstraintsResponse"); + + xfer += oprot->writeFieldBegin("checkConstraints", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->checkConstraints.size())); + std::vector ::const_iterator _iter578; + for (_iter578 = this->checkConstraints.begin(); _iter578 != this->checkConstraints.end(); ++_iter578) + { + xfer += (*_iter578).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CheckConstraintsResponse &a, CheckConstraintsResponse &b) noexcept { + using ::std::swap; + swap(a.checkConstraints, b.checkConstraints); +} + +bool CheckConstraintsResponse::operator==(const CheckConstraintsResponse & rhs) const +{ + if (!(checkConstraints == rhs.checkConstraints)) + return false; + return true; +} + +CheckConstraintsResponse::CheckConstraintsResponse(const CheckConstraintsResponse& other579) { + checkConstraints = other579.checkConstraints; +} +CheckConstraintsResponse& CheckConstraintsResponse::operator=(const CheckConstraintsResponse& other580) { + checkConstraints = other580.checkConstraints; + return *this; +} +void CheckConstraintsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CheckConstraintsResponse("; + out << "checkConstraints=" << to_string(checkConstraints); + out << ")"; +} + + +AllTableConstraintsRequest::~AllTableConstraintsRequest() noexcept { +} + +AllTableConstraintsRequest::AllTableConstraintsRequest() noexcept + : dbName(), + tblName(), + catName(), + validWriteIdList(), + tableId(-1LL) { +} + +void AllTableConstraintsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AllTableConstraintsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void AllTableConstraintsRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void AllTableConstraintsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void AllTableConstraintsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +__isset.tableId = true; +} +std::ostream& operator<<(std::ostream& out, const AllTableConstraintsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AllTableConstraintsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_catName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + this->__isset.tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AllTableConstraintsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AllTableConstraintsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableId) { + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AllTableConstraintsRequest &a, AllTableConstraintsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.tableId, b.tableId); + swap(a.__isset, b.__isset); +} + +bool AllTableConstraintsRequest::operator==(const AllTableConstraintsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.tableId != rhs.__isset.tableId) + return false; + else if (__isset.tableId && !(tableId == rhs.tableId)) + return false; + return true; +} + +AllTableConstraintsRequest::AllTableConstraintsRequest(const AllTableConstraintsRequest& other581) { + dbName = other581.dbName; + tblName = other581.tblName; + catName = other581.catName; + validWriteIdList = other581.validWriteIdList; + tableId = other581.tableId; + __isset = other581.__isset; +} +AllTableConstraintsRequest& AllTableConstraintsRequest::operator=(const AllTableConstraintsRequest& other582) { + dbName = other582.dbName; + tblName = other582.tblName; + catName = other582.catName; + validWriteIdList = other582.validWriteIdList; + tableId = other582.tableId; + __isset = other582.__isset; + return *this; +} +void AllTableConstraintsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AllTableConstraintsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "catName=" << to_string(catName); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "tableId="; (__isset.tableId ? (out << to_string(tableId)) : (out << "")); + out << ")"; +} + + +AllTableConstraintsResponse::~AllTableConstraintsResponse() noexcept { +} + +AllTableConstraintsResponse::AllTableConstraintsResponse() noexcept { +} + +void AllTableConstraintsResponse::__set_allTableConstraints(const SQLAllTableConstraints& val) { + this->allTableConstraints = val; +} +std::ostream& operator<<(std::ostream& out, const AllTableConstraintsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AllTableConstraintsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_allTableConstraints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->allTableConstraints.read(iprot); + isset_allTableConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_allTableConstraints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AllTableConstraintsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AllTableConstraintsResponse"); + + xfer += oprot->writeFieldBegin("allTableConstraints", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->allTableConstraints.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AllTableConstraintsResponse &a, AllTableConstraintsResponse &b) noexcept { + using ::std::swap; + swap(a.allTableConstraints, b.allTableConstraints); +} + +bool AllTableConstraintsResponse::operator==(const AllTableConstraintsResponse & rhs) const +{ + if (!(allTableConstraints == rhs.allTableConstraints)) + return false; + return true; +} + +AllTableConstraintsResponse::AllTableConstraintsResponse(const AllTableConstraintsResponse& other583) { + allTableConstraints = other583.allTableConstraints; +} +AllTableConstraintsResponse& AllTableConstraintsResponse::operator=(const AllTableConstraintsResponse& other584) { + allTableConstraints = other584.allTableConstraints; + return *this; +} +void AllTableConstraintsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AllTableConstraintsResponse("; + out << "allTableConstraints=" << to_string(allTableConstraints); + out << ")"; +} + + +DropConstraintRequest::~DropConstraintRequest() noexcept { +} + +DropConstraintRequest::DropConstraintRequest() noexcept + : dbname(), + tablename(), + constraintname(), + catName() { +} + +void DropConstraintRequest::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void DropConstraintRequest::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void DropConstraintRequest::__set_constraintname(const std::string& val) { + this->constraintname = val; +} + +void DropConstraintRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const DropConstraintRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropConstraintRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbname = false; + bool isset_tablename = false; + bool isset_constraintname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->constraintname); + isset_constraintname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_constraintname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropConstraintRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropConstraintRequest"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("constraintname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->constraintname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropConstraintRequest &a, DropConstraintRequest &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.constraintname, b.constraintname); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool DropConstraintRequest::operator==(const DropConstraintRequest & rhs) const +{ + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (!(constraintname == rhs.constraintname)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +DropConstraintRequest::DropConstraintRequest(const DropConstraintRequest& other585) { + dbname = other585.dbname; + tablename = other585.tablename; + constraintname = other585.constraintname; + catName = other585.catName; + __isset = other585.__isset; +} +DropConstraintRequest& DropConstraintRequest::operator=(const DropConstraintRequest& other586) { + dbname = other586.dbname; + tablename = other586.tablename; + constraintname = other586.constraintname; + catName = other586.catName; + __isset = other586.__isset; + return *this; +} +void DropConstraintRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropConstraintRequest("; + out << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "constraintname=" << to_string(constraintname); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +AddPrimaryKeyRequest::~AddPrimaryKeyRequest() noexcept { +} + +AddPrimaryKeyRequest::AddPrimaryKeyRequest() noexcept { +} + +void AddPrimaryKeyRequest::__set_primaryKeyCols(const std::vector & val) { + this->primaryKeyCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddPrimaryKeyRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddPrimaryKeyRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_primaryKeyCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->primaryKeyCols.clear(); + uint32_t _size587; + ::apache::thrift::protocol::TType _etype590; + xfer += iprot->readListBegin(_etype590, _size587); + this->primaryKeyCols.resize(_size587); + uint32_t _i591; + for (_i591 = 0; _i591 < _size587; ++_i591) + { + xfer += this->primaryKeyCols[_i591].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_primaryKeyCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_primaryKeyCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddPrimaryKeyRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddPrimaryKeyRequest"); + + xfer += oprot->writeFieldBegin("primaryKeyCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->primaryKeyCols.size())); + std::vector ::const_iterator _iter592; + for (_iter592 = this->primaryKeyCols.begin(); _iter592 != this->primaryKeyCols.end(); ++_iter592) + { + xfer += (*_iter592).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddPrimaryKeyRequest &a, AddPrimaryKeyRequest &b) noexcept { + using ::std::swap; + swap(a.primaryKeyCols, b.primaryKeyCols); +} + +bool AddPrimaryKeyRequest::operator==(const AddPrimaryKeyRequest & rhs) const +{ + if (!(primaryKeyCols == rhs.primaryKeyCols)) + return false; + return true; +} + +AddPrimaryKeyRequest::AddPrimaryKeyRequest(const AddPrimaryKeyRequest& other593) { + primaryKeyCols = other593.primaryKeyCols; +} +AddPrimaryKeyRequest& AddPrimaryKeyRequest::operator=(const AddPrimaryKeyRequest& other594) { + primaryKeyCols = other594.primaryKeyCols; + return *this; +} +void AddPrimaryKeyRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddPrimaryKeyRequest("; + out << "primaryKeyCols=" << to_string(primaryKeyCols); + out << ")"; +} + + +AddForeignKeyRequest::~AddForeignKeyRequest() noexcept { +} + +AddForeignKeyRequest::AddForeignKeyRequest() noexcept { +} + +void AddForeignKeyRequest::__set_foreignKeyCols(const std::vector & val) { + this->foreignKeyCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddForeignKeyRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddForeignKeyRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_foreignKeyCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->foreignKeyCols.clear(); + uint32_t _size595; + ::apache::thrift::protocol::TType _etype598; + xfer += iprot->readListBegin(_etype598, _size595); + this->foreignKeyCols.resize(_size595); + uint32_t _i599; + for (_i599 = 0; _i599 < _size595; ++_i599) + { + xfer += this->foreignKeyCols[_i599].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_foreignKeyCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_foreignKeyCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddForeignKeyRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddForeignKeyRequest"); + + xfer += oprot->writeFieldBegin("foreignKeyCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->foreignKeyCols.size())); + std::vector ::const_iterator _iter600; + for (_iter600 = this->foreignKeyCols.begin(); _iter600 != this->foreignKeyCols.end(); ++_iter600) + { + xfer += (*_iter600).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddForeignKeyRequest &a, AddForeignKeyRequest &b) noexcept { + using ::std::swap; + swap(a.foreignKeyCols, b.foreignKeyCols); +} + +bool AddForeignKeyRequest::operator==(const AddForeignKeyRequest & rhs) const +{ + if (!(foreignKeyCols == rhs.foreignKeyCols)) + return false; + return true; +} + +AddForeignKeyRequest::AddForeignKeyRequest(const AddForeignKeyRequest& other601) { + foreignKeyCols = other601.foreignKeyCols; +} +AddForeignKeyRequest& AddForeignKeyRequest::operator=(const AddForeignKeyRequest& other602) { + foreignKeyCols = other602.foreignKeyCols; + return *this; +} +void AddForeignKeyRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddForeignKeyRequest("; + out << "foreignKeyCols=" << to_string(foreignKeyCols); + out << ")"; +} + + +AddUniqueConstraintRequest::~AddUniqueConstraintRequest() noexcept { +} + +AddUniqueConstraintRequest::AddUniqueConstraintRequest() noexcept { +} + +void AddUniqueConstraintRequest::__set_uniqueConstraintCols(const std::vector & val) { + this->uniqueConstraintCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddUniqueConstraintRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddUniqueConstraintRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_uniqueConstraintCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->uniqueConstraintCols.clear(); + uint32_t _size603; + ::apache::thrift::protocol::TType _etype606; + xfer += iprot->readListBegin(_etype606, _size603); + this->uniqueConstraintCols.resize(_size603); + uint32_t _i607; + for (_i607 = 0; _i607 < _size603; ++_i607) + { + xfer += this->uniqueConstraintCols[_i607].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_uniqueConstraintCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_uniqueConstraintCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddUniqueConstraintRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddUniqueConstraintRequest"); + + xfer += oprot->writeFieldBegin("uniqueConstraintCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->uniqueConstraintCols.size())); + std::vector ::const_iterator _iter608; + for (_iter608 = this->uniqueConstraintCols.begin(); _iter608 != this->uniqueConstraintCols.end(); ++_iter608) + { + xfer += (*_iter608).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddUniqueConstraintRequest &a, AddUniqueConstraintRequest &b) noexcept { + using ::std::swap; + swap(a.uniqueConstraintCols, b.uniqueConstraintCols); +} + +bool AddUniqueConstraintRequest::operator==(const AddUniqueConstraintRequest & rhs) const +{ + if (!(uniqueConstraintCols == rhs.uniqueConstraintCols)) + return false; + return true; +} + +AddUniqueConstraintRequest::AddUniqueConstraintRequest(const AddUniqueConstraintRequest& other609) { + uniqueConstraintCols = other609.uniqueConstraintCols; +} +AddUniqueConstraintRequest& AddUniqueConstraintRequest::operator=(const AddUniqueConstraintRequest& other610) { + uniqueConstraintCols = other610.uniqueConstraintCols; + return *this; +} +void AddUniqueConstraintRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddUniqueConstraintRequest("; + out << "uniqueConstraintCols=" << to_string(uniqueConstraintCols); + out << ")"; +} + + +AddNotNullConstraintRequest::~AddNotNullConstraintRequest() noexcept { +} + +AddNotNullConstraintRequest::AddNotNullConstraintRequest() noexcept { +} + +void AddNotNullConstraintRequest::__set_notNullConstraintCols(const std::vector & val) { + this->notNullConstraintCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddNotNullConstraintRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddNotNullConstraintRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_notNullConstraintCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->notNullConstraintCols.clear(); + uint32_t _size611; + ::apache::thrift::protocol::TType _etype614; + xfer += iprot->readListBegin(_etype614, _size611); + this->notNullConstraintCols.resize(_size611); + uint32_t _i615; + for (_i615 = 0; _i615 < _size611; ++_i615) + { + xfer += this->notNullConstraintCols[_i615].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_notNullConstraintCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_notNullConstraintCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddNotNullConstraintRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddNotNullConstraintRequest"); + + xfer += oprot->writeFieldBegin("notNullConstraintCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->notNullConstraintCols.size())); + std::vector ::const_iterator _iter616; + for (_iter616 = this->notNullConstraintCols.begin(); _iter616 != this->notNullConstraintCols.end(); ++_iter616) + { + xfer += (*_iter616).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddNotNullConstraintRequest &a, AddNotNullConstraintRequest &b) noexcept { + using ::std::swap; + swap(a.notNullConstraintCols, b.notNullConstraintCols); +} + +bool AddNotNullConstraintRequest::operator==(const AddNotNullConstraintRequest & rhs) const +{ + if (!(notNullConstraintCols == rhs.notNullConstraintCols)) + return false; + return true; +} + +AddNotNullConstraintRequest::AddNotNullConstraintRequest(const AddNotNullConstraintRequest& other617) { + notNullConstraintCols = other617.notNullConstraintCols; +} +AddNotNullConstraintRequest& AddNotNullConstraintRequest::operator=(const AddNotNullConstraintRequest& other618) { + notNullConstraintCols = other618.notNullConstraintCols; + return *this; +} +void AddNotNullConstraintRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddNotNullConstraintRequest("; + out << "notNullConstraintCols=" << to_string(notNullConstraintCols); + out << ")"; +} + + +AddDefaultConstraintRequest::~AddDefaultConstraintRequest() noexcept { +} + +AddDefaultConstraintRequest::AddDefaultConstraintRequest() noexcept { +} + +void AddDefaultConstraintRequest::__set_defaultConstraintCols(const std::vector & val) { + this->defaultConstraintCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddDefaultConstraintRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddDefaultConstraintRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_defaultConstraintCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->defaultConstraintCols.clear(); + uint32_t _size619; + ::apache::thrift::protocol::TType _etype622; + xfer += iprot->readListBegin(_etype622, _size619); + this->defaultConstraintCols.resize(_size619); + uint32_t _i623; + for (_i623 = 0; _i623 < _size619; ++_i623) + { + xfer += this->defaultConstraintCols[_i623].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_defaultConstraintCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_defaultConstraintCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddDefaultConstraintRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddDefaultConstraintRequest"); + + xfer += oprot->writeFieldBegin("defaultConstraintCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->defaultConstraintCols.size())); + std::vector ::const_iterator _iter624; + for (_iter624 = this->defaultConstraintCols.begin(); _iter624 != this->defaultConstraintCols.end(); ++_iter624) + { + xfer += (*_iter624).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddDefaultConstraintRequest &a, AddDefaultConstraintRequest &b) noexcept { + using ::std::swap; + swap(a.defaultConstraintCols, b.defaultConstraintCols); +} + +bool AddDefaultConstraintRequest::operator==(const AddDefaultConstraintRequest & rhs) const +{ + if (!(defaultConstraintCols == rhs.defaultConstraintCols)) + return false; + return true; +} + +AddDefaultConstraintRequest::AddDefaultConstraintRequest(const AddDefaultConstraintRequest& other625) { + defaultConstraintCols = other625.defaultConstraintCols; +} +AddDefaultConstraintRequest& AddDefaultConstraintRequest::operator=(const AddDefaultConstraintRequest& other626) { + defaultConstraintCols = other626.defaultConstraintCols; + return *this; +} +void AddDefaultConstraintRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddDefaultConstraintRequest("; + out << "defaultConstraintCols=" << to_string(defaultConstraintCols); + out << ")"; +} + + +AddCheckConstraintRequest::~AddCheckConstraintRequest() noexcept { +} + +AddCheckConstraintRequest::AddCheckConstraintRequest() noexcept { +} + +void AddCheckConstraintRequest::__set_checkConstraintCols(const std::vector & val) { + this->checkConstraintCols = val; +} +std::ostream& operator<<(std::ostream& out, const AddCheckConstraintRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddCheckConstraintRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_checkConstraintCols = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->checkConstraintCols.clear(); + uint32_t _size627; + ::apache::thrift::protocol::TType _etype630; + xfer += iprot->readListBegin(_etype630, _size627); + this->checkConstraintCols.resize(_size627); + uint32_t _i631; + for (_i631 = 0; _i631 < _size627; ++_i631) + { + xfer += this->checkConstraintCols[_i631].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_checkConstraintCols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_checkConstraintCols) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddCheckConstraintRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddCheckConstraintRequest"); + + xfer += oprot->writeFieldBegin("checkConstraintCols", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->checkConstraintCols.size())); + std::vector ::const_iterator _iter632; + for (_iter632 = this->checkConstraintCols.begin(); _iter632 != this->checkConstraintCols.end(); ++_iter632) + { + xfer += (*_iter632).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddCheckConstraintRequest &a, AddCheckConstraintRequest &b) noexcept { + using ::std::swap; + swap(a.checkConstraintCols, b.checkConstraintCols); +} + +bool AddCheckConstraintRequest::operator==(const AddCheckConstraintRequest & rhs) const +{ + if (!(checkConstraintCols == rhs.checkConstraintCols)) + return false; + return true; +} + +AddCheckConstraintRequest::AddCheckConstraintRequest(const AddCheckConstraintRequest& other633) { + checkConstraintCols = other633.checkConstraintCols; +} +AddCheckConstraintRequest& AddCheckConstraintRequest::operator=(const AddCheckConstraintRequest& other634) { + checkConstraintCols = other634.checkConstraintCols; + return *this; +} +void AddCheckConstraintRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddCheckConstraintRequest("; + out << "checkConstraintCols=" << to_string(checkConstraintCols); + out << ")"; +} + + +PartitionsByExprResult::~PartitionsByExprResult() noexcept { +} + +PartitionsByExprResult::PartitionsByExprResult() noexcept + : hasUnknownPartitions(0) { +} + +void PartitionsByExprResult::__set_partitions(const std::vector & val) { + this->partitions = val; +} + +void PartitionsByExprResult::__set_hasUnknownPartitions(const bool val) { + this->hasUnknownPartitions = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionsByExprResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsByExprResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitions = false; + bool isset_hasUnknownPartitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size635; + ::apache::thrift::protocol::TType _etype638; + xfer += iprot->readListBegin(_etype638, _size635); + this->partitions.resize(_size635); + uint32_t _i639; + for (_i639 = 0; _i639 < _size635; ++_i639) + { + xfer += this->partitions[_i639].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->hasUnknownPartitions); + isset_hasUnknownPartitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hasUnknownPartitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsByExprResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsByExprResult"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter640; + for (_iter640 = this->partitions.begin(); _iter640 != this->partitions.end(); ++_iter640) + { + xfer += (*_iter640).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hasUnknownPartitions", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->hasUnknownPartitions); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsByExprResult &a, PartitionsByExprResult &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.hasUnknownPartitions, b.hasUnknownPartitions); +} + +bool PartitionsByExprResult::operator==(const PartitionsByExprResult & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + if (!(hasUnknownPartitions == rhs.hasUnknownPartitions)) + return false; + return true; +} + +PartitionsByExprResult::PartitionsByExprResult(const PartitionsByExprResult& other641) { + partitions = other641.partitions; + hasUnknownPartitions = other641.hasUnknownPartitions; +} +PartitionsByExprResult& PartitionsByExprResult::operator=(const PartitionsByExprResult& other642) { + partitions = other642.partitions; + hasUnknownPartitions = other642.hasUnknownPartitions; + return *this; +} +void PartitionsByExprResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsByExprResult("; + out << "partitions=" << to_string(partitions); + out << ", " << "hasUnknownPartitions=" << to_string(hasUnknownPartitions); + out << ")"; +} + + +PartitionsSpecByExprResult::~PartitionsSpecByExprResult() noexcept { +} + +PartitionsSpecByExprResult::PartitionsSpecByExprResult() noexcept + : hasUnknownPartitions(0) { +} + +void PartitionsSpecByExprResult::__set_partitionsSpec(const std::vector & val) { + this->partitionsSpec = val; +} + +void PartitionsSpecByExprResult::__set_hasUnknownPartitions(const bool val) { + this->hasUnknownPartitions = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionsSpecByExprResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsSpecByExprResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitionsSpec = false; + bool isset_hasUnknownPartitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionsSpec.clear(); + uint32_t _size643; + ::apache::thrift::protocol::TType _etype646; + xfer += iprot->readListBegin(_etype646, _size643); + this->partitionsSpec.resize(_size643); + uint32_t _i647; + for (_i647 = 0; _i647 < _size643; ++_i647) + { + xfer += this->partitionsSpec[_i647].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitionsSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->hasUnknownPartitions); + isset_hasUnknownPartitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitionsSpec) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hasUnknownPartitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsSpecByExprResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsSpecByExprResult"); + + xfer += oprot->writeFieldBegin("partitionsSpec", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionsSpec.size())); + std::vector ::const_iterator _iter648; + for (_iter648 = this->partitionsSpec.begin(); _iter648 != this->partitionsSpec.end(); ++_iter648) + { + xfer += (*_iter648).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hasUnknownPartitions", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->hasUnknownPartitions); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsSpecByExprResult &a, PartitionsSpecByExprResult &b) noexcept { + using ::std::swap; + swap(a.partitionsSpec, b.partitionsSpec); + swap(a.hasUnknownPartitions, b.hasUnknownPartitions); +} + +bool PartitionsSpecByExprResult::operator==(const PartitionsSpecByExprResult & rhs) const +{ + if (!(partitionsSpec == rhs.partitionsSpec)) + return false; + if (!(hasUnknownPartitions == rhs.hasUnknownPartitions)) + return false; + return true; +} + +PartitionsSpecByExprResult::PartitionsSpecByExprResult(const PartitionsSpecByExprResult& other649) { + partitionsSpec = other649.partitionsSpec; + hasUnknownPartitions = other649.hasUnknownPartitions; +} +PartitionsSpecByExprResult& PartitionsSpecByExprResult::operator=(const PartitionsSpecByExprResult& other650) { + partitionsSpec = other650.partitionsSpec; + hasUnknownPartitions = other650.hasUnknownPartitions; + return *this; +} +void PartitionsSpecByExprResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsSpecByExprResult("; + out << "partitionsSpec=" << to_string(partitionsSpec); + out << ", " << "hasUnknownPartitions=" << to_string(hasUnknownPartitions); + out << ")"; +} + + +PartitionsByExprRequest::~PartitionsByExprRequest() noexcept { +} + +PartitionsByExprRequest::PartitionsByExprRequest() noexcept + : dbName(), + tblName(), + expr(), + defaultPartitionName(), + maxParts(-1), + catName(), + order(), + validWriteIdList(), + id(-1LL), + skipColumnSchemaForPartition(0), + includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void PartitionsByExprRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void PartitionsByExprRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void PartitionsByExprRequest::__set_expr(const std::string& val) { + this->expr = val; +} + +void PartitionsByExprRequest::__set_defaultPartitionName(const std::string& val) { + this->defaultPartitionName = val; +__isset.defaultPartitionName = true; +} + +void PartitionsByExprRequest::__set_maxParts(const int16_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void PartitionsByExprRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PartitionsByExprRequest::__set_order(const std::string& val) { + this->order = val; +__isset.order = true; +} + +void PartitionsByExprRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void PartitionsByExprRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void PartitionsByExprRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void PartitionsByExprRequest::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +__isset.includeParamKeyPattern = true; +} + +void PartitionsByExprRequest::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +__isset.excludeParamKeyPattern = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionsByExprRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsByExprRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_expr = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->expr); + isset_expr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->defaultPartitionName); + this->__isset.defaultPartitionName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->order); + this->__isset.order = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_expr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsByExprRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsByExprRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("expr", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeBinary(this->expr); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.defaultPartitionName) { + xfer += oprot->writeFieldBegin("defaultPartitionName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->defaultPartitionName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I16, 5); + xfer += oprot->writeI16(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.order) { + xfer += oprot->writeFieldBegin("order", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->order); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 9); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 10); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeParamKeyPattern) { + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.excludeParamKeyPattern) { + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsByExprRequest &a, PartitionsByExprRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.expr, b.expr); + swap(a.defaultPartitionName, b.defaultPartitionName); + swap(a.maxParts, b.maxParts); + swap(a.catName, b.catName); + swap(a.order, b.order); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.__isset, b.__isset); +} + +bool PartitionsByExprRequest::operator==(const PartitionsByExprRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(expr == rhs.expr)) + return false; + if (__isset.defaultPartitionName != rhs.__isset.defaultPartitionName) + return false; + else if (__isset.defaultPartitionName && !(defaultPartitionName == rhs.defaultPartitionName)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.order != rhs.__isset.order) + return false; + else if (__isset.order && !(order == rhs.order)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.includeParamKeyPattern != rhs.__isset.includeParamKeyPattern) + return false; + else if (__isset.includeParamKeyPattern && !(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (__isset.excludeParamKeyPattern != rhs.__isset.excludeParamKeyPattern) + return false; + else if (__isset.excludeParamKeyPattern && !(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + return true; +} + +PartitionsByExprRequest::PartitionsByExprRequest(const PartitionsByExprRequest& other651) { + dbName = other651.dbName; + tblName = other651.tblName; + expr = other651.expr; + defaultPartitionName = other651.defaultPartitionName; + maxParts = other651.maxParts; + catName = other651.catName; + order = other651.order; + validWriteIdList = other651.validWriteIdList; + id = other651.id; + skipColumnSchemaForPartition = other651.skipColumnSchemaForPartition; + includeParamKeyPattern = other651.includeParamKeyPattern; + excludeParamKeyPattern = other651.excludeParamKeyPattern; + __isset = other651.__isset; +} +PartitionsByExprRequest& PartitionsByExprRequest::operator=(const PartitionsByExprRequest& other652) { + dbName = other652.dbName; + tblName = other652.tblName; + expr = other652.expr; + defaultPartitionName = other652.defaultPartitionName; + maxParts = other652.maxParts; + catName = other652.catName; + order = other652.order; + validWriteIdList = other652.validWriteIdList; + id = other652.id; + skipColumnSchemaForPartition = other652.skipColumnSchemaForPartition; + includeParamKeyPattern = other652.includeParamKeyPattern; + excludeParamKeyPattern = other652.excludeParamKeyPattern; + __isset = other652.__isset; + return *this; +} +void PartitionsByExprRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsByExprRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "expr=" << to_string(expr); + out << ", " << "defaultPartitionName="; (__isset.defaultPartitionName ? (out << to_string(defaultPartitionName)) : (out << "")); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "order="; (__isset.order ? (out << to_string(order)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "includeParamKeyPattern="; (__isset.includeParamKeyPattern ? (out << to_string(includeParamKeyPattern)) : (out << "")); + out << ", " << "excludeParamKeyPattern="; (__isset.excludeParamKeyPattern ? (out << to_string(excludeParamKeyPattern)) : (out << "")); + out << ")"; +} + + +TableStatsResult::~TableStatsResult() noexcept { +} + +TableStatsResult::TableStatsResult() noexcept + : isStatsCompliant(0) { +} + +void TableStatsResult::__set_tableStats(const std::vector & val) { + this->tableStats = val; +} + +void TableStatsResult::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} +std::ostream& operator<<(std::ostream& out, const TableStatsResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TableStatsResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tableStats = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tableStats.clear(); + uint32_t _size653; + ::apache::thrift::protocol::TType _etype656; + xfer += iprot->readListBegin(_etype656, _size653); + this->tableStats.resize(_size653); + uint32_t _i657; + for (_i657 = 0; _i657 < _size653; ++_i657) + { + xfer += this->tableStats[_i657].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_tableStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tableStats) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TableStatsResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TableStatsResult"); + + xfer += oprot->writeFieldBegin("tableStats", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->tableStats.size())); + std::vector ::const_iterator _iter658; + for (_iter658 = this->tableStats.begin(); _iter658 != this->tableStats.end(); ++_iter658) + { + xfer += (*_iter658).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TableStatsResult &a, TableStatsResult &b) noexcept { + using ::std::swap; + swap(a.tableStats, b.tableStats); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.__isset, b.__isset); +} + +bool TableStatsResult::operator==(const TableStatsResult & rhs) const +{ + if (!(tableStats == rhs.tableStats)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + return true; +} + +TableStatsResult::TableStatsResult(const TableStatsResult& other659) { + tableStats = other659.tableStats; + isStatsCompliant = other659.isStatsCompliant; + __isset = other659.__isset; +} +TableStatsResult& TableStatsResult::operator=(const TableStatsResult& other660) { + tableStats = other660.tableStats; + isStatsCompliant = other660.isStatsCompliant; + __isset = other660.__isset; + return *this; +} +void TableStatsResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TableStatsResult("; + out << "tableStats=" << to_string(tableStats); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ")"; +} + + +PartitionsStatsResult::~PartitionsStatsResult() noexcept { +} + +PartitionsStatsResult::PartitionsStatsResult() noexcept + : isStatsCompliant(0) { +} + +void PartitionsStatsResult::__set_partStats(const std::map > & val) { + this->partStats = val; +} + +void PartitionsStatsResult::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionsStatsResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsStatsResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partStats = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->partStats.clear(); + uint32_t _size661; + ::apache::thrift::protocol::TType _ktype662; + ::apache::thrift::protocol::TType _vtype663; + xfer += iprot->readMapBegin(_ktype662, _vtype663, _size661); + uint32_t _i665; + for (_i665 = 0; _i665 < _size661; ++_i665) + { + std::string _key666; + xfer += iprot->readString(_key666); + std::vector & _val667 = this->partStats[_key666]; + { + _val667.clear(); + uint32_t _size668; + ::apache::thrift::protocol::TType _etype671; + xfer += iprot->readListBegin(_etype671, _size668); + _val667.resize(_size668); + uint32_t _i672; + for (_i672 = 0; _i672 < _size668; ++_i672) + { + xfer += _val667[_i672].read(iprot); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readMapEnd(); + } + isset_partStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partStats) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsStatsResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsStatsResult"); + + xfer += oprot->writeFieldBegin("partStats", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast(this->partStats.size())); + std::map > ::const_iterator _iter673; + for (_iter673 = this->partStats.begin(); _iter673 != this->partStats.end(); ++_iter673) + { + xfer += oprot->writeString(_iter673->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(_iter673->second.size())); + std::vector ::const_iterator _iter674; + for (_iter674 = _iter673->second.begin(); _iter674 != _iter673->second.end(); ++_iter674) + { + xfer += (*_iter674).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsStatsResult &a, PartitionsStatsResult &b) noexcept { + using ::std::swap; + swap(a.partStats, b.partStats); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.__isset, b.__isset); +} + +bool PartitionsStatsResult::operator==(const PartitionsStatsResult & rhs) const +{ + if (!(partStats == rhs.partStats)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + return true; +} + +PartitionsStatsResult::PartitionsStatsResult(const PartitionsStatsResult& other675) { + partStats = other675.partStats; + isStatsCompliant = other675.isStatsCompliant; + __isset = other675.__isset; +} +PartitionsStatsResult& PartitionsStatsResult::operator=(const PartitionsStatsResult& other676) { + partStats = other676.partStats; + isStatsCompliant = other676.isStatsCompliant; + __isset = other676.__isset; + return *this; +} +void PartitionsStatsResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsStatsResult("; + out << "partStats=" << to_string(partStats); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ")"; +} + + +TableStatsRequest::~TableStatsRequest() noexcept { +} + +TableStatsRequest::TableStatsRequest() : dbName(), + tblName(), + catName(), + validWriteIdList(), + engine("hive"), + id(-1LL) { +} + +void TableStatsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void TableStatsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void TableStatsRequest::__set_colNames(const std::vector & val) { + this->colNames = val; +} + +void TableStatsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void TableStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void TableStatsRequest::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} + +void TableStatsRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const TableStatsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TableStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_colNames = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->colNames.clear(); + uint32_t _size677; + ::apache::thrift::protocol::TType _etype680; + xfer += iprot->readListBegin(_etype680, _size677); + this->colNames.resize(_size677); + uint32_t _i681; + for (_i681 = 0; _i681 < _size677; ++_i681) + { + xfer += iprot->readString(this->colNames[_i681]); + } + xfer += iprot->readListEnd(); + } + isset_colNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_colNames) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TableStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TableStatsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("colNames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->colNames.size())); + std::vector ::const_iterator _iter682; + for (_iter682 = this->colNames.begin(); _iter682 != this->colNames.end(); ++_iter682) + { + xfer += oprot->writeString((*_iter682)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TableStatsRequest &a, TableStatsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.colNames, b.colNames); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.engine, b.engine); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool TableStatsRequest::operator==(const TableStatsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(colNames == rhs.colNames)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +TableStatsRequest::TableStatsRequest(const TableStatsRequest& other683) { + dbName = other683.dbName; + tblName = other683.tblName; + colNames = other683.colNames; + catName = other683.catName; + validWriteIdList = other683.validWriteIdList; + engine = other683.engine; + id = other683.id; + __isset = other683.__isset; +} +TableStatsRequest& TableStatsRequest::operator=(const TableStatsRequest& other684) { + dbName = other684.dbName; + tblName = other684.tblName; + colNames = other684.colNames; + catName = other684.catName; + validWriteIdList = other684.validWriteIdList; + engine = other684.engine; + id = other684.id; + __isset = other684.__isset; + return *this; +} +void TableStatsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TableStatsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "colNames=" << to_string(colNames); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +PartitionsStatsRequest::~PartitionsStatsRequest() noexcept { +} + +PartitionsStatsRequest::PartitionsStatsRequest() : dbName(), + tblName(), + catName(), + validWriteIdList(), + engine("hive") { +} + +void PartitionsStatsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void PartitionsStatsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void PartitionsStatsRequest::__set_colNames(const std::vector & val) { + this->colNames = val; +} + +void PartitionsStatsRequest::__set_partNames(const std::vector & val) { + this->partNames = val; +} + +void PartitionsStatsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PartitionsStatsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void PartitionsStatsRequest::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionsStatsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_colNames = false; + bool isset_partNames = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->colNames.clear(); + uint32_t _size685; + ::apache::thrift::protocol::TType _etype688; + xfer += iprot->readListBegin(_etype688, _size685); + this->colNames.resize(_size685); + uint32_t _i689; + for (_i689 = 0; _i689 < _size685; ++_i689) + { + xfer += iprot->readString(this->colNames[_i689]); + } + xfer += iprot->readListEnd(); + } + isset_colNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partNames.clear(); + uint32_t _size690; + ::apache::thrift::protocol::TType _etype693; + xfer += iprot->readListBegin(_etype693, _size690); + this->partNames.resize(_size690); + uint32_t _i694; + for (_i694 = 0; _i694 < _size690; ++_i694) + { + xfer += iprot->readString(this->partNames[_i694]); + } + xfer += iprot->readListEnd(); + } + isset_partNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_colNames) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partNames) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsStatsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("colNames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->colNames.size())); + std::vector ::const_iterator _iter695; + for (_iter695 = this->colNames.begin(); _iter695 != this->colNames.end(); ++_iter695) + { + xfer += oprot->writeString((*_iter695)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partNames.size())); + std::vector ::const_iterator _iter696; + for (_iter696 = this->partNames.begin(); _iter696 != this->partNames.end(); ++_iter696) + { + xfer += oprot->writeString((*_iter696)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsStatsRequest &a, PartitionsStatsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.colNames, b.colNames); + swap(a.partNames, b.partNames); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.engine, b.engine); + swap(a.__isset, b.__isset); +} + +bool PartitionsStatsRequest::operator==(const PartitionsStatsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(colNames == rhs.colNames)) + return false; + if (!(partNames == rhs.partNames)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + return true; +} + +PartitionsStatsRequest::PartitionsStatsRequest(const PartitionsStatsRequest& other697) { + dbName = other697.dbName; + tblName = other697.tblName; + colNames = other697.colNames; + partNames = other697.partNames; + catName = other697.catName; + validWriteIdList = other697.validWriteIdList; + engine = other697.engine; + __isset = other697.__isset; +} +PartitionsStatsRequest& PartitionsStatsRequest::operator=(const PartitionsStatsRequest& other698) { + dbName = other698.dbName; + tblName = other698.tblName; + colNames = other698.colNames; + partNames = other698.partNames; + catName = other698.catName; + validWriteIdList = other698.validWriteIdList; + engine = other698.engine; + __isset = other698.__isset; + return *this; +} +void PartitionsStatsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsStatsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "colNames=" << to_string(colNames); + out << ", " << "partNames=" << to_string(partNames); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ")"; +} + + +AddPartitionsResult::~AddPartitionsResult() noexcept { +} + +AddPartitionsResult::AddPartitionsResult() noexcept + : isStatsCompliant(0) { +} + +void AddPartitionsResult::__set_partitions(const std::vector & val) { + this->partitions = val; +__isset.partitions = true; +} + +void AddPartitionsResult::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} + +void AddPartitionsResult::__set_partitionColSchema(const std::vector & val) { + this->partitionColSchema = val; +__isset.partitionColSchema = true; +} +std::ostream& operator<<(std::ostream& out, const AddPartitionsResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddPartitionsResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size699; + ::apache::thrift::protocol::TType _etype702; + xfer += iprot->readListBegin(_etype702, _size699); + this->partitions.resize(_size699); + uint32_t _i703; + for (_i703 = 0; _i703 < _size699; ++_i703) + { + xfer += this->partitions[_i703].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionColSchema.clear(); + uint32_t _size704; + ::apache::thrift::protocol::TType _etype707; + xfer += iprot->readListBegin(_etype707, _size704); + this->partitionColSchema.resize(_size704); + uint32_t _i708; + for (_i708 = 0; _i708 < _size704; ++_i708) + { + xfer += this->partitionColSchema[_i708].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionColSchema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AddPartitionsResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddPartitionsResult"); + + if (this->__isset.partitions) { + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter709; + for (_iter709 = this->partitions.begin(); _iter709 != this->partitions.end(); ++_iter709) + { + xfer += (*_iter709).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionColSchema) { + xfer += oprot->writeFieldBegin("partitionColSchema", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionColSchema.size())); + std::vector ::const_iterator _iter710; + for (_iter710 = this->partitionColSchema.begin(); _iter710 != this->partitionColSchema.end(); ++_iter710) + { + xfer += (*_iter710).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddPartitionsResult &a, AddPartitionsResult &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.partitionColSchema, b.partitionColSchema); + swap(a.__isset, b.__isset); +} + +bool AddPartitionsResult::operator==(const AddPartitionsResult & rhs) const +{ + if (__isset.partitions != rhs.__isset.partitions) + return false; + else if (__isset.partitions && !(partitions == rhs.partitions)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + if (__isset.partitionColSchema != rhs.__isset.partitionColSchema) + return false; + else if (__isset.partitionColSchema && !(partitionColSchema == rhs.partitionColSchema)) + return false; + return true; +} + +AddPartitionsResult::AddPartitionsResult(const AddPartitionsResult& other711) { + partitions = other711.partitions; + isStatsCompliant = other711.isStatsCompliant; + partitionColSchema = other711.partitionColSchema; + __isset = other711.__isset; +} +AddPartitionsResult& AddPartitionsResult::operator=(const AddPartitionsResult& other712) { + partitions = other712.partitions; + isStatsCompliant = other712.isStatsCompliant; + partitionColSchema = other712.partitionColSchema; + __isset = other712.__isset; + return *this; +} +void AddPartitionsResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddPartitionsResult("; + out << "partitions="; (__isset.partitions ? (out << to_string(partitions)) : (out << "")); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ", " << "partitionColSchema="; (__isset.partitionColSchema ? (out << to_string(partitionColSchema)) : (out << "")); + out << ")"; +} + + +AddPartitionsRequest::~AddPartitionsRequest() noexcept { +} + +AddPartitionsRequest::AddPartitionsRequest() noexcept + : dbName(), + tblName(), + ifNotExists(0), + needResult(true), + catName(), + validWriteIdList(), + skipColumnSchemaForPartition(0) { +} + +void AddPartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AddPartitionsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void AddPartitionsRequest::__set_parts(const std::vector & val) { + this->parts = val; +} + +void AddPartitionsRequest::__set_ifNotExists(const bool val) { + this->ifNotExists = val; +} + +void AddPartitionsRequest::__set_needResult(const bool val) { + this->needResult = val; +__isset.needResult = true; +} + +void AddPartitionsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void AddPartitionsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void AddPartitionsRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void AddPartitionsRequest::__set_partitionColSchema(const std::vector & val) { + this->partitionColSchema = val; +__isset.partitionColSchema = true; +} + +void AddPartitionsRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} +std::ostream& operator<<(std::ostream& out, const AddPartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddPartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_parts = false; + bool isset_ifNotExists = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->parts.clear(); + uint32_t _size713; + ::apache::thrift::protocol::TType _etype716; + xfer += iprot->readListBegin(_etype716, _size713); + this->parts.resize(_size713); + uint32_t _i717; + for (_i717 = 0; _i717 < _size713; ++_i717) + { + xfer += this->parts[_i717].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ifNotExists); + isset_ifNotExists = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->needResult); + this->__isset.needResult = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionColSchema.clear(); + uint32_t _size718; + ::apache::thrift::protocol::TType _etype721; + xfer += iprot->readListBegin(_etype721, _size718); + this->partitionColSchema.resize(_size718); + uint32_t _i722; + for (_i722 = 0; _i722 < _size718; ++_i722) + { + xfer += this->partitionColSchema[_i722].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionColSchema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_parts) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_ifNotExists) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddPartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddPartitionsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parts", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->parts.size())); + std::vector ::const_iterator _iter723; + for (_iter723 = this->parts.begin(); _iter723 != this->parts.end(); ++_iter723) + { + xfer += (*_iter723).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ifNotExists", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->ifNotExists); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.needResult) { + xfer += oprot->writeFieldBegin("needResult", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->needResult); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionColSchema) { + xfer += oprot->writeFieldBegin("partitionColSchema", ::apache::thrift::protocol::T_LIST, 9); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionColSchema.size())); + std::vector ::const_iterator _iter724; + for (_iter724 = this->partitionColSchema.begin(); _iter724 != this->partitionColSchema.end(); ++_iter724) + { + xfer += (*_iter724).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 10); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddPartitionsRequest &a, AddPartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.parts, b.parts); + swap(a.ifNotExists, b.ifNotExists); + swap(a.needResult, b.needResult); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.partitionColSchema, b.partitionColSchema); + swap(a.environmentContext, b.environmentContext); + swap(a.__isset, b.__isset); +} + +bool AddPartitionsRequest::operator==(const AddPartitionsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(parts == rhs.parts)) + return false; + if (!(ifNotExists == rhs.ifNotExists)) + return false; + if (__isset.needResult != rhs.__isset.needResult) + return false; + else if (__isset.needResult && !(needResult == rhs.needResult)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.partitionColSchema != rhs.__isset.partitionColSchema) + return false; + else if (__isset.partitionColSchema && !(partitionColSchema == rhs.partitionColSchema)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + return true; +} + +AddPartitionsRequest::AddPartitionsRequest(const AddPartitionsRequest& other725) { + dbName = other725.dbName; + tblName = other725.tblName; + parts = other725.parts; + ifNotExists = other725.ifNotExists; + needResult = other725.needResult; + catName = other725.catName; + validWriteIdList = other725.validWriteIdList; + skipColumnSchemaForPartition = other725.skipColumnSchemaForPartition; + partitionColSchema = other725.partitionColSchema; + environmentContext = other725.environmentContext; + __isset = other725.__isset; +} +AddPartitionsRequest& AddPartitionsRequest::operator=(const AddPartitionsRequest& other726) { + dbName = other726.dbName; + tblName = other726.tblName; + parts = other726.parts; + ifNotExists = other726.ifNotExists; + needResult = other726.needResult; + catName = other726.catName; + validWriteIdList = other726.validWriteIdList; + skipColumnSchemaForPartition = other726.skipColumnSchemaForPartition; + partitionColSchema = other726.partitionColSchema; + environmentContext = other726.environmentContext; + __isset = other726.__isset; + return *this; +} +void AddPartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddPartitionsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "parts=" << to_string(parts); + out << ", " << "ifNotExists=" << to_string(ifNotExists); + out << ", " << "needResult="; (__isset.needResult ? (out << to_string(needResult)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "partitionColSchema="; (__isset.partitionColSchema ? (out << to_string(partitionColSchema)) : (out << "")); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ")"; +} + + +DropPartitionsResult::~DropPartitionsResult() noexcept { +} + +DropPartitionsResult::DropPartitionsResult() noexcept { +} + +void DropPartitionsResult::__set_partitions(const std::vector & val) { + this->partitions = val; +__isset.partitions = true; +} +std::ostream& operator<<(std::ostream& out, const DropPartitionsResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropPartitionsResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size727; + ::apache::thrift::protocol::TType _etype730; + xfer += iprot->readListBegin(_etype730, _size727); + this->partitions.resize(_size727); + uint32_t _i731; + for (_i731 = 0; _i731 < _size727; ++_i731) + { + xfer += this->partitions[_i731].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t DropPartitionsResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropPartitionsResult"); + + if (this->__isset.partitions) { + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter732; + for (_iter732 = this->partitions.begin(); _iter732 != this->partitions.end(); ++_iter732) + { + xfer += (*_iter732).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropPartitionsResult &a, DropPartitionsResult &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.__isset, b.__isset); +} + +bool DropPartitionsResult::operator==(const DropPartitionsResult & rhs) const +{ + if (__isset.partitions != rhs.__isset.partitions) + return false; + else if (__isset.partitions && !(partitions == rhs.partitions)) + return false; + return true; +} + +DropPartitionsResult::DropPartitionsResult(const DropPartitionsResult& other733) { + partitions = other733.partitions; + __isset = other733.__isset; +} +DropPartitionsResult& DropPartitionsResult::operator=(const DropPartitionsResult& other734) { + partitions = other734.partitions; + __isset = other734.__isset; + return *this; +} +void DropPartitionsResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropPartitionsResult("; + out << "partitions="; (__isset.partitions ? (out << to_string(partitions)) : (out << "")); + out << ")"; +} + + +DropPartitionsExpr::~DropPartitionsExpr() noexcept { +} + +DropPartitionsExpr::DropPartitionsExpr() noexcept + : expr(), + partArchiveLevel(0) { +} + +void DropPartitionsExpr::__set_expr(const std::string& val) { + this->expr = val; +} + +void DropPartitionsExpr::__set_partArchiveLevel(const int32_t val) { + this->partArchiveLevel = val; +__isset.partArchiveLevel = true; +} +std::ostream& operator<<(std::ostream& out, const DropPartitionsExpr& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropPartitionsExpr::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_expr = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->expr); + isset_expr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->partArchiveLevel); + this->__isset.partArchiveLevel = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_expr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropPartitionsExpr::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropPartitionsExpr"); + + xfer += oprot->writeFieldBegin("expr", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->expr); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partArchiveLevel) { + xfer += oprot->writeFieldBegin("partArchiveLevel", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->partArchiveLevel); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropPartitionsExpr &a, DropPartitionsExpr &b) noexcept { + using ::std::swap; + swap(a.expr, b.expr); + swap(a.partArchiveLevel, b.partArchiveLevel); + swap(a.__isset, b.__isset); +} + +bool DropPartitionsExpr::operator==(const DropPartitionsExpr & rhs) const +{ + if (!(expr == rhs.expr)) + return false; + if (__isset.partArchiveLevel != rhs.__isset.partArchiveLevel) + return false; + else if (__isset.partArchiveLevel && !(partArchiveLevel == rhs.partArchiveLevel)) + return false; + return true; +} + +DropPartitionsExpr::DropPartitionsExpr(const DropPartitionsExpr& other735) { + expr = other735.expr; + partArchiveLevel = other735.partArchiveLevel; + __isset = other735.__isset; +} +DropPartitionsExpr& DropPartitionsExpr::operator=(const DropPartitionsExpr& other736) { + expr = other736.expr; + partArchiveLevel = other736.partArchiveLevel; + __isset = other736.__isset; + return *this; +} +void DropPartitionsExpr::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropPartitionsExpr("; + out << "expr=" << to_string(expr); + out << ", " << "partArchiveLevel="; (__isset.partArchiveLevel ? (out << to_string(partArchiveLevel)) : (out << "")); + out << ")"; +} + + +RequestPartsSpec::~RequestPartsSpec() noexcept { +} + +RequestPartsSpec::RequestPartsSpec() noexcept { +} + +void RequestPartsSpec::__set_names(const std::vector & val) { + this->names = val; +__isset.names = true; +} + +void RequestPartsSpec::__set_exprs(const std::vector & val) { + this->exprs = val; +__isset.exprs = true; +} +std::ostream& operator<<(std::ostream& out, const RequestPartsSpec& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t RequestPartsSpec::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->names.clear(); + uint32_t _size737; + ::apache::thrift::protocol::TType _etype740; + xfer += iprot->readListBegin(_etype740, _size737); + this->names.resize(_size737); + uint32_t _i741; + for (_i741 = 0; _i741 < _size737; ++_i741) + { + xfer += iprot->readString(this->names[_i741]); + } + xfer += iprot->readListEnd(); + } + this->__isset.names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->exprs.clear(); + uint32_t _size742; + ::apache::thrift::protocol::TType _etype745; + xfer += iprot->readListBegin(_etype745, _size742); + this->exprs.resize(_size742); + uint32_t _i746; + for (_i746 = 0; _i746 < _size742; ++_i746) + { + xfer += this->exprs[_i746].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.exprs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t RequestPartsSpec::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("RequestPartsSpec"); + + if (this->__isset.names) { + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->names.size())); + std::vector ::const_iterator _iter747; + for (_iter747 = this->names.begin(); _iter747 != this->names.end(); ++_iter747) + { + xfer += oprot->writeString((*_iter747)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.exprs) { + xfer += oprot->writeFieldBegin("exprs", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->exprs.size())); + std::vector ::const_iterator _iter748; + for (_iter748 = this->exprs.begin(); _iter748 != this->exprs.end(); ++_iter748) + { + xfer += (*_iter748).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(RequestPartsSpec &a, RequestPartsSpec &b) noexcept { + using ::std::swap; + swap(a.names, b.names); + swap(a.exprs, b.exprs); + swap(a.__isset, b.__isset); +} + +bool RequestPartsSpec::operator==(const RequestPartsSpec & rhs) const +{ + if (__isset.names != rhs.__isset.names) + return false; + else if (__isset.names && !(names == rhs.names)) + return false; + if (__isset.exprs != rhs.__isset.exprs) + return false; + else if (__isset.exprs && !(exprs == rhs.exprs)) + return false; + return true; +} + +RequestPartsSpec::RequestPartsSpec(const RequestPartsSpec& other749) { + names = other749.names; + exprs = other749.exprs; + __isset = other749.__isset; +} +RequestPartsSpec& RequestPartsSpec::operator=(const RequestPartsSpec& other750) { + names = other750.names; + exprs = other750.exprs; + __isset = other750.__isset; + return *this; +} +void RequestPartsSpec::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "RequestPartsSpec("; + out << "names="; (__isset.names ? (out << to_string(names)) : (out << "")); + out << ", " << "exprs="; (__isset.exprs ? (out << to_string(exprs)) : (out << "")); + out << ")"; +} + + +DropPartitionsRequest::~DropPartitionsRequest() noexcept { +} + +DropPartitionsRequest::DropPartitionsRequest() noexcept + : dbName(), + tblName(), + deleteData(0), + ifExists(true), + ignoreProtection(0), + needResult(true), + catName(), + skipColumnSchemaForPartition(0) { +} + +void DropPartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void DropPartitionsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void DropPartitionsRequest::__set_parts(const RequestPartsSpec& val) { + this->parts = val; +} + +void DropPartitionsRequest::__set_deleteData(const bool val) { + this->deleteData = val; +__isset.deleteData = true; +} + +void DropPartitionsRequest::__set_ifExists(const bool val) { + this->ifExists = val; +__isset.ifExists = true; +} + +void DropPartitionsRequest::__set_ignoreProtection(const bool val) { + this->ignoreProtection = val; +__isset.ignoreProtection = true; +} + +void DropPartitionsRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} + +void DropPartitionsRequest::__set_needResult(const bool val) { + this->needResult = val; +__isset.needResult = true; +} + +void DropPartitionsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void DropPartitionsRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} +std::ostream& operator<<(std::ostream& out, const DropPartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropPartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_parts = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->parts.read(iprot); + isset_parts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ifExists); + this->__isset.ifExists = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ignoreProtection); + this->__isset.ignoreProtection = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->needResult); + this->__isset.needResult = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_parts) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropPartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropPartitionsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("parts", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->parts.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.deleteData) { + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ifExists) { + xfer += oprot->writeFieldBegin("ifExists", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->ifExists); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ignoreProtection) { + xfer += oprot->writeFieldBegin("ignoreProtection", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->ignoreProtection); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.needResult) { + xfer += oprot->writeFieldBegin("needResult", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->needResult); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 10); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropPartitionsRequest &a, DropPartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.parts, b.parts); + swap(a.deleteData, b.deleteData); + swap(a.ifExists, b.ifExists); + swap(a.ignoreProtection, b.ignoreProtection); + swap(a.environmentContext, b.environmentContext); + swap(a.needResult, b.needResult); + swap(a.catName, b.catName); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.__isset, b.__isset); +} + +bool DropPartitionsRequest::operator==(const DropPartitionsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(parts == rhs.parts)) + return false; + if (__isset.deleteData != rhs.__isset.deleteData) + return false; + else if (__isset.deleteData && !(deleteData == rhs.deleteData)) + return false; + if (__isset.ifExists != rhs.__isset.ifExists) + return false; + else if (__isset.ifExists && !(ifExists == rhs.ifExists)) + return false; + if (__isset.ignoreProtection != rhs.__isset.ignoreProtection) + return false; + else if (__isset.ignoreProtection && !(ignoreProtection == rhs.ignoreProtection)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + if (__isset.needResult != rhs.__isset.needResult) + return false; + else if (__isset.needResult && !(needResult == rhs.needResult)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + return true; +} + +DropPartitionsRequest::DropPartitionsRequest(const DropPartitionsRequest& other751) { + dbName = other751.dbName; + tblName = other751.tblName; + parts = other751.parts; + deleteData = other751.deleteData; + ifExists = other751.ifExists; + ignoreProtection = other751.ignoreProtection; + environmentContext = other751.environmentContext; + needResult = other751.needResult; + catName = other751.catName; + skipColumnSchemaForPartition = other751.skipColumnSchemaForPartition; + __isset = other751.__isset; +} +DropPartitionsRequest& DropPartitionsRequest::operator=(const DropPartitionsRequest& other752) { + dbName = other752.dbName; + tblName = other752.tblName; + parts = other752.parts; + deleteData = other752.deleteData; + ifExists = other752.ifExists; + ignoreProtection = other752.ignoreProtection; + environmentContext = other752.environmentContext; + needResult = other752.needResult; + catName = other752.catName; + skipColumnSchemaForPartition = other752.skipColumnSchemaForPartition; + __isset = other752.__isset; + return *this; +} +void DropPartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropPartitionsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "parts=" << to_string(parts); + out << ", " << "deleteData="; (__isset.deleteData ? (out << to_string(deleteData)) : (out << "")); + out << ", " << "ifExists="; (__isset.ifExists ? (out << to_string(ifExists)) : (out << "")); + out << ", " << "ignoreProtection="; (__isset.ignoreProtection ? (out << to_string(ignoreProtection)) : (out << "")); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ", " << "needResult="; (__isset.needResult ? (out << to_string(needResult)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ")"; +} + + +DropPartitionRequest::~DropPartitionRequest() noexcept { +} + +DropPartitionRequest::DropPartitionRequest() noexcept + : catName(), + dbName(), + tblName(), + partName(), + deleteData(0) { +} + +void DropPartitionRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void DropPartitionRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void DropPartitionRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void DropPartitionRequest::__set_partName(const std::string& val) { + this->partName = val; +__isset.partName = true; +} + +void DropPartitionRequest::__set_partVals(const std::vector & val) { + this->partVals = val; +__isset.partVals = true; +} + +void DropPartitionRequest::__set_deleteData(const bool val) { + this->deleteData = val; +__isset.deleteData = true; +} + +void DropPartitionRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} +std::ostream& operator<<(std::ostream& out, const DropPartitionRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropPartitionRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partName); + this->__isset.partName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partVals.clear(); + uint32_t _size753; + ::apache::thrift::protocol::TType _etype756; + xfer += iprot->readListBegin(_etype756, _size753); + this->partVals.resize(_size753); + uint32_t _i757; + for (_i757 = 0; _i757 < _size753; ++_i757) + { + xfer += iprot->readString(this->partVals[_i757]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropPartitionRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropPartitionRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partName) { + xfer += oprot->writeFieldBegin("partName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->partName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partVals) { + xfer += oprot->writeFieldBegin("partVals", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partVals.size())); + std::vector ::const_iterator _iter758; + for (_iter758 = this->partVals.begin(); _iter758 != this->partVals.end(); ++_iter758) + { + xfer += oprot->writeString((*_iter758)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.deleteData) { + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropPartitionRequest &a, DropPartitionRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partName, b.partName); + swap(a.partVals, b.partVals); + swap(a.deleteData, b.deleteData); + swap(a.environmentContext, b.environmentContext); + swap(a.__isset, b.__isset); +} + +bool DropPartitionRequest::operator==(const DropPartitionRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.partName != rhs.__isset.partName) + return false; + else if (__isset.partName && !(partName == rhs.partName)) + return false; + if (__isset.partVals != rhs.__isset.partVals) + return false; + else if (__isset.partVals && !(partVals == rhs.partVals)) + return false; + if (__isset.deleteData != rhs.__isset.deleteData) + return false; + else if (__isset.deleteData && !(deleteData == rhs.deleteData)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + return true; +} + +DropPartitionRequest::DropPartitionRequest(const DropPartitionRequest& other759) { + catName = other759.catName; + dbName = other759.dbName; + tblName = other759.tblName; + partName = other759.partName; + partVals = other759.partVals; + deleteData = other759.deleteData; + environmentContext = other759.environmentContext; + __isset = other759.__isset; +} +DropPartitionRequest& DropPartitionRequest::operator=(const DropPartitionRequest& other760) { + catName = other760.catName; + dbName = other760.dbName; + tblName = other760.tblName; + partName = other760.partName; + partVals = other760.partVals; + deleteData = other760.deleteData; + environmentContext = other760.environmentContext; + __isset = other760.__isset; + return *this; +} +void DropPartitionRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropPartitionRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partName="; (__isset.partName ? (out << to_string(partName)) : (out << "")); + out << ", " << "partVals="; (__isset.partVals ? (out << to_string(partVals)) : (out << "")); + out << ", " << "deleteData="; (__isset.deleteData ? (out << to_string(deleteData)) : (out << "")); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ")"; +} + + +PartitionValuesRequest::~PartitionValuesRequest() noexcept { +} + +PartitionValuesRequest::PartitionValuesRequest() noexcept + : dbName(), + tblName(), + applyDistinct(true), + filter(), + ascending(true), + maxParts(-1LL), + catName(), + validWriteIdList() { +} + +void PartitionValuesRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void PartitionValuesRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void PartitionValuesRequest::__set_partitionKeys(const std::vector & val) { + this->partitionKeys = val; +} + +void PartitionValuesRequest::__set_applyDistinct(const bool val) { + this->applyDistinct = val; +__isset.applyDistinct = true; +} + +void PartitionValuesRequest::__set_filter(const std::string& val) { + this->filter = val; +__isset.filter = true; +} + +void PartitionValuesRequest::__set_partitionOrder(const std::vector & val) { + this->partitionOrder = val; +__isset.partitionOrder = true; +} + +void PartitionValuesRequest::__set_ascending(const bool val) { + this->ascending = val; +__isset.ascending = true; +} + +void PartitionValuesRequest::__set_maxParts(const int64_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void PartitionValuesRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PartitionValuesRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionValuesRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionValuesRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_partitionKeys = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionKeys.clear(); + uint32_t _size761; + ::apache::thrift::protocol::TType _etype764; + xfer += iprot->readListBegin(_etype764, _size761); + this->partitionKeys.resize(_size761); + uint32_t _i765; + for (_i765 = 0; _i765 < _size761; ++_i765) + { + xfer += this->partitionKeys[_i765].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitionKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->applyDistinct); + this->__isset.applyDistinct = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionOrder.clear(); + uint32_t _size766; + ::apache::thrift::protocol::TType _etype769; + xfer += iprot->readListBegin(_etype769, _size766); + this->partitionOrder.resize(_size766); + uint32_t _i770; + for (_i770 = 0; _i770 < _size766; ++_i770) + { + xfer += this->partitionOrder[_i770].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionOrder = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ascending); + this->__isset.ascending = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partitionKeys) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionValuesRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionValuesRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partitionKeys", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionKeys.size())); + std::vector ::const_iterator _iter771; + for (_iter771 = this->partitionKeys.begin(); _iter771 != this->partitionKeys.end(); ++_iter771) + { + xfer += (*_iter771).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.applyDistinct) { + xfer += oprot->writeFieldBegin("applyDistinct", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->applyDistinct); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.filter) { + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionOrder) { + xfer += oprot->writeFieldBegin("partitionOrder", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionOrder.size())); + std::vector ::const_iterator _iter772; + for (_iter772 = this->partitionOrder.begin(); _iter772 != this->partitionOrder.end(); ++_iter772) + { + xfer += (*_iter772).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ascending) { + xfer += oprot->writeFieldBegin("ascending", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->ascending); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I64, 8); + xfer += oprot->writeI64(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionValuesRequest &a, PartitionValuesRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partitionKeys, b.partitionKeys); + swap(a.applyDistinct, b.applyDistinct); + swap(a.filter, b.filter); + swap(a.partitionOrder, b.partitionOrder); + swap(a.ascending, b.ascending); + swap(a.maxParts, b.maxParts); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.__isset, b.__isset); +} + +bool PartitionValuesRequest::operator==(const PartitionValuesRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(partitionKeys == rhs.partitionKeys)) + return false; + if (__isset.applyDistinct != rhs.__isset.applyDistinct) + return false; + else if (__isset.applyDistinct && !(applyDistinct == rhs.applyDistinct)) + return false; + if (__isset.filter != rhs.__isset.filter) + return false; + else if (__isset.filter && !(filter == rhs.filter)) + return false; + if (__isset.partitionOrder != rhs.__isset.partitionOrder) + return false; + else if (__isset.partitionOrder && !(partitionOrder == rhs.partitionOrder)) + return false; + if (__isset.ascending != rhs.__isset.ascending) + return false; + else if (__isset.ascending && !(ascending == rhs.ascending)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + return true; +} + +PartitionValuesRequest::PartitionValuesRequest(const PartitionValuesRequest& other773) { + dbName = other773.dbName; + tblName = other773.tblName; + partitionKeys = other773.partitionKeys; + applyDistinct = other773.applyDistinct; + filter = other773.filter; + partitionOrder = other773.partitionOrder; + ascending = other773.ascending; + maxParts = other773.maxParts; + catName = other773.catName; + validWriteIdList = other773.validWriteIdList; + __isset = other773.__isset; +} +PartitionValuesRequest& PartitionValuesRequest::operator=(const PartitionValuesRequest& other774) { + dbName = other774.dbName; + tblName = other774.tblName; + partitionKeys = other774.partitionKeys; + applyDistinct = other774.applyDistinct; + filter = other774.filter; + partitionOrder = other774.partitionOrder; + ascending = other774.ascending; + maxParts = other774.maxParts; + catName = other774.catName; + validWriteIdList = other774.validWriteIdList; + __isset = other774.__isset; + return *this; +} +void PartitionValuesRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionValuesRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partitionKeys=" << to_string(partitionKeys); + out << ", " << "applyDistinct="; (__isset.applyDistinct ? (out << to_string(applyDistinct)) : (out << "")); + out << ", " << "filter="; (__isset.filter ? (out << to_string(filter)) : (out << "")); + out << ", " << "partitionOrder="; (__isset.partitionOrder ? (out << to_string(partitionOrder)) : (out << "")); + out << ", " << "ascending="; (__isset.ascending ? (out << to_string(ascending)) : (out << "")); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ")"; +} + + +PartitionValuesRow::~PartitionValuesRow() noexcept { +} + +PartitionValuesRow::PartitionValuesRow() noexcept { +} + +void PartitionValuesRow::__set_row(const std::vector & val) { + this->row = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionValuesRow& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionValuesRow::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_row = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->row.clear(); + uint32_t _size775; + ::apache::thrift::protocol::TType _etype778; + xfer += iprot->readListBegin(_etype778, _size775); + this->row.resize(_size775); + uint32_t _i779; + for (_i779 = 0; _i779 < _size775; ++_i779) + { + xfer += iprot->readString(this->row[_i779]); + } + xfer += iprot->readListEnd(); + } + isset_row = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_row) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionValuesRow::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionValuesRow"); + + xfer += oprot->writeFieldBegin("row", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->row.size())); + std::vector ::const_iterator _iter780; + for (_iter780 = this->row.begin(); _iter780 != this->row.end(); ++_iter780) + { + xfer += oprot->writeString((*_iter780)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionValuesRow &a, PartitionValuesRow &b) noexcept { + using ::std::swap; + swap(a.row, b.row); +} + +bool PartitionValuesRow::operator==(const PartitionValuesRow & rhs) const +{ + if (!(row == rhs.row)) + return false; + return true; +} + +PartitionValuesRow::PartitionValuesRow(const PartitionValuesRow& other781) { + row = other781.row; +} +PartitionValuesRow& PartitionValuesRow::operator=(const PartitionValuesRow& other782) { + row = other782.row; + return *this; +} +void PartitionValuesRow::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionValuesRow("; + out << "row=" << to_string(row); + out << ")"; +} + + +PartitionValuesResponse::~PartitionValuesResponse() noexcept { +} + +PartitionValuesResponse::PartitionValuesResponse() noexcept { +} + +void PartitionValuesResponse::__set_partitionValues(const std::vector & val) { + this->partitionValues = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionValuesResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionValuesResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitionValues = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionValues.clear(); + uint32_t _size783; + ::apache::thrift::protocol::TType _etype786; + xfer += iprot->readListBegin(_etype786, _size783); + this->partitionValues.resize(_size783); + uint32_t _i787; + for (_i787 = 0; _i787 < _size783; ++_i787) + { + xfer += this->partitionValues[_i787].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitionValues = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitionValues) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionValuesResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionValuesResponse"); + + xfer += oprot->writeFieldBegin("partitionValues", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionValues.size())); + std::vector ::const_iterator _iter788; + for (_iter788 = this->partitionValues.begin(); _iter788 != this->partitionValues.end(); ++_iter788) + { + xfer += (*_iter788).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionValuesResponse &a, PartitionValuesResponse &b) noexcept { + using ::std::swap; + swap(a.partitionValues, b.partitionValues); +} + +bool PartitionValuesResponse::operator==(const PartitionValuesResponse & rhs) const +{ + if (!(partitionValues == rhs.partitionValues)) + return false; + return true; +} + +PartitionValuesResponse::PartitionValuesResponse(const PartitionValuesResponse& other789) { + partitionValues = other789.partitionValues; +} +PartitionValuesResponse& PartitionValuesResponse::operator=(const PartitionValuesResponse& other790) { + partitionValues = other790.partitionValues; + return *this; +} +void PartitionValuesResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionValuesResponse("; + out << "partitionValues=" << to_string(partitionValues); + out << ")"; +} + + +GetPartitionsByNamesRequest::~GetPartitionsByNamesRequest() noexcept { +} + +GetPartitionsByNamesRequest::GetPartitionsByNamesRequest() : db_name(), + tbl_name(), + get_col_stats(0), + processorIdentifier(), + engine("hive"), + validWriteIdList(), + getFileMetadata(0), + id(-1LL), + skipColumnSchemaForPartition(0), + includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void GetPartitionsByNamesRequest::__set_db_name(const std::string& val) { + this->db_name = val; +} + +void GetPartitionsByNamesRequest::__set_tbl_name(const std::string& val) { + this->tbl_name = val; +} + +void GetPartitionsByNamesRequest::__set_names(const std::vector & val) { + this->names = val; +__isset.names = true; +} + +void GetPartitionsByNamesRequest::__set_get_col_stats(const bool val) { + this->get_col_stats = val; +__isset.get_col_stats = true; +} + +void GetPartitionsByNamesRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetPartitionsByNamesRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} + +void GetPartitionsByNamesRequest::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} + +void GetPartitionsByNamesRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetPartitionsByNamesRequest::__set_getFileMetadata(const bool val) { + this->getFileMetadata = val; +__isset.getFileMetadata = true; +} + +void GetPartitionsByNamesRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void GetPartitionsByNamesRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void GetPartitionsByNamesRequest::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +__isset.includeParamKeyPattern = true; +} + +void GetPartitionsByNamesRequest::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +__isset.excludeParamKeyPattern = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsByNamesRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsByNamesRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_db_name = false; + bool isset_tbl_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db_name); + isset_db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + isset_tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->names.clear(); + uint32_t _size791; + ::apache::thrift::protocol::TType _etype794; + xfer += iprot->readListBegin(_etype794, _size791); + this->names.resize(_size791); + uint32_t _i795; + for (_i795 = 0; _i795 < _size791; ++_i795) + { + xfer += iprot->readString(this->names[_i795]); + } + xfer += iprot->readListEnd(); + } + this->__isset.names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->get_col_stats); + this->__isset.get_col_stats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size796; + ::apache::thrift::protocol::TType _etype799; + xfer += iprot->readListBegin(_etype799, _size796); + this->processorCapabilities.resize(_size796); + uint32_t _i800; + for (_i800 = 0; _i800 < _size796; ++_i800) + { + xfer += iprot->readString(this->processorCapabilities[_i800]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->getFileMetadata); + this->__isset.getFileMetadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_db_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tbl_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionsByNamesRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsByNamesRequest"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.names) { + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->names.size())); + std::vector ::const_iterator _iter801; + for (_iter801 = this->names.begin(); _iter801 != this->names.end(); ++_iter801) + { + xfer += oprot->writeString((*_iter801)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.get_col_stats) { + xfer += oprot->writeFieldBegin("get_col_stats", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->get_col_stats); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter802; + for (_iter802 = this->processorCapabilities.begin(); _iter802 != this->processorCapabilities.end(); ++_iter802) + { + xfer += oprot->writeString((*_iter802)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.getFileMetadata) { + xfer += oprot->writeFieldBegin("getFileMetadata", ::apache::thrift::protocol::T_BOOL, 9); + xfer += oprot->writeBool(this->getFileMetadata); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 10); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 11); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeParamKeyPattern) { + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.excludeParamKeyPattern) { + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 13); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsByNamesRequest &a, GetPartitionsByNamesRequest &b) noexcept { + using ::std::swap; + swap(a.db_name, b.db_name); + swap(a.tbl_name, b.tbl_name); + swap(a.names, b.names); + swap(a.get_col_stats, b.get_col_stats); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.engine, b.engine); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.getFileMetadata, b.getFileMetadata); + swap(a.id, b.id); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsByNamesRequest::operator==(const GetPartitionsByNamesRequest & rhs) const +{ + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (__isset.names != rhs.__isset.names) + return false; + else if (__isset.names && !(names == rhs.names)) + return false; + if (__isset.get_col_stats != rhs.__isset.get_col_stats) + return false; + else if (__isset.get_col_stats && !(get_col_stats == rhs.get_col_stats)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.getFileMetadata != rhs.__isset.getFileMetadata) + return false; + else if (__isset.getFileMetadata && !(getFileMetadata == rhs.getFileMetadata)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.includeParamKeyPattern != rhs.__isset.includeParamKeyPattern) + return false; + else if (__isset.includeParamKeyPattern && !(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (__isset.excludeParamKeyPattern != rhs.__isset.excludeParamKeyPattern) + return false; + else if (__isset.excludeParamKeyPattern && !(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + return true; +} + +GetPartitionsByNamesRequest::GetPartitionsByNamesRequest(const GetPartitionsByNamesRequest& other803) { + db_name = other803.db_name; + tbl_name = other803.tbl_name; + names = other803.names; + get_col_stats = other803.get_col_stats; + processorCapabilities = other803.processorCapabilities; + processorIdentifier = other803.processorIdentifier; + engine = other803.engine; + validWriteIdList = other803.validWriteIdList; + getFileMetadata = other803.getFileMetadata; + id = other803.id; + skipColumnSchemaForPartition = other803.skipColumnSchemaForPartition; + includeParamKeyPattern = other803.includeParamKeyPattern; + excludeParamKeyPattern = other803.excludeParamKeyPattern; + __isset = other803.__isset; +} +GetPartitionsByNamesRequest& GetPartitionsByNamesRequest::operator=(const GetPartitionsByNamesRequest& other804) { + db_name = other804.db_name; + tbl_name = other804.tbl_name; + names = other804.names; + get_col_stats = other804.get_col_stats; + processorCapabilities = other804.processorCapabilities; + processorIdentifier = other804.processorIdentifier; + engine = other804.engine; + validWriteIdList = other804.validWriteIdList; + getFileMetadata = other804.getFileMetadata; + id = other804.id; + skipColumnSchemaForPartition = other804.skipColumnSchemaForPartition; + includeParamKeyPattern = other804.includeParamKeyPattern; + excludeParamKeyPattern = other804.excludeParamKeyPattern; + __isset = other804.__isset; + return *this; +} +void GetPartitionsByNamesRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsByNamesRequest("; + out << "db_name=" << to_string(db_name); + out << ", " << "tbl_name=" << to_string(tbl_name); + out << ", " << "names="; (__isset.names ? (out << to_string(names)) : (out << "")); + out << ", " << "get_col_stats="; (__isset.get_col_stats ? (out << to_string(get_col_stats)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "getFileMetadata="; (__isset.getFileMetadata ? (out << to_string(getFileMetadata)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "includeParamKeyPattern="; (__isset.includeParamKeyPattern ? (out << to_string(includeParamKeyPattern)) : (out << "")); + out << ", " << "excludeParamKeyPattern="; (__isset.excludeParamKeyPattern ? (out << to_string(excludeParamKeyPattern)) : (out << "")); + out << ")"; +} + + +GetPartitionsByNamesResult::~GetPartitionsByNamesResult() noexcept { +} + +GetPartitionsByNamesResult::GetPartitionsByNamesResult() noexcept { +} + +void GetPartitionsByNamesResult::__set_partitions(const std::vector & val) { + this->partitions = val; +} + +void GetPartitionsByNamesResult::__set_dictionary(const ObjectDictionary& val) { + this->dictionary = val; +__isset.dictionary = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsByNamesResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsByNamesResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size805; + ::apache::thrift::protocol::TType _etype808; + xfer += iprot->readListBegin(_etype808, _size805); + this->partitions.resize(_size805); + uint32_t _i809; + for (_i809 = 0; _i809 < _size805; ++_i809) + { + xfer += this->partitions[_i809].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->dictionary.read(iprot); + this->__isset.dictionary = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionsByNamesResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsByNamesResult"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter810; + for (_iter810 = this->partitions.begin(); _iter810 != this->partitions.end(); ++_iter810) + { + xfer += (*_iter810).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dictionary) { + xfer += oprot->writeFieldBegin("dictionary", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->dictionary.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsByNamesResult &a, GetPartitionsByNamesResult &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); + swap(a.dictionary, b.dictionary); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsByNamesResult::operator==(const GetPartitionsByNamesResult & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + if (__isset.dictionary != rhs.__isset.dictionary) + return false; + else if (__isset.dictionary && !(dictionary == rhs.dictionary)) + return false; + return true; +} + +GetPartitionsByNamesResult::GetPartitionsByNamesResult(const GetPartitionsByNamesResult& other811) { + partitions = other811.partitions; + dictionary = other811.dictionary; + __isset = other811.__isset; +} +GetPartitionsByNamesResult& GetPartitionsByNamesResult::operator=(const GetPartitionsByNamesResult& other812) { + partitions = other812.partitions; + dictionary = other812.dictionary; + __isset = other812.__isset; + return *this; +} +void GetPartitionsByNamesResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsByNamesResult("; + out << "partitions=" << to_string(partitions); + out << ", " << "dictionary="; (__isset.dictionary ? (out << to_string(dictionary)) : (out << "")); + out << ")"; +} + + +DataConnector::~DataConnector() noexcept { +} + +DataConnector::DataConnector() noexcept + : name(), + type(), + url(), + description(), + ownerName(), + ownerType(static_cast(0)), + createTime(0) { +} + +void DataConnector::__set_name(const std::string& val) { + this->name = val; +} + +void DataConnector::__set_type(const std::string& val) { + this->type = val; +} + +void DataConnector::__set_url(const std::string& val) { + this->url = val; +} + +void DataConnector::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} + +void DataConnector::__set_parameters(const std::map & val) { + this->parameters = val; +__isset.parameters = true; +} + +void DataConnector::__set_ownerName(const std::string& val) { + this->ownerName = val; +__isset.ownerName = true; +} + +void DataConnector::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +__isset.ownerType = true; +} + +void DataConnector::__set_createTime(const int32_t val) { + this->createTime = val; +__isset.createTime = true; +} +std::ostream& operator<<(std::ostream& out, const DataConnector& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DataConnector::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->url); + this->__isset.url = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size813; + ::apache::thrift::protocol::TType _ktype814; + ::apache::thrift::protocol::TType _vtype815; + xfer += iprot->readMapBegin(_ktype814, _vtype815, _size813); + uint32_t _i817; + for (_i817 = 0; _i817 < _size813; ++_i817) + { + std::string _key818; + xfer += iprot->readString(_key818); + std::string& _val819 = this->parameters[_key818]; + xfer += iprot->readString(_val819); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast820; + xfer += iprot->readI32(ecast820); + this->ownerType = static_cast(ecast820); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t DataConnector::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DataConnector"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->type); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("url", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->url); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.parameters) { + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 5); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter821; + for (_iter821 = this->parameters.begin(); _iter821 != this->parameters.end(); ++_iter821) + { + xfer += oprot->writeString(_iter821->first); + xfer += oprot->writeString(_iter821->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerName) { + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerType) { + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.createTime) { + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 8); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DataConnector &a, DataConnector &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.type, b.type); + swap(a.url, b.url); + swap(a.description, b.description); + swap(a.parameters, b.parameters); + swap(a.ownerName, b.ownerName); + swap(a.ownerType, b.ownerType); + swap(a.createTime, b.createTime); + swap(a.__isset, b.__isset); +} + +bool DataConnector::operator==(const DataConnector & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(type == rhs.type)) + return false; + if (!(url == rhs.url)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + if (__isset.parameters != rhs.__isset.parameters) + return false; + else if (__isset.parameters && !(parameters == rhs.parameters)) + return false; + if (__isset.ownerName != rhs.__isset.ownerName) + return false; + else if (__isset.ownerName && !(ownerName == rhs.ownerName)) + return false; + if (__isset.ownerType != rhs.__isset.ownerType) + return false; + else if (__isset.ownerType && !(ownerType == rhs.ownerType)) + return false; + if (__isset.createTime != rhs.__isset.createTime) + return false; + else if (__isset.createTime && !(createTime == rhs.createTime)) + return false; + return true; +} + +DataConnector::DataConnector(const DataConnector& other822) { + name = other822.name; + type = other822.type; + url = other822.url; + description = other822.description; + parameters = other822.parameters; + ownerName = other822.ownerName; + ownerType = other822.ownerType; + createTime = other822.createTime; + __isset = other822.__isset; +} +DataConnector& DataConnector::operator=(const DataConnector& other823) { + name = other823.name; + type = other823.type; + url = other823.url; + description = other823.description; + parameters = other823.parameters; + ownerName = other823.ownerName; + ownerType = other823.ownerType; + createTime = other823.createTime; + __isset = other823.__isset; + return *this; +} +void DataConnector::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DataConnector("; + out << "name=" << to_string(name); + out << ", " << "type=" << to_string(type); + out << ", " << "url=" << to_string(url); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ", " << "parameters="; (__isset.parameters ? (out << to_string(parameters)) : (out << "")); + out << ", " << "ownerName="; (__isset.ownerName ? (out << to_string(ownerName)) : (out << "")); + out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ", " << "createTime="; (__isset.createTime ? (out << to_string(createTime)) : (out << "")); + out << ")"; +} + + +ResourceUri::~ResourceUri() noexcept { +} + +ResourceUri::ResourceUri() noexcept + : resourceType(static_cast(0)), + uri() { +} + +void ResourceUri::__set_resourceType(const ResourceType::type val) { + this->resourceType = val; +} + +void ResourceUri::__set_uri(const std::string& val) { + this->uri = val; +} +std::ostream& operator<<(std::ostream& out, const ResourceUri& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ResourceUri::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast824; + xfer += iprot->readI32(ecast824); + this->resourceType = static_cast(ecast824); + this->__isset.resourceType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->uri); + this->__isset.uri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ResourceUri::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ResourceUri"); + + xfer += oprot->writeFieldBegin("resourceType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->resourceType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("uri", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->uri); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ResourceUri &a, ResourceUri &b) noexcept { + using ::std::swap; + swap(a.resourceType, b.resourceType); + swap(a.uri, b.uri); + swap(a.__isset, b.__isset); +} + +bool ResourceUri::operator==(const ResourceUri & rhs) const +{ + if (!(resourceType == rhs.resourceType)) + return false; + if (!(uri == rhs.uri)) + return false; + return true; +} + +ResourceUri::ResourceUri(const ResourceUri& other825) { + resourceType = other825.resourceType; + uri = other825.uri; + __isset = other825.__isset; +} +ResourceUri& ResourceUri::operator=(const ResourceUri& other826) { + resourceType = other826.resourceType; + uri = other826.uri; + __isset = other826.__isset; + return *this; +} +void ResourceUri::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ResourceUri("; + out << "resourceType=" << to_string(resourceType); + out << ", " << "uri=" << to_string(uri); + out << ")"; +} + + +Function::~Function() noexcept { +} + +Function::Function() noexcept + : functionName(), + dbName(), + className(), + ownerName(), + ownerType(static_cast(0)), + createTime(0), + functionType(static_cast(0)), + catName() { +} + +void Function::__set_functionName(const std::string& val) { + this->functionName = val; +} + +void Function::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void Function::__set_className(const std::string& val) { + this->className = val; +} + +void Function::__set_ownerName(const std::string& val) { + this->ownerName = val; +} + +void Function::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +} + +void Function::__set_createTime(const int32_t val) { + this->createTime = val; +} + +void Function::__set_functionType(const FunctionType::type val) { + this->functionType = val; +} + +void Function::__set_resourceUris(const std::vector & val) { + this->resourceUris = val; +} + +void Function::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const Function& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Function::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->functionName); + this->__isset.functionName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->className); + this->__isset.className = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast827; + xfer += iprot->readI32(ecast827); + this->ownerType = static_cast(ecast827); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast828; + xfer += iprot->readI32(ecast828); + this->functionType = static_cast(ecast828); + this->__isset.functionType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->resourceUris.clear(); + uint32_t _size829; + ::apache::thrift::protocol::TType _etype832; + xfer += iprot->readListBegin(_etype832, _size829); + this->resourceUris.resize(_size829); + uint32_t _i833; + for (_i833 = 0; _i833 < _size829; ++_i833) + { + xfer += this->resourceUris[_i833].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.resourceUris = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Function::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Function"); + + xfer += oprot->writeFieldBegin("functionName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->functionName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("className", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->className); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("functionType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->functionType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("resourceUris", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->resourceUris.size())); + std::vector ::const_iterator _iter834; + for (_iter834 = this->resourceUris.begin(); _iter834 != this->resourceUris.end(); ++_iter834) + { + xfer += (*_iter834).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Function &a, Function &b) noexcept { + using ::std::swap; + swap(a.functionName, b.functionName); + swap(a.dbName, b.dbName); + swap(a.className, b.className); + swap(a.ownerName, b.ownerName); + swap(a.ownerType, b.ownerType); + swap(a.createTime, b.createTime); + swap(a.functionType, b.functionType); + swap(a.resourceUris, b.resourceUris); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool Function::operator==(const Function & rhs) const +{ + if (!(functionName == rhs.functionName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(className == rhs.className)) + return false; + if (!(ownerName == rhs.ownerName)) + return false; + if (!(ownerType == rhs.ownerType)) + return false; + if (!(createTime == rhs.createTime)) + return false; + if (!(functionType == rhs.functionType)) + return false; + if (!(resourceUris == rhs.resourceUris)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +Function::Function(const Function& other835) { + functionName = other835.functionName; + dbName = other835.dbName; + className = other835.className; + ownerName = other835.ownerName; + ownerType = other835.ownerType; + createTime = other835.createTime; + functionType = other835.functionType; + resourceUris = other835.resourceUris; + catName = other835.catName; + __isset = other835.__isset; +} +Function& Function::operator=(const Function& other836) { + functionName = other836.functionName; + dbName = other836.dbName; + className = other836.className; + ownerName = other836.ownerName; + ownerType = other836.ownerType; + createTime = other836.createTime; + functionType = other836.functionType; + resourceUris = other836.resourceUris; + catName = other836.catName; + __isset = other836.__isset; + return *this; +} +void Function::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Function("; + out << "functionName=" << to_string(functionName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "className=" << to_string(className); + out << ", " << "ownerName=" << to_string(ownerName); + out << ", " << "ownerType=" << to_string(ownerType); + out << ", " << "createTime=" << to_string(createTime); + out << ", " << "functionType=" << to_string(functionType); + out << ", " << "resourceUris=" << to_string(resourceUris); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +TxnInfo::~TxnInfo() noexcept { +} + +TxnInfo::TxnInfo() : id(0), + state(static_cast(0)), + user(), + hostname(), + agentInfo("Unknown"), + heartbeatCount(0), + metaInfo(), + startedTime(0), + lastHeartbeatTime(0) { +} + +void TxnInfo::__set_id(const int64_t val) { + this->id = val; +} + +void TxnInfo::__set_state(const TxnState::type val) { + this->state = val; +} + +void TxnInfo::__set_user(const std::string& val) { + this->user = val; +} + +void TxnInfo::__set_hostname(const std::string& val) { + this->hostname = val; +} + +void TxnInfo::__set_agentInfo(const std::string& val) { + this->agentInfo = val; +__isset.agentInfo = true; +} + +void TxnInfo::__set_heartbeatCount(const int32_t val) { + this->heartbeatCount = val; +__isset.heartbeatCount = true; +} + +void TxnInfo::__set_metaInfo(const std::string& val) { + this->metaInfo = val; +__isset.metaInfo = true; +} + +void TxnInfo::__set_startedTime(const int64_t val) { + this->startedTime = val; +__isset.startedTime = true; +} + +void TxnInfo::__set_lastHeartbeatTime(const int64_t val) { + this->lastHeartbeatTime = val; +__isset.lastHeartbeatTime = true; +} +std::ostream& operator<<(std::ostream& out, const TxnInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TxnInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_id = false; + bool isset_state = false; + bool isset_user = false; + bool isset_hostname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + isset_id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast837; + xfer += iprot->readI32(ecast837); + this->state = static_cast(ecast837); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + isset_user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hostname); + isset_hostname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->agentInfo); + this->__isset.agentInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->heartbeatCount); + this->__isset.heartbeatCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->metaInfo); + this->__isset.metaInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->startedTime); + this->__isset.startedTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastHeartbeatTime); + this->__isset.lastHeartbeatTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_id) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_user) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hostname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TxnInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TxnInfo"); + + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hostname", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->hostname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.agentInfo) { + xfer += oprot->writeFieldBegin("agentInfo", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->agentInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.heartbeatCount) { + xfer += oprot->writeFieldBegin("heartbeatCount", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(this->heartbeatCount); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.metaInfo) { + xfer += oprot->writeFieldBegin("metaInfo", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->metaInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.startedTime) { + xfer += oprot->writeFieldBegin("startedTime", ::apache::thrift::protocol::T_I64, 8); + xfer += oprot->writeI64(this->startedTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.lastHeartbeatTime) { + xfer += oprot->writeFieldBegin("lastHeartbeatTime", ::apache::thrift::protocol::T_I64, 9); + xfer += oprot->writeI64(this->lastHeartbeatTime); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TxnInfo &a, TxnInfo &b) noexcept { + using ::std::swap; + swap(a.id, b.id); + swap(a.state, b.state); + swap(a.user, b.user); + swap(a.hostname, b.hostname); + swap(a.agentInfo, b.agentInfo); + swap(a.heartbeatCount, b.heartbeatCount); + swap(a.metaInfo, b.metaInfo); + swap(a.startedTime, b.startedTime); + swap(a.lastHeartbeatTime, b.lastHeartbeatTime); + swap(a.__isset, b.__isset); +} + +bool TxnInfo::operator==(const TxnInfo & rhs) const +{ + if (!(id == rhs.id)) + return false; + if (!(state == rhs.state)) + return false; + if (!(user == rhs.user)) + return false; + if (!(hostname == rhs.hostname)) + return false; + if (__isset.agentInfo != rhs.__isset.agentInfo) + return false; + else if (__isset.agentInfo && !(agentInfo == rhs.agentInfo)) + return false; + if (__isset.heartbeatCount != rhs.__isset.heartbeatCount) + return false; + else if (__isset.heartbeatCount && !(heartbeatCount == rhs.heartbeatCount)) + return false; + if (__isset.metaInfo != rhs.__isset.metaInfo) + return false; + else if (__isset.metaInfo && !(metaInfo == rhs.metaInfo)) + return false; + if (__isset.startedTime != rhs.__isset.startedTime) + return false; + else if (__isset.startedTime && !(startedTime == rhs.startedTime)) + return false; + if (__isset.lastHeartbeatTime != rhs.__isset.lastHeartbeatTime) + return false; + else if (__isset.lastHeartbeatTime && !(lastHeartbeatTime == rhs.lastHeartbeatTime)) + return false; + return true; +} + +TxnInfo::TxnInfo(const TxnInfo& other838) { + id = other838.id; + state = other838.state; + user = other838.user; + hostname = other838.hostname; + agentInfo = other838.agentInfo; + heartbeatCount = other838.heartbeatCount; + metaInfo = other838.metaInfo; + startedTime = other838.startedTime; + lastHeartbeatTime = other838.lastHeartbeatTime; + __isset = other838.__isset; +} +TxnInfo& TxnInfo::operator=(const TxnInfo& other839) { + id = other839.id; + state = other839.state; + user = other839.user; + hostname = other839.hostname; + agentInfo = other839.agentInfo; + heartbeatCount = other839.heartbeatCount; + metaInfo = other839.metaInfo; + startedTime = other839.startedTime; + lastHeartbeatTime = other839.lastHeartbeatTime; + __isset = other839.__isset; + return *this; +} +void TxnInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TxnInfo("; + out << "id=" << to_string(id); + out << ", " << "state=" << to_string(state); + out << ", " << "user=" << to_string(user); + out << ", " << "hostname=" << to_string(hostname); + out << ", " << "agentInfo="; (__isset.agentInfo ? (out << to_string(agentInfo)) : (out << "")); + out << ", " << "heartbeatCount="; (__isset.heartbeatCount ? (out << to_string(heartbeatCount)) : (out << "")); + out << ", " << "metaInfo="; (__isset.metaInfo ? (out << to_string(metaInfo)) : (out << "")); + out << ", " << "startedTime="; (__isset.startedTime ? (out << to_string(startedTime)) : (out << "")); + out << ", " << "lastHeartbeatTime="; (__isset.lastHeartbeatTime ? (out << to_string(lastHeartbeatTime)) : (out << "")); + out << ")"; +} + + +GetOpenTxnsInfoResponse::~GetOpenTxnsInfoResponse() noexcept { +} + +GetOpenTxnsInfoResponse::GetOpenTxnsInfoResponse() noexcept + : txn_high_water_mark(0) { +} + +void GetOpenTxnsInfoResponse::__set_txn_high_water_mark(const int64_t val) { + this->txn_high_water_mark = val; +} + +void GetOpenTxnsInfoResponse::__set_open_txns(const std::vector & val) { + this->open_txns = val; +} +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsInfoResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetOpenTxnsInfoResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txn_high_water_mark = false; + bool isset_open_txns = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txn_high_water_mark); + isset_txn_high_water_mark = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->open_txns.clear(); + uint32_t _size840; + ::apache::thrift::protocol::TType _etype843; + xfer += iprot->readListBegin(_etype843, _size840); + this->open_txns.resize(_size840); + uint32_t _i844; + for (_i844 = 0; _i844 < _size840; ++_i844) + { + xfer += this->open_txns[_i844].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_open_txns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txn_high_water_mark) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_open_txns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetOpenTxnsInfoResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetOpenTxnsInfoResponse"); + + xfer += oprot->writeFieldBegin("txn_high_water_mark", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txn_high_water_mark); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("open_txns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->open_txns.size())); + std::vector ::const_iterator _iter845; + for (_iter845 = this->open_txns.begin(); _iter845 != this->open_txns.end(); ++_iter845) + { + xfer += (*_iter845).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetOpenTxnsInfoResponse &a, GetOpenTxnsInfoResponse &b) noexcept { + using ::std::swap; + swap(a.txn_high_water_mark, b.txn_high_water_mark); + swap(a.open_txns, b.open_txns); +} + +bool GetOpenTxnsInfoResponse::operator==(const GetOpenTxnsInfoResponse & rhs) const +{ + if (!(txn_high_water_mark == rhs.txn_high_water_mark)) + return false; + if (!(open_txns == rhs.open_txns)) + return false; + return true; +} + +GetOpenTxnsInfoResponse::GetOpenTxnsInfoResponse(const GetOpenTxnsInfoResponse& other846) { + txn_high_water_mark = other846.txn_high_water_mark; + open_txns = other846.open_txns; +} +GetOpenTxnsInfoResponse& GetOpenTxnsInfoResponse::operator=(const GetOpenTxnsInfoResponse& other847) { + txn_high_water_mark = other847.txn_high_water_mark; + open_txns = other847.open_txns; + return *this; +} +void GetOpenTxnsInfoResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetOpenTxnsInfoResponse("; + out << "txn_high_water_mark=" << to_string(txn_high_water_mark); + out << ", " << "open_txns=" << to_string(open_txns); + out << ")"; +} + + +GetOpenTxnsResponse::~GetOpenTxnsResponse() noexcept { +} + +GetOpenTxnsResponse::GetOpenTxnsResponse() noexcept + : txn_high_water_mark(0), + min_open_txn(0), + abortedBits() { +} + +void GetOpenTxnsResponse::__set_txn_high_water_mark(const int64_t val) { + this->txn_high_water_mark = val; +} + +void GetOpenTxnsResponse::__set_open_txns(const std::vector & val) { + this->open_txns = val; +} + +void GetOpenTxnsResponse::__set_min_open_txn(const int64_t val) { + this->min_open_txn = val; +__isset.min_open_txn = true; +} + +void GetOpenTxnsResponse::__set_abortedBits(const std::string& val) { + this->abortedBits = val; +} +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetOpenTxnsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txn_high_water_mark = false; + bool isset_open_txns = false; + bool isset_abortedBits = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txn_high_water_mark); + isset_txn_high_water_mark = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->open_txns.clear(); + uint32_t _size848; + ::apache::thrift::protocol::TType _etype851; + xfer += iprot->readListBegin(_etype851, _size848); + this->open_txns.resize(_size848); + uint32_t _i852; + for (_i852 = 0; _i852 < _size848; ++_i852) + { + xfer += iprot->readI64(this->open_txns[_i852]); + } + xfer += iprot->readListEnd(); + } + isset_open_txns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->min_open_txn); + this->__isset.min_open_txn = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->abortedBits); + isset_abortedBits = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txn_high_water_mark) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_open_txns) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_abortedBits) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetOpenTxnsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetOpenTxnsResponse"); + + xfer += oprot->writeFieldBegin("txn_high_water_mark", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txn_high_water_mark); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("open_txns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->open_txns.size())); + std::vector ::const_iterator _iter853; + for (_iter853 = this->open_txns.begin(); _iter853 != this->open_txns.end(); ++_iter853) + { + xfer += oprot->writeI64((*_iter853)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.min_open_txn) { + xfer += oprot->writeFieldBegin("min_open_txn", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->min_open_txn); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("abortedBits", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->abortedBits); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetOpenTxnsResponse &a, GetOpenTxnsResponse &b) noexcept { + using ::std::swap; + swap(a.txn_high_water_mark, b.txn_high_water_mark); + swap(a.open_txns, b.open_txns); + swap(a.min_open_txn, b.min_open_txn); + swap(a.abortedBits, b.abortedBits); + swap(a.__isset, b.__isset); +} + +bool GetOpenTxnsResponse::operator==(const GetOpenTxnsResponse & rhs) const +{ + if (!(txn_high_water_mark == rhs.txn_high_water_mark)) + return false; + if (!(open_txns == rhs.open_txns)) + return false; + if (__isset.min_open_txn != rhs.__isset.min_open_txn) + return false; + else if (__isset.min_open_txn && !(min_open_txn == rhs.min_open_txn)) + return false; + if (!(abortedBits == rhs.abortedBits)) + return false; + return true; +} + +GetOpenTxnsResponse::GetOpenTxnsResponse(const GetOpenTxnsResponse& other854) { + txn_high_water_mark = other854.txn_high_water_mark; + open_txns = other854.open_txns; + min_open_txn = other854.min_open_txn; + abortedBits = other854.abortedBits; + __isset = other854.__isset; +} +GetOpenTxnsResponse& GetOpenTxnsResponse::operator=(const GetOpenTxnsResponse& other855) { + txn_high_water_mark = other855.txn_high_water_mark; + open_txns = other855.open_txns; + min_open_txn = other855.min_open_txn; + abortedBits = other855.abortedBits; + __isset = other855.__isset; + return *this; +} +void GetOpenTxnsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetOpenTxnsResponse("; + out << "txn_high_water_mark=" << to_string(txn_high_water_mark); + out << ", " << "open_txns=" << to_string(open_txns); + out << ", " << "min_open_txn="; (__isset.min_open_txn ? (out << to_string(min_open_txn)) : (out << "")); + out << ", " << "abortedBits=" << to_string(abortedBits); + out << ")"; +} + + +OpenTxnRequest::~OpenTxnRequest() noexcept { +} + +OpenTxnRequest::OpenTxnRequest() : num_txns(0), + user(), + hostname(), + agentInfo("Unknown"), + replPolicy(), + txn_type(static_cast(0)) { +} + +void OpenTxnRequest::__set_num_txns(const int32_t val) { + this->num_txns = val; +} + +void OpenTxnRequest::__set_user(const std::string& val) { + this->user = val; +} + +void OpenTxnRequest::__set_hostname(const std::string& val) { + this->hostname = val; +} + +void OpenTxnRequest::__set_agentInfo(const std::string& val) { + this->agentInfo = val; +__isset.agentInfo = true; +} + +void OpenTxnRequest::__set_replPolicy(const std::string& val) { + this->replPolicy = val; +__isset.replPolicy = true; +} + +void OpenTxnRequest::__set_replSrcTxnIds(const std::vector & val) { + this->replSrcTxnIds = val; +__isset.replSrcTxnIds = true; +} + +void OpenTxnRequest::__set_txn_type(const TxnType::type val) { + this->txn_type = val; +__isset.txn_type = true; +} +std::ostream& operator<<(std::ostream& out, const OpenTxnRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t OpenTxnRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_num_txns = false; + bool isset_user = false; + bool isset_hostname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num_txns); + isset_num_txns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + isset_user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hostname); + isset_hostname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->agentInfo); + this->__isset.agentInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->replPolicy); + this->__isset.replPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->replSrcTxnIds.clear(); + uint32_t _size856; + ::apache::thrift::protocol::TType _etype859; + xfer += iprot->readListBegin(_etype859, _size856); + this->replSrcTxnIds.resize(_size856); + uint32_t _i860; + for (_i860 = 0; _i860 < _size856; ++_i860) + { + xfer += iprot->readI64(this->replSrcTxnIds[_i860]); + } + xfer += iprot->readListEnd(); + } + this->__isset.replSrcTxnIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast861; + xfer += iprot->readI32(ecast861); + this->txn_type = static_cast(ecast861); + this->__isset.txn_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_num_txns) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_user) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hostname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t OpenTxnRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("OpenTxnRequest"); + + xfer += oprot->writeFieldBegin("num_txns", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->num_txns); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hostname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->hostname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.agentInfo) { + xfer += oprot->writeFieldBegin("agentInfo", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->agentInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replPolicy) { + xfer += oprot->writeFieldBegin("replPolicy", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->replPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replSrcTxnIds) { + xfer += oprot->writeFieldBegin("replSrcTxnIds", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->replSrcTxnIds.size())); + std::vector ::const_iterator _iter862; + for (_iter862 = this->replSrcTxnIds.begin(); _iter862 != this->replSrcTxnIds.end(); ++_iter862) + { + xfer += oprot->writeI64((*_iter862)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txn_type) { + xfer += oprot->writeFieldBegin("txn_type", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->txn_type)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(OpenTxnRequest &a, OpenTxnRequest &b) noexcept { + using ::std::swap; + swap(a.num_txns, b.num_txns); + swap(a.user, b.user); + swap(a.hostname, b.hostname); + swap(a.agentInfo, b.agentInfo); + swap(a.replPolicy, b.replPolicy); + swap(a.replSrcTxnIds, b.replSrcTxnIds); + swap(a.txn_type, b.txn_type); + swap(a.__isset, b.__isset); +} + +bool OpenTxnRequest::operator==(const OpenTxnRequest & rhs) const +{ + if (!(num_txns == rhs.num_txns)) + return false; + if (!(user == rhs.user)) + return false; + if (!(hostname == rhs.hostname)) + return false; + if (__isset.agentInfo != rhs.__isset.agentInfo) + return false; + else if (__isset.agentInfo && !(agentInfo == rhs.agentInfo)) + return false; + if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; + else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; + if (__isset.replSrcTxnIds != rhs.__isset.replSrcTxnIds) + return false; + else if (__isset.replSrcTxnIds && !(replSrcTxnIds == rhs.replSrcTxnIds)) + return false; + if (__isset.txn_type != rhs.__isset.txn_type) + return false; + else if (__isset.txn_type && !(txn_type == rhs.txn_type)) + return false; + return true; +} + +OpenTxnRequest::OpenTxnRequest(const OpenTxnRequest& other863) { + num_txns = other863.num_txns; + user = other863.user; + hostname = other863.hostname; + agentInfo = other863.agentInfo; + replPolicy = other863.replPolicy; + replSrcTxnIds = other863.replSrcTxnIds; + txn_type = other863.txn_type; + __isset = other863.__isset; +} +OpenTxnRequest& OpenTxnRequest::operator=(const OpenTxnRequest& other864) { + num_txns = other864.num_txns; + user = other864.user; + hostname = other864.hostname; + agentInfo = other864.agentInfo; + replPolicy = other864.replPolicy; + replSrcTxnIds = other864.replSrcTxnIds; + txn_type = other864.txn_type; + __isset = other864.__isset; + return *this; +} +void OpenTxnRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "OpenTxnRequest("; + out << "num_txns=" << to_string(num_txns); + out << ", " << "user=" << to_string(user); + out << ", " << "hostname=" << to_string(hostname); + out << ", " << "agentInfo="; (__isset.agentInfo ? (out << to_string(agentInfo)) : (out << "")); + out << ", " << "replPolicy="; (__isset.replPolicy ? (out << to_string(replPolicy)) : (out << "")); + out << ", " << "replSrcTxnIds="; (__isset.replSrcTxnIds ? (out << to_string(replSrcTxnIds)) : (out << "")); + out << ", " << "txn_type="; (__isset.txn_type ? (out << to_string(txn_type)) : (out << "")); + out << ")"; +} + + +OpenTxnsResponse::~OpenTxnsResponse() noexcept { +} + +OpenTxnsResponse::OpenTxnsResponse() noexcept { +} + +void OpenTxnsResponse::__set_txn_ids(const std::vector & val) { + this->txn_ids = val; +} +std::ostream& operator<<(std::ostream& out, const OpenTxnsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t OpenTxnsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txn_ids = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->txn_ids.clear(); + uint32_t _size865; + ::apache::thrift::protocol::TType _etype868; + xfer += iprot->readListBegin(_etype868, _size865); + this->txn_ids.resize(_size865); + uint32_t _i869; + for (_i869 = 0; _i869 < _size865; ++_i869) + { + xfer += iprot->readI64(this->txn_ids[_i869]); + } + xfer += iprot->readListEnd(); + } + isset_txn_ids = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txn_ids) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t OpenTxnsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("OpenTxnsResponse"); + + xfer += oprot->writeFieldBegin("txn_ids", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->txn_ids.size())); + std::vector ::const_iterator _iter870; + for (_iter870 = this->txn_ids.begin(); _iter870 != this->txn_ids.end(); ++_iter870) + { + xfer += oprot->writeI64((*_iter870)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(OpenTxnsResponse &a, OpenTxnsResponse &b) noexcept { + using ::std::swap; + swap(a.txn_ids, b.txn_ids); +} + +bool OpenTxnsResponse::operator==(const OpenTxnsResponse & rhs) const +{ + if (!(txn_ids == rhs.txn_ids)) + return false; + return true; +} + +OpenTxnsResponse::OpenTxnsResponse(const OpenTxnsResponse& other871) { + txn_ids = other871.txn_ids; +} +OpenTxnsResponse& OpenTxnsResponse::operator=(const OpenTxnsResponse& other872) { + txn_ids = other872.txn_ids; + return *this; +} +void OpenTxnsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "OpenTxnsResponse("; + out << "txn_ids=" << to_string(txn_ids); + out << ")"; +} + + +AbortTxnRequest::~AbortTxnRequest() noexcept { +} + +AbortTxnRequest::AbortTxnRequest() noexcept + : txnid(0), + replPolicy(), + txn_type(static_cast(0)), + errorCode(0) { +} + +void AbortTxnRequest::__set_txnid(const int64_t val) { + this->txnid = val; +} + +void AbortTxnRequest::__set_replPolicy(const std::string& val) { + this->replPolicy = val; +__isset.replPolicy = true; +} + +void AbortTxnRequest::__set_txn_type(const TxnType::type val) { + this->txn_type = val; +__isset.txn_type = true; +} + +void AbortTxnRequest::__set_errorCode(const int64_t val) { + this->errorCode = val; +__isset.errorCode = true; +} +std::ostream& operator<<(std::ostream& out, const AbortTxnRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AbortTxnRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnid = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + isset_txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->replPolicy); + this->__isset.replPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast873; + xfer += iprot->readI32(ecast873); + this->txn_type = static_cast(ecast873); + this->__isset.txn_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->errorCode); + this->__isset.errorCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnid) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AbortTxnRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AbortTxnRequest"); + + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.replPolicy) { + xfer += oprot->writeFieldBegin("replPolicy", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->replPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txn_type) { + xfer += oprot->writeFieldBegin("txn_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->txn_type)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorCode) { + xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->errorCode); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AbortTxnRequest &a, AbortTxnRequest &b) noexcept { + using ::std::swap; + swap(a.txnid, b.txnid); + swap(a.replPolicy, b.replPolicy); + swap(a.txn_type, b.txn_type); + swap(a.errorCode, b.errorCode); + swap(a.__isset, b.__isset); +} + +bool AbortTxnRequest::operator==(const AbortTxnRequest & rhs) const +{ + if (!(txnid == rhs.txnid)) + return false; + if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; + else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; + if (__isset.txn_type != rhs.__isset.txn_type) + return false; + else if (__isset.txn_type && !(txn_type == rhs.txn_type)) + return false; + if (__isset.errorCode != rhs.__isset.errorCode) + return false; + else if (__isset.errorCode && !(errorCode == rhs.errorCode)) + return false; + return true; +} + +AbortTxnRequest::AbortTxnRequest(const AbortTxnRequest& other874) { + txnid = other874.txnid; + replPolicy = other874.replPolicy; + txn_type = other874.txn_type; + errorCode = other874.errorCode; + __isset = other874.__isset; +} +AbortTxnRequest& AbortTxnRequest::operator=(const AbortTxnRequest& other875) { + txnid = other875.txnid; + replPolicy = other875.replPolicy; + txn_type = other875.txn_type; + errorCode = other875.errorCode; + __isset = other875.__isset; + return *this; +} +void AbortTxnRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AbortTxnRequest("; + out << "txnid=" << to_string(txnid); + out << ", " << "replPolicy="; (__isset.replPolicy ? (out << to_string(replPolicy)) : (out << "")); + out << ", " << "txn_type="; (__isset.txn_type ? (out << to_string(txn_type)) : (out << "")); + out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); + out << ")"; +} + + +AbortTxnsRequest::~AbortTxnsRequest() noexcept { +} + +AbortTxnsRequest::AbortTxnsRequest() noexcept + : errorCode(0) { +} + +void AbortTxnsRequest::__set_txn_ids(const std::vector & val) { + this->txn_ids = val; +} + +void AbortTxnsRequest::__set_errorCode(const int64_t val) { + this->errorCode = val; +__isset.errorCode = true; +} +std::ostream& operator<<(std::ostream& out, const AbortTxnsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AbortTxnsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txn_ids = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->txn_ids.clear(); + uint32_t _size876; + ::apache::thrift::protocol::TType _etype879; + xfer += iprot->readListBegin(_etype879, _size876); + this->txn_ids.resize(_size876); + uint32_t _i880; + for (_i880 = 0; _i880 < _size876; ++_i880) + { + xfer += iprot->readI64(this->txn_ids[_i880]); + } + xfer += iprot->readListEnd(); + } + isset_txn_ids = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->errorCode); + this->__isset.errorCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txn_ids) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AbortTxnsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AbortTxnsRequest"); + + xfer += oprot->writeFieldBegin("txn_ids", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->txn_ids.size())); + std::vector ::const_iterator _iter881; + for (_iter881 = this->txn_ids.begin(); _iter881 != this->txn_ids.end(); ++_iter881) + { + xfer += oprot->writeI64((*_iter881)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.errorCode) { + xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->errorCode); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AbortTxnsRequest &a, AbortTxnsRequest &b) noexcept { + using ::std::swap; + swap(a.txn_ids, b.txn_ids); + swap(a.errorCode, b.errorCode); + swap(a.__isset, b.__isset); +} + +bool AbortTxnsRequest::operator==(const AbortTxnsRequest & rhs) const +{ + if (!(txn_ids == rhs.txn_ids)) + return false; + if (__isset.errorCode != rhs.__isset.errorCode) + return false; + else if (__isset.errorCode && !(errorCode == rhs.errorCode)) + return false; + return true; +} + +AbortTxnsRequest::AbortTxnsRequest(const AbortTxnsRequest& other882) { + txn_ids = other882.txn_ids; + errorCode = other882.errorCode; + __isset = other882.__isset; +} +AbortTxnsRequest& AbortTxnsRequest::operator=(const AbortTxnsRequest& other883) { + txn_ids = other883.txn_ids; + errorCode = other883.errorCode; + __isset = other883.__isset; + return *this; +} +void AbortTxnsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AbortTxnsRequest("; + out << "txn_ids=" << to_string(txn_ids); + out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); + out << ")"; +} + + +CommitTxnKeyValue::~CommitTxnKeyValue() noexcept { +} + +CommitTxnKeyValue::CommitTxnKeyValue() noexcept + : tableId(0), + key(), + value() { +} + +void CommitTxnKeyValue::__set_tableId(const int64_t val) { + this->tableId = val; +} + +void CommitTxnKeyValue::__set_key(const std::string& val) { + this->key = val; +} + +void CommitTxnKeyValue::__set_value(const std::string& val) { + this->value = val; +} +std::ostream& operator<<(std::ostream& out, const CommitTxnKeyValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CommitTxnKeyValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tableId = false; + bool isset_key = false; + bool isset_value = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + isset_tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->value); + isset_value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tableId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_value) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CommitTxnKeyValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CommitTxnKeyValue"); + + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->key); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->value); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CommitTxnKeyValue &a, CommitTxnKeyValue &b) noexcept { + using ::std::swap; + swap(a.tableId, b.tableId); + swap(a.key, b.key); + swap(a.value, b.value); +} + +bool CommitTxnKeyValue::operator==(const CommitTxnKeyValue & rhs) const +{ + if (!(tableId == rhs.tableId)) + return false; + if (!(key == rhs.key)) + return false; + if (!(value == rhs.value)) + return false; + return true; +} + +CommitTxnKeyValue::CommitTxnKeyValue(const CommitTxnKeyValue& other884) { + tableId = other884.tableId; + key = other884.key; + value = other884.value; +} +CommitTxnKeyValue& CommitTxnKeyValue::operator=(const CommitTxnKeyValue& other885) { + tableId = other885.tableId; + key = other885.key; + value = other885.value; + return *this; +} +void CommitTxnKeyValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CommitTxnKeyValue("; + out << "tableId=" << to_string(tableId); + out << ", " << "key=" << to_string(key); + out << ", " << "value=" << to_string(value); + out << ")"; +} + + +WriteEventInfo::~WriteEventInfo() noexcept { +} + +WriteEventInfo::WriteEventInfo() noexcept + : writeId(0), + database(), + table(), + files(), + partition(), + tableObj(), + partitionObj() { +} + +void WriteEventInfo::__set_writeId(const int64_t val) { + this->writeId = val; +} + +void WriteEventInfo::__set_database(const std::string& val) { + this->database = val; +} + +void WriteEventInfo::__set_table(const std::string& val) { + this->table = val; +} + +void WriteEventInfo::__set_files(const std::string& val) { + this->files = val; +} + +void WriteEventInfo::__set_partition(const std::string& val) { + this->partition = val; +__isset.partition = true; +} + +void WriteEventInfo::__set_tableObj(const std::string& val) { + this->tableObj = val; +__isset.tableObj = true; +} + +void WriteEventInfo::__set_partitionObj(const std::string& val) { + this->partitionObj = val; +__isset.partitionObj = true; +} +std::ostream& operator<<(std::ostream& out, const WriteEventInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WriteEventInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_writeId = false; + bool isset_database = false; + bool isset_table = false; + bool isset_files = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + isset_writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->database); + isset_database = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->files); + isset_files = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partition); + this->__isset.partition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableObj); + this->__isset.tableObj = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionObj); + this->__isset.partitionObj = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_writeId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_database) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_files) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WriteEventInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WriteEventInfo"); + + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("database", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->database); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("files", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->files); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partition) { + xfer += oprot->writeFieldBegin("partition", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->partition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableObj) { + xfer += oprot->writeFieldBegin("tableObj", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->tableObj); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionObj) { + xfer += oprot->writeFieldBegin("partitionObj", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->partitionObj); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WriteEventInfo &a, WriteEventInfo &b) noexcept { + using ::std::swap; + swap(a.writeId, b.writeId); + swap(a.database, b.database); + swap(a.table, b.table); + swap(a.files, b.files); + swap(a.partition, b.partition); + swap(a.tableObj, b.tableObj); + swap(a.partitionObj, b.partitionObj); + swap(a.__isset, b.__isset); +} + +bool WriteEventInfo::operator==(const WriteEventInfo & rhs) const +{ + if (!(writeId == rhs.writeId)) + return false; + if (!(database == rhs.database)) + return false; + if (!(table == rhs.table)) + return false; + if (!(files == rhs.files)) + return false; + if (__isset.partition != rhs.__isset.partition) + return false; + else if (__isset.partition && !(partition == rhs.partition)) + return false; + if (__isset.tableObj != rhs.__isset.tableObj) + return false; + else if (__isset.tableObj && !(tableObj == rhs.tableObj)) + return false; + if (__isset.partitionObj != rhs.__isset.partitionObj) + return false; + else if (__isset.partitionObj && !(partitionObj == rhs.partitionObj)) + return false; + return true; +} + +WriteEventInfo::WriteEventInfo(const WriteEventInfo& other886) { + writeId = other886.writeId; + database = other886.database; + table = other886.table; + files = other886.files; + partition = other886.partition; + tableObj = other886.tableObj; + partitionObj = other886.partitionObj; + __isset = other886.__isset; +} +WriteEventInfo& WriteEventInfo::operator=(const WriteEventInfo& other887) { + writeId = other887.writeId; + database = other887.database; + table = other887.table; + files = other887.files; + partition = other887.partition; + tableObj = other887.tableObj; + partitionObj = other887.partitionObj; + __isset = other887.__isset; + return *this; +} +void WriteEventInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WriteEventInfo("; + out << "writeId=" << to_string(writeId); + out << ", " << "database=" << to_string(database); + out << ", " << "table=" << to_string(table); + out << ", " << "files=" << to_string(files); + out << ", " << "partition="; (__isset.partition ? (out << to_string(partition)) : (out << "")); + out << ", " << "tableObj="; (__isset.tableObj ? (out << to_string(tableObj)) : (out << "")); + out << ", " << "partitionObj="; (__isset.partitionObj ? (out << to_string(partitionObj)) : (out << "")); + out << ")"; +} + + +ReplLastIdInfo::~ReplLastIdInfo() noexcept { +} + +ReplLastIdInfo::ReplLastIdInfo() noexcept + : database(), + lastReplId(0), + table(), + catalog() { +} + +void ReplLastIdInfo::__set_database(const std::string& val) { + this->database = val; +} + +void ReplLastIdInfo::__set_lastReplId(const int64_t val) { + this->lastReplId = val; +} + +void ReplLastIdInfo::__set_table(const std::string& val) { + this->table = val; +__isset.table = true; +} + +void ReplLastIdInfo::__set_catalog(const std::string& val) { + this->catalog = val; +__isset.catalog = true; +} + +void ReplLastIdInfo::__set_partitionList(const std::vector & val) { + this->partitionList = val; +__isset.partitionList = true; +} +std::ostream& operator<<(std::ostream& out, const ReplLastIdInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ReplLastIdInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_database = false; + bool isset_lastReplId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->database); + isset_database = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastReplId); + isset_lastReplId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table); + this->__isset.table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalog); + this->__isset.catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionList.clear(); + uint32_t _size888; + ::apache::thrift::protocol::TType _etype891; + xfer += iprot->readListBegin(_etype891, _size888); + this->partitionList.resize(_size888); + uint32_t _i892; + for (_i892 = 0; _i892 < _size888; ++_i892) + { + xfer += iprot->readString(this->partitionList[_i892]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_database) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_lastReplId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ReplLastIdInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ReplLastIdInfo"); + + xfer += oprot->writeFieldBegin("database", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->database); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("lastReplId", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->lastReplId); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.table) { + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catalog) { + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catalog); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionList) { + xfer += oprot->writeFieldBegin("partitionList", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionList.size())); + std::vector ::const_iterator _iter893; + for (_iter893 = this->partitionList.begin(); _iter893 != this->partitionList.end(); ++_iter893) + { + xfer += oprot->writeString((*_iter893)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ReplLastIdInfo &a, ReplLastIdInfo &b) noexcept { + using ::std::swap; + swap(a.database, b.database); + swap(a.lastReplId, b.lastReplId); + swap(a.table, b.table); + swap(a.catalog, b.catalog); + swap(a.partitionList, b.partitionList); + swap(a.__isset, b.__isset); +} + +bool ReplLastIdInfo::operator==(const ReplLastIdInfo & rhs) const +{ + if (!(database == rhs.database)) + return false; + if (!(lastReplId == rhs.lastReplId)) + return false; + if (__isset.table != rhs.__isset.table) + return false; + else if (__isset.table && !(table == rhs.table)) + return false; + if (__isset.catalog != rhs.__isset.catalog) + return false; + else if (__isset.catalog && !(catalog == rhs.catalog)) + return false; + if (__isset.partitionList != rhs.__isset.partitionList) + return false; + else if (__isset.partitionList && !(partitionList == rhs.partitionList)) + return false; + return true; +} + +ReplLastIdInfo::ReplLastIdInfo(const ReplLastIdInfo& other894) { + database = other894.database; + lastReplId = other894.lastReplId; + table = other894.table; + catalog = other894.catalog; + partitionList = other894.partitionList; + __isset = other894.__isset; +} +ReplLastIdInfo& ReplLastIdInfo::operator=(const ReplLastIdInfo& other895) { + database = other895.database; + lastReplId = other895.lastReplId; + table = other895.table; + catalog = other895.catalog; + partitionList = other895.partitionList; + __isset = other895.__isset; + return *this; +} +void ReplLastIdInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ReplLastIdInfo("; + out << "database=" << to_string(database); + out << ", " << "lastReplId=" << to_string(lastReplId); + out << ", " << "table="; (__isset.table ? (out << to_string(table)) : (out << "")); + out << ", " << "catalog="; (__isset.catalog ? (out << to_string(catalog)) : (out << "")); + out << ", " << "partitionList="; (__isset.partitionList ? (out << to_string(partitionList)) : (out << "")); + out << ")"; +} + + +UpdateTransactionalStatsRequest::~UpdateTransactionalStatsRequest() noexcept { +} + +UpdateTransactionalStatsRequest::UpdateTransactionalStatsRequest() noexcept + : tableId(0), + insertCount(0), + updatedCount(0), + deletedCount(0) { +} + +void UpdateTransactionalStatsRequest::__set_tableId(const int64_t val) { + this->tableId = val; +} + +void UpdateTransactionalStatsRequest::__set_insertCount(const int64_t val) { + this->insertCount = val; +} + +void UpdateTransactionalStatsRequest::__set_updatedCount(const int64_t val) { + this->updatedCount = val; +} + +void UpdateTransactionalStatsRequest::__set_deletedCount(const int64_t val) { + this->deletedCount = val; +} +std::ostream& operator<<(std::ostream& out, const UpdateTransactionalStatsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UpdateTransactionalStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tableId = false; + bool isset_insertCount = false; + bool isset_updatedCount = false; + bool isset_deletedCount = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->tableId); + isset_tableId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->insertCount); + isset_insertCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->updatedCount); + isset_updatedCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->deletedCount); + isset_deletedCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tableId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_insertCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_updatedCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_deletedCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t UpdateTransactionalStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UpdateTransactionalStatsRequest"); + + xfer += oprot->writeFieldBegin("tableId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->tableId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("insertCount", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->insertCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("updatedCount", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->updatedCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deletedCount", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->deletedCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UpdateTransactionalStatsRequest &a, UpdateTransactionalStatsRequest &b) noexcept { + using ::std::swap; + swap(a.tableId, b.tableId); + swap(a.insertCount, b.insertCount); + swap(a.updatedCount, b.updatedCount); + swap(a.deletedCount, b.deletedCount); +} + +bool UpdateTransactionalStatsRequest::operator==(const UpdateTransactionalStatsRequest & rhs) const +{ + if (!(tableId == rhs.tableId)) + return false; + if (!(insertCount == rhs.insertCount)) + return false; + if (!(updatedCount == rhs.updatedCount)) + return false; + if (!(deletedCount == rhs.deletedCount)) + return false; + return true; +} + +UpdateTransactionalStatsRequest::UpdateTransactionalStatsRequest(const UpdateTransactionalStatsRequest& other896) noexcept { + tableId = other896.tableId; + insertCount = other896.insertCount; + updatedCount = other896.updatedCount; + deletedCount = other896.deletedCount; +} +UpdateTransactionalStatsRequest& UpdateTransactionalStatsRequest::operator=(const UpdateTransactionalStatsRequest& other897) noexcept { + tableId = other897.tableId; + insertCount = other897.insertCount; + updatedCount = other897.updatedCount; + deletedCount = other897.deletedCount; + return *this; +} +void UpdateTransactionalStatsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UpdateTransactionalStatsRequest("; + out << "tableId=" << to_string(tableId); + out << ", " << "insertCount=" << to_string(insertCount); + out << ", " << "updatedCount=" << to_string(updatedCount); + out << ", " << "deletedCount=" << to_string(deletedCount); + out << ")"; +} + + +CommitTxnRequest::~CommitTxnRequest() noexcept { +} + +CommitTxnRequest::CommitTxnRequest() noexcept + : txnid(0), + replPolicy(), + exclWriteEnabled(true), + txn_type(static_cast(0)) { +} + +void CommitTxnRequest::__set_txnid(const int64_t val) { + this->txnid = val; +} + +void CommitTxnRequest::__set_replPolicy(const std::string& val) { + this->replPolicy = val; +__isset.replPolicy = true; +} + +void CommitTxnRequest::__set_writeEventInfos(const std::vector & val) { + this->writeEventInfos = val; +__isset.writeEventInfos = true; +} + +void CommitTxnRequest::__set_replLastIdInfo(const ReplLastIdInfo& val) { + this->replLastIdInfo = val; +__isset.replLastIdInfo = true; +} + +void CommitTxnRequest::__set_keyValue(const CommitTxnKeyValue& val) { + this->keyValue = val; +__isset.keyValue = true; +} + +void CommitTxnRequest::__set_exclWriteEnabled(const bool val) { + this->exclWriteEnabled = val; +__isset.exclWriteEnabled = true; +} + +void CommitTxnRequest::__set_txn_type(const TxnType::type val) { + this->txn_type = val; +__isset.txn_type = true; +} +std::ostream& operator<<(std::ostream& out, const CommitTxnRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CommitTxnRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnid = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + isset_txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->replPolicy); + this->__isset.replPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->writeEventInfos.clear(); + uint32_t _size898; + ::apache::thrift::protocol::TType _etype901; + xfer += iprot->readListBegin(_etype901, _size898); + this->writeEventInfos.resize(_size898); + uint32_t _i902; + for (_i902 = 0; _i902 < _size898; ++_i902) + { + xfer += this->writeEventInfos[_i902].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.writeEventInfos = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->replLastIdInfo.read(iprot); + this->__isset.replLastIdInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->keyValue.read(iprot); + this->__isset.keyValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->exclWriteEnabled); + this->__isset.exclWriteEnabled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast903; + xfer += iprot->readI32(ecast903); + this->txn_type = static_cast(ecast903); + this->__isset.txn_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnid) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CommitTxnRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CommitTxnRequest"); + + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.replPolicy) { + xfer += oprot->writeFieldBegin("replPolicy", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->replPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeEventInfos) { + xfer += oprot->writeFieldBegin("writeEventInfos", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->writeEventInfos.size())); + std::vector ::const_iterator _iter904; + for (_iter904 = this->writeEventInfos.begin(); _iter904 != this->writeEventInfos.end(); ++_iter904) + { + xfer += (*_iter904).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replLastIdInfo) { + xfer += oprot->writeFieldBegin("replLastIdInfo", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->replLastIdInfo.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.keyValue) { + xfer += oprot->writeFieldBegin("keyValue", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->keyValue.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.exclWriteEnabled) { + xfer += oprot->writeFieldBegin("exclWriteEnabled", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->exclWriteEnabled); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txn_type) { + xfer += oprot->writeFieldBegin("txn_type", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->txn_type)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CommitTxnRequest &a, CommitTxnRequest &b) noexcept { + using ::std::swap; + swap(a.txnid, b.txnid); + swap(a.replPolicy, b.replPolicy); + swap(a.writeEventInfos, b.writeEventInfos); + swap(a.replLastIdInfo, b.replLastIdInfo); + swap(a.keyValue, b.keyValue); + swap(a.exclWriteEnabled, b.exclWriteEnabled); + swap(a.txn_type, b.txn_type); + swap(a.__isset, b.__isset); +} + +bool CommitTxnRequest::operator==(const CommitTxnRequest & rhs) const +{ + if (!(txnid == rhs.txnid)) + return false; + if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; + else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; + if (__isset.writeEventInfos != rhs.__isset.writeEventInfos) + return false; + else if (__isset.writeEventInfos && !(writeEventInfos == rhs.writeEventInfos)) + return false; + if (__isset.replLastIdInfo != rhs.__isset.replLastIdInfo) + return false; + else if (__isset.replLastIdInfo && !(replLastIdInfo == rhs.replLastIdInfo)) + return false; + if (__isset.keyValue != rhs.__isset.keyValue) + return false; + else if (__isset.keyValue && !(keyValue == rhs.keyValue)) + return false; + if (__isset.exclWriteEnabled != rhs.__isset.exclWriteEnabled) + return false; + else if (__isset.exclWriteEnabled && !(exclWriteEnabled == rhs.exclWriteEnabled)) + return false; + if (__isset.txn_type != rhs.__isset.txn_type) + return false; + else if (__isset.txn_type && !(txn_type == rhs.txn_type)) + return false; + return true; +} + +CommitTxnRequest::CommitTxnRequest(const CommitTxnRequest& other905) { + txnid = other905.txnid; + replPolicy = other905.replPolicy; + writeEventInfos = other905.writeEventInfos; + replLastIdInfo = other905.replLastIdInfo; + keyValue = other905.keyValue; + exclWriteEnabled = other905.exclWriteEnabled; + txn_type = other905.txn_type; + __isset = other905.__isset; +} +CommitTxnRequest& CommitTxnRequest::operator=(const CommitTxnRequest& other906) { + txnid = other906.txnid; + replPolicy = other906.replPolicy; + writeEventInfos = other906.writeEventInfos; + replLastIdInfo = other906.replLastIdInfo; + keyValue = other906.keyValue; + exclWriteEnabled = other906.exclWriteEnabled; + txn_type = other906.txn_type; + __isset = other906.__isset; + return *this; +} +void CommitTxnRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CommitTxnRequest("; + out << "txnid=" << to_string(txnid); + out << ", " << "replPolicy="; (__isset.replPolicy ? (out << to_string(replPolicy)) : (out << "")); + out << ", " << "writeEventInfos="; (__isset.writeEventInfos ? (out << to_string(writeEventInfos)) : (out << "")); + out << ", " << "replLastIdInfo="; (__isset.replLastIdInfo ? (out << to_string(replLastIdInfo)) : (out << "")); + out << ", " << "keyValue="; (__isset.keyValue ? (out << to_string(keyValue)) : (out << "")); + out << ", " << "exclWriteEnabled="; (__isset.exclWriteEnabled ? (out << to_string(exclWriteEnabled)) : (out << "")); + out << ", " << "txn_type="; (__isset.txn_type ? (out << to_string(txn_type)) : (out << "")); + out << ")"; +} + + +ReplTblWriteIdStateRequest::~ReplTblWriteIdStateRequest() noexcept { +} + +ReplTblWriteIdStateRequest::ReplTblWriteIdStateRequest() noexcept + : validWriteIdlist(), + user(), + hostName(), + dbName(), + tableName() { +} + +void ReplTblWriteIdStateRequest::__set_validWriteIdlist(const std::string& val) { + this->validWriteIdlist = val; +} + +void ReplTblWriteIdStateRequest::__set_user(const std::string& val) { + this->user = val; +} + +void ReplTblWriteIdStateRequest::__set_hostName(const std::string& val) { + this->hostName = val; +} + +void ReplTblWriteIdStateRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void ReplTblWriteIdStateRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void ReplTblWriteIdStateRequest::__set_partNames(const std::vector & val) { + this->partNames = val; +__isset.partNames = true; +} +std::ostream& operator<<(std::ostream& out, const ReplTblWriteIdStateRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ReplTblWriteIdStateRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_validWriteIdlist = false; + bool isset_user = false; + bool isset_hostName = false; + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdlist); + isset_validWriteIdlist = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + isset_user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hostName); + isset_hostName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partNames.clear(); + uint32_t _size907; + ::apache::thrift::protocol::TType _etype910; + xfer += iprot->readListBegin(_etype910, _size907); + this->partNames.resize(_size907); + uint32_t _i911; + for (_i911 = 0; _i911 < _size907; ++_i911) + { + xfer += iprot->readString(this->partNames[_i911]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_validWriteIdlist) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_user) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hostName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ReplTblWriteIdStateRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ReplTblWriteIdStateRequest"); + + xfer += oprot->writeFieldBegin("validWriteIdlist", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->validWriteIdlist); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hostName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->hostName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partNames) { + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partNames.size())); + std::vector ::const_iterator _iter912; + for (_iter912 = this->partNames.begin(); _iter912 != this->partNames.end(); ++_iter912) + { + xfer += oprot->writeString((*_iter912)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ReplTblWriteIdStateRequest &a, ReplTblWriteIdStateRequest &b) noexcept { + using ::std::swap; + swap(a.validWriteIdlist, b.validWriteIdlist); + swap(a.user, b.user); + swap(a.hostName, b.hostName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partNames, b.partNames); + swap(a.__isset, b.__isset); +} + +bool ReplTblWriteIdStateRequest::operator==(const ReplTblWriteIdStateRequest & rhs) const +{ + if (!(validWriteIdlist == rhs.validWriteIdlist)) + return false; + if (!(user == rhs.user)) + return false; + if (!(hostName == rhs.hostName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.partNames != rhs.__isset.partNames) + return false; + else if (__isset.partNames && !(partNames == rhs.partNames)) + return false; + return true; +} + +ReplTblWriteIdStateRequest::ReplTblWriteIdStateRequest(const ReplTblWriteIdStateRequest& other913) { + validWriteIdlist = other913.validWriteIdlist; + user = other913.user; + hostName = other913.hostName; + dbName = other913.dbName; + tableName = other913.tableName; + partNames = other913.partNames; + __isset = other913.__isset; +} +ReplTblWriteIdStateRequest& ReplTblWriteIdStateRequest::operator=(const ReplTblWriteIdStateRequest& other914) { + validWriteIdlist = other914.validWriteIdlist; + user = other914.user; + hostName = other914.hostName; + dbName = other914.dbName; + tableName = other914.tableName; + partNames = other914.partNames; + __isset = other914.__isset; + return *this; +} +void ReplTblWriteIdStateRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ReplTblWriteIdStateRequest("; + out << "validWriteIdlist=" << to_string(validWriteIdlist); + out << ", " << "user=" << to_string(user); + out << ", " << "hostName=" << to_string(hostName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "partNames="; (__isset.partNames ? (out << to_string(partNames)) : (out << "")); + out << ")"; +} + + +GetValidWriteIdsRequest::~GetValidWriteIdsRequest() noexcept { +} + +GetValidWriteIdsRequest::GetValidWriteIdsRequest() noexcept + : validTxnList(), + writeId(0) { +} + +void GetValidWriteIdsRequest::__set_fullTableNames(const std::vector & val) { + this->fullTableNames = val; +} + +void GetValidWriteIdsRequest::__set_validTxnList(const std::string& val) { + this->validTxnList = val; +__isset.validTxnList = true; +} + +void GetValidWriteIdsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} +std::ostream& operator<<(std::ostream& out, const GetValidWriteIdsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetValidWriteIdsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fullTableNames = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fullTableNames.clear(); + uint32_t _size915; + ::apache::thrift::protocol::TType _etype918; + xfer += iprot->readListBegin(_etype918, _size915); + this->fullTableNames.resize(_size915); + uint32_t _i919; + for (_i919 = 0; _i919 < _size915; ++_i919) + { + xfer += iprot->readString(this->fullTableNames[_i919]); + } + xfer += iprot->readListEnd(); + } + isset_fullTableNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validTxnList); + this->__isset.validTxnList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fullTableNames) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetValidWriteIdsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetValidWriteIdsRequest"); + + xfer += oprot->writeFieldBegin("fullTableNames", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->fullTableNames.size())); + std::vector ::const_iterator _iter920; + for (_iter920 = this->fullTableNames.begin(); _iter920 != this->fullTableNames.end(); ++_iter920) + { + xfer += oprot->writeString((*_iter920)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validTxnList) { + xfer += oprot->writeFieldBegin("validTxnList", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->validTxnList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetValidWriteIdsRequest &a, GetValidWriteIdsRequest &b) noexcept { + using ::std::swap; + swap(a.fullTableNames, b.fullTableNames); + swap(a.validTxnList, b.validTxnList); + swap(a.writeId, b.writeId); + swap(a.__isset, b.__isset); +} + +bool GetValidWriteIdsRequest::operator==(const GetValidWriteIdsRequest & rhs) const +{ + if (!(fullTableNames == rhs.fullTableNames)) + return false; + if (__isset.validTxnList != rhs.__isset.validTxnList) + return false; + else if (__isset.validTxnList && !(validTxnList == rhs.validTxnList)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + return true; +} + +GetValidWriteIdsRequest::GetValidWriteIdsRequest(const GetValidWriteIdsRequest& other921) { + fullTableNames = other921.fullTableNames; + validTxnList = other921.validTxnList; + writeId = other921.writeId; + __isset = other921.__isset; +} +GetValidWriteIdsRequest& GetValidWriteIdsRequest::operator=(const GetValidWriteIdsRequest& other922) { + fullTableNames = other922.fullTableNames; + validTxnList = other922.validTxnList; + writeId = other922.writeId; + __isset = other922.__isset; + return *this; +} +void GetValidWriteIdsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetValidWriteIdsRequest("; + out << "fullTableNames=" << to_string(fullTableNames); + out << ", " << "validTxnList="; (__isset.validTxnList ? (out << to_string(validTxnList)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ")"; +} + + +TableValidWriteIds::~TableValidWriteIds() noexcept { +} + +TableValidWriteIds::TableValidWriteIds() noexcept + : fullTableName(), + writeIdHighWaterMark(0), + minOpenWriteId(0), + abortedBits() { +} + +void TableValidWriteIds::__set_fullTableName(const std::string& val) { + this->fullTableName = val; +} + +void TableValidWriteIds::__set_writeIdHighWaterMark(const int64_t val) { + this->writeIdHighWaterMark = val; +} + +void TableValidWriteIds::__set_invalidWriteIds(const std::vector & val) { + this->invalidWriteIds = val; +} + +void TableValidWriteIds::__set_minOpenWriteId(const int64_t val) { + this->minOpenWriteId = val; +__isset.minOpenWriteId = true; +} + +void TableValidWriteIds::__set_abortedBits(const std::string& val) { + this->abortedBits = val; +} +std::ostream& operator<<(std::ostream& out, const TableValidWriteIds& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TableValidWriteIds::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fullTableName = false; + bool isset_writeIdHighWaterMark = false; + bool isset_invalidWriteIds = false; + bool isset_abortedBits = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fullTableName); + isset_fullTableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeIdHighWaterMark); + isset_writeIdHighWaterMark = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->invalidWriteIds.clear(); + uint32_t _size923; + ::apache::thrift::protocol::TType _etype926; + xfer += iprot->readListBegin(_etype926, _size923); + this->invalidWriteIds.resize(_size923); + uint32_t _i927; + for (_i927 = 0; _i927 < _size923; ++_i927) + { + xfer += iprot->readI64(this->invalidWriteIds[_i927]); + } + xfer += iprot->readListEnd(); + } + isset_invalidWriteIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->minOpenWriteId); + this->__isset.minOpenWriteId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->abortedBits); + isset_abortedBits = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fullTableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_writeIdHighWaterMark) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_invalidWriteIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_abortedBits) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TableValidWriteIds::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TableValidWriteIds"); + + xfer += oprot->writeFieldBegin("fullTableName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->fullTableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeIdHighWaterMark", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->writeIdHighWaterMark); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("invalidWriteIds", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->invalidWriteIds.size())); + std::vector ::const_iterator _iter928; + for (_iter928 = this->invalidWriteIds.begin(); _iter928 != this->invalidWriteIds.end(); ++_iter928) + { + xfer += oprot->writeI64((*_iter928)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.minOpenWriteId) { + xfer += oprot->writeFieldBegin("minOpenWriteId", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->minOpenWriteId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("abortedBits", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->abortedBits); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TableValidWriteIds &a, TableValidWriteIds &b) noexcept { + using ::std::swap; + swap(a.fullTableName, b.fullTableName); + swap(a.writeIdHighWaterMark, b.writeIdHighWaterMark); + swap(a.invalidWriteIds, b.invalidWriteIds); + swap(a.minOpenWriteId, b.minOpenWriteId); + swap(a.abortedBits, b.abortedBits); + swap(a.__isset, b.__isset); +} + +bool TableValidWriteIds::operator==(const TableValidWriteIds & rhs) const +{ + if (!(fullTableName == rhs.fullTableName)) + return false; + if (!(writeIdHighWaterMark == rhs.writeIdHighWaterMark)) + return false; + if (!(invalidWriteIds == rhs.invalidWriteIds)) + return false; + if (__isset.minOpenWriteId != rhs.__isset.minOpenWriteId) + return false; + else if (__isset.minOpenWriteId && !(minOpenWriteId == rhs.minOpenWriteId)) + return false; + if (!(abortedBits == rhs.abortedBits)) + return false; + return true; +} + +TableValidWriteIds::TableValidWriteIds(const TableValidWriteIds& other929) { + fullTableName = other929.fullTableName; + writeIdHighWaterMark = other929.writeIdHighWaterMark; + invalidWriteIds = other929.invalidWriteIds; + minOpenWriteId = other929.minOpenWriteId; + abortedBits = other929.abortedBits; + __isset = other929.__isset; +} +TableValidWriteIds& TableValidWriteIds::operator=(const TableValidWriteIds& other930) { + fullTableName = other930.fullTableName; + writeIdHighWaterMark = other930.writeIdHighWaterMark; + invalidWriteIds = other930.invalidWriteIds; + minOpenWriteId = other930.minOpenWriteId; + abortedBits = other930.abortedBits; + __isset = other930.__isset; + return *this; +} +void TableValidWriteIds::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TableValidWriteIds("; + out << "fullTableName=" << to_string(fullTableName); + out << ", " << "writeIdHighWaterMark=" << to_string(writeIdHighWaterMark); + out << ", " << "invalidWriteIds=" << to_string(invalidWriteIds); + out << ", " << "minOpenWriteId="; (__isset.minOpenWriteId ? (out << to_string(minOpenWriteId)) : (out << "")); + out << ", " << "abortedBits=" << to_string(abortedBits); + out << ")"; +} + + +GetValidWriteIdsResponse::~GetValidWriteIdsResponse() noexcept { +} + +GetValidWriteIdsResponse::GetValidWriteIdsResponse() noexcept { +} + +void GetValidWriteIdsResponse::__set_tblValidWriteIds(const std::vector & val) { + this->tblValidWriteIds = val; +} +std::ostream& operator<<(std::ostream& out, const GetValidWriteIdsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetValidWriteIdsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tblValidWriteIds = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tblValidWriteIds.clear(); + uint32_t _size931; + ::apache::thrift::protocol::TType _etype934; + xfer += iprot->readListBegin(_etype934, _size931); + this->tblValidWriteIds.resize(_size931); + uint32_t _i935; + for (_i935 = 0; _i935 < _size931; ++_i935) + { + xfer += this->tblValidWriteIds[_i935].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_tblValidWriteIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tblValidWriteIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetValidWriteIdsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetValidWriteIdsResponse"); + + xfer += oprot->writeFieldBegin("tblValidWriteIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->tblValidWriteIds.size())); + std::vector ::const_iterator _iter936; + for (_iter936 = this->tblValidWriteIds.begin(); _iter936 != this->tblValidWriteIds.end(); ++_iter936) + { + xfer += (*_iter936).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetValidWriteIdsResponse &a, GetValidWriteIdsResponse &b) noexcept { + using ::std::swap; + swap(a.tblValidWriteIds, b.tblValidWriteIds); +} + +bool GetValidWriteIdsResponse::operator==(const GetValidWriteIdsResponse & rhs) const +{ + if (!(tblValidWriteIds == rhs.tblValidWriteIds)) + return false; + return true; +} + +GetValidWriteIdsResponse::GetValidWriteIdsResponse(const GetValidWriteIdsResponse& other937) { + tblValidWriteIds = other937.tblValidWriteIds; +} +GetValidWriteIdsResponse& GetValidWriteIdsResponse::operator=(const GetValidWriteIdsResponse& other938) { + tblValidWriteIds = other938.tblValidWriteIds; + return *this; +} +void GetValidWriteIdsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetValidWriteIdsResponse("; + out << "tblValidWriteIds=" << to_string(tblValidWriteIds); + out << ")"; +} + + +TxnToWriteId::~TxnToWriteId() noexcept { +} + +TxnToWriteId::TxnToWriteId() noexcept + : txnId(0), + writeId(0) { +} + +void TxnToWriteId::__set_txnId(const int64_t val) { + this->txnId = val; +} + +void TxnToWriteId::__set_writeId(const int64_t val) { + this->writeId = val; +} +std::ostream& operator<<(std::ostream& out, const TxnToWriteId& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TxnToWriteId::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnId = false; + bool isset_writeId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + isset_txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + isset_writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_writeId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TxnToWriteId::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TxnToWriteId"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TxnToWriteId &a, TxnToWriteId &b) noexcept { + using ::std::swap; + swap(a.txnId, b.txnId); + swap(a.writeId, b.writeId); +} + +bool TxnToWriteId::operator==(const TxnToWriteId & rhs) const +{ + if (!(txnId == rhs.txnId)) + return false; + if (!(writeId == rhs.writeId)) + return false; + return true; +} + +TxnToWriteId::TxnToWriteId(const TxnToWriteId& other939) noexcept { + txnId = other939.txnId; + writeId = other939.writeId; +} +TxnToWriteId& TxnToWriteId::operator=(const TxnToWriteId& other940) noexcept { + txnId = other940.txnId; + writeId = other940.writeId; + return *this; +} +void TxnToWriteId::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TxnToWriteId("; + out << "txnId=" << to_string(txnId); + out << ", " << "writeId=" << to_string(writeId); + out << ")"; +} + + +AllocateTableWriteIdsRequest::~AllocateTableWriteIdsRequest() noexcept { +} + +AllocateTableWriteIdsRequest::AllocateTableWriteIdsRequest() noexcept + : dbName(), + tableName(), + replPolicy(), + reallocate(false) { +} + +void AllocateTableWriteIdsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AllocateTableWriteIdsRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void AllocateTableWriteIdsRequest::__set_txnIds(const std::vector & val) { + this->txnIds = val; +__isset.txnIds = true; +} + +void AllocateTableWriteIdsRequest::__set_replPolicy(const std::string& val) { + this->replPolicy = val; +__isset.replPolicy = true; +} + +void AllocateTableWriteIdsRequest::__set_srcTxnToWriteIdList(const std::vector & val) { + this->srcTxnToWriteIdList = val; +__isset.srcTxnToWriteIdList = true; +} + +void AllocateTableWriteIdsRequest::__set_reallocate(const bool val) { + this->reallocate = val; +__isset.reallocate = true; +} +std::ostream& operator<<(std::ostream& out, const AllocateTableWriteIdsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AllocateTableWriteIdsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->txnIds.clear(); + uint32_t _size941; + ::apache::thrift::protocol::TType _etype944; + xfer += iprot->readListBegin(_etype944, _size941); + this->txnIds.resize(_size941); + uint32_t _i945; + for (_i945 = 0; _i945 < _size941; ++_i945) + { + xfer += iprot->readI64(this->txnIds[_i945]); + } + xfer += iprot->readListEnd(); + } + this->__isset.txnIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->replPolicy); + this->__isset.replPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->srcTxnToWriteIdList.clear(); + uint32_t _size946; + ::apache::thrift::protocol::TType _etype949; + xfer += iprot->readListBegin(_etype949, _size946); + this->srcTxnToWriteIdList.resize(_size946); + uint32_t _i950; + for (_i950 = 0; _i950 < _size946; ++_i950) + { + xfer += this->srcTxnToWriteIdList[_i950].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.srcTxnToWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->reallocate); + this->__isset.reallocate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AllocateTableWriteIdsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AllocateTableWriteIdsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.txnIds) { + xfer += oprot->writeFieldBegin("txnIds", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->txnIds.size())); + std::vector ::const_iterator _iter951; + for (_iter951 = this->txnIds.begin(); _iter951 != this->txnIds.end(); ++_iter951) + { + xfer += oprot->writeI64((*_iter951)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replPolicy) { + xfer += oprot->writeFieldBegin("replPolicy", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->replPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.srcTxnToWriteIdList) { + xfer += oprot->writeFieldBegin("srcTxnToWriteIdList", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->srcTxnToWriteIdList.size())); + std::vector ::const_iterator _iter952; + for (_iter952 = this->srcTxnToWriteIdList.begin(); _iter952 != this->srcTxnToWriteIdList.end(); ++_iter952) + { + xfer += (*_iter952).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.reallocate) { + xfer += oprot->writeFieldBegin("reallocate", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->reallocate); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AllocateTableWriteIdsRequest &a, AllocateTableWriteIdsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.txnIds, b.txnIds); + swap(a.replPolicy, b.replPolicy); + swap(a.srcTxnToWriteIdList, b.srcTxnToWriteIdList); + swap(a.reallocate, b.reallocate); + swap(a.__isset, b.__isset); +} + +bool AllocateTableWriteIdsRequest::operator==(const AllocateTableWriteIdsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.txnIds != rhs.__isset.txnIds) + return false; + else if (__isset.txnIds && !(txnIds == rhs.txnIds)) + return false; + if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; + else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; + if (__isset.srcTxnToWriteIdList != rhs.__isset.srcTxnToWriteIdList) + return false; + else if (__isset.srcTxnToWriteIdList && !(srcTxnToWriteIdList == rhs.srcTxnToWriteIdList)) + return false; + if (__isset.reallocate != rhs.__isset.reallocate) + return false; + else if (__isset.reallocate && !(reallocate == rhs.reallocate)) + return false; + return true; +} + +AllocateTableWriteIdsRequest::AllocateTableWriteIdsRequest(const AllocateTableWriteIdsRequest& other953) { + dbName = other953.dbName; + tableName = other953.tableName; + txnIds = other953.txnIds; + replPolicy = other953.replPolicy; + srcTxnToWriteIdList = other953.srcTxnToWriteIdList; + reallocate = other953.reallocate; + __isset = other953.__isset; +} +AllocateTableWriteIdsRequest& AllocateTableWriteIdsRequest::operator=(const AllocateTableWriteIdsRequest& other954) { + dbName = other954.dbName; + tableName = other954.tableName; + txnIds = other954.txnIds; + replPolicy = other954.replPolicy; + srcTxnToWriteIdList = other954.srcTxnToWriteIdList; + reallocate = other954.reallocate; + __isset = other954.__isset; + return *this; +} +void AllocateTableWriteIdsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AllocateTableWriteIdsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "txnIds="; (__isset.txnIds ? (out << to_string(txnIds)) : (out << "")); + out << ", " << "replPolicy="; (__isset.replPolicy ? (out << to_string(replPolicy)) : (out << "")); + out << ", " << "srcTxnToWriteIdList="; (__isset.srcTxnToWriteIdList ? (out << to_string(srcTxnToWriteIdList)) : (out << "")); + out << ", " << "reallocate="; (__isset.reallocate ? (out << to_string(reallocate)) : (out << "")); + out << ")"; +} + + +AllocateTableWriteIdsResponse::~AllocateTableWriteIdsResponse() noexcept { +} + +AllocateTableWriteIdsResponse::AllocateTableWriteIdsResponse() noexcept { +} + +void AllocateTableWriteIdsResponse::__set_txnToWriteIds(const std::vector & val) { + this->txnToWriteIds = val; +} +std::ostream& operator<<(std::ostream& out, const AllocateTableWriteIdsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AllocateTableWriteIdsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnToWriteIds = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->txnToWriteIds.clear(); + uint32_t _size955; + ::apache::thrift::protocol::TType _etype958; + xfer += iprot->readListBegin(_etype958, _size955); + this->txnToWriteIds.resize(_size955); + uint32_t _i959; + for (_i959 = 0; _i959 < _size955; ++_i959) + { + xfer += this->txnToWriteIds[_i959].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_txnToWriteIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnToWriteIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AllocateTableWriteIdsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AllocateTableWriteIdsResponse"); + + xfer += oprot->writeFieldBegin("txnToWriteIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->txnToWriteIds.size())); + std::vector ::const_iterator _iter960; + for (_iter960 = this->txnToWriteIds.begin(); _iter960 != this->txnToWriteIds.end(); ++_iter960) + { + xfer += (*_iter960).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AllocateTableWriteIdsResponse &a, AllocateTableWriteIdsResponse &b) noexcept { + using ::std::swap; + swap(a.txnToWriteIds, b.txnToWriteIds); +} + +bool AllocateTableWriteIdsResponse::operator==(const AllocateTableWriteIdsResponse & rhs) const +{ + if (!(txnToWriteIds == rhs.txnToWriteIds)) + return false; + return true; +} + +AllocateTableWriteIdsResponse::AllocateTableWriteIdsResponse(const AllocateTableWriteIdsResponse& other961) { + txnToWriteIds = other961.txnToWriteIds; +} +AllocateTableWriteIdsResponse& AllocateTableWriteIdsResponse::operator=(const AllocateTableWriteIdsResponse& other962) { + txnToWriteIds = other962.txnToWriteIds; + return *this; +} +void AllocateTableWriteIdsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AllocateTableWriteIdsResponse("; + out << "txnToWriteIds=" << to_string(txnToWriteIds); + out << ")"; +} + + +MaxAllocatedTableWriteIdRequest::~MaxAllocatedTableWriteIdRequest() noexcept { +} + +MaxAllocatedTableWriteIdRequest::MaxAllocatedTableWriteIdRequest() noexcept + : dbName(), + tableName() { +} + +void MaxAllocatedTableWriteIdRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void MaxAllocatedTableWriteIdRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} +std::ostream& operator<<(std::ostream& out, const MaxAllocatedTableWriteIdRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t MaxAllocatedTableWriteIdRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t MaxAllocatedTableWriteIdRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("MaxAllocatedTableWriteIdRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(MaxAllocatedTableWriteIdRequest &a, MaxAllocatedTableWriteIdRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); +} + +bool MaxAllocatedTableWriteIdRequest::operator==(const MaxAllocatedTableWriteIdRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + return true; +} + +MaxAllocatedTableWriteIdRequest::MaxAllocatedTableWriteIdRequest(const MaxAllocatedTableWriteIdRequest& other963) { + dbName = other963.dbName; + tableName = other963.tableName; +} +MaxAllocatedTableWriteIdRequest& MaxAllocatedTableWriteIdRequest::operator=(const MaxAllocatedTableWriteIdRequest& other964) { + dbName = other964.dbName; + tableName = other964.tableName; + return *this; +} +void MaxAllocatedTableWriteIdRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "MaxAllocatedTableWriteIdRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ")"; +} + + +MaxAllocatedTableWriteIdResponse::~MaxAllocatedTableWriteIdResponse() noexcept { +} + +MaxAllocatedTableWriteIdResponse::MaxAllocatedTableWriteIdResponse() noexcept + : maxWriteId(0) { +} + +void MaxAllocatedTableWriteIdResponse::__set_maxWriteId(const int64_t val) { + this->maxWriteId = val; +} +std::ostream& operator<<(std::ostream& out, const MaxAllocatedTableWriteIdResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t MaxAllocatedTableWriteIdResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_maxWriteId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->maxWriteId); + isset_maxWriteId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_maxWriteId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t MaxAllocatedTableWriteIdResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("MaxAllocatedTableWriteIdResponse"); + + xfer += oprot->writeFieldBegin("maxWriteId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->maxWriteId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(MaxAllocatedTableWriteIdResponse &a, MaxAllocatedTableWriteIdResponse &b) noexcept { + using ::std::swap; + swap(a.maxWriteId, b.maxWriteId); +} + +bool MaxAllocatedTableWriteIdResponse::operator==(const MaxAllocatedTableWriteIdResponse & rhs) const +{ + if (!(maxWriteId == rhs.maxWriteId)) + return false; + return true; +} + +MaxAllocatedTableWriteIdResponse::MaxAllocatedTableWriteIdResponse(const MaxAllocatedTableWriteIdResponse& other965) noexcept { + maxWriteId = other965.maxWriteId; +} +MaxAllocatedTableWriteIdResponse& MaxAllocatedTableWriteIdResponse::operator=(const MaxAllocatedTableWriteIdResponse& other966) noexcept { + maxWriteId = other966.maxWriteId; + return *this; +} +void MaxAllocatedTableWriteIdResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "MaxAllocatedTableWriteIdResponse("; + out << "maxWriteId=" << to_string(maxWriteId); + out << ")"; +} + + +SeedTableWriteIdsRequest::~SeedTableWriteIdsRequest() noexcept { +} + +SeedTableWriteIdsRequest::SeedTableWriteIdsRequest() noexcept + : dbName(), + tableName(), + seedWriteId(0) { +} + +void SeedTableWriteIdsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void SeedTableWriteIdsRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void SeedTableWriteIdsRequest::__set_seedWriteId(const int64_t val) { + this->seedWriteId = val; +} +std::ostream& operator<<(std::ostream& out, const SeedTableWriteIdsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SeedTableWriteIdsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + bool isset_seedWriteId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->seedWriteId); + isset_seedWriteId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_seedWriteId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SeedTableWriteIdsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SeedTableWriteIdsRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("seedWriteId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->seedWriteId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SeedTableWriteIdsRequest &a, SeedTableWriteIdsRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.seedWriteId, b.seedWriteId); +} + +bool SeedTableWriteIdsRequest::operator==(const SeedTableWriteIdsRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(seedWriteId == rhs.seedWriteId)) + return false; + return true; +} + +SeedTableWriteIdsRequest::SeedTableWriteIdsRequest(const SeedTableWriteIdsRequest& other967) { + dbName = other967.dbName; + tableName = other967.tableName; + seedWriteId = other967.seedWriteId; +} +SeedTableWriteIdsRequest& SeedTableWriteIdsRequest::operator=(const SeedTableWriteIdsRequest& other968) { + dbName = other968.dbName; + tableName = other968.tableName; + seedWriteId = other968.seedWriteId; + return *this; +} +void SeedTableWriteIdsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SeedTableWriteIdsRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "seedWriteId=" << to_string(seedWriteId); + out << ")"; +} + + +SeedTxnIdRequest::~SeedTxnIdRequest() noexcept { +} + +SeedTxnIdRequest::SeedTxnIdRequest() noexcept + : seedTxnId(0) { +} + +void SeedTxnIdRequest::__set_seedTxnId(const int64_t val) { + this->seedTxnId = val; +} +std::ostream& operator<<(std::ostream& out, const SeedTxnIdRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SeedTxnIdRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_seedTxnId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->seedTxnId); + isset_seedTxnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_seedTxnId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SeedTxnIdRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SeedTxnIdRequest"); + + xfer += oprot->writeFieldBegin("seedTxnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->seedTxnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SeedTxnIdRequest &a, SeedTxnIdRequest &b) noexcept { + using ::std::swap; + swap(a.seedTxnId, b.seedTxnId); +} + +bool SeedTxnIdRequest::operator==(const SeedTxnIdRequest & rhs) const +{ + if (!(seedTxnId == rhs.seedTxnId)) + return false; + return true; +} + +SeedTxnIdRequest::SeedTxnIdRequest(const SeedTxnIdRequest& other969) noexcept { + seedTxnId = other969.seedTxnId; +} +SeedTxnIdRequest& SeedTxnIdRequest::operator=(const SeedTxnIdRequest& other970) noexcept { + seedTxnId = other970.seedTxnId; + return *this; +} +void SeedTxnIdRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SeedTxnIdRequest("; + out << "seedTxnId=" << to_string(seedTxnId); + out << ")"; +} + + +LockComponent::~LockComponent() noexcept { +} + +LockComponent::LockComponent() noexcept + : type(static_cast(0)), + level(static_cast(0)), + dbname(), + tablename(), + partitionname(), + operationType(static_cast(5)), + isTransactional(false), + isDynamicPartitionWrite(false) { +} + +void LockComponent::__set_type(const LockType::type val) { + this->type = val; +} + +void LockComponent::__set_level(const LockLevel::type val) { + this->level = val; +} + +void LockComponent::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void LockComponent::__set_tablename(const std::string& val) { + this->tablename = val; +__isset.tablename = true; +} + +void LockComponent::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} + +void LockComponent::__set_operationType(const DataOperationType::type val) { + this->operationType = val; +__isset.operationType = true; +} + +void LockComponent::__set_isTransactional(const bool val) { + this->isTransactional = val; +__isset.isTransactional = true; +} + +void LockComponent::__set_isDynamicPartitionWrite(const bool val) { + this->isDynamicPartitionWrite = val; +__isset.isDynamicPartitionWrite = true; +} +std::ostream& operator<<(std::ostream& out, const LockComponent& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t LockComponent::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_type = false; + bool isset_level = false; + bool isset_dbname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast971; + xfer += iprot->readI32(ecast971); + this->type = static_cast(ecast971); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast972; + xfer += iprot->readI32(ecast972); + this->level = static_cast(ecast972); + isset_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + this->__isset.tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast973; + xfer += iprot->readI32(ecast973); + this->operationType = static_cast(ecast973); + this->__isset.operationType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isTransactional); + this->__isset.isTransactional = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isDynamicPartitionWrite); + this->__isset.isDynamicPartitionWrite = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t LockComponent::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("LockComponent"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("level", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->level)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.tablename) { + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.operationType) { + xfer += oprot->writeFieldBegin("operationType", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->operationType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isTransactional) { + xfer += oprot->writeFieldBegin("isTransactional", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->isTransactional); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isDynamicPartitionWrite) { + xfer += oprot->writeFieldBegin("isDynamicPartitionWrite", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->isDynamicPartitionWrite); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(LockComponent &a, LockComponent &b) noexcept { + using ::std::swap; + swap(a.type, b.type); + swap(a.level, b.level); + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionname, b.partitionname); + swap(a.operationType, b.operationType); + swap(a.isTransactional, b.isTransactional); + swap(a.isDynamicPartitionWrite, b.isDynamicPartitionWrite); + swap(a.__isset, b.__isset); +} + +bool LockComponent::operator==(const LockComponent & rhs) const +{ + if (!(type == rhs.type)) + return false; + if (!(level == rhs.level)) + return false; + if (!(dbname == rhs.dbname)) + return false; + if (__isset.tablename != rhs.__isset.tablename) + return false; + else if (__isset.tablename && !(tablename == rhs.tablename)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + if (__isset.operationType != rhs.__isset.operationType) + return false; + else if (__isset.operationType && !(operationType == rhs.operationType)) + return false; + if (__isset.isTransactional != rhs.__isset.isTransactional) + return false; + else if (__isset.isTransactional && !(isTransactional == rhs.isTransactional)) + return false; + if (__isset.isDynamicPartitionWrite != rhs.__isset.isDynamicPartitionWrite) + return false; + else if (__isset.isDynamicPartitionWrite && !(isDynamicPartitionWrite == rhs.isDynamicPartitionWrite)) + return false; + return true; +} + +LockComponent::LockComponent(const LockComponent& other974) { + type = other974.type; + level = other974.level; + dbname = other974.dbname; + tablename = other974.tablename; + partitionname = other974.partitionname; + operationType = other974.operationType; + isTransactional = other974.isTransactional; + isDynamicPartitionWrite = other974.isDynamicPartitionWrite; + __isset = other974.__isset; +} +LockComponent& LockComponent::operator=(const LockComponent& other975) { + type = other975.type; + level = other975.level; + dbname = other975.dbname; + tablename = other975.tablename; + partitionname = other975.partitionname; + operationType = other975.operationType; + isTransactional = other975.isTransactional; + isDynamicPartitionWrite = other975.isDynamicPartitionWrite; + __isset = other975.__isset; + return *this; +} +void LockComponent::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "LockComponent("; + out << "type=" << to_string(type); + out << ", " << "level=" << to_string(level); + out << ", " << "dbname=" << to_string(dbname); + out << ", " << "tablename="; (__isset.tablename ? (out << to_string(tablename)) : (out << "")); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ", " << "operationType="; (__isset.operationType ? (out << to_string(operationType)) : (out << "")); + out << ", " << "isTransactional="; (__isset.isTransactional ? (out << to_string(isTransactional)) : (out << "")); + out << ", " << "isDynamicPartitionWrite="; (__isset.isDynamicPartitionWrite ? (out << to_string(isDynamicPartitionWrite)) : (out << "")); + out << ")"; +} + + +LockRequest::~LockRequest() noexcept { +} + +LockRequest::LockRequest() : txnid(0), + user(), + hostname(), + agentInfo("Unknown"), + zeroWaitReadEnabled(false), + exclusiveCTAS(false), + locklessReadsEnabled(false) { +} + +void LockRequest::__set_component(const std::vector & val) { + this->component = val; +} + +void LockRequest::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} + +void LockRequest::__set_user(const std::string& val) { + this->user = val; +} + +void LockRequest::__set_hostname(const std::string& val) { + this->hostname = val; +} + +void LockRequest::__set_agentInfo(const std::string& val) { + this->agentInfo = val; +__isset.agentInfo = true; +} + +void LockRequest::__set_zeroWaitReadEnabled(const bool val) { + this->zeroWaitReadEnabled = val; +__isset.zeroWaitReadEnabled = true; +} + +void LockRequest::__set_exclusiveCTAS(const bool val) { + this->exclusiveCTAS = val; +__isset.exclusiveCTAS = true; +} + +void LockRequest::__set_locklessReadsEnabled(const bool val) { + this->locklessReadsEnabled = val; +__isset.locklessReadsEnabled = true; +} +std::ostream& operator<<(std::ostream& out, const LockRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t LockRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_component = false; + bool isset_user = false; + bool isset_hostname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->component.clear(); + uint32_t _size976; + ::apache::thrift::protocol::TType _etype979; + xfer += iprot->readListBegin(_etype979, _size976); + this->component.resize(_size976); + uint32_t _i980; + for (_i980 = 0; _i980 < _size976; ++_i980) + { + xfer += this->component[_i980].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_component = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + isset_user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hostname); + isset_hostname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->agentInfo); + this->__isset.agentInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->zeroWaitReadEnabled); + this->__isset.zeroWaitReadEnabled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->exclusiveCTAS); + this->__isset.exclusiveCTAS = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->locklessReadsEnabled); + this->__isset.locklessReadsEnabled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_component) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_user) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hostname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t LockRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("LockRequest"); + + xfer += oprot->writeFieldBegin("component", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->component.size())); + std::vector ::const_iterator _iter981; + for (_iter981 = this->component.begin(); _iter981 != this->component.end(); ++_iter981) + { + xfer += (*_iter981).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hostname", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->hostname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.agentInfo) { + xfer += oprot->writeFieldBegin("agentInfo", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->agentInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.zeroWaitReadEnabled) { + xfer += oprot->writeFieldBegin("zeroWaitReadEnabled", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->zeroWaitReadEnabled); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.exclusiveCTAS) { + xfer += oprot->writeFieldBegin("exclusiveCTAS", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->exclusiveCTAS); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.locklessReadsEnabled) { + xfer += oprot->writeFieldBegin("locklessReadsEnabled", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->locklessReadsEnabled); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(LockRequest &a, LockRequest &b) noexcept { + using ::std::swap; + swap(a.component, b.component); + swap(a.txnid, b.txnid); + swap(a.user, b.user); + swap(a.hostname, b.hostname); + swap(a.agentInfo, b.agentInfo); + swap(a.zeroWaitReadEnabled, b.zeroWaitReadEnabled); + swap(a.exclusiveCTAS, b.exclusiveCTAS); + swap(a.locklessReadsEnabled, b.locklessReadsEnabled); + swap(a.__isset, b.__isset); +} + +bool LockRequest::operator==(const LockRequest & rhs) const +{ + if (!(component == rhs.component)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + if (!(user == rhs.user)) + return false; + if (!(hostname == rhs.hostname)) + return false; + if (__isset.agentInfo != rhs.__isset.agentInfo) + return false; + else if (__isset.agentInfo && !(agentInfo == rhs.agentInfo)) + return false; + if (__isset.zeroWaitReadEnabled != rhs.__isset.zeroWaitReadEnabled) + return false; + else if (__isset.zeroWaitReadEnabled && !(zeroWaitReadEnabled == rhs.zeroWaitReadEnabled)) + return false; + if (__isset.exclusiveCTAS != rhs.__isset.exclusiveCTAS) + return false; + else if (__isset.exclusiveCTAS && !(exclusiveCTAS == rhs.exclusiveCTAS)) + return false; + if (__isset.locklessReadsEnabled != rhs.__isset.locklessReadsEnabled) + return false; + else if (__isset.locklessReadsEnabled && !(locklessReadsEnabled == rhs.locklessReadsEnabled)) + return false; + return true; +} + +LockRequest::LockRequest(const LockRequest& other982) { + component = other982.component; + txnid = other982.txnid; + user = other982.user; + hostname = other982.hostname; + agentInfo = other982.agentInfo; + zeroWaitReadEnabled = other982.zeroWaitReadEnabled; + exclusiveCTAS = other982.exclusiveCTAS; + locklessReadsEnabled = other982.locklessReadsEnabled; + __isset = other982.__isset; +} +LockRequest& LockRequest::operator=(const LockRequest& other983) { + component = other983.component; + txnid = other983.txnid; + user = other983.user; + hostname = other983.hostname; + agentInfo = other983.agentInfo; + zeroWaitReadEnabled = other983.zeroWaitReadEnabled; + exclusiveCTAS = other983.exclusiveCTAS; + locklessReadsEnabled = other983.locklessReadsEnabled; + __isset = other983.__isset; + return *this; +} +void LockRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "LockRequest("; + out << "component=" << to_string(component); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ", " << "user=" << to_string(user); + out << ", " << "hostname=" << to_string(hostname); + out << ", " << "agentInfo="; (__isset.agentInfo ? (out << to_string(agentInfo)) : (out << "")); + out << ", " << "zeroWaitReadEnabled="; (__isset.zeroWaitReadEnabled ? (out << to_string(zeroWaitReadEnabled)) : (out << "")); + out << ", " << "exclusiveCTAS="; (__isset.exclusiveCTAS ? (out << to_string(exclusiveCTAS)) : (out << "")); + out << ", " << "locklessReadsEnabled="; (__isset.locklessReadsEnabled ? (out << to_string(locklessReadsEnabled)) : (out << "")); + out << ")"; +} + + +LockResponse::~LockResponse() noexcept { +} + +LockResponse::LockResponse() noexcept + : lockid(0), + state(static_cast(0)), + errorMessage() { +} + +void LockResponse::__set_lockid(const int64_t val) { + this->lockid = val; +} + +void LockResponse::__set_state(const LockState::type val) { + this->state = val; +} + +void LockResponse::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} +std::ostream& operator<<(std::ostream& out, const LockResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t LockResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_lockid = false; + bool isset_state = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockid); + isset_lockid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast984; + xfer += iprot->readI32(ecast984); + this->state = static_cast(ecast984); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_lockid) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t LockResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("LockResponse"); + + xfer += oprot->writeFieldBegin("lockid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lockid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(LockResponse &a, LockResponse &b) noexcept { + using ::std::swap; + swap(a.lockid, b.lockid); + swap(a.state, b.state); + swap(a.errorMessage, b.errorMessage); + swap(a.__isset, b.__isset); +} + +bool LockResponse::operator==(const LockResponse & rhs) const +{ + if (!(lockid == rhs.lockid)) + return false; + if (!(state == rhs.state)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + return true; +} + +LockResponse::LockResponse(const LockResponse& other985) { + lockid = other985.lockid; + state = other985.state; + errorMessage = other985.errorMessage; + __isset = other985.__isset; +} +LockResponse& LockResponse::operator=(const LockResponse& other986) { + lockid = other986.lockid; + state = other986.state; + errorMessage = other986.errorMessage; + __isset = other986.__isset; + return *this; +} +void LockResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "LockResponse("; + out << "lockid=" << to_string(lockid); + out << ", " << "state=" << to_string(state); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ")"; +} + + +CheckLockRequest::~CheckLockRequest() noexcept { +} + +CheckLockRequest::CheckLockRequest() noexcept + : lockid(0), + txnid(0), + elapsed_ms(0) { +} + +void CheckLockRequest::__set_lockid(const int64_t val) { + this->lockid = val; +} + +void CheckLockRequest::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} + +void CheckLockRequest::__set_elapsed_ms(const int64_t val) { + this->elapsed_ms = val; +__isset.elapsed_ms = true; +} +std::ostream& operator<<(std::ostream& out, const CheckLockRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CheckLockRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_lockid = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockid); + isset_lockid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->elapsed_ms); + this->__isset.elapsed_ms = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_lockid) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CheckLockRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CheckLockRequest"); + + xfer += oprot->writeFieldBegin("lockid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lockid); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.elapsed_ms) { + xfer += oprot->writeFieldBegin("elapsed_ms", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->elapsed_ms); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CheckLockRequest &a, CheckLockRequest &b) noexcept { + using ::std::swap; + swap(a.lockid, b.lockid); + swap(a.txnid, b.txnid); + swap(a.elapsed_ms, b.elapsed_ms); + swap(a.__isset, b.__isset); +} + +bool CheckLockRequest::operator==(const CheckLockRequest & rhs) const +{ + if (!(lockid == rhs.lockid)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + if (__isset.elapsed_ms != rhs.__isset.elapsed_ms) + return false; + else if (__isset.elapsed_ms && !(elapsed_ms == rhs.elapsed_ms)) + return false; + return true; +} + +CheckLockRequest::CheckLockRequest(const CheckLockRequest& other987) noexcept { + lockid = other987.lockid; + txnid = other987.txnid; + elapsed_ms = other987.elapsed_ms; + __isset = other987.__isset; +} +CheckLockRequest& CheckLockRequest::operator=(const CheckLockRequest& other988) noexcept { + lockid = other988.lockid; + txnid = other988.txnid; + elapsed_ms = other988.elapsed_ms; + __isset = other988.__isset; + return *this; +} +void CheckLockRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CheckLockRequest("; + out << "lockid=" << to_string(lockid); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ", " << "elapsed_ms="; (__isset.elapsed_ms ? (out << to_string(elapsed_ms)) : (out << "")); + out << ")"; +} + + +UnlockRequest::~UnlockRequest() noexcept { +} + +UnlockRequest::UnlockRequest() noexcept + : lockid(0) { +} + +void UnlockRequest::__set_lockid(const int64_t val) { + this->lockid = val; +} +std::ostream& operator<<(std::ostream& out, const UnlockRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UnlockRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_lockid = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockid); + isset_lockid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_lockid) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t UnlockRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UnlockRequest"); + + xfer += oprot->writeFieldBegin("lockid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lockid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UnlockRequest &a, UnlockRequest &b) noexcept { + using ::std::swap; + swap(a.lockid, b.lockid); +} + +bool UnlockRequest::operator==(const UnlockRequest & rhs) const +{ + if (!(lockid == rhs.lockid)) + return false; + return true; +} + +UnlockRequest::UnlockRequest(const UnlockRequest& other989) noexcept { + lockid = other989.lockid; +} +UnlockRequest& UnlockRequest::operator=(const UnlockRequest& other990) noexcept { + lockid = other990.lockid; + return *this; +} +void UnlockRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UnlockRequest("; + out << "lockid=" << to_string(lockid); + out << ")"; +} + + +ShowLocksRequest::~ShowLocksRequest() noexcept { +} + +ShowLocksRequest::ShowLocksRequest() noexcept + : dbname(), + tablename(), + partname(), + isExtended(false), + txnid(0) { +} + +void ShowLocksRequest::__set_dbname(const std::string& val) { + this->dbname = val; +__isset.dbname = true; +} + +void ShowLocksRequest::__set_tablename(const std::string& val) { + this->tablename = val; +__isset.tablename = true; +} + +void ShowLocksRequest::__set_partname(const std::string& val) { + this->partname = val; +__isset.partname = true; +} + +void ShowLocksRequest::__set_isExtended(const bool val) { + this->isExtended = val; +__isset.isExtended = true; +} + +void ShowLocksRequest::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} +std::ostream& operator<<(std::ostream& out, const ShowLocksRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowLocksRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + this->__isset.tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partname); + this->__isset.partname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isExtended); + this->__isset.isExtended = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ShowLocksRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowLocksRequest"); + + if (this->__isset.dbname) { + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tablename) { + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partname) { + xfer += oprot->writeFieldBegin("partname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partname); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isExtended) { + xfer += oprot->writeFieldBegin("isExtended", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->isExtended); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowLocksRequest &a, ShowLocksRequest &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partname, b.partname); + swap(a.isExtended, b.isExtended); + swap(a.txnid, b.txnid); + swap(a.__isset, b.__isset); +} + +bool ShowLocksRequest::operator==(const ShowLocksRequest & rhs) const +{ + if (__isset.dbname != rhs.__isset.dbname) + return false; + else if (__isset.dbname && !(dbname == rhs.dbname)) + return false; + if (__isset.tablename != rhs.__isset.tablename) + return false; + else if (__isset.tablename && !(tablename == rhs.tablename)) + return false; + if (__isset.partname != rhs.__isset.partname) + return false; + else if (__isset.partname && !(partname == rhs.partname)) + return false; + if (__isset.isExtended != rhs.__isset.isExtended) + return false; + else if (__isset.isExtended && !(isExtended == rhs.isExtended)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + return true; +} + +ShowLocksRequest::ShowLocksRequest(const ShowLocksRequest& other991) { + dbname = other991.dbname; + tablename = other991.tablename; + partname = other991.partname; + isExtended = other991.isExtended; + txnid = other991.txnid; + __isset = other991.__isset; +} +ShowLocksRequest& ShowLocksRequest::operator=(const ShowLocksRequest& other992) { + dbname = other992.dbname; + tablename = other992.tablename; + partname = other992.partname; + isExtended = other992.isExtended; + txnid = other992.txnid; + __isset = other992.__isset; + return *this; +} +void ShowLocksRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowLocksRequest("; + out << "dbname="; (__isset.dbname ? (out << to_string(dbname)) : (out << "")); + out << ", " << "tablename="; (__isset.tablename ? (out << to_string(tablename)) : (out << "")); + out << ", " << "partname="; (__isset.partname ? (out << to_string(partname)) : (out << "")); + out << ", " << "isExtended="; (__isset.isExtended ? (out << to_string(isExtended)) : (out << "")); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ")"; +} + + +ShowLocksResponseElement::~ShowLocksResponseElement() noexcept { +} + +ShowLocksResponseElement::ShowLocksResponseElement() noexcept + : lockid(0), + dbname(), + tablename(), + partname(), + state(static_cast(0)), + type(static_cast(0)), + txnid(0), + lastheartbeat(0), + acquiredat(0), + user(), + hostname(), + heartbeatCount(0), + agentInfo(), + blockedByExtId(0), + blockedByIntId(0), + lockIdInternal(0) { +} + +void ShowLocksResponseElement::__set_lockid(const int64_t val) { + this->lockid = val; +} + +void ShowLocksResponseElement::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void ShowLocksResponseElement::__set_tablename(const std::string& val) { + this->tablename = val; +__isset.tablename = true; +} + +void ShowLocksResponseElement::__set_partname(const std::string& val) { + this->partname = val; +__isset.partname = true; +} + +void ShowLocksResponseElement::__set_state(const LockState::type val) { + this->state = val; +} + +void ShowLocksResponseElement::__set_type(const LockType::type val) { + this->type = val; +} + +void ShowLocksResponseElement::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} + +void ShowLocksResponseElement::__set_lastheartbeat(const int64_t val) { + this->lastheartbeat = val; +} + +void ShowLocksResponseElement::__set_acquiredat(const int64_t val) { + this->acquiredat = val; +__isset.acquiredat = true; +} + +void ShowLocksResponseElement::__set_user(const std::string& val) { + this->user = val; +} + +void ShowLocksResponseElement::__set_hostname(const std::string& val) { + this->hostname = val; +} + +void ShowLocksResponseElement::__set_heartbeatCount(const int32_t val) { + this->heartbeatCount = val; +__isset.heartbeatCount = true; +} + +void ShowLocksResponseElement::__set_agentInfo(const std::string& val) { + this->agentInfo = val; +__isset.agentInfo = true; +} + +void ShowLocksResponseElement::__set_blockedByExtId(const int64_t val) { + this->blockedByExtId = val; +__isset.blockedByExtId = true; +} + +void ShowLocksResponseElement::__set_blockedByIntId(const int64_t val) { + this->blockedByIntId = val; +__isset.blockedByIntId = true; +} + +void ShowLocksResponseElement::__set_lockIdInternal(const int64_t val) { + this->lockIdInternal = val; +__isset.lockIdInternal = true; +} +std::ostream& operator<<(std::ostream& out, const ShowLocksResponseElement& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowLocksResponseElement::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_lockid = false; + bool isset_dbname = false; + bool isset_state = false; + bool isset_type = false; + bool isset_lastheartbeat = false; + bool isset_user = false; + bool isset_hostname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockid); + isset_lockid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + this->__isset.tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partname); + this->__isset.partname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast993; + xfer += iprot->readI32(ecast993); + this->state = static_cast(ecast993); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast994; + xfer += iprot->readI32(ecast994); + this->type = static_cast(ecast994); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastheartbeat); + isset_lastheartbeat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->acquiredat); + this->__isset.acquiredat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + isset_user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hostname); + isset_hostname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->heartbeatCount); + this->__isset.heartbeatCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->agentInfo); + this->__isset.agentInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->blockedByExtId); + this->__isset.blockedByExtId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->blockedByIntId); + this->__isset.blockedByIntId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 16: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockIdInternal); + this->__isset.lockIdInternal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_lockid) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_lastheartbeat) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_user) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hostname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ShowLocksResponseElement::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowLocksResponseElement"); + + xfer += oprot->writeFieldBegin("lockid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lockid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.tablename) { + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partname) { + xfer += oprot->writeFieldBegin("partname", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->partname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("lastheartbeat", ::apache::thrift::protocol::T_I64, 8); + xfer += oprot->writeI64(this->lastheartbeat); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.acquiredat) { + xfer += oprot->writeFieldBegin("acquiredat", ::apache::thrift::protocol::T_I64, 9); + xfer += oprot->writeI64(this->acquiredat); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hostname", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->hostname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.heartbeatCount) { + xfer += oprot->writeFieldBegin("heartbeatCount", ::apache::thrift::protocol::T_I32, 12); + xfer += oprot->writeI32(this->heartbeatCount); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.agentInfo) { + xfer += oprot->writeFieldBegin("agentInfo", ::apache::thrift::protocol::T_STRING, 13); + xfer += oprot->writeString(this->agentInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.blockedByExtId) { + xfer += oprot->writeFieldBegin("blockedByExtId", ::apache::thrift::protocol::T_I64, 14); + xfer += oprot->writeI64(this->blockedByExtId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.blockedByIntId) { + xfer += oprot->writeFieldBegin("blockedByIntId", ::apache::thrift::protocol::T_I64, 15); + xfer += oprot->writeI64(this->blockedByIntId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.lockIdInternal) { + xfer += oprot->writeFieldBegin("lockIdInternal", ::apache::thrift::protocol::T_I64, 16); + xfer += oprot->writeI64(this->lockIdInternal); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowLocksResponseElement &a, ShowLocksResponseElement &b) noexcept { + using ::std::swap; + swap(a.lockid, b.lockid); + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partname, b.partname); + swap(a.state, b.state); + swap(a.type, b.type); + swap(a.txnid, b.txnid); + swap(a.lastheartbeat, b.lastheartbeat); + swap(a.acquiredat, b.acquiredat); + swap(a.user, b.user); + swap(a.hostname, b.hostname); + swap(a.heartbeatCount, b.heartbeatCount); + swap(a.agentInfo, b.agentInfo); + swap(a.blockedByExtId, b.blockedByExtId); + swap(a.blockedByIntId, b.blockedByIntId); + swap(a.lockIdInternal, b.lockIdInternal); + swap(a.__isset, b.__isset); +} + +bool ShowLocksResponseElement::operator==(const ShowLocksResponseElement & rhs) const +{ + if (!(lockid == rhs.lockid)) + return false; + if (!(dbname == rhs.dbname)) + return false; + if (__isset.tablename != rhs.__isset.tablename) + return false; + else if (__isset.tablename && !(tablename == rhs.tablename)) + return false; + if (__isset.partname != rhs.__isset.partname) + return false; + else if (__isset.partname && !(partname == rhs.partname)) + return false; + if (!(state == rhs.state)) + return false; + if (!(type == rhs.type)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + if (!(lastheartbeat == rhs.lastheartbeat)) + return false; + if (__isset.acquiredat != rhs.__isset.acquiredat) + return false; + else if (__isset.acquiredat && !(acquiredat == rhs.acquiredat)) + return false; + if (!(user == rhs.user)) + return false; + if (!(hostname == rhs.hostname)) + return false; + if (__isset.heartbeatCount != rhs.__isset.heartbeatCount) + return false; + else if (__isset.heartbeatCount && !(heartbeatCount == rhs.heartbeatCount)) + return false; + if (__isset.agentInfo != rhs.__isset.agentInfo) + return false; + else if (__isset.agentInfo && !(agentInfo == rhs.agentInfo)) + return false; + if (__isset.blockedByExtId != rhs.__isset.blockedByExtId) + return false; + else if (__isset.blockedByExtId && !(blockedByExtId == rhs.blockedByExtId)) + return false; + if (__isset.blockedByIntId != rhs.__isset.blockedByIntId) + return false; + else if (__isset.blockedByIntId && !(blockedByIntId == rhs.blockedByIntId)) + return false; + if (__isset.lockIdInternal != rhs.__isset.lockIdInternal) + return false; + else if (__isset.lockIdInternal && !(lockIdInternal == rhs.lockIdInternal)) + return false; + return true; +} + +ShowLocksResponseElement::ShowLocksResponseElement(const ShowLocksResponseElement& other995) { + lockid = other995.lockid; + dbname = other995.dbname; + tablename = other995.tablename; + partname = other995.partname; + state = other995.state; + type = other995.type; + txnid = other995.txnid; + lastheartbeat = other995.lastheartbeat; + acquiredat = other995.acquiredat; + user = other995.user; + hostname = other995.hostname; + heartbeatCount = other995.heartbeatCount; + agentInfo = other995.agentInfo; + blockedByExtId = other995.blockedByExtId; + blockedByIntId = other995.blockedByIntId; + lockIdInternal = other995.lockIdInternal; + __isset = other995.__isset; +} +ShowLocksResponseElement& ShowLocksResponseElement::operator=(const ShowLocksResponseElement& other996) { + lockid = other996.lockid; + dbname = other996.dbname; + tablename = other996.tablename; + partname = other996.partname; + state = other996.state; + type = other996.type; + txnid = other996.txnid; + lastheartbeat = other996.lastheartbeat; + acquiredat = other996.acquiredat; + user = other996.user; + hostname = other996.hostname; + heartbeatCount = other996.heartbeatCount; + agentInfo = other996.agentInfo; + blockedByExtId = other996.blockedByExtId; + blockedByIntId = other996.blockedByIntId; + lockIdInternal = other996.lockIdInternal; + __isset = other996.__isset; + return *this; +} +void ShowLocksResponseElement::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowLocksResponseElement("; + out << "lockid=" << to_string(lockid); + out << ", " << "dbname=" << to_string(dbname); + out << ", " << "tablename="; (__isset.tablename ? (out << to_string(tablename)) : (out << "")); + out << ", " << "partname="; (__isset.partname ? (out << to_string(partname)) : (out << "")); + out << ", " << "state=" << to_string(state); + out << ", " << "type=" << to_string(type); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ", " << "lastheartbeat=" << to_string(lastheartbeat); + out << ", " << "acquiredat="; (__isset.acquiredat ? (out << to_string(acquiredat)) : (out << "")); + out << ", " << "user=" << to_string(user); + out << ", " << "hostname=" << to_string(hostname); + out << ", " << "heartbeatCount="; (__isset.heartbeatCount ? (out << to_string(heartbeatCount)) : (out << "")); + out << ", " << "agentInfo="; (__isset.agentInfo ? (out << to_string(agentInfo)) : (out << "")); + out << ", " << "blockedByExtId="; (__isset.blockedByExtId ? (out << to_string(blockedByExtId)) : (out << "")); + out << ", " << "blockedByIntId="; (__isset.blockedByIntId ? (out << to_string(blockedByIntId)) : (out << "")); + out << ", " << "lockIdInternal="; (__isset.lockIdInternal ? (out << to_string(lockIdInternal)) : (out << "")); + out << ")"; +} + + +ShowLocksResponse::~ShowLocksResponse() noexcept { +} + +ShowLocksResponse::ShowLocksResponse() noexcept { +} + +void ShowLocksResponse::__set_locks(const std::vector & val) { + this->locks = val; +} +std::ostream& operator<<(std::ostream& out, const ShowLocksResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowLocksResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->locks.clear(); + uint32_t _size997; + ::apache::thrift::protocol::TType _etype1000; + xfer += iprot->readListBegin(_etype1000, _size997); + this->locks.resize(_size997); + uint32_t _i1001; + for (_i1001 = 0; _i1001 < _size997; ++_i1001) + { + xfer += this->locks[_i1001].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.locks = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ShowLocksResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowLocksResponse"); + + xfer += oprot->writeFieldBegin("locks", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->locks.size())); + std::vector ::const_iterator _iter1002; + for (_iter1002 = this->locks.begin(); _iter1002 != this->locks.end(); ++_iter1002) + { + xfer += (*_iter1002).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowLocksResponse &a, ShowLocksResponse &b) noexcept { + using ::std::swap; + swap(a.locks, b.locks); + swap(a.__isset, b.__isset); +} + +bool ShowLocksResponse::operator==(const ShowLocksResponse & rhs) const +{ + if (!(locks == rhs.locks)) + return false; + return true; +} + +ShowLocksResponse::ShowLocksResponse(const ShowLocksResponse& other1003) { + locks = other1003.locks; + __isset = other1003.__isset; +} +ShowLocksResponse& ShowLocksResponse::operator=(const ShowLocksResponse& other1004) { + locks = other1004.locks; + __isset = other1004.__isset; + return *this; +} +void ShowLocksResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowLocksResponse("; + out << "locks=" << to_string(locks); + out << ")"; +} + + +HeartbeatRequest::~HeartbeatRequest() noexcept { +} + +HeartbeatRequest::HeartbeatRequest() noexcept + : lockid(0), + txnid(0) { +} + +void HeartbeatRequest::__set_lockid(const int64_t val) { + this->lockid = val; +__isset.lockid = true; +} + +void HeartbeatRequest::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} +std::ostream& operator<<(std::ostream& out, const HeartbeatRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t HeartbeatRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lockid); + this->__isset.lockid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t HeartbeatRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HeartbeatRequest"); + + if (this->__isset.lockid) { + xfer += oprot->writeFieldBegin("lockid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lockid); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HeartbeatRequest &a, HeartbeatRequest &b) noexcept { + using ::std::swap; + swap(a.lockid, b.lockid); + swap(a.txnid, b.txnid); + swap(a.__isset, b.__isset); +} + +bool HeartbeatRequest::operator==(const HeartbeatRequest & rhs) const +{ + if (__isset.lockid != rhs.__isset.lockid) + return false; + else if (__isset.lockid && !(lockid == rhs.lockid)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + return true; +} + +HeartbeatRequest::HeartbeatRequest(const HeartbeatRequest& other1005) noexcept { + lockid = other1005.lockid; + txnid = other1005.txnid; + __isset = other1005.__isset; +} +HeartbeatRequest& HeartbeatRequest::operator=(const HeartbeatRequest& other1006) noexcept { + lockid = other1006.lockid; + txnid = other1006.txnid; + __isset = other1006.__isset; + return *this; +} +void HeartbeatRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HeartbeatRequest("; + out << "lockid="; (__isset.lockid ? (out << to_string(lockid)) : (out << "")); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ")"; +} + + +HeartbeatTxnRangeRequest::~HeartbeatTxnRangeRequest() noexcept { +} + +HeartbeatTxnRangeRequest::HeartbeatTxnRangeRequest() noexcept + : min(0), + max(0) { +} + +void HeartbeatTxnRangeRequest::__set_min(const int64_t val) { + this->min = val; +} + +void HeartbeatTxnRangeRequest::__set_max(const int64_t val) { + this->max = val; +} +std::ostream& operator<<(std::ostream& out, const HeartbeatTxnRangeRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t HeartbeatTxnRangeRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_min = false; + bool isset_max = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->min); + isset_min = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->max); + isset_max = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_min) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_max) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t HeartbeatTxnRangeRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HeartbeatTxnRangeRequest"); + + xfer += oprot->writeFieldBegin("min", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->min); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("max", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->max); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HeartbeatTxnRangeRequest &a, HeartbeatTxnRangeRequest &b) noexcept { + using ::std::swap; + swap(a.min, b.min); + swap(a.max, b.max); +} + +bool HeartbeatTxnRangeRequest::operator==(const HeartbeatTxnRangeRequest & rhs) const +{ + if (!(min == rhs.min)) + return false; + if (!(max == rhs.max)) + return false; + return true; +} + +HeartbeatTxnRangeRequest::HeartbeatTxnRangeRequest(const HeartbeatTxnRangeRequest& other1007) noexcept { + min = other1007.min; + max = other1007.max; +} +HeartbeatTxnRangeRequest& HeartbeatTxnRangeRequest::operator=(const HeartbeatTxnRangeRequest& other1008) noexcept { + min = other1008.min; + max = other1008.max; + return *this; +} +void HeartbeatTxnRangeRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HeartbeatTxnRangeRequest("; + out << "min=" << to_string(min); + out << ", " << "max=" << to_string(max); + out << ")"; +} + + +HeartbeatTxnRangeResponse::~HeartbeatTxnRangeResponse() noexcept { +} + +HeartbeatTxnRangeResponse::HeartbeatTxnRangeResponse() noexcept { +} + +void HeartbeatTxnRangeResponse::__set_aborted(const std::set & val) { + this->aborted = val; +} + +void HeartbeatTxnRangeResponse::__set_nosuch(const std::set & val) { + this->nosuch = val; +} +std::ostream& operator<<(std::ostream& out, const HeartbeatTxnRangeResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t HeartbeatTxnRangeResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_aborted = false; + bool isset_nosuch = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_SET) { + { + this->aborted.clear(); + uint32_t _size1009; + ::apache::thrift::protocol::TType _etype1012; + xfer += iprot->readSetBegin(_etype1012, _size1009); + uint32_t _i1013; + for (_i1013 = 0; _i1013 < _size1009; ++_i1013) + { + int64_t _elem1014; + xfer += iprot->readI64(_elem1014); + this->aborted.insert(_elem1014); + } + xfer += iprot->readSetEnd(); + } + isset_aborted = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_SET) { + { + this->nosuch.clear(); + uint32_t _size1015; + ::apache::thrift::protocol::TType _etype1018; + xfer += iprot->readSetBegin(_etype1018, _size1015); + uint32_t _i1019; + for (_i1019 = 0; _i1019 < _size1015; ++_i1019) + { + int64_t _elem1020; + xfer += iprot->readI64(_elem1020); + this->nosuch.insert(_elem1020); + } + xfer += iprot->readSetEnd(); + } + isset_nosuch = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_aborted) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nosuch) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t HeartbeatTxnRangeResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HeartbeatTxnRangeResponse"); + + xfer += oprot->writeFieldBegin("aborted", ::apache::thrift::protocol::T_SET, 1); + { + xfer += oprot->writeSetBegin(::apache::thrift::protocol::T_I64, static_cast(this->aborted.size())); + std::set ::const_iterator _iter1021; + for (_iter1021 = this->aborted.begin(); _iter1021 != this->aborted.end(); ++_iter1021) + { + xfer += oprot->writeI64((*_iter1021)); + } + xfer += oprot->writeSetEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nosuch", ::apache::thrift::protocol::T_SET, 2); + { + xfer += oprot->writeSetBegin(::apache::thrift::protocol::T_I64, static_cast(this->nosuch.size())); + std::set ::const_iterator _iter1022; + for (_iter1022 = this->nosuch.begin(); _iter1022 != this->nosuch.end(); ++_iter1022) + { + xfer += oprot->writeI64((*_iter1022)); + } + xfer += oprot->writeSetEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HeartbeatTxnRangeResponse &a, HeartbeatTxnRangeResponse &b) noexcept { + using ::std::swap; + swap(a.aborted, b.aborted); + swap(a.nosuch, b.nosuch); +} + +bool HeartbeatTxnRangeResponse::operator==(const HeartbeatTxnRangeResponse & rhs) const +{ + if (!(aborted == rhs.aborted)) + return false; + if (!(nosuch == rhs.nosuch)) + return false; + return true; +} + +HeartbeatTxnRangeResponse::HeartbeatTxnRangeResponse(const HeartbeatTxnRangeResponse& other1023) { + aborted = other1023.aborted; + nosuch = other1023.nosuch; +} +HeartbeatTxnRangeResponse& HeartbeatTxnRangeResponse::operator=(const HeartbeatTxnRangeResponse& other1024) { + aborted = other1024.aborted; + nosuch = other1024.nosuch; + return *this; +} +void HeartbeatTxnRangeResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HeartbeatTxnRangeResponse("; + out << "aborted=" << to_string(aborted); + out << ", " << "nosuch=" << to_string(nosuch); + out << ")"; +} + + +CompactionRequest::~CompactionRequest() noexcept { +} + +CompactionRequest::CompactionRequest() noexcept + : dbname(), + tablename(), + partitionname(), + type(static_cast(0)), + runas(), + initiatorId(), + initiatorVersion(), + poolName(), + numberOfBuckets(0), + orderByClause() { +} + +void CompactionRequest::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void CompactionRequest::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void CompactionRequest::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} + +void CompactionRequest::__set_type(const CompactionType::type val) { + this->type = val; +} + +void CompactionRequest::__set_runas(const std::string& val) { + this->runas = val; +__isset.runas = true; +} + +void CompactionRequest::__set_properties(const std::map & val) { + this->properties = val; +__isset.properties = true; +} + +void CompactionRequest::__set_initiatorId(const std::string& val) { + this->initiatorId = val; +__isset.initiatorId = true; +} + +void CompactionRequest::__set_initiatorVersion(const std::string& val) { + this->initiatorVersion = val; +__isset.initiatorVersion = true; +} + +void CompactionRequest::__set_poolName(const std::string& val) { + this->poolName = val; +__isset.poolName = true; +} + +void CompactionRequest::__set_numberOfBuckets(const int32_t val) { + this->numberOfBuckets = val; +__isset.numberOfBuckets = true; +} + +void CompactionRequest::__set_orderByClause(const std::string& val) { + this->orderByClause = val; +__isset.orderByClause = true; +} +std::ostream& operator<<(std::ostream& out, const CompactionRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbname = false; + bool isset_tablename = false; + bool isset_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1025; + xfer += iprot->readI32(ecast1025); + this->type = static_cast(ecast1025); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->runas); + this->__isset.runas = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->properties.clear(); + uint32_t _size1026; + ::apache::thrift::protocol::TType _ktype1027; + ::apache::thrift::protocol::TType _vtype1028; + xfer += iprot->readMapBegin(_ktype1027, _vtype1028, _size1026); + uint32_t _i1030; + for (_i1030 = 0; _i1030 < _size1026; ++_i1030) + { + std::string _key1031; + xfer += iprot->readString(_key1031); + std::string& _val1032 = this->properties[_key1031]; + xfer += iprot->readString(_val1032); + } + xfer += iprot->readMapEnd(); + } + this->__isset.properties = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->initiatorId); + this->__isset.initiatorId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->initiatorVersion); + this->__isset.initiatorVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolName); + this->__isset.poolName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->numberOfBuckets); + this->__isset.numberOfBuckets = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->orderByClause); + this->__isset.orderByClause = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CompactionRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionRequest"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.runas) { + xfer += oprot->writeFieldBegin("runas", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->runas); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.properties) { + xfer += oprot->writeFieldBegin("properties", ::apache::thrift::protocol::T_MAP, 6); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->properties.size())); + std::map ::const_iterator _iter1033; + for (_iter1033 = this->properties.begin(); _iter1033 != this->properties.end(); ++_iter1033) + { + xfer += oprot->writeString(_iter1033->first); + xfer += oprot->writeString(_iter1033->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.initiatorId) { + xfer += oprot->writeFieldBegin("initiatorId", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->initiatorId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.initiatorVersion) { + xfer += oprot->writeFieldBegin("initiatorVersion", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->initiatorVersion); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolName) { + xfer += oprot->writeFieldBegin("poolName", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->poolName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.numberOfBuckets) { + xfer += oprot->writeFieldBegin("numberOfBuckets", ::apache::thrift::protocol::T_I32, 10); + xfer += oprot->writeI32(this->numberOfBuckets); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.orderByClause) { + xfer += oprot->writeFieldBegin("orderByClause", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->orderByClause); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionRequest &a, CompactionRequest &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionname, b.partitionname); + swap(a.type, b.type); + swap(a.runas, b.runas); + swap(a.properties, b.properties); + swap(a.initiatorId, b.initiatorId); + swap(a.initiatorVersion, b.initiatorVersion); + swap(a.poolName, b.poolName); + swap(a.numberOfBuckets, b.numberOfBuckets); + swap(a.orderByClause, b.orderByClause); + swap(a.__isset, b.__isset); +} + +bool CompactionRequest::operator==(const CompactionRequest & rhs) const +{ + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + if (!(type == rhs.type)) + return false; + if (__isset.runas != rhs.__isset.runas) + return false; + else if (__isset.runas && !(runas == rhs.runas)) + return false; + if (__isset.properties != rhs.__isset.properties) + return false; + else if (__isset.properties && !(properties == rhs.properties)) + return false; + if (__isset.initiatorId != rhs.__isset.initiatorId) + return false; + else if (__isset.initiatorId && !(initiatorId == rhs.initiatorId)) + return false; + if (__isset.initiatorVersion != rhs.__isset.initiatorVersion) + return false; + else if (__isset.initiatorVersion && !(initiatorVersion == rhs.initiatorVersion)) + return false; + if (__isset.poolName != rhs.__isset.poolName) + return false; + else if (__isset.poolName && !(poolName == rhs.poolName)) + return false; + if (__isset.numberOfBuckets != rhs.__isset.numberOfBuckets) + return false; + else if (__isset.numberOfBuckets && !(numberOfBuckets == rhs.numberOfBuckets)) + return false; + if (__isset.orderByClause != rhs.__isset.orderByClause) + return false; + else if (__isset.orderByClause && !(orderByClause == rhs.orderByClause)) + return false; + return true; +} + +CompactionRequest::CompactionRequest(const CompactionRequest& other1034) { + dbname = other1034.dbname; + tablename = other1034.tablename; + partitionname = other1034.partitionname; + type = other1034.type; + runas = other1034.runas; + properties = other1034.properties; + initiatorId = other1034.initiatorId; + initiatorVersion = other1034.initiatorVersion; + poolName = other1034.poolName; + numberOfBuckets = other1034.numberOfBuckets; + orderByClause = other1034.orderByClause; + __isset = other1034.__isset; +} +CompactionRequest& CompactionRequest::operator=(const CompactionRequest& other1035) { + dbname = other1035.dbname; + tablename = other1035.tablename; + partitionname = other1035.partitionname; + type = other1035.type; + runas = other1035.runas; + properties = other1035.properties; + initiatorId = other1035.initiatorId; + initiatorVersion = other1035.initiatorVersion; + poolName = other1035.poolName; + numberOfBuckets = other1035.numberOfBuckets; + orderByClause = other1035.orderByClause; + __isset = other1035.__isset; + return *this; +} +void CompactionRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionRequest("; + out << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ", " << "type=" << to_string(type); + out << ", " << "runas="; (__isset.runas ? (out << to_string(runas)) : (out << "")); + out << ", " << "properties="; (__isset.properties ? (out << to_string(properties)) : (out << "")); + out << ", " << "initiatorId="; (__isset.initiatorId ? (out << to_string(initiatorId)) : (out << "")); + out << ", " << "initiatorVersion="; (__isset.initiatorVersion ? (out << to_string(initiatorVersion)) : (out << "")); + out << ", " << "poolName="; (__isset.poolName ? (out << to_string(poolName)) : (out << "")); + out << ", " << "numberOfBuckets="; (__isset.numberOfBuckets ? (out << to_string(numberOfBuckets)) : (out << "")); + out << ", " << "orderByClause="; (__isset.orderByClause ? (out << to_string(orderByClause)) : (out << "")); + out << ")"; +} + + +CompactionInfoStruct::~CompactionInfoStruct() noexcept { +} + +CompactionInfoStruct::CompactionInfoStruct() noexcept + : id(0), + dbname(), + tablename(), + partitionname(), + type(static_cast(0)), + runas(), + properties(), + toomanyaborts(0), + state(), + workerId(), + start(0), + highestWriteId(0), + errorMessage(), + hasoldabort(0), + enqueueTime(0), + retryRetention(0), + poolname(), + numberOfBuckets(0), + orderByClause() { +} + +void CompactionInfoStruct::__set_id(const int64_t val) { + this->id = val; +} + +void CompactionInfoStruct::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void CompactionInfoStruct::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void CompactionInfoStruct::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} + +void CompactionInfoStruct::__set_type(const CompactionType::type val) { + this->type = val; +} + +void CompactionInfoStruct::__set_runas(const std::string& val) { + this->runas = val; +__isset.runas = true; +} + +void CompactionInfoStruct::__set_properties(const std::string& val) { + this->properties = val; +__isset.properties = true; +} + +void CompactionInfoStruct::__set_toomanyaborts(const bool val) { + this->toomanyaborts = val; +__isset.toomanyaborts = true; +} + +void CompactionInfoStruct::__set_state(const std::string& val) { + this->state = val; +__isset.state = true; +} + +void CompactionInfoStruct::__set_workerId(const std::string& val) { + this->workerId = val; +__isset.workerId = true; +} + +void CompactionInfoStruct::__set_start(const int64_t val) { + this->start = val; +__isset.start = true; +} + +void CompactionInfoStruct::__set_highestWriteId(const int64_t val) { + this->highestWriteId = val; +__isset.highestWriteId = true; +} + +void CompactionInfoStruct::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} + +void CompactionInfoStruct::__set_hasoldabort(const bool val) { + this->hasoldabort = val; +__isset.hasoldabort = true; +} + +void CompactionInfoStruct::__set_enqueueTime(const int64_t val) { + this->enqueueTime = val; +__isset.enqueueTime = true; +} + +void CompactionInfoStruct::__set_retryRetention(const int64_t val) { + this->retryRetention = val; +__isset.retryRetention = true; +} + +void CompactionInfoStruct::__set_poolname(const std::string& val) { + this->poolname = val; +__isset.poolname = true; +} + +void CompactionInfoStruct::__set_numberOfBuckets(const int32_t val) { + this->numberOfBuckets = val; +__isset.numberOfBuckets = true; +} + +void CompactionInfoStruct::__set_orderByClause(const std::string& val) { + this->orderByClause = val; +__isset.orderByClause = true; +} +std::ostream& operator<<(std::ostream& out, const CompactionInfoStruct& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionInfoStruct::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_id = false; + bool isset_dbname = false; + bool isset_tablename = false; + bool isset_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + isset_id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1036; + xfer += iprot->readI32(ecast1036); + this->type = static_cast(ecast1036); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->runas); + this->__isset.runas = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->properties); + this->__isset.properties = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->toomanyaborts); + this->__isset.toomanyaborts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->state); + this->__isset.state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerId); + this->__isset.workerId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->start); + this->__isset.start = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->highestWriteId); + this->__isset.highestWriteId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->hasoldabort); + this->__isset.hasoldabort = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->enqueueTime); + this->__isset.enqueueTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 16: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->retryRetention); + this->__isset.retryRetention = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 17: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolname); + this->__isset.poolname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 18: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->numberOfBuckets); + this->__isset.numberOfBuckets = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 19: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->orderByClause); + this->__isset.orderByClause = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_id) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CompactionInfoStruct::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionInfoStruct"); + + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.runas) { + xfer += oprot->writeFieldBegin("runas", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->runas); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.properties) { + xfer += oprot->writeFieldBegin("properties", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->properties); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.toomanyaborts) { + xfer += oprot->writeFieldBegin("toomanyaborts", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->toomanyaborts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.state) { + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->state); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.workerId) { + xfer += oprot->writeFieldBegin("workerId", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->workerId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.start) { + xfer += oprot->writeFieldBegin("start", ::apache::thrift::protocol::T_I64, 11); + xfer += oprot->writeI64(this->start); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.highestWriteId) { + xfer += oprot->writeFieldBegin("highestWriteId", ::apache::thrift::protocol::T_I64, 12); + xfer += oprot->writeI64(this->highestWriteId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 13); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.hasoldabort) { + xfer += oprot->writeFieldBegin("hasoldabort", ::apache::thrift::protocol::T_BOOL, 14); + xfer += oprot->writeBool(this->hasoldabort); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.enqueueTime) { + xfer += oprot->writeFieldBegin("enqueueTime", ::apache::thrift::protocol::T_I64, 15); + xfer += oprot->writeI64(this->enqueueTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.retryRetention) { + xfer += oprot->writeFieldBegin("retryRetention", ::apache::thrift::protocol::T_I64, 16); + xfer += oprot->writeI64(this->retryRetention); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolname) { + xfer += oprot->writeFieldBegin("poolname", ::apache::thrift::protocol::T_STRING, 17); + xfer += oprot->writeString(this->poolname); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.numberOfBuckets) { + xfer += oprot->writeFieldBegin("numberOfBuckets", ::apache::thrift::protocol::T_I32, 18); + xfer += oprot->writeI32(this->numberOfBuckets); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.orderByClause) { + xfer += oprot->writeFieldBegin("orderByClause", ::apache::thrift::protocol::T_STRING, 19); + xfer += oprot->writeString(this->orderByClause); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionInfoStruct &a, CompactionInfoStruct &b) noexcept { + using ::std::swap; + swap(a.id, b.id); + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionname, b.partitionname); + swap(a.type, b.type); + swap(a.runas, b.runas); + swap(a.properties, b.properties); + swap(a.toomanyaborts, b.toomanyaborts); + swap(a.state, b.state); + swap(a.workerId, b.workerId); + swap(a.start, b.start); + swap(a.highestWriteId, b.highestWriteId); + swap(a.errorMessage, b.errorMessage); + swap(a.hasoldabort, b.hasoldabort); + swap(a.enqueueTime, b.enqueueTime); + swap(a.retryRetention, b.retryRetention); + swap(a.poolname, b.poolname); + swap(a.numberOfBuckets, b.numberOfBuckets); + swap(a.orderByClause, b.orderByClause); + swap(a.__isset, b.__isset); +} + +bool CompactionInfoStruct::operator==(const CompactionInfoStruct & rhs) const +{ + if (!(id == rhs.id)) + return false; + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + if (!(type == rhs.type)) + return false; + if (__isset.runas != rhs.__isset.runas) + return false; + else if (__isset.runas && !(runas == rhs.runas)) + return false; + if (__isset.properties != rhs.__isset.properties) + return false; + else if (__isset.properties && !(properties == rhs.properties)) + return false; + if (__isset.toomanyaborts != rhs.__isset.toomanyaborts) + return false; + else if (__isset.toomanyaborts && !(toomanyaborts == rhs.toomanyaborts)) + return false; + if (__isset.state != rhs.__isset.state) + return false; + else if (__isset.state && !(state == rhs.state)) + return false; + if (__isset.workerId != rhs.__isset.workerId) + return false; + else if (__isset.workerId && !(workerId == rhs.workerId)) + return false; + if (__isset.start != rhs.__isset.start) + return false; + else if (__isset.start && !(start == rhs.start)) + return false; + if (__isset.highestWriteId != rhs.__isset.highestWriteId) + return false; + else if (__isset.highestWriteId && !(highestWriteId == rhs.highestWriteId)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + if (__isset.hasoldabort != rhs.__isset.hasoldabort) + return false; + else if (__isset.hasoldabort && !(hasoldabort == rhs.hasoldabort)) + return false; + if (__isset.enqueueTime != rhs.__isset.enqueueTime) + return false; + else if (__isset.enqueueTime && !(enqueueTime == rhs.enqueueTime)) + return false; + if (__isset.retryRetention != rhs.__isset.retryRetention) + return false; + else if (__isset.retryRetention && !(retryRetention == rhs.retryRetention)) + return false; + if (__isset.poolname != rhs.__isset.poolname) + return false; + else if (__isset.poolname && !(poolname == rhs.poolname)) + return false; + if (__isset.numberOfBuckets != rhs.__isset.numberOfBuckets) + return false; + else if (__isset.numberOfBuckets && !(numberOfBuckets == rhs.numberOfBuckets)) + return false; + if (__isset.orderByClause != rhs.__isset.orderByClause) + return false; + else if (__isset.orderByClause && !(orderByClause == rhs.orderByClause)) + return false; + return true; +} + +CompactionInfoStruct::CompactionInfoStruct(const CompactionInfoStruct& other1037) { + id = other1037.id; + dbname = other1037.dbname; + tablename = other1037.tablename; + partitionname = other1037.partitionname; + type = other1037.type; + runas = other1037.runas; + properties = other1037.properties; + toomanyaborts = other1037.toomanyaborts; + state = other1037.state; + workerId = other1037.workerId; + start = other1037.start; + highestWriteId = other1037.highestWriteId; + errorMessage = other1037.errorMessage; + hasoldabort = other1037.hasoldabort; + enqueueTime = other1037.enqueueTime; + retryRetention = other1037.retryRetention; + poolname = other1037.poolname; + numberOfBuckets = other1037.numberOfBuckets; + orderByClause = other1037.orderByClause; + __isset = other1037.__isset; +} +CompactionInfoStruct& CompactionInfoStruct::operator=(const CompactionInfoStruct& other1038) { + id = other1038.id; + dbname = other1038.dbname; + tablename = other1038.tablename; + partitionname = other1038.partitionname; + type = other1038.type; + runas = other1038.runas; + properties = other1038.properties; + toomanyaborts = other1038.toomanyaborts; + state = other1038.state; + workerId = other1038.workerId; + start = other1038.start; + highestWriteId = other1038.highestWriteId; + errorMessage = other1038.errorMessage; + hasoldabort = other1038.hasoldabort; + enqueueTime = other1038.enqueueTime; + retryRetention = other1038.retryRetention; + poolname = other1038.poolname; + numberOfBuckets = other1038.numberOfBuckets; + orderByClause = other1038.orderByClause; + __isset = other1038.__isset; + return *this; +} +void CompactionInfoStruct::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionInfoStruct("; + out << "id=" << to_string(id); + out << ", " << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ", " << "type=" << to_string(type); + out << ", " << "runas="; (__isset.runas ? (out << to_string(runas)) : (out << "")); + out << ", " << "properties="; (__isset.properties ? (out << to_string(properties)) : (out << "")); + out << ", " << "toomanyaborts="; (__isset.toomanyaborts ? (out << to_string(toomanyaborts)) : (out << "")); + out << ", " << "state="; (__isset.state ? (out << to_string(state)) : (out << "")); + out << ", " << "workerId="; (__isset.workerId ? (out << to_string(workerId)) : (out << "")); + out << ", " << "start="; (__isset.start ? (out << to_string(start)) : (out << "")); + out << ", " << "highestWriteId="; (__isset.highestWriteId ? (out << to_string(highestWriteId)) : (out << "")); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ", " << "hasoldabort="; (__isset.hasoldabort ? (out << to_string(hasoldabort)) : (out << "")); + out << ", " << "enqueueTime="; (__isset.enqueueTime ? (out << to_string(enqueueTime)) : (out << "")); + out << ", " << "retryRetention="; (__isset.retryRetention ? (out << to_string(retryRetention)) : (out << "")); + out << ", " << "poolname="; (__isset.poolname ? (out << to_string(poolname)) : (out << "")); + out << ", " << "numberOfBuckets="; (__isset.numberOfBuckets ? (out << to_string(numberOfBuckets)) : (out << "")); + out << ", " << "orderByClause="; (__isset.orderByClause ? (out << to_string(orderByClause)) : (out << "")); + out << ")"; +} + + +OptionalCompactionInfoStruct::~OptionalCompactionInfoStruct() noexcept { +} + +OptionalCompactionInfoStruct::OptionalCompactionInfoStruct() noexcept { +} + +void OptionalCompactionInfoStruct::__set_ci(const CompactionInfoStruct& val) { + this->ci = val; +__isset.ci = true; +} +std::ostream& operator<<(std::ostream& out, const OptionalCompactionInfoStruct& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t OptionalCompactionInfoStruct::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ci.read(iprot); + this->__isset.ci = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t OptionalCompactionInfoStruct::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("OptionalCompactionInfoStruct"); + + if (this->__isset.ci) { + xfer += oprot->writeFieldBegin("ci", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ci.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(OptionalCompactionInfoStruct &a, OptionalCompactionInfoStruct &b) noexcept { + using ::std::swap; + swap(a.ci, b.ci); + swap(a.__isset, b.__isset); +} + +bool OptionalCompactionInfoStruct::operator==(const OptionalCompactionInfoStruct & rhs) const +{ + if (__isset.ci != rhs.__isset.ci) + return false; + else if (__isset.ci && !(ci == rhs.ci)) + return false; + return true; +} + +OptionalCompactionInfoStruct::OptionalCompactionInfoStruct(const OptionalCompactionInfoStruct& other1039) { + ci = other1039.ci; + __isset = other1039.__isset; +} +OptionalCompactionInfoStruct& OptionalCompactionInfoStruct::operator=(const OptionalCompactionInfoStruct& other1040) { + ci = other1040.ci; + __isset = other1040.__isset; + return *this; +} +void OptionalCompactionInfoStruct::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "OptionalCompactionInfoStruct("; + out << "ci="; (__isset.ci ? (out << to_string(ci)) : (out << "")); + out << ")"; +} + + +CompactionMetricsDataStruct::~CompactionMetricsDataStruct() noexcept { +} + +CompactionMetricsDataStruct::CompactionMetricsDataStruct() noexcept + : dbname(), + tblname(), + partitionname(), + type(static_cast(0)), + metricvalue(0), + version(0), + threshold(0) { +} + +void CompactionMetricsDataStruct::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void CompactionMetricsDataStruct::__set_tblname(const std::string& val) { + this->tblname = val; +} + +void CompactionMetricsDataStruct::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} + +void CompactionMetricsDataStruct::__set_type(const CompactionMetricsMetricType::type val) { + this->type = val; +} + +void CompactionMetricsDataStruct::__set_metricvalue(const int32_t val) { + this->metricvalue = val; +} + +void CompactionMetricsDataStruct::__set_version(const int32_t val) { + this->version = val; +} + +void CompactionMetricsDataStruct::__set_threshold(const int32_t val) { + this->threshold = val; +} +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataStruct& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionMetricsDataStruct::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbname = false; + bool isset_tblname = false; + bool isset_type = false; + bool isset_metricvalue = false; + bool isset_version = false; + bool isset_threshold = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblname); + isset_tblname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1041; + xfer += iprot->readI32(ecast1041); + this->type = static_cast(ecast1041); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->metricvalue); + isset_metricvalue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->version); + isset_version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->threshold); + isset_threshold = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_metricvalue) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_version) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_threshold) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CompactionMetricsDataStruct::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionMetricsDataStruct"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblname", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblname); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("metricvalue", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->metricvalue); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(this->version); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("threshold", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(this->threshold); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionMetricsDataStruct &a, CompactionMetricsDataStruct &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tblname, b.tblname); + swap(a.partitionname, b.partitionname); + swap(a.type, b.type); + swap(a.metricvalue, b.metricvalue); + swap(a.version, b.version); + swap(a.threshold, b.threshold); + swap(a.__isset, b.__isset); +} + +bool CompactionMetricsDataStruct::operator==(const CompactionMetricsDataStruct & rhs) const +{ + if (!(dbname == rhs.dbname)) + return false; + if (!(tblname == rhs.tblname)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + if (!(type == rhs.type)) + return false; + if (!(metricvalue == rhs.metricvalue)) + return false; + if (!(version == rhs.version)) + return false; + if (!(threshold == rhs.threshold)) + return false; + return true; +} + +CompactionMetricsDataStruct::CompactionMetricsDataStruct(const CompactionMetricsDataStruct& other1042) { + dbname = other1042.dbname; + tblname = other1042.tblname; + partitionname = other1042.partitionname; + type = other1042.type; + metricvalue = other1042.metricvalue; + version = other1042.version; + threshold = other1042.threshold; + __isset = other1042.__isset; +} +CompactionMetricsDataStruct& CompactionMetricsDataStruct::operator=(const CompactionMetricsDataStruct& other1043) { + dbname = other1043.dbname; + tblname = other1043.tblname; + partitionname = other1043.partitionname; + type = other1043.type; + metricvalue = other1043.metricvalue; + version = other1043.version; + threshold = other1043.threshold; + __isset = other1043.__isset; + return *this; +} +void CompactionMetricsDataStruct::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionMetricsDataStruct("; + out << "dbname=" << to_string(dbname); + out << ", " << "tblname=" << to_string(tblname); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ", " << "type=" << to_string(type); + out << ", " << "metricvalue=" << to_string(metricvalue); + out << ", " << "version=" << to_string(version); + out << ", " << "threshold=" << to_string(threshold); + out << ")"; +} + + +CompactionMetricsDataResponse::~CompactionMetricsDataResponse() noexcept { +} + +CompactionMetricsDataResponse::CompactionMetricsDataResponse() noexcept { +} + +void CompactionMetricsDataResponse::__set_data(const CompactionMetricsDataStruct& val) { + this->data = val; +__isset.data = true; +} +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionMetricsDataResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->data.read(iprot); + this->__isset.data = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t CompactionMetricsDataResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionMetricsDataResponse"); + + if (this->__isset.data) { + xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->data.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionMetricsDataResponse &a, CompactionMetricsDataResponse &b) noexcept { + using ::std::swap; + swap(a.data, b.data); + swap(a.__isset, b.__isset); +} + +bool CompactionMetricsDataResponse::operator==(const CompactionMetricsDataResponse & rhs) const +{ + if (__isset.data != rhs.__isset.data) + return false; + else if (__isset.data && !(data == rhs.data)) + return false; + return true; +} + +CompactionMetricsDataResponse::CompactionMetricsDataResponse(const CompactionMetricsDataResponse& other1044) { + data = other1044.data; + __isset = other1044.__isset; +} +CompactionMetricsDataResponse& CompactionMetricsDataResponse::operator=(const CompactionMetricsDataResponse& other1045) { + data = other1045.data; + __isset = other1045.__isset; + return *this; +} +void CompactionMetricsDataResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionMetricsDataResponse("; + out << "data="; (__isset.data ? (out << to_string(data)) : (out << "")); + out << ")"; +} + + +CompactionMetricsDataRequest::~CompactionMetricsDataRequest() noexcept { +} + +CompactionMetricsDataRequest::CompactionMetricsDataRequest() noexcept + : dbName(), + tblName(), + partitionName(), + type(static_cast(0)) { +} + +void CompactionMetricsDataRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void CompactionMetricsDataRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void CompactionMetricsDataRequest::__set_partitionName(const std::string& val) { + this->partitionName = val; +__isset.partitionName = true; +} + +void CompactionMetricsDataRequest::__set_type(const CompactionMetricsMetricType::type val) { + this->type = val; +} +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionMetricsDataRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionName); + this->__isset.partitionName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1046; + xfer += iprot->readI32(ecast1046); + this->type = static_cast(ecast1046); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CompactionMetricsDataRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionMetricsDataRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionName) { + xfer += oprot->writeFieldBegin("partitionName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partitionName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionMetricsDataRequest &a, CompactionMetricsDataRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partitionName, b.partitionName); + swap(a.type, b.type); + swap(a.__isset, b.__isset); +} + +bool CompactionMetricsDataRequest::operator==(const CompactionMetricsDataRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.partitionName != rhs.__isset.partitionName) + return false; + else if (__isset.partitionName && !(partitionName == rhs.partitionName)) + return false; + if (!(type == rhs.type)) + return false; + return true; +} + +CompactionMetricsDataRequest::CompactionMetricsDataRequest(const CompactionMetricsDataRequest& other1047) { + dbName = other1047.dbName; + tblName = other1047.tblName; + partitionName = other1047.partitionName; + type = other1047.type; + __isset = other1047.__isset; +} +CompactionMetricsDataRequest& CompactionMetricsDataRequest::operator=(const CompactionMetricsDataRequest& other1048) { + dbName = other1048.dbName; + tblName = other1048.tblName; + partitionName = other1048.partitionName; + type = other1048.type; + __isset = other1048.__isset; + return *this; +} +void CompactionMetricsDataRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionMetricsDataRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partitionName="; (__isset.partitionName ? (out << to_string(partitionName)) : (out << "")); + out << ", " << "type=" << to_string(type); + out << ")"; +} + + +CompactionResponse::~CompactionResponse() noexcept { +} + +CompactionResponse::CompactionResponse() noexcept + : id(0), + state(), + accepted(0), + errormessage() { +} + +void CompactionResponse::__set_id(const int64_t val) { + this->id = val; +} + +void CompactionResponse::__set_state(const std::string& val) { + this->state = val; +} + +void CompactionResponse::__set_accepted(const bool val) { + this->accepted = val; +} + +void CompactionResponse::__set_errormessage(const std::string& val) { + this->errormessage = val; +__isset.errormessage = true; +} +std::ostream& operator<<(std::ostream& out, const CompactionResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_id = false; + bool isset_state = false; + bool isset_accepted = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + isset_id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->state); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->accepted); + isset_accepted = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errormessage); + this->__isset.errormessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_id) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_accepted) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CompactionResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionResponse"); + + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->state); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("accepted", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->accepted); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.errormessage) { + xfer += oprot->writeFieldBegin("errormessage", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->errormessage); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionResponse &a, CompactionResponse &b) noexcept { + using ::std::swap; + swap(a.id, b.id); + swap(a.state, b.state); + swap(a.accepted, b.accepted); + swap(a.errormessage, b.errormessage); + swap(a.__isset, b.__isset); +} + +bool CompactionResponse::operator==(const CompactionResponse & rhs) const +{ + if (!(id == rhs.id)) + return false; + if (!(state == rhs.state)) + return false; + if (!(accepted == rhs.accepted)) + return false; + if (__isset.errormessage != rhs.__isset.errormessage) + return false; + else if (__isset.errormessage && !(errormessage == rhs.errormessage)) + return false; + return true; +} + +CompactionResponse::CompactionResponse(const CompactionResponse& other1049) { + id = other1049.id; + state = other1049.state; + accepted = other1049.accepted; + errormessage = other1049.errormessage; + __isset = other1049.__isset; +} +CompactionResponse& CompactionResponse::operator=(const CompactionResponse& other1050) { + id = other1050.id; + state = other1050.state; + accepted = other1050.accepted; + errormessage = other1050.errormessage; + __isset = other1050.__isset; + return *this; +} +void CompactionResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionResponse("; + out << "id=" << to_string(id); + out << ", " << "state=" << to_string(state); + out << ", " << "accepted=" << to_string(accepted); + out << ", " << "errormessage="; (__isset.errormessage ? (out << to_string(errormessage)) : (out << "")); + out << ")"; +} + + +ShowCompactRequest::~ShowCompactRequest() noexcept { +} + +ShowCompactRequest::ShowCompactRequest() noexcept + : id(0), + poolName(), + dbName(), + tbName(), + partName(), + type(static_cast(0)), + state(), + limit(0), + order() { +} + +void ShowCompactRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void ShowCompactRequest::__set_poolName(const std::string& val) { + this->poolName = val; +__isset.poolName = true; +} + +void ShowCompactRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} + +void ShowCompactRequest::__set_tbName(const std::string& val) { + this->tbName = val; +__isset.tbName = true; +} + +void ShowCompactRequest::__set_partName(const std::string& val) { + this->partName = val; +__isset.partName = true; +} + +void ShowCompactRequest::__set_type(const CompactionType::type val) { + this->type = val; +__isset.type = true; +} + +void ShowCompactRequest::__set_state(const std::string& val) { + this->state = val; +__isset.state = true; +} + +void ShowCompactRequest::__set_limit(const int64_t val) { + this->limit = val; +__isset.limit = true; +} + +void ShowCompactRequest::__set_order(const std::string& val) { + this->order = val; +__isset.order = true; +} +std::ostream& operator<<(std::ostream& out, const ShowCompactRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowCompactRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolName); + this->__isset.poolName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbName); + this->__isset.tbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partName); + this->__isset.partName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1051; + xfer += iprot->readI32(ecast1051); + this->type = static_cast(ecast1051); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->state); + this->__isset.state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->limit); + this->__isset.limit = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->order); + this->__isset.order = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ShowCompactRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowCompactRequest"); + + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolName) { + xfer += oprot->writeFieldBegin("poolName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->poolName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tbName) { + xfer += oprot->writeFieldBegin("tbName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partName) { + xfer += oprot->writeFieldBegin("partName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->partName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.state) { + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->state); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.limit) { + xfer += oprot->writeFieldBegin("limit", ::apache::thrift::protocol::T_I64, 8); + xfer += oprot->writeI64(this->limit); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.order) { + xfer += oprot->writeFieldBegin("order", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->order); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowCompactRequest &a, ShowCompactRequest &b) noexcept { + using ::std::swap; + swap(a.id, b.id); + swap(a.poolName, b.poolName); + swap(a.dbName, b.dbName); + swap(a.tbName, b.tbName); + swap(a.partName, b.partName); + swap(a.type, b.type); + swap(a.state, b.state); + swap(a.limit, b.limit); + swap(a.order, b.order); + swap(a.__isset, b.__isset); +} + +bool ShowCompactRequest::operator==(const ShowCompactRequest & rhs) const +{ + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.poolName != rhs.__isset.poolName) + return false; + else if (__isset.poolName && !(poolName == rhs.poolName)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + if (__isset.tbName != rhs.__isset.tbName) + return false; + else if (__isset.tbName && !(tbName == rhs.tbName)) + return false; + if (__isset.partName != rhs.__isset.partName) + return false; + else if (__isset.partName && !(partName == rhs.partName)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + if (__isset.state != rhs.__isset.state) + return false; + else if (__isset.state && !(state == rhs.state)) + return false; + if (__isset.limit != rhs.__isset.limit) + return false; + else if (__isset.limit && !(limit == rhs.limit)) + return false; + if (__isset.order != rhs.__isset.order) + return false; + else if (__isset.order && !(order == rhs.order)) + return false; + return true; +} + +ShowCompactRequest::ShowCompactRequest(const ShowCompactRequest& other1052) { + id = other1052.id; + poolName = other1052.poolName; + dbName = other1052.dbName; + tbName = other1052.tbName; + partName = other1052.partName; + type = other1052.type; + state = other1052.state; + limit = other1052.limit; + order = other1052.order; + __isset = other1052.__isset; +} +ShowCompactRequest& ShowCompactRequest::operator=(const ShowCompactRequest& other1053) { + id = other1053.id; + poolName = other1053.poolName; + dbName = other1053.dbName; + tbName = other1053.tbName; + partName = other1053.partName; + type = other1053.type; + state = other1053.state; + limit = other1053.limit; + order = other1053.order; + __isset = other1053.__isset; + return *this; +} +void ShowCompactRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowCompactRequest("; + out << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "poolName="; (__isset.poolName ? (out << to_string(poolName)) : (out << "")); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ", " << "tbName="; (__isset.tbName ? (out << to_string(tbName)) : (out << "")); + out << ", " << "partName="; (__isset.partName ? (out << to_string(partName)) : (out << "")); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ", " << "state="; (__isset.state ? (out << to_string(state)) : (out << "")); + out << ", " << "limit="; (__isset.limit ? (out << to_string(limit)) : (out << "")); + out << ", " << "order="; (__isset.order ? (out << to_string(order)) : (out << "")); + out << ")"; +} + + +ShowCompactResponseElement::~ShowCompactResponseElement() noexcept { +} + +ShowCompactResponseElement::ShowCompactResponseElement() : dbname(), + tablename(), + partitionname(), + type(static_cast(0)), + state(), + workerid(), + start(0), + runAs(), + hightestTxnId(0), + metaInfo(), + endTime(0), + hadoopJobId("None"), + id(0), + errorMessage(), + enqueueTime(0), + workerVersion(), + initiatorId(), + initiatorVersion(), + cleanerStart(0), + poolName(), + nextTxnId(0), + txnId(0), + commitTime(0), + hightestWriteId(0) { +} + +void ShowCompactResponseElement::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void ShowCompactResponseElement::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void ShowCompactResponseElement::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} + +void ShowCompactResponseElement::__set_type(const CompactionType::type val) { + this->type = val; +} + +void ShowCompactResponseElement::__set_state(const std::string& val) { + this->state = val; +} + +void ShowCompactResponseElement::__set_workerid(const std::string& val) { + this->workerid = val; +__isset.workerid = true; +} + +void ShowCompactResponseElement::__set_start(const int64_t val) { + this->start = val; +__isset.start = true; +} + +void ShowCompactResponseElement::__set_runAs(const std::string& val) { + this->runAs = val; +__isset.runAs = true; +} + +void ShowCompactResponseElement::__set_hightestTxnId(const int64_t val) { + this->hightestTxnId = val; +__isset.hightestTxnId = true; +} + +void ShowCompactResponseElement::__set_metaInfo(const std::string& val) { + this->metaInfo = val; +__isset.metaInfo = true; +} + +void ShowCompactResponseElement::__set_endTime(const int64_t val) { + this->endTime = val; +__isset.endTime = true; +} + +void ShowCompactResponseElement::__set_hadoopJobId(const std::string& val) { + this->hadoopJobId = val; +__isset.hadoopJobId = true; +} + +void ShowCompactResponseElement::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void ShowCompactResponseElement::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} + +void ShowCompactResponseElement::__set_enqueueTime(const int64_t val) { + this->enqueueTime = val; +__isset.enqueueTime = true; +} + +void ShowCompactResponseElement::__set_workerVersion(const std::string& val) { + this->workerVersion = val; +__isset.workerVersion = true; +} + +void ShowCompactResponseElement::__set_initiatorId(const std::string& val) { + this->initiatorId = val; +__isset.initiatorId = true; +} + +void ShowCompactResponseElement::__set_initiatorVersion(const std::string& val) { + this->initiatorVersion = val; +__isset.initiatorVersion = true; +} + +void ShowCompactResponseElement::__set_cleanerStart(const int64_t val) { + this->cleanerStart = val; +__isset.cleanerStart = true; +} + +void ShowCompactResponseElement::__set_poolName(const std::string& val) { + this->poolName = val; +__isset.poolName = true; +} + +void ShowCompactResponseElement::__set_nextTxnId(const int64_t val) { + this->nextTxnId = val; +__isset.nextTxnId = true; +} + +void ShowCompactResponseElement::__set_txnId(const int64_t val) { + this->txnId = val; +__isset.txnId = true; +} + +void ShowCompactResponseElement::__set_commitTime(const int64_t val) { + this->commitTime = val; +__isset.commitTime = true; +} + +void ShowCompactResponseElement::__set_hightestWriteId(const int64_t val) { + this->hightestWriteId = val; +__isset.hightestWriteId = true; +} +std::ostream& operator<<(std::ostream& out, const ShowCompactResponseElement& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowCompactResponseElement::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbname = false; + bool isset_tablename = false; + bool isset_type = false; + bool isset_state = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1054; + xfer += iprot->readI32(ecast1054); + this->type = static_cast(ecast1054); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->state); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerid); + this->__isset.workerid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->start); + this->__isset.start = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->runAs); + this->__isset.runAs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->hightestTxnId); + this->__isset.hightestTxnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->metaInfo); + this->__isset.metaInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->endTime); + this->__isset.endTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->hadoopJobId); + this->__isset.hadoopJobId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->enqueueTime); + this->__isset.enqueueTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 16: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerVersion); + this->__isset.workerVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 17: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->initiatorId); + this->__isset.initiatorId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 18: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->initiatorVersion); + this->__isset.initiatorVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 19: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->cleanerStart); + this->__isset.cleanerStart = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 20: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolName); + this->__isset.poolName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 21: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->nextTxnId); + this->__isset.nextTxnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 22: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 23: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->commitTime); + this->__isset.commitTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 24: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->hightestWriteId); + this->__isset.hightestWriteId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ShowCompactResponseElement::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowCompactResponseElement"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->state); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.workerid) { + xfer += oprot->writeFieldBegin("workerid", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->workerid); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.start) { + xfer += oprot->writeFieldBegin("start", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->start); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.runAs) { + xfer += oprot->writeFieldBegin("runAs", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->runAs); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.hightestTxnId) { + xfer += oprot->writeFieldBegin("hightestTxnId", ::apache::thrift::protocol::T_I64, 9); + xfer += oprot->writeI64(this->hightestTxnId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.metaInfo) { + xfer += oprot->writeFieldBegin("metaInfo", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->metaInfo); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.endTime) { + xfer += oprot->writeFieldBegin("endTime", ::apache::thrift::protocol::T_I64, 11); + xfer += oprot->writeI64(this->endTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.hadoopJobId) { + xfer += oprot->writeFieldBegin("hadoopJobId", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->hadoopJobId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 13); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 14); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.enqueueTime) { + xfer += oprot->writeFieldBegin("enqueueTime", ::apache::thrift::protocol::T_I64, 15); + xfer += oprot->writeI64(this->enqueueTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.workerVersion) { + xfer += oprot->writeFieldBegin("workerVersion", ::apache::thrift::protocol::T_STRING, 16); + xfer += oprot->writeString(this->workerVersion); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.initiatorId) { + xfer += oprot->writeFieldBegin("initiatorId", ::apache::thrift::protocol::T_STRING, 17); + xfer += oprot->writeString(this->initiatorId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.initiatorVersion) { + xfer += oprot->writeFieldBegin("initiatorVersion", ::apache::thrift::protocol::T_STRING, 18); + xfer += oprot->writeString(this->initiatorVersion); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.cleanerStart) { + xfer += oprot->writeFieldBegin("cleanerStart", ::apache::thrift::protocol::T_I64, 19); + xfer += oprot->writeI64(this->cleanerStart); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolName) { + xfer += oprot->writeFieldBegin("poolName", ::apache::thrift::protocol::T_STRING, 20); + xfer += oprot->writeString(this->poolName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.nextTxnId) { + xfer += oprot->writeFieldBegin("nextTxnId", ::apache::thrift::protocol::T_I64, 21); + xfer += oprot->writeI64(this->nextTxnId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnId) { + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 22); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.commitTime) { + xfer += oprot->writeFieldBegin("commitTime", ::apache::thrift::protocol::T_I64, 23); + xfer += oprot->writeI64(this->commitTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.hightestWriteId) { + xfer += oprot->writeFieldBegin("hightestWriteId", ::apache::thrift::protocol::T_I64, 24); + xfer += oprot->writeI64(this->hightestWriteId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowCompactResponseElement &a, ShowCompactResponseElement &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionname, b.partitionname); + swap(a.type, b.type); + swap(a.state, b.state); + swap(a.workerid, b.workerid); + swap(a.start, b.start); + swap(a.runAs, b.runAs); + swap(a.hightestTxnId, b.hightestTxnId); + swap(a.metaInfo, b.metaInfo); + swap(a.endTime, b.endTime); + swap(a.hadoopJobId, b.hadoopJobId); + swap(a.id, b.id); + swap(a.errorMessage, b.errorMessage); + swap(a.enqueueTime, b.enqueueTime); + swap(a.workerVersion, b.workerVersion); + swap(a.initiatorId, b.initiatorId); + swap(a.initiatorVersion, b.initiatorVersion); + swap(a.cleanerStart, b.cleanerStart); + swap(a.poolName, b.poolName); + swap(a.nextTxnId, b.nextTxnId); + swap(a.txnId, b.txnId); + swap(a.commitTime, b.commitTime); + swap(a.hightestWriteId, b.hightestWriteId); + swap(a.__isset, b.__isset); +} + +bool ShowCompactResponseElement::operator==(const ShowCompactResponseElement & rhs) const +{ + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + if (!(type == rhs.type)) + return false; + if (!(state == rhs.state)) + return false; + if (__isset.workerid != rhs.__isset.workerid) + return false; + else if (__isset.workerid && !(workerid == rhs.workerid)) + return false; + if (__isset.start != rhs.__isset.start) + return false; + else if (__isset.start && !(start == rhs.start)) + return false; + if (__isset.runAs != rhs.__isset.runAs) + return false; + else if (__isset.runAs && !(runAs == rhs.runAs)) + return false; + if (__isset.hightestTxnId != rhs.__isset.hightestTxnId) + return false; + else if (__isset.hightestTxnId && !(hightestTxnId == rhs.hightestTxnId)) + return false; + if (__isset.metaInfo != rhs.__isset.metaInfo) + return false; + else if (__isset.metaInfo && !(metaInfo == rhs.metaInfo)) + return false; + if (__isset.endTime != rhs.__isset.endTime) + return false; + else if (__isset.endTime && !(endTime == rhs.endTime)) + return false; + if (__isset.hadoopJobId != rhs.__isset.hadoopJobId) + return false; + else if (__isset.hadoopJobId && !(hadoopJobId == rhs.hadoopJobId)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + if (__isset.enqueueTime != rhs.__isset.enqueueTime) + return false; + else if (__isset.enqueueTime && !(enqueueTime == rhs.enqueueTime)) + return false; + if (__isset.workerVersion != rhs.__isset.workerVersion) + return false; + else if (__isset.workerVersion && !(workerVersion == rhs.workerVersion)) + return false; + if (__isset.initiatorId != rhs.__isset.initiatorId) + return false; + else if (__isset.initiatorId && !(initiatorId == rhs.initiatorId)) + return false; + if (__isset.initiatorVersion != rhs.__isset.initiatorVersion) + return false; + else if (__isset.initiatorVersion && !(initiatorVersion == rhs.initiatorVersion)) + return false; + if (__isset.cleanerStart != rhs.__isset.cleanerStart) + return false; + else if (__isset.cleanerStart && !(cleanerStart == rhs.cleanerStart)) + return false; + if (__isset.poolName != rhs.__isset.poolName) + return false; + else if (__isset.poolName && !(poolName == rhs.poolName)) + return false; + if (__isset.nextTxnId != rhs.__isset.nextTxnId) + return false; + else if (__isset.nextTxnId && !(nextTxnId == rhs.nextTxnId)) + return false; + if (__isset.txnId != rhs.__isset.txnId) + return false; + else if (__isset.txnId && !(txnId == rhs.txnId)) + return false; + if (__isset.commitTime != rhs.__isset.commitTime) + return false; + else if (__isset.commitTime && !(commitTime == rhs.commitTime)) + return false; + if (__isset.hightestWriteId != rhs.__isset.hightestWriteId) + return false; + else if (__isset.hightestWriteId && !(hightestWriteId == rhs.hightestWriteId)) + return false; + return true; +} + +ShowCompactResponseElement::ShowCompactResponseElement(const ShowCompactResponseElement& other1055) { + dbname = other1055.dbname; + tablename = other1055.tablename; + partitionname = other1055.partitionname; + type = other1055.type; + state = other1055.state; + workerid = other1055.workerid; + start = other1055.start; + runAs = other1055.runAs; + hightestTxnId = other1055.hightestTxnId; + metaInfo = other1055.metaInfo; + endTime = other1055.endTime; + hadoopJobId = other1055.hadoopJobId; + id = other1055.id; + errorMessage = other1055.errorMessage; + enqueueTime = other1055.enqueueTime; + workerVersion = other1055.workerVersion; + initiatorId = other1055.initiatorId; + initiatorVersion = other1055.initiatorVersion; + cleanerStart = other1055.cleanerStart; + poolName = other1055.poolName; + nextTxnId = other1055.nextTxnId; + txnId = other1055.txnId; + commitTime = other1055.commitTime; + hightestWriteId = other1055.hightestWriteId; + __isset = other1055.__isset; +} +ShowCompactResponseElement& ShowCompactResponseElement::operator=(const ShowCompactResponseElement& other1056) { + dbname = other1056.dbname; + tablename = other1056.tablename; + partitionname = other1056.partitionname; + type = other1056.type; + state = other1056.state; + workerid = other1056.workerid; + start = other1056.start; + runAs = other1056.runAs; + hightestTxnId = other1056.hightestTxnId; + metaInfo = other1056.metaInfo; + endTime = other1056.endTime; + hadoopJobId = other1056.hadoopJobId; + id = other1056.id; + errorMessage = other1056.errorMessage; + enqueueTime = other1056.enqueueTime; + workerVersion = other1056.workerVersion; + initiatorId = other1056.initiatorId; + initiatorVersion = other1056.initiatorVersion; + cleanerStart = other1056.cleanerStart; + poolName = other1056.poolName; + nextTxnId = other1056.nextTxnId; + txnId = other1056.txnId; + commitTime = other1056.commitTime; + hightestWriteId = other1056.hightestWriteId; + __isset = other1056.__isset; + return *this; +} +void ShowCompactResponseElement::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowCompactResponseElement("; + out << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ", " << "type=" << to_string(type); + out << ", " << "state=" << to_string(state); + out << ", " << "workerid="; (__isset.workerid ? (out << to_string(workerid)) : (out << "")); + out << ", " << "start="; (__isset.start ? (out << to_string(start)) : (out << "")); + out << ", " << "runAs="; (__isset.runAs ? (out << to_string(runAs)) : (out << "")); + out << ", " << "hightestTxnId="; (__isset.hightestTxnId ? (out << to_string(hightestTxnId)) : (out << "")); + out << ", " << "metaInfo="; (__isset.metaInfo ? (out << to_string(metaInfo)) : (out << "")); + out << ", " << "endTime="; (__isset.endTime ? (out << to_string(endTime)) : (out << "")); + out << ", " << "hadoopJobId="; (__isset.hadoopJobId ? (out << to_string(hadoopJobId)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ", " << "enqueueTime="; (__isset.enqueueTime ? (out << to_string(enqueueTime)) : (out << "")); + out << ", " << "workerVersion="; (__isset.workerVersion ? (out << to_string(workerVersion)) : (out << "")); + out << ", " << "initiatorId="; (__isset.initiatorId ? (out << to_string(initiatorId)) : (out << "")); + out << ", " << "initiatorVersion="; (__isset.initiatorVersion ? (out << to_string(initiatorVersion)) : (out << "")); + out << ", " << "cleanerStart="; (__isset.cleanerStart ? (out << to_string(cleanerStart)) : (out << "")); + out << ", " << "poolName="; (__isset.poolName ? (out << to_string(poolName)) : (out << "")); + out << ", " << "nextTxnId="; (__isset.nextTxnId ? (out << to_string(nextTxnId)) : (out << "")); + out << ", " << "txnId="; (__isset.txnId ? (out << to_string(txnId)) : (out << "")); + out << ", " << "commitTime="; (__isset.commitTime ? (out << to_string(commitTime)) : (out << "")); + out << ", " << "hightestWriteId="; (__isset.hightestWriteId ? (out << to_string(hightestWriteId)) : (out << "")); + out << ")"; +} + + +ShowCompactResponse::~ShowCompactResponse() noexcept { +} + +ShowCompactResponse::ShowCompactResponse() noexcept { +} + +void ShowCompactResponse::__set_compacts(const std::vector & val) { + this->compacts = val; +} +std::ostream& operator<<(std::ostream& out, const ShowCompactResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ShowCompactResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_compacts = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->compacts.clear(); + uint32_t _size1057; + ::apache::thrift::protocol::TType _etype1060; + xfer += iprot->readListBegin(_etype1060, _size1057); + this->compacts.resize(_size1057); + uint32_t _i1061; + for (_i1061 = 0; _i1061 < _size1057; ++_i1061) + { + xfer += this->compacts[_i1061].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_compacts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_compacts) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ShowCompactResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ShowCompactResponse"); + + xfer += oprot->writeFieldBegin("compacts", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->compacts.size())); + std::vector ::const_iterator _iter1062; + for (_iter1062 = this->compacts.begin(); _iter1062 != this->compacts.end(); ++_iter1062) + { + xfer += (*_iter1062).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ShowCompactResponse &a, ShowCompactResponse &b) noexcept { + using ::std::swap; + swap(a.compacts, b.compacts); +} + +bool ShowCompactResponse::operator==(const ShowCompactResponse & rhs) const +{ + if (!(compacts == rhs.compacts)) + return false; + return true; +} + +ShowCompactResponse::ShowCompactResponse(const ShowCompactResponse& other1063) { + compacts = other1063.compacts; +} +ShowCompactResponse& ShowCompactResponse::operator=(const ShowCompactResponse& other1064) { + compacts = other1064.compacts; + return *this; +} +void ShowCompactResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ShowCompactResponse("; + out << "compacts=" << to_string(compacts); + out << ")"; +} + + +AbortCompactionRequest::~AbortCompactionRequest() noexcept { +} + +AbortCompactionRequest::AbortCompactionRequest() noexcept + : type(), + poolName() { +} + +void AbortCompactionRequest::__set_compactionIds(const std::vector & val) { + this->compactionIds = val; +} + +void AbortCompactionRequest::__set_type(const std::string& val) { + this->type = val; +__isset.type = true; +} + +void AbortCompactionRequest::__set_poolName(const std::string& val) { + this->poolName = val; +__isset.poolName = true; +} +std::ostream& operator<<(std::ostream& out, const AbortCompactionRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AbortCompactionRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_compactionIds = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->compactionIds.clear(); + uint32_t _size1065; + ::apache::thrift::protocol::TType _etype1068; + xfer += iprot->readListBegin(_etype1068, _size1065); + this->compactionIds.resize(_size1065); + uint32_t _i1069; + for (_i1069 = 0; _i1069 < _size1065; ++_i1069) + { + xfer += iprot->readI64(this->compactionIds[_i1069]); + } + xfer += iprot->readListEnd(); + } + isset_compactionIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolName); + this->__isset.poolName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_compactionIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AbortCompactionRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AbortCompactionRequest"); + + xfer += oprot->writeFieldBegin("compactionIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->compactionIds.size())); + std::vector ::const_iterator _iter1070; + for (_iter1070 = this->compactionIds.begin(); _iter1070 != this->compactionIds.end(); ++_iter1070) + { + xfer += oprot->writeI64((*_iter1070)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->type); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolName) { + xfer += oprot->writeFieldBegin("poolName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->poolName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AbortCompactionRequest &a, AbortCompactionRequest &b) noexcept { + using ::std::swap; + swap(a.compactionIds, b.compactionIds); + swap(a.type, b.type); + swap(a.poolName, b.poolName); + swap(a.__isset, b.__isset); +} + +bool AbortCompactionRequest::operator==(const AbortCompactionRequest & rhs) const +{ + if (!(compactionIds == rhs.compactionIds)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + if (__isset.poolName != rhs.__isset.poolName) + return false; + else if (__isset.poolName && !(poolName == rhs.poolName)) + return false; + return true; +} + +AbortCompactionRequest::AbortCompactionRequest(const AbortCompactionRequest& other1071) { + compactionIds = other1071.compactionIds; + type = other1071.type; + poolName = other1071.poolName; + __isset = other1071.__isset; +} +AbortCompactionRequest& AbortCompactionRequest::operator=(const AbortCompactionRequest& other1072) { + compactionIds = other1072.compactionIds; + type = other1072.type; + poolName = other1072.poolName; + __isset = other1072.__isset; + return *this; +} +void AbortCompactionRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AbortCompactionRequest("; + out << "compactionIds=" << to_string(compactionIds); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ", " << "poolName="; (__isset.poolName ? (out << to_string(poolName)) : (out << "")); + out << ")"; +} + + +AbortCompactionResponseElement::~AbortCompactionResponseElement() noexcept { +} + +AbortCompactionResponseElement::AbortCompactionResponseElement() noexcept + : compactionId(0), + status(), + message() { +} + +void AbortCompactionResponseElement::__set_compactionId(const int64_t val) { + this->compactionId = val; +} + +void AbortCompactionResponseElement::__set_status(const std::string& val) { + this->status = val; +__isset.status = true; +} + +void AbortCompactionResponseElement::__set_message(const std::string& val) { + this->message = val; +__isset.message = true; +} +std::ostream& operator<<(std::ostream& out, const AbortCompactionResponseElement& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AbortCompactionResponseElement::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_compactionId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->compactionId); + isset_compactionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->status); + this->__isset.status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_compactionId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AbortCompactionResponseElement::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AbortCompactionResponseElement"); + + xfer += oprot->writeFieldBegin("compactionId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->compactionId); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.status) { + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->status); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.message) { + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AbortCompactionResponseElement &a, AbortCompactionResponseElement &b) noexcept { + using ::std::swap; + swap(a.compactionId, b.compactionId); + swap(a.status, b.status); + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool AbortCompactionResponseElement::operator==(const AbortCompactionResponseElement & rhs) const +{ + if (!(compactionId == rhs.compactionId)) + return false; + if (__isset.status != rhs.__isset.status) + return false; + else if (__isset.status && !(status == rhs.status)) + return false; + if (__isset.message != rhs.__isset.message) + return false; + else if (__isset.message && !(message == rhs.message)) + return false; + return true; +} + +AbortCompactionResponseElement::AbortCompactionResponseElement(const AbortCompactionResponseElement& other1073) { + compactionId = other1073.compactionId; + status = other1073.status; + message = other1073.message; + __isset = other1073.__isset; +} +AbortCompactionResponseElement& AbortCompactionResponseElement::operator=(const AbortCompactionResponseElement& other1074) { + compactionId = other1074.compactionId; + status = other1074.status; + message = other1074.message; + __isset = other1074.__isset; + return *this; +} +void AbortCompactionResponseElement::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AbortCompactionResponseElement("; + out << "compactionId=" << to_string(compactionId); + out << ", " << "status="; (__isset.status ? (out << to_string(status)) : (out << "")); + out << ", " << "message="; (__isset.message ? (out << to_string(message)) : (out << "")); + out << ")"; +} + + +AbortCompactResponse::~AbortCompactResponse() noexcept { +} + +AbortCompactResponse::AbortCompactResponse() noexcept { +} + +void AbortCompactResponse::__set_abortedcompacts(const std::map & val) { + this->abortedcompacts = val; +} +std::ostream& operator<<(std::ostream& out, const AbortCompactResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AbortCompactResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_abortedcompacts = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->abortedcompacts.clear(); + uint32_t _size1075; + ::apache::thrift::protocol::TType _ktype1076; + ::apache::thrift::protocol::TType _vtype1077; + xfer += iprot->readMapBegin(_ktype1076, _vtype1077, _size1075); + uint32_t _i1079; + for (_i1079 = 0; _i1079 < _size1075; ++_i1079) + { + int64_t _key1080; + xfer += iprot->readI64(_key1080); + AbortCompactionResponseElement& _val1081 = this->abortedcompacts[_key1080]; + xfer += _val1081.read(iprot); + } + xfer += iprot->readMapEnd(); + } + isset_abortedcompacts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_abortedcompacts) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AbortCompactResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AbortCompactResponse"); + + xfer += oprot->writeFieldBegin("abortedcompacts", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I64, ::apache::thrift::protocol::T_STRUCT, static_cast(this->abortedcompacts.size())); + std::map ::const_iterator _iter1082; + for (_iter1082 = this->abortedcompacts.begin(); _iter1082 != this->abortedcompacts.end(); ++_iter1082) + { + xfer += oprot->writeI64(_iter1082->first); + xfer += _iter1082->second.write(oprot); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AbortCompactResponse &a, AbortCompactResponse &b) noexcept { + using ::std::swap; + swap(a.abortedcompacts, b.abortedcompacts); +} + +bool AbortCompactResponse::operator==(const AbortCompactResponse & rhs) const +{ + if (!(abortedcompacts == rhs.abortedcompacts)) + return false; + return true; +} + +AbortCompactResponse::AbortCompactResponse(const AbortCompactResponse& other1083) { + abortedcompacts = other1083.abortedcompacts; +} +AbortCompactResponse& AbortCompactResponse::operator=(const AbortCompactResponse& other1084) { + abortedcompacts = other1084.abortedcompacts; + return *this; +} +void AbortCompactResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AbortCompactResponse("; + out << "abortedcompacts=" << to_string(abortedcompacts); + out << ")"; +} + + +GetLatestCommittedCompactionInfoRequest::~GetLatestCommittedCompactionInfoRequest() noexcept { +} + +GetLatestCommittedCompactionInfoRequest::GetLatestCommittedCompactionInfoRequest() noexcept + : dbname(), + tablename(), + lastCompactionId(0) { +} + +void GetLatestCommittedCompactionInfoRequest::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void GetLatestCommittedCompactionInfoRequest::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void GetLatestCommittedCompactionInfoRequest::__set_partitionnames(const std::vector & val) { + this->partitionnames = val; +__isset.partitionnames = true; +} + +void GetLatestCommittedCompactionInfoRequest::__set_lastCompactionId(const int64_t val) { + this->lastCompactionId = val; +__isset.lastCompactionId = true; +} +std::ostream& operator<<(std::ostream& out, const GetLatestCommittedCompactionInfoRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetLatestCommittedCompactionInfoRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbname = false; + bool isset_tablename = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionnames.clear(); + uint32_t _size1085; + ::apache::thrift::protocol::TType _etype1088; + xfer += iprot->readListBegin(_etype1088, _size1085); + this->partitionnames.resize(_size1085); + uint32_t _i1089; + for (_i1089 = 0; _i1089 < _size1085; ++_i1089) + { + xfer += iprot->readString(this->partitionnames[_i1089]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionnames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastCompactionId); + this->__isset.lastCompactionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetLatestCommittedCompactionInfoRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetLatestCommittedCompactionInfoRequest"); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionnames) { + xfer += oprot->writeFieldBegin("partitionnames", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionnames.size())); + std::vector ::const_iterator _iter1090; + for (_iter1090 = this->partitionnames.begin(); _iter1090 != this->partitionnames.end(); ++_iter1090) + { + xfer += oprot->writeString((*_iter1090)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.lastCompactionId) { + xfer += oprot->writeFieldBegin("lastCompactionId", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->lastCompactionId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetLatestCommittedCompactionInfoRequest &a, GetLatestCommittedCompactionInfoRequest &b) noexcept { + using ::std::swap; + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionnames, b.partitionnames); + swap(a.lastCompactionId, b.lastCompactionId); + swap(a.__isset, b.__isset); +} + +bool GetLatestCommittedCompactionInfoRequest::operator==(const GetLatestCommittedCompactionInfoRequest & rhs) const +{ + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (__isset.partitionnames != rhs.__isset.partitionnames) + return false; + else if (__isset.partitionnames && !(partitionnames == rhs.partitionnames)) + return false; + if (__isset.lastCompactionId != rhs.__isset.lastCompactionId) + return false; + else if (__isset.lastCompactionId && !(lastCompactionId == rhs.lastCompactionId)) + return false; + return true; +} + +GetLatestCommittedCompactionInfoRequest::GetLatestCommittedCompactionInfoRequest(const GetLatestCommittedCompactionInfoRequest& other1091) { + dbname = other1091.dbname; + tablename = other1091.tablename; + partitionnames = other1091.partitionnames; + lastCompactionId = other1091.lastCompactionId; + __isset = other1091.__isset; +} +GetLatestCommittedCompactionInfoRequest& GetLatestCommittedCompactionInfoRequest::operator=(const GetLatestCommittedCompactionInfoRequest& other1092) { + dbname = other1092.dbname; + tablename = other1092.tablename; + partitionnames = other1092.partitionnames; + lastCompactionId = other1092.lastCompactionId; + __isset = other1092.__isset; + return *this; +} +void GetLatestCommittedCompactionInfoRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetLatestCommittedCompactionInfoRequest("; + out << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "partitionnames="; (__isset.partitionnames ? (out << to_string(partitionnames)) : (out << "")); + out << ", " << "lastCompactionId="; (__isset.lastCompactionId ? (out << to_string(lastCompactionId)) : (out << "")); + out << ")"; +} + + +GetLatestCommittedCompactionInfoResponse::~GetLatestCommittedCompactionInfoResponse() noexcept { +} + +GetLatestCommittedCompactionInfoResponse::GetLatestCommittedCompactionInfoResponse() noexcept { +} + +void GetLatestCommittedCompactionInfoResponse::__set_compactions(const std::vector & val) { + this->compactions = val; +} +std::ostream& operator<<(std::ostream& out, const GetLatestCommittedCompactionInfoResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetLatestCommittedCompactionInfoResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_compactions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->compactions.clear(); + uint32_t _size1093; + ::apache::thrift::protocol::TType _etype1096; + xfer += iprot->readListBegin(_etype1096, _size1093); + this->compactions.resize(_size1093); + uint32_t _i1097; + for (_i1097 = 0; _i1097 < _size1093; ++_i1097) + { + xfer += this->compactions[_i1097].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_compactions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_compactions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetLatestCommittedCompactionInfoResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetLatestCommittedCompactionInfoResponse"); + + xfer += oprot->writeFieldBegin("compactions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->compactions.size())); + std::vector ::const_iterator _iter1098; + for (_iter1098 = this->compactions.begin(); _iter1098 != this->compactions.end(); ++_iter1098) + { + xfer += (*_iter1098).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetLatestCommittedCompactionInfoResponse &a, GetLatestCommittedCompactionInfoResponse &b) noexcept { + using ::std::swap; + swap(a.compactions, b.compactions); +} + +bool GetLatestCommittedCompactionInfoResponse::operator==(const GetLatestCommittedCompactionInfoResponse & rhs) const +{ + if (!(compactions == rhs.compactions)) + return false; + return true; +} + +GetLatestCommittedCompactionInfoResponse::GetLatestCommittedCompactionInfoResponse(const GetLatestCommittedCompactionInfoResponse& other1099) { + compactions = other1099.compactions; +} +GetLatestCommittedCompactionInfoResponse& GetLatestCommittedCompactionInfoResponse::operator=(const GetLatestCommittedCompactionInfoResponse& other1100) { + compactions = other1100.compactions; + return *this; +} +void GetLatestCommittedCompactionInfoResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetLatestCommittedCompactionInfoResponse("; + out << "compactions=" << to_string(compactions); + out << ")"; +} + + +FindNextCompactRequest::~FindNextCompactRequest() noexcept { +} + +FindNextCompactRequest::FindNextCompactRequest() noexcept + : workerId(), + workerVersion(), + poolName() { +} + +void FindNextCompactRequest::__set_workerId(const std::string& val) { + this->workerId = val; +__isset.workerId = true; +} + +void FindNextCompactRequest::__set_workerVersion(const std::string& val) { + this->workerVersion = val; +__isset.workerVersion = true; +} + +void FindNextCompactRequest::__set_poolName(const std::string& val) { + this->poolName = val; +__isset.poolName = true; +} +std::ostream& operator<<(std::ostream& out, const FindNextCompactRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FindNextCompactRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerId); + this->__isset.workerId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->workerVersion); + this->__isset.workerVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolName); + this->__isset.poolName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FindNextCompactRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FindNextCompactRequest"); + + if (this->__isset.workerId) { + xfer += oprot->writeFieldBegin("workerId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->workerId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.workerVersion) { + xfer += oprot->writeFieldBegin("workerVersion", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->workerVersion); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolName) { + xfer += oprot->writeFieldBegin("poolName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->poolName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FindNextCompactRequest &a, FindNextCompactRequest &b) noexcept { + using ::std::swap; + swap(a.workerId, b.workerId); + swap(a.workerVersion, b.workerVersion); + swap(a.poolName, b.poolName); + swap(a.__isset, b.__isset); +} + +bool FindNextCompactRequest::operator==(const FindNextCompactRequest & rhs) const +{ + if (__isset.workerId != rhs.__isset.workerId) + return false; + else if (__isset.workerId && !(workerId == rhs.workerId)) + return false; + if (__isset.workerVersion != rhs.__isset.workerVersion) + return false; + else if (__isset.workerVersion && !(workerVersion == rhs.workerVersion)) + return false; + if (__isset.poolName != rhs.__isset.poolName) + return false; + else if (__isset.poolName && !(poolName == rhs.poolName)) + return false; + return true; +} + +FindNextCompactRequest::FindNextCompactRequest(const FindNextCompactRequest& other1101) { + workerId = other1101.workerId; + workerVersion = other1101.workerVersion; + poolName = other1101.poolName; + __isset = other1101.__isset; +} +FindNextCompactRequest& FindNextCompactRequest::operator=(const FindNextCompactRequest& other1102) { + workerId = other1102.workerId; + workerVersion = other1102.workerVersion; + poolName = other1102.poolName; + __isset = other1102.__isset; + return *this; +} +void FindNextCompactRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FindNextCompactRequest("; + out << "workerId="; (__isset.workerId ? (out << to_string(workerId)) : (out << "")); + out << ", " << "workerVersion="; (__isset.workerVersion ? (out << to_string(workerVersion)) : (out << "")); + out << ", " << "poolName="; (__isset.poolName ? (out << to_string(poolName)) : (out << "")); + out << ")"; +} + + +AddDynamicPartitions::~AddDynamicPartitions() noexcept { +} + +AddDynamicPartitions::AddDynamicPartitions() noexcept + : txnid(0), + writeid(0), + dbname(), + tablename(), + operationType(static_cast(5)) { +} + +void AddDynamicPartitions::__set_txnid(const int64_t val) { + this->txnid = val; +} + +void AddDynamicPartitions::__set_writeid(const int64_t val) { + this->writeid = val; +} + +void AddDynamicPartitions::__set_dbname(const std::string& val) { + this->dbname = val; +} + +void AddDynamicPartitions::__set_tablename(const std::string& val) { + this->tablename = val; +} + +void AddDynamicPartitions::__set_partitionnames(const std::vector & val) { + this->partitionnames = val; +} + +void AddDynamicPartitions::__set_operationType(const DataOperationType::type val) { + this->operationType = val; +__isset.operationType = true; +} +std::ostream& operator<<(std::ostream& out, const AddDynamicPartitions& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddDynamicPartitions::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnid = false; + bool isset_writeid = false; + bool isset_dbname = false; + bool isset_tablename = false; + bool isset_partitionnames = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + isset_txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeid); + isset_writeid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + isset_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + isset_tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionnames.clear(); + uint32_t _size1103; + ::apache::thrift::protocol::TType _etype1106; + xfer += iprot->readListBegin(_etype1106, _size1103); + this->partitionnames.resize(_size1103); + uint32_t _i1107; + for (_i1107 = 0; _i1107 < _size1103; ++_i1107) + { + xfer += iprot->readString(this->partitionnames[_i1107]); + } + xfer += iprot->readListEnd(); + } + isset_partitionnames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1108; + xfer += iprot->readI32(ecast1108); + this->operationType = static_cast(ecast1108); + this->__isset.operationType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnid) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_writeid) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbname) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tablename) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partitionnames) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AddDynamicPartitions::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddDynamicPartitions"); + + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeid", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->writeid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partitionnames", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionnames.size())); + std::vector ::const_iterator _iter1109; + for (_iter1109 = this->partitionnames.begin(); _iter1109 != this->partitionnames.end(); ++_iter1109) + { + xfer += oprot->writeString((*_iter1109)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationType) { + xfer += oprot->writeFieldBegin("operationType", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->operationType)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddDynamicPartitions &a, AddDynamicPartitions &b) noexcept { + using ::std::swap; + swap(a.txnid, b.txnid); + swap(a.writeid, b.writeid); + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionnames, b.partitionnames); + swap(a.operationType, b.operationType); + swap(a.__isset, b.__isset); +} + +bool AddDynamicPartitions::operator==(const AddDynamicPartitions & rhs) const +{ + if (!(txnid == rhs.txnid)) + return false; + if (!(writeid == rhs.writeid)) + return false; + if (!(dbname == rhs.dbname)) + return false; + if (!(tablename == rhs.tablename)) + return false; + if (!(partitionnames == rhs.partitionnames)) + return false; + if (__isset.operationType != rhs.__isset.operationType) + return false; + else if (__isset.operationType && !(operationType == rhs.operationType)) + return false; + return true; +} + +AddDynamicPartitions::AddDynamicPartitions(const AddDynamicPartitions& other1110) { + txnid = other1110.txnid; + writeid = other1110.writeid; + dbname = other1110.dbname; + tablename = other1110.tablename; + partitionnames = other1110.partitionnames; + operationType = other1110.operationType; + __isset = other1110.__isset; +} +AddDynamicPartitions& AddDynamicPartitions::operator=(const AddDynamicPartitions& other1111) { + txnid = other1111.txnid; + writeid = other1111.writeid; + dbname = other1111.dbname; + tablename = other1111.tablename; + partitionnames = other1111.partitionnames; + operationType = other1111.operationType; + __isset = other1111.__isset; + return *this; +} +void AddDynamicPartitions::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddDynamicPartitions("; + out << "txnid=" << to_string(txnid); + out << ", " << "writeid=" << to_string(writeid); + out << ", " << "dbname=" << to_string(dbname); + out << ", " << "tablename=" << to_string(tablename); + out << ", " << "partitionnames=" << to_string(partitionnames); + out << ", " << "operationType="; (__isset.operationType ? (out << to_string(operationType)) : (out << "")); + out << ")"; +} + + +BasicTxnInfo::~BasicTxnInfo() noexcept { +} + +BasicTxnInfo::BasicTxnInfo() noexcept + : isnull(0), + time(0), + txnid(0), + dbname(), + tablename(), + partitionname() { +} + +void BasicTxnInfo::__set_isnull(const bool val) { + this->isnull = val; +} + +void BasicTxnInfo::__set_time(const int64_t val) { + this->time = val; +__isset.time = true; +} + +void BasicTxnInfo::__set_txnid(const int64_t val) { + this->txnid = val; +__isset.txnid = true; +} + +void BasicTxnInfo::__set_dbname(const std::string& val) { + this->dbname = val; +__isset.dbname = true; +} + +void BasicTxnInfo::__set_tablename(const std::string& val) { + this->tablename = val; +__isset.tablename = true; +} + +void BasicTxnInfo::__set_partitionname(const std::string& val) { + this->partitionname = val; +__isset.partitionname = true; +} +std::ostream& operator<<(std::ostream& out, const BasicTxnInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t BasicTxnInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_isnull = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isnull); + isset_isnull = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->time); + this->__isset.time = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnid); + this->__isset.txnid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbname); + this->__isset.dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablename); + this->__isset.tablename = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partitionname); + this->__isset.partitionname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_isnull) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t BasicTxnInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("BasicTxnInfo"); + + xfer += oprot->writeFieldBegin("isnull", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->isnull); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.time) { + xfer += oprot->writeFieldBegin("time", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->time); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnid) { + xfer += oprot->writeFieldBegin("txnid", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->txnid); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dbname) { + xfer += oprot->writeFieldBegin("dbname", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dbname); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tablename) { + xfer += oprot->writeFieldBegin("tablename", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->tablename); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionname) { + xfer += oprot->writeFieldBegin("partitionname", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->partitionname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(BasicTxnInfo &a, BasicTxnInfo &b) noexcept { + using ::std::swap; + swap(a.isnull, b.isnull); + swap(a.time, b.time); + swap(a.txnid, b.txnid); + swap(a.dbname, b.dbname); + swap(a.tablename, b.tablename); + swap(a.partitionname, b.partitionname); + swap(a.__isset, b.__isset); +} + +bool BasicTxnInfo::operator==(const BasicTxnInfo & rhs) const +{ + if (!(isnull == rhs.isnull)) + return false; + if (__isset.time != rhs.__isset.time) + return false; + else if (__isset.time && !(time == rhs.time)) + return false; + if (__isset.txnid != rhs.__isset.txnid) + return false; + else if (__isset.txnid && !(txnid == rhs.txnid)) + return false; + if (__isset.dbname != rhs.__isset.dbname) + return false; + else if (__isset.dbname && !(dbname == rhs.dbname)) + return false; + if (__isset.tablename != rhs.__isset.tablename) + return false; + else if (__isset.tablename && !(tablename == rhs.tablename)) + return false; + if (__isset.partitionname != rhs.__isset.partitionname) + return false; + else if (__isset.partitionname && !(partitionname == rhs.partitionname)) + return false; + return true; +} + +BasicTxnInfo::BasicTxnInfo(const BasicTxnInfo& other1112) { + isnull = other1112.isnull; + time = other1112.time; + txnid = other1112.txnid; + dbname = other1112.dbname; + tablename = other1112.tablename; + partitionname = other1112.partitionname; + __isset = other1112.__isset; +} +BasicTxnInfo& BasicTxnInfo::operator=(const BasicTxnInfo& other1113) { + isnull = other1113.isnull; + time = other1113.time; + txnid = other1113.txnid; + dbname = other1113.dbname; + tablename = other1113.tablename; + partitionname = other1113.partitionname; + __isset = other1113.__isset; + return *this; +} +void BasicTxnInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "BasicTxnInfo("; + out << "isnull=" << to_string(isnull); + out << ", " << "time="; (__isset.time ? (out << to_string(time)) : (out << "")); + out << ", " << "txnid="; (__isset.txnid ? (out << to_string(txnid)) : (out << "")); + out << ", " << "dbname="; (__isset.dbname ? (out << to_string(dbname)) : (out << "")); + out << ", " << "tablename="; (__isset.tablename ? (out << to_string(tablename)) : (out << "")); + out << ", " << "partitionname="; (__isset.partitionname ? (out << to_string(partitionname)) : (out << "")); + out << ")"; +} + + +NotificationEventRequest::~NotificationEventRequest() noexcept { +} + +NotificationEventRequest::NotificationEventRequest() noexcept + : lastEvent(0), + maxEvents(0), + catName(), + dbName() { +} + +void NotificationEventRequest::__set_lastEvent(const int64_t val) { + this->lastEvent = val; +} + +void NotificationEventRequest::__set_maxEvents(const int32_t val) { + this->maxEvents = val; +__isset.maxEvents = true; +} + +void NotificationEventRequest::__set_eventTypeSkipList(const std::vector & val) { + this->eventTypeSkipList = val; +__isset.eventTypeSkipList = true; +} + +void NotificationEventRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void NotificationEventRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} + +void NotificationEventRequest::__set_tableNames(const std::vector & val) { + this->tableNames = val; +__isset.tableNames = true; +} +std::ostream& operator<<(std::ostream& out, const NotificationEventRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotificationEventRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_lastEvent = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lastEvent); + isset_lastEvent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxEvents); + this->__isset.maxEvents = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->eventTypeSkipList.clear(); + uint32_t _size1114; + ::apache::thrift::protocol::TType _etype1117; + xfer += iprot->readListBegin(_etype1117, _size1114); + this->eventTypeSkipList.resize(_size1114); + uint32_t _i1118; + for (_i1118 = 0; _i1118 < _size1114; ++_i1118) + { + xfer += iprot->readString(this->eventTypeSkipList[_i1118]); + } + xfer += iprot->readListEnd(); + } + this->__isset.eventTypeSkipList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tableNames.clear(); + uint32_t _size1119; + ::apache::thrift::protocol::TType _etype1122; + xfer += iprot->readListBegin(_etype1122, _size1119); + this->tableNames.resize(_size1119); + uint32_t _i1123; + for (_i1123 = 0; _i1123 < _size1119; ++_i1123) + { + xfer += iprot->readString(this->tableNames[_i1123]); + } + xfer += iprot->readListEnd(); + } + this->__isset.tableNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_lastEvent) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotificationEventRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotificationEventRequest"); + + xfer += oprot->writeFieldBegin("lastEvent", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->lastEvent); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.maxEvents) { + xfer += oprot->writeFieldBegin("maxEvents", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->maxEvents); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.eventTypeSkipList) { + xfer += oprot->writeFieldBegin("eventTypeSkipList", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->eventTypeSkipList.size())); + std::vector ::const_iterator _iter1124; + for (_iter1124 = this->eventTypeSkipList.begin(); _iter1124 != this->eventTypeSkipList.end(); ++_iter1124) + { + xfer += oprot->writeString((*_iter1124)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableNames) { + xfer += oprot->writeFieldBegin("tableNames", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableNames.size())); + std::vector ::const_iterator _iter1125; + for (_iter1125 = this->tableNames.begin(); _iter1125 != this->tableNames.end(); ++_iter1125) + { + xfer += oprot->writeString((*_iter1125)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotificationEventRequest &a, NotificationEventRequest &b) noexcept { + using ::std::swap; + swap(a.lastEvent, b.lastEvent); + swap(a.maxEvents, b.maxEvents); + swap(a.eventTypeSkipList, b.eventTypeSkipList); + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tableNames, b.tableNames); + swap(a.__isset, b.__isset); +} + +bool NotificationEventRequest::operator==(const NotificationEventRequest & rhs) const +{ + if (!(lastEvent == rhs.lastEvent)) + return false; + if (__isset.maxEvents != rhs.__isset.maxEvents) + return false; + else if (__isset.maxEvents && !(maxEvents == rhs.maxEvents)) + return false; + if (__isset.eventTypeSkipList != rhs.__isset.eventTypeSkipList) + return false; + else if (__isset.eventTypeSkipList && !(eventTypeSkipList == rhs.eventTypeSkipList)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + if (__isset.tableNames != rhs.__isset.tableNames) + return false; + else if (__isset.tableNames && !(tableNames == rhs.tableNames)) + return false; + return true; +} + +NotificationEventRequest::NotificationEventRequest(const NotificationEventRequest& other1126) { + lastEvent = other1126.lastEvent; + maxEvents = other1126.maxEvents; + eventTypeSkipList = other1126.eventTypeSkipList; + catName = other1126.catName; + dbName = other1126.dbName; + tableNames = other1126.tableNames; + __isset = other1126.__isset; +} +NotificationEventRequest& NotificationEventRequest::operator=(const NotificationEventRequest& other1127) { + lastEvent = other1127.lastEvent; + maxEvents = other1127.maxEvents; + eventTypeSkipList = other1127.eventTypeSkipList; + catName = other1127.catName; + dbName = other1127.dbName; + tableNames = other1127.tableNames; + __isset = other1127.__isset; + return *this; +} +void NotificationEventRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotificationEventRequest("; + out << "lastEvent=" << to_string(lastEvent); + out << ", " << "maxEvents="; (__isset.maxEvents ? (out << to_string(maxEvents)) : (out << "")); + out << ", " << "eventTypeSkipList="; (__isset.eventTypeSkipList ? (out << to_string(eventTypeSkipList)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ", " << "tableNames="; (__isset.tableNames ? (out << to_string(tableNames)) : (out << "")); + out << ")"; +} + + +NotificationEvent::~NotificationEvent() noexcept { +} + +NotificationEvent::NotificationEvent() noexcept + : eventId(0), + eventTime(0), + eventType(), + dbName(), + tableName(), + message(), + messageFormat(), + catName() { +} + +void NotificationEvent::__set_eventId(const int64_t val) { + this->eventId = val; +} + +void NotificationEvent::__set_eventTime(const int32_t val) { + this->eventTime = val; +} + +void NotificationEvent::__set_eventType(const std::string& val) { + this->eventType = val; +} + +void NotificationEvent::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} + +void NotificationEvent::__set_tableName(const std::string& val) { + this->tableName = val; +__isset.tableName = true; +} + +void NotificationEvent::__set_message(const std::string& val) { + this->message = val; +} + +void NotificationEvent::__set_messageFormat(const std::string& val) { + this->messageFormat = val; +__isset.messageFormat = true; +} + +void NotificationEvent::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} +std::ostream& operator<<(std::ostream& out, const NotificationEvent& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotificationEvent::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_eventId = false; + bool isset_eventTime = false; + bool isset_eventType = false; + bool isset_message = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->eventId); + isset_eventId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->eventTime); + isset_eventTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->eventType); + isset_eventType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + isset_message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->messageFormat); + this->__isset.messageFormat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_eventId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_eventTime) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_eventType) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_message) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotificationEvent::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotificationEvent"); + + xfer += oprot->writeFieldBegin("eventId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->eventId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventTime", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->eventTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("eventType", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->eventType); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.messageFormat) { + xfer += oprot->writeFieldBegin("messageFormat", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->messageFormat); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotificationEvent &a, NotificationEvent &b) noexcept { + using ::std::swap; + swap(a.eventId, b.eventId); + swap(a.eventTime, b.eventTime); + swap(a.eventType, b.eventType); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.message, b.message); + swap(a.messageFormat, b.messageFormat); + swap(a.catName, b.catName); + swap(a.__isset, b.__isset); +} + +bool NotificationEvent::operator==(const NotificationEvent & rhs) const +{ + if (!(eventId == rhs.eventId)) + return false; + if (!(eventTime == rhs.eventTime)) + return false; + if (!(eventType == rhs.eventType)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + if (!(message == rhs.message)) + return false; + if (__isset.messageFormat != rhs.__isset.messageFormat) + return false; + else if (__isset.messageFormat && !(messageFormat == rhs.messageFormat)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + return true; +} + +NotificationEvent::NotificationEvent(const NotificationEvent& other1128) { + eventId = other1128.eventId; + eventTime = other1128.eventTime; + eventType = other1128.eventType; + dbName = other1128.dbName; + tableName = other1128.tableName; + message = other1128.message; + messageFormat = other1128.messageFormat; + catName = other1128.catName; + __isset = other1128.__isset; +} +NotificationEvent& NotificationEvent::operator=(const NotificationEvent& other1129) { + eventId = other1129.eventId; + eventTime = other1129.eventTime; + eventType = other1129.eventType; + dbName = other1129.dbName; + tableName = other1129.tableName; + message = other1129.message; + messageFormat = other1129.messageFormat; + catName = other1129.catName; + __isset = other1129.__isset; + return *this; +} +void NotificationEvent::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotificationEvent("; + out << "eventId=" << to_string(eventId); + out << ", " << "eventTime=" << to_string(eventTime); + out << ", " << "eventType=" << to_string(eventType); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ", " << "message=" << to_string(message); + out << ", " << "messageFormat="; (__isset.messageFormat ? (out << to_string(messageFormat)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ")"; +} + + +NotificationEventResponse::~NotificationEventResponse() noexcept { +} + +NotificationEventResponse::NotificationEventResponse() noexcept { +} + +void NotificationEventResponse::__set_events(const std::vector & val) { + this->events = val; +} +std::ostream& operator<<(std::ostream& out, const NotificationEventResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotificationEventResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_events = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->events.clear(); + uint32_t _size1130; + ::apache::thrift::protocol::TType _etype1133; + xfer += iprot->readListBegin(_etype1133, _size1130); + this->events.resize(_size1130); + uint32_t _i1134; + for (_i1134 = 0; _i1134 < _size1130; ++_i1134) + { + xfer += this->events[_i1134].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_events = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_events) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotificationEventResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotificationEventResponse"); + + xfer += oprot->writeFieldBegin("events", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->events.size())); + std::vector ::const_iterator _iter1135; + for (_iter1135 = this->events.begin(); _iter1135 != this->events.end(); ++_iter1135) + { + xfer += (*_iter1135).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotificationEventResponse &a, NotificationEventResponse &b) noexcept { + using ::std::swap; + swap(a.events, b.events); +} + +bool NotificationEventResponse::operator==(const NotificationEventResponse & rhs) const +{ + if (!(events == rhs.events)) + return false; + return true; +} + +NotificationEventResponse::NotificationEventResponse(const NotificationEventResponse& other1136) { + events = other1136.events; +} +NotificationEventResponse& NotificationEventResponse::operator=(const NotificationEventResponse& other1137) { + events = other1137.events; + return *this; +} +void NotificationEventResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotificationEventResponse("; + out << "events=" << to_string(events); + out << ")"; +} + + +CurrentNotificationEventId::~CurrentNotificationEventId() noexcept { +} + +CurrentNotificationEventId::CurrentNotificationEventId() noexcept + : eventId(0) { +} + +void CurrentNotificationEventId::__set_eventId(const int64_t val) { + this->eventId = val; +} +std::ostream& operator<<(std::ostream& out, const CurrentNotificationEventId& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CurrentNotificationEventId::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_eventId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->eventId); + isset_eventId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_eventId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CurrentNotificationEventId::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CurrentNotificationEventId"); + + xfer += oprot->writeFieldBegin("eventId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->eventId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CurrentNotificationEventId &a, CurrentNotificationEventId &b) noexcept { + using ::std::swap; + swap(a.eventId, b.eventId); +} + +bool CurrentNotificationEventId::operator==(const CurrentNotificationEventId & rhs) const +{ + if (!(eventId == rhs.eventId)) + return false; + return true; +} + +CurrentNotificationEventId::CurrentNotificationEventId(const CurrentNotificationEventId& other1138) noexcept { + eventId = other1138.eventId; +} +CurrentNotificationEventId& CurrentNotificationEventId::operator=(const CurrentNotificationEventId& other1139) noexcept { + eventId = other1139.eventId; + return *this; +} +void CurrentNotificationEventId::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CurrentNotificationEventId("; + out << "eventId=" << to_string(eventId); + out << ")"; +} + + +NotificationEventsCountRequest::~NotificationEventsCountRequest() noexcept { +} + +NotificationEventsCountRequest::NotificationEventsCountRequest() noexcept + : fromEventId(0), + dbName(), + catName(), + toEventId(0), + limit(0) { +} + +void NotificationEventsCountRequest::__set_fromEventId(const int64_t val) { + this->fromEventId = val; +} + +void NotificationEventsCountRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void NotificationEventsCountRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void NotificationEventsCountRequest::__set_toEventId(const int64_t val) { + this->toEventId = val; +__isset.toEventId = true; +} + +void NotificationEventsCountRequest::__set_limit(const int64_t val) { + this->limit = val; +__isset.limit = true; +} + +void NotificationEventsCountRequest::__set_tableNames(const std::vector & val) { + this->tableNames = val; +__isset.tableNames = true; +} +std::ostream& operator<<(std::ostream& out, const NotificationEventsCountRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotificationEventsCountRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fromEventId = false; + bool isset_dbName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->fromEventId); + isset_fromEventId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->toEventId); + this->__isset.toEventId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->limit); + this->__isset.limit = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tableNames.clear(); + uint32_t _size1140; + ::apache::thrift::protocol::TType _etype1143; + xfer += iprot->readListBegin(_etype1143, _size1140); + this->tableNames.resize(_size1140); + uint32_t _i1144; + for (_i1144 = 0; _i1144 < _size1140; ++_i1144) + { + xfer += iprot->readString(this->tableNames[_i1144]); + } + xfer += iprot->readListEnd(); + } + this->__isset.tableNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fromEventId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotificationEventsCountRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotificationEventsCountRequest"); + + xfer += oprot->writeFieldBegin("fromEventId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->fromEventId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.toEventId) { + xfer += oprot->writeFieldBegin("toEventId", ::apache::thrift::protocol::T_I64, 4); + xfer += oprot->writeI64(this->toEventId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.limit) { + xfer += oprot->writeFieldBegin("limit", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->limit); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableNames) { + xfer += oprot->writeFieldBegin("tableNames", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableNames.size())); + std::vector ::const_iterator _iter1145; + for (_iter1145 = this->tableNames.begin(); _iter1145 != this->tableNames.end(); ++_iter1145) + { + xfer += oprot->writeString((*_iter1145)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotificationEventsCountRequest &a, NotificationEventsCountRequest &b) noexcept { + using ::std::swap; + swap(a.fromEventId, b.fromEventId); + swap(a.dbName, b.dbName); + swap(a.catName, b.catName); + swap(a.toEventId, b.toEventId); + swap(a.limit, b.limit); + swap(a.tableNames, b.tableNames); + swap(a.__isset, b.__isset); +} + +bool NotificationEventsCountRequest::operator==(const NotificationEventsCountRequest & rhs) const +{ + if (!(fromEventId == rhs.fromEventId)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.toEventId != rhs.__isset.toEventId) + return false; + else if (__isset.toEventId && !(toEventId == rhs.toEventId)) + return false; + if (__isset.limit != rhs.__isset.limit) + return false; + else if (__isset.limit && !(limit == rhs.limit)) + return false; + if (__isset.tableNames != rhs.__isset.tableNames) + return false; + else if (__isset.tableNames && !(tableNames == rhs.tableNames)) + return false; + return true; +} + +NotificationEventsCountRequest::NotificationEventsCountRequest(const NotificationEventsCountRequest& other1146) { + fromEventId = other1146.fromEventId; + dbName = other1146.dbName; + catName = other1146.catName; + toEventId = other1146.toEventId; + limit = other1146.limit; + tableNames = other1146.tableNames; + __isset = other1146.__isset; +} +NotificationEventsCountRequest& NotificationEventsCountRequest::operator=(const NotificationEventsCountRequest& other1147) { + fromEventId = other1147.fromEventId; + dbName = other1147.dbName; + catName = other1147.catName; + toEventId = other1147.toEventId; + limit = other1147.limit; + tableNames = other1147.tableNames; + __isset = other1147.__isset; + return *this; +} +void NotificationEventsCountRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotificationEventsCountRequest("; + out << "fromEventId=" << to_string(fromEventId); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "toEventId="; (__isset.toEventId ? (out << to_string(toEventId)) : (out << "")); + out << ", " << "limit="; (__isset.limit ? (out << to_string(limit)) : (out << "")); + out << ", " << "tableNames="; (__isset.tableNames ? (out << to_string(tableNames)) : (out << "")); + out << ")"; +} + + +NotificationEventsCountResponse::~NotificationEventsCountResponse() noexcept { +} + +NotificationEventsCountResponse::NotificationEventsCountResponse() noexcept + : eventsCount(0) { +} + +void NotificationEventsCountResponse::__set_eventsCount(const int64_t val) { + this->eventsCount = val; +} +std::ostream& operator<<(std::ostream& out, const NotificationEventsCountResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NotificationEventsCountResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_eventsCount = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->eventsCount); + isset_eventsCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_eventsCount) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t NotificationEventsCountResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NotificationEventsCountResponse"); + + xfer += oprot->writeFieldBegin("eventsCount", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->eventsCount); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NotificationEventsCountResponse &a, NotificationEventsCountResponse &b) noexcept { + using ::std::swap; + swap(a.eventsCount, b.eventsCount); +} + +bool NotificationEventsCountResponse::operator==(const NotificationEventsCountResponse & rhs) const +{ + if (!(eventsCount == rhs.eventsCount)) + return false; + return true; +} + +NotificationEventsCountResponse::NotificationEventsCountResponse(const NotificationEventsCountResponse& other1148) noexcept { + eventsCount = other1148.eventsCount; +} +NotificationEventsCountResponse& NotificationEventsCountResponse::operator=(const NotificationEventsCountResponse& other1149) noexcept { + eventsCount = other1149.eventsCount; + return *this; +} +void NotificationEventsCountResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NotificationEventsCountResponse("; + out << "eventsCount=" << to_string(eventsCount); + out << ")"; +} + + +InsertEventRequestData::~InsertEventRequestData() noexcept { +} + +InsertEventRequestData::InsertEventRequestData() noexcept + : replace(0) { +} + +void InsertEventRequestData::__set_replace(const bool val) { + this->replace = val; +__isset.replace = true; +} + +void InsertEventRequestData::__set_filesAdded(const std::vector & val) { + this->filesAdded = val; +} + +void InsertEventRequestData::__set_filesAddedChecksum(const std::vector & val) { + this->filesAddedChecksum = val; +__isset.filesAddedChecksum = true; +} + +void InsertEventRequestData::__set_subDirectoryList(const std::vector & val) { + this->subDirectoryList = val; +__isset.subDirectoryList = true; +} + +void InsertEventRequestData::__set_partitionVal(const std::vector & val) { + this->partitionVal = val; +__isset.partitionVal = true; +} +std::ostream& operator<<(std::ostream& out, const InsertEventRequestData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t InsertEventRequestData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_filesAdded = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->replace); + this->__isset.replace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->filesAdded.clear(); + uint32_t _size1150; + ::apache::thrift::protocol::TType _etype1153; + xfer += iprot->readListBegin(_etype1153, _size1150); + this->filesAdded.resize(_size1150); + uint32_t _i1154; + for (_i1154 = 0; _i1154 < _size1150; ++_i1154) + { + xfer += iprot->readString(this->filesAdded[_i1154]); + } + xfer += iprot->readListEnd(); + } + isset_filesAdded = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->filesAddedChecksum.clear(); + uint32_t _size1155; + ::apache::thrift::protocol::TType _etype1158; + xfer += iprot->readListBegin(_etype1158, _size1155); + this->filesAddedChecksum.resize(_size1155); + uint32_t _i1159; + for (_i1159 = 0; _i1159 < _size1155; ++_i1159) + { + xfer += iprot->readString(this->filesAddedChecksum[_i1159]); + } + xfer += iprot->readListEnd(); + } + this->__isset.filesAddedChecksum = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->subDirectoryList.clear(); + uint32_t _size1160; + ::apache::thrift::protocol::TType _etype1163; + xfer += iprot->readListBegin(_etype1163, _size1160); + this->subDirectoryList.resize(_size1160); + uint32_t _i1164; + for (_i1164 = 0; _i1164 < _size1160; ++_i1164) + { + xfer += iprot->readString(this->subDirectoryList[_i1164]); + } + xfer += iprot->readListEnd(); + } + this->__isset.subDirectoryList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionVal.clear(); + uint32_t _size1165; + ::apache::thrift::protocol::TType _etype1168; + xfer += iprot->readListBegin(_etype1168, _size1165); + this->partitionVal.resize(_size1165); + uint32_t _i1169; + for (_i1169 = 0; _i1169 < _size1165; ++_i1169) + { + xfer += iprot->readString(this->partitionVal[_i1169]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_filesAdded) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t InsertEventRequestData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("InsertEventRequestData"); + + if (this->__isset.replace) { + xfer += oprot->writeFieldBegin("replace", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->replace); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("filesAdded", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->filesAdded.size())); + std::vector ::const_iterator _iter1170; + for (_iter1170 = this->filesAdded.begin(); _iter1170 != this->filesAdded.end(); ++_iter1170) + { + xfer += oprot->writeString((*_iter1170)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.filesAddedChecksum) { + xfer += oprot->writeFieldBegin("filesAddedChecksum", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->filesAddedChecksum.size())); + std::vector ::const_iterator _iter1171; + for (_iter1171 = this->filesAddedChecksum.begin(); _iter1171 != this->filesAddedChecksum.end(); ++_iter1171) + { + xfer += oprot->writeString((*_iter1171)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.subDirectoryList) { + xfer += oprot->writeFieldBegin("subDirectoryList", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->subDirectoryList.size())); + std::vector ::const_iterator _iter1172; + for (_iter1172 = this->subDirectoryList.begin(); _iter1172 != this->subDirectoryList.end(); ++_iter1172) + { + xfer += oprot->writeString((*_iter1172)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionVal) { + xfer += oprot->writeFieldBegin("partitionVal", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionVal.size())); + std::vector ::const_iterator _iter1173; + for (_iter1173 = this->partitionVal.begin(); _iter1173 != this->partitionVal.end(); ++_iter1173) + { + xfer += oprot->writeString((*_iter1173)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(InsertEventRequestData &a, InsertEventRequestData &b) noexcept { + using ::std::swap; + swap(a.replace, b.replace); + swap(a.filesAdded, b.filesAdded); + swap(a.filesAddedChecksum, b.filesAddedChecksum); + swap(a.subDirectoryList, b.subDirectoryList); + swap(a.partitionVal, b.partitionVal); + swap(a.__isset, b.__isset); +} + +bool InsertEventRequestData::operator==(const InsertEventRequestData & rhs) const +{ + if (__isset.replace != rhs.__isset.replace) + return false; + else if (__isset.replace && !(replace == rhs.replace)) + return false; + if (!(filesAdded == rhs.filesAdded)) + return false; + if (__isset.filesAddedChecksum != rhs.__isset.filesAddedChecksum) + return false; + else if (__isset.filesAddedChecksum && !(filesAddedChecksum == rhs.filesAddedChecksum)) + return false; + if (__isset.subDirectoryList != rhs.__isset.subDirectoryList) + return false; + else if (__isset.subDirectoryList && !(subDirectoryList == rhs.subDirectoryList)) + return false; + if (__isset.partitionVal != rhs.__isset.partitionVal) + return false; + else if (__isset.partitionVal && !(partitionVal == rhs.partitionVal)) + return false; + return true; +} + +InsertEventRequestData::InsertEventRequestData(const InsertEventRequestData& other1174) { + replace = other1174.replace; + filesAdded = other1174.filesAdded; + filesAddedChecksum = other1174.filesAddedChecksum; + subDirectoryList = other1174.subDirectoryList; + partitionVal = other1174.partitionVal; + __isset = other1174.__isset; +} +InsertEventRequestData& InsertEventRequestData::operator=(const InsertEventRequestData& other1175) { + replace = other1175.replace; + filesAdded = other1175.filesAdded; + filesAddedChecksum = other1175.filesAddedChecksum; + subDirectoryList = other1175.subDirectoryList; + partitionVal = other1175.partitionVal; + __isset = other1175.__isset; + return *this; +} +void InsertEventRequestData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "InsertEventRequestData("; + out << "replace="; (__isset.replace ? (out << to_string(replace)) : (out << "")); + out << ", " << "filesAdded=" << to_string(filesAdded); + out << ", " << "filesAddedChecksum="; (__isset.filesAddedChecksum ? (out << to_string(filesAddedChecksum)) : (out << "")); + out << ", " << "subDirectoryList="; (__isset.subDirectoryList ? (out << to_string(subDirectoryList)) : (out << "")); + out << ", " << "partitionVal="; (__isset.partitionVal ? (out << to_string(partitionVal)) : (out << "")); + out << ")"; +} + + +FireEventRequestData::~FireEventRequestData() noexcept { +} + +FireEventRequestData::FireEventRequestData() noexcept + : refreshEvent(0) { +} + +void FireEventRequestData::__set_insertData(const InsertEventRequestData& val) { + this->insertData = val; +__isset.insertData = true; +} + +void FireEventRequestData::__set_insertDatas(const std::vector & val) { + this->insertDatas = val; +__isset.insertDatas = true; +} + +void FireEventRequestData::__set_refreshEvent(const bool val) { + this->refreshEvent = val; +__isset.refreshEvent = true; +} +std::ostream& operator<<(std::ostream& out, const FireEventRequestData& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FireEventRequestData::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->insertData.read(iprot); + this->__isset.insertData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->insertDatas.clear(); + uint32_t _size1176; + ::apache::thrift::protocol::TType _etype1179; + xfer += iprot->readListBegin(_etype1179, _size1176); + this->insertDatas.resize(_size1176); + uint32_t _i1180; + for (_i1180 = 0; _i1180 < _size1176; ++_i1180) + { + xfer += this->insertDatas[_i1180].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.insertDatas = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->refreshEvent); + this->__isset.refreshEvent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FireEventRequestData::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FireEventRequestData"); + + if (this->__isset.insertData) { + xfer += oprot->writeFieldBegin("insertData", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->insertData.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.insertDatas) { + xfer += oprot->writeFieldBegin("insertDatas", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->insertDatas.size())); + std::vector ::const_iterator _iter1181; + for (_iter1181 = this->insertDatas.begin(); _iter1181 != this->insertDatas.end(); ++_iter1181) + { + xfer += (*_iter1181).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.refreshEvent) { + xfer += oprot->writeFieldBegin("refreshEvent", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->refreshEvent); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FireEventRequestData &a, FireEventRequestData &b) noexcept { + using ::std::swap; + swap(a.insertData, b.insertData); + swap(a.insertDatas, b.insertDatas); + swap(a.refreshEvent, b.refreshEvent); + swap(a.__isset, b.__isset); +} + +bool FireEventRequestData::operator==(const FireEventRequestData & rhs) const +{ + if (__isset.insertData != rhs.__isset.insertData) + return false; + else if (__isset.insertData && !(insertData == rhs.insertData)) + return false; + if (__isset.insertDatas != rhs.__isset.insertDatas) + return false; + else if (__isset.insertDatas && !(insertDatas == rhs.insertDatas)) + return false; + if (__isset.refreshEvent != rhs.__isset.refreshEvent) + return false; + else if (__isset.refreshEvent && !(refreshEvent == rhs.refreshEvent)) + return false; + return true; +} + +FireEventRequestData::FireEventRequestData(const FireEventRequestData& other1182) { + insertData = other1182.insertData; + insertDatas = other1182.insertDatas; + refreshEvent = other1182.refreshEvent; + __isset = other1182.__isset; +} +FireEventRequestData& FireEventRequestData::operator=(const FireEventRequestData& other1183) { + insertData = other1183.insertData; + insertDatas = other1183.insertDatas; + refreshEvent = other1183.refreshEvent; + __isset = other1183.__isset; + return *this; +} +void FireEventRequestData::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FireEventRequestData("; + out << "insertData="; (__isset.insertData ? (out << to_string(insertData)) : (out << "")); + out << ", " << "insertDatas="; (__isset.insertDatas ? (out << to_string(insertDatas)) : (out << "")); + out << ", " << "refreshEvent="; (__isset.refreshEvent ? (out << to_string(refreshEvent)) : (out << "")); + out << ")"; +} + + +FireEventRequest::~FireEventRequest() noexcept { +} + +FireEventRequest::FireEventRequest() noexcept + : successful(0), + dbName(), + tableName(), + catName() { +} + +void FireEventRequest::__set_successful(const bool val) { + this->successful = val; +} + +void FireEventRequest::__set_data(const FireEventRequestData& val) { + this->data = val; +} + +void FireEventRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} + +void FireEventRequest::__set_tableName(const std::string& val) { + this->tableName = val; +__isset.tableName = true; +} + +void FireEventRequest::__set_partitionVals(const std::vector & val) { + this->partitionVals = val; +__isset.partitionVals = true; +} + +void FireEventRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void FireEventRequest::__set_tblParams(const std::map & val) { + this->tblParams = val; +__isset.tblParams = true; +} +std::ostream& operator<<(std::ostream& out, const FireEventRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FireEventRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_successful = false; + bool isset_data = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->successful); + isset_successful = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->data.read(iprot); + isset_data = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionVals.clear(); + uint32_t _size1184; + ::apache::thrift::protocol::TType _etype1187; + xfer += iprot->readListBegin(_etype1187, _size1184); + this->partitionVals.resize(_size1184); + uint32_t _i1188; + for (_i1188 = 0; _i1188 < _size1184; ++_i1188) + { + xfer += iprot->readString(this->partitionVals[_i1188]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->tblParams.clear(); + uint32_t _size1189; + ::apache::thrift::protocol::TType _ktype1190; + ::apache::thrift::protocol::TType _vtype1191; + xfer += iprot->readMapBegin(_ktype1190, _vtype1191, _size1189); + uint32_t _i1193; + for (_i1193 = 0; _i1193 < _size1189; ++_i1193) + { + std::string _key1194; + xfer += iprot->readString(_key1194); + std::string& _val1195 = this->tblParams[_key1194]; + xfer += iprot->readString(_val1195); + } + xfer += iprot->readMapEnd(); + } + this->__isset.tblParams = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_successful) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_data) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t FireEventRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FireEventRequest"); + + xfer += oprot->writeFieldBegin("successful", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->successful); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->data.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionVals) { + xfer += oprot->writeFieldBegin("partitionVals", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionVals.size())); + std::vector ::const_iterator _iter1196; + for (_iter1196 = this->partitionVals.begin(); _iter1196 != this->partitionVals.end(); ++_iter1196) + { + xfer += oprot->writeString((*_iter1196)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tblParams) { + xfer += oprot->writeFieldBegin("tblParams", ::apache::thrift::protocol::T_MAP, 7); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->tblParams.size())); + std::map ::const_iterator _iter1197; + for (_iter1197 = this->tblParams.begin(); _iter1197 != this->tblParams.end(); ++_iter1197) + { + xfer += oprot->writeString(_iter1197->first); + xfer += oprot->writeString(_iter1197->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FireEventRequest &a, FireEventRequest &b) noexcept { + using ::std::swap; + swap(a.successful, b.successful); + swap(a.data, b.data); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partitionVals, b.partitionVals); + swap(a.catName, b.catName); + swap(a.tblParams, b.tblParams); + swap(a.__isset, b.__isset); +} + +bool FireEventRequest::operator==(const FireEventRequest & rhs) const +{ + if (!(successful == rhs.successful)) + return false; + if (!(data == rhs.data)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + if (__isset.partitionVals != rhs.__isset.partitionVals) + return false; + else if (__isset.partitionVals && !(partitionVals == rhs.partitionVals)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.tblParams != rhs.__isset.tblParams) + return false; + else if (__isset.tblParams && !(tblParams == rhs.tblParams)) + return false; + return true; +} + +FireEventRequest::FireEventRequest(const FireEventRequest& other1198) { + successful = other1198.successful; + data = other1198.data; + dbName = other1198.dbName; + tableName = other1198.tableName; + partitionVals = other1198.partitionVals; + catName = other1198.catName; + tblParams = other1198.tblParams; + __isset = other1198.__isset; +} +FireEventRequest& FireEventRequest::operator=(const FireEventRequest& other1199) { + successful = other1199.successful; + data = other1199.data; + dbName = other1199.dbName; + tableName = other1199.tableName; + partitionVals = other1199.partitionVals; + catName = other1199.catName; + tblParams = other1199.tblParams; + __isset = other1199.__isset; + return *this; +} +void FireEventRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FireEventRequest("; + out << "successful=" << to_string(successful); + out << ", " << "data=" << to_string(data); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ", " << "partitionVals="; (__isset.partitionVals ? (out << to_string(partitionVals)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "tblParams="; (__isset.tblParams ? (out << to_string(tblParams)) : (out << "")); + out << ")"; +} + + +FireEventResponse::~FireEventResponse() noexcept { +} + +FireEventResponse::FireEventResponse() noexcept { +} + +void FireEventResponse::__set_eventIds(const std::vector & val) { + this->eventIds = val; +} +std::ostream& operator<<(std::ostream& out, const FireEventResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FireEventResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->eventIds.clear(); + uint32_t _size1200; + ::apache::thrift::protocol::TType _etype1203; + xfer += iprot->readListBegin(_etype1203, _size1200); + this->eventIds.resize(_size1200); + uint32_t _i1204; + for (_i1204 = 0; _i1204 < _size1200; ++_i1204) + { + xfer += iprot->readI64(this->eventIds[_i1204]); + } + xfer += iprot->readListEnd(); + } + this->__isset.eventIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FireEventResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FireEventResponse"); + + xfer += oprot->writeFieldBegin("eventIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->eventIds.size())); + std::vector ::const_iterator _iter1205; + for (_iter1205 = this->eventIds.begin(); _iter1205 != this->eventIds.end(); ++_iter1205) + { + xfer += oprot->writeI64((*_iter1205)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FireEventResponse &a, FireEventResponse &b) noexcept { + using ::std::swap; + swap(a.eventIds, b.eventIds); + swap(a.__isset, b.__isset); +} + +bool FireEventResponse::operator==(const FireEventResponse & rhs) const +{ + if (!(eventIds == rhs.eventIds)) + return false; + return true; +} + +FireEventResponse::FireEventResponse(const FireEventResponse& other1206) { + eventIds = other1206.eventIds; + __isset = other1206.__isset; +} +FireEventResponse& FireEventResponse::operator=(const FireEventResponse& other1207) { + eventIds = other1207.eventIds; + __isset = other1207.__isset; + return *this; +} +void FireEventResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FireEventResponse("; + out << "eventIds=" << to_string(eventIds); + out << ")"; +} + + +WriteNotificationLogRequest::~WriteNotificationLogRequest() noexcept { +} + +WriteNotificationLogRequest::WriteNotificationLogRequest() noexcept + : txnId(0), + writeId(0), + db(), + table() { +} + +void WriteNotificationLogRequest::__set_txnId(const int64_t val) { + this->txnId = val; +} + +void WriteNotificationLogRequest::__set_writeId(const int64_t val) { + this->writeId = val; +} + +void WriteNotificationLogRequest::__set_db(const std::string& val) { + this->db = val; +} + +void WriteNotificationLogRequest::__set_table(const std::string& val) { + this->table = val; +} + +void WriteNotificationLogRequest::__set_fileInfo(const InsertEventRequestData& val) { + this->fileInfo = val; +} + +void WriteNotificationLogRequest::__set_partitionVals(const std::vector & val) { + this->partitionVals = val; +__isset.partitionVals = true; +} +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WriteNotificationLogRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnId = false; + bool isset_writeId = false; + bool isset_db = false; + bool isset_table = false; + bool isset_fileInfo = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + isset_txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + isset_writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db); + isset_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->fileInfo.read(iprot); + isset_fileInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionVals.clear(); + uint32_t _size1208; + ::apache::thrift::protocol::TType _etype1211; + xfer += iprot->readListBegin(_etype1211, _size1208); + this->partitionVals.resize(_size1208); + uint32_t _i1212; + for (_i1212 = 0; _i1212 < _size1208; ++_i1212) + { + xfer += iprot->readString(this->partitionVals[_i1212]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_writeId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_fileInfo) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WriteNotificationLogRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WriteNotificationLogRequest"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->table); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("fileInfo", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->fileInfo.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partitionVals) { + xfer += oprot->writeFieldBegin("partitionVals", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partitionVals.size())); + std::vector ::const_iterator _iter1213; + for (_iter1213 = this->partitionVals.begin(); _iter1213 != this->partitionVals.end(); ++_iter1213) + { + xfer += oprot->writeString((*_iter1213)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WriteNotificationLogRequest &a, WriteNotificationLogRequest &b) noexcept { + using ::std::swap; + swap(a.txnId, b.txnId); + swap(a.writeId, b.writeId); + swap(a.db, b.db); + swap(a.table, b.table); + swap(a.fileInfo, b.fileInfo); + swap(a.partitionVals, b.partitionVals); + swap(a.__isset, b.__isset); +} + +bool WriteNotificationLogRequest::operator==(const WriteNotificationLogRequest & rhs) const +{ + if (!(txnId == rhs.txnId)) + return false; + if (!(writeId == rhs.writeId)) + return false; + if (!(db == rhs.db)) + return false; + if (!(table == rhs.table)) + return false; + if (!(fileInfo == rhs.fileInfo)) + return false; + if (__isset.partitionVals != rhs.__isset.partitionVals) + return false; + else if (__isset.partitionVals && !(partitionVals == rhs.partitionVals)) + return false; + return true; +} + +WriteNotificationLogRequest::WriteNotificationLogRequest(const WriteNotificationLogRequest& other1214) { + txnId = other1214.txnId; + writeId = other1214.writeId; + db = other1214.db; + table = other1214.table; + fileInfo = other1214.fileInfo; + partitionVals = other1214.partitionVals; + __isset = other1214.__isset; +} +WriteNotificationLogRequest& WriteNotificationLogRequest::operator=(const WriteNotificationLogRequest& other1215) { + txnId = other1215.txnId; + writeId = other1215.writeId; + db = other1215.db; + table = other1215.table; + fileInfo = other1215.fileInfo; + partitionVals = other1215.partitionVals; + __isset = other1215.__isset; + return *this; +} +void WriteNotificationLogRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WriteNotificationLogRequest("; + out << "txnId=" << to_string(txnId); + out << ", " << "writeId=" << to_string(writeId); + out << ", " << "db=" << to_string(db); + out << ", " << "table=" << to_string(table); + out << ", " << "fileInfo=" << to_string(fileInfo); + out << ", " << "partitionVals="; (__isset.partitionVals ? (out << to_string(partitionVals)) : (out << "")); + out << ")"; +} + + +WriteNotificationLogResponse::~WriteNotificationLogResponse() noexcept { +} + +WriteNotificationLogResponse::WriteNotificationLogResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WriteNotificationLogResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WriteNotificationLogResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WriteNotificationLogResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WriteNotificationLogResponse &a, WriteNotificationLogResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WriteNotificationLogResponse::operator==(const WriteNotificationLogResponse & /* rhs */) const +{ + return true; +} + +WriteNotificationLogResponse::WriteNotificationLogResponse(const WriteNotificationLogResponse& other1216) noexcept { + (void) other1216; +} +WriteNotificationLogResponse& WriteNotificationLogResponse::operator=(const WriteNotificationLogResponse& other1217) noexcept { + (void) other1217; + return *this; +} +void WriteNotificationLogResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WriteNotificationLogResponse("; + out << ")"; +} + + +WriteNotificationLogBatchRequest::~WriteNotificationLogBatchRequest() noexcept { +} + +WriteNotificationLogBatchRequest::WriteNotificationLogBatchRequest() noexcept + : catalog(), + db(), + table() { +} + +void WriteNotificationLogBatchRequest::__set_catalog(const std::string& val) { + this->catalog = val; +} + +void WriteNotificationLogBatchRequest::__set_db(const std::string& val) { + this->db = val; +} + +void WriteNotificationLogBatchRequest::__set_table(const std::string& val) { + this->table = val; +} + +void WriteNotificationLogBatchRequest::__set_requestList(const std::vector & val) { + this->requestList = val; +} +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogBatchRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WriteNotificationLogBatchRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catalog = false; + bool isset_db = false; + bool isset_table = false; + bool isset_requestList = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalog); + isset_catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->db); + isset_db = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->table); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->requestList.clear(); + uint32_t _size1218; + ::apache::thrift::protocol::TType _etype1221; + xfer += iprot->readListBegin(_etype1221, _size1218); + this->requestList.resize(_size1218); + uint32_t _i1222; + for (_i1222 = 0; _i1222 < _size1218; ++_i1222) + { + xfer += this->requestList[_i1222].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_requestList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catalog) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_db) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_requestList) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WriteNotificationLogBatchRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WriteNotificationLogBatchRequest"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catalog); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("db", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->db); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->table); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("requestList", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->requestList.size())); + std::vector ::const_iterator _iter1223; + for (_iter1223 = this->requestList.begin(); _iter1223 != this->requestList.end(); ++_iter1223) + { + xfer += (*_iter1223).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WriteNotificationLogBatchRequest &a, WriteNotificationLogBatchRequest &b) noexcept { + using ::std::swap; + swap(a.catalog, b.catalog); + swap(a.db, b.db); + swap(a.table, b.table); + swap(a.requestList, b.requestList); +} + +bool WriteNotificationLogBatchRequest::operator==(const WriteNotificationLogBatchRequest & rhs) const +{ + if (!(catalog == rhs.catalog)) + return false; + if (!(db == rhs.db)) + return false; + if (!(table == rhs.table)) + return false; + if (!(requestList == rhs.requestList)) + return false; + return true; +} + +WriteNotificationLogBatchRequest::WriteNotificationLogBatchRequest(const WriteNotificationLogBatchRequest& other1224) { + catalog = other1224.catalog; + db = other1224.db; + table = other1224.table; + requestList = other1224.requestList; +} +WriteNotificationLogBatchRequest& WriteNotificationLogBatchRequest::operator=(const WriteNotificationLogBatchRequest& other1225) { + catalog = other1225.catalog; + db = other1225.db; + table = other1225.table; + requestList = other1225.requestList; + return *this; +} +void WriteNotificationLogBatchRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WriteNotificationLogBatchRequest("; + out << "catalog=" << to_string(catalog); + out << ", " << "db=" << to_string(db); + out << ", " << "table=" << to_string(table); + out << ", " << "requestList=" << to_string(requestList); + out << ")"; +} + + +WriteNotificationLogBatchResponse::~WriteNotificationLogBatchResponse() noexcept { +} + +WriteNotificationLogBatchResponse::WriteNotificationLogBatchResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogBatchResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WriteNotificationLogBatchResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WriteNotificationLogBatchResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WriteNotificationLogBatchResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WriteNotificationLogBatchResponse &a, WriteNotificationLogBatchResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WriteNotificationLogBatchResponse::operator==(const WriteNotificationLogBatchResponse & /* rhs */) const +{ + return true; +} + +WriteNotificationLogBatchResponse::WriteNotificationLogBatchResponse(const WriteNotificationLogBatchResponse& other1226) noexcept { + (void) other1226; +} +WriteNotificationLogBatchResponse& WriteNotificationLogBatchResponse::operator=(const WriteNotificationLogBatchResponse& other1227) noexcept { + (void) other1227; + return *this; +} +void WriteNotificationLogBatchResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WriteNotificationLogBatchResponse("; + out << ")"; +} + + +MetadataPpdResult::~MetadataPpdResult() noexcept { +} + +MetadataPpdResult::MetadataPpdResult() noexcept + : metadata(), + includeBitset() { +} + +void MetadataPpdResult::__set_metadata(const std::string& val) { + this->metadata = val; +__isset.metadata = true; +} + +void MetadataPpdResult::__set_includeBitset(const std::string& val) { + this->includeBitset = val; +__isset.includeBitset = true; +} +std::ostream& operator<<(std::ostream& out, const MetadataPpdResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t MetadataPpdResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->metadata); + this->__isset.metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->includeBitset); + this->__isset.includeBitset = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t MetadataPpdResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("MetadataPpdResult"); + + if (this->__isset.metadata) { + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->metadata); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeBitset) { + xfer += oprot->writeFieldBegin("includeBitset", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->includeBitset); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(MetadataPpdResult &a, MetadataPpdResult &b) noexcept { + using ::std::swap; + swap(a.metadata, b.metadata); + swap(a.includeBitset, b.includeBitset); + swap(a.__isset, b.__isset); +} + +bool MetadataPpdResult::operator==(const MetadataPpdResult & rhs) const +{ + if (__isset.metadata != rhs.__isset.metadata) + return false; + else if (__isset.metadata && !(metadata == rhs.metadata)) + return false; + if (__isset.includeBitset != rhs.__isset.includeBitset) + return false; + else if (__isset.includeBitset && !(includeBitset == rhs.includeBitset)) + return false; + return true; +} + +MetadataPpdResult::MetadataPpdResult(const MetadataPpdResult& other1228) { + metadata = other1228.metadata; + includeBitset = other1228.includeBitset; + __isset = other1228.__isset; +} +MetadataPpdResult& MetadataPpdResult::operator=(const MetadataPpdResult& other1229) { + metadata = other1229.metadata; + includeBitset = other1229.includeBitset; + __isset = other1229.__isset; + return *this; +} +void MetadataPpdResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "MetadataPpdResult("; + out << "metadata="; (__isset.metadata ? (out << to_string(metadata)) : (out << "")); + out << ", " << "includeBitset="; (__isset.includeBitset ? (out << to_string(includeBitset)) : (out << "")); + out << ")"; +} + + +GetFileMetadataByExprResult::~GetFileMetadataByExprResult() noexcept { +} + +GetFileMetadataByExprResult::GetFileMetadataByExprResult() noexcept + : isSupported(0) { +} + +void GetFileMetadataByExprResult::__set_metadata(const std::map & val) { + this->metadata = val; +} + +void GetFileMetadataByExprResult::__set_isSupported(const bool val) { + this->isSupported = val; +} +std::ostream& operator<<(std::ostream& out, const GetFileMetadataByExprResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFileMetadataByExprResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_metadata = false; + bool isset_isSupported = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->metadata.clear(); + uint32_t _size1230; + ::apache::thrift::protocol::TType _ktype1231; + ::apache::thrift::protocol::TType _vtype1232; + xfer += iprot->readMapBegin(_ktype1231, _vtype1232, _size1230); + uint32_t _i1234; + for (_i1234 = 0; _i1234 < _size1230; ++_i1234) + { + int64_t _key1235; + xfer += iprot->readI64(_key1235); + MetadataPpdResult& _val1236 = this->metadata[_key1235]; + xfer += _val1236.read(iprot); + } + xfer += iprot->readMapEnd(); + } + isset_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSupported); + isset_isSupported = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_metadata) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_isSupported) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFileMetadataByExprResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFileMetadataByExprResult"); + + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I64, ::apache::thrift::protocol::T_STRUCT, static_cast(this->metadata.size())); + std::map ::const_iterator _iter1237; + for (_iter1237 = this->metadata.begin(); _iter1237 != this->metadata.end(); ++_iter1237) + { + xfer += oprot->writeI64(_iter1237->first); + xfer += _iter1237->second.write(oprot); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("isSupported", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isSupported); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFileMetadataByExprResult &a, GetFileMetadataByExprResult &b) noexcept { + using ::std::swap; + swap(a.metadata, b.metadata); + swap(a.isSupported, b.isSupported); +} + +bool GetFileMetadataByExprResult::operator==(const GetFileMetadataByExprResult & rhs) const +{ + if (!(metadata == rhs.metadata)) + return false; + if (!(isSupported == rhs.isSupported)) + return false; + return true; +} + +GetFileMetadataByExprResult::GetFileMetadataByExprResult(const GetFileMetadataByExprResult& other1238) { + metadata = other1238.metadata; + isSupported = other1238.isSupported; +} +GetFileMetadataByExprResult& GetFileMetadataByExprResult::operator=(const GetFileMetadataByExprResult& other1239) { + metadata = other1239.metadata; + isSupported = other1239.isSupported; + return *this; +} +void GetFileMetadataByExprResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFileMetadataByExprResult("; + out << "metadata=" << to_string(metadata); + out << ", " << "isSupported=" << to_string(isSupported); + out << ")"; +} + + +GetFileMetadataByExprRequest::~GetFileMetadataByExprRequest() noexcept { +} + +GetFileMetadataByExprRequest::GetFileMetadataByExprRequest() noexcept + : expr(), + doGetFooters(0), + type(static_cast(0)) { +} + +void GetFileMetadataByExprRequest::__set_fileIds(const std::vector & val) { + this->fileIds = val; +} + +void GetFileMetadataByExprRequest::__set_expr(const std::string& val) { + this->expr = val; +} + +void GetFileMetadataByExprRequest::__set_doGetFooters(const bool val) { + this->doGetFooters = val; +__isset.doGetFooters = true; +} + +void GetFileMetadataByExprRequest::__set_type(const FileMetadataExprType::type val) { + this->type = val; +__isset.type = true; +} +std::ostream& operator<<(std::ostream& out, const GetFileMetadataByExprRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFileMetadataByExprRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fileIds = false; + bool isset_expr = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fileIds.clear(); + uint32_t _size1240; + ::apache::thrift::protocol::TType _etype1243; + xfer += iprot->readListBegin(_etype1243, _size1240); + this->fileIds.resize(_size1240); + uint32_t _i1244; + for (_i1244 = 0; _i1244 < _size1240; ++_i1244) + { + xfer += iprot->readI64(this->fileIds[_i1244]); + } + xfer += iprot->readListEnd(); + } + isset_fileIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->expr); + isset_expr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->doGetFooters); + this->__isset.doGetFooters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1245; + xfer += iprot->readI32(ecast1245); + this->type = static_cast(ecast1245); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fileIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_expr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFileMetadataByExprRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFileMetadataByExprRequest"); + + xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->fileIds.size())); + std::vector ::const_iterator _iter1246; + for (_iter1246 = this->fileIds.begin(); _iter1246 != this->fileIds.end(); ++_iter1246) + { + xfer += oprot->writeI64((*_iter1246)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("expr", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->expr); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.doGetFooters) { + xfer += oprot->writeFieldBegin("doGetFooters", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->doGetFooters); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFileMetadataByExprRequest &a, GetFileMetadataByExprRequest &b) noexcept { + using ::std::swap; + swap(a.fileIds, b.fileIds); + swap(a.expr, b.expr); + swap(a.doGetFooters, b.doGetFooters); + swap(a.type, b.type); + swap(a.__isset, b.__isset); +} + +bool GetFileMetadataByExprRequest::operator==(const GetFileMetadataByExprRequest & rhs) const +{ + if (!(fileIds == rhs.fileIds)) + return false; + if (!(expr == rhs.expr)) + return false; + if (__isset.doGetFooters != rhs.__isset.doGetFooters) + return false; + else if (__isset.doGetFooters && !(doGetFooters == rhs.doGetFooters)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + return true; +} + +GetFileMetadataByExprRequest::GetFileMetadataByExprRequest(const GetFileMetadataByExprRequest& other1247) { + fileIds = other1247.fileIds; + expr = other1247.expr; + doGetFooters = other1247.doGetFooters; + type = other1247.type; + __isset = other1247.__isset; +} +GetFileMetadataByExprRequest& GetFileMetadataByExprRequest::operator=(const GetFileMetadataByExprRequest& other1248) { + fileIds = other1248.fileIds; + expr = other1248.expr; + doGetFooters = other1248.doGetFooters; + type = other1248.type; + __isset = other1248.__isset; + return *this; +} +void GetFileMetadataByExprRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFileMetadataByExprRequest("; + out << "fileIds=" << to_string(fileIds); + out << ", " << "expr=" << to_string(expr); + out << ", " << "doGetFooters="; (__isset.doGetFooters ? (out << to_string(doGetFooters)) : (out << "")); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ")"; +} + + +GetFileMetadataResult::~GetFileMetadataResult() noexcept { +} + +GetFileMetadataResult::GetFileMetadataResult() noexcept + : isSupported(0) { +} + +void GetFileMetadataResult::__set_metadata(const std::map & val) { + this->metadata = val; +} + +void GetFileMetadataResult::__set_isSupported(const bool val) { + this->isSupported = val; +} +std::ostream& operator<<(std::ostream& out, const GetFileMetadataResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFileMetadataResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_metadata = false; + bool isset_isSupported = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->metadata.clear(); + uint32_t _size1249; + ::apache::thrift::protocol::TType _ktype1250; + ::apache::thrift::protocol::TType _vtype1251; + xfer += iprot->readMapBegin(_ktype1250, _vtype1251, _size1249); + uint32_t _i1253; + for (_i1253 = 0; _i1253 < _size1249; ++_i1253) + { + int64_t _key1254; + xfer += iprot->readI64(_key1254); + std::string& _val1255 = this->metadata[_key1254]; + xfer += iprot->readBinary(_val1255); + } + xfer += iprot->readMapEnd(); + } + isset_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSupported); + isset_isSupported = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_metadata) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_isSupported) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFileMetadataResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFileMetadataResult"); + + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_I64, ::apache::thrift::protocol::T_STRING, static_cast(this->metadata.size())); + std::map ::const_iterator _iter1256; + for (_iter1256 = this->metadata.begin(); _iter1256 != this->metadata.end(); ++_iter1256) + { + xfer += oprot->writeI64(_iter1256->first); + xfer += oprot->writeBinary(_iter1256->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("isSupported", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isSupported); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFileMetadataResult &a, GetFileMetadataResult &b) noexcept { + using ::std::swap; + swap(a.metadata, b.metadata); + swap(a.isSupported, b.isSupported); +} + +bool GetFileMetadataResult::operator==(const GetFileMetadataResult & rhs) const +{ + if (!(metadata == rhs.metadata)) + return false; + if (!(isSupported == rhs.isSupported)) + return false; + return true; +} + +GetFileMetadataResult::GetFileMetadataResult(const GetFileMetadataResult& other1257) { + metadata = other1257.metadata; + isSupported = other1257.isSupported; +} +GetFileMetadataResult& GetFileMetadataResult::operator=(const GetFileMetadataResult& other1258) { + metadata = other1258.metadata; + isSupported = other1258.isSupported; + return *this; +} +void GetFileMetadataResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFileMetadataResult("; + out << "metadata=" << to_string(metadata); + out << ", " << "isSupported=" << to_string(isSupported); + out << ")"; +} + + +GetFileMetadataRequest::~GetFileMetadataRequest() noexcept { +} + +GetFileMetadataRequest::GetFileMetadataRequest() noexcept { +} + +void GetFileMetadataRequest::__set_fileIds(const std::vector & val) { + this->fileIds = val; +} +std::ostream& operator<<(std::ostream& out, const GetFileMetadataRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fileIds = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fileIds.clear(); + uint32_t _size1259; + ::apache::thrift::protocol::TType _etype1262; + xfer += iprot->readListBegin(_etype1262, _size1259); + this->fileIds.resize(_size1259); + uint32_t _i1263; + for (_i1263 = 0; _i1263 < _size1259; ++_i1263) + { + xfer += iprot->readI64(this->fileIds[_i1263]); + } + xfer += iprot->readListEnd(); + } + isset_fileIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fileIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFileMetadataRequest"); + + xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->fileIds.size())); + std::vector ::const_iterator _iter1264; + for (_iter1264 = this->fileIds.begin(); _iter1264 != this->fileIds.end(); ++_iter1264) + { + xfer += oprot->writeI64((*_iter1264)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFileMetadataRequest &a, GetFileMetadataRequest &b) noexcept { + using ::std::swap; + swap(a.fileIds, b.fileIds); +} + +bool GetFileMetadataRequest::operator==(const GetFileMetadataRequest & rhs) const +{ + if (!(fileIds == rhs.fileIds)) + return false; + return true; +} + +GetFileMetadataRequest::GetFileMetadataRequest(const GetFileMetadataRequest& other1265) { + fileIds = other1265.fileIds; +} +GetFileMetadataRequest& GetFileMetadataRequest::operator=(const GetFileMetadataRequest& other1266) { + fileIds = other1266.fileIds; + return *this; +} +void GetFileMetadataRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFileMetadataRequest("; + out << "fileIds=" << to_string(fileIds); + out << ")"; +} + + +PutFileMetadataResult::~PutFileMetadataResult() noexcept { +} + +PutFileMetadataResult::PutFileMetadataResult() noexcept { +} +std::ostream& operator<<(std::ostream& out, const PutFileMetadataResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PutFileMetadataResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t PutFileMetadataResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PutFileMetadataResult"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PutFileMetadataResult &a, PutFileMetadataResult &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool PutFileMetadataResult::operator==(const PutFileMetadataResult & /* rhs */) const +{ + return true; +} + +PutFileMetadataResult::PutFileMetadataResult(const PutFileMetadataResult& other1267) noexcept { + (void) other1267; +} +PutFileMetadataResult& PutFileMetadataResult::operator=(const PutFileMetadataResult& other1268) noexcept { + (void) other1268; + return *this; +} +void PutFileMetadataResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PutFileMetadataResult("; + out << ")"; +} + + +PutFileMetadataRequest::~PutFileMetadataRequest() noexcept { +} + +PutFileMetadataRequest::PutFileMetadataRequest() noexcept + : type(static_cast(0)) { +} + +void PutFileMetadataRequest::__set_fileIds(const std::vector & val) { + this->fileIds = val; +} + +void PutFileMetadataRequest::__set_metadata(const std::vector & val) { + this->metadata = val; +} + +void PutFileMetadataRequest::__set_type(const FileMetadataExprType::type val) { + this->type = val; +__isset.type = true; +} +std::ostream& operator<<(std::ostream& out, const PutFileMetadataRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PutFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fileIds = false; + bool isset_metadata = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fileIds.clear(); + uint32_t _size1269; + ::apache::thrift::protocol::TType _etype1272; + xfer += iprot->readListBegin(_etype1272, _size1269); + this->fileIds.resize(_size1269); + uint32_t _i1273; + for (_i1273 = 0; _i1273 < _size1269; ++_i1273) + { + xfer += iprot->readI64(this->fileIds[_i1273]); + } + xfer += iprot->readListEnd(); + } + isset_fileIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->metadata.clear(); + uint32_t _size1274; + ::apache::thrift::protocol::TType _etype1277; + xfer += iprot->readListBegin(_etype1277, _size1274); + this->metadata.resize(_size1274); + uint32_t _i1278; + for (_i1278 = 0; _i1278 < _size1274; ++_i1278) + { + xfer += iprot->readBinary(this->metadata[_i1278]); + } + xfer += iprot->readListEnd(); + } + isset_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1279; + xfer += iprot->readI32(ecast1279); + this->type = static_cast(ecast1279); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fileIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_metadata) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PutFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PutFileMetadataRequest"); + + xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->fileIds.size())); + std::vector ::const_iterator _iter1280; + for (_iter1280 = this->fileIds.begin(); _iter1280 != this->fileIds.end(); ++_iter1280) + { + xfer += oprot->writeI64((*_iter1280)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->metadata.size())); + std::vector ::const_iterator _iter1281; + for (_iter1281 = this->metadata.begin(); _iter1281 != this->metadata.end(); ++_iter1281) + { + xfer += oprot->writeBinary((*_iter1281)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PutFileMetadataRequest &a, PutFileMetadataRequest &b) noexcept { + using ::std::swap; + swap(a.fileIds, b.fileIds); + swap(a.metadata, b.metadata); + swap(a.type, b.type); + swap(a.__isset, b.__isset); +} + +bool PutFileMetadataRequest::operator==(const PutFileMetadataRequest & rhs) const +{ + if (!(fileIds == rhs.fileIds)) + return false; + if (!(metadata == rhs.metadata)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + return true; +} + +PutFileMetadataRequest::PutFileMetadataRequest(const PutFileMetadataRequest& other1282) { + fileIds = other1282.fileIds; + metadata = other1282.metadata; + type = other1282.type; + __isset = other1282.__isset; +} +PutFileMetadataRequest& PutFileMetadataRequest::operator=(const PutFileMetadataRequest& other1283) { + fileIds = other1283.fileIds; + metadata = other1283.metadata; + type = other1283.type; + __isset = other1283.__isset; + return *this; +} +void PutFileMetadataRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PutFileMetadataRequest("; + out << "fileIds=" << to_string(fileIds); + out << ", " << "metadata=" << to_string(metadata); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ")"; +} + + +ClearFileMetadataResult::~ClearFileMetadataResult() noexcept { +} + +ClearFileMetadataResult::ClearFileMetadataResult() noexcept { +} +std::ostream& operator<<(std::ostream& out, const ClearFileMetadataResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ClearFileMetadataResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ClearFileMetadataResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ClearFileMetadataResult"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ClearFileMetadataResult &a, ClearFileMetadataResult &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool ClearFileMetadataResult::operator==(const ClearFileMetadataResult & /* rhs */) const +{ + return true; +} + +ClearFileMetadataResult::ClearFileMetadataResult(const ClearFileMetadataResult& other1284) noexcept { + (void) other1284; +} +ClearFileMetadataResult& ClearFileMetadataResult::operator=(const ClearFileMetadataResult& other1285) noexcept { + (void) other1285; + return *this; +} +void ClearFileMetadataResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ClearFileMetadataResult("; + out << ")"; +} + + +ClearFileMetadataRequest::~ClearFileMetadataRequest() noexcept { +} + +ClearFileMetadataRequest::ClearFileMetadataRequest() noexcept { +} + +void ClearFileMetadataRequest::__set_fileIds(const std::vector & val) { + this->fileIds = val; +} +std::ostream& operator<<(std::ostream& out, const ClearFileMetadataRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ClearFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fileIds = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fileIds.clear(); + uint32_t _size1286; + ::apache::thrift::protocol::TType _etype1289; + xfer += iprot->readListBegin(_etype1289, _size1286); + this->fileIds.resize(_size1286); + uint32_t _i1290; + for (_i1290 = 0; _i1290 < _size1286; ++_i1290) + { + xfer += iprot->readI64(this->fileIds[_i1290]); + } + xfer += iprot->readListEnd(); + } + isset_fileIds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fileIds) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ClearFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ClearFileMetadataRequest"); + + xfer += oprot->writeFieldBegin("fileIds", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->fileIds.size())); + std::vector ::const_iterator _iter1291; + for (_iter1291 = this->fileIds.begin(); _iter1291 != this->fileIds.end(); ++_iter1291) + { + xfer += oprot->writeI64((*_iter1291)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ClearFileMetadataRequest &a, ClearFileMetadataRequest &b) noexcept { + using ::std::swap; + swap(a.fileIds, b.fileIds); +} + +bool ClearFileMetadataRequest::operator==(const ClearFileMetadataRequest & rhs) const +{ + if (!(fileIds == rhs.fileIds)) + return false; + return true; +} + +ClearFileMetadataRequest::ClearFileMetadataRequest(const ClearFileMetadataRequest& other1292) { + fileIds = other1292.fileIds; +} +ClearFileMetadataRequest& ClearFileMetadataRequest::operator=(const ClearFileMetadataRequest& other1293) { + fileIds = other1293.fileIds; + return *this; +} +void ClearFileMetadataRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ClearFileMetadataRequest("; + out << "fileIds=" << to_string(fileIds); + out << ")"; +} + + +CacheFileMetadataResult::~CacheFileMetadataResult() noexcept { +} + +CacheFileMetadataResult::CacheFileMetadataResult() noexcept + : isSupported(0) { +} + +void CacheFileMetadataResult::__set_isSupported(const bool val) { + this->isSupported = val; +} +std::ostream& operator<<(std::ostream& out, const CacheFileMetadataResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CacheFileMetadataResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_isSupported = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSupported); + isset_isSupported = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_isSupported) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CacheFileMetadataResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CacheFileMetadataResult"); + + xfer += oprot->writeFieldBegin("isSupported", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->isSupported); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CacheFileMetadataResult &a, CacheFileMetadataResult &b) noexcept { + using ::std::swap; + swap(a.isSupported, b.isSupported); +} + +bool CacheFileMetadataResult::operator==(const CacheFileMetadataResult & rhs) const +{ + if (!(isSupported == rhs.isSupported)) + return false; + return true; +} + +CacheFileMetadataResult::CacheFileMetadataResult(const CacheFileMetadataResult& other1294) noexcept { + isSupported = other1294.isSupported; +} +CacheFileMetadataResult& CacheFileMetadataResult::operator=(const CacheFileMetadataResult& other1295) noexcept { + isSupported = other1295.isSupported; + return *this; +} +void CacheFileMetadataResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CacheFileMetadataResult("; + out << "isSupported=" << to_string(isSupported); + out << ")"; +} + + +CacheFileMetadataRequest::~CacheFileMetadataRequest() noexcept { +} + +CacheFileMetadataRequest::CacheFileMetadataRequest() noexcept + : dbName(), + tblName(), + partName(), + isAllParts(0) { +} + +void CacheFileMetadataRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void CacheFileMetadataRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void CacheFileMetadataRequest::__set_partName(const std::string& val) { + this->partName = val; +__isset.partName = true; +} + +void CacheFileMetadataRequest::__set_isAllParts(const bool val) { + this->isAllParts = val; +__isset.isAllParts = true; +} +std::ostream& operator<<(std::ostream& out, const CacheFileMetadataRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CacheFileMetadataRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->partName); + this->__isset.partName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isAllParts); + this->__isset.isAllParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CacheFileMetadataRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CacheFileMetadataRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partName) { + xfer += oprot->writeFieldBegin("partName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->partName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isAllParts) { + xfer += oprot->writeFieldBegin("isAllParts", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->isAllParts); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CacheFileMetadataRequest &a, CacheFileMetadataRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partName, b.partName); + swap(a.isAllParts, b.isAllParts); + swap(a.__isset, b.__isset); +} + +bool CacheFileMetadataRequest::operator==(const CacheFileMetadataRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.partName != rhs.__isset.partName) + return false; + else if (__isset.partName && !(partName == rhs.partName)) + return false; + if (__isset.isAllParts != rhs.__isset.isAllParts) + return false; + else if (__isset.isAllParts && !(isAllParts == rhs.isAllParts)) + return false; + return true; +} + +CacheFileMetadataRequest::CacheFileMetadataRequest(const CacheFileMetadataRequest& other1296) { + dbName = other1296.dbName; + tblName = other1296.tblName; + partName = other1296.partName; + isAllParts = other1296.isAllParts; + __isset = other1296.__isset; +} +CacheFileMetadataRequest& CacheFileMetadataRequest::operator=(const CacheFileMetadataRequest& other1297) { + dbName = other1297.dbName; + tblName = other1297.tblName; + partName = other1297.partName; + isAllParts = other1297.isAllParts; + __isset = other1297.__isset; + return *this; +} +void CacheFileMetadataRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CacheFileMetadataRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partName="; (__isset.partName ? (out << to_string(partName)) : (out << "")); + out << ", " << "isAllParts="; (__isset.isAllParts ? (out << to_string(isAllParts)) : (out << "")); + out << ")"; +} + + +GetAllFunctionsResponse::~GetAllFunctionsResponse() noexcept { +} + +GetAllFunctionsResponse::GetAllFunctionsResponse() noexcept { +} + +void GetAllFunctionsResponse::__set_functions(const std::vector & val) { + this->functions = val; +__isset.functions = true; +} +std::ostream& operator<<(std::ostream& out, const GetAllFunctionsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetAllFunctionsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->functions.clear(); + uint32_t _size1298; + ::apache::thrift::protocol::TType _etype1301; + xfer += iprot->readListBegin(_etype1301, _size1298); + this->functions.resize(_size1298); + uint32_t _i1302; + for (_i1302 = 0; _i1302 < _size1298; ++_i1302) + { + xfer += this->functions[_i1302].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.functions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetAllFunctionsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetAllFunctionsResponse"); + + if (this->__isset.functions) { + xfer += oprot->writeFieldBegin("functions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->functions.size())); + std::vector ::const_iterator _iter1303; + for (_iter1303 = this->functions.begin(); _iter1303 != this->functions.end(); ++_iter1303) + { + xfer += (*_iter1303).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetAllFunctionsResponse &a, GetAllFunctionsResponse &b) noexcept { + using ::std::swap; + swap(a.functions, b.functions); + swap(a.__isset, b.__isset); +} + +bool GetAllFunctionsResponse::operator==(const GetAllFunctionsResponse & rhs) const +{ + if (__isset.functions != rhs.__isset.functions) + return false; + else if (__isset.functions && !(functions == rhs.functions)) + return false; + return true; +} + +GetAllFunctionsResponse::GetAllFunctionsResponse(const GetAllFunctionsResponse& other1304) { + functions = other1304.functions; + __isset = other1304.__isset; +} +GetAllFunctionsResponse& GetAllFunctionsResponse::operator=(const GetAllFunctionsResponse& other1305) { + functions = other1305.functions; + __isset = other1305.__isset; + return *this; +} +void GetAllFunctionsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetAllFunctionsResponse("; + out << "functions="; (__isset.functions ? (out << to_string(functions)) : (out << "")); + out << ")"; +} + + +ClientCapabilities::~ClientCapabilities() noexcept { +} + +ClientCapabilities::ClientCapabilities() noexcept { +} + +void ClientCapabilities::__set_values(const std::vector & val) { + this->values = val; +} +std::ostream& operator<<(std::ostream& out, const ClientCapabilities& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ClientCapabilities::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_values = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size1306; + ::apache::thrift::protocol::TType _etype1309; + xfer += iprot->readListBegin(_etype1309, _size1306); + this->values.resize(_size1306); + uint32_t _i1310; + for (_i1310 = 0; _i1310 < _size1306; ++_i1310) + { + int32_t ecast1311; + xfer += iprot->readI32(ecast1311); + this->values[_i1310] = static_cast(ecast1311); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ClientCapabilities::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ClientCapabilities"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->values.size())); + std::vector ::const_iterator _iter1312; + for (_iter1312 = this->values.begin(); _iter1312 != this->values.end(); ++_iter1312) + { + xfer += oprot->writeI32(static_cast((*_iter1312))); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ClientCapabilities &a, ClientCapabilities &b) noexcept { + using ::std::swap; + swap(a.values, b.values); +} + +bool ClientCapabilities::operator==(const ClientCapabilities & rhs) const +{ + if (!(values == rhs.values)) + return false; + return true; +} + +ClientCapabilities::ClientCapabilities(const ClientCapabilities& other1313) { + values = other1313.values; +} +ClientCapabilities& ClientCapabilities::operator=(const ClientCapabilities& other1314) { + values = other1314.values; + return *this; +} +void ClientCapabilities::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ClientCapabilities("; + out << "values=" << to_string(values); + out << ")"; +} + + +GetProjectionsSpec::~GetProjectionsSpec() noexcept { +} + +GetProjectionsSpec::GetProjectionsSpec() noexcept + : includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void GetProjectionsSpec::__set_fieldList(const std::vector & val) { + this->fieldList = val; +} + +void GetProjectionsSpec::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +} + +void GetProjectionsSpec::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +} +std::ostream& operator<<(std::ostream& out, const GetProjectionsSpec& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetProjectionsSpec::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fieldList.clear(); + uint32_t _size1315; + ::apache::thrift::protocol::TType _etype1318; + xfer += iprot->readListBegin(_etype1318, _size1315); + this->fieldList.resize(_size1315); + uint32_t _i1319; + for (_i1319 = 0; _i1319 < _size1315; ++_i1319) + { + xfer += iprot->readString(this->fieldList[_i1319]); + } + xfer += iprot->readListEnd(); + } + this->__isset.fieldList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetProjectionsSpec::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetProjectionsSpec"); + + xfer += oprot->writeFieldBegin("fieldList", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->fieldList.size())); + std::vector ::const_iterator _iter1320; + for (_iter1320 = this->fieldList.begin(); _iter1320 != this->fieldList.end(); ++_iter1320) + { + xfer += oprot->writeString((*_iter1320)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetProjectionsSpec &a, GetProjectionsSpec &b) noexcept { + using ::std::swap; + swap(a.fieldList, b.fieldList); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.__isset, b.__isset); +} + +bool GetProjectionsSpec::operator==(const GetProjectionsSpec & rhs) const +{ + if (!(fieldList == rhs.fieldList)) + return false; + if (!(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (!(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + return true; +} + +GetProjectionsSpec::GetProjectionsSpec(const GetProjectionsSpec& other1321) { + fieldList = other1321.fieldList; + includeParamKeyPattern = other1321.includeParamKeyPattern; + excludeParamKeyPattern = other1321.excludeParamKeyPattern; + __isset = other1321.__isset; +} +GetProjectionsSpec& GetProjectionsSpec::operator=(const GetProjectionsSpec& other1322) { + fieldList = other1322.fieldList; + includeParamKeyPattern = other1322.includeParamKeyPattern; + excludeParamKeyPattern = other1322.excludeParamKeyPattern; + __isset = other1322.__isset; + return *this; +} +void GetProjectionsSpec::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetProjectionsSpec("; + out << "fieldList=" << to_string(fieldList); + out << ", " << "includeParamKeyPattern=" << to_string(includeParamKeyPattern); + out << ", " << "excludeParamKeyPattern=" << to_string(excludeParamKeyPattern); + out << ")"; +} + + +GetTableRequest::~GetTableRequest() noexcept { +} + +GetTableRequest::GetTableRequest() : dbName(), + tblName(), + catName(), + validWriteIdList(), + getColumnStats(0), + processorIdentifier(), + engine("hive"), + id(-1LL) { +} + +void GetTableRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetTableRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetTableRequest::__set_capabilities(const ClientCapabilities& val) { + this->capabilities = val; +__isset.capabilities = true; +} + +void GetTableRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetTableRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetTableRequest::__set_getColumnStats(const bool val) { + this->getColumnStats = val; +__isset.getColumnStats = true; +} + +void GetTableRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetTableRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} + +void GetTableRequest::__set_engine(const std::string& val) { + this->engine = val; +__isset.engine = true; +} + +void GetTableRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const GetTableRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->capabilities.read(iprot); + this->__isset.capabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->getColumnStats); + this->__isset.getColumnStats = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1323; + ::apache::thrift::protocol::TType _etype1326; + xfer += iprot->readListBegin(_etype1326, _size1323); + this->processorCapabilities.resize(_size1323); + uint32_t _i1327; + for (_i1327 = 0; _i1327 < _size1323; ++_i1327) + { + xfer += iprot->readString(this->processorCapabilities[_i1327]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->engine); + this->__isset.engine = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetTableRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.capabilities) { + xfer += oprot->writeFieldBegin("capabilities", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->capabilities.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.getColumnStats) { + xfer += oprot->writeFieldBegin("getColumnStats", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->getColumnStats); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1328; + for (_iter1328 = this->processorCapabilities.begin(); _iter1328 != this->processorCapabilities.end(); ++_iter1328) + { + xfer += oprot->writeString((*_iter1328)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.engine) { + xfer += oprot->writeFieldBegin("engine", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->engine); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 11); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetTableRequest &a, GetTableRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.capabilities, b.capabilities); + swap(a.catName, b.catName); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.getColumnStats, b.getColumnStats); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.engine, b.engine); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool GetTableRequest::operator==(const GetTableRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.capabilities != rhs.__isset.capabilities) + return false; + else if (__isset.capabilities && !(capabilities == rhs.capabilities)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.getColumnStats != rhs.__isset.getColumnStats) + return false; + else if (__isset.getColumnStats && !(getColumnStats == rhs.getColumnStats)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + if (__isset.engine != rhs.__isset.engine) + return false; + else if (__isset.engine && !(engine == rhs.engine)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +GetTableRequest::GetTableRequest(const GetTableRequest& other1329) { + dbName = other1329.dbName; + tblName = other1329.tblName; + capabilities = other1329.capabilities; + catName = other1329.catName; + validWriteIdList = other1329.validWriteIdList; + getColumnStats = other1329.getColumnStats; + processorCapabilities = other1329.processorCapabilities; + processorIdentifier = other1329.processorIdentifier; + engine = other1329.engine; + id = other1329.id; + __isset = other1329.__isset; +} +GetTableRequest& GetTableRequest::operator=(const GetTableRequest& other1330) { + dbName = other1330.dbName; + tblName = other1330.tblName; + capabilities = other1330.capabilities; + catName = other1330.catName; + validWriteIdList = other1330.validWriteIdList; + getColumnStats = other1330.getColumnStats; + processorCapabilities = other1330.processorCapabilities; + processorIdentifier = other1330.processorIdentifier; + engine = other1330.engine; + id = other1330.id; + __isset = other1330.__isset; + return *this; +} +void GetTableRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetTableRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "capabilities="; (__isset.capabilities ? (out << to_string(capabilities)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "getColumnStats="; (__isset.getColumnStats ? (out << to_string(getColumnStats)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ", " << "engine="; (__isset.engine ? (out << to_string(engine)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +GetTableResult::~GetTableResult() noexcept { +} + +GetTableResult::GetTableResult() noexcept + : isStatsCompliant(0) { +} + +void GetTableResult::__set_table(const Table& val) { + this->table = val; +} + +void GetTableResult::__set_isStatsCompliant(const bool val) { + this->isStatsCompliant = val; +__isset.isStatsCompliant = true; +} +std::ostream& operator<<(std::ostream& out, const GetTableResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetTableResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_table = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->table.read(iprot); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isStatsCompliant); + this->__isset.isStatsCompliant = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetTableResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetTableResult"); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->table.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.isStatsCompliant) { + xfer += oprot->writeFieldBegin("isStatsCompliant", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->isStatsCompliant); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetTableResult &a, GetTableResult &b) noexcept { + using ::std::swap; + swap(a.table, b.table); + swap(a.isStatsCompliant, b.isStatsCompliant); + swap(a.__isset, b.__isset); +} + +bool GetTableResult::operator==(const GetTableResult & rhs) const +{ + if (!(table == rhs.table)) + return false; + if (__isset.isStatsCompliant != rhs.__isset.isStatsCompliant) + return false; + else if (__isset.isStatsCompliant && !(isStatsCompliant == rhs.isStatsCompliant)) + return false; + return true; +} + +GetTableResult::GetTableResult(const GetTableResult& other1331) { + table = other1331.table; + isStatsCompliant = other1331.isStatsCompliant; + __isset = other1331.__isset; +} +GetTableResult& GetTableResult::operator=(const GetTableResult& other1332) { + table = other1332.table; + isStatsCompliant = other1332.isStatsCompliant; + __isset = other1332.__isset; + return *this; +} +void GetTableResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetTableResult("; + out << "table=" << to_string(table); + out << ", " << "isStatsCompliant="; (__isset.isStatsCompliant ? (out << to_string(isStatsCompliant)) : (out << "")); + out << ")"; +} + + +GetTablesRequest::~GetTablesRequest() noexcept { +} + +GetTablesRequest::GetTablesRequest() noexcept + : dbName(), + catName(), + processorIdentifier(), + tablesPattern() { +} + +void GetTablesRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetTablesRequest::__set_tblNames(const std::vector & val) { + this->tblNames = val; +__isset.tblNames = true; +} + +void GetTablesRequest::__set_capabilities(const ClientCapabilities& val) { + this->capabilities = val; +__isset.capabilities = true; +} + +void GetTablesRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetTablesRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetTablesRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} + +void GetTablesRequest::__set_projectionSpec(const GetProjectionsSpec& val) { + this->projectionSpec = val; +__isset.projectionSpec = true; +} + +void GetTablesRequest::__set_tablesPattern(const std::string& val) { + this->tablesPattern = val; +__isset.tablesPattern = true; +} +std::ostream& operator<<(std::ostream& out, const GetTablesRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetTablesRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tblNames.clear(); + uint32_t _size1333; + ::apache::thrift::protocol::TType _etype1336; + xfer += iprot->readListBegin(_etype1336, _size1333); + this->tblNames.resize(_size1333); + uint32_t _i1337; + for (_i1337 = 0; _i1337 < _size1333; ++_i1337) + { + xfer += iprot->readString(this->tblNames[_i1337]); + } + xfer += iprot->readListEnd(); + } + this->__isset.tblNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->capabilities.read(iprot); + this->__isset.capabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1338; + ::apache::thrift::protocol::TType _etype1341; + xfer += iprot->readListBegin(_etype1341, _size1338); + this->processorCapabilities.resize(_size1338); + uint32_t _i1342; + for (_i1342 = 0; _i1342 < _size1338; ++_i1342) + { + xfer += iprot->readString(this->processorCapabilities[_i1342]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->projectionSpec.read(iprot); + this->__isset.projectionSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tablesPattern); + this->__isset.tablesPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetTablesRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetTablesRequest"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.tblNames) { + xfer += oprot->writeFieldBegin("tblNames", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tblNames.size())); + std::vector ::const_iterator _iter1343; + for (_iter1343 = this->tblNames.begin(); _iter1343 != this->tblNames.end(); ++_iter1343) + { + xfer += oprot->writeString((*_iter1343)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.capabilities) { + xfer += oprot->writeFieldBegin("capabilities", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->capabilities.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1344; + for (_iter1344 = this->processorCapabilities.begin(); _iter1344 != this->processorCapabilities.end(); ++_iter1344) + { + xfer += oprot->writeString((*_iter1344)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.projectionSpec) { + xfer += oprot->writeFieldBegin("projectionSpec", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->projectionSpec.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tablesPattern) { + xfer += oprot->writeFieldBegin("tablesPattern", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->tablesPattern); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetTablesRequest &a, GetTablesRequest &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tblNames, b.tblNames); + swap(a.capabilities, b.capabilities); + swap(a.catName, b.catName); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.projectionSpec, b.projectionSpec); + swap(a.tablesPattern, b.tablesPattern); + swap(a.__isset, b.__isset); +} + +bool GetTablesRequest::operator==(const GetTablesRequest & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (__isset.tblNames != rhs.__isset.tblNames) + return false; + else if (__isset.tblNames && !(tblNames == rhs.tblNames)) + return false; + if (__isset.capabilities != rhs.__isset.capabilities) + return false; + else if (__isset.capabilities && !(capabilities == rhs.capabilities)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + if (__isset.projectionSpec != rhs.__isset.projectionSpec) + return false; + else if (__isset.projectionSpec && !(projectionSpec == rhs.projectionSpec)) + return false; + if (__isset.tablesPattern != rhs.__isset.tablesPattern) + return false; + else if (__isset.tablesPattern && !(tablesPattern == rhs.tablesPattern)) + return false; + return true; +} + +GetTablesRequest::GetTablesRequest(const GetTablesRequest& other1345) { + dbName = other1345.dbName; + tblNames = other1345.tblNames; + capabilities = other1345.capabilities; + catName = other1345.catName; + processorCapabilities = other1345.processorCapabilities; + processorIdentifier = other1345.processorIdentifier; + projectionSpec = other1345.projectionSpec; + tablesPattern = other1345.tablesPattern; + __isset = other1345.__isset; +} +GetTablesRequest& GetTablesRequest::operator=(const GetTablesRequest& other1346) { + dbName = other1346.dbName; + tblNames = other1346.tblNames; + capabilities = other1346.capabilities; + catName = other1346.catName; + processorCapabilities = other1346.processorCapabilities; + processorIdentifier = other1346.processorIdentifier; + projectionSpec = other1346.projectionSpec; + tablesPattern = other1346.tablesPattern; + __isset = other1346.__isset; + return *this; +} +void GetTablesRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetTablesRequest("; + out << "dbName=" << to_string(dbName); + out << ", " << "tblNames="; (__isset.tblNames ? (out << to_string(tblNames)) : (out << "")); + out << ", " << "capabilities="; (__isset.capabilities ? (out << to_string(capabilities)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ", " << "projectionSpec="; (__isset.projectionSpec ? (out << to_string(projectionSpec)) : (out << "")); + out << ", " << "tablesPattern="; (__isset.tablesPattern ? (out << to_string(tablesPattern)) : (out << "")); + out << ")"; +} + + +GetTablesResult::~GetTablesResult() noexcept { +} + +GetTablesResult::GetTablesResult() noexcept { +} + +void GetTablesResult::__set_tables(const std::vector
& val) { + this->tables = val; +} +std::ostream& operator<<(std::ostream& out, const GetTablesResult& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetTablesResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tables = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tables.clear(); + uint32_t _size1347; + ::apache::thrift::protocol::TType _etype1350; + xfer += iprot->readListBegin(_etype1350, _size1347); + this->tables.resize(_size1347); + uint32_t _i1351; + for (_i1351 = 0; _i1351 < _size1347; ++_i1351) + { + xfer += this->tables[_i1351].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_tables = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tables) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetTablesResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetTablesResult"); + + xfer += oprot->writeFieldBegin("tables", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->tables.size())); + std::vector
::const_iterator _iter1352; + for (_iter1352 = this->tables.begin(); _iter1352 != this->tables.end(); ++_iter1352) + { + xfer += (*_iter1352).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetTablesResult &a, GetTablesResult &b) noexcept { + using ::std::swap; + swap(a.tables, b.tables); +} + +bool GetTablesResult::operator==(const GetTablesResult & rhs) const +{ + if (!(tables == rhs.tables)) + return false; + return true; +} + +GetTablesResult::GetTablesResult(const GetTablesResult& other1353) { + tables = other1353.tables; +} +GetTablesResult& GetTablesResult::operator=(const GetTablesResult& other1354) { + tables = other1354.tables; + return *this; +} +void GetTablesResult::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetTablesResult("; + out << "tables=" << to_string(tables); + out << ")"; +} + + +GetTablesExtRequest::~GetTablesExtRequest() noexcept { +} + +GetTablesExtRequest::GetTablesExtRequest() noexcept + : catalog(), + database(), + tableNamePattern(), + requestedFields(0), + limit(0), + processorIdentifier() { +} + +void GetTablesExtRequest::__set_catalog(const std::string& val) { + this->catalog = val; +} + +void GetTablesExtRequest::__set_database(const std::string& val) { + this->database = val; +} + +void GetTablesExtRequest::__set_tableNamePattern(const std::string& val) { + this->tableNamePattern = val; +} + +void GetTablesExtRequest::__set_requestedFields(const int32_t val) { + this->requestedFields = val; +} + +void GetTablesExtRequest::__set_limit(const int32_t val) { + this->limit = val; +__isset.limit = true; +} + +void GetTablesExtRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetTablesExtRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} +std::ostream& operator<<(std::ostream& out, const GetTablesExtRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetTablesExtRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catalog = false; + bool isset_database = false; + bool isset_tableNamePattern = false; + bool isset_requestedFields = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalog); + isset_catalog = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->database); + isset_database = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableNamePattern); + isset_tableNamePattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->requestedFields); + isset_requestedFields = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->limit); + this->__isset.limit = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1355; + ::apache::thrift::protocol::TType _etype1358; + xfer += iprot->readListBegin(_etype1358, _size1355); + this->processorCapabilities.resize(_size1355); + uint32_t _i1359; + for (_i1359 = 0; _i1359 < _size1355; ++_i1359) + { + xfer += iprot->readString(this->processorCapabilities[_i1359]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catalog) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_database) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableNamePattern) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_requestedFields) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetTablesExtRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetTablesExtRequest"); + + xfer += oprot->writeFieldBegin("catalog", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catalog); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("database", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->database); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableNamePattern", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableNamePattern); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("requestedFields", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->requestedFields); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.limit) { + xfer += oprot->writeFieldBegin("limit", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->limit); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1360; + for (_iter1360 = this->processorCapabilities.begin(); _iter1360 != this->processorCapabilities.end(); ++_iter1360) + { + xfer += oprot->writeString((*_iter1360)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetTablesExtRequest &a, GetTablesExtRequest &b) noexcept { + using ::std::swap; + swap(a.catalog, b.catalog); + swap(a.database, b.database); + swap(a.tableNamePattern, b.tableNamePattern); + swap(a.requestedFields, b.requestedFields); + swap(a.limit, b.limit); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.__isset, b.__isset); +} + +bool GetTablesExtRequest::operator==(const GetTablesExtRequest & rhs) const +{ + if (!(catalog == rhs.catalog)) + return false; + if (!(database == rhs.database)) + return false; + if (!(tableNamePattern == rhs.tableNamePattern)) + return false; + if (!(requestedFields == rhs.requestedFields)) + return false; + if (__isset.limit != rhs.__isset.limit) + return false; + else if (__isset.limit && !(limit == rhs.limit)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + return true; +} + +GetTablesExtRequest::GetTablesExtRequest(const GetTablesExtRequest& other1361) { + catalog = other1361.catalog; + database = other1361.database; + tableNamePattern = other1361.tableNamePattern; + requestedFields = other1361.requestedFields; + limit = other1361.limit; + processorCapabilities = other1361.processorCapabilities; + processorIdentifier = other1361.processorIdentifier; + __isset = other1361.__isset; +} +GetTablesExtRequest& GetTablesExtRequest::operator=(const GetTablesExtRequest& other1362) { + catalog = other1362.catalog; + database = other1362.database; + tableNamePattern = other1362.tableNamePattern; + requestedFields = other1362.requestedFields; + limit = other1362.limit; + processorCapabilities = other1362.processorCapabilities; + processorIdentifier = other1362.processorIdentifier; + __isset = other1362.__isset; + return *this; +} +void GetTablesExtRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetTablesExtRequest("; + out << "catalog=" << to_string(catalog); + out << ", " << "database=" << to_string(database); + out << ", " << "tableNamePattern=" << to_string(tableNamePattern); + out << ", " << "requestedFields=" << to_string(requestedFields); + out << ", " << "limit="; (__isset.limit ? (out << to_string(limit)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ")"; +} + + +ExtendedTableInfo::~ExtendedTableInfo() noexcept { +} + +ExtendedTableInfo::ExtendedTableInfo() noexcept + : tblName(), + accessType(0) { +} + +void ExtendedTableInfo::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void ExtendedTableInfo::__set_accessType(const int32_t val) { + this->accessType = val; +__isset.accessType = true; +} + +void ExtendedTableInfo::__set_requiredReadCapabilities(const std::vector & val) { + this->requiredReadCapabilities = val; +__isset.requiredReadCapabilities = true; +} + +void ExtendedTableInfo::__set_requiredWriteCapabilities(const std::vector & val) { + this->requiredWriteCapabilities = val; +__isset.requiredWriteCapabilities = true; +} +std::ostream& operator<<(std::ostream& out, const ExtendedTableInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ExtendedTableInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->accessType); + this->__isset.accessType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->requiredReadCapabilities.clear(); + uint32_t _size1363; + ::apache::thrift::protocol::TType _etype1366; + xfer += iprot->readListBegin(_etype1366, _size1363); + this->requiredReadCapabilities.resize(_size1363); + uint32_t _i1367; + for (_i1367 = 0; _i1367 < _size1363; ++_i1367) + { + xfer += iprot->readString(this->requiredReadCapabilities[_i1367]); + } + xfer += iprot->readListEnd(); + } + this->__isset.requiredReadCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->requiredWriteCapabilities.clear(); + uint32_t _size1368; + ::apache::thrift::protocol::TType _etype1371; + xfer += iprot->readListBegin(_etype1371, _size1368); + this->requiredWriteCapabilities.resize(_size1368); + uint32_t _i1372; + for (_i1372 = 0; _i1372 < _size1368; ++_i1372) + { + xfer += iprot->readString(this->requiredWriteCapabilities[_i1372]); + } + xfer += iprot->readListEnd(); + } + this->__isset.requiredWriteCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ExtendedTableInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ExtendedTableInfo"); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.accessType) { + xfer += oprot->writeFieldBegin("accessType", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->accessType); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.requiredReadCapabilities) { + xfer += oprot->writeFieldBegin("requiredReadCapabilities", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->requiredReadCapabilities.size())); + std::vector ::const_iterator _iter1373; + for (_iter1373 = this->requiredReadCapabilities.begin(); _iter1373 != this->requiredReadCapabilities.end(); ++_iter1373) + { + xfer += oprot->writeString((*_iter1373)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.requiredWriteCapabilities) { + xfer += oprot->writeFieldBegin("requiredWriteCapabilities", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->requiredWriteCapabilities.size())); + std::vector ::const_iterator _iter1374; + for (_iter1374 = this->requiredWriteCapabilities.begin(); _iter1374 != this->requiredWriteCapabilities.end(); ++_iter1374) + { + xfer += oprot->writeString((*_iter1374)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ExtendedTableInfo &a, ExtendedTableInfo &b) noexcept { + using ::std::swap; + swap(a.tblName, b.tblName); + swap(a.accessType, b.accessType); + swap(a.requiredReadCapabilities, b.requiredReadCapabilities); + swap(a.requiredWriteCapabilities, b.requiredWriteCapabilities); + swap(a.__isset, b.__isset); +} + +bool ExtendedTableInfo::operator==(const ExtendedTableInfo & rhs) const +{ + if (!(tblName == rhs.tblName)) + return false; + if (__isset.accessType != rhs.__isset.accessType) + return false; + else if (__isset.accessType && !(accessType == rhs.accessType)) + return false; + if (__isset.requiredReadCapabilities != rhs.__isset.requiredReadCapabilities) + return false; + else if (__isset.requiredReadCapabilities && !(requiredReadCapabilities == rhs.requiredReadCapabilities)) + return false; + if (__isset.requiredWriteCapabilities != rhs.__isset.requiredWriteCapabilities) + return false; + else if (__isset.requiredWriteCapabilities && !(requiredWriteCapabilities == rhs.requiredWriteCapabilities)) + return false; + return true; +} + +ExtendedTableInfo::ExtendedTableInfo(const ExtendedTableInfo& other1375) { + tblName = other1375.tblName; + accessType = other1375.accessType; + requiredReadCapabilities = other1375.requiredReadCapabilities; + requiredWriteCapabilities = other1375.requiredWriteCapabilities; + __isset = other1375.__isset; +} +ExtendedTableInfo& ExtendedTableInfo::operator=(const ExtendedTableInfo& other1376) { + tblName = other1376.tblName; + accessType = other1376.accessType; + requiredReadCapabilities = other1376.requiredReadCapabilities; + requiredWriteCapabilities = other1376.requiredWriteCapabilities; + __isset = other1376.__isset; + return *this; +} +void ExtendedTableInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ExtendedTableInfo("; + out << "tblName=" << to_string(tblName); + out << ", " << "accessType="; (__isset.accessType ? (out << to_string(accessType)) : (out << "")); + out << ", " << "requiredReadCapabilities="; (__isset.requiredReadCapabilities ? (out << to_string(requiredReadCapabilities)) : (out << "")); + out << ", " << "requiredWriteCapabilities="; (__isset.requiredWriteCapabilities ? (out << to_string(requiredWriteCapabilities)) : (out << "")); + out << ")"; +} + + +DropTableRequest::~DropTableRequest() noexcept { +} + +DropTableRequest::DropTableRequest() noexcept + : catalogName(), + dbName(), + tableName(), + deleteData(0), + dropPartitions(0) { +} + +void DropTableRequest::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void DropTableRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void DropTableRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void DropTableRequest::__set_deleteData(const bool val) { + this->deleteData = val; +__isset.deleteData = true; +} + +void DropTableRequest::__set_envContext(const EnvironmentContext& val) { + this->envContext = val; +__isset.envContext = true; +} + +void DropTableRequest::__set_dropPartitions(const bool val) { + this->dropPartitions = val; +__isset.dropPartitions = true; +} +std::ostream& operator<<(std::ostream& out, const DropTableRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + this->__isset.deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->envContext.read(iprot); + this->__isset.envContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->dropPartitions); + this->__isset.dropPartitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropTableRequest"); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.deleteData) { + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.envContext) { + xfer += oprot->writeFieldBegin("envContext", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->envContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dropPartitions) { + xfer += oprot->writeFieldBegin("dropPartitions", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->dropPartitions); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropTableRequest &a, DropTableRequest &b) noexcept { + using ::std::swap; + swap(a.catalogName, b.catalogName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.deleteData, b.deleteData); + swap(a.envContext, b.envContext); + swap(a.dropPartitions, b.dropPartitions); + swap(a.__isset, b.__isset); +} + +bool DropTableRequest::operator==(const DropTableRequest & rhs) const +{ + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.deleteData != rhs.__isset.deleteData) + return false; + else if (__isset.deleteData && !(deleteData == rhs.deleteData)) + return false; + if (__isset.envContext != rhs.__isset.envContext) + return false; + else if (__isset.envContext && !(envContext == rhs.envContext)) + return false; + if (__isset.dropPartitions != rhs.__isset.dropPartitions) + return false; + else if (__isset.dropPartitions && !(dropPartitions == rhs.dropPartitions)) + return false; + return true; +} + +DropTableRequest::DropTableRequest(const DropTableRequest& other1377) { + catalogName = other1377.catalogName; + dbName = other1377.dbName; + tableName = other1377.tableName; + deleteData = other1377.deleteData; + envContext = other1377.envContext; + dropPartitions = other1377.dropPartitions; + __isset = other1377.__isset; +} +DropTableRequest& DropTableRequest::operator=(const DropTableRequest& other1378) { + catalogName = other1378.catalogName; + dbName = other1378.dbName; + tableName = other1378.tableName; + deleteData = other1378.deleteData; + envContext = other1378.envContext; + dropPartitions = other1378.dropPartitions; + __isset = other1378.__isset; + return *this; +} +void DropTableRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropTableRequest("; + out << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "deleteData="; (__isset.deleteData ? (out << to_string(deleteData)) : (out << "")); + out << ", " << "envContext="; (__isset.envContext ? (out << to_string(envContext)) : (out << "")); + out << ", " << "dropPartitions="; (__isset.dropPartitions ? (out << to_string(dropPartitions)) : (out << "")); + out << ")"; +} + + +GetDatabaseRequest::~GetDatabaseRequest() noexcept { +} + +GetDatabaseRequest::GetDatabaseRequest() noexcept + : name(), + catalogName(), + processorIdentifier() { +} + +void GetDatabaseRequest::__set_name(const std::string& val) { + this->name = val; +__isset.name = true; +} + +void GetDatabaseRequest::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void GetDatabaseRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetDatabaseRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} +std::ostream& operator<<(std::ostream& out, const GetDatabaseRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetDatabaseRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1379; + ::apache::thrift::protocol::TType _etype1382; + xfer += iprot->readListBegin(_etype1382, _size1379); + this->processorCapabilities.resize(_size1379); + uint32_t _i1383; + for (_i1383 = 0; _i1383 < _size1379; ++_i1383) + { + xfer += iprot->readString(this->processorCapabilities[_i1383]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetDatabaseRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetDatabaseRequest"); + + if (this->__isset.name) { + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1384; + for (_iter1384 = this->processorCapabilities.begin(); _iter1384 != this->processorCapabilities.end(); ++_iter1384) + { + xfer += oprot->writeString((*_iter1384)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetDatabaseRequest &a, GetDatabaseRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.catalogName, b.catalogName); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.__isset, b.__isset); +} + +bool GetDatabaseRequest::operator==(const GetDatabaseRequest & rhs) const +{ + if (__isset.name != rhs.__isset.name) + return false; + else if (__isset.name && !(name == rhs.name)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + return true; +} + +GetDatabaseRequest::GetDatabaseRequest(const GetDatabaseRequest& other1385) { + name = other1385.name; + catalogName = other1385.catalogName; + processorCapabilities = other1385.processorCapabilities; + processorIdentifier = other1385.processorIdentifier; + __isset = other1385.__isset; +} +GetDatabaseRequest& GetDatabaseRequest::operator=(const GetDatabaseRequest& other1386) { + name = other1386.name; + catalogName = other1386.catalogName; + processorCapabilities = other1386.processorCapabilities; + processorIdentifier = other1386.processorIdentifier; + __isset = other1386.__isset; + return *this; +} +void GetDatabaseRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetDatabaseRequest("; + out << "name="; (__isset.name ? (out << to_string(name)) : (out << "")); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ")"; +} + + +AlterDatabaseRequest::~AlterDatabaseRequest() noexcept { +} + +AlterDatabaseRequest::AlterDatabaseRequest() noexcept + : oldDbName() { +} + +void AlterDatabaseRequest::__set_oldDbName(const std::string& val) { + this->oldDbName = val; +} + +void AlterDatabaseRequest::__set_newDb(const Database& val) { + this->newDb = val; +} +std::ostream& operator<<(std::ostream& out, const AlterDatabaseRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterDatabaseRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_oldDbName = false; + bool isset_newDb = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->oldDbName); + isset_oldDbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newDb.read(iprot); + isset_newDb = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_oldDbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_newDb) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AlterDatabaseRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterDatabaseRequest"); + + xfer += oprot->writeFieldBegin("oldDbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->oldDbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newDb", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->newDb.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterDatabaseRequest &a, AlterDatabaseRequest &b) noexcept { + using ::std::swap; + swap(a.oldDbName, b.oldDbName); + swap(a.newDb, b.newDb); +} + +bool AlterDatabaseRequest::operator==(const AlterDatabaseRequest & rhs) const +{ + if (!(oldDbName == rhs.oldDbName)) + return false; + if (!(newDb == rhs.newDb)) + return false; + return true; +} + +AlterDatabaseRequest::AlterDatabaseRequest(const AlterDatabaseRequest& other1387) { + oldDbName = other1387.oldDbName; + newDb = other1387.newDb; +} +AlterDatabaseRequest& AlterDatabaseRequest::operator=(const AlterDatabaseRequest& other1388) { + oldDbName = other1388.oldDbName; + newDb = other1388.newDb; + return *this; +} +void AlterDatabaseRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterDatabaseRequest("; + out << "oldDbName=" << to_string(oldDbName); + out << ", " << "newDb=" << to_string(newDb); + out << ")"; +} + + +DropDatabaseRequest::~DropDatabaseRequest() noexcept { +} + +DropDatabaseRequest::DropDatabaseRequest() noexcept + : name(), + catalogName(), + ignoreUnknownDb(0), + deleteData(0), + cascade(0), + softDelete(false), + txnId(0LL), + deleteManagedDir(true) { +} + +void DropDatabaseRequest::__set_name(const std::string& val) { + this->name = val; +} + +void DropDatabaseRequest::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void DropDatabaseRequest::__set_ignoreUnknownDb(const bool val) { + this->ignoreUnknownDb = val; +} + +void DropDatabaseRequest::__set_deleteData(const bool val) { + this->deleteData = val; +} + +void DropDatabaseRequest::__set_cascade(const bool val) { + this->cascade = val; +} + +void DropDatabaseRequest::__set_softDelete(const bool val) { + this->softDelete = val; +__isset.softDelete = true; +} + +void DropDatabaseRequest::__set_txnId(const int64_t val) { + this->txnId = val; +__isset.txnId = true; +} + +void DropDatabaseRequest::__set_deleteManagedDir(const bool val) { + this->deleteManagedDir = val; +__isset.deleteManagedDir = true; +} +std::ostream& operator<<(std::ostream& out, const DropDatabaseRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropDatabaseRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_ignoreUnknownDb = false; + bool isset_deleteData = false; + bool isset_cascade = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ignoreUnknownDb); + isset_ignoreUnknownDb = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteData); + isset_deleteData = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->cascade); + isset_cascade = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->softDelete); + this->__isset.softDelete = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->deleteManagedDir); + this->__isset.deleteManagedDir = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_ignoreUnknownDb) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_deleteData) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_cascade) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropDatabaseRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropDatabaseRequest"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("ignoreUnknownDb", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->ignoreUnknownDb); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("deleteData", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->deleteData); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cascade", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->cascade); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.softDelete) { + xfer += oprot->writeFieldBegin("softDelete", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->softDelete); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnId) { + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.deleteManagedDir) { + xfer += oprot->writeFieldBegin("deleteManagedDir", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->deleteManagedDir); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropDatabaseRequest &a, DropDatabaseRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.catalogName, b.catalogName); + swap(a.ignoreUnknownDb, b.ignoreUnknownDb); + swap(a.deleteData, b.deleteData); + swap(a.cascade, b.cascade); + swap(a.softDelete, b.softDelete); + swap(a.txnId, b.txnId); + swap(a.deleteManagedDir, b.deleteManagedDir); + swap(a.__isset, b.__isset); +} + +bool DropDatabaseRequest::operator==(const DropDatabaseRequest & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (!(ignoreUnknownDb == rhs.ignoreUnknownDb)) + return false; + if (!(deleteData == rhs.deleteData)) + return false; + if (!(cascade == rhs.cascade)) + return false; + if (__isset.softDelete != rhs.__isset.softDelete) + return false; + else if (__isset.softDelete && !(softDelete == rhs.softDelete)) + return false; + if (__isset.txnId != rhs.__isset.txnId) + return false; + else if (__isset.txnId && !(txnId == rhs.txnId)) + return false; + if (__isset.deleteManagedDir != rhs.__isset.deleteManagedDir) + return false; + else if (__isset.deleteManagedDir && !(deleteManagedDir == rhs.deleteManagedDir)) + return false; + return true; +} + +DropDatabaseRequest::DropDatabaseRequest(const DropDatabaseRequest& other1389) { + name = other1389.name; + catalogName = other1389.catalogName; + ignoreUnknownDb = other1389.ignoreUnknownDb; + deleteData = other1389.deleteData; + cascade = other1389.cascade; + softDelete = other1389.softDelete; + txnId = other1389.txnId; + deleteManagedDir = other1389.deleteManagedDir; + __isset = other1389.__isset; +} +DropDatabaseRequest& DropDatabaseRequest::operator=(const DropDatabaseRequest& other1390) { + name = other1390.name; + catalogName = other1390.catalogName; + ignoreUnknownDb = other1390.ignoreUnknownDb; + deleteData = other1390.deleteData; + cascade = other1390.cascade; + softDelete = other1390.softDelete; + txnId = other1390.txnId; + deleteManagedDir = other1390.deleteManagedDir; + __isset = other1390.__isset; + return *this; +} +void DropDatabaseRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropDatabaseRequest("; + out << "name=" << to_string(name); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "ignoreUnknownDb=" << to_string(ignoreUnknownDb); + out << ", " << "deleteData=" << to_string(deleteData); + out << ", " << "cascade=" << to_string(cascade); + out << ", " << "softDelete="; (__isset.softDelete ? (out << to_string(softDelete)) : (out << "")); + out << ", " << "txnId="; (__isset.txnId ? (out << to_string(txnId)) : (out << "")); + out << ", " << "deleteManagedDir="; (__isset.deleteManagedDir ? (out << to_string(deleteManagedDir)) : (out << "")); + out << ")"; +} + + +CmRecycleRequest::~CmRecycleRequest() noexcept { +} + +CmRecycleRequest::CmRecycleRequest() noexcept + : dataPath(), + purge(0) { +} + +void CmRecycleRequest::__set_dataPath(const std::string& val) { + this->dataPath = val; +} + +void CmRecycleRequest::__set_purge(const bool val) { + this->purge = val; +} +std::ostream& operator<<(std::ostream& out, const CmRecycleRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CmRecycleRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dataPath = false; + bool isset_purge = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dataPath); + isset_dataPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->purge); + isset_purge = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dataPath) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_purge) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CmRecycleRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CmRecycleRequest"); + + xfer += oprot->writeFieldBegin("dataPath", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dataPath); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("purge", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->purge); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CmRecycleRequest &a, CmRecycleRequest &b) noexcept { + using ::std::swap; + swap(a.dataPath, b.dataPath); + swap(a.purge, b.purge); +} + +bool CmRecycleRequest::operator==(const CmRecycleRequest & rhs) const +{ + if (!(dataPath == rhs.dataPath)) + return false; + if (!(purge == rhs.purge)) + return false; + return true; +} + +CmRecycleRequest::CmRecycleRequest(const CmRecycleRequest& other1391) { + dataPath = other1391.dataPath; + purge = other1391.purge; +} +CmRecycleRequest& CmRecycleRequest::operator=(const CmRecycleRequest& other1392) { + dataPath = other1392.dataPath; + purge = other1392.purge; + return *this; +} +void CmRecycleRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CmRecycleRequest("; + out << "dataPath=" << to_string(dataPath); + out << ", " << "purge=" << to_string(purge); + out << ")"; +} + + +CmRecycleResponse::~CmRecycleResponse() noexcept { +} + +CmRecycleResponse::CmRecycleResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const CmRecycleResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CmRecycleResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t CmRecycleResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CmRecycleResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CmRecycleResponse &a, CmRecycleResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool CmRecycleResponse::operator==(const CmRecycleResponse & /* rhs */) const +{ + return true; +} + +CmRecycleResponse::CmRecycleResponse(const CmRecycleResponse& other1393) noexcept { + (void) other1393; +} +CmRecycleResponse& CmRecycleResponse::operator=(const CmRecycleResponse& other1394) noexcept { + (void) other1394; + return *this; +} +void CmRecycleResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CmRecycleResponse("; + out << ")"; +} + + +TableMeta::~TableMeta() noexcept { +} + +TableMeta::TableMeta() noexcept + : dbName(), + tableName(), + tableType(), + comments(), + catName(), + ownerName(), + ownerType(static_cast(0)) { +} + +void TableMeta::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void TableMeta::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void TableMeta::__set_tableType(const std::string& val) { + this->tableType = val; +} + +void TableMeta::__set_comments(const std::string& val) { + this->comments = val; +__isset.comments = true; +} + +void TableMeta::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void TableMeta::__set_ownerName(const std::string& val) { + this->ownerName = val; +__isset.ownerName = true; +} + +void TableMeta::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +__isset.ownerType = true; +} +std::ostream& operator<<(std::ostream& out, const TableMeta& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TableMeta::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + bool isset_tableType = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableType); + isset_tableType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comments); + this->__isset.comments = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1395; + xfer += iprot->readI32(ecast1395); + this->ownerType = static_cast(ecast1395); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableType) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TableMeta::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TableMeta"); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableType", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableType); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.comments) { + xfer += oprot->writeFieldBegin("comments", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->comments); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerName) { + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerType) { + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TableMeta &a, TableMeta &b) noexcept { + using ::std::swap; + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.tableType, b.tableType); + swap(a.comments, b.comments); + swap(a.catName, b.catName); + swap(a.ownerName, b.ownerName); + swap(a.ownerType, b.ownerType); + swap(a.__isset, b.__isset); +} + +bool TableMeta::operator==(const TableMeta & rhs) const +{ + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(tableType == rhs.tableType)) + return false; + if (__isset.comments != rhs.__isset.comments) + return false; + else if (__isset.comments && !(comments == rhs.comments)) + return false; + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (__isset.ownerName != rhs.__isset.ownerName) + return false; + else if (__isset.ownerName && !(ownerName == rhs.ownerName)) + return false; + if (__isset.ownerType != rhs.__isset.ownerType) + return false; + else if (__isset.ownerType && !(ownerType == rhs.ownerType)) + return false; + return true; +} + +TableMeta::TableMeta(const TableMeta& other1396) { + dbName = other1396.dbName; + tableName = other1396.tableName; + tableType = other1396.tableType; + comments = other1396.comments; + catName = other1396.catName; + ownerName = other1396.ownerName; + ownerType = other1396.ownerType; + __isset = other1396.__isset; +} +TableMeta& TableMeta::operator=(const TableMeta& other1397) { + dbName = other1397.dbName; + tableName = other1397.tableName; + tableType = other1397.tableType; + comments = other1397.comments; + catName = other1397.catName; + ownerName = other1397.ownerName; + ownerType = other1397.ownerType; + __isset = other1397.__isset; + return *this; +} +void TableMeta::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TableMeta("; + out << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "tableType=" << to_string(tableType); + out << ", " << "comments="; (__isset.comments ? (out << to_string(comments)) : (out << "")); + out << ", " << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "ownerName="; (__isset.ownerName ? (out << to_string(ownerName)) : (out << "")); + out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ")"; +} + + +Materialization::~Materialization() noexcept { +} + +Materialization::Materialization() noexcept + : sourceTablesUpdateDeleteModified(0), + sourceTablesCompacted(0) { +} + +void Materialization::__set_sourceTablesUpdateDeleteModified(const bool val) { + this->sourceTablesUpdateDeleteModified = val; +} + +void Materialization::__set_sourceTablesCompacted(const bool val) { + this->sourceTablesCompacted = val; +} +std::ostream& operator<<(std::ostream& out, const Materialization& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Materialization::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_sourceTablesUpdateDeleteModified = false; + bool isset_sourceTablesCompacted = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->sourceTablesUpdateDeleteModified); + isset_sourceTablesUpdateDeleteModified = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->sourceTablesCompacted); + isset_sourceTablesCompacted = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sourceTablesUpdateDeleteModified) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_sourceTablesCompacted) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Materialization::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Materialization"); + + xfer += oprot->writeFieldBegin("sourceTablesUpdateDeleteModified", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->sourceTablesUpdateDeleteModified); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sourceTablesCompacted", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->sourceTablesCompacted); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Materialization &a, Materialization &b) noexcept { + using ::std::swap; + swap(a.sourceTablesUpdateDeleteModified, b.sourceTablesUpdateDeleteModified); + swap(a.sourceTablesCompacted, b.sourceTablesCompacted); +} + +bool Materialization::operator==(const Materialization & rhs) const +{ + if (!(sourceTablesUpdateDeleteModified == rhs.sourceTablesUpdateDeleteModified)) + return false; + if (!(sourceTablesCompacted == rhs.sourceTablesCompacted)) + return false; + return true; +} + +Materialization::Materialization(const Materialization& other1398) noexcept { + sourceTablesUpdateDeleteModified = other1398.sourceTablesUpdateDeleteModified; + sourceTablesCompacted = other1398.sourceTablesCompacted; +} +Materialization& Materialization::operator=(const Materialization& other1399) noexcept { + sourceTablesUpdateDeleteModified = other1399.sourceTablesUpdateDeleteModified; + sourceTablesCompacted = other1399.sourceTablesCompacted; + return *this; +} +void Materialization::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Materialization("; + out << "sourceTablesUpdateDeleteModified=" << to_string(sourceTablesUpdateDeleteModified); + out << ", " << "sourceTablesCompacted=" << to_string(sourceTablesCompacted); + out << ")"; +} + + +WMResourcePlan::~WMResourcePlan() noexcept { +} + +WMResourcePlan::WMResourcePlan() noexcept + : name(), + status(static_cast(0)), + queryParallelism(0), + defaultPoolPath(), + ns() { +} + +void WMResourcePlan::__set_name(const std::string& val) { + this->name = val; +} + +void WMResourcePlan::__set_status(const WMResourcePlanStatus::type val) { + this->status = val; +__isset.status = true; +} + +void WMResourcePlan::__set_queryParallelism(const int32_t val) { + this->queryParallelism = val; +__isset.queryParallelism = true; +} + +void WMResourcePlan::__set_defaultPoolPath(const std::string& val) { + this->defaultPoolPath = val; +__isset.defaultPoolPath = true; +} + +void WMResourcePlan::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMResourcePlan& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMResourcePlan::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1400; + xfer += iprot->readI32(ecast1400); + this->status = static_cast(ecast1400); + this->__isset.status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->queryParallelism); + this->__isset.queryParallelism = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->defaultPoolPath); + this->__isset.defaultPoolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMResourcePlan::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMResourcePlan"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.status) { + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->status)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.queryParallelism) { + xfer += oprot->writeFieldBegin("queryParallelism", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->queryParallelism); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.defaultPoolPath) { + xfer += oprot->writeFieldBegin("defaultPoolPath", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->defaultPoolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMResourcePlan &a, WMResourcePlan &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.status, b.status); + swap(a.queryParallelism, b.queryParallelism); + swap(a.defaultPoolPath, b.defaultPoolPath); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMResourcePlan::operator==(const WMResourcePlan & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (__isset.status != rhs.__isset.status) + return false; + else if (__isset.status && !(status == rhs.status)) + return false; + if (__isset.queryParallelism != rhs.__isset.queryParallelism) + return false; + else if (__isset.queryParallelism && !(queryParallelism == rhs.queryParallelism)) + return false; + if (__isset.defaultPoolPath != rhs.__isset.defaultPoolPath) + return false; + else if (__isset.defaultPoolPath && !(defaultPoolPath == rhs.defaultPoolPath)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMResourcePlan::WMResourcePlan(const WMResourcePlan& other1401) { + name = other1401.name; + status = other1401.status; + queryParallelism = other1401.queryParallelism; + defaultPoolPath = other1401.defaultPoolPath; + ns = other1401.ns; + __isset = other1401.__isset; +} +WMResourcePlan& WMResourcePlan::operator=(const WMResourcePlan& other1402) { + name = other1402.name; + status = other1402.status; + queryParallelism = other1402.queryParallelism; + defaultPoolPath = other1402.defaultPoolPath; + ns = other1402.ns; + __isset = other1402.__isset; + return *this; +} +void WMResourcePlan::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMResourcePlan("; + out << "name=" << to_string(name); + out << ", " << "status="; (__isset.status ? (out << to_string(status)) : (out << "")); + out << ", " << "queryParallelism="; (__isset.queryParallelism ? (out << to_string(queryParallelism)) : (out << "")); + out << ", " << "defaultPoolPath="; (__isset.defaultPoolPath ? (out << to_string(defaultPoolPath)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMNullableResourcePlan::~WMNullableResourcePlan() noexcept { +} + +WMNullableResourcePlan::WMNullableResourcePlan() noexcept + : name(), + status(static_cast(0)), + queryParallelism(0), + isSetQueryParallelism(0), + defaultPoolPath(), + isSetDefaultPoolPath(0), + ns() { +} + +void WMNullableResourcePlan::__set_name(const std::string& val) { + this->name = val; +__isset.name = true; +} + +void WMNullableResourcePlan::__set_status(const WMResourcePlanStatus::type val) { + this->status = val; +__isset.status = true; +} + +void WMNullableResourcePlan::__set_queryParallelism(const int32_t val) { + this->queryParallelism = val; +__isset.queryParallelism = true; +} + +void WMNullableResourcePlan::__set_isSetQueryParallelism(const bool val) { + this->isSetQueryParallelism = val; +__isset.isSetQueryParallelism = true; +} + +void WMNullableResourcePlan::__set_defaultPoolPath(const std::string& val) { + this->defaultPoolPath = val; +__isset.defaultPoolPath = true; +} + +void WMNullableResourcePlan::__set_isSetDefaultPoolPath(const bool val) { + this->isSetDefaultPoolPath = val; +__isset.isSetDefaultPoolPath = true; +} + +void WMNullableResourcePlan::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMNullableResourcePlan& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMNullableResourcePlan::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1403; + xfer += iprot->readI32(ecast1403); + this->status = static_cast(ecast1403); + this->__isset.status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->queryParallelism); + this->__isset.queryParallelism = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSetQueryParallelism); + this->__isset.isSetQueryParallelism = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->defaultPoolPath); + this->__isset.defaultPoolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSetDefaultPoolPath); + this->__isset.isSetDefaultPoolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMNullableResourcePlan::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMNullableResourcePlan"); + + if (this->__isset.name) { + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.status) { + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->status)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.queryParallelism) { + xfer += oprot->writeFieldBegin("queryParallelism", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->queryParallelism); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isSetQueryParallelism) { + xfer += oprot->writeFieldBegin("isSetQueryParallelism", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->isSetQueryParallelism); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.defaultPoolPath) { + xfer += oprot->writeFieldBegin("defaultPoolPath", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->defaultPoolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isSetDefaultPoolPath) { + xfer += oprot->writeFieldBegin("isSetDefaultPoolPath", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->isSetDefaultPoolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMNullableResourcePlan &a, WMNullableResourcePlan &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.status, b.status); + swap(a.queryParallelism, b.queryParallelism); + swap(a.isSetQueryParallelism, b.isSetQueryParallelism); + swap(a.defaultPoolPath, b.defaultPoolPath); + swap(a.isSetDefaultPoolPath, b.isSetDefaultPoolPath); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMNullableResourcePlan::operator==(const WMNullableResourcePlan & rhs) const +{ + if (__isset.name != rhs.__isset.name) + return false; + else if (__isset.name && !(name == rhs.name)) + return false; + if (__isset.status != rhs.__isset.status) + return false; + else if (__isset.status && !(status == rhs.status)) + return false; + if (__isset.queryParallelism != rhs.__isset.queryParallelism) + return false; + else if (__isset.queryParallelism && !(queryParallelism == rhs.queryParallelism)) + return false; + if (__isset.isSetQueryParallelism != rhs.__isset.isSetQueryParallelism) + return false; + else if (__isset.isSetQueryParallelism && !(isSetQueryParallelism == rhs.isSetQueryParallelism)) + return false; + if (__isset.defaultPoolPath != rhs.__isset.defaultPoolPath) + return false; + else if (__isset.defaultPoolPath && !(defaultPoolPath == rhs.defaultPoolPath)) + return false; + if (__isset.isSetDefaultPoolPath != rhs.__isset.isSetDefaultPoolPath) + return false; + else if (__isset.isSetDefaultPoolPath && !(isSetDefaultPoolPath == rhs.isSetDefaultPoolPath)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMNullableResourcePlan::WMNullableResourcePlan(const WMNullableResourcePlan& other1404) { + name = other1404.name; + status = other1404.status; + queryParallelism = other1404.queryParallelism; + isSetQueryParallelism = other1404.isSetQueryParallelism; + defaultPoolPath = other1404.defaultPoolPath; + isSetDefaultPoolPath = other1404.isSetDefaultPoolPath; + ns = other1404.ns; + __isset = other1404.__isset; +} +WMNullableResourcePlan& WMNullableResourcePlan::operator=(const WMNullableResourcePlan& other1405) { + name = other1405.name; + status = other1405.status; + queryParallelism = other1405.queryParallelism; + isSetQueryParallelism = other1405.isSetQueryParallelism; + defaultPoolPath = other1405.defaultPoolPath; + isSetDefaultPoolPath = other1405.isSetDefaultPoolPath; + ns = other1405.ns; + __isset = other1405.__isset; + return *this; +} +void WMNullableResourcePlan::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMNullableResourcePlan("; + out << "name="; (__isset.name ? (out << to_string(name)) : (out << "")); + out << ", " << "status="; (__isset.status ? (out << to_string(status)) : (out << "")); + out << ", " << "queryParallelism="; (__isset.queryParallelism ? (out << to_string(queryParallelism)) : (out << "")); + out << ", " << "isSetQueryParallelism="; (__isset.isSetQueryParallelism ? (out << to_string(isSetQueryParallelism)) : (out << "")); + out << ", " << "defaultPoolPath="; (__isset.defaultPoolPath ? (out << to_string(defaultPoolPath)) : (out << "")); + out << ", " << "isSetDefaultPoolPath="; (__isset.isSetDefaultPoolPath ? (out << to_string(isSetDefaultPoolPath)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMPool::~WMPool() noexcept { +} + +WMPool::WMPool() noexcept + : resourcePlanName(), + poolPath(), + allocFraction(0), + queryParallelism(0), + schedulingPolicy(), + ns() { +} + +void WMPool::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +} + +void WMPool::__set_poolPath(const std::string& val) { + this->poolPath = val; +} + +void WMPool::__set_allocFraction(const double val) { + this->allocFraction = val; +__isset.allocFraction = true; +} + +void WMPool::__set_queryParallelism(const int32_t val) { + this->queryParallelism = val; +__isset.queryParallelism = true; +} + +void WMPool::__set_schedulingPolicy(const std::string& val) { + this->schedulingPolicy = val; +__isset.schedulingPolicy = true; +} + +void WMPool::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMPool& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMPool::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_resourcePlanName = false; + bool isset_poolPath = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + isset_resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + isset_poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->allocFraction); + this->__isset.allocFraction = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->queryParallelism); + this->__isset.queryParallelism = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schedulingPolicy); + this->__isset.schedulingPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_resourcePlanName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_poolPath) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMPool::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMPool"); + + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.allocFraction) { + xfer += oprot->writeFieldBegin("allocFraction", ::apache::thrift::protocol::T_DOUBLE, 3); + xfer += oprot->writeDouble(this->allocFraction); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.queryParallelism) { + xfer += oprot->writeFieldBegin("queryParallelism", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->queryParallelism); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schedulingPolicy) { + xfer += oprot->writeFieldBegin("schedulingPolicy", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->schedulingPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMPool &a, WMPool &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.poolPath, b.poolPath); + swap(a.allocFraction, b.allocFraction); + swap(a.queryParallelism, b.queryParallelism); + swap(a.schedulingPolicy, b.schedulingPolicy); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMPool::operator==(const WMPool & rhs) const +{ + if (!(resourcePlanName == rhs.resourcePlanName)) + return false; + if (!(poolPath == rhs.poolPath)) + return false; + if (__isset.allocFraction != rhs.__isset.allocFraction) + return false; + else if (__isset.allocFraction && !(allocFraction == rhs.allocFraction)) + return false; + if (__isset.queryParallelism != rhs.__isset.queryParallelism) + return false; + else if (__isset.queryParallelism && !(queryParallelism == rhs.queryParallelism)) + return false; + if (__isset.schedulingPolicy != rhs.__isset.schedulingPolicy) + return false; + else if (__isset.schedulingPolicy && !(schedulingPolicy == rhs.schedulingPolicy)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMPool::WMPool(const WMPool& other1406) { + resourcePlanName = other1406.resourcePlanName; + poolPath = other1406.poolPath; + allocFraction = other1406.allocFraction; + queryParallelism = other1406.queryParallelism; + schedulingPolicy = other1406.schedulingPolicy; + ns = other1406.ns; + __isset = other1406.__isset; +} +WMPool& WMPool::operator=(const WMPool& other1407) { + resourcePlanName = other1407.resourcePlanName; + poolPath = other1407.poolPath; + allocFraction = other1407.allocFraction; + queryParallelism = other1407.queryParallelism; + schedulingPolicy = other1407.schedulingPolicy; + ns = other1407.ns; + __isset = other1407.__isset; + return *this; +} +void WMPool::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMPool("; + out << "resourcePlanName=" << to_string(resourcePlanName); + out << ", " << "poolPath=" << to_string(poolPath); + out << ", " << "allocFraction="; (__isset.allocFraction ? (out << to_string(allocFraction)) : (out << "")); + out << ", " << "queryParallelism="; (__isset.queryParallelism ? (out << to_string(queryParallelism)) : (out << "")); + out << ", " << "schedulingPolicy="; (__isset.schedulingPolicy ? (out << to_string(schedulingPolicy)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMNullablePool::~WMNullablePool() noexcept { +} + +WMNullablePool::WMNullablePool() noexcept + : resourcePlanName(), + poolPath(), + allocFraction(0), + queryParallelism(0), + schedulingPolicy(), + isSetSchedulingPolicy(0), + ns() { +} + +void WMNullablePool::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +} + +void WMNullablePool::__set_poolPath(const std::string& val) { + this->poolPath = val; +} + +void WMNullablePool::__set_allocFraction(const double val) { + this->allocFraction = val; +__isset.allocFraction = true; +} + +void WMNullablePool::__set_queryParallelism(const int32_t val) { + this->queryParallelism = val; +__isset.queryParallelism = true; +} + +void WMNullablePool::__set_schedulingPolicy(const std::string& val) { + this->schedulingPolicy = val; +__isset.schedulingPolicy = true; +} + +void WMNullablePool::__set_isSetSchedulingPolicy(const bool val) { + this->isSetSchedulingPolicy = val; +__isset.isSetSchedulingPolicy = true; +} + +void WMNullablePool::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMNullablePool& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMNullablePool::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_resourcePlanName = false; + bool isset_poolPath = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + isset_resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + isset_poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->allocFraction); + this->__isset.allocFraction = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->queryParallelism); + this->__isset.queryParallelism = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schedulingPolicy); + this->__isset.schedulingPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isSetSchedulingPolicy); + this->__isset.isSetSchedulingPolicy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_resourcePlanName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_poolPath) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMNullablePool::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMNullablePool"); + + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.allocFraction) { + xfer += oprot->writeFieldBegin("allocFraction", ::apache::thrift::protocol::T_DOUBLE, 3); + xfer += oprot->writeDouble(this->allocFraction); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.queryParallelism) { + xfer += oprot->writeFieldBegin("queryParallelism", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->queryParallelism); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schedulingPolicy) { + xfer += oprot->writeFieldBegin("schedulingPolicy", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->schedulingPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isSetSchedulingPolicy) { + xfer += oprot->writeFieldBegin("isSetSchedulingPolicy", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->isSetSchedulingPolicy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMNullablePool &a, WMNullablePool &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.poolPath, b.poolPath); + swap(a.allocFraction, b.allocFraction); + swap(a.queryParallelism, b.queryParallelism); + swap(a.schedulingPolicy, b.schedulingPolicy); + swap(a.isSetSchedulingPolicy, b.isSetSchedulingPolicy); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMNullablePool::operator==(const WMNullablePool & rhs) const +{ + if (!(resourcePlanName == rhs.resourcePlanName)) + return false; + if (!(poolPath == rhs.poolPath)) + return false; + if (__isset.allocFraction != rhs.__isset.allocFraction) + return false; + else if (__isset.allocFraction && !(allocFraction == rhs.allocFraction)) + return false; + if (__isset.queryParallelism != rhs.__isset.queryParallelism) + return false; + else if (__isset.queryParallelism && !(queryParallelism == rhs.queryParallelism)) + return false; + if (__isset.schedulingPolicy != rhs.__isset.schedulingPolicy) + return false; + else if (__isset.schedulingPolicy && !(schedulingPolicy == rhs.schedulingPolicy)) + return false; + if (__isset.isSetSchedulingPolicy != rhs.__isset.isSetSchedulingPolicy) + return false; + else if (__isset.isSetSchedulingPolicy && !(isSetSchedulingPolicy == rhs.isSetSchedulingPolicy)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMNullablePool::WMNullablePool(const WMNullablePool& other1408) { + resourcePlanName = other1408.resourcePlanName; + poolPath = other1408.poolPath; + allocFraction = other1408.allocFraction; + queryParallelism = other1408.queryParallelism; + schedulingPolicy = other1408.schedulingPolicy; + isSetSchedulingPolicy = other1408.isSetSchedulingPolicy; + ns = other1408.ns; + __isset = other1408.__isset; +} +WMNullablePool& WMNullablePool::operator=(const WMNullablePool& other1409) { + resourcePlanName = other1409.resourcePlanName; + poolPath = other1409.poolPath; + allocFraction = other1409.allocFraction; + queryParallelism = other1409.queryParallelism; + schedulingPolicy = other1409.schedulingPolicy; + isSetSchedulingPolicy = other1409.isSetSchedulingPolicy; + ns = other1409.ns; + __isset = other1409.__isset; + return *this; +} +void WMNullablePool::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMNullablePool("; + out << "resourcePlanName=" << to_string(resourcePlanName); + out << ", " << "poolPath=" << to_string(poolPath); + out << ", " << "allocFraction="; (__isset.allocFraction ? (out << to_string(allocFraction)) : (out << "")); + out << ", " << "queryParallelism="; (__isset.queryParallelism ? (out << to_string(queryParallelism)) : (out << "")); + out << ", " << "schedulingPolicy="; (__isset.schedulingPolicy ? (out << to_string(schedulingPolicy)) : (out << "")); + out << ", " << "isSetSchedulingPolicy="; (__isset.isSetSchedulingPolicy ? (out << to_string(isSetSchedulingPolicy)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMTrigger::~WMTrigger() noexcept { +} + +WMTrigger::WMTrigger() noexcept + : resourcePlanName(), + triggerName(), + triggerExpression(), + actionExpression(), + isInUnmanaged(0), + ns() { +} + +void WMTrigger::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +} + +void WMTrigger::__set_triggerName(const std::string& val) { + this->triggerName = val; +} + +void WMTrigger::__set_triggerExpression(const std::string& val) { + this->triggerExpression = val; +__isset.triggerExpression = true; +} + +void WMTrigger::__set_actionExpression(const std::string& val) { + this->actionExpression = val; +__isset.actionExpression = true; +} + +void WMTrigger::__set_isInUnmanaged(const bool val) { + this->isInUnmanaged = val; +__isset.isInUnmanaged = true; +} + +void WMTrigger::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMTrigger& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMTrigger::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_resourcePlanName = false; + bool isset_triggerName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + isset_resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->triggerName); + isset_triggerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->triggerExpression); + this->__isset.triggerExpression = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->actionExpression); + this->__isset.actionExpression = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isInUnmanaged); + this->__isset.isInUnmanaged = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_resourcePlanName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_triggerName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMTrigger::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMTrigger"); + + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("triggerName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->triggerName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.triggerExpression) { + xfer += oprot->writeFieldBegin("triggerExpression", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->triggerExpression); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.actionExpression) { + xfer += oprot->writeFieldBegin("actionExpression", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->actionExpression); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isInUnmanaged) { + xfer += oprot->writeFieldBegin("isInUnmanaged", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->isInUnmanaged); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMTrigger &a, WMTrigger &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.triggerName, b.triggerName); + swap(a.triggerExpression, b.triggerExpression); + swap(a.actionExpression, b.actionExpression); + swap(a.isInUnmanaged, b.isInUnmanaged); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMTrigger::operator==(const WMTrigger & rhs) const +{ + if (!(resourcePlanName == rhs.resourcePlanName)) + return false; + if (!(triggerName == rhs.triggerName)) + return false; + if (__isset.triggerExpression != rhs.__isset.triggerExpression) + return false; + else if (__isset.triggerExpression && !(triggerExpression == rhs.triggerExpression)) + return false; + if (__isset.actionExpression != rhs.__isset.actionExpression) + return false; + else if (__isset.actionExpression && !(actionExpression == rhs.actionExpression)) + return false; + if (__isset.isInUnmanaged != rhs.__isset.isInUnmanaged) + return false; + else if (__isset.isInUnmanaged && !(isInUnmanaged == rhs.isInUnmanaged)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMTrigger::WMTrigger(const WMTrigger& other1410) { + resourcePlanName = other1410.resourcePlanName; + triggerName = other1410.triggerName; + triggerExpression = other1410.triggerExpression; + actionExpression = other1410.actionExpression; + isInUnmanaged = other1410.isInUnmanaged; + ns = other1410.ns; + __isset = other1410.__isset; +} +WMTrigger& WMTrigger::operator=(const WMTrigger& other1411) { + resourcePlanName = other1411.resourcePlanName; + triggerName = other1411.triggerName; + triggerExpression = other1411.triggerExpression; + actionExpression = other1411.actionExpression; + isInUnmanaged = other1411.isInUnmanaged; + ns = other1411.ns; + __isset = other1411.__isset; + return *this; +} +void WMTrigger::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMTrigger("; + out << "resourcePlanName=" << to_string(resourcePlanName); + out << ", " << "triggerName=" << to_string(triggerName); + out << ", " << "triggerExpression="; (__isset.triggerExpression ? (out << to_string(triggerExpression)) : (out << "")); + out << ", " << "actionExpression="; (__isset.actionExpression ? (out << to_string(actionExpression)) : (out << "")); + out << ", " << "isInUnmanaged="; (__isset.isInUnmanaged ? (out << to_string(isInUnmanaged)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMMapping::~WMMapping() noexcept { +} + +WMMapping::WMMapping() noexcept + : resourcePlanName(), + entityType(), + entityName(), + poolPath(), + ordering(0), + ns() { +} + +void WMMapping::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +} + +void WMMapping::__set_entityType(const std::string& val) { + this->entityType = val; +} + +void WMMapping::__set_entityName(const std::string& val) { + this->entityName = val; +} + +void WMMapping::__set_poolPath(const std::string& val) { + this->poolPath = val; +__isset.poolPath = true; +} + +void WMMapping::__set_ordering(const int32_t val) { + this->ordering = val; +__isset.ordering = true; +} + +void WMMapping::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMMapping& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMMapping::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_resourcePlanName = false; + bool isset_entityType = false; + bool isset_entityName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + isset_resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->entityType); + isset_entityType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->entityName); + isset_entityName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + this->__isset.poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->ordering); + this->__isset.ordering = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_resourcePlanName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_entityType) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_entityName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMMapping::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMMapping"); + + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("entityType", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->entityType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("entityName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->entityName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.poolPath) { + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ordering) { + xfer += oprot->writeFieldBegin("ordering", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->ordering); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMMapping &a, WMMapping &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.entityType, b.entityType); + swap(a.entityName, b.entityName); + swap(a.poolPath, b.poolPath); + swap(a.ordering, b.ordering); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMMapping::operator==(const WMMapping & rhs) const +{ + if (!(resourcePlanName == rhs.resourcePlanName)) + return false; + if (!(entityType == rhs.entityType)) + return false; + if (!(entityName == rhs.entityName)) + return false; + if (__isset.poolPath != rhs.__isset.poolPath) + return false; + else if (__isset.poolPath && !(poolPath == rhs.poolPath)) + return false; + if (__isset.ordering != rhs.__isset.ordering) + return false; + else if (__isset.ordering && !(ordering == rhs.ordering)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMMapping::WMMapping(const WMMapping& other1412) { + resourcePlanName = other1412.resourcePlanName; + entityType = other1412.entityType; + entityName = other1412.entityName; + poolPath = other1412.poolPath; + ordering = other1412.ordering; + ns = other1412.ns; + __isset = other1412.__isset; +} +WMMapping& WMMapping::operator=(const WMMapping& other1413) { + resourcePlanName = other1413.resourcePlanName; + entityType = other1413.entityType; + entityName = other1413.entityName; + poolPath = other1413.poolPath; + ordering = other1413.ordering; + ns = other1413.ns; + __isset = other1413.__isset; + return *this; +} +void WMMapping::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMMapping("; + out << "resourcePlanName=" << to_string(resourcePlanName); + out << ", " << "entityType=" << to_string(entityType); + out << ", " << "entityName=" << to_string(entityName); + out << ", " << "poolPath="; (__isset.poolPath ? (out << to_string(poolPath)) : (out << "")); + out << ", " << "ordering="; (__isset.ordering ? (out << to_string(ordering)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMPoolTrigger::~WMPoolTrigger() noexcept { +} + +WMPoolTrigger::WMPoolTrigger() noexcept + : pool(), + trigger(), + ns() { +} + +void WMPoolTrigger::__set_pool(const std::string& val) { + this->pool = val; +} + +void WMPoolTrigger::__set_trigger(const std::string& val) { + this->trigger = val; +} + +void WMPoolTrigger::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMPoolTrigger& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMPoolTrigger::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_pool = false; + bool isset_trigger = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->pool); + isset_pool = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->trigger); + isset_trigger = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_pool) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_trigger) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMPoolTrigger::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMPoolTrigger"); + + xfer += oprot->writeFieldBegin("pool", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->pool); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("trigger", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->trigger); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMPoolTrigger &a, WMPoolTrigger &b) noexcept { + using ::std::swap; + swap(a.pool, b.pool); + swap(a.trigger, b.trigger); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMPoolTrigger::operator==(const WMPoolTrigger & rhs) const +{ + if (!(pool == rhs.pool)) + return false; + if (!(trigger == rhs.trigger)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMPoolTrigger::WMPoolTrigger(const WMPoolTrigger& other1414) { + pool = other1414.pool; + trigger = other1414.trigger; + ns = other1414.ns; + __isset = other1414.__isset; +} +WMPoolTrigger& WMPoolTrigger::operator=(const WMPoolTrigger& other1415) { + pool = other1415.pool; + trigger = other1415.trigger; + ns = other1415.ns; + __isset = other1415.__isset; + return *this; +} +void WMPoolTrigger::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMPoolTrigger("; + out << "pool=" << to_string(pool); + out << ", " << "trigger=" << to_string(trigger); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMFullResourcePlan::~WMFullResourcePlan() noexcept { +} + +WMFullResourcePlan::WMFullResourcePlan() noexcept { +} + +void WMFullResourcePlan::__set_plan(const WMResourcePlan& val) { + this->plan = val; +} + +void WMFullResourcePlan::__set_pools(const std::vector & val) { + this->pools = val; +} + +void WMFullResourcePlan::__set_mappings(const std::vector & val) { + this->mappings = val; +__isset.mappings = true; +} + +void WMFullResourcePlan::__set_triggers(const std::vector & val) { + this->triggers = val; +__isset.triggers = true; +} + +void WMFullResourcePlan::__set_poolTriggers(const std::vector & val) { + this->poolTriggers = val; +__isset.poolTriggers = true; +} +std::ostream& operator<<(std::ostream& out, const WMFullResourcePlan& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMFullResourcePlan::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_plan = false; + bool isset_pools = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->plan.read(iprot); + isset_plan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->pools.clear(); + uint32_t _size1416; + ::apache::thrift::protocol::TType _etype1419; + xfer += iprot->readListBegin(_etype1419, _size1416); + this->pools.resize(_size1416); + uint32_t _i1420; + for (_i1420 = 0; _i1420 < _size1416; ++_i1420) + { + xfer += this->pools[_i1420].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_pools = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->mappings.clear(); + uint32_t _size1421; + ::apache::thrift::protocol::TType _etype1424; + xfer += iprot->readListBegin(_etype1424, _size1421); + this->mappings.resize(_size1421); + uint32_t _i1425; + for (_i1425 = 0; _i1425 < _size1421; ++_i1425) + { + xfer += this->mappings[_i1425].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.mappings = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->triggers.clear(); + uint32_t _size1426; + ::apache::thrift::protocol::TType _etype1429; + xfer += iprot->readListBegin(_etype1429, _size1426); + this->triggers.resize(_size1426); + uint32_t _i1430; + for (_i1430 = 0; _i1430 < _size1426; ++_i1430) + { + xfer += this->triggers[_i1430].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.triggers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->poolTriggers.clear(); + uint32_t _size1431; + ::apache::thrift::protocol::TType _etype1434; + xfer += iprot->readListBegin(_etype1434, _size1431); + this->poolTriggers.resize(_size1431); + uint32_t _i1435; + for (_i1435 = 0; _i1435 < _size1431; ++_i1435) + { + xfer += this->poolTriggers[_i1435].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.poolTriggers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_plan) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_pools) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t WMFullResourcePlan::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMFullResourcePlan"); + + xfer += oprot->writeFieldBegin("plan", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->plan.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("pools", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->pools.size())); + std::vector ::const_iterator _iter1436; + for (_iter1436 = this->pools.begin(); _iter1436 != this->pools.end(); ++_iter1436) + { + xfer += (*_iter1436).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.mappings) { + xfer += oprot->writeFieldBegin("mappings", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->mappings.size())); + std::vector ::const_iterator _iter1437; + for (_iter1437 = this->mappings.begin(); _iter1437 != this->mappings.end(); ++_iter1437) + { + xfer += (*_iter1437).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.triggers) { + xfer += oprot->writeFieldBegin("triggers", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->triggers.size())); + std::vector ::const_iterator _iter1438; + for (_iter1438 = this->triggers.begin(); _iter1438 != this->triggers.end(); ++_iter1438) + { + xfer += (*_iter1438).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolTriggers) { + xfer += oprot->writeFieldBegin("poolTriggers", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->poolTriggers.size())); + std::vector ::const_iterator _iter1439; + for (_iter1439 = this->poolTriggers.begin(); _iter1439 != this->poolTriggers.end(); ++_iter1439) + { + xfer += (*_iter1439).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMFullResourcePlan &a, WMFullResourcePlan &b) noexcept { + using ::std::swap; + swap(a.plan, b.plan); + swap(a.pools, b.pools); + swap(a.mappings, b.mappings); + swap(a.triggers, b.triggers); + swap(a.poolTriggers, b.poolTriggers); + swap(a.__isset, b.__isset); +} + +bool WMFullResourcePlan::operator==(const WMFullResourcePlan & rhs) const +{ + if (!(plan == rhs.plan)) + return false; + if (!(pools == rhs.pools)) + return false; + if (__isset.mappings != rhs.__isset.mappings) + return false; + else if (__isset.mappings && !(mappings == rhs.mappings)) + return false; + if (__isset.triggers != rhs.__isset.triggers) + return false; + else if (__isset.triggers && !(triggers == rhs.triggers)) + return false; + if (__isset.poolTriggers != rhs.__isset.poolTriggers) + return false; + else if (__isset.poolTriggers && !(poolTriggers == rhs.poolTriggers)) + return false; + return true; +} + +WMFullResourcePlan::WMFullResourcePlan(const WMFullResourcePlan& other1440) { + plan = other1440.plan; + pools = other1440.pools; + mappings = other1440.mappings; + triggers = other1440.triggers; + poolTriggers = other1440.poolTriggers; + __isset = other1440.__isset; +} +WMFullResourcePlan& WMFullResourcePlan::operator=(const WMFullResourcePlan& other1441) { + plan = other1441.plan; + pools = other1441.pools; + mappings = other1441.mappings; + triggers = other1441.triggers; + poolTriggers = other1441.poolTriggers; + __isset = other1441.__isset; + return *this; +} +void WMFullResourcePlan::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMFullResourcePlan("; + out << "plan=" << to_string(plan); + out << ", " << "pools=" << to_string(pools); + out << ", " << "mappings="; (__isset.mappings ? (out << to_string(mappings)) : (out << "")); + out << ", " << "triggers="; (__isset.triggers ? (out << to_string(triggers)) : (out << "")); + out << ", " << "poolTriggers="; (__isset.poolTriggers ? (out << to_string(poolTriggers)) : (out << "")); + out << ")"; +} + + +WMCreateResourcePlanRequest::~WMCreateResourcePlanRequest() noexcept { +} + +WMCreateResourcePlanRequest::WMCreateResourcePlanRequest() noexcept + : copyFrom() { +} + +void WMCreateResourcePlanRequest::__set_resourcePlan(const WMResourcePlan& val) { + this->resourcePlan = val; +__isset.resourcePlan = true; +} + +void WMCreateResourcePlanRequest::__set_copyFrom(const std::string& val) { + this->copyFrom = val; +__isset.copyFrom = true; +} +std::ostream& operator<<(std::ostream& out, const WMCreateResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->resourcePlan.read(iprot); + this->__isset.resourcePlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->copyFrom); + this->__isset.copyFrom = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateResourcePlanRequest"); + + if (this->__isset.resourcePlan) { + xfer += oprot->writeFieldBegin("resourcePlan", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->resourcePlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.copyFrom) { + xfer += oprot->writeFieldBegin("copyFrom", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->copyFrom); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateResourcePlanRequest &a, WMCreateResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlan, b.resourcePlan); + swap(a.copyFrom, b.copyFrom); + swap(a.__isset, b.__isset); +} + +bool WMCreateResourcePlanRequest::operator==(const WMCreateResourcePlanRequest & rhs) const +{ + if (__isset.resourcePlan != rhs.__isset.resourcePlan) + return false; + else if (__isset.resourcePlan && !(resourcePlan == rhs.resourcePlan)) + return false; + if (__isset.copyFrom != rhs.__isset.copyFrom) + return false; + else if (__isset.copyFrom && !(copyFrom == rhs.copyFrom)) + return false; + return true; +} + +WMCreateResourcePlanRequest::WMCreateResourcePlanRequest(const WMCreateResourcePlanRequest& other1442) { + resourcePlan = other1442.resourcePlan; + copyFrom = other1442.copyFrom; + __isset = other1442.__isset; +} +WMCreateResourcePlanRequest& WMCreateResourcePlanRequest::operator=(const WMCreateResourcePlanRequest& other1443) { + resourcePlan = other1443.resourcePlan; + copyFrom = other1443.copyFrom; + __isset = other1443.__isset; + return *this; +} +void WMCreateResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateResourcePlanRequest("; + out << "resourcePlan="; (__isset.resourcePlan ? (out << to_string(resourcePlan)) : (out << "")); + out << ", " << "copyFrom="; (__isset.copyFrom ? (out << to_string(copyFrom)) : (out << "")); + out << ")"; +} + + +WMCreateResourcePlanResponse::~WMCreateResourcePlanResponse() noexcept { +} + +WMCreateResourcePlanResponse::WMCreateResourcePlanResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMCreateResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateResourcePlanResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateResourcePlanResponse &a, WMCreateResourcePlanResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMCreateResourcePlanResponse::operator==(const WMCreateResourcePlanResponse & /* rhs */) const +{ + return true; +} + +WMCreateResourcePlanResponse::WMCreateResourcePlanResponse(const WMCreateResourcePlanResponse& other1444) noexcept { + (void) other1444; +} +WMCreateResourcePlanResponse& WMCreateResourcePlanResponse::operator=(const WMCreateResourcePlanResponse& other1445) noexcept { + (void) other1445; + return *this; +} +void WMCreateResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateResourcePlanResponse("; + out << ")"; +} + + +WMGetActiveResourcePlanRequest::~WMGetActiveResourcePlanRequest() noexcept { +} + +WMGetActiveResourcePlanRequest::WMGetActiveResourcePlanRequest() noexcept + : ns() { +} + +void WMGetActiveResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetActiveResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetActiveResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetActiveResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetActiveResourcePlanRequest"); + + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetActiveResourcePlanRequest &a, WMGetActiveResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMGetActiveResourcePlanRequest::operator==(const WMGetActiveResourcePlanRequest & rhs) const +{ + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMGetActiveResourcePlanRequest::WMGetActiveResourcePlanRequest(const WMGetActiveResourcePlanRequest& other1446) { + ns = other1446.ns; + __isset = other1446.__isset; +} +WMGetActiveResourcePlanRequest& WMGetActiveResourcePlanRequest::operator=(const WMGetActiveResourcePlanRequest& other1447) { + ns = other1447.ns; + __isset = other1447.__isset; + return *this; +} +void WMGetActiveResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetActiveResourcePlanRequest("; + out << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMGetActiveResourcePlanResponse::~WMGetActiveResourcePlanResponse() noexcept { +} + +WMGetActiveResourcePlanResponse::WMGetActiveResourcePlanResponse() noexcept { +} + +void WMGetActiveResourcePlanResponse::__set_resourcePlan(const WMFullResourcePlan& val) { + this->resourcePlan = val; +__isset.resourcePlan = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetActiveResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetActiveResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->resourcePlan.read(iprot); + this->__isset.resourcePlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetActiveResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetActiveResourcePlanResponse"); + + if (this->__isset.resourcePlan) { + xfer += oprot->writeFieldBegin("resourcePlan", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->resourcePlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetActiveResourcePlanResponse &a, WMGetActiveResourcePlanResponse &b) noexcept { + using ::std::swap; + swap(a.resourcePlan, b.resourcePlan); + swap(a.__isset, b.__isset); +} + +bool WMGetActiveResourcePlanResponse::operator==(const WMGetActiveResourcePlanResponse & rhs) const +{ + if (__isset.resourcePlan != rhs.__isset.resourcePlan) + return false; + else if (__isset.resourcePlan && !(resourcePlan == rhs.resourcePlan)) + return false; + return true; +} + +WMGetActiveResourcePlanResponse::WMGetActiveResourcePlanResponse(const WMGetActiveResourcePlanResponse& other1448) { + resourcePlan = other1448.resourcePlan; + __isset = other1448.__isset; +} +WMGetActiveResourcePlanResponse& WMGetActiveResourcePlanResponse::operator=(const WMGetActiveResourcePlanResponse& other1449) { + resourcePlan = other1449.resourcePlan; + __isset = other1449.__isset; + return *this; +} +void WMGetActiveResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetActiveResourcePlanResponse("; + out << "resourcePlan="; (__isset.resourcePlan ? (out << to_string(resourcePlan)) : (out << "")); + out << ")"; +} + + +WMGetResourcePlanRequest::~WMGetResourcePlanRequest() noexcept { +} + +WMGetResourcePlanRequest::WMGetResourcePlanRequest() noexcept + : resourcePlanName(), + ns() { +} + +void WMGetResourcePlanRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMGetResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetResourcePlanRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetResourcePlanRequest &a, WMGetResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMGetResourcePlanRequest::operator==(const WMGetResourcePlanRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMGetResourcePlanRequest::WMGetResourcePlanRequest(const WMGetResourcePlanRequest& other1450) { + resourcePlanName = other1450.resourcePlanName; + ns = other1450.ns; + __isset = other1450.__isset; +} +WMGetResourcePlanRequest& WMGetResourcePlanRequest::operator=(const WMGetResourcePlanRequest& other1451) { + resourcePlanName = other1451.resourcePlanName; + ns = other1451.ns; + __isset = other1451.__isset; + return *this; +} +void WMGetResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetResourcePlanRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMGetResourcePlanResponse::~WMGetResourcePlanResponse() noexcept { +} + +WMGetResourcePlanResponse::WMGetResourcePlanResponse() noexcept { +} + +void WMGetResourcePlanResponse::__set_resourcePlan(const WMFullResourcePlan& val) { + this->resourcePlan = val; +__isset.resourcePlan = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->resourcePlan.read(iprot); + this->__isset.resourcePlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetResourcePlanResponse"); + + if (this->__isset.resourcePlan) { + xfer += oprot->writeFieldBegin("resourcePlan", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->resourcePlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetResourcePlanResponse &a, WMGetResourcePlanResponse &b) noexcept { + using ::std::swap; + swap(a.resourcePlan, b.resourcePlan); + swap(a.__isset, b.__isset); +} + +bool WMGetResourcePlanResponse::operator==(const WMGetResourcePlanResponse & rhs) const +{ + if (__isset.resourcePlan != rhs.__isset.resourcePlan) + return false; + else if (__isset.resourcePlan && !(resourcePlan == rhs.resourcePlan)) + return false; + return true; +} + +WMGetResourcePlanResponse::WMGetResourcePlanResponse(const WMGetResourcePlanResponse& other1452) { + resourcePlan = other1452.resourcePlan; + __isset = other1452.__isset; +} +WMGetResourcePlanResponse& WMGetResourcePlanResponse::operator=(const WMGetResourcePlanResponse& other1453) { + resourcePlan = other1453.resourcePlan; + __isset = other1453.__isset; + return *this; +} +void WMGetResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetResourcePlanResponse("; + out << "resourcePlan="; (__isset.resourcePlan ? (out << to_string(resourcePlan)) : (out << "")); + out << ")"; +} + + +WMGetAllResourcePlanRequest::~WMGetAllResourcePlanRequest() noexcept { +} + +WMGetAllResourcePlanRequest::WMGetAllResourcePlanRequest() noexcept + : ns() { +} + +void WMGetAllResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetAllResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetAllResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetAllResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetAllResourcePlanRequest"); + + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetAllResourcePlanRequest &a, WMGetAllResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMGetAllResourcePlanRequest::operator==(const WMGetAllResourcePlanRequest & rhs) const +{ + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMGetAllResourcePlanRequest::WMGetAllResourcePlanRequest(const WMGetAllResourcePlanRequest& other1454) { + ns = other1454.ns; + __isset = other1454.__isset; +} +WMGetAllResourcePlanRequest& WMGetAllResourcePlanRequest::operator=(const WMGetAllResourcePlanRequest& other1455) { + ns = other1455.ns; + __isset = other1455.__isset; + return *this; +} +void WMGetAllResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetAllResourcePlanRequest("; + out << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMGetAllResourcePlanResponse::~WMGetAllResourcePlanResponse() noexcept { +} + +WMGetAllResourcePlanResponse::WMGetAllResourcePlanResponse() noexcept { +} + +void WMGetAllResourcePlanResponse::__set_resourcePlans(const std::vector & val) { + this->resourcePlans = val; +__isset.resourcePlans = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetAllResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetAllResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->resourcePlans.clear(); + uint32_t _size1456; + ::apache::thrift::protocol::TType _etype1459; + xfer += iprot->readListBegin(_etype1459, _size1456); + this->resourcePlans.resize(_size1456); + uint32_t _i1460; + for (_i1460 = 0; _i1460 < _size1456; ++_i1460) + { + xfer += this->resourcePlans[_i1460].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.resourcePlans = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetAllResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetAllResourcePlanResponse"); + + if (this->__isset.resourcePlans) { + xfer += oprot->writeFieldBegin("resourcePlans", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->resourcePlans.size())); + std::vector ::const_iterator _iter1461; + for (_iter1461 = this->resourcePlans.begin(); _iter1461 != this->resourcePlans.end(); ++_iter1461) + { + xfer += (*_iter1461).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetAllResourcePlanResponse &a, WMGetAllResourcePlanResponse &b) noexcept { + using ::std::swap; + swap(a.resourcePlans, b.resourcePlans); + swap(a.__isset, b.__isset); +} + +bool WMGetAllResourcePlanResponse::operator==(const WMGetAllResourcePlanResponse & rhs) const +{ + if (__isset.resourcePlans != rhs.__isset.resourcePlans) + return false; + else if (__isset.resourcePlans && !(resourcePlans == rhs.resourcePlans)) + return false; + return true; +} + +WMGetAllResourcePlanResponse::WMGetAllResourcePlanResponse(const WMGetAllResourcePlanResponse& other1462) { + resourcePlans = other1462.resourcePlans; + __isset = other1462.__isset; +} +WMGetAllResourcePlanResponse& WMGetAllResourcePlanResponse::operator=(const WMGetAllResourcePlanResponse& other1463) { + resourcePlans = other1463.resourcePlans; + __isset = other1463.__isset; + return *this; +} +void WMGetAllResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetAllResourcePlanResponse("; + out << "resourcePlans="; (__isset.resourcePlans ? (out << to_string(resourcePlans)) : (out << "")); + out << ")"; +} + + +WMAlterResourcePlanRequest::~WMAlterResourcePlanRequest() noexcept { +} + +WMAlterResourcePlanRequest::WMAlterResourcePlanRequest() noexcept + : resourcePlanName(), + isEnableAndActivate(0), + isForceDeactivate(0), + isReplace(0), + ns() { +} + +void WMAlterResourcePlanRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMAlterResourcePlanRequest::__set_resourcePlan(const WMNullableResourcePlan& val) { + this->resourcePlan = val; +__isset.resourcePlan = true; +} + +void WMAlterResourcePlanRequest::__set_isEnableAndActivate(const bool val) { + this->isEnableAndActivate = val; +__isset.isEnableAndActivate = true; +} + +void WMAlterResourcePlanRequest::__set_isForceDeactivate(const bool val) { + this->isForceDeactivate = val; +__isset.isForceDeactivate = true; +} + +void WMAlterResourcePlanRequest::__set_isReplace(const bool val) { + this->isReplace = val; +__isset.isReplace = true; +} + +void WMAlterResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMAlterResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->resourcePlan.read(iprot); + this->__isset.resourcePlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isEnableAndActivate); + this->__isset.isEnableAndActivate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isForceDeactivate); + this->__isset.isForceDeactivate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->isReplace); + this->__isset.isReplace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterResourcePlanRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.resourcePlan) { + xfer += oprot->writeFieldBegin("resourcePlan", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->resourcePlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isEnableAndActivate) { + xfer += oprot->writeFieldBegin("isEnableAndActivate", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->isEnableAndActivate); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isForceDeactivate) { + xfer += oprot->writeFieldBegin("isForceDeactivate", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->isForceDeactivate); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.isReplace) { + xfer += oprot->writeFieldBegin("isReplace", ::apache::thrift::protocol::T_BOOL, 5); + xfer += oprot->writeBool(this->isReplace); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterResourcePlanRequest &a, WMAlterResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.resourcePlan, b.resourcePlan); + swap(a.isEnableAndActivate, b.isEnableAndActivate); + swap(a.isForceDeactivate, b.isForceDeactivate); + swap(a.isReplace, b.isReplace); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMAlterResourcePlanRequest::operator==(const WMAlterResourcePlanRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.resourcePlan != rhs.__isset.resourcePlan) + return false; + else if (__isset.resourcePlan && !(resourcePlan == rhs.resourcePlan)) + return false; + if (__isset.isEnableAndActivate != rhs.__isset.isEnableAndActivate) + return false; + else if (__isset.isEnableAndActivate && !(isEnableAndActivate == rhs.isEnableAndActivate)) + return false; + if (__isset.isForceDeactivate != rhs.__isset.isForceDeactivate) + return false; + else if (__isset.isForceDeactivate && !(isForceDeactivate == rhs.isForceDeactivate)) + return false; + if (__isset.isReplace != rhs.__isset.isReplace) + return false; + else if (__isset.isReplace && !(isReplace == rhs.isReplace)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMAlterResourcePlanRequest::WMAlterResourcePlanRequest(const WMAlterResourcePlanRequest& other1464) { + resourcePlanName = other1464.resourcePlanName; + resourcePlan = other1464.resourcePlan; + isEnableAndActivate = other1464.isEnableAndActivate; + isForceDeactivate = other1464.isForceDeactivate; + isReplace = other1464.isReplace; + ns = other1464.ns; + __isset = other1464.__isset; +} +WMAlterResourcePlanRequest& WMAlterResourcePlanRequest::operator=(const WMAlterResourcePlanRequest& other1465) { + resourcePlanName = other1465.resourcePlanName; + resourcePlan = other1465.resourcePlan; + isEnableAndActivate = other1465.isEnableAndActivate; + isForceDeactivate = other1465.isForceDeactivate; + isReplace = other1465.isReplace; + ns = other1465.ns; + __isset = other1465.__isset; + return *this; +} +void WMAlterResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterResourcePlanRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "resourcePlan="; (__isset.resourcePlan ? (out << to_string(resourcePlan)) : (out << "")); + out << ", " << "isEnableAndActivate="; (__isset.isEnableAndActivate ? (out << to_string(isEnableAndActivate)) : (out << "")); + out << ", " << "isForceDeactivate="; (__isset.isForceDeactivate ? (out << to_string(isForceDeactivate)) : (out << "")); + out << ", " << "isReplace="; (__isset.isReplace ? (out << to_string(isReplace)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMAlterResourcePlanResponse::~WMAlterResourcePlanResponse() noexcept { +} + +WMAlterResourcePlanResponse::WMAlterResourcePlanResponse() noexcept { +} + +void WMAlterResourcePlanResponse::__set_fullResourcePlan(const WMFullResourcePlan& val) { + this->fullResourcePlan = val; +__isset.fullResourcePlan = true; +} +std::ostream& operator<<(std::ostream& out, const WMAlterResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->fullResourcePlan.read(iprot); + this->__isset.fullResourcePlan = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterResourcePlanResponse"); + + if (this->__isset.fullResourcePlan) { + xfer += oprot->writeFieldBegin("fullResourcePlan", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->fullResourcePlan.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterResourcePlanResponse &a, WMAlterResourcePlanResponse &b) noexcept { + using ::std::swap; + swap(a.fullResourcePlan, b.fullResourcePlan); + swap(a.__isset, b.__isset); +} + +bool WMAlterResourcePlanResponse::operator==(const WMAlterResourcePlanResponse & rhs) const +{ + if (__isset.fullResourcePlan != rhs.__isset.fullResourcePlan) + return false; + else if (__isset.fullResourcePlan && !(fullResourcePlan == rhs.fullResourcePlan)) + return false; + return true; +} + +WMAlterResourcePlanResponse::WMAlterResourcePlanResponse(const WMAlterResourcePlanResponse& other1466) { + fullResourcePlan = other1466.fullResourcePlan; + __isset = other1466.__isset; +} +WMAlterResourcePlanResponse& WMAlterResourcePlanResponse::operator=(const WMAlterResourcePlanResponse& other1467) { + fullResourcePlan = other1467.fullResourcePlan; + __isset = other1467.__isset; + return *this; +} +void WMAlterResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterResourcePlanResponse("; + out << "fullResourcePlan="; (__isset.fullResourcePlan ? (out << to_string(fullResourcePlan)) : (out << "")); + out << ")"; +} + + +WMValidateResourcePlanRequest::~WMValidateResourcePlanRequest() noexcept { +} + +WMValidateResourcePlanRequest::WMValidateResourcePlanRequest() noexcept + : resourcePlanName(), + ns() { +} + +void WMValidateResourcePlanRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMValidateResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMValidateResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMValidateResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMValidateResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMValidateResourcePlanRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMValidateResourcePlanRequest &a, WMValidateResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMValidateResourcePlanRequest::operator==(const WMValidateResourcePlanRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMValidateResourcePlanRequest::WMValidateResourcePlanRequest(const WMValidateResourcePlanRequest& other1468) { + resourcePlanName = other1468.resourcePlanName; + ns = other1468.ns; + __isset = other1468.__isset; +} +WMValidateResourcePlanRequest& WMValidateResourcePlanRequest::operator=(const WMValidateResourcePlanRequest& other1469) { + resourcePlanName = other1469.resourcePlanName; + ns = other1469.ns; + __isset = other1469.__isset; + return *this; +} +void WMValidateResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMValidateResourcePlanRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMValidateResourcePlanResponse::~WMValidateResourcePlanResponse() noexcept { +} + +WMValidateResourcePlanResponse::WMValidateResourcePlanResponse() noexcept { +} + +void WMValidateResourcePlanResponse::__set_errors(const std::vector & val) { + this->errors = val; +__isset.errors = true; +} + +void WMValidateResourcePlanResponse::__set_warnings(const std::vector & val) { + this->warnings = val; +__isset.warnings = true; +} +std::ostream& operator<<(std::ostream& out, const WMValidateResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMValidateResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->errors.clear(); + uint32_t _size1470; + ::apache::thrift::protocol::TType _etype1473; + xfer += iprot->readListBegin(_etype1473, _size1470); + this->errors.resize(_size1470); + uint32_t _i1474; + for (_i1474 = 0; _i1474 < _size1470; ++_i1474) + { + xfer += iprot->readString(this->errors[_i1474]); + } + xfer += iprot->readListEnd(); + } + this->__isset.errors = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->warnings.clear(); + uint32_t _size1475; + ::apache::thrift::protocol::TType _etype1478; + xfer += iprot->readListBegin(_etype1478, _size1475); + this->warnings.resize(_size1475); + uint32_t _i1479; + for (_i1479 = 0; _i1479 < _size1475; ++_i1479) + { + xfer += iprot->readString(this->warnings[_i1479]); + } + xfer += iprot->readListEnd(); + } + this->__isset.warnings = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMValidateResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMValidateResourcePlanResponse"); + + if (this->__isset.errors) { + xfer += oprot->writeFieldBegin("errors", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->errors.size())); + std::vector ::const_iterator _iter1480; + for (_iter1480 = this->errors.begin(); _iter1480 != this->errors.end(); ++_iter1480) + { + xfer += oprot->writeString((*_iter1480)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.warnings) { + xfer += oprot->writeFieldBegin("warnings", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->warnings.size())); + std::vector ::const_iterator _iter1481; + for (_iter1481 = this->warnings.begin(); _iter1481 != this->warnings.end(); ++_iter1481) + { + xfer += oprot->writeString((*_iter1481)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMValidateResourcePlanResponse &a, WMValidateResourcePlanResponse &b) noexcept { + using ::std::swap; + swap(a.errors, b.errors); + swap(a.warnings, b.warnings); + swap(a.__isset, b.__isset); +} + +bool WMValidateResourcePlanResponse::operator==(const WMValidateResourcePlanResponse & rhs) const +{ + if (__isset.errors != rhs.__isset.errors) + return false; + else if (__isset.errors && !(errors == rhs.errors)) + return false; + if (__isset.warnings != rhs.__isset.warnings) + return false; + else if (__isset.warnings && !(warnings == rhs.warnings)) + return false; + return true; +} + +WMValidateResourcePlanResponse::WMValidateResourcePlanResponse(const WMValidateResourcePlanResponse& other1482) { + errors = other1482.errors; + warnings = other1482.warnings; + __isset = other1482.__isset; +} +WMValidateResourcePlanResponse& WMValidateResourcePlanResponse::operator=(const WMValidateResourcePlanResponse& other1483) { + errors = other1483.errors; + warnings = other1483.warnings; + __isset = other1483.__isset; + return *this; +} +void WMValidateResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMValidateResourcePlanResponse("; + out << "errors="; (__isset.errors ? (out << to_string(errors)) : (out << "")); + out << ", " << "warnings="; (__isset.warnings ? (out << to_string(warnings)) : (out << "")); + out << ")"; +} + + +WMDropResourcePlanRequest::~WMDropResourcePlanRequest() noexcept { +} + +WMDropResourcePlanRequest::WMDropResourcePlanRequest() noexcept + : resourcePlanName(), + ns() { +} + +void WMDropResourcePlanRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMDropResourcePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMDropResourcePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropResourcePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropResourcePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropResourcePlanRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropResourcePlanRequest &a, WMDropResourcePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMDropResourcePlanRequest::operator==(const WMDropResourcePlanRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMDropResourcePlanRequest::WMDropResourcePlanRequest(const WMDropResourcePlanRequest& other1484) { + resourcePlanName = other1484.resourcePlanName; + ns = other1484.ns; + __isset = other1484.__isset; +} +WMDropResourcePlanRequest& WMDropResourcePlanRequest::operator=(const WMDropResourcePlanRequest& other1485) { + resourcePlanName = other1485.resourcePlanName; + ns = other1485.ns; + __isset = other1485.__isset; + return *this; +} +void WMDropResourcePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropResourcePlanRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMDropResourcePlanResponse::~WMDropResourcePlanResponse() noexcept { +} + +WMDropResourcePlanResponse::WMDropResourcePlanResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMDropResourcePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropResourcePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropResourcePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropResourcePlanResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropResourcePlanResponse &a, WMDropResourcePlanResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMDropResourcePlanResponse::operator==(const WMDropResourcePlanResponse & /* rhs */) const +{ + return true; +} + +WMDropResourcePlanResponse::WMDropResourcePlanResponse(const WMDropResourcePlanResponse& other1486) noexcept { + (void) other1486; +} +WMDropResourcePlanResponse& WMDropResourcePlanResponse::operator=(const WMDropResourcePlanResponse& other1487) noexcept { + (void) other1487; + return *this; +} +void WMDropResourcePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropResourcePlanResponse("; + out << ")"; +} + + +WMCreateTriggerRequest::~WMCreateTriggerRequest() noexcept { +} + +WMCreateTriggerRequest::WMCreateTriggerRequest() noexcept { +} + +void WMCreateTriggerRequest::__set_trigger(const WMTrigger& val) { + this->trigger = val; +__isset.trigger = true; +} +std::ostream& operator<<(std::ostream& out, const WMCreateTriggerRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateTriggerRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->trigger.read(iprot); + this->__isset.trigger = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateTriggerRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateTriggerRequest"); + + if (this->__isset.trigger) { + xfer += oprot->writeFieldBegin("trigger", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->trigger.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateTriggerRequest &a, WMCreateTriggerRequest &b) noexcept { + using ::std::swap; + swap(a.trigger, b.trigger); + swap(a.__isset, b.__isset); +} + +bool WMCreateTriggerRequest::operator==(const WMCreateTriggerRequest & rhs) const +{ + if (__isset.trigger != rhs.__isset.trigger) + return false; + else if (__isset.trigger && !(trigger == rhs.trigger)) + return false; + return true; +} + +WMCreateTriggerRequest::WMCreateTriggerRequest(const WMCreateTriggerRequest& other1488) { + trigger = other1488.trigger; + __isset = other1488.__isset; +} +WMCreateTriggerRequest& WMCreateTriggerRequest::operator=(const WMCreateTriggerRequest& other1489) { + trigger = other1489.trigger; + __isset = other1489.__isset; + return *this; +} +void WMCreateTriggerRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateTriggerRequest("; + out << "trigger="; (__isset.trigger ? (out << to_string(trigger)) : (out << "")); + out << ")"; +} + + +WMCreateTriggerResponse::~WMCreateTriggerResponse() noexcept { +} + +WMCreateTriggerResponse::WMCreateTriggerResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMCreateTriggerResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateTriggerResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateTriggerResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateTriggerResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateTriggerResponse &a, WMCreateTriggerResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMCreateTriggerResponse::operator==(const WMCreateTriggerResponse & /* rhs */) const +{ + return true; +} + +WMCreateTriggerResponse::WMCreateTriggerResponse(const WMCreateTriggerResponse& other1490) noexcept { + (void) other1490; +} +WMCreateTriggerResponse& WMCreateTriggerResponse::operator=(const WMCreateTriggerResponse& other1491) noexcept { + (void) other1491; + return *this; +} +void WMCreateTriggerResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateTriggerResponse("; + out << ")"; +} + + +WMAlterTriggerRequest::~WMAlterTriggerRequest() noexcept { +} + +WMAlterTriggerRequest::WMAlterTriggerRequest() noexcept { +} + +void WMAlterTriggerRequest::__set_trigger(const WMTrigger& val) { + this->trigger = val; +__isset.trigger = true; +} +std::ostream& operator<<(std::ostream& out, const WMAlterTriggerRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterTriggerRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->trigger.read(iprot); + this->__isset.trigger = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterTriggerRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterTriggerRequest"); + + if (this->__isset.trigger) { + xfer += oprot->writeFieldBegin("trigger", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->trigger.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterTriggerRequest &a, WMAlterTriggerRequest &b) noexcept { + using ::std::swap; + swap(a.trigger, b.trigger); + swap(a.__isset, b.__isset); +} + +bool WMAlterTriggerRequest::operator==(const WMAlterTriggerRequest & rhs) const +{ + if (__isset.trigger != rhs.__isset.trigger) + return false; + else if (__isset.trigger && !(trigger == rhs.trigger)) + return false; + return true; +} + +WMAlterTriggerRequest::WMAlterTriggerRequest(const WMAlterTriggerRequest& other1492) { + trigger = other1492.trigger; + __isset = other1492.__isset; +} +WMAlterTriggerRequest& WMAlterTriggerRequest::operator=(const WMAlterTriggerRequest& other1493) { + trigger = other1493.trigger; + __isset = other1493.__isset; + return *this; +} +void WMAlterTriggerRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterTriggerRequest("; + out << "trigger="; (__isset.trigger ? (out << to_string(trigger)) : (out << "")); + out << ")"; +} + + +WMAlterTriggerResponse::~WMAlterTriggerResponse() noexcept { +} + +WMAlterTriggerResponse::WMAlterTriggerResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMAlterTriggerResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterTriggerResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterTriggerResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterTriggerResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterTriggerResponse &a, WMAlterTriggerResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMAlterTriggerResponse::operator==(const WMAlterTriggerResponse & /* rhs */) const +{ + return true; +} + +WMAlterTriggerResponse::WMAlterTriggerResponse(const WMAlterTriggerResponse& other1494) noexcept { + (void) other1494; +} +WMAlterTriggerResponse& WMAlterTriggerResponse::operator=(const WMAlterTriggerResponse& other1495) noexcept { + (void) other1495; + return *this; +} +void WMAlterTriggerResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterTriggerResponse("; + out << ")"; +} + + +WMDropTriggerRequest::~WMDropTriggerRequest() noexcept { +} + +WMDropTriggerRequest::WMDropTriggerRequest() noexcept + : resourcePlanName(), + triggerName(), + ns() { +} + +void WMDropTriggerRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMDropTriggerRequest::__set_triggerName(const std::string& val) { + this->triggerName = val; +__isset.triggerName = true; +} + +void WMDropTriggerRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMDropTriggerRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropTriggerRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->triggerName); + this->__isset.triggerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropTriggerRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropTriggerRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.triggerName) { + xfer += oprot->writeFieldBegin("triggerName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->triggerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropTriggerRequest &a, WMDropTriggerRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.triggerName, b.triggerName); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMDropTriggerRequest::operator==(const WMDropTriggerRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.triggerName != rhs.__isset.triggerName) + return false; + else if (__isset.triggerName && !(triggerName == rhs.triggerName)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMDropTriggerRequest::WMDropTriggerRequest(const WMDropTriggerRequest& other1496) { + resourcePlanName = other1496.resourcePlanName; + triggerName = other1496.triggerName; + ns = other1496.ns; + __isset = other1496.__isset; +} +WMDropTriggerRequest& WMDropTriggerRequest::operator=(const WMDropTriggerRequest& other1497) { + resourcePlanName = other1497.resourcePlanName; + triggerName = other1497.triggerName; + ns = other1497.ns; + __isset = other1497.__isset; + return *this; +} +void WMDropTriggerRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropTriggerRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "triggerName="; (__isset.triggerName ? (out << to_string(triggerName)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMDropTriggerResponse::~WMDropTriggerResponse() noexcept { +} + +WMDropTriggerResponse::WMDropTriggerResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMDropTriggerResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropTriggerResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropTriggerResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropTriggerResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropTriggerResponse &a, WMDropTriggerResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMDropTriggerResponse::operator==(const WMDropTriggerResponse & /* rhs */) const +{ + return true; +} + +WMDropTriggerResponse::WMDropTriggerResponse(const WMDropTriggerResponse& other1498) noexcept { + (void) other1498; +} +WMDropTriggerResponse& WMDropTriggerResponse::operator=(const WMDropTriggerResponse& other1499) noexcept { + (void) other1499; + return *this; +} +void WMDropTriggerResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropTriggerResponse("; + out << ")"; +} + + +WMGetTriggersForResourePlanRequest::~WMGetTriggersForResourePlanRequest() noexcept { +} + +WMGetTriggersForResourePlanRequest::WMGetTriggersForResourePlanRequest() noexcept + : resourcePlanName(), + ns() { +} + +void WMGetTriggersForResourePlanRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMGetTriggersForResourePlanRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetTriggersForResourePlanRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetTriggersForResourePlanRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetTriggersForResourePlanRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetTriggersForResourePlanRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetTriggersForResourePlanRequest &a, WMGetTriggersForResourePlanRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMGetTriggersForResourePlanRequest::operator==(const WMGetTriggersForResourePlanRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMGetTriggersForResourePlanRequest::WMGetTriggersForResourePlanRequest(const WMGetTriggersForResourePlanRequest& other1500) { + resourcePlanName = other1500.resourcePlanName; + ns = other1500.ns; + __isset = other1500.__isset; +} +WMGetTriggersForResourePlanRequest& WMGetTriggersForResourePlanRequest::operator=(const WMGetTriggersForResourePlanRequest& other1501) { + resourcePlanName = other1501.resourcePlanName; + ns = other1501.ns; + __isset = other1501.__isset; + return *this; +} +void WMGetTriggersForResourePlanRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetTriggersForResourePlanRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMGetTriggersForResourePlanResponse::~WMGetTriggersForResourePlanResponse() noexcept { +} + +WMGetTriggersForResourePlanResponse::WMGetTriggersForResourePlanResponse() noexcept { +} + +void WMGetTriggersForResourePlanResponse::__set_triggers(const std::vector & val) { + this->triggers = val; +__isset.triggers = true; +} +std::ostream& operator<<(std::ostream& out, const WMGetTriggersForResourePlanResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMGetTriggersForResourePlanResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->triggers.clear(); + uint32_t _size1502; + ::apache::thrift::protocol::TType _etype1505; + xfer += iprot->readListBegin(_etype1505, _size1502); + this->triggers.resize(_size1502); + uint32_t _i1506; + for (_i1506 = 0; _i1506 < _size1502; ++_i1506) + { + xfer += this->triggers[_i1506].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.triggers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMGetTriggersForResourePlanResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMGetTriggersForResourePlanResponse"); + + if (this->__isset.triggers) { + xfer += oprot->writeFieldBegin("triggers", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->triggers.size())); + std::vector ::const_iterator _iter1507; + for (_iter1507 = this->triggers.begin(); _iter1507 != this->triggers.end(); ++_iter1507) + { + xfer += (*_iter1507).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMGetTriggersForResourePlanResponse &a, WMGetTriggersForResourePlanResponse &b) noexcept { + using ::std::swap; + swap(a.triggers, b.triggers); + swap(a.__isset, b.__isset); +} + +bool WMGetTriggersForResourePlanResponse::operator==(const WMGetTriggersForResourePlanResponse & rhs) const +{ + if (__isset.triggers != rhs.__isset.triggers) + return false; + else if (__isset.triggers && !(triggers == rhs.triggers)) + return false; + return true; +} + +WMGetTriggersForResourePlanResponse::WMGetTriggersForResourePlanResponse(const WMGetTriggersForResourePlanResponse& other1508) { + triggers = other1508.triggers; + __isset = other1508.__isset; +} +WMGetTriggersForResourePlanResponse& WMGetTriggersForResourePlanResponse::operator=(const WMGetTriggersForResourePlanResponse& other1509) { + triggers = other1509.triggers; + __isset = other1509.__isset; + return *this; +} +void WMGetTriggersForResourePlanResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMGetTriggersForResourePlanResponse("; + out << "triggers="; (__isset.triggers ? (out << to_string(triggers)) : (out << "")); + out << ")"; +} + + +WMCreatePoolRequest::~WMCreatePoolRequest() noexcept { +} + +WMCreatePoolRequest::WMCreatePoolRequest() noexcept { +} + +void WMCreatePoolRequest::__set_pool(const WMPool& val) { + this->pool = val; +__isset.pool = true; +} +std::ostream& operator<<(std::ostream& out, const WMCreatePoolRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreatePoolRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->pool.read(iprot); + this->__isset.pool = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreatePoolRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreatePoolRequest"); + + if (this->__isset.pool) { + xfer += oprot->writeFieldBegin("pool", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->pool.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreatePoolRequest &a, WMCreatePoolRequest &b) noexcept { + using ::std::swap; + swap(a.pool, b.pool); + swap(a.__isset, b.__isset); +} + +bool WMCreatePoolRequest::operator==(const WMCreatePoolRequest & rhs) const +{ + if (__isset.pool != rhs.__isset.pool) + return false; + else if (__isset.pool && !(pool == rhs.pool)) + return false; + return true; +} + +WMCreatePoolRequest::WMCreatePoolRequest(const WMCreatePoolRequest& other1510) { + pool = other1510.pool; + __isset = other1510.__isset; +} +WMCreatePoolRequest& WMCreatePoolRequest::operator=(const WMCreatePoolRequest& other1511) { + pool = other1511.pool; + __isset = other1511.__isset; + return *this; +} +void WMCreatePoolRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreatePoolRequest("; + out << "pool="; (__isset.pool ? (out << to_string(pool)) : (out << "")); + out << ")"; +} + + +WMCreatePoolResponse::~WMCreatePoolResponse() noexcept { +} + +WMCreatePoolResponse::WMCreatePoolResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMCreatePoolResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreatePoolResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreatePoolResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreatePoolResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreatePoolResponse &a, WMCreatePoolResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMCreatePoolResponse::operator==(const WMCreatePoolResponse & /* rhs */) const +{ + return true; +} + +WMCreatePoolResponse::WMCreatePoolResponse(const WMCreatePoolResponse& other1512) noexcept { + (void) other1512; +} +WMCreatePoolResponse& WMCreatePoolResponse::operator=(const WMCreatePoolResponse& other1513) noexcept { + (void) other1513; + return *this; +} +void WMCreatePoolResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreatePoolResponse("; + out << ")"; +} + + +WMAlterPoolRequest::~WMAlterPoolRequest() noexcept { +} + +WMAlterPoolRequest::WMAlterPoolRequest() noexcept + : poolPath() { +} + +void WMAlterPoolRequest::__set_pool(const WMNullablePool& val) { + this->pool = val; +__isset.pool = true; +} + +void WMAlterPoolRequest::__set_poolPath(const std::string& val) { + this->poolPath = val; +__isset.poolPath = true; +} +std::ostream& operator<<(std::ostream& out, const WMAlterPoolRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterPoolRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->pool.read(iprot); + this->__isset.pool = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + this->__isset.poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterPoolRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterPoolRequest"); + + if (this->__isset.pool) { + xfer += oprot->writeFieldBegin("pool", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->pool.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolPath) { + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterPoolRequest &a, WMAlterPoolRequest &b) noexcept { + using ::std::swap; + swap(a.pool, b.pool); + swap(a.poolPath, b.poolPath); + swap(a.__isset, b.__isset); +} + +bool WMAlterPoolRequest::operator==(const WMAlterPoolRequest & rhs) const +{ + if (__isset.pool != rhs.__isset.pool) + return false; + else if (__isset.pool && !(pool == rhs.pool)) + return false; + if (__isset.poolPath != rhs.__isset.poolPath) + return false; + else if (__isset.poolPath && !(poolPath == rhs.poolPath)) + return false; + return true; +} + +WMAlterPoolRequest::WMAlterPoolRequest(const WMAlterPoolRequest& other1514) { + pool = other1514.pool; + poolPath = other1514.poolPath; + __isset = other1514.__isset; +} +WMAlterPoolRequest& WMAlterPoolRequest::operator=(const WMAlterPoolRequest& other1515) { + pool = other1515.pool; + poolPath = other1515.poolPath; + __isset = other1515.__isset; + return *this; +} +void WMAlterPoolRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterPoolRequest("; + out << "pool="; (__isset.pool ? (out << to_string(pool)) : (out << "")); + out << ", " << "poolPath="; (__isset.poolPath ? (out << to_string(poolPath)) : (out << "")); + out << ")"; +} + + +WMAlterPoolResponse::~WMAlterPoolResponse() noexcept { +} + +WMAlterPoolResponse::WMAlterPoolResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMAlterPoolResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMAlterPoolResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMAlterPoolResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMAlterPoolResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMAlterPoolResponse &a, WMAlterPoolResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMAlterPoolResponse::operator==(const WMAlterPoolResponse & /* rhs */) const +{ + return true; +} + +WMAlterPoolResponse::WMAlterPoolResponse(const WMAlterPoolResponse& other1516) noexcept { + (void) other1516; +} +WMAlterPoolResponse& WMAlterPoolResponse::operator=(const WMAlterPoolResponse& other1517) noexcept { + (void) other1517; + return *this; +} +void WMAlterPoolResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMAlterPoolResponse("; + out << ")"; +} + + +WMDropPoolRequest::~WMDropPoolRequest() noexcept { +} + +WMDropPoolRequest::WMDropPoolRequest() noexcept + : resourcePlanName(), + poolPath(), + ns() { +} + +void WMDropPoolRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMDropPoolRequest::__set_poolPath(const std::string& val) { + this->poolPath = val; +__isset.poolPath = true; +} + +void WMDropPoolRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMDropPoolRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropPoolRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + this->__isset.poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropPoolRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropPoolRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolPath) { + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropPoolRequest &a, WMDropPoolRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.poolPath, b.poolPath); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMDropPoolRequest::operator==(const WMDropPoolRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.poolPath != rhs.__isset.poolPath) + return false; + else if (__isset.poolPath && !(poolPath == rhs.poolPath)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMDropPoolRequest::WMDropPoolRequest(const WMDropPoolRequest& other1518) { + resourcePlanName = other1518.resourcePlanName; + poolPath = other1518.poolPath; + ns = other1518.ns; + __isset = other1518.__isset; +} +WMDropPoolRequest& WMDropPoolRequest::operator=(const WMDropPoolRequest& other1519) { + resourcePlanName = other1519.resourcePlanName; + poolPath = other1519.poolPath; + ns = other1519.ns; + __isset = other1519.__isset; + return *this; +} +void WMDropPoolRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropPoolRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "poolPath="; (__isset.poolPath ? (out << to_string(poolPath)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMDropPoolResponse::~WMDropPoolResponse() noexcept { +} + +WMDropPoolResponse::WMDropPoolResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMDropPoolResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropPoolResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropPoolResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropPoolResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropPoolResponse &a, WMDropPoolResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMDropPoolResponse::operator==(const WMDropPoolResponse & /* rhs */) const +{ + return true; +} + +WMDropPoolResponse::WMDropPoolResponse(const WMDropPoolResponse& other1520) noexcept { + (void) other1520; +} +WMDropPoolResponse& WMDropPoolResponse::operator=(const WMDropPoolResponse& other1521) noexcept { + (void) other1521; + return *this; +} +void WMDropPoolResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropPoolResponse("; + out << ")"; +} + + +WMCreateOrUpdateMappingRequest::~WMCreateOrUpdateMappingRequest() noexcept { +} + +WMCreateOrUpdateMappingRequest::WMCreateOrUpdateMappingRequest() noexcept + : update(0) { +} + +void WMCreateOrUpdateMappingRequest::__set_mapping(const WMMapping& val) { + this->mapping = val; +__isset.mapping = true; +} + +void WMCreateOrUpdateMappingRequest::__set_update(const bool val) { + this->update = val; +__isset.update = true; +} +std::ostream& operator<<(std::ostream& out, const WMCreateOrUpdateMappingRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateOrUpdateMappingRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->mapping.read(iprot); + this->__isset.mapping = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->update); + this->__isset.update = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateOrUpdateMappingRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateOrUpdateMappingRequest"); + + if (this->__isset.mapping) { + xfer += oprot->writeFieldBegin("mapping", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->mapping.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.update) { + xfer += oprot->writeFieldBegin("update", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->update); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateOrUpdateMappingRequest &a, WMCreateOrUpdateMappingRequest &b) noexcept { + using ::std::swap; + swap(a.mapping, b.mapping); + swap(a.update, b.update); + swap(a.__isset, b.__isset); +} + +bool WMCreateOrUpdateMappingRequest::operator==(const WMCreateOrUpdateMappingRequest & rhs) const +{ + if (__isset.mapping != rhs.__isset.mapping) + return false; + else if (__isset.mapping && !(mapping == rhs.mapping)) + return false; + if (__isset.update != rhs.__isset.update) + return false; + else if (__isset.update && !(update == rhs.update)) + return false; + return true; +} + +WMCreateOrUpdateMappingRequest::WMCreateOrUpdateMappingRequest(const WMCreateOrUpdateMappingRequest& other1522) { + mapping = other1522.mapping; + update = other1522.update; + __isset = other1522.__isset; +} +WMCreateOrUpdateMappingRequest& WMCreateOrUpdateMappingRequest::operator=(const WMCreateOrUpdateMappingRequest& other1523) { + mapping = other1523.mapping; + update = other1523.update; + __isset = other1523.__isset; + return *this; +} +void WMCreateOrUpdateMappingRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateOrUpdateMappingRequest("; + out << "mapping="; (__isset.mapping ? (out << to_string(mapping)) : (out << "")); + out << ", " << "update="; (__isset.update ? (out << to_string(update)) : (out << "")); + out << ")"; +} + + +WMCreateOrUpdateMappingResponse::~WMCreateOrUpdateMappingResponse() noexcept { +} + +WMCreateOrUpdateMappingResponse::WMCreateOrUpdateMappingResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMCreateOrUpdateMappingResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateOrUpdateMappingResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateOrUpdateMappingResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateOrUpdateMappingResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateOrUpdateMappingResponse &a, WMCreateOrUpdateMappingResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMCreateOrUpdateMappingResponse::operator==(const WMCreateOrUpdateMappingResponse & /* rhs */) const +{ + return true; +} + +WMCreateOrUpdateMappingResponse::WMCreateOrUpdateMappingResponse(const WMCreateOrUpdateMappingResponse& other1524) noexcept { + (void) other1524; +} +WMCreateOrUpdateMappingResponse& WMCreateOrUpdateMappingResponse::operator=(const WMCreateOrUpdateMappingResponse& other1525) noexcept { + (void) other1525; + return *this; +} +void WMCreateOrUpdateMappingResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateOrUpdateMappingResponse("; + out << ")"; +} + + +WMDropMappingRequest::~WMDropMappingRequest() noexcept { +} + +WMDropMappingRequest::WMDropMappingRequest() noexcept { +} + +void WMDropMappingRequest::__set_mapping(const WMMapping& val) { + this->mapping = val; +__isset.mapping = true; +} +std::ostream& operator<<(std::ostream& out, const WMDropMappingRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropMappingRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->mapping.read(iprot); + this->__isset.mapping = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropMappingRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropMappingRequest"); + + if (this->__isset.mapping) { + xfer += oprot->writeFieldBegin("mapping", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->mapping.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropMappingRequest &a, WMDropMappingRequest &b) noexcept { + using ::std::swap; + swap(a.mapping, b.mapping); + swap(a.__isset, b.__isset); +} + +bool WMDropMappingRequest::operator==(const WMDropMappingRequest & rhs) const +{ + if (__isset.mapping != rhs.__isset.mapping) + return false; + else if (__isset.mapping && !(mapping == rhs.mapping)) + return false; + return true; +} + +WMDropMappingRequest::WMDropMappingRequest(const WMDropMappingRequest& other1526) { + mapping = other1526.mapping; + __isset = other1526.__isset; +} +WMDropMappingRequest& WMDropMappingRequest::operator=(const WMDropMappingRequest& other1527) { + mapping = other1527.mapping; + __isset = other1527.__isset; + return *this; +} +void WMDropMappingRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropMappingRequest("; + out << "mapping="; (__isset.mapping ? (out << to_string(mapping)) : (out << "")); + out << ")"; +} + + +WMDropMappingResponse::~WMDropMappingResponse() noexcept { +} + +WMDropMappingResponse::WMDropMappingResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMDropMappingResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMDropMappingResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMDropMappingResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMDropMappingResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMDropMappingResponse &a, WMDropMappingResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMDropMappingResponse::operator==(const WMDropMappingResponse & /* rhs */) const +{ + return true; +} + +WMDropMappingResponse::WMDropMappingResponse(const WMDropMappingResponse& other1528) noexcept { + (void) other1528; +} +WMDropMappingResponse& WMDropMappingResponse::operator=(const WMDropMappingResponse& other1529) noexcept { + (void) other1529; + return *this; +} +void WMDropMappingResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMDropMappingResponse("; + out << ")"; +} + + +WMCreateOrDropTriggerToPoolMappingRequest::~WMCreateOrDropTriggerToPoolMappingRequest() noexcept { +} + +WMCreateOrDropTriggerToPoolMappingRequest::WMCreateOrDropTriggerToPoolMappingRequest() noexcept + : resourcePlanName(), + triggerName(), + poolPath(), + drop(0), + ns() { +} + +void WMCreateOrDropTriggerToPoolMappingRequest::__set_resourcePlanName(const std::string& val) { + this->resourcePlanName = val; +__isset.resourcePlanName = true; +} + +void WMCreateOrDropTriggerToPoolMappingRequest::__set_triggerName(const std::string& val) { + this->triggerName = val; +__isset.triggerName = true; +} + +void WMCreateOrDropTriggerToPoolMappingRequest::__set_poolPath(const std::string& val) { + this->poolPath = val; +__isset.poolPath = true; +} + +void WMCreateOrDropTriggerToPoolMappingRequest::__set_drop(const bool val) { + this->drop = val; +__isset.drop = true; +} + +void WMCreateOrDropTriggerToPoolMappingRequest::__set_ns(const std::string& val) { + this->ns = val; +__isset.ns = true; +} +std::ostream& operator<<(std::ostream& out, const WMCreateOrDropTriggerToPoolMappingRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateOrDropTriggerToPoolMappingRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->resourcePlanName); + this->__isset.resourcePlanName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->triggerName); + this->__isset.triggerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->poolPath); + this->__isset.poolPath = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->drop); + this->__isset.drop = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ns); + this->__isset.ns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateOrDropTriggerToPoolMappingRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateOrDropTriggerToPoolMappingRequest"); + + if (this->__isset.resourcePlanName) { + xfer += oprot->writeFieldBegin("resourcePlanName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->resourcePlanName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.triggerName) { + xfer += oprot->writeFieldBegin("triggerName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->triggerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.poolPath) { + xfer += oprot->writeFieldBegin("poolPath", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->poolPath); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.drop) { + xfer += oprot->writeFieldBegin("drop", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->drop); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ns) { + xfer += oprot->writeFieldBegin("ns", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->ns); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateOrDropTriggerToPoolMappingRequest &a, WMCreateOrDropTriggerToPoolMappingRequest &b) noexcept { + using ::std::swap; + swap(a.resourcePlanName, b.resourcePlanName); + swap(a.triggerName, b.triggerName); + swap(a.poolPath, b.poolPath); + swap(a.drop, b.drop); + swap(a.ns, b.ns); + swap(a.__isset, b.__isset); +} + +bool WMCreateOrDropTriggerToPoolMappingRequest::operator==(const WMCreateOrDropTriggerToPoolMappingRequest & rhs) const +{ + if (__isset.resourcePlanName != rhs.__isset.resourcePlanName) + return false; + else if (__isset.resourcePlanName && !(resourcePlanName == rhs.resourcePlanName)) + return false; + if (__isset.triggerName != rhs.__isset.triggerName) + return false; + else if (__isset.triggerName && !(triggerName == rhs.triggerName)) + return false; + if (__isset.poolPath != rhs.__isset.poolPath) + return false; + else if (__isset.poolPath && !(poolPath == rhs.poolPath)) + return false; + if (__isset.drop != rhs.__isset.drop) + return false; + else if (__isset.drop && !(drop == rhs.drop)) + return false; + if (__isset.ns != rhs.__isset.ns) + return false; + else if (__isset.ns && !(ns == rhs.ns)) + return false; + return true; +} + +WMCreateOrDropTriggerToPoolMappingRequest::WMCreateOrDropTriggerToPoolMappingRequest(const WMCreateOrDropTriggerToPoolMappingRequest& other1530) { + resourcePlanName = other1530.resourcePlanName; + triggerName = other1530.triggerName; + poolPath = other1530.poolPath; + drop = other1530.drop; + ns = other1530.ns; + __isset = other1530.__isset; +} +WMCreateOrDropTriggerToPoolMappingRequest& WMCreateOrDropTriggerToPoolMappingRequest::operator=(const WMCreateOrDropTriggerToPoolMappingRequest& other1531) { + resourcePlanName = other1531.resourcePlanName; + triggerName = other1531.triggerName; + poolPath = other1531.poolPath; + drop = other1531.drop; + ns = other1531.ns; + __isset = other1531.__isset; + return *this; +} +void WMCreateOrDropTriggerToPoolMappingRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateOrDropTriggerToPoolMappingRequest("; + out << "resourcePlanName="; (__isset.resourcePlanName ? (out << to_string(resourcePlanName)) : (out << "")); + out << ", " << "triggerName="; (__isset.triggerName ? (out << to_string(triggerName)) : (out << "")); + out << ", " << "poolPath="; (__isset.poolPath ? (out << to_string(poolPath)) : (out << "")); + out << ", " << "drop="; (__isset.drop ? (out << to_string(drop)) : (out << "")); + out << ", " << "ns="; (__isset.ns ? (out << to_string(ns)) : (out << "")); + out << ")"; +} + + +WMCreateOrDropTriggerToPoolMappingResponse::~WMCreateOrDropTriggerToPoolMappingResponse() noexcept { +} + +WMCreateOrDropTriggerToPoolMappingResponse::WMCreateOrDropTriggerToPoolMappingResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const WMCreateOrDropTriggerToPoolMappingResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t WMCreateOrDropTriggerToPoolMappingResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t WMCreateOrDropTriggerToPoolMappingResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("WMCreateOrDropTriggerToPoolMappingResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(WMCreateOrDropTriggerToPoolMappingResponse &a, WMCreateOrDropTriggerToPoolMappingResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool WMCreateOrDropTriggerToPoolMappingResponse::operator==(const WMCreateOrDropTriggerToPoolMappingResponse & /* rhs */) const +{ + return true; +} + +WMCreateOrDropTriggerToPoolMappingResponse::WMCreateOrDropTriggerToPoolMappingResponse(const WMCreateOrDropTriggerToPoolMappingResponse& other1532) noexcept { + (void) other1532; +} +WMCreateOrDropTriggerToPoolMappingResponse& WMCreateOrDropTriggerToPoolMappingResponse::operator=(const WMCreateOrDropTriggerToPoolMappingResponse& other1533) noexcept { + (void) other1533; + return *this; +} +void WMCreateOrDropTriggerToPoolMappingResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "WMCreateOrDropTriggerToPoolMappingResponse("; + out << ")"; +} + + +ISchema::~ISchema() noexcept { +} + +ISchema::ISchema() noexcept + : schemaType(static_cast(0)), + name(), + catName(), + dbName(), + compatibility(static_cast(0)), + validationLevel(static_cast(0)), + canEvolve(0), + schemaGroup(), + description() { +} + +void ISchema::__set_schemaType(const SchemaType::type val) { + this->schemaType = val; +} + +void ISchema::__set_name(const std::string& val) { + this->name = val; +} + +void ISchema::__set_catName(const std::string& val) { + this->catName = val; +} + +void ISchema::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void ISchema::__set_compatibility(const SchemaCompatibility::type val) { + this->compatibility = val; +} + +void ISchema::__set_validationLevel(const SchemaValidation::type val) { + this->validationLevel = val; +} + +void ISchema::__set_canEvolve(const bool val) { + this->canEvolve = val; +} + +void ISchema::__set_schemaGroup(const std::string& val) { + this->schemaGroup = val; +__isset.schemaGroup = true; +} + +void ISchema::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} +std::ostream& operator<<(std::ostream& out, const ISchema& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ISchema::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1534; + xfer += iprot->readI32(ecast1534); + this->schemaType = static_cast(ecast1534); + this->__isset.schemaType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1535; + xfer += iprot->readI32(ecast1535); + this->compatibility = static_cast(ecast1535); + this->__isset.compatibility = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1536; + xfer += iprot->readI32(ecast1536); + this->validationLevel = static_cast(ecast1536); + this->__isset.validationLevel = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->canEvolve); + this->__isset.canEvolve = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaGroup); + this->__isset.schemaGroup = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ISchema::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ISchema"); + + xfer += oprot->writeFieldBegin("schemaType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->schemaType)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("compatibility", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->compatibility)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("validationLevel", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32(static_cast(this->validationLevel)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("canEvolve", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->canEvolve); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.schemaGroup) { + xfer += oprot->writeFieldBegin("schemaGroup", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->schemaGroup); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ISchema &a, ISchema &b) noexcept { + using ::std::swap; + swap(a.schemaType, b.schemaType); + swap(a.name, b.name); + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.compatibility, b.compatibility); + swap(a.validationLevel, b.validationLevel); + swap(a.canEvolve, b.canEvolve); + swap(a.schemaGroup, b.schemaGroup); + swap(a.description, b.description); + swap(a.__isset, b.__isset); +} + +bool ISchema::operator==(const ISchema & rhs) const +{ + if (!(schemaType == rhs.schemaType)) + return false; + if (!(name == rhs.name)) + return false; + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(compatibility == rhs.compatibility)) + return false; + if (!(validationLevel == rhs.validationLevel)) + return false; + if (!(canEvolve == rhs.canEvolve)) + return false; + if (__isset.schemaGroup != rhs.__isset.schemaGroup) + return false; + else if (__isset.schemaGroup && !(schemaGroup == rhs.schemaGroup)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + return true; +} + +ISchema::ISchema(const ISchema& other1537) { + schemaType = other1537.schemaType; + name = other1537.name; + catName = other1537.catName; + dbName = other1537.dbName; + compatibility = other1537.compatibility; + validationLevel = other1537.validationLevel; + canEvolve = other1537.canEvolve; + schemaGroup = other1537.schemaGroup; + description = other1537.description; + __isset = other1537.__isset; +} +ISchema& ISchema::operator=(const ISchema& other1538) { + schemaType = other1538.schemaType; + name = other1538.name; + catName = other1538.catName; + dbName = other1538.dbName; + compatibility = other1538.compatibility; + validationLevel = other1538.validationLevel; + canEvolve = other1538.canEvolve; + schemaGroup = other1538.schemaGroup; + description = other1538.description; + __isset = other1538.__isset; + return *this; +} +void ISchema::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ISchema("; + out << "schemaType=" << to_string(schemaType); + out << ", " << "name=" << to_string(name); + out << ", " << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "compatibility=" << to_string(compatibility); + out << ", " << "validationLevel=" << to_string(validationLevel); + out << ", " << "canEvolve=" << to_string(canEvolve); + out << ", " << "schemaGroup="; (__isset.schemaGroup ? (out << to_string(schemaGroup)) : (out << "")); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ")"; +} + + +ISchemaName::~ISchemaName() noexcept { +} + +ISchemaName::ISchemaName() noexcept + : catName(), + dbName(), + schemaName() { +} + +void ISchemaName::__set_catName(const std::string& val) { + this->catName = val; +} + +void ISchemaName::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void ISchemaName::__set_schemaName(const std::string& val) { + this->schemaName = val; +} +std::ostream& operator<<(std::ostream& out, const ISchemaName& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ISchemaName::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ISchemaName::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ISchemaName"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ISchemaName &a, ISchemaName &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.schemaName, b.schemaName); + swap(a.__isset, b.__isset); +} + +bool ISchemaName::operator==(const ISchemaName & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(schemaName == rhs.schemaName)) + return false; + return true; +} + +ISchemaName::ISchemaName(const ISchemaName& other1539) { + catName = other1539.catName; + dbName = other1539.dbName; + schemaName = other1539.schemaName; + __isset = other1539.__isset; +} +ISchemaName& ISchemaName::operator=(const ISchemaName& other1540) { + catName = other1540.catName; + dbName = other1540.dbName; + schemaName = other1540.schemaName; + __isset = other1540.__isset; + return *this; +} +void ISchemaName::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ISchemaName("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "schemaName=" << to_string(schemaName); + out << ")"; +} + + +AlterISchemaRequest::~AlterISchemaRequest() noexcept { +} + +AlterISchemaRequest::AlterISchemaRequest() noexcept { +} + +void AlterISchemaRequest::__set_name(const ISchemaName& val) { + this->name = val; +} + +void AlterISchemaRequest::__set_newSchema(const ISchema& val) { + this->newSchema = val; +} +std::ostream& operator<<(std::ostream& out, const AlterISchemaRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterISchemaRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->name.read(iprot); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newSchema.read(iprot); + this->__isset.newSchema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AlterISchemaRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterISchemaRequest"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->name.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newSchema", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->newSchema.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterISchemaRequest &a, AlterISchemaRequest &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.newSchema, b.newSchema); + swap(a.__isset, b.__isset); +} + +bool AlterISchemaRequest::operator==(const AlterISchemaRequest & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(newSchema == rhs.newSchema)) + return false; + return true; +} + +AlterISchemaRequest::AlterISchemaRequest(const AlterISchemaRequest& other1541) { + name = other1541.name; + newSchema = other1541.newSchema; + __isset = other1541.__isset; +} +AlterISchemaRequest& AlterISchemaRequest::operator=(const AlterISchemaRequest& other1542) { + name = other1542.name; + newSchema = other1542.newSchema; + __isset = other1542.__isset; + return *this; +} +void AlterISchemaRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterISchemaRequest("; + out << "name=" << to_string(name); + out << ", " << "newSchema=" << to_string(newSchema); + out << ")"; +} + + +SchemaVersion::~SchemaVersion() noexcept { +} + +SchemaVersion::SchemaVersion() noexcept + : version(0), + createdAt(0), + state(static_cast(0)), + description(), + schemaText(), + fingerprint(), + name() { +} + +void SchemaVersion::__set_schema(const ISchemaName& val) { + this->schema = val; +} + +void SchemaVersion::__set_version(const int32_t val) { + this->version = val; +} + +void SchemaVersion::__set_createdAt(const int64_t val) { + this->createdAt = val; +} + +void SchemaVersion::__set_cols(const std::vector & val) { + this->cols = val; +} + +void SchemaVersion::__set_state(const SchemaVersionState::type val) { + this->state = val; +__isset.state = true; +} + +void SchemaVersion::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} + +void SchemaVersion::__set_schemaText(const std::string& val) { + this->schemaText = val; +__isset.schemaText = true; +} + +void SchemaVersion::__set_fingerprint(const std::string& val) { + this->fingerprint = val; +__isset.fingerprint = true; +} + +void SchemaVersion::__set_name(const std::string& val) { + this->name = val; +__isset.name = true; +} + +void SchemaVersion::__set_serDe(const SerDeInfo& val) { + this->serDe = val; +__isset.serDe = true; +} +std::ostream& operator<<(std::ostream& out, const SchemaVersion& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SchemaVersion::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schema.read(iprot); + this->__isset.schema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->version); + this->__isset.version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->createdAt); + this->__isset.createdAt = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->cols.clear(); + uint32_t _size1543; + ::apache::thrift::protocol::TType _etype1546; + xfer += iprot->readListBegin(_etype1546, _size1543); + this->cols.resize(_size1543); + uint32_t _i1547; + for (_i1547 = 0; _i1547 < _size1543; ++_i1547) + { + xfer += this->cols[_i1547].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.cols = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1548; + xfer += iprot->readI32(ecast1548); + this->state = static_cast(ecast1548); + this->__isset.state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaText); + this->__isset.schemaText = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->fingerprint); + this->__isset.fingerprint = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->serDe.read(iprot); + this->__isset.serDe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SchemaVersion::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SchemaVersion"); + + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schema.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->version); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("createdAt", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->createdAt); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("cols", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->cols.size())); + std::vector ::const_iterator _iter1549; + for (_iter1549 = this->cols.begin(); _iter1549 != this->cols.end(); ++_iter1549) + { + xfer += (*_iter1549).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.state) { + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaText) { + xfer += oprot->writeFieldBegin("schemaText", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->schemaText); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.fingerprint) { + xfer += oprot->writeFieldBegin("fingerprint", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->fingerprint); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.name) { + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.serDe) { + xfer += oprot->writeFieldBegin("serDe", ::apache::thrift::protocol::T_STRUCT, 10); + xfer += this->serDe.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SchemaVersion &a, SchemaVersion &b) noexcept { + using ::std::swap; + swap(a.schema, b.schema); + swap(a.version, b.version); + swap(a.createdAt, b.createdAt); + swap(a.cols, b.cols); + swap(a.state, b.state); + swap(a.description, b.description); + swap(a.schemaText, b.schemaText); + swap(a.fingerprint, b.fingerprint); + swap(a.name, b.name); + swap(a.serDe, b.serDe); + swap(a.__isset, b.__isset); +} + +bool SchemaVersion::operator==(const SchemaVersion & rhs) const +{ + if (!(schema == rhs.schema)) + return false; + if (!(version == rhs.version)) + return false; + if (!(createdAt == rhs.createdAt)) + return false; + if (!(cols == rhs.cols)) + return false; + if (__isset.state != rhs.__isset.state) + return false; + else if (__isset.state && !(state == rhs.state)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + if (__isset.schemaText != rhs.__isset.schemaText) + return false; + else if (__isset.schemaText && !(schemaText == rhs.schemaText)) + return false; + if (__isset.fingerprint != rhs.__isset.fingerprint) + return false; + else if (__isset.fingerprint && !(fingerprint == rhs.fingerprint)) + return false; + if (__isset.name != rhs.__isset.name) + return false; + else if (__isset.name && !(name == rhs.name)) + return false; + if (__isset.serDe != rhs.__isset.serDe) + return false; + else if (__isset.serDe && !(serDe == rhs.serDe)) + return false; + return true; +} + +SchemaVersion::SchemaVersion(const SchemaVersion& other1550) { + schema = other1550.schema; + version = other1550.version; + createdAt = other1550.createdAt; + cols = other1550.cols; + state = other1550.state; + description = other1550.description; + schemaText = other1550.schemaText; + fingerprint = other1550.fingerprint; + name = other1550.name; + serDe = other1550.serDe; + __isset = other1550.__isset; +} +SchemaVersion& SchemaVersion::operator=(const SchemaVersion& other1551) { + schema = other1551.schema; + version = other1551.version; + createdAt = other1551.createdAt; + cols = other1551.cols; + state = other1551.state; + description = other1551.description; + schemaText = other1551.schemaText; + fingerprint = other1551.fingerprint; + name = other1551.name; + serDe = other1551.serDe; + __isset = other1551.__isset; + return *this; +} +void SchemaVersion::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SchemaVersion("; + out << "schema=" << to_string(schema); + out << ", " << "version=" << to_string(version); + out << ", " << "createdAt=" << to_string(createdAt); + out << ", " << "cols=" << to_string(cols); + out << ", " << "state="; (__isset.state ? (out << to_string(state)) : (out << "")); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ", " << "schemaText="; (__isset.schemaText ? (out << to_string(schemaText)) : (out << "")); + out << ", " << "fingerprint="; (__isset.fingerprint ? (out << to_string(fingerprint)) : (out << "")); + out << ", " << "name="; (__isset.name ? (out << to_string(name)) : (out << "")); + out << ", " << "serDe="; (__isset.serDe ? (out << to_string(serDe)) : (out << "")); + out << ")"; +} + + +SchemaVersionDescriptor::~SchemaVersionDescriptor() noexcept { +} + +SchemaVersionDescriptor::SchemaVersionDescriptor() noexcept + : version(0) { +} + +void SchemaVersionDescriptor::__set_schema(const ISchemaName& val) { + this->schema = val; +} + +void SchemaVersionDescriptor::__set_version(const int32_t val) { + this->version = val; +} +std::ostream& operator<<(std::ostream& out, const SchemaVersionDescriptor& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SchemaVersionDescriptor::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schema.read(iprot); + this->__isset.schema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->version); + this->__isset.version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SchemaVersionDescriptor::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SchemaVersionDescriptor"); + + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schema.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->version); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SchemaVersionDescriptor &a, SchemaVersionDescriptor &b) noexcept { + using ::std::swap; + swap(a.schema, b.schema); + swap(a.version, b.version); + swap(a.__isset, b.__isset); +} + +bool SchemaVersionDescriptor::operator==(const SchemaVersionDescriptor & rhs) const +{ + if (!(schema == rhs.schema)) + return false; + if (!(version == rhs.version)) + return false; + return true; +} + +SchemaVersionDescriptor::SchemaVersionDescriptor(const SchemaVersionDescriptor& other1552) { + schema = other1552.schema; + version = other1552.version; + __isset = other1552.__isset; +} +SchemaVersionDescriptor& SchemaVersionDescriptor::operator=(const SchemaVersionDescriptor& other1553) { + schema = other1553.schema; + version = other1553.version; + __isset = other1553.__isset; + return *this; +} +void SchemaVersionDescriptor::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SchemaVersionDescriptor("; + out << "schema=" << to_string(schema); + out << ", " << "version=" << to_string(version); + out << ")"; +} + + +FindSchemasByColsRqst::~FindSchemasByColsRqst() noexcept { +} + +FindSchemasByColsRqst::FindSchemasByColsRqst() noexcept + : colName(), + colNamespace(), + type() { +} + +void FindSchemasByColsRqst::__set_colName(const std::string& val) { + this->colName = val; +__isset.colName = true; +} + +void FindSchemasByColsRqst::__set_colNamespace(const std::string& val) { + this->colNamespace = val; +__isset.colNamespace = true; +} + +void FindSchemasByColsRqst::__set_type(const std::string& val) { + this->type = val; +__isset.type = true; +} +std::ostream& operator<<(std::ostream& out, const FindSchemasByColsRqst& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FindSchemasByColsRqst::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->colName); + this->__isset.colName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->colNamespace); + this->__isset.colNamespace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->type); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FindSchemasByColsRqst::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FindSchemasByColsRqst"); + + if (this->__isset.colName) { + xfer += oprot->writeFieldBegin("colName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->colName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.colNamespace) { + xfer += oprot->writeFieldBegin("colNamespace", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->colNamespace); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->type); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FindSchemasByColsRqst &a, FindSchemasByColsRqst &b) noexcept { + using ::std::swap; + swap(a.colName, b.colName); + swap(a.colNamespace, b.colNamespace); + swap(a.type, b.type); + swap(a.__isset, b.__isset); +} + +bool FindSchemasByColsRqst::operator==(const FindSchemasByColsRqst & rhs) const +{ + if (__isset.colName != rhs.__isset.colName) + return false; + else if (__isset.colName && !(colName == rhs.colName)) + return false; + if (__isset.colNamespace != rhs.__isset.colNamespace) + return false; + else if (__isset.colNamespace && !(colNamespace == rhs.colNamespace)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + return true; +} + +FindSchemasByColsRqst::FindSchemasByColsRqst(const FindSchemasByColsRqst& other1554) { + colName = other1554.colName; + colNamespace = other1554.colNamespace; + type = other1554.type; + __isset = other1554.__isset; +} +FindSchemasByColsRqst& FindSchemasByColsRqst::operator=(const FindSchemasByColsRqst& other1555) { + colName = other1555.colName; + colNamespace = other1555.colNamespace; + type = other1555.type; + __isset = other1555.__isset; + return *this; +} +void FindSchemasByColsRqst::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FindSchemasByColsRqst("; + out << "colName="; (__isset.colName ? (out << to_string(colName)) : (out << "")); + out << ", " << "colNamespace="; (__isset.colNamespace ? (out << to_string(colNamespace)) : (out << "")); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ")"; +} + + +FindSchemasByColsResp::~FindSchemasByColsResp() noexcept { +} + +FindSchemasByColsResp::FindSchemasByColsResp() noexcept { +} + +void FindSchemasByColsResp::__set_schemaVersions(const std::vector & val) { + this->schemaVersions = val; +} +std::ostream& operator<<(std::ostream& out, const FindSchemasByColsResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t FindSchemasByColsResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->schemaVersions.clear(); + uint32_t _size1556; + ::apache::thrift::protocol::TType _etype1559; + xfer += iprot->readListBegin(_etype1559, _size1556); + this->schemaVersions.resize(_size1556); + uint32_t _i1560; + for (_i1560 = 0; _i1560 < _size1556; ++_i1560) + { + xfer += this->schemaVersions[_i1560].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.schemaVersions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t FindSchemasByColsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("FindSchemasByColsResp"); + + xfer += oprot->writeFieldBegin("schemaVersions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->schemaVersions.size())); + std::vector ::const_iterator _iter1561; + for (_iter1561 = this->schemaVersions.begin(); _iter1561 != this->schemaVersions.end(); ++_iter1561) + { + xfer += (*_iter1561).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(FindSchemasByColsResp &a, FindSchemasByColsResp &b) noexcept { + using ::std::swap; + swap(a.schemaVersions, b.schemaVersions); + swap(a.__isset, b.__isset); +} + +bool FindSchemasByColsResp::operator==(const FindSchemasByColsResp & rhs) const +{ + if (!(schemaVersions == rhs.schemaVersions)) + return false; + return true; +} + +FindSchemasByColsResp::FindSchemasByColsResp(const FindSchemasByColsResp& other1562) { + schemaVersions = other1562.schemaVersions; + __isset = other1562.__isset; +} +FindSchemasByColsResp& FindSchemasByColsResp::operator=(const FindSchemasByColsResp& other1563) { + schemaVersions = other1563.schemaVersions; + __isset = other1563.__isset; + return *this; +} +void FindSchemasByColsResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "FindSchemasByColsResp("; + out << "schemaVersions=" << to_string(schemaVersions); + out << ")"; +} + + +MapSchemaVersionToSerdeRequest::~MapSchemaVersionToSerdeRequest() noexcept { +} + +MapSchemaVersionToSerdeRequest::MapSchemaVersionToSerdeRequest() noexcept + : serdeName() { +} + +void MapSchemaVersionToSerdeRequest::__set_schemaVersion(const SchemaVersionDescriptor& val) { + this->schemaVersion = val; +} + +void MapSchemaVersionToSerdeRequest::__set_serdeName(const std::string& val) { + this->serdeName = val; +} +std::ostream& operator<<(std::ostream& out, const MapSchemaVersionToSerdeRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t MapSchemaVersionToSerdeRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaVersion.read(iprot); + this->__isset.schemaVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->serdeName); + this->__isset.serdeName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t MapSchemaVersionToSerdeRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("MapSchemaVersionToSerdeRequest"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaVersion.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("serdeName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->serdeName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(MapSchemaVersionToSerdeRequest &a, MapSchemaVersionToSerdeRequest &b) noexcept { + using ::std::swap; + swap(a.schemaVersion, b.schemaVersion); + swap(a.serdeName, b.serdeName); + swap(a.__isset, b.__isset); +} + +bool MapSchemaVersionToSerdeRequest::operator==(const MapSchemaVersionToSerdeRequest & rhs) const +{ + if (!(schemaVersion == rhs.schemaVersion)) + return false; + if (!(serdeName == rhs.serdeName)) + return false; + return true; +} + +MapSchemaVersionToSerdeRequest::MapSchemaVersionToSerdeRequest(const MapSchemaVersionToSerdeRequest& other1564) { + schemaVersion = other1564.schemaVersion; + serdeName = other1564.serdeName; + __isset = other1564.__isset; +} +MapSchemaVersionToSerdeRequest& MapSchemaVersionToSerdeRequest::operator=(const MapSchemaVersionToSerdeRequest& other1565) { + schemaVersion = other1565.schemaVersion; + serdeName = other1565.serdeName; + __isset = other1565.__isset; + return *this; +} +void MapSchemaVersionToSerdeRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "MapSchemaVersionToSerdeRequest("; + out << "schemaVersion=" << to_string(schemaVersion); + out << ", " << "serdeName=" << to_string(serdeName); + out << ")"; +} + + +SetSchemaVersionStateRequest::~SetSchemaVersionStateRequest() noexcept { +} + +SetSchemaVersionStateRequest::SetSchemaVersionStateRequest() noexcept + : state(static_cast(0)) { +} + +void SetSchemaVersionStateRequest::__set_schemaVersion(const SchemaVersionDescriptor& val) { + this->schemaVersion = val; +} + +void SetSchemaVersionStateRequest::__set_state(const SchemaVersionState::type val) { + this->state = val; +} +std::ostream& operator<<(std::ostream& out, const SetSchemaVersionStateRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t SetSchemaVersionStateRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schemaVersion.read(iprot); + this->__isset.schemaVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1566; + xfer += iprot->readI32(ecast1566); + this->state = static_cast(ecast1566); + this->__isset.state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SetSchemaVersionStateRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("SetSchemaVersionStateRequest"); + + xfer += oprot->writeFieldBegin("schemaVersion", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->schemaVersion.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(SetSchemaVersionStateRequest &a, SetSchemaVersionStateRequest &b) noexcept { + using ::std::swap; + swap(a.schemaVersion, b.schemaVersion); + swap(a.state, b.state); + swap(a.__isset, b.__isset); +} + +bool SetSchemaVersionStateRequest::operator==(const SetSchemaVersionStateRequest & rhs) const +{ + if (!(schemaVersion == rhs.schemaVersion)) + return false; + if (!(state == rhs.state)) + return false; + return true; +} + +SetSchemaVersionStateRequest::SetSchemaVersionStateRequest(const SetSchemaVersionStateRequest& other1567) { + schemaVersion = other1567.schemaVersion; + state = other1567.state; + __isset = other1567.__isset; +} +SetSchemaVersionStateRequest& SetSchemaVersionStateRequest::operator=(const SetSchemaVersionStateRequest& other1568) { + schemaVersion = other1568.schemaVersion; + state = other1568.state; + __isset = other1568.__isset; + return *this; +} +void SetSchemaVersionStateRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "SetSchemaVersionStateRequest("; + out << "schemaVersion=" << to_string(schemaVersion); + out << ", " << "state=" << to_string(state); + out << ")"; +} + + +GetSerdeRequest::~GetSerdeRequest() noexcept { +} + +GetSerdeRequest::GetSerdeRequest() noexcept + : serdeName() { +} + +void GetSerdeRequest::__set_serdeName(const std::string& val) { + this->serdeName = val; +} +std::ostream& operator<<(std::ostream& out, const GetSerdeRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetSerdeRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->serdeName); + this->__isset.serdeName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetSerdeRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetSerdeRequest"); + + xfer += oprot->writeFieldBegin("serdeName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->serdeName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetSerdeRequest &a, GetSerdeRequest &b) noexcept { + using ::std::swap; + swap(a.serdeName, b.serdeName); + swap(a.__isset, b.__isset); +} + +bool GetSerdeRequest::operator==(const GetSerdeRequest & rhs) const +{ + if (!(serdeName == rhs.serdeName)) + return false; + return true; +} + +GetSerdeRequest::GetSerdeRequest(const GetSerdeRequest& other1569) { + serdeName = other1569.serdeName; + __isset = other1569.__isset; +} +GetSerdeRequest& GetSerdeRequest::operator=(const GetSerdeRequest& other1570) { + serdeName = other1570.serdeName; + __isset = other1570.__isset; + return *this; +} +void GetSerdeRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetSerdeRequest("; + out << "serdeName=" << to_string(serdeName); + out << ")"; +} + + +RuntimeStat::~RuntimeStat() noexcept { +} + +RuntimeStat::RuntimeStat() noexcept + : createTime(0), + weight(0), + payload() { +} + +void RuntimeStat::__set_createTime(const int32_t val) { + this->createTime = val; +__isset.createTime = true; +} + +void RuntimeStat::__set_weight(const int32_t val) { + this->weight = val; +} + +void RuntimeStat::__set_payload(const std::string& val) { + this->payload = val; +} +std::ostream& operator<<(std::ostream& out, const RuntimeStat& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t RuntimeStat::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_weight = false; + bool isset_payload = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->weight); + isset_weight = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->payload); + isset_payload = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_weight) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_payload) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t RuntimeStat::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("RuntimeStat"); + + if (this->__isset.createTime) { + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("weight", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->weight); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("payload", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeBinary(this->payload); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(RuntimeStat &a, RuntimeStat &b) noexcept { + using ::std::swap; + swap(a.createTime, b.createTime); + swap(a.weight, b.weight); + swap(a.payload, b.payload); + swap(a.__isset, b.__isset); +} + +bool RuntimeStat::operator==(const RuntimeStat & rhs) const +{ + if (__isset.createTime != rhs.__isset.createTime) + return false; + else if (__isset.createTime && !(createTime == rhs.createTime)) + return false; + if (!(weight == rhs.weight)) + return false; + if (!(payload == rhs.payload)) + return false; + return true; +} + +RuntimeStat::RuntimeStat(const RuntimeStat& other1571) { + createTime = other1571.createTime; + weight = other1571.weight; + payload = other1571.payload; + __isset = other1571.__isset; +} +RuntimeStat& RuntimeStat::operator=(const RuntimeStat& other1572) { + createTime = other1572.createTime; + weight = other1572.weight; + payload = other1572.payload; + __isset = other1572.__isset; + return *this; +} +void RuntimeStat::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "RuntimeStat("; + out << "createTime="; (__isset.createTime ? (out << to_string(createTime)) : (out << "")); + out << ", " << "weight=" << to_string(weight); + out << ", " << "payload=" << to_string(payload); + out << ")"; +} + + +GetRuntimeStatsRequest::~GetRuntimeStatsRequest() noexcept { +} + +GetRuntimeStatsRequest::GetRuntimeStatsRequest() noexcept + : maxWeight(0), + maxCreateTime(0) { +} + +void GetRuntimeStatsRequest::__set_maxWeight(const int32_t val) { + this->maxWeight = val; +} + +void GetRuntimeStatsRequest::__set_maxCreateTime(const int32_t val) { + this->maxCreateTime = val; +} +std::ostream& operator<<(std::ostream& out, const GetRuntimeStatsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetRuntimeStatsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_maxWeight = false; + bool isset_maxCreateTime = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxWeight); + isset_maxWeight = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxCreateTime); + isset_maxCreateTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_maxWeight) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_maxCreateTime) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetRuntimeStatsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetRuntimeStatsRequest"); + + xfer += oprot->writeFieldBegin("maxWeight", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->maxWeight); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("maxCreateTime", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->maxCreateTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetRuntimeStatsRequest &a, GetRuntimeStatsRequest &b) noexcept { + using ::std::swap; + swap(a.maxWeight, b.maxWeight); + swap(a.maxCreateTime, b.maxCreateTime); +} + +bool GetRuntimeStatsRequest::operator==(const GetRuntimeStatsRequest & rhs) const +{ + if (!(maxWeight == rhs.maxWeight)) + return false; + if (!(maxCreateTime == rhs.maxCreateTime)) + return false; + return true; +} + +GetRuntimeStatsRequest::GetRuntimeStatsRequest(const GetRuntimeStatsRequest& other1573) noexcept { + maxWeight = other1573.maxWeight; + maxCreateTime = other1573.maxCreateTime; +} +GetRuntimeStatsRequest& GetRuntimeStatsRequest::operator=(const GetRuntimeStatsRequest& other1574) noexcept { + maxWeight = other1574.maxWeight; + maxCreateTime = other1574.maxCreateTime; + return *this; +} +void GetRuntimeStatsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetRuntimeStatsRequest("; + out << "maxWeight=" << to_string(maxWeight); + out << ", " << "maxCreateTime=" << to_string(maxCreateTime); + out << ")"; +} + + +CreateTableRequest::~CreateTableRequest() noexcept { +} + +CreateTableRequest::CreateTableRequest() noexcept + : processorIdentifier() { +} + +void CreateTableRequest::__set_table(const Table& val) { + this->table = val; +} + +void CreateTableRequest::__set_envContext(const EnvironmentContext& val) { + this->envContext = val; +__isset.envContext = true; +} + +void CreateTableRequest::__set_primaryKeys(const std::vector & val) { + this->primaryKeys = val; +__isset.primaryKeys = true; +} + +void CreateTableRequest::__set_foreignKeys(const std::vector & val) { + this->foreignKeys = val; +__isset.foreignKeys = true; +} + +void CreateTableRequest::__set_uniqueConstraints(const std::vector & val) { + this->uniqueConstraints = val; +__isset.uniqueConstraints = true; +} + +void CreateTableRequest::__set_notNullConstraints(const std::vector & val) { + this->notNullConstraints = val; +__isset.notNullConstraints = true; +} + +void CreateTableRequest::__set_defaultConstraints(const std::vector & val) { + this->defaultConstraints = val; +__isset.defaultConstraints = true; +} + +void CreateTableRequest::__set_checkConstraints(const std::vector & val) { + this->checkConstraints = val; +__isset.checkConstraints = true; +} + +void CreateTableRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void CreateTableRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} +std::ostream& operator<<(std::ostream& out, const CreateTableRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CreateTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_table = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->table.read(iprot); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->envContext.read(iprot); + this->__isset.envContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->primaryKeys.clear(); + uint32_t _size1575; + ::apache::thrift::protocol::TType _etype1578; + xfer += iprot->readListBegin(_etype1578, _size1575); + this->primaryKeys.resize(_size1575); + uint32_t _i1579; + for (_i1579 = 0; _i1579 < _size1575; ++_i1579) + { + xfer += this->primaryKeys[_i1579].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.primaryKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->foreignKeys.clear(); + uint32_t _size1580; + ::apache::thrift::protocol::TType _etype1583; + xfer += iprot->readListBegin(_etype1583, _size1580); + this->foreignKeys.resize(_size1580); + uint32_t _i1584; + for (_i1584 = 0; _i1584 < _size1580; ++_i1584) + { + xfer += this->foreignKeys[_i1584].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.foreignKeys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->uniqueConstraints.clear(); + uint32_t _size1585; + ::apache::thrift::protocol::TType _etype1588; + xfer += iprot->readListBegin(_etype1588, _size1585); + this->uniqueConstraints.resize(_size1585); + uint32_t _i1589; + for (_i1589 = 0; _i1589 < _size1585; ++_i1589) + { + xfer += this->uniqueConstraints[_i1589].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.uniqueConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->notNullConstraints.clear(); + uint32_t _size1590; + ::apache::thrift::protocol::TType _etype1593; + xfer += iprot->readListBegin(_etype1593, _size1590); + this->notNullConstraints.resize(_size1590); + uint32_t _i1594; + for (_i1594 = 0; _i1594 < _size1590; ++_i1594) + { + xfer += this->notNullConstraints[_i1594].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.notNullConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->defaultConstraints.clear(); + uint32_t _size1595; + ::apache::thrift::protocol::TType _etype1598; + xfer += iprot->readListBegin(_etype1598, _size1595); + this->defaultConstraints.resize(_size1595); + uint32_t _i1599; + for (_i1599 = 0; _i1599 < _size1595; ++_i1599) + { + xfer += this->defaultConstraints[_i1599].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.defaultConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->checkConstraints.clear(); + uint32_t _size1600; + ::apache::thrift::protocol::TType _etype1603; + xfer += iprot->readListBegin(_etype1603, _size1600); + this->checkConstraints.resize(_size1600); + uint32_t _i1604; + for (_i1604 = 0; _i1604 < _size1600; ++_i1604) + { + xfer += this->checkConstraints[_i1604].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.checkConstraints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1605; + ::apache::thrift::protocol::TType _etype1608; + xfer += iprot->readListBegin(_etype1608, _size1605); + this->processorCapabilities.resize(_size1605); + uint32_t _i1609; + for (_i1609 = 0; _i1609 < _size1605; ++_i1609) + { + xfer += iprot->readString(this->processorCapabilities[_i1609]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CreateTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CreateTableRequest"); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->table.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.envContext) { + xfer += oprot->writeFieldBegin("envContext", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->envContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.primaryKeys) { + xfer += oprot->writeFieldBegin("primaryKeys", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->primaryKeys.size())); + std::vector ::const_iterator _iter1610; + for (_iter1610 = this->primaryKeys.begin(); _iter1610 != this->primaryKeys.end(); ++_iter1610) + { + xfer += (*_iter1610).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.foreignKeys) { + xfer += oprot->writeFieldBegin("foreignKeys", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->foreignKeys.size())); + std::vector ::const_iterator _iter1611; + for (_iter1611 = this->foreignKeys.begin(); _iter1611 != this->foreignKeys.end(); ++_iter1611) + { + xfer += (*_iter1611).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.uniqueConstraints) { + xfer += oprot->writeFieldBegin("uniqueConstraints", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->uniqueConstraints.size())); + std::vector ::const_iterator _iter1612; + for (_iter1612 = this->uniqueConstraints.begin(); _iter1612 != this->uniqueConstraints.end(); ++_iter1612) + { + xfer += (*_iter1612).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.notNullConstraints) { + xfer += oprot->writeFieldBegin("notNullConstraints", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->notNullConstraints.size())); + std::vector ::const_iterator _iter1613; + for (_iter1613 = this->notNullConstraints.begin(); _iter1613 != this->notNullConstraints.end(); ++_iter1613) + { + xfer += (*_iter1613).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.defaultConstraints) { + xfer += oprot->writeFieldBegin("defaultConstraints", ::apache::thrift::protocol::T_LIST, 7); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->defaultConstraints.size())); + std::vector ::const_iterator _iter1614; + for (_iter1614 = this->defaultConstraints.begin(); _iter1614 != this->defaultConstraints.end(); ++_iter1614) + { + xfer += (*_iter1614).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.checkConstraints) { + xfer += oprot->writeFieldBegin("checkConstraints", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->checkConstraints.size())); + std::vector ::const_iterator _iter1615; + for (_iter1615 = this->checkConstraints.begin(); _iter1615 != this->checkConstraints.end(); ++_iter1615) + { + xfer += (*_iter1615).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 9); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1616; + for (_iter1616 = this->processorCapabilities.begin(); _iter1616 != this->processorCapabilities.end(); ++_iter1616) + { + xfer += oprot->writeString((*_iter1616)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CreateTableRequest &a, CreateTableRequest &b) noexcept { + using ::std::swap; + swap(a.table, b.table); + swap(a.envContext, b.envContext); + swap(a.primaryKeys, b.primaryKeys); + swap(a.foreignKeys, b.foreignKeys); + swap(a.uniqueConstraints, b.uniqueConstraints); + swap(a.notNullConstraints, b.notNullConstraints); + swap(a.defaultConstraints, b.defaultConstraints); + swap(a.checkConstraints, b.checkConstraints); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.__isset, b.__isset); +} + +bool CreateTableRequest::operator==(const CreateTableRequest & rhs) const +{ + if (!(table == rhs.table)) + return false; + if (__isset.envContext != rhs.__isset.envContext) + return false; + else if (__isset.envContext && !(envContext == rhs.envContext)) + return false; + if (__isset.primaryKeys != rhs.__isset.primaryKeys) + return false; + else if (__isset.primaryKeys && !(primaryKeys == rhs.primaryKeys)) + return false; + if (__isset.foreignKeys != rhs.__isset.foreignKeys) + return false; + else if (__isset.foreignKeys && !(foreignKeys == rhs.foreignKeys)) + return false; + if (__isset.uniqueConstraints != rhs.__isset.uniqueConstraints) + return false; + else if (__isset.uniqueConstraints && !(uniqueConstraints == rhs.uniqueConstraints)) + return false; + if (__isset.notNullConstraints != rhs.__isset.notNullConstraints) + return false; + else if (__isset.notNullConstraints && !(notNullConstraints == rhs.notNullConstraints)) + return false; + if (__isset.defaultConstraints != rhs.__isset.defaultConstraints) + return false; + else if (__isset.defaultConstraints && !(defaultConstraints == rhs.defaultConstraints)) + return false; + if (__isset.checkConstraints != rhs.__isset.checkConstraints) + return false; + else if (__isset.checkConstraints && !(checkConstraints == rhs.checkConstraints)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + return true; +} + +CreateTableRequest::CreateTableRequest(const CreateTableRequest& other1617) { + table = other1617.table; + envContext = other1617.envContext; + primaryKeys = other1617.primaryKeys; + foreignKeys = other1617.foreignKeys; + uniqueConstraints = other1617.uniqueConstraints; + notNullConstraints = other1617.notNullConstraints; + defaultConstraints = other1617.defaultConstraints; + checkConstraints = other1617.checkConstraints; + processorCapabilities = other1617.processorCapabilities; + processorIdentifier = other1617.processorIdentifier; + __isset = other1617.__isset; +} +CreateTableRequest& CreateTableRequest::operator=(const CreateTableRequest& other1618) { + table = other1618.table; + envContext = other1618.envContext; + primaryKeys = other1618.primaryKeys; + foreignKeys = other1618.foreignKeys; + uniqueConstraints = other1618.uniqueConstraints; + notNullConstraints = other1618.notNullConstraints; + defaultConstraints = other1618.defaultConstraints; + checkConstraints = other1618.checkConstraints; + processorCapabilities = other1618.processorCapabilities; + processorIdentifier = other1618.processorIdentifier; + __isset = other1618.__isset; + return *this; +} +void CreateTableRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CreateTableRequest("; + out << "table=" << to_string(table); + out << ", " << "envContext="; (__isset.envContext ? (out << to_string(envContext)) : (out << "")); + out << ", " << "primaryKeys="; (__isset.primaryKeys ? (out << to_string(primaryKeys)) : (out << "")); + out << ", " << "foreignKeys="; (__isset.foreignKeys ? (out << to_string(foreignKeys)) : (out << "")); + out << ", " << "uniqueConstraints="; (__isset.uniqueConstraints ? (out << to_string(uniqueConstraints)) : (out << "")); + out << ", " << "notNullConstraints="; (__isset.notNullConstraints ? (out << to_string(notNullConstraints)) : (out << "")); + out << ", " << "defaultConstraints="; (__isset.defaultConstraints ? (out << to_string(defaultConstraints)) : (out << "")); + out << ", " << "checkConstraints="; (__isset.checkConstraints ? (out << to_string(checkConstraints)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ")"; +} + + +CreateDatabaseRequest::~CreateDatabaseRequest() noexcept { +} + +CreateDatabaseRequest::CreateDatabaseRequest() noexcept + : databaseName(), + description(), + locationUri(), + ownerName(), + ownerType(static_cast(0)), + catalogName(), + createTime(0), + managedLocationUri(), + type(static_cast(0)), + dataConnectorName(), + remote_dbname() { +} + +void CreateDatabaseRequest::__set_databaseName(const std::string& val) { + this->databaseName = val; +} + +void CreateDatabaseRequest::__set_description(const std::string& val) { + this->description = val; +__isset.description = true; +} + +void CreateDatabaseRequest::__set_locationUri(const std::string& val) { + this->locationUri = val; +__isset.locationUri = true; +} + +void CreateDatabaseRequest::__set_parameters(const std::map & val) { + this->parameters = val; +__isset.parameters = true; +} + +void CreateDatabaseRequest::__set_privileges(const PrincipalPrivilegeSet& val) { + this->privileges = val; +__isset.privileges = true; +} + +void CreateDatabaseRequest::__set_ownerName(const std::string& val) { + this->ownerName = val; +__isset.ownerName = true; +} + +void CreateDatabaseRequest::__set_ownerType(const PrincipalType::type val) { + this->ownerType = val; +__isset.ownerType = true; +} + +void CreateDatabaseRequest::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void CreateDatabaseRequest::__set_createTime(const int32_t val) { + this->createTime = val; +__isset.createTime = true; +} + +void CreateDatabaseRequest::__set_managedLocationUri(const std::string& val) { + this->managedLocationUri = val; +__isset.managedLocationUri = true; +} + +void CreateDatabaseRequest::__set_type(const DatabaseType::type val) { + this->type = val; +__isset.type = true; +} + +void CreateDatabaseRequest::__set_dataConnectorName(const std::string& val) { + this->dataConnectorName = val; +__isset.dataConnectorName = true; +} + +void CreateDatabaseRequest::__set_remote_dbname(const std::string& val) { + this->remote_dbname = val; +__isset.remote_dbname = true; +} +std::ostream& operator<<(std::ostream& out, const CreateDatabaseRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CreateDatabaseRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_databaseName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->databaseName); + isset_databaseName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->description); + this->__isset.description = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->locationUri); + this->__isset.locationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->parameters.clear(); + uint32_t _size1619; + ::apache::thrift::protocol::TType _ktype1620; + ::apache::thrift::protocol::TType _vtype1621; + xfer += iprot->readMapBegin(_ktype1620, _vtype1621, _size1619); + uint32_t _i1623; + for (_i1623 = 0; _i1623 < _size1619; ++_i1623) + { + std::string _key1624; + xfer += iprot->readString(_key1624); + std::string& _val1625 = this->parameters[_key1624]; + xfer += iprot->readString(_val1625); + } + xfer += iprot->readMapEnd(); + } + this->__isset.parameters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->privileges.read(iprot); + this->__isset.privileges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1626; + xfer += iprot->readI32(ecast1626); + this->ownerType = static_cast(ecast1626); + this->__isset.ownerType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->createTime); + this->__isset.createTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->managedLocationUri); + this->__isset.managedLocationUri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1627; + xfer += iprot->readI32(ecast1627); + this->type = static_cast(ecast1627); + this->__isset.type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dataConnectorName); + this->__isset.dataConnectorName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->remote_dbname); + this->__isset.remote_dbname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_databaseName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CreateDatabaseRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CreateDatabaseRequest"); + + xfer += oprot->writeFieldBegin("databaseName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->databaseName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.description) { + xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->description); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.locationUri) { + xfer += oprot->writeFieldBegin("locationUri", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->locationUri); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.parameters) { + xfer += oprot->writeFieldBegin("parameters", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->parameters.size())); + std::map ::const_iterator _iter1628; + for (_iter1628 = this->parameters.begin(); _iter1628 != this->parameters.end(); ++_iter1628) + { + xfer += oprot->writeString(_iter1628->first); + xfer += oprot->writeString(_iter1628->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.privileges) { + xfer += oprot->writeFieldBegin("privileges", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->privileges.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerName) { + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ownerType) { + xfer += oprot->writeFieldBegin("ownerType", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->ownerType)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.createTime) { + xfer += oprot->writeFieldBegin("createTime", ::apache::thrift::protocol::T_I32, 9); + xfer += oprot->writeI32(this->createTime); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.managedLocationUri) { + xfer += oprot->writeFieldBegin("managedLocationUri", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->managedLocationUri); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.type) { + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 11); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dataConnectorName) { + xfer += oprot->writeFieldBegin("dataConnectorName", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->dataConnectorName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.remote_dbname) { + xfer += oprot->writeFieldBegin("remote_dbname", ::apache::thrift::protocol::T_STRING, 13); + xfer += oprot->writeString(this->remote_dbname); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CreateDatabaseRequest &a, CreateDatabaseRequest &b) noexcept { + using ::std::swap; + swap(a.databaseName, b.databaseName); + swap(a.description, b.description); + swap(a.locationUri, b.locationUri); + swap(a.parameters, b.parameters); + swap(a.privileges, b.privileges); + swap(a.ownerName, b.ownerName); + swap(a.ownerType, b.ownerType); + swap(a.catalogName, b.catalogName); + swap(a.createTime, b.createTime); + swap(a.managedLocationUri, b.managedLocationUri); + swap(a.type, b.type); + swap(a.dataConnectorName, b.dataConnectorName); + swap(a.remote_dbname, b.remote_dbname); + swap(a.__isset, b.__isset); +} + +bool CreateDatabaseRequest::operator==(const CreateDatabaseRequest & rhs) const +{ + if (!(databaseName == rhs.databaseName)) + return false; + if (__isset.description != rhs.__isset.description) + return false; + else if (__isset.description && !(description == rhs.description)) + return false; + if (__isset.locationUri != rhs.__isset.locationUri) + return false; + else if (__isset.locationUri && !(locationUri == rhs.locationUri)) + return false; + if (__isset.parameters != rhs.__isset.parameters) + return false; + else if (__isset.parameters && !(parameters == rhs.parameters)) + return false; + if (__isset.privileges != rhs.__isset.privileges) + return false; + else if (__isset.privileges && !(privileges == rhs.privileges)) + return false; + if (__isset.ownerName != rhs.__isset.ownerName) + return false; + else if (__isset.ownerName && !(ownerName == rhs.ownerName)) + return false; + if (__isset.ownerType != rhs.__isset.ownerType) + return false; + else if (__isset.ownerType && !(ownerType == rhs.ownerType)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.createTime != rhs.__isset.createTime) + return false; + else if (__isset.createTime && !(createTime == rhs.createTime)) + return false; + if (__isset.managedLocationUri != rhs.__isset.managedLocationUri) + return false; + else if (__isset.managedLocationUri && !(managedLocationUri == rhs.managedLocationUri)) + return false; + if (__isset.type != rhs.__isset.type) + return false; + else if (__isset.type && !(type == rhs.type)) + return false; + if (__isset.dataConnectorName != rhs.__isset.dataConnectorName) + return false; + else if (__isset.dataConnectorName && !(dataConnectorName == rhs.dataConnectorName)) + return false; + if (__isset.remote_dbname != rhs.__isset.remote_dbname) + return false; + else if (__isset.remote_dbname && !(remote_dbname == rhs.remote_dbname)) + return false; + return true; +} + +CreateDatabaseRequest::CreateDatabaseRequest(const CreateDatabaseRequest& other1629) { + databaseName = other1629.databaseName; + description = other1629.description; + locationUri = other1629.locationUri; + parameters = other1629.parameters; + privileges = other1629.privileges; + ownerName = other1629.ownerName; + ownerType = other1629.ownerType; + catalogName = other1629.catalogName; + createTime = other1629.createTime; + managedLocationUri = other1629.managedLocationUri; + type = other1629.type; + dataConnectorName = other1629.dataConnectorName; + remote_dbname = other1629.remote_dbname; + __isset = other1629.__isset; +} +CreateDatabaseRequest& CreateDatabaseRequest::operator=(const CreateDatabaseRequest& other1630) { + databaseName = other1630.databaseName; + description = other1630.description; + locationUri = other1630.locationUri; + parameters = other1630.parameters; + privileges = other1630.privileges; + ownerName = other1630.ownerName; + ownerType = other1630.ownerType; + catalogName = other1630.catalogName; + createTime = other1630.createTime; + managedLocationUri = other1630.managedLocationUri; + type = other1630.type; + dataConnectorName = other1630.dataConnectorName; + remote_dbname = other1630.remote_dbname; + __isset = other1630.__isset; + return *this; +} +void CreateDatabaseRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CreateDatabaseRequest("; + out << "databaseName=" << to_string(databaseName); + out << ", " << "description="; (__isset.description ? (out << to_string(description)) : (out << "")); + out << ", " << "locationUri="; (__isset.locationUri ? (out << to_string(locationUri)) : (out << "")); + out << ", " << "parameters="; (__isset.parameters ? (out << to_string(parameters)) : (out << "")); + out << ", " << "privileges="; (__isset.privileges ? (out << to_string(privileges)) : (out << "")); + out << ", " << "ownerName="; (__isset.ownerName ? (out << to_string(ownerName)) : (out << "")); + out << ", " << "ownerType="; (__isset.ownerType ? (out << to_string(ownerType)) : (out << "")); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "createTime="; (__isset.createTime ? (out << to_string(createTime)) : (out << "")); + out << ", " << "managedLocationUri="; (__isset.managedLocationUri ? (out << to_string(managedLocationUri)) : (out << "")); + out << ", " << "type="; (__isset.type ? (out << to_string(type)) : (out << "")); + out << ", " << "dataConnectorName="; (__isset.dataConnectorName ? (out << to_string(dataConnectorName)) : (out << "")); + out << ", " << "remote_dbname="; (__isset.remote_dbname ? (out << to_string(remote_dbname)) : (out << "")); + out << ")"; +} + + +CreateDataConnectorRequest::~CreateDataConnectorRequest() noexcept { +} + +CreateDataConnectorRequest::CreateDataConnectorRequest() noexcept { +} + +void CreateDataConnectorRequest::__set_connector(const DataConnector& val) { + this->connector = val; +} +std::ostream& operator<<(std::ostream& out, const CreateDataConnectorRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CreateDataConnectorRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_connector = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->connector.read(iprot); + isset_connector = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_connector) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CreateDataConnectorRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CreateDataConnectorRequest"); + + xfer += oprot->writeFieldBegin("connector", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->connector.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CreateDataConnectorRequest &a, CreateDataConnectorRequest &b) noexcept { + using ::std::swap; + swap(a.connector, b.connector); +} + +bool CreateDataConnectorRequest::operator==(const CreateDataConnectorRequest & rhs) const +{ + if (!(connector == rhs.connector)) + return false; + return true; +} + +CreateDataConnectorRequest::CreateDataConnectorRequest(const CreateDataConnectorRequest& other1631) { + connector = other1631.connector; +} +CreateDataConnectorRequest& CreateDataConnectorRequest::operator=(const CreateDataConnectorRequest& other1632) { + connector = other1632.connector; + return *this; +} +void CreateDataConnectorRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CreateDataConnectorRequest("; + out << "connector=" << to_string(connector); + out << ")"; +} + + +GetDataConnectorRequest::~GetDataConnectorRequest() noexcept { +} + +GetDataConnectorRequest::GetDataConnectorRequest() noexcept + : connectorName() { +} + +void GetDataConnectorRequest::__set_connectorName(const std::string& val) { + this->connectorName = val; +} +std::ostream& operator<<(std::ostream& out, const GetDataConnectorRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetDataConnectorRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_connectorName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->connectorName); + isset_connectorName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_connectorName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetDataConnectorRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetDataConnectorRequest"); + + xfer += oprot->writeFieldBegin("connectorName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->connectorName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetDataConnectorRequest &a, GetDataConnectorRequest &b) noexcept { + using ::std::swap; + swap(a.connectorName, b.connectorName); +} + +bool GetDataConnectorRequest::operator==(const GetDataConnectorRequest & rhs) const +{ + if (!(connectorName == rhs.connectorName)) + return false; + return true; +} + +GetDataConnectorRequest::GetDataConnectorRequest(const GetDataConnectorRequest& other1633) { + connectorName = other1633.connectorName; +} +GetDataConnectorRequest& GetDataConnectorRequest::operator=(const GetDataConnectorRequest& other1634) { + connectorName = other1634.connectorName; + return *this; +} +void GetDataConnectorRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetDataConnectorRequest("; + out << "connectorName=" << to_string(connectorName); + out << ")"; +} + + +AlterDataConnectorRequest::~AlterDataConnectorRequest() noexcept { +} + +AlterDataConnectorRequest::AlterDataConnectorRequest() noexcept + : connectorName() { +} + +void AlterDataConnectorRequest::__set_connectorName(const std::string& val) { + this->connectorName = val; +} + +void AlterDataConnectorRequest::__set_newConnector(const DataConnector& val) { + this->newConnector = val; +} +std::ostream& operator<<(std::ostream& out, const AlterDataConnectorRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterDataConnectorRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_connectorName = false; + bool isset_newConnector = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->connectorName); + isset_connectorName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newConnector.read(iprot); + isset_newConnector = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_connectorName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_newConnector) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AlterDataConnectorRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterDataConnectorRequest"); + + xfer += oprot->writeFieldBegin("connectorName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->connectorName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newConnector", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->newConnector.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterDataConnectorRequest &a, AlterDataConnectorRequest &b) noexcept { + using ::std::swap; + swap(a.connectorName, b.connectorName); + swap(a.newConnector, b.newConnector); +} + +bool AlterDataConnectorRequest::operator==(const AlterDataConnectorRequest & rhs) const +{ + if (!(connectorName == rhs.connectorName)) + return false; + if (!(newConnector == rhs.newConnector)) + return false; + return true; +} + +AlterDataConnectorRequest::AlterDataConnectorRequest(const AlterDataConnectorRequest& other1635) { + connectorName = other1635.connectorName; + newConnector = other1635.newConnector; +} +AlterDataConnectorRequest& AlterDataConnectorRequest::operator=(const AlterDataConnectorRequest& other1636) { + connectorName = other1636.connectorName; + newConnector = other1636.newConnector; + return *this; +} +void AlterDataConnectorRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterDataConnectorRequest("; + out << "connectorName=" << to_string(connectorName); + out << ", " << "newConnector=" << to_string(newConnector); + out << ")"; +} + + +DropDataConnectorRequest::~DropDataConnectorRequest() noexcept { +} + +DropDataConnectorRequest::DropDataConnectorRequest() noexcept + : connectorName(), + ifNotExists(0), + checkReferences(0) { +} + +void DropDataConnectorRequest::__set_connectorName(const std::string& val) { + this->connectorName = val; +} + +void DropDataConnectorRequest::__set_ifNotExists(const bool val) { + this->ifNotExists = val; +__isset.ifNotExists = true; +} + +void DropDataConnectorRequest::__set_checkReferences(const bool val) { + this->checkReferences = val; +__isset.checkReferences = true; +} +std::ostream& operator<<(std::ostream& out, const DropDataConnectorRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropDataConnectorRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_connectorName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->connectorName); + isset_connectorName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->ifNotExists); + this->__isset.ifNotExists = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->checkReferences); + this->__isset.checkReferences = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_connectorName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropDataConnectorRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropDataConnectorRequest"); + + xfer += oprot->writeFieldBegin("connectorName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->connectorName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.ifNotExists) { + xfer += oprot->writeFieldBegin("ifNotExists", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->ifNotExists); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.checkReferences) { + xfer += oprot->writeFieldBegin("checkReferences", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->checkReferences); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropDataConnectorRequest &a, DropDataConnectorRequest &b) noexcept { + using ::std::swap; + swap(a.connectorName, b.connectorName); + swap(a.ifNotExists, b.ifNotExists); + swap(a.checkReferences, b.checkReferences); + swap(a.__isset, b.__isset); +} + +bool DropDataConnectorRequest::operator==(const DropDataConnectorRequest & rhs) const +{ + if (!(connectorName == rhs.connectorName)) + return false; + if (__isset.ifNotExists != rhs.__isset.ifNotExists) + return false; + else if (__isset.ifNotExists && !(ifNotExists == rhs.ifNotExists)) + return false; + if (__isset.checkReferences != rhs.__isset.checkReferences) + return false; + else if (__isset.checkReferences && !(checkReferences == rhs.checkReferences)) + return false; + return true; +} + +DropDataConnectorRequest::DropDataConnectorRequest(const DropDataConnectorRequest& other1637) { + connectorName = other1637.connectorName; + ifNotExists = other1637.ifNotExists; + checkReferences = other1637.checkReferences; + __isset = other1637.__isset; +} +DropDataConnectorRequest& DropDataConnectorRequest::operator=(const DropDataConnectorRequest& other1638) { + connectorName = other1638.connectorName; + ifNotExists = other1638.ifNotExists; + checkReferences = other1638.checkReferences; + __isset = other1638.__isset; + return *this; +} +void DropDataConnectorRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropDataConnectorRequest("; + out << "connectorName=" << to_string(connectorName); + out << ", " << "ifNotExists="; (__isset.ifNotExists ? (out << to_string(ifNotExists)) : (out << "")); + out << ", " << "checkReferences="; (__isset.checkReferences ? (out << to_string(checkReferences)) : (out << "")); + out << ")"; +} + + +ScheduledQueryPollRequest::~ScheduledQueryPollRequest() noexcept { +} + +ScheduledQueryPollRequest::ScheduledQueryPollRequest() noexcept + : clusterNamespace() { +} + +void ScheduledQueryPollRequest::__set_clusterNamespace(const std::string& val) { + this->clusterNamespace = val; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQueryPollRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQueryPollRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_clusterNamespace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->clusterNamespace); + isset_clusterNamespace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_clusterNamespace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ScheduledQueryPollRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQueryPollRequest"); + + xfer += oprot->writeFieldBegin("clusterNamespace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->clusterNamespace); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQueryPollRequest &a, ScheduledQueryPollRequest &b) noexcept { + using ::std::swap; + swap(a.clusterNamespace, b.clusterNamespace); +} + +bool ScheduledQueryPollRequest::operator==(const ScheduledQueryPollRequest & rhs) const +{ + if (!(clusterNamespace == rhs.clusterNamespace)) + return false; + return true; +} + +ScheduledQueryPollRequest::ScheduledQueryPollRequest(const ScheduledQueryPollRequest& other1639) { + clusterNamespace = other1639.clusterNamespace; +} +ScheduledQueryPollRequest& ScheduledQueryPollRequest::operator=(const ScheduledQueryPollRequest& other1640) { + clusterNamespace = other1640.clusterNamespace; + return *this; +} +void ScheduledQueryPollRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQueryPollRequest("; + out << "clusterNamespace=" << to_string(clusterNamespace); + out << ")"; +} + + +ScheduledQueryKey::~ScheduledQueryKey() noexcept { +} + +ScheduledQueryKey::ScheduledQueryKey() noexcept + : scheduleName(), + clusterNamespace() { +} + +void ScheduledQueryKey::__set_scheduleName(const std::string& val) { + this->scheduleName = val; +} + +void ScheduledQueryKey::__set_clusterNamespace(const std::string& val) { + this->clusterNamespace = val; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQueryKey& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQueryKey::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_scheduleName = false; + bool isset_clusterNamespace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->scheduleName); + isset_scheduleName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->clusterNamespace); + isset_clusterNamespace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_scheduleName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_clusterNamespace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ScheduledQueryKey::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQueryKey"); + + xfer += oprot->writeFieldBegin("scheduleName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->scheduleName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("clusterNamespace", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->clusterNamespace); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQueryKey &a, ScheduledQueryKey &b) noexcept { + using ::std::swap; + swap(a.scheduleName, b.scheduleName); + swap(a.clusterNamespace, b.clusterNamespace); +} + +bool ScheduledQueryKey::operator==(const ScheduledQueryKey & rhs) const +{ + if (!(scheduleName == rhs.scheduleName)) + return false; + if (!(clusterNamespace == rhs.clusterNamespace)) + return false; + return true; +} + +ScheduledQueryKey::ScheduledQueryKey(const ScheduledQueryKey& other1641) { + scheduleName = other1641.scheduleName; + clusterNamespace = other1641.clusterNamespace; +} +ScheduledQueryKey& ScheduledQueryKey::operator=(const ScheduledQueryKey& other1642) { + scheduleName = other1642.scheduleName; + clusterNamespace = other1642.clusterNamespace; + return *this; +} +void ScheduledQueryKey::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQueryKey("; + out << "scheduleName=" << to_string(scheduleName); + out << ", " << "clusterNamespace=" << to_string(clusterNamespace); + out << ")"; +} + + +ScheduledQueryPollResponse::~ScheduledQueryPollResponse() noexcept { +} + +ScheduledQueryPollResponse::ScheduledQueryPollResponse() noexcept + : executionId(0), + query(), + user() { +} + +void ScheduledQueryPollResponse::__set_scheduleKey(const ScheduledQueryKey& val) { + this->scheduleKey = val; +__isset.scheduleKey = true; +} + +void ScheduledQueryPollResponse::__set_executionId(const int64_t val) { + this->executionId = val; +__isset.executionId = true; +} + +void ScheduledQueryPollResponse::__set_query(const std::string& val) { + this->query = val; +__isset.query = true; +} + +void ScheduledQueryPollResponse::__set_user(const std::string& val) { + this->user = val; +__isset.user = true; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQueryPollResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQueryPollResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->scheduleKey.read(iprot); + this->__isset.scheduleKey = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->executionId); + this->__isset.executionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->query); + this->__isset.query = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + this->__isset.user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ScheduledQueryPollResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQueryPollResponse"); + + if (this->__isset.scheduleKey) { + xfer += oprot->writeFieldBegin("scheduleKey", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->scheduleKey.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.executionId) { + xfer += oprot->writeFieldBegin("executionId", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->executionId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.query) { + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->query); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.user) { + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQueryPollResponse &a, ScheduledQueryPollResponse &b) noexcept { + using ::std::swap; + swap(a.scheduleKey, b.scheduleKey); + swap(a.executionId, b.executionId); + swap(a.query, b.query); + swap(a.user, b.user); + swap(a.__isset, b.__isset); +} + +bool ScheduledQueryPollResponse::operator==(const ScheduledQueryPollResponse & rhs) const +{ + if (__isset.scheduleKey != rhs.__isset.scheduleKey) + return false; + else if (__isset.scheduleKey && !(scheduleKey == rhs.scheduleKey)) + return false; + if (__isset.executionId != rhs.__isset.executionId) + return false; + else if (__isset.executionId && !(executionId == rhs.executionId)) + return false; + if (__isset.query != rhs.__isset.query) + return false; + else if (__isset.query && !(query == rhs.query)) + return false; + if (__isset.user != rhs.__isset.user) + return false; + else if (__isset.user && !(user == rhs.user)) + return false; + return true; +} + +ScheduledQueryPollResponse::ScheduledQueryPollResponse(const ScheduledQueryPollResponse& other1643) { + scheduleKey = other1643.scheduleKey; + executionId = other1643.executionId; + query = other1643.query; + user = other1643.user; + __isset = other1643.__isset; +} +ScheduledQueryPollResponse& ScheduledQueryPollResponse::operator=(const ScheduledQueryPollResponse& other1644) { + scheduleKey = other1644.scheduleKey; + executionId = other1644.executionId; + query = other1644.query; + user = other1644.user; + __isset = other1644.__isset; + return *this; +} +void ScheduledQueryPollResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQueryPollResponse("; + out << "scheduleKey="; (__isset.scheduleKey ? (out << to_string(scheduleKey)) : (out << "")); + out << ", " << "executionId="; (__isset.executionId ? (out << to_string(executionId)) : (out << "")); + out << ", " << "query="; (__isset.query ? (out << to_string(query)) : (out << "")); + out << ", " << "user="; (__isset.user ? (out << to_string(user)) : (out << "")); + out << ")"; +} + + +ScheduledQuery::~ScheduledQuery() noexcept { +} + +ScheduledQuery::ScheduledQuery() noexcept + : enabled(0), + schedule(), + user(), + query(), + nextExecution(0) { +} + +void ScheduledQuery::__set_scheduleKey(const ScheduledQueryKey& val) { + this->scheduleKey = val; +} + +void ScheduledQuery::__set_enabled(const bool val) { + this->enabled = val; +__isset.enabled = true; +} + +void ScheduledQuery::__set_schedule(const std::string& val) { + this->schedule = val; +__isset.schedule = true; +} + +void ScheduledQuery::__set_user(const std::string& val) { + this->user = val; +__isset.user = true; +} + +void ScheduledQuery::__set_query(const std::string& val) { + this->query = val; +__isset.query = true; +} + +void ScheduledQuery::__set_nextExecution(const int32_t val) { + this->nextExecution = val; +__isset.nextExecution = true; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQuery& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQuery::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_scheduleKey = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->scheduleKey.read(iprot); + isset_scheduleKey = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->enabled); + this->__isset.enabled = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schedule); + this->__isset.schedule = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + this->__isset.user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->query); + this->__isset.query = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->nextExecution); + this->__isset.nextExecution = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_scheduleKey) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ScheduledQuery::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQuery"); + + xfer += oprot->writeFieldBegin("scheduleKey", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->scheduleKey.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.enabled) { + xfer += oprot->writeFieldBegin("enabled", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->enabled); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schedule) { + xfer += oprot->writeFieldBegin("schedule", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->schedule); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.user) { + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.query) { + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->query); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.nextExecution) { + xfer += oprot->writeFieldBegin("nextExecution", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(this->nextExecution); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQuery &a, ScheduledQuery &b) noexcept { + using ::std::swap; + swap(a.scheduleKey, b.scheduleKey); + swap(a.enabled, b.enabled); + swap(a.schedule, b.schedule); + swap(a.user, b.user); + swap(a.query, b.query); + swap(a.nextExecution, b.nextExecution); + swap(a.__isset, b.__isset); +} + +bool ScheduledQuery::operator==(const ScheduledQuery & rhs) const +{ + if (!(scheduleKey == rhs.scheduleKey)) + return false; + if (__isset.enabled != rhs.__isset.enabled) + return false; + else if (__isset.enabled && !(enabled == rhs.enabled)) + return false; + if (__isset.schedule != rhs.__isset.schedule) + return false; + else if (__isset.schedule && !(schedule == rhs.schedule)) + return false; + if (__isset.user != rhs.__isset.user) + return false; + else if (__isset.user && !(user == rhs.user)) + return false; + if (__isset.query != rhs.__isset.query) + return false; + else if (__isset.query && !(query == rhs.query)) + return false; + if (__isset.nextExecution != rhs.__isset.nextExecution) + return false; + else if (__isset.nextExecution && !(nextExecution == rhs.nextExecution)) + return false; + return true; +} + +ScheduledQuery::ScheduledQuery(const ScheduledQuery& other1645) { + scheduleKey = other1645.scheduleKey; + enabled = other1645.enabled; + schedule = other1645.schedule; + user = other1645.user; + query = other1645.query; + nextExecution = other1645.nextExecution; + __isset = other1645.__isset; +} +ScheduledQuery& ScheduledQuery::operator=(const ScheduledQuery& other1646) { + scheduleKey = other1646.scheduleKey; + enabled = other1646.enabled; + schedule = other1646.schedule; + user = other1646.user; + query = other1646.query; + nextExecution = other1646.nextExecution; + __isset = other1646.__isset; + return *this; +} +void ScheduledQuery::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQuery("; + out << "scheduleKey=" << to_string(scheduleKey); + out << ", " << "enabled="; (__isset.enabled ? (out << to_string(enabled)) : (out << "")); + out << ", " << "schedule="; (__isset.schedule ? (out << to_string(schedule)) : (out << "")); + out << ", " << "user="; (__isset.user ? (out << to_string(user)) : (out << "")); + out << ", " << "query="; (__isset.query ? (out << to_string(query)) : (out << "")); + out << ", " << "nextExecution="; (__isset.nextExecution ? (out << to_string(nextExecution)) : (out << "")); + out << ")"; +} + + +ScheduledQueryMaintenanceRequest::~ScheduledQueryMaintenanceRequest() noexcept { +} + +ScheduledQueryMaintenanceRequest::ScheduledQueryMaintenanceRequest() noexcept + : type(static_cast(0)) { +} + +void ScheduledQueryMaintenanceRequest::__set_type(const ScheduledQueryMaintenanceRequestType::type val) { + this->type = val; +} + +void ScheduledQueryMaintenanceRequest::__set_scheduledQuery(const ScheduledQuery& val) { + this->scheduledQuery = val; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQueryMaintenanceRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQueryMaintenanceRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_type = false; + bool isset_scheduledQuery = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1647; + xfer += iprot->readI32(ecast1647); + this->type = static_cast(ecast1647); + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->scheduledQuery.read(iprot); + isset_scheduledQuery = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_scheduledQuery) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ScheduledQueryMaintenanceRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQueryMaintenanceRequest"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->type)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("scheduledQuery", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->scheduledQuery.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQueryMaintenanceRequest &a, ScheduledQueryMaintenanceRequest &b) noexcept { + using ::std::swap; + swap(a.type, b.type); + swap(a.scheduledQuery, b.scheduledQuery); +} + +bool ScheduledQueryMaintenanceRequest::operator==(const ScheduledQueryMaintenanceRequest & rhs) const +{ + if (!(type == rhs.type)) + return false; + if (!(scheduledQuery == rhs.scheduledQuery)) + return false; + return true; +} + +ScheduledQueryMaintenanceRequest::ScheduledQueryMaintenanceRequest(const ScheduledQueryMaintenanceRequest& other1648) { + type = other1648.type; + scheduledQuery = other1648.scheduledQuery; +} +ScheduledQueryMaintenanceRequest& ScheduledQueryMaintenanceRequest::operator=(const ScheduledQueryMaintenanceRequest& other1649) { + type = other1649.type; + scheduledQuery = other1649.scheduledQuery; + return *this; +} +void ScheduledQueryMaintenanceRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQueryMaintenanceRequest("; + out << "type=" << to_string(type); + out << ", " << "scheduledQuery=" << to_string(scheduledQuery); + out << ")"; +} + + +ScheduledQueryProgressInfo::~ScheduledQueryProgressInfo() noexcept { +} + +ScheduledQueryProgressInfo::ScheduledQueryProgressInfo() noexcept + : scheduledExecutionId(0), + state(static_cast(0)), + executorQueryId(), + errorMessage() { +} + +void ScheduledQueryProgressInfo::__set_scheduledExecutionId(const int64_t val) { + this->scheduledExecutionId = val; +} + +void ScheduledQueryProgressInfo::__set_state(const QueryState::type val) { + this->state = val; +} + +void ScheduledQueryProgressInfo::__set_executorQueryId(const std::string& val) { + this->executorQueryId = val; +} + +void ScheduledQueryProgressInfo::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} +std::ostream& operator<<(std::ostream& out, const ScheduledQueryProgressInfo& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ScheduledQueryProgressInfo::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_scheduledExecutionId = false; + bool isset_state = false; + bool isset_executorQueryId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->scheduledExecutionId); + isset_scheduledExecutionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1650; + xfer += iprot->readI32(ecast1650); + this->state = static_cast(ecast1650); + isset_state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->executorQueryId); + isset_executorQueryId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_scheduledExecutionId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_state) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_executorQueryId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ScheduledQueryProgressInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ScheduledQueryProgressInfo"); + + xfer += oprot->writeFieldBegin("scheduledExecutionId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->scheduledExecutionId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->state)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("executorQueryId", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->executorQueryId); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ScheduledQueryProgressInfo &a, ScheduledQueryProgressInfo &b) noexcept { + using ::std::swap; + swap(a.scheduledExecutionId, b.scheduledExecutionId); + swap(a.state, b.state); + swap(a.executorQueryId, b.executorQueryId); + swap(a.errorMessage, b.errorMessage); + swap(a.__isset, b.__isset); +} + +bool ScheduledQueryProgressInfo::operator==(const ScheduledQueryProgressInfo & rhs) const +{ + if (!(scheduledExecutionId == rhs.scheduledExecutionId)) + return false; + if (!(state == rhs.state)) + return false; + if (!(executorQueryId == rhs.executorQueryId)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + return true; +} + +ScheduledQueryProgressInfo::ScheduledQueryProgressInfo(const ScheduledQueryProgressInfo& other1651) { + scheduledExecutionId = other1651.scheduledExecutionId; + state = other1651.state; + executorQueryId = other1651.executorQueryId; + errorMessage = other1651.errorMessage; + __isset = other1651.__isset; +} +ScheduledQueryProgressInfo& ScheduledQueryProgressInfo::operator=(const ScheduledQueryProgressInfo& other1652) { + scheduledExecutionId = other1652.scheduledExecutionId; + state = other1652.state; + executorQueryId = other1652.executorQueryId; + errorMessage = other1652.errorMessage; + __isset = other1652.__isset; + return *this; +} +void ScheduledQueryProgressInfo::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ScheduledQueryProgressInfo("; + out << "scheduledExecutionId=" << to_string(scheduledExecutionId); + out << ", " << "state=" << to_string(state); + out << ", " << "executorQueryId=" << to_string(executorQueryId); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ")"; +} + + +AlterPartitionsRequest::~AlterPartitionsRequest() noexcept { +} + +AlterPartitionsRequest::AlterPartitionsRequest() noexcept + : catName(), + dbName(), + tableName(), + writeId(-1LL), + validWriteIdList(), + skipColumnSchemaForPartition(0) { +} + +void AlterPartitionsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void AlterPartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AlterPartitionsRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void AlterPartitionsRequest::__set_partitions(const std::vector & val) { + this->partitions = val; +} + +void AlterPartitionsRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} + +void AlterPartitionsRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void AlterPartitionsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void AlterPartitionsRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void AlterPartitionsRequest::__set_partitionColSchema(const std::vector & val) { + this->partitionColSchema = val; +__isset.partitionColSchema = true; +} +std::ostream& operator<<(std::ostream& out, const AlterPartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterPartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + bool isset_partitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size1653; + ::apache::thrift::protocol::TType _etype1656; + xfer += iprot->readListBegin(_etype1656, _size1653); + this->partitions.resize(_size1653); + uint32_t _i1657; + for (_i1657 = 0; _i1657 < _size1653; ++_i1657) + { + xfer += this->partitions[_i1657].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionColSchema.clear(); + uint32_t _size1658; + ::apache::thrift::protocol::TType _etype1661; + xfer += iprot->readListBegin(_etype1661, _size1658); + this->partitionColSchema.resize(_size1658); + uint32_t _i1662; + for (_i1662 = 0; _i1662 < _size1658; ++_i1662) + { + xfer += this->partitionColSchema[_i1662].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionColSchema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AlterPartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterPartitionsRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter1663; + for (_iter1663 = this->partitions.begin(); _iter1663 != this->partitions.end(); ++_iter1663) + { + xfer += (*_iter1663).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partitionColSchema) { + xfer += oprot->writeFieldBegin("partitionColSchema", ::apache::thrift::protocol::T_LIST, 9); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionColSchema.size())); + std::vector ::const_iterator _iter1664; + for (_iter1664 = this->partitionColSchema.begin(); _iter1664 != this->partitionColSchema.end(); ++_iter1664) + { + xfer += (*_iter1664).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterPartitionsRequest &a, AlterPartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partitions, b.partitions); + swap(a.environmentContext, b.environmentContext); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.partitionColSchema, b.partitionColSchema); + swap(a.__isset, b.__isset); +} + +bool AlterPartitionsRequest::operator==(const AlterPartitionsRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(partitions == rhs.partitions)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.partitionColSchema != rhs.__isset.partitionColSchema) + return false; + else if (__isset.partitionColSchema && !(partitionColSchema == rhs.partitionColSchema)) + return false; + return true; +} + +AlterPartitionsRequest::AlterPartitionsRequest(const AlterPartitionsRequest& other1665) { + catName = other1665.catName; + dbName = other1665.dbName; + tableName = other1665.tableName; + partitions = other1665.partitions; + environmentContext = other1665.environmentContext; + writeId = other1665.writeId; + validWriteIdList = other1665.validWriteIdList; + skipColumnSchemaForPartition = other1665.skipColumnSchemaForPartition; + partitionColSchema = other1665.partitionColSchema; + __isset = other1665.__isset; +} +AlterPartitionsRequest& AlterPartitionsRequest::operator=(const AlterPartitionsRequest& other1666) { + catName = other1666.catName; + dbName = other1666.dbName; + tableName = other1666.tableName; + partitions = other1666.partitions; + environmentContext = other1666.environmentContext; + writeId = other1666.writeId; + validWriteIdList = other1666.validWriteIdList; + skipColumnSchemaForPartition = other1666.skipColumnSchemaForPartition; + partitionColSchema = other1666.partitionColSchema; + __isset = other1666.__isset; + return *this; +} +void AlterPartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterPartitionsRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "partitions=" << to_string(partitions); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "partitionColSchema="; (__isset.partitionColSchema ? (out << to_string(partitionColSchema)) : (out << "")); + out << ")"; +} + + +AppendPartitionsRequest::~AppendPartitionsRequest() noexcept { +} + +AppendPartitionsRequest::AppendPartitionsRequest() noexcept + : catalogName(), + dbName(), + tableName(), + name() { +} + +void AppendPartitionsRequest::__set_catalogName(const std::string& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void AppendPartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AppendPartitionsRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void AppendPartitionsRequest::__set_name(const std::string& val) { + this->name = val; +__isset.name = true; +} + +void AppendPartitionsRequest::__set_partVals(const std::vector & val) { + this->partVals = val; +__isset.partVals = true; +} + +void AppendPartitionsRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} +std::ostream& operator<<(std::ostream& out, const AppendPartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AppendPartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partVals.clear(); + uint32_t _size1667; + ::apache::thrift::protocol::TType _etype1670; + xfer += iprot->readListBegin(_etype1670, _size1667); + this->partVals.resize(_size1667); + uint32_t _i1671; + for (_i1671 = 0; _i1671 < _size1667; ++_i1671) + { + xfer += iprot->readString(this->partVals[_i1671]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AppendPartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AppendPartitionsRequest"); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.name) { + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partVals) { + xfer += oprot->writeFieldBegin("partVals", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partVals.size())); + std::vector ::const_iterator _iter1672; + for (_iter1672 = this->partVals.begin(); _iter1672 != this->partVals.end(); ++_iter1672) + { + xfer += oprot->writeString((*_iter1672)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AppendPartitionsRequest &a, AppendPartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.catalogName, b.catalogName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.name, b.name); + swap(a.partVals, b.partVals); + swap(a.environmentContext, b.environmentContext); + swap(a.__isset, b.__isset); +} + +bool AppendPartitionsRequest::operator==(const AppendPartitionsRequest & rhs) const +{ + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (__isset.name != rhs.__isset.name) + return false; + else if (__isset.name && !(name == rhs.name)) + return false; + if (__isset.partVals != rhs.__isset.partVals) + return false; + else if (__isset.partVals && !(partVals == rhs.partVals)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + return true; +} + +AppendPartitionsRequest::AppendPartitionsRequest(const AppendPartitionsRequest& other1673) { + catalogName = other1673.catalogName; + dbName = other1673.dbName; + tableName = other1673.tableName; + name = other1673.name; + partVals = other1673.partVals; + environmentContext = other1673.environmentContext; + __isset = other1673.__isset; +} +AppendPartitionsRequest& AppendPartitionsRequest::operator=(const AppendPartitionsRequest& other1674) { + catalogName = other1674.catalogName; + dbName = other1674.dbName; + tableName = other1674.tableName; + name = other1674.name; + partVals = other1674.partVals; + environmentContext = other1674.environmentContext; + __isset = other1674.__isset; + return *this; +} +void AppendPartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AppendPartitionsRequest("; + out << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "name="; (__isset.name ? (out << to_string(name)) : (out << "")); + out << ", " << "partVals="; (__isset.partVals ? (out << to_string(partVals)) : (out << "")); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ")"; +} + + +AlterPartitionsResponse::~AlterPartitionsResponse() noexcept { +} + +AlterPartitionsResponse::AlterPartitionsResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const AlterPartitionsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterPartitionsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AlterPartitionsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterPartitionsResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterPartitionsResponse &a, AlterPartitionsResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool AlterPartitionsResponse::operator==(const AlterPartitionsResponse & /* rhs */) const +{ + return true; +} + +AlterPartitionsResponse::AlterPartitionsResponse(const AlterPartitionsResponse& other1675) noexcept { + (void) other1675; +} +AlterPartitionsResponse& AlterPartitionsResponse::operator=(const AlterPartitionsResponse& other1676) noexcept { + (void) other1676; + return *this; +} +void AlterPartitionsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterPartitionsResponse("; + out << ")"; +} + + +RenamePartitionRequest::~RenamePartitionRequest() noexcept { +} + +RenamePartitionRequest::RenamePartitionRequest() noexcept + : catName(), + dbName(), + tableName(), + validWriteIdList(), + txnId(0), + clonePart(0) { +} + +void RenamePartitionRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void RenamePartitionRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void RenamePartitionRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void RenamePartitionRequest::__set_partVals(const std::vector & val) { + this->partVals = val; +} + +void RenamePartitionRequest::__set_newPart(const Partition& val) { + this->newPart = val; +} + +void RenamePartitionRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void RenamePartitionRequest::__set_txnId(const int64_t val) { + this->txnId = val; +__isset.txnId = true; +} + +void RenamePartitionRequest::__set_clonePart(const bool val) { + this->clonePart = val; +__isset.clonePart = true; +} +std::ostream& operator<<(std::ostream& out, const RenamePartitionRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t RenamePartitionRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + bool isset_partVals = false; + bool isset_newPart = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partVals.clear(); + uint32_t _size1677; + ::apache::thrift::protocol::TType _etype1680; + xfer += iprot->readListBegin(_etype1680, _size1677); + this->partVals.resize(_size1677); + uint32_t _i1681; + for (_i1681 = 0; _i1681 < _size1677; ++_i1681) + { + xfer += iprot->readString(this->partVals[_i1681]); + } + xfer += iprot->readListEnd(); + } + isset_partVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->newPart.read(iprot); + isset_newPart = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + this->__isset.txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->clonePart); + this->__isset.clonePart = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partVals) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_newPart) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t RenamePartitionRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("RenamePartitionRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partVals", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partVals.size())); + std::vector ::const_iterator _iter1682; + for (_iter1682 = this->partVals.begin(); _iter1682 != this->partVals.end(); ++_iter1682) + { + xfer += oprot->writeString((*_iter1682)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("newPart", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->newPart.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.txnId) { + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.clonePart) { + xfer += oprot->writeFieldBegin("clonePart", ::apache::thrift::protocol::T_BOOL, 8); + xfer += oprot->writeBool(this->clonePart); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(RenamePartitionRequest &a, RenamePartitionRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.partVals, b.partVals); + swap(a.newPart, b.newPart); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.txnId, b.txnId); + swap(a.clonePart, b.clonePart); + swap(a.__isset, b.__isset); +} + +bool RenamePartitionRequest::operator==(const RenamePartitionRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(partVals == rhs.partVals)) + return false; + if (!(newPart == rhs.newPart)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.txnId != rhs.__isset.txnId) + return false; + else if (__isset.txnId && !(txnId == rhs.txnId)) + return false; + if (__isset.clonePart != rhs.__isset.clonePart) + return false; + else if (__isset.clonePart && !(clonePart == rhs.clonePart)) + return false; + return true; +} + +RenamePartitionRequest::RenamePartitionRequest(const RenamePartitionRequest& other1683) { + catName = other1683.catName; + dbName = other1683.dbName; + tableName = other1683.tableName; + partVals = other1683.partVals; + newPart = other1683.newPart; + validWriteIdList = other1683.validWriteIdList; + txnId = other1683.txnId; + clonePart = other1683.clonePart; + __isset = other1683.__isset; +} +RenamePartitionRequest& RenamePartitionRequest::operator=(const RenamePartitionRequest& other1684) { + catName = other1684.catName; + dbName = other1684.dbName; + tableName = other1684.tableName; + partVals = other1684.partVals; + newPart = other1684.newPart; + validWriteIdList = other1684.validWriteIdList; + txnId = other1684.txnId; + clonePart = other1684.clonePart; + __isset = other1684.__isset; + return *this; +} +void RenamePartitionRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "RenamePartitionRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "partVals=" << to_string(partVals); + out << ", " << "newPart=" << to_string(newPart); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "txnId="; (__isset.txnId ? (out << to_string(txnId)) : (out << "")); + out << ", " << "clonePart="; (__isset.clonePart ? (out << to_string(clonePart)) : (out << "")); + out << ")"; +} + + +RenamePartitionResponse::~RenamePartitionResponse() noexcept { +} + +RenamePartitionResponse::RenamePartitionResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const RenamePartitionResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t RenamePartitionResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t RenamePartitionResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("RenamePartitionResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(RenamePartitionResponse &a, RenamePartitionResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool RenamePartitionResponse::operator==(const RenamePartitionResponse & /* rhs */) const +{ + return true; +} + +RenamePartitionResponse::RenamePartitionResponse(const RenamePartitionResponse& other1685) noexcept { + (void) other1685; +} +RenamePartitionResponse& RenamePartitionResponse::operator=(const RenamePartitionResponse& other1686) noexcept { + (void) other1686; + return *this; +} +void RenamePartitionResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "RenamePartitionResponse("; + out << ")"; +} + + +AlterTableRequest::~AlterTableRequest() noexcept { +} + +AlterTableRequest::AlterTableRequest() noexcept + : catName(), + dbName(), + tableName(), + writeId(-1LL), + validWriteIdList(), + processorIdentifier(), + expectedParameterKey(), + expectedParameterValue() { +} + +void AlterTableRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void AlterTableRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AlterTableRequest::__set_tableName(const std::string& val) { + this->tableName = val; +} + +void AlterTableRequest::__set_table(const Table& val) { + this->table = val; +} + +void AlterTableRequest::__set_environmentContext(const EnvironmentContext& val) { + this->environmentContext = val; +__isset.environmentContext = true; +} + +void AlterTableRequest::__set_writeId(const int64_t val) { + this->writeId = val; +__isset.writeId = true; +} + +void AlterTableRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void AlterTableRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void AlterTableRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} + +void AlterTableRequest::__set_expectedParameterKey(const std::string& val) { + this->expectedParameterKey = val; +__isset.expectedParameterKey = true; +} + +void AlterTableRequest::__set_expectedParameterValue(const std::string& val) { + this->expectedParameterValue = val; +__isset.expectedParameterValue = true; +} +std::ostream& operator<<(std::ostream& out, const AlterTableRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterTableRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tableName = false; + bool isset_table = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + isset_tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->table.read(iprot); + isset_table = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->environmentContext.read(iprot); + this->__isset.environmentContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->writeId); + this->__isset.writeId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1687; + ::apache::thrift::protocol::TType _etype1690; + xfer += iprot->readListBegin(_etype1690, _size1687); + this->processorCapabilities.resize(_size1687); + uint32_t _i1691; + for (_i1691 = 0; _i1691 < _size1687; ++_i1691) + { + xfer += iprot->readString(this->processorCapabilities[_i1691]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->expectedParameterKey); + this->__isset.expectedParameterKey = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->expectedParameterValue); + this->__isset.expectedParameterValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tableName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_table) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AlterTableRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterTableRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("table", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->table.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.environmentContext) { + xfer += oprot->writeFieldBegin("environmentContext", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->environmentContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.writeId) { + xfer += oprot->writeFieldBegin("writeId", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->writeId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1692; + for (_iter1692 = this->processorCapabilities.begin(); _iter1692 != this->processorCapabilities.end(); ++_iter1692) + { + xfer += oprot->writeString((*_iter1692)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.expectedParameterKey) { + xfer += oprot->writeFieldBegin("expectedParameterKey", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->expectedParameterKey); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.expectedParameterValue) { + xfer += oprot->writeFieldBegin("expectedParameterValue", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->expectedParameterValue); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterTableRequest &a, AlterTableRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.table, b.table); + swap(a.environmentContext, b.environmentContext); + swap(a.writeId, b.writeId); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.expectedParameterKey, b.expectedParameterKey); + swap(a.expectedParameterValue, b.expectedParameterValue); + swap(a.__isset, b.__isset); +} + +bool AlterTableRequest::operator==(const AlterTableRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tableName == rhs.tableName)) + return false; + if (!(table == rhs.table)) + return false; + if (__isset.environmentContext != rhs.__isset.environmentContext) + return false; + else if (__isset.environmentContext && !(environmentContext == rhs.environmentContext)) + return false; + if (__isset.writeId != rhs.__isset.writeId) + return false; + else if (__isset.writeId && !(writeId == rhs.writeId)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + if (__isset.expectedParameterKey != rhs.__isset.expectedParameterKey) + return false; + else if (__isset.expectedParameterKey && !(expectedParameterKey == rhs.expectedParameterKey)) + return false; + if (__isset.expectedParameterValue != rhs.__isset.expectedParameterValue) + return false; + else if (__isset.expectedParameterValue && !(expectedParameterValue == rhs.expectedParameterValue)) + return false; + return true; +} + +AlterTableRequest::AlterTableRequest(const AlterTableRequest& other1693) { + catName = other1693.catName; + dbName = other1693.dbName; + tableName = other1693.tableName; + table = other1693.table; + environmentContext = other1693.environmentContext; + writeId = other1693.writeId; + validWriteIdList = other1693.validWriteIdList; + processorCapabilities = other1693.processorCapabilities; + processorIdentifier = other1693.processorIdentifier; + expectedParameterKey = other1693.expectedParameterKey; + expectedParameterValue = other1693.expectedParameterValue; + __isset = other1693.__isset; +} +AlterTableRequest& AlterTableRequest::operator=(const AlterTableRequest& other1694) { + catName = other1694.catName; + dbName = other1694.dbName; + tableName = other1694.tableName; + table = other1694.table; + environmentContext = other1694.environmentContext; + writeId = other1694.writeId; + validWriteIdList = other1694.validWriteIdList; + processorCapabilities = other1694.processorCapabilities; + processorIdentifier = other1694.processorIdentifier; + expectedParameterKey = other1694.expectedParameterKey; + expectedParameterValue = other1694.expectedParameterValue; + __isset = other1694.__isset; + return *this; +} +void AlterTableRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterTableRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tableName=" << to_string(tableName); + out << ", " << "table=" << to_string(table); + out << ", " << "environmentContext="; (__isset.environmentContext ? (out << to_string(environmentContext)) : (out << "")); + out << ", " << "writeId="; (__isset.writeId ? (out << to_string(writeId)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ", " << "expectedParameterKey="; (__isset.expectedParameterKey ? (out << to_string(expectedParameterKey)) : (out << "")); + out << ", " << "expectedParameterValue="; (__isset.expectedParameterValue ? (out << to_string(expectedParameterValue)) : (out << "")); + out << ")"; +} + + +AlterTableResponse::~AlterTableResponse() noexcept { +} + +AlterTableResponse::AlterTableResponse() noexcept { +} +std::ostream& operator<<(std::ostream& out, const AlterTableResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlterTableResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AlterTableResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlterTableResponse"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlterTableResponse &a, AlterTableResponse &b) noexcept { + using ::std::swap; + (void) a; + (void) b; +} + +bool AlterTableResponse::operator==(const AlterTableResponse & /* rhs */) const +{ + return true; +} + +AlterTableResponse::AlterTableResponse(const AlterTableResponse& other1695) noexcept { + (void) other1695; +} +AlterTableResponse& AlterTableResponse::operator=(const AlterTableResponse& other1696) noexcept { + (void) other1696; + return *this; +} +void AlterTableResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlterTableResponse("; + out << ")"; +} + + +GetPartitionsFilterSpec::~GetPartitionsFilterSpec() noexcept { +} + +GetPartitionsFilterSpec::GetPartitionsFilterSpec() noexcept + : filterMode(static_cast(0)) { +} + +void GetPartitionsFilterSpec::__set_filterMode(const PartitionFilterMode::type val) { + this->filterMode = val; +__isset.filterMode = true; +} + +void GetPartitionsFilterSpec::__set_filters(const std::vector & val) { + this->filters = val; +__isset.filters = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsFilterSpec& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsFilterSpec::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 7: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast1697; + xfer += iprot->readI32(ecast1697); + this->filterMode = static_cast(ecast1697); + this->__isset.filterMode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->filters.clear(); + uint32_t _size1698; + ::apache::thrift::protocol::TType _etype1701; + xfer += iprot->readListBegin(_etype1701, _size1698); + this->filters.resize(_size1698); + uint32_t _i1702; + for (_i1702 = 0; _i1702 < _size1698; ++_i1702) + { + xfer += iprot->readString(this->filters[_i1702]); + } + xfer += iprot->readListEnd(); + } + this->__isset.filters = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetPartitionsFilterSpec::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsFilterSpec"); + + if (this->__isset.filterMode) { + xfer += oprot->writeFieldBegin("filterMode", ::apache::thrift::protocol::T_I32, 7); + xfer += oprot->writeI32(static_cast(this->filterMode)); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.filters) { + xfer += oprot->writeFieldBegin("filters", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->filters.size())); + std::vector ::const_iterator _iter1703; + for (_iter1703 = this->filters.begin(); _iter1703 != this->filters.end(); ++_iter1703) + { + xfer += oprot->writeString((*_iter1703)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsFilterSpec &a, GetPartitionsFilterSpec &b) noexcept { + using ::std::swap; + swap(a.filterMode, b.filterMode); + swap(a.filters, b.filters); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsFilterSpec::operator==(const GetPartitionsFilterSpec & rhs) const +{ + if (__isset.filterMode != rhs.__isset.filterMode) + return false; + else if (__isset.filterMode && !(filterMode == rhs.filterMode)) + return false; + if (__isset.filters != rhs.__isset.filters) + return false; + else if (__isset.filters && !(filters == rhs.filters)) + return false; + return true; +} + +GetPartitionsFilterSpec::GetPartitionsFilterSpec(const GetPartitionsFilterSpec& other1704) { + filterMode = other1704.filterMode; + filters = other1704.filters; + __isset = other1704.__isset; +} +GetPartitionsFilterSpec& GetPartitionsFilterSpec::operator=(const GetPartitionsFilterSpec& other1705) { + filterMode = other1705.filterMode; + filters = other1705.filters; + __isset = other1705.__isset; + return *this; +} +void GetPartitionsFilterSpec::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsFilterSpec("; + out << "filterMode="; (__isset.filterMode ? (out << to_string(filterMode)) : (out << "")); + out << ", " << "filters="; (__isset.filters ? (out << to_string(filters)) : (out << "")); + out << ")"; +} + + +GetPartitionsResponse::~GetPartitionsResponse() noexcept { +} + +GetPartitionsResponse::GetPartitionsResponse() noexcept { +} + +void GetPartitionsResponse::__set_partitionSpec(const std::vector & val) { + this->partitionSpec = val; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitionSpec.clear(); + uint32_t _size1706; + ::apache::thrift::protocol::TType _etype1709; + xfer += iprot->readListBegin(_etype1709, _size1706); + this->partitionSpec.resize(_size1706); + uint32_t _i1710; + for (_i1710 = 0; _i1710 < _size1706; ++_i1710) + { + xfer += this->partitionSpec[_i1710].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.partitionSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetPartitionsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsResponse"); + + xfer += oprot->writeFieldBegin("partitionSpec", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitionSpec.size())); + std::vector ::const_iterator _iter1711; + for (_iter1711 = this->partitionSpec.begin(); _iter1711 != this->partitionSpec.end(); ++_iter1711) + { + xfer += (*_iter1711).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsResponse &a, GetPartitionsResponse &b) noexcept { + using ::std::swap; + swap(a.partitionSpec, b.partitionSpec); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsResponse::operator==(const GetPartitionsResponse & rhs) const +{ + if (!(partitionSpec == rhs.partitionSpec)) + return false; + return true; +} + +GetPartitionsResponse::GetPartitionsResponse(const GetPartitionsResponse& other1712) { + partitionSpec = other1712.partitionSpec; + __isset = other1712.__isset; +} +GetPartitionsResponse& GetPartitionsResponse::operator=(const GetPartitionsResponse& other1713) { + partitionSpec = other1713.partitionSpec; + __isset = other1713.__isset; + return *this; +} +void GetPartitionsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsResponse("; + out << "partitionSpec=" << to_string(partitionSpec); + out << ")"; +} + + +GetPartitionsRequest::~GetPartitionsRequest() noexcept { +} + +GetPartitionsRequest::GetPartitionsRequest() noexcept + : catName(), + dbName(), + tblName(), + withAuth(0), + user(), + processorIdentifier(), + validWriteIdList() { +} + +void GetPartitionsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetPartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPartitionsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetPartitionsRequest::__set_withAuth(const bool val) { + this->withAuth = val; +__isset.withAuth = true; +} + +void GetPartitionsRequest::__set_user(const std::string& val) { + this->user = val; +__isset.user = true; +} + +void GetPartitionsRequest::__set_groupNames(const std::vector & val) { + this->groupNames = val; +__isset.groupNames = true; +} + +void GetPartitionsRequest::__set_projectionSpec(const GetProjectionsSpec& val) { + this->projectionSpec = val; +} + +void GetPartitionsRequest::__set_filterSpec(const GetPartitionsFilterSpec& val) { + this->filterSpec = val; +} + +void GetPartitionsRequest::__set_processorCapabilities(const std::vector & val) { + this->processorCapabilities = val; +__isset.processorCapabilities = true; +} + +void GetPartitionsRequest::__set_processorIdentifier(const std::string& val) { + this->processorIdentifier = val; +__isset.processorIdentifier = true; +} + +void GetPartitionsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + this->__isset.tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->withAuth); + this->__isset.withAuth = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->user); + this->__isset.user = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->groupNames.clear(); + uint32_t _size1714; + ::apache::thrift::protocol::TType _etype1717; + xfer += iprot->readListBegin(_etype1717, _size1714); + this->groupNames.resize(_size1714); + uint32_t _i1718; + for (_i1718 = 0; _i1718 < _size1714; ++_i1718) + { + xfer += iprot->readString(this->groupNames[_i1718]); + } + xfer += iprot->readListEnd(); + } + this->__isset.groupNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->projectionSpec.read(iprot); + this->__isset.projectionSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->filterSpec.read(iprot); + this->__isset.filterSpec = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->processorCapabilities.clear(); + uint32_t _size1719; + ::apache::thrift::protocol::TType _etype1722; + xfer += iprot->readListBegin(_etype1722, _size1719); + this->processorCapabilities.resize(_size1719); + uint32_t _i1723; + for (_i1723 = 0; _i1723 < _size1719; ++_i1723) + { + xfer += iprot->readString(this->processorCapabilities[_i1723]); + } + xfer += iprot->readListEnd(); + } + this->__isset.processorCapabilities = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->processorIdentifier); + this->__isset.processorIdentifier = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetPartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.withAuth) { + xfer += oprot->writeFieldBegin("withAuth", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->withAuth); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.user) { + xfer += oprot->writeFieldBegin("user", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->user); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.groupNames) { + xfer += oprot->writeFieldBegin("groupNames", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->groupNames.size())); + std::vector ::const_iterator _iter1724; + for (_iter1724 = this->groupNames.begin(); _iter1724 != this->groupNames.end(); ++_iter1724) + { + xfer += oprot->writeString((*_iter1724)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("projectionSpec", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->projectionSpec.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filterSpec", ::apache::thrift::protocol::T_STRUCT, 8); + xfer += this->filterSpec.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.processorCapabilities) { + xfer += oprot->writeFieldBegin("processorCapabilities", ::apache::thrift::protocol::T_LIST, 9); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->processorCapabilities.size())); + std::vector ::const_iterator _iter1725; + for (_iter1725 = this->processorCapabilities.begin(); _iter1725 != this->processorCapabilities.end(); ++_iter1725) + { + xfer += oprot->writeString((*_iter1725)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.processorIdentifier) { + xfer += oprot->writeFieldBegin("processorIdentifier", ::apache::thrift::protocol::T_STRING, 10); + xfer += oprot->writeString(this->processorIdentifier); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsRequest &a, GetPartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.withAuth, b.withAuth); + swap(a.user, b.user); + swap(a.groupNames, b.groupNames); + swap(a.projectionSpec, b.projectionSpec); + swap(a.filterSpec, b.filterSpec); + swap(a.processorCapabilities, b.processorCapabilities); + swap(a.processorIdentifier, b.processorIdentifier); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsRequest::operator==(const GetPartitionsRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.withAuth != rhs.__isset.withAuth) + return false; + else if (__isset.withAuth && !(withAuth == rhs.withAuth)) + return false; + if (__isset.user != rhs.__isset.user) + return false; + else if (__isset.user && !(user == rhs.user)) + return false; + if (__isset.groupNames != rhs.__isset.groupNames) + return false; + else if (__isset.groupNames && !(groupNames == rhs.groupNames)) + return false; + if (!(projectionSpec == rhs.projectionSpec)) + return false; + if (!(filterSpec == rhs.filterSpec)) + return false; + if (__isset.processorCapabilities != rhs.__isset.processorCapabilities) + return false; + else if (__isset.processorCapabilities && !(processorCapabilities == rhs.processorCapabilities)) + return false; + if (__isset.processorIdentifier != rhs.__isset.processorIdentifier) + return false; + else if (__isset.processorIdentifier && !(processorIdentifier == rhs.processorIdentifier)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + return true; +} + +GetPartitionsRequest::GetPartitionsRequest(const GetPartitionsRequest& other1726) { + catName = other1726.catName; + dbName = other1726.dbName; + tblName = other1726.tblName; + withAuth = other1726.withAuth; + user = other1726.user; + groupNames = other1726.groupNames; + projectionSpec = other1726.projectionSpec; + filterSpec = other1726.filterSpec; + processorCapabilities = other1726.processorCapabilities; + processorIdentifier = other1726.processorIdentifier; + validWriteIdList = other1726.validWriteIdList; + __isset = other1726.__isset; +} +GetPartitionsRequest& GetPartitionsRequest::operator=(const GetPartitionsRequest& other1727) { + catName = other1727.catName; + dbName = other1727.dbName; + tblName = other1727.tblName; + withAuth = other1727.withAuth; + user = other1727.user; + groupNames = other1727.groupNames; + projectionSpec = other1727.projectionSpec; + filterSpec = other1727.filterSpec; + processorCapabilities = other1727.processorCapabilities; + processorIdentifier = other1727.processorIdentifier; + validWriteIdList = other1727.validWriteIdList; + __isset = other1727.__isset; + return *this; +} +void GetPartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "withAuth="; (__isset.withAuth ? (out << to_string(withAuth)) : (out << "")); + out << ", " << "user="; (__isset.user ? (out << to_string(user)) : (out << "")); + out << ", " << "groupNames="; (__isset.groupNames ? (out << to_string(groupNames)) : (out << "")); + out << ", " << "projectionSpec=" << to_string(projectionSpec); + out << ", " << "filterSpec=" << to_string(filterSpec); + out << ", " << "processorCapabilities="; (__isset.processorCapabilities ? (out << to_string(processorCapabilities)) : (out << "")); + out << ", " << "processorIdentifier="; (__isset.processorIdentifier ? (out << to_string(processorIdentifier)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ")"; +} + + +GetFieldsRequest::~GetFieldsRequest() noexcept { +} + +GetFieldsRequest::GetFieldsRequest() noexcept + : catName(), + dbName(), + tblName(), + validWriteIdList(), + id(-1LL) { +} + +void GetFieldsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetFieldsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetFieldsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetFieldsRequest::__set_envContext(const EnvironmentContext& val) { + this->envContext = val; +__isset.envContext = true; +} + +void GetFieldsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetFieldsRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const GetFieldsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFieldsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->envContext.read(iprot); + this->__isset.envContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFieldsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFieldsRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.envContext) { + xfer += oprot->writeFieldBegin("envContext", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->envContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFieldsRequest &a, GetFieldsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.envContext, b.envContext); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool GetFieldsRequest::operator==(const GetFieldsRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.envContext != rhs.__isset.envContext) + return false; + else if (__isset.envContext && !(envContext == rhs.envContext)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +GetFieldsRequest::GetFieldsRequest(const GetFieldsRequest& other1728) { + catName = other1728.catName; + dbName = other1728.dbName; + tblName = other1728.tblName; + envContext = other1728.envContext; + validWriteIdList = other1728.validWriteIdList; + id = other1728.id; + __isset = other1728.__isset; +} +GetFieldsRequest& GetFieldsRequest::operator=(const GetFieldsRequest& other1729) { + catName = other1729.catName; + dbName = other1729.dbName; + tblName = other1729.tblName; + envContext = other1729.envContext; + validWriteIdList = other1729.validWriteIdList; + id = other1729.id; + __isset = other1729.__isset; + return *this; +} +void GetFieldsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFieldsRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "envContext="; (__isset.envContext ? (out << to_string(envContext)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +GetFieldsResponse::~GetFieldsResponse() noexcept { +} + +GetFieldsResponse::GetFieldsResponse() noexcept { +} + +void GetFieldsResponse::__set_fields(const std::vector & val) { + this->fields = val; +} +std::ostream& operator<<(std::ostream& out, const GetFieldsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetFieldsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fields = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fields.clear(); + uint32_t _size1730; + ::apache::thrift::protocol::TType _etype1733; + xfer += iprot->readListBegin(_etype1733, _size1730); + this->fields.resize(_size1730); + uint32_t _i1734; + for (_i1734 = 0; _i1734 < _size1730; ++_i1734) + { + xfer += this->fields[_i1734].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_fields = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fields) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetFieldsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetFieldsResponse"); + + xfer += oprot->writeFieldBegin("fields", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->fields.size())); + std::vector ::const_iterator _iter1735; + for (_iter1735 = this->fields.begin(); _iter1735 != this->fields.end(); ++_iter1735) + { + xfer += (*_iter1735).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetFieldsResponse &a, GetFieldsResponse &b) noexcept { + using ::std::swap; + swap(a.fields, b.fields); +} + +bool GetFieldsResponse::operator==(const GetFieldsResponse & rhs) const +{ + if (!(fields == rhs.fields)) + return false; + return true; +} + +GetFieldsResponse::GetFieldsResponse(const GetFieldsResponse& other1736) { + fields = other1736.fields; +} +GetFieldsResponse& GetFieldsResponse::operator=(const GetFieldsResponse& other1737) { + fields = other1737.fields; + return *this; +} +void GetFieldsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetFieldsResponse("; + out << "fields=" << to_string(fields); + out << ")"; +} + + +GetSchemaRequest::~GetSchemaRequest() noexcept { +} + +GetSchemaRequest::GetSchemaRequest() noexcept + : catName(), + dbName(), + tblName(), + validWriteIdList(), + id(-1LL) { +} + +void GetSchemaRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetSchemaRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetSchemaRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetSchemaRequest::__set_envContext(const EnvironmentContext& val) { + this->envContext = val; +__isset.envContext = true; +} + +void GetSchemaRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetSchemaRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const GetSchemaRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetSchemaRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->envContext.read(iprot); + this->__isset.envContext = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetSchemaRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetSchemaRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.envContext) { + xfer += oprot->writeFieldBegin("envContext", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->envContext.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetSchemaRequest &a, GetSchemaRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.envContext, b.envContext); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool GetSchemaRequest::operator==(const GetSchemaRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.envContext != rhs.__isset.envContext) + return false; + else if (__isset.envContext && !(envContext == rhs.envContext)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +GetSchemaRequest::GetSchemaRequest(const GetSchemaRequest& other1738) { + catName = other1738.catName; + dbName = other1738.dbName; + tblName = other1738.tblName; + envContext = other1738.envContext; + validWriteIdList = other1738.validWriteIdList; + id = other1738.id; + __isset = other1738.__isset; +} +GetSchemaRequest& GetSchemaRequest::operator=(const GetSchemaRequest& other1739) { + catName = other1739.catName; + dbName = other1739.dbName; + tblName = other1739.tblName; + envContext = other1739.envContext; + validWriteIdList = other1739.validWriteIdList; + id = other1739.id; + __isset = other1739.__isset; + return *this; +} +void GetSchemaRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetSchemaRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "envContext="; (__isset.envContext ? (out << to_string(envContext)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +GetSchemaResponse::~GetSchemaResponse() noexcept { +} + +GetSchemaResponse::GetSchemaResponse() noexcept { +} + +void GetSchemaResponse::__set_fields(const std::vector & val) { + this->fields = val; +} +std::ostream& operator<<(std::ostream& out, const GetSchemaResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetSchemaResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_fields = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->fields.clear(); + uint32_t _size1740; + ::apache::thrift::protocol::TType _etype1743; + xfer += iprot->readListBegin(_etype1743, _size1740); + this->fields.resize(_size1740); + uint32_t _i1744; + for (_i1744 = 0; _i1744 < _size1740; ++_i1744) + { + xfer += this->fields[_i1744].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_fields = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_fields) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetSchemaResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetSchemaResponse"); + + xfer += oprot->writeFieldBegin("fields", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->fields.size())); + std::vector ::const_iterator _iter1745; + for (_iter1745 = this->fields.begin(); _iter1745 != this->fields.end(); ++_iter1745) + { + xfer += (*_iter1745).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetSchemaResponse &a, GetSchemaResponse &b) noexcept { + using ::std::swap; + swap(a.fields, b.fields); +} + +bool GetSchemaResponse::operator==(const GetSchemaResponse & rhs) const +{ + if (!(fields == rhs.fields)) + return false; + return true; +} + +GetSchemaResponse::GetSchemaResponse(const GetSchemaResponse& other1746) { + fields = other1746.fields; +} +GetSchemaResponse& GetSchemaResponse::operator=(const GetSchemaResponse& other1747) { + fields = other1747.fields; + return *this; +} +void GetSchemaResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetSchemaResponse("; + out << "fields=" << to_string(fields); + out << ")"; +} + + +GetPartitionRequest::~GetPartitionRequest() noexcept { +} + +GetPartitionRequest::GetPartitionRequest() noexcept + : catName(), + dbName(), + tblName(), + validWriteIdList(), + id(-1LL) { +} + +void GetPartitionRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetPartitionRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPartitionRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetPartitionRequest::__set_partVals(const std::vector & val) { + this->partVals = val; +} + +void GetPartitionRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetPartitionRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + bool isset_partVals = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partVals.clear(); + uint32_t _size1748; + ::apache::thrift::protocol::TType _etype1751; + xfer += iprot->readListBegin(_etype1751, _size1748); + this->partVals.resize(_size1748); + uint32_t _i1752; + for (_i1752 = 0; _i1752 < _size1748; ++_i1752) + { + xfer += iprot->readString(this->partVals[_i1752]); + } + xfer += iprot->readListEnd(); + } + isset_partVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_partVals) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("partVals", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partVals.size())); + std::vector ::const_iterator _iter1753; + for (_iter1753 = this->partVals.begin(); _iter1753 != this->partVals.end(); ++_iter1753) + { + xfer += oprot->writeString((*_iter1753)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionRequest &a, GetPartitionRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partVals, b.partVals); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool GetPartitionRequest::operator==(const GetPartitionRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(partVals == rhs.partVals)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +GetPartitionRequest::GetPartitionRequest(const GetPartitionRequest& other1754) { + catName = other1754.catName; + dbName = other1754.dbName; + tblName = other1754.tblName; + partVals = other1754.partVals; + validWriteIdList = other1754.validWriteIdList; + id = other1754.id; + __isset = other1754.__isset; +} +GetPartitionRequest& GetPartitionRequest::operator=(const GetPartitionRequest& other1755) { + catName = other1755.catName; + dbName = other1755.dbName; + tblName = other1755.tblName; + partVals = other1755.partVals; + validWriteIdList = other1755.validWriteIdList; + id = other1755.id; + __isset = other1755.__isset; + return *this; +} +void GetPartitionRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partVals=" << to_string(partVals); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +GetPartitionResponse::~GetPartitionResponse() noexcept { +} + +GetPartitionResponse::GetPartitionResponse() noexcept { +} + +void GetPartitionResponse::__set_partition(const Partition& val) { + this->partition = val; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partition = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->partition.read(iprot); + isset_partition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partition) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionResponse"); + + xfer += oprot->writeFieldBegin("partition", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->partition.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionResponse &a, GetPartitionResponse &b) noexcept { + using ::std::swap; + swap(a.partition, b.partition); +} + +bool GetPartitionResponse::operator==(const GetPartitionResponse & rhs) const +{ + if (!(partition == rhs.partition)) + return false; + return true; +} + +GetPartitionResponse::GetPartitionResponse(const GetPartitionResponse& other1756) { + partition = other1756.partition; +} +GetPartitionResponse& GetPartitionResponse::operator=(const GetPartitionResponse& other1757) { + partition = other1757.partition; + return *this; +} +void GetPartitionResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionResponse("; + out << "partition=" << to_string(partition); + out << ")"; +} + + +PartitionsRequest::~PartitionsRequest() noexcept { +} + +PartitionsRequest::PartitionsRequest() noexcept + : catName(), + dbName(), + tblName(), + maxParts(-1), + validWriteIdList(), + id(-1LL), + skipColumnSchemaForPartition(0), + includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void PartitionsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void PartitionsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void PartitionsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void PartitionsRequest::__set_maxParts(const int16_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void PartitionsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void PartitionsRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void PartitionsRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void PartitionsRequest::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +__isset.includeParamKeyPattern = true; +} + +void PartitionsRequest::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +__isset.excludeParamKeyPattern = true; +} +std::ostream& operator<<(std::ostream& out, const PartitionsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 7); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeParamKeyPattern) { + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.excludeParamKeyPattern) { + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 9); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsRequest &a, PartitionsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.maxParts, b.maxParts); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.__isset, b.__isset); +} + +bool PartitionsRequest::operator==(const PartitionsRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.includeParamKeyPattern != rhs.__isset.includeParamKeyPattern) + return false; + else if (__isset.includeParamKeyPattern && !(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (__isset.excludeParamKeyPattern != rhs.__isset.excludeParamKeyPattern) + return false; + else if (__isset.excludeParamKeyPattern && !(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + return true; +} + +PartitionsRequest::PartitionsRequest(const PartitionsRequest& other1758) { + catName = other1758.catName; + dbName = other1758.dbName; + tblName = other1758.tblName; + maxParts = other1758.maxParts; + validWriteIdList = other1758.validWriteIdList; + id = other1758.id; + skipColumnSchemaForPartition = other1758.skipColumnSchemaForPartition; + includeParamKeyPattern = other1758.includeParamKeyPattern; + excludeParamKeyPattern = other1758.excludeParamKeyPattern; + __isset = other1758.__isset; +} +PartitionsRequest& PartitionsRequest::operator=(const PartitionsRequest& other1759) { + catName = other1759.catName; + dbName = other1759.dbName; + tblName = other1759.tblName; + maxParts = other1759.maxParts; + validWriteIdList = other1759.validWriteIdList; + id = other1759.id; + skipColumnSchemaForPartition = other1759.skipColumnSchemaForPartition; + includeParamKeyPattern = other1759.includeParamKeyPattern; + excludeParamKeyPattern = other1759.excludeParamKeyPattern; + __isset = other1759.__isset; + return *this; +} +void PartitionsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "includeParamKeyPattern="; (__isset.includeParamKeyPattern ? (out << to_string(includeParamKeyPattern)) : (out << "")); + out << ", " << "excludeParamKeyPattern="; (__isset.excludeParamKeyPattern ? (out << to_string(excludeParamKeyPattern)) : (out << "")); + out << ")"; +} + + +PartitionsResponse::~PartitionsResponse() noexcept { +} + +PartitionsResponse::PartitionsResponse() noexcept { +} + +void PartitionsResponse::__set_partitions(const std::vector & val) { + this->partitions = val; +} +std::ostream& operator<<(std::ostream& out, const PartitionsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t PartitionsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size1760; + ::apache::thrift::protocol::TType _etype1763; + xfer += iprot->readListBegin(_etype1763, _size1760); + this->partitions.resize(_size1760); + uint32_t _i1764; + for (_i1764 = 0; _i1764 < _size1760; ++_i1764) + { + xfer += this->partitions[_i1764].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t PartitionsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("PartitionsResponse"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter1765; + for (_iter1765 = this->partitions.begin(); _iter1765 != this->partitions.end(); ++_iter1765) + { + xfer += (*_iter1765).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(PartitionsResponse &a, PartitionsResponse &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); +} + +bool PartitionsResponse::operator==(const PartitionsResponse & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + return true; +} + +PartitionsResponse::PartitionsResponse(const PartitionsResponse& other1766) { + partitions = other1766.partitions; +} +PartitionsResponse& PartitionsResponse::operator=(const PartitionsResponse& other1767) { + partitions = other1767.partitions; + return *this; +} +void PartitionsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "PartitionsResponse("; + out << "partitions=" << to_string(partitions); + out << ")"; +} + + +GetPartitionsByFilterRequest::~GetPartitionsByFilterRequest() noexcept { +} + +GetPartitionsByFilterRequest::GetPartitionsByFilterRequest() noexcept + : catName(), + dbName(), + tblName(), + filter(), + maxParts(-1), + skipColumnSchemaForPartition(0), + includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void GetPartitionsByFilterRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetPartitionsByFilterRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPartitionsByFilterRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetPartitionsByFilterRequest::__set_filter(const std::string& val) { + this->filter = val; +} + +void GetPartitionsByFilterRequest::__set_maxParts(const int16_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void GetPartitionsByFilterRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void GetPartitionsByFilterRequest::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +__isset.includeParamKeyPattern = true; +} + +void GetPartitionsByFilterRequest::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +__isset.excludeParamKeyPattern = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsByFilterRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsByFilterRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + this->__isset.tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetPartitionsByFilterRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsByFilterRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I16, 5); + xfer += oprot->writeI16(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeParamKeyPattern) { + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.excludeParamKeyPattern) { + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsByFilterRequest &a, GetPartitionsByFilterRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.filter, b.filter); + swap(a.maxParts, b.maxParts); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsByFilterRequest::operator==(const GetPartitionsByFilterRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (!(filter == rhs.filter)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.includeParamKeyPattern != rhs.__isset.includeParamKeyPattern) + return false; + else if (__isset.includeParamKeyPattern && !(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (__isset.excludeParamKeyPattern != rhs.__isset.excludeParamKeyPattern) + return false; + else if (__isset.excludeParamKeyPattern && !(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + return true; +} + +GetPartitionsByFilterRequest::GetPartitionsByFilterRequest(const GetPartitionsByFilterRequest& other1768) { + catName = other1768.catName; + dbName = other1768.dbName; + tblName = other1768.tblName; + filter = other1768.filter; + maxParts = other1768.maxParts; + skipColumnSchemaForPartition = other1768.skipColumnSchemaForPartition; + includeParamKeyPattern = other1768.includeParamKeyPattern; + excludeParamKeyPattern = other1768.excludeParamKeyPattern; + __isset = other1768.__isset; +} +GetPartitionsByFilterRequest& GetPartitionsByFilterRequest::operator=(const GetPartitionsByFilterRequest& other1769) { + catName = other1769.catName; + dbName = other1769.dbName; + tblName = other1769.tblName; + filter = other1769.filter; + maxParts = other1769.maxParts; + skipColumnSchemaForPartition = other1769.skipColumnSchemaForPartition; + includeParamKeyPattern = other1769.includeParamKeyPattern; + excludeParamKeyPattern = other1769.excludeParamKeyPattern; + __isset = other1769.__isset; + return *this; +} +void GetPartitionsByFilterRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsByFilterRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "filter=" << to_string(filter); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "includeParamKeyPattern="; (__isset.includeParamKeyPattern ? (out << to_string(includeParamKeyPattern)) : (out << "")); + out << ", " << "excludeParamKeyPattern="; (__isset.excludeParamKeyPattern ? (out << to_string(excludeParamKeyPattern)) : (out << "")); + out << ")"; +} + + +GetPartitionNamesPsRequest::~GetPartitionNamesPsRequest() noexcept { +} + +GetPartitionNamesPsRequest::GetPartitionNamesPsRequest() noexcept + : catName(), + dbName(), + tblName(), + maxParts(-1), + validWriteIdList(), + id(-1LL) { +} + +void GetPartitionNamesPsRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetPartitionNamesPsRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPartitionNamesPsRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetPartitionNamesPsRequest::__set_partValues(const std::vector & val) { + this->partValues = val; +__isset.partValues = true; +} + +void GetPartitionNamesPsRequest::__set_maxParts(const int16_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void GetPartitionNamesPsRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetPartitionNamesPsRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionNamesPsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionNamesPsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partValues.clear(); + uint32_t _size1770; + ::apache::thrift::protocol::TType _etype1773; + xfer += iprot->readListBegin(_etype1773, _size1770); + this->partValues.resize(_size1770); + uint32_t _i1774; + for (_i1774 = 0; _i1774 < _size1770; ++_i1774) + { + xfer += iprot->readString(this->partValues[_i1774]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partValues = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionNamesPsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionNamesPsRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partValues) { + xfer += oprot->writeFieldBegin("partValues", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partValues.size())); + std::vector ::const_iterator _iter1775; + for (_iter1775 = this->partValues.begin(); _iter1775 != this->partValues.end(); ++_iter1775) + { + xfer += oprot->writeString((*_iter1775)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I16, 5); + xfer += oprot->writeI16(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionNamesPsRequest &a, GetPartitionNamesPsRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partValues, b.partValues); + swap(a.maxParts, b.maxParts); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.__isset, b.__isset); +} + +bool GetPartitionNamesPsRequest::operator==(const GetPartitionNamesPsRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.partValues != rhs.__isset.partValues) + return false; + else if (__isset.partValues && !(partValues == rhs.partValues)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + return true; +} + +GetPartitionNamesPsRequest::GetPartitionNamesPsRequest(const GetPartitionNamesPsRequest& other1776) { + catName = other1776.catName; + dbName = other1776.dbName; + tblName = other1776.tblName; + partValues = other1776.partValues; + maxParts = other1776.maxParts; + validWriteIdList = other1776.validWriteIdList; + id = other1776.id; + __isset = other1776.__isset; +} +GetPartitionNamesPsRequest& GetPartitionNamesPsRequest::operator=(const GetPartitionNamesPsRequest& other1777) { + catName = other1777.catName; + dbName = other1777.dbName; + tblName = other1777.tblName; + partValues = other1777.partValues; + maxParts = other1777.maxParts; + validWriteIdList = other1777.validWriteIdList; + id = other1777.id; + __isset = other1777.__isset; + return *this; +} +void GetPartitionNamesPsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionNamesPsRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partValues="; (__isset.partValues ? (out << to_string(partValues)) : (out << "")); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ")"; +} + + +GetPartitionNamesPsResponse::~GetPartitionNamesPsResponse() noexcept { +} + +GetPartitionNamesPsResponse::GetPartitionNamesPsResponse() noexcept { +} + +void GetPartitionNamesPsResponse::__set_names(const std::vector & val) { + this->names = val; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionNamesPsResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionNamesPsResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_names = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->names.clear(); + uint32_t _size1778; + ::apache::thrift::protocol::TType _etype1781; + xfer += iprot->readListBegin(_etype1781, _size1778); + this->names.resize(_size1778); + uint32_t _i1782; + for (_i1782 = 0; _i1782 < _size1778; ++_i1782) + { + xfer += iprot->readString(this->names[_i1782]); + } + xfer += iprot->readListEnd(); + } + isset_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_names) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionNamesPsResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionNamesPsResponse"); + + xfer += oprot->writeFieldBegin("names", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->names.size())); + std::vector ::const_iterator _iter1783; + for (_iter1783 = this->names.begin(); _iter1783 != this->names.end(); ++_iter1783) + { + xfer += oprot->writeString((*_iter1783)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionNamesPsResponse &a, GetPartitionNamesPsResponse &b) noexcept { + using ::std::swap; + swap(a.names, b.names); +} + +bool GetPartitionNamesPsResponse::operator==(const GetPartitionNamesPsResponse & rhs) const +{ + if (!(names == rhs.names)) + return false; + return true; +} + +GetPartitionNamesPsResponse::GetPartitionNamesPsResponse(const GetPartitionNamesPsResponse& other1784) { + names = other1784.names; +} +GetPartitionNamesPsResponse& GetPartitionNamesPsResponse::operator=(const GetPartitionNamesPsResponse& other1785) { + names = other1785.names; + return *this; +} +void GetPartitionNamesPsResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionNamesPsResponse("; + out << "names=" << to_string(names); + out << ")"; +} + + +GetPartitionsPsWithAuthRequest::~GetPartitionsPsWithAuthRequest() noexcept { +} + +GetPartitionsPsWithAuthRequest::GetPartitionsPsWithAuthRequest() noexcept + : catName(), + dbName(), + tblName(), + maxParts(-1), + userName(), + validWriteIdList(), + id(-1LL), + skipColumnSchemaForPartition(0), + includeParamKeyPattern(), + excludeParamKeyPattern() { +} + +void GetPartitionsPsWithAuthRequest::__set_catName(const std::string& val) { + this->catName = val; +__isset.catName = true; +} + +void GetPartitionsPsWithAuthRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPartitionsPsWithAuthRequest::__set_tblName(const std::string& val) { + this->tblName = val; +} + +void GetPartitionsPsWithAuthRequest::__set_partVals(const std::vector & val) { + this->partVals = val; +__isset.partVals = true; +} + +void GetPartitionsPsWithAuthRequest::__set_maxParts(const int16_t val) { + this->maxParts = val; +__isset.maxParts = true; +} + +void GetPartitionsPsWithAuthRequest::__set_userName(const std::string& val) { + this->userName = val; +__isset.userName = true; +} + +void GetPartitionsPsWithAuthRequest::__set_groupNames(const std::vector & val) { + this->groupNames = val; +__isset.groupNames = true; +} + +void GetPartitionsPsWithAuthRequest::__set_validWriteIdList(const std::string& val) { + this->validWriteIdList = val; +__isset.validWriteIdList = true; +} + +void GetPartitionsPsWithAuthRequest::__set_id(const int64_t val) { + this->id = val; +__isset.id = true; +} + +void GetPartitionsPsWithAuthRequest::__set_skipColumnSchemaForPartition(const bool val) { + this->skipColumnSchemaForPartition = val; +__isset.skipColumnSchemaForPartition = true; +} + +void GetPartitionsPsWithAuthRequest::__set_includeParamKeyPattern(const std::string& val) { + this->includeParamKeyPattern = val; +__isset.includeParamKeyPattern = true; +} + +void GetPartitionsPsWithAuthRequest::__set_excludeParamKeyPattern(const std::string& val) { + this->excludeParamKeyPattern = val; +__isset.excludeParamKeyPattern = true; +} + +void GetPartitionsPsWithAuthRequest::__set_partNames(const std::vector & val) { + this->partNames = val; +__isset.partNames = true; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsPsWithAuthRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsPsWithAuthRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_dbName = false; + bool isset_tblName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tblName); + isset_tblName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partVals.clear(); + uint32_t _size1786; + ::apache::thrift::protocol::TType _etype1789; + xfer += iprot->readListBegin(_etype1789, _size1786); + this->partVals.resize(_size1786); + uint32_t _i1790; + for (_i1790 = 0; _i1790 < _size1786; ++_i1790) + { + xfer += iprot->readString(this->partVals[_i1790]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->maxParts); + this->__isset.maxParts = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->userName); + this->__isset.userName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->groupNames.clear(); + uint32_t _size1791; + ::apache::thrift::protocol::TType _etype1794; + xfer += iprot->readListBegin(_etype1794, _size1791); + this->groupNames.resize(_size1791); + uint32_t _i1795; + for (_i1795 = 0; _i1795 < _size1791; ++_i1795) + { + xfer += iprot->readString(this->groupNames[_i1795]); + } + xfer += iprot->readListEnd(); + } + this->__isset.groupNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validWriteIdList); + this->__isset.validWriteIdList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->skipColumnSchemaForPartition); + this->__isset.skipColumnSchemaForPartition = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->includeParamKeyPattern); + this->__isset.includeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->excludeParamKeyPattern); + this->__isset.excludeParamKeyPattern = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partNames.clear(); + uint32_t _size1796; + ::apache::thrift::protocol::TType _etype1799; + xfer += iprot->readListBegin(_etype1799, _size1796); + this->partNames.resize(_size1796); + uint32_t _i1800; + for (_i1800 = 0; _i1800 < _size1796; ++_i1800) + { + xfer += iprot->readString(this->partNames[_i1800]); + } + xfer += iprot->readListEnd(); + } + this->__isset.partNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_tblName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionsPsWithAuthRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsPsWithAuthRequest"); + + if (this->__isset.catName) { + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tblName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tblName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.partVals) { + xfer += oprot->writeFieldBegin("partVals", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partVals.size())); + std::vector ::const_iterator _iter1801; + for (_iter1801 = this->partVals.begin(); _iter1801 != this->partVals.end(); ++_iter1801) + { + xfer += oprot->writeString((*_iter1801)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.maxParts) { + xfer += oprot->writeFieldBegin("maxParts", ::apache::thrift::protocol::T_I16, 5); + xfer += oprot->writeI16(this->maxParts); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.userName) { + xfer += oprot->writeFieldBegin("userName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->userName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.groupNames) { + xfer += oprot->writeFieldBegin("groupNames", ::apache::thrift::protocol::T_LIST, 7); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->groupNames.size())); + std::vector ::const_iterator _iter1802; + for (_iter1802 = this->groupNames.begin(); _iter1802 != this->groupNames.end(); ++_iter1802) + { + xfer += oprot->writeString((*_iter1802)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.validWriteIdList) { + xfer += oprot->writeFieldBegin("validWriteIdList", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->validWriteIdList); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 9); + xfer += oprot->writeI64(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.skipColumnSchemaForPartition) { + xfer += oprot->writeFieldBegin("skipColumnSchemaForPartition", ::apache::thrift::protocol::T_BOOL, 10); + xfer += oprot->writeBool(this->skipColumnSchemaForPartition); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.includeParamKeyPattern) { + xfer += oprot->writeFieldBegin("includeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 11); + xfer += oprot->writeString(this->includeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.excludeParamKeyPattern) { + xfer += oprot->writeFieldBegin("excludeParamKeyPattern", ::apache::thrift::protocol::T_STRING, 12); + xfer += oprot->writeString(this->excludeParamKeyPattern); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.partNames) { + xfer += oprot->writeFieldBegin("partNames", ::apache::thrift::protocol::T_LIST, 13); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->partNames.size())); + std::vector ::const_iterator _iter1803; + for (_iter1803 = this->partNames.begin(); _iter1803 != this->partNames.end(); ++_iter1803) + { + xfer += oprot->writeString((*_iter1803)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsPsWithAuthRequest &a, GetPartitionsPsWithAuthRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.tblName, b.tblName); + swap(a.partVals, b.partVals); + swap(a.maxParts, b.maxParts); + swap(a.userName, b.userName); + swap(a.groupNames, b.groupNames); + swap(a.validWriteIdList, b.validWriteIdList); + swap(a.id, b.id); + swap(a.skipColumnSchemaForPartition, b.skipColumnSchemaForPartition); + swap(a.includeParamKeyPattern, b.includeParamKeyPattern); + swap(a.excludeParamKeyPattern, b.excludeParamKeyPattern); + swap(a.partNames, b.partNames); + swap(a.__isset, b.__isset); +} + +bool GetPartitionsPsWithAuthRequest::operator==(const GetPartitionsPsWithAuthRequest & rhs) const +{ + if (__isset.catName != rhs.__isset.catName) + return false; + else if (__isset.catName && !(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(tblName == rhs.tblName)) + return false; + if (__isset.partVals != rhs.__isset.partVals) + return false; + else if (__isset.partVals && !(partVals == rhs.partVals)) + return false; + if (__isset.maxParts != rhs.__isset.maxParts) + return false; + else if (__isset.maxParts && !(maxParts == rhs.maxParts)) + return false; + if (__isset.userName != rhs.__isset.userName) + return false; + else if (__isset.userName && !(userName == rhs.userName)) + return false; + if (__isset.groupNames != rhs.__isset.groupNames) + return false; + else if (__isset.groupNames && !(groupNames == rhs.groupNames)) + return false; + if (__isset.validWriteIdList != rhs.__isset.validWriteIdList) + return false; + else if (__isset.validWriteIdList && !(validWriteIdList == rhs.validWriteIdList)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.skipColumnSchemaForPartition != rhs.__isset.skipColumnSchemaForPartition) + return false; + else if (__isset.skipColumnSchemaForPartition && !(skipColumnSchemaForPartition == rhs.skipColumnSchemaForPartition)) + return false; + if (__isset.includeParamKeyPattern != rhs.__isset.includeParamKeyPattern) + return false; + else if (__isset.includeParamKeyPattern && !(includeParamKeyPattern == rhs.includeParamKeyPattern)) + return false; + if (__isset.excludeParamKeyPattern != rhs.__isset.excludeParamKeyPattern) + return false; + else if (__isset.excludeParamKeyPattern && !(excludeParamKeyPattern == rhs.excludeParamKeyPattern)) + return false; + if (__isset.partNames != rhs.__isset.partNames) + return false; + else if (__isset.partNames && !(partNames == rhs.partNames)) + return false; + return true; +} + +GetPartitionsPsWithAuthRequest::GetPartitionsPsWithAuthRequest(const GetPartitionsPsWithAuthRequest& other1804) { + catName = other1804.catName; + dbName = other1804.dbName; + tblName = other1804.tblName; + partVals = other1804.partVals; + maxParts = other1804.maxParts; + userName = other1804.userName; + groupNames = other1804.groupNames; + validWriteIdList = other1804.validWriteIdList; + id = other1804.id; + skipColumnSchemaForPartition = other1804.skipColumnSchemaForPartition; + includeParamKeyPattern = other1804.includeParamKeyPattern; + excludeParamKeyPattern = other1804.excludeParamKeyPattern; + partNames = other1804.partNames; + __isset = other1804.__isset; +} +GetPartitionsPsWithAuthRequest& GetPartitionsPsWithAuthRequest::operator=(const GetPartitionsPsWithAuthRequest& other1805) { + catName = other1805.catName; + dbName = other1805.dbName; + tblName = other1805.tblName; + partVals = other1805.partVals; + maxParts = other1805.maxParts; + userName = other1805.userName; + groupNames = other1805.groupNames; + validWriteIdList = other1805.validWriteIdList; + id = other1805.id; + skipColumnSchemaForPartition = other1805.skipColumnSchemaForPartition; + includeParamKeyPattern = other1805.includeParamKeyPattern; + excludeParamKeyPattern = other1805.excludeParamKeyPattern; + partNames = other1805.partNames; + __isset = other1805.__isset; + return *this; +} +void GetPartitionsPsWithAuthRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsPsWithAuthRequest("; + out << "catName="; (__isset.catName ? (out << to_string(catName)) : (out << "")); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "tblName=" << to_string(tblName); + out << ", " << "partVals="; (__isset.partVals ? (out << to_string(partVals)) : (out << "")); + out << ", " << "maxParts="; (__isset.maxParts ? (out << to_string(maxParts)) : (out << "")); + out << ", " << "userName="; (__isset.userName ? (out << to_string(userName)) : (out << "")); + out << ", " << "groupNames="; (__isset.groupNames ? (out << to_string(groupNames)) : (out << "")); + out << ", " << "validWriteIdList="; (__isset.validWriteIdList ? (out << to_string(validWriteIdList)) : (out << "")); + out << ", " << "id="; (__isset.id ? (out << to_string(id)) : (out << "")); + out << ", " << "skipColumnSchemaForPartition="; (__isset.skipColumnSchemaForPartition ? (out << to_string(skipColumnSchemaForPartition)) : (out << "")); + out << ", " << "includeParamKeyPattern="; (__isset.includeParamKeyPattern ? (out << to_string(includeParamKeyPattern)) : (out << "")); + out << ", " << "excludeParamKeyPattern="; (__isset.excludeParamKeyPattern ? (out << to_string(excludeParamKeyPattern)) : (out << "")); + out << ", " << "partNames="; (__isset.partNames ? (out << to_string(partNames)) : (out << "")); + out << ")"; +} + + +GetPartitionsPsWithAuthResponse::~GetPartitionsPsWithAuthResponse() noexcept { +} + +GetPartitionsPsWithAuthResponse::GetPartitionsPsWithAuthResponse() noexcept { +} + +void GetPartitionsPsWithAuthResponse::__set_partitions(const std::vector & val) { + this->partitions = val; +} +std::ostream& operator<<(std::ostream& out, const GetPartitionsPsWithAuthResponse& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPartitionsPsWithAuthResponse::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_partitions = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->partitions.clear(); + uint32_t _size1806; + ::apache::thrift::protocol::TType _etype1809; + xfer += iprot->readListBegin(_etype1809, _size1806); + this->partitions.resize(_size1806); + uint32_t _i1810; + for (_i1810 = 0; _i1810 < _size1806; ++_i1810) + { + xfer += this->partitions[_i1810].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_partitions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_partitions) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPartitionsPsWithAuthResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPartitionsPsWithAuthResponse"); + + xfer += oprot->writeFieldBegin("partitions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->partitions.size())); + std::vector ::const_iterator _iter1811; + for (_iter1811 = this->partitions.begin(); _iter1811 != this->partitions.end(); ++_iter1811) + { + xfer += (*_iter1811).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPartitionsPsWithAuthResponse &a, GetPartitionsPsWithAuthResponse &b) noexcept { + using ::std::swap; + swap(a.partitions, b.partitions); +} + +bool GetPartitionsPsWithAuthResponse::operator==(const GetPartitionsPsWithAuthResponse & rhs) const +{ + if (!(partitions == rhs.partitions)) + return false; + return true; +} + +GetPartitionsPsWithAuthResponse::GetPartitionsPsWithAuthResponse(const GetPartitionsPsWithAuthResponse& other1812) { + partitions = other1812.partitions; +} +GetPartitionsPsWithAuthResponse& GetPartitionsPsWithAuthResponse::operator=(const GetPartitionsPsWithAuthResponse& other1813) { + partitions = other1813.partitions; + return *this; +} +void GetPartitionsPsWithAuthResponse::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPartitionsPsWithAuthResponse("; + out << "partitions=" << to_string(partitions); + out << ")"; +} + + +ReplicationMetrics::~ReplicationMetrics() noexcept { +} + +ReplicationMetrics::ReplicationMetrics() noexcept + : scheduledExecutionId(0), + policy(), + dumpExecutionId(0), + metadata(), + progress(), + messageFormat() { +} + +void ReplicationMetrics::__set_scheduledExecutionId(const int64_t val) { + this->scheduledExecutionId = val; +} + +void ReplicationMetrics::__set_policy(const std::string& val) { + this->policy = val; +} + +void ReplicationMetrics::__set_dumpExecutionId(const int64_t val) { + this->dumpExecutionId = val; +} + +void ReplicationMetrics::__set_metadata(const std::string& val) { + this->metadata = val; +__isset.metadata = true; +} + +void ReplicationMetrics::__set_progress(const std::string& val) { + this->progress = val; +__isset.progress = true; +} + +void ReplicationMetrics::__set_messageFormat(const std::string& val) { + this->messageFormat = val; +__isset.messageFormat = true; +} +std::ostream& operator<<(std::ostream& out, const ReplicationMetrics& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ReplicationMetrics::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_scheduledExecutionId = false; + bool isset_policy = false; + bool isset_dumpExecutionId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->scheduledExecutionId); + isset_scheduledExecutionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->policy); + isset_policy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->dumpExecutionId); + isset_dumpExecutionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->metadata); + this->__isset.metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->progress); + this->__isset.progress = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->messageFormat); + this->__isset.messageFormat = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_scheduledExecutionId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_policy) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dumpExecutionId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ReplicationMetrics::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ReplicationMetrics"); + + xfer += oprot->writeFieldBegin("scheduledExecutionId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->scheduledExecutionId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("policy", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->policy); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dumpExecutionId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->dumpExecutionId); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.metadata) { + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->metadata); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.progress) { + xfer += oprot->writeFieldBegin("progress", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->progress); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.messageFormat) { + xfer += oprot->writeFieldBegin("messageFormat", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->messageFormat); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ReplicationMetrics &a, ReplicationMetrics &b) noexcept { + using ::std::swap; + swap(a.scheduledExecutionId, b.scheduledExecutionId); + swap(a.policy, b.policy); + swap(a.dumpExecutionId, b.dumpExecutionId); + swap(a.metadata, b.metadata); + swap(a.progress, b.progress); + swap(a.messageFormat, b.messageFormat); + swap(a.__isset, b.__isset); +} + +bool ReplicationMetrics::operator==(const ReplicationMetrics & rhs) const +{ + if (!(scheduledExecutionId == rhs.scheduledExecutionId)) + return false; + if (!(policy == rhs.policy)) + return false; + if (!(dumpExecutionId == rhs.dumpExecutionId)) + return false; + if (__isset.metadata != rhs.__isset.metadata) + return false; + else if (__isset.metadata && !(metadata == rhs.metadata)) + return false; + if (__isset.progress != rhs.__isset.progress) + return false; + else if (__isset.progress && !(progress == rhs.progress)) + return false; + if (__isset.messageFormat != rhs.__isset.messageFormat) + return false; + else if (__isset.messageFormat && !(messageFormat == rhs.messageFormat)) + return false; + return true; +} + +ReplicationMetrics::ReplicationMetrics(const ReplicationMetrics& other1814) { + scheduledExecutionId = other1814.scheduledExecutionId; + policy = other1814.policy; + dumpExecutionId = other1814.dumpExecutionId; + metadata = other1814.metadata; + progress = other1814.progress; + messageFormat = other1814.messageFormat; + __isset = other1814.__isset; +} +ReplicationMetrics& ReplicationMetrics::operator=(const ReplicationMetrics& other1815) { + scheduledExecutionId = other1815.scheduledExecutionId; + policy = other1815.policy; + dumpExecutionId = other1815.dumpExecutionId; + metadata = other1815.metadata; + progress = other1815.progress; + messageFormat = other1815.messageFormat; + __isset = other1815.__isset; + return *this; +} +void ReplicationMetrics::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ReplicationMetrics("; + out << "scheduledExecutionId=" << to_string(scheduledExecutionId); + out << ", " << "policy=" << to_string(policy); + out << ", " << "dumpExecutionId=" << to_string(dumpExecutionId); + out << ", " << "metadata="; (__isset.metadata ? (out << to_string(metadata)) : (out << "")); + out << ", " << "progress="; (__isset.progress ? (out << to_string(progress)) : (out << "")); + out << ", " << "messageFormat="; (__isset.messageFormat ? (out << to_string(messageFormat)) : (out << "")); + out << ")"; +} + + +ReplicationMetricList::~ReplicationMetricList() noexcept { +} + +ReplicationMetricList::ReplicationMetricList() noexcept { +} + +void ReplicationMetricList::__set_replicationMetricList(const std::vector & val) { + this->replicationMetricList = val; +} +std::ostream& operator<<(std::ostream& out, const ReplicationMetricList& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ReplicationMetricList::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_replicationMetricList = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->replicationMetricList.clear(); + uint32_t _size1816; + ::apache::thrift::protocol::TType _etype1819; + xfer += iprot->readListBegin(_etype1819, _size1816); + this->replicationMetricList.resize(_size1816); + uint32_t _i1820; + for (_i1820 = 0; _i1820 < _size1816; ++_i1820) + { + xfer += this->replicationMetricList[_i1820].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_replicationMetricList = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_replicationMetricList) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ReplicationMetricList::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ReplicationMetricList"); + + xfer += oprot->writeFieldBegin("replicationMetricList", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->replicationMetricList.size())); + std::vector ::const_iterator _iter1821; + for (_iter1821 = this->replicationMetricList.begin(); _iter1821 != this->replicationMetricList.end(); ++_iter1821) + { + xfer += (*_iter1821).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ReplicationMetricList &a, ReplicationMetricList &b) noexcept { + using ::std::swap; + swap(a.replicationMetricList, b.replicationMetricList); +} + +bool ReplicationMetricList::operator==(const ReplicationMetricList & rhs) const +{ + if (!(replicationMetricList == rhs.replicationMetricList)) + return false; + return true; +} + +ReplicationMetricList::ReplicationMetricList(const ReplicationMetricList& other1822) { + replicationMetricList = other1822.replicationMetricList; +} +ReplicationMetricList& ReplicationMetricList::operator=(const ReplicationMetricList& other1823) { + replicationMetricList = other1823.replicationMetricList; + return *this; +} +void ReplicationMetricList::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ReplicationMetricList("; + out << "replicationMetricList=" << to_string(replicationMetricList); + out << ")"; +} + + +GetReplicationMetricsRequest::~GetReplicationMetricsRequest() noexcept { +} + +GetReplicationMetricsRequest::GetReplicationMetricsRequest() noexcept + : scheduledExecutionId(0), + policy(), + dumpExecutionId(0) { +} + +void GetReplicationMetricsRequest::__set_scheduledExecutionId(const int64_t val) { + this->scheduledExecutionId = val; +__isset.scheduledExecutionId = true; +} + +void GetReplicationMetricsRequest::__set_policy(const std::string& val) { + this->policy = val; +__isset.policy = true; +} + +void GetReplicationMetricsRequest::__set_dumpExecutionId(const int64_t val) { + this->dumpExecutionId = val; +__isset.dumpExecutionId = true; +} +std::ostream& operator<<(std::ostream& out, const GetReplicationMetricsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetReplicationMetricsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->scheduledExecutionId); + this->__isset.scheduledExecutionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->policy); + this->__isset.policy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->dumpExecutionId); + this->__isset.dumpExecutionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetReplicationMetricsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetReplicationMetricsRequest"); + + if (this->__isset.scheduledExecutionId) { + xfer += oprot->writeFieldBegin("scheduledExecutionId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->scheduledExecutionId); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.policy) { + xfer += oprot->writeFieldBegin("policy", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->policy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dumpExecutionId) { + xfer += oprot->writeFieldBegin("dumpExecutionId", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->dumpExecutionId); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetReplicationMetricsRequest &a, GetReplicationMetricsRequest &b) noexcept { + using ::std::swap; + swap(a.scheduledExecutionId, b.scheduledExecutionId); + swap(a.policy, b.policy); + swap(a.dumpExecutionId, b.dumpExecutionId); + swap(a.__isset, b.__isset); +} + +bool GetReplicationMetricsRequest::operator==(const GetReplicationMetricsRequest & rhs) const +{ + if (__isset.scheduledExecutionId != rhs.__isset.scheduledExecutionId) + return false; + else if (__isset.scheduledExecutionId && !(scheduledExecutionId == rhs.scheduledExecutionId)) + return false; + if (__isset.policy != rhs.__isset.policy) + return false; + else if (__isset.policy && !(policy == rhs.policy)) + return false; + if (__isset.dumpExecutionId != rhs.__isset.dumpExecutionId) + return false; + else if (__isset.dumpExecutionId && !(dumpExecutionId == rhs.dumpExecutionId)) + return false; + return true; +} + +GetReplicationMetricsRequest::GetReplicationMetricsRequest(const GetReplicationMetricsRequest& other1824) { + scheduledExecutionId = other1824.scheduledExecutionId; + policy = other1824.policy; + dumpExecutionId = other1824.dumpExecutionId; + __isset = other1824.__isset; +} +GetReplicationMetricsRequest& GetReplicationMetricsRequest::operator=(const GetReplicationMetricsRequest& other1825) { + scheduledExecutionId = other1825.scheduledExecutionId; + policy = other1825.policy; + dumpExecutionId = other1825.dumpExecutionId; + __isset = other1825.__isset; + return *this; +} +void GetReplicationMetricsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetReplicationMetricsRequest("; + out << "scheduledExecutionId="; (__isset.scheduledExecutionId ? (out << to_string(scheduledExecutionId)) : (out << "")); + out << ", " << "policy="; (__isset.policy ? (out << to_string(policy)) : (out << "")); + out << ", " << "dumpExecutionId="; (__isset.dumpExecutionId ? (out << to_string(dumpExecutionId)) : (out << "")); + out << ")"; +} + + +GetOpenTxnsRequest::~GetOpenTxnsRequest() noexcept { +} + +GetOpenTxnsRequest::GetOpenTxnsRequest() noexcept { +} + +void GetOpenTxnsRequest::__set_excludeTxnTypes(const std::vector & val) { + this->excludeTxnTypes = val; +__isset.excludeTxnTypes = true; +} +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetOpenTxnsRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->excludeTxnTypes.clear(); + uint32_t _size1826; + ::apache::thrift::protocol::TType _etype1829; + xfer += iprot->readListBegin(_etype1829, _size1826); + this->excludeTxnTypes.resize(_size1826); + uint32_t _i1830; + for (_i1830 = 0; _i1830 < _size1826; ++_i1830) + { + int32_t ecast1831; + xfer += iprot->readI32(ecast1831); + this->excludeTxnTypes[_i1830] = static_cast(ecast1831); + } + xfer += iprot->readListEnd(); + } + this->__isset.excludeTxnTypes = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t GetOpenTxnsRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetOpenTxnsRequest"); + + if (this->__isset.excludeTxnTypes) { + xfer += oprot->writeFieldBegin("excludeTxnTypes", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->excludeTxnTypes.size())); + std::vector ::const_iterator _iter1832; + for (_iter1832 = this->excludeTxnTypes.begin(); _iter1832 != this->excludeTxnTypes.end(); ++_iter1832) + { + xfer += oprot->writeI32(static_cast((*_iter1832))); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetOpenTxnsRequest &a, GetOpenTxnsRequest &b) noexcept { + using ::std::swap; + swap(a.excludeTxnTypes, b.excludeTxnTypes); + swap(a.__isset, b.__isset); +} + +bool GetOpenTxnsRequest::operator==(const GetOpenTxnsRequest & rhs) const +{ + if (__isset.excludeTxnTypes != rhs.__isset.excludeTxnTypes) + return false; + else if (__isset.excludeTxnTypes && !(excludeTxnTypes == rhs.excludeTxnTypes)) + return false; + return true; +} + +GetOpenTxnsRequest::GetOpenTxnsRequest(const GetOpenTxnsRequest& other1833) { + excludeTxnTypes = other1833.excludeTxnTypes; + __isset = other1833.__isset; +} +GetOpenTxnsRequest& GetOpenTxnsRequest::operator=(const GetOpenTxnsRequest& other1834) { + excludeTxnTypes = other1834.excludeTxnTypes; + __isset = other1834.__isset; + return *this; +} +void GetOpenTxnsRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetOpenTxnsRequest("; + out << "excludeTxnTypes="; (__isset.excludeTxnTypes ? (out << to_string(excludeTxnTypes)) : (out << "")); + out << ")"; +} + + +StoredProcedureRequest::~StoredProcedureRequest() noexcept { +} + +StoredProcedureRequest::StoredProcedureRequest() noexcept + : catName(), + dbName(), + procName() { +} + +void StoredProcedureRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void StoredProcedureRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void StoredProcedureRequest::__set_procName(const std::string& val) { + this->procName = val; +} +std::ostream& operator<<(std::ostream& out, const StoredProcedureRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t StoredProcedureRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_dbName = false; + bool isset_procName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->procName); + isset_procName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_procName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t StoredProcedureRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("StoredProcedureRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("procName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->procName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(StoredProcedureRequest &a, StoredProcedureRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.procName, b.procName); +} + +bool StoredProcedureRequest::operator==(const StoredProcedureRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(procName == rhs.procName)) + return false; + return true; +} + +StoredProcedureRequest::StoredProcedureRequest(const StoredProcedureRequest& other1835) { + catName = other1835.catName; + dbName = other1835.dbName; + procName = other1835.procName; +} +StoredProcedureRequest& StoredProcedureRequest::operator=(const StoredProcedureRequest& other1836) { + catName = other1836.catName; + dbName = other1836.dbName; + procName = other1836.procName; + return *this; +} +void StoredProcedureRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "StoredProcedureRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "procName=" << to_string(procName); + out << ")"; +} + + +ListStoredProcedureRequest::~ListStoredProcedureRequest() noexcept { +} + +ListStoredProcedureRequest::ListStoredProcedureRequest() noexcept + : catName(), + dbName() { +} + +void ListStoredProcedureRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void ListStoredProcedureRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} +std::ostream& operator<<(std::ostream& out, const ListStoredProcedureRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ListStoredProcedureRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ListStoredProcedureRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ListStoredProcedureRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ListStoredProcedureRequest &a, ListStoredProcedureRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.__isset, b.__isset); +} + +bool ListStoredProcedureRequest::operator==(const ListStoredProcedureRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + return true; +} + +ListStoredProcedureRequest::ListStoredProcedureRequest(const ListStoredProcedureRequest& other1837) { + catName = other1837.catName; + dbName = other1837.dbName; + __isset = other1837.__isset; +} +ListStoredProcedureRequest& ListStoredProcedureRequest::operator=(const ListStoredProcedureRequest& other1838) { + catName = other1838.catName; + dbName = other1838.dbName; + __isset = other1838.__isset; + return *this; +} +void ListStoredProcedureRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ListStoredProcedureRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ")"; +} + + +StoredProcedure::~StoredProcedure() noexcept { +} + +StoredProcedure::StoredProcedure() noexcept + : name(), + dbName(), + catName(), + ownerName(), + source() { +} + +void StoredProcedure::__set_name(const std::string& val) { + this->name = val; +} + +void StoredProcedure::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void StoredProcedure::__set_catName(const std::string& val) { + this->catName = val; +} + +void StoredProcedure::__set_ownerName(const std::string& val) { + this->ownerName = val; +} + +void StoredProcedure::__set_source(const std::string& val) { + this->source = val; +} +std::ostream& operator<<(std::ostream& out, const StoredProcedure& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t StoredProcedure::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + this->__isset.name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->source); + this->__isset.source = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t StoredProcedure::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("StoredProcedure"); + + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("source", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->source); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(StoredProcedure &a, StoredProcedure &b) noexcept { + using ::std::swap; + swap(a.name, b.name); + swap(a.dbName, b.dbName); + swap(a.catName, b.catName); + swap(a.ownerName, b.ownerName); + swap(a.source, b.source); + swap(a.__isset, b.__isset); +} + +bool StoredProcedure::operator==(const StoredProcedure & rhs) const +{ + if (!(name == rhs.name)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(catName == rhs.catName)) + return false; + if (!(ownerName == rhs.ownerName)) + return false; + if (!(source == rhs.source)) + return false; + return true; +} + +StoredProcedure::StoredProcedure(const StoredProcedure& other1839) { + name = other1839.name; + dbName = other1839.dbName; + catName = other1839.catName; + ownerName = other1839.ownerName; + source = other1839.source; + __isset = other1839.__isset; +} +StoredProcedure& StoredProcedure::operator=(const StoredProcedure& other1840) { + name = other1840.name; + dbName = other1840.dbName; + catName = other1840.catName; + ownerName = other1840.ownerName; + source = other1840.source; + __isset = other1840.__isset; + return *this; +} +void StoredProcedure::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "StoredProcedure("; + out << "name=" << to_string(name); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "catName=" << to_string(catName); + out << ", " << "ownerName=" << to_string(ownerName); + out << ", " << "source=" << to_string(source); + out << ")"; +} + + +AddPackageRequest::~AddPackageRequest() noexcept { +} + +AddPackageRequest::AddPackageRequest() noexcept + : catName(), + dbName(), + packageName(), + ownerName(), + header(), + body() { +} + +void AddPackageRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void AddPackageRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void AddPackageRequest::__set_packageName(const std::string& val) { + this->packageName = val; +} + +void AddPackageRequest::__set_ownerName(const std::string& val) { + this->ownerName = val; +} + +void AddPackageRequest::__set_header(const std::string& val) { + this->header = val; +} + +void AddPackageRequest::__set_body(const std::string& val) { + this->body = val; +} +std::ostream& operator<<(std::ostream& out, const AddPackageRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AddPackageRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->packageName); + this->__isset.packageName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->header); + this->__isset.header = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->body); + this->__isset.body = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AddPackageRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AddPackageRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("packageName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->packageName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("header", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->header); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("body", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->body); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AddPackageRequest &a, AddPackageRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.packageName, b.packageName); + swap(a.ownerName, b.ownerName); + swap(a.header, b.header); + swap(a.body, b.body); + swap(a.__isset, b.__isset); +} + +bool AddPackageRequest::operator==(const AddPackageRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(packageName == rhs.packageName)) + return false; + if (!(ownerName == rhs.ownerName)) + return false; + if (!(header == rhs.header)) + return false; + if (!(body == rhs.body)) + return false; + return true; +} + +AddPackageRequest::AddPackageRequest(const AddPackageRequest& other1841) { + catName = other1841.catName; + dbName = other1841.dbName; + packageName = other1841.packageName; + ownerName = other1841.ownerName; + header = other1841.header; + body = other1841.body; + __isset = other1841.__isset; +} +AddPackageRequest& AddPackageRequest::operator=(const AddPackageRequest& other1842) { + catName = other1842.catName; + dbName = other1842.dbName; + packageName = other1842.packageName; + ownerName = other1842.ownerName; + header = other1842.header; + body = other1842.body; + __isset = other1842.__isset; + return *this; +} +void AddPackageRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AddPackageRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "packageName=" << to_string(packageName); + out << ", " << "ownerName=" << to_string(ownerName); + out << ", " << "header=" << to_string(header); + out << ", " << "body=" << to_string(body); + out << ")"; +} + + +GetPackageRequest::~GetPackageRequest() noexcept { +} + +GetPackageRequest::GetPackageRequest() noexcept + : catName(), + dbName(), + packageName() { +} + +void GetPackageRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void GetPackageRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void GetPackageRequest::__set_packageName(const std::string& val) { + this->packageName = val; +} +std::ostream& operator<<(std::ostream& out, const GetPackageRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetPackageRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_dbName = false; + bool isset_packageName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->packageName); + isset_packageName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_packageName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetPackageRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetPackageRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("packageName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->packageName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetPackageRequest &a, GetPackageRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.packageName, b.packageName); +} + +bool GetPackageRequest::operator==(const GetPackageRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(packageName == rhs.packageName)) + return false; + return true; +} + +GetPackageRequest::GetPackageRequest(const GetPackageRequest& other1843) { + catName = other1843.catName; + dbName = other1843.dbName; + packageName = other1843.packageName; +} +GetPackageRequest& GetPackageRequest::operator=(const GetPackageRequest& other1844) { + catName = other1844.catName; + dbName = other1844.dbName; + packageName = other1844.packageName; + return *this; +} +void GetPackageRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetPackageRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "packageName=" << to_string(packageName); + out << ")"; +} + + +DropPackageRequest::~DropPackageRequest() noexcept { +} + +DropPackageRequest::DropPackageRequest() noexcept + : catName(), + dbName(), + packageName() { +} + +void DropPackageRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void DropPackageRequest::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void DropPackageRequest::__set_packageName(const std::string& val) { + this->packageName = val; +} +std::ostream& operator<<(std::ostream& out, const DropPackageRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t DropPackageRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + bool isset_dbName = false; + bool isset_packageName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + isset_dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->packageName); + isset_packageName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_dbName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_packageName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t DropPackageRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("DropPackageRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("packageName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->packageName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(DropPackageRequest &a, DropPackageRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.packageName, b.packageName); +} + +bool DropPackageRequest::operator==(const DropPackageRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(packageName == rhs.packageName)) + return false; + return true; +} + +DropPackageRequest::DropPackageRequest(const DropPackageRequest& other1845) { + catName = other1845.catName; + dbName = other1845.dbName; + packageName = other1845.packageName; +} +DropPackageRequest& DropPackageRequest::operator=(const DropPackageRequest& other1846) { + catName = other1846.catName; + dbName = other1846.dbName; + packageName = other1846.packageName; + return *this; +} +void DropPackageRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "DropPackageRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "packageName=" << to_string(packageName); + out << ")"; +} + + +ListPackageRequest::~ListPackageRequest() noexcept { +} + +ListPackageRequest::ListPackageRequest() noexcept + : catName(), + dbName() { +} + +void ListPackageRequest::__set_catName(const std::string& val) { + this->catName = val; +} + +void ListPackageRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} +std::ostream& operator<<(std::ostream& out, const ListPackageRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ListPackageRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_catName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + isset_catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_catName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ListPackageRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ListPackageRequest"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ListPackageRequest &a, ListPackageRequest &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.__isset, b.__isset); +} + +bool ListPackageRequest::operator==(const ListPackageRequest & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + return true; +} + +ListPackageRequest::ListPackageRequest(const ListPackageRequest& other1847) { + catName = other1847.catName; + dbName = other1847.dbName; + __isset = other1847.__isset; +} +ListPackageRequest& ListPackageRequest::operator=(const ListPackageRequest& other1848) { + catName = other1848.catName; + dbName = other1848.dbName; + __isset = other1848.__isset; + return *this; +} +void ListPackageRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ListPackageRequest("; + out << "catName=" << to_string(catName); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ")"; +} + + +Package::~Package() noexcept { +} + +Package::Package() noexcept + : catName(), + dbName(), + packageName(), + ownerName(), + header(), + body() { +} + +void Package::__set_catName(const std::string& val) { + this->catName = val; +} + +void Package::__set_dbName(const std::string& val) { + this->dbName = val; +} + +void Package::__set_packageName(const std::string& val) { + this->packageName = val; +} + +void Package::__set_ownerName(const std::string& val) { + this->ownerName = val; +} + +void Package::__set_header(const std::string& val) { + this->header = val; +} + +void Package::__set_body(const std::string& val) { + this->body = val; +} +std::ostream& operator<<(std::ostream& out, const Package& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t Package::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->catName); + this->__isset.catName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->packageName); + this->__isset.packageName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->ownerName); + this->__isset.ownerName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->header); + this->__isset.header = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->body); + this->__isset.body = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Package::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Package"); + + xfer += oprot->writeFieldBegin("catName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->catName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("packageName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->packageName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ownerName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->ownerName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("header", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->header); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("body", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->body); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(Package &a, Package &b) noexcept { + using ::std::swap; + swap(a.catName, b.catName); + swap(a.dbName, b.dbName); + swap(a.packageName, b.packageName); + swap(a.ownerName, b.ownerName); + swap(a.header, b.header); + swap(a.body, b.body); + swap(a.__isset, b.__isset); +} + +bool Package::operator==(const Package & rhs) const +{ + if (!(catName == rhs.catName)) + return false; + if (!(dbName == rhs.dbName)) + return false; + if (!(packageName == rhs.packageName)) + return false; + if (!(ownerName == rhs.ownerName)) + return false; + if (!(header == rhs.header)) + return false; + if (!(body == rhs.body)) + return false; + return true; +} + +Package::Package(const Package& other1849) { + catName = other1849.catName; + dbName = other1849.dbName; + packageName = other1849.packageName; + ownerName = other1849.ownerName; + header = other1849.header; + body = other1849.body; + __isset = other1849.__isset; +} +Package& Package::operator=(const Package& other1850) { + catName = other1850.catName; + dbName = other1850.dbName; + packageName = other1850.packageName; + ownerName = other1850.ownerName; + header = other1850.header; + body = other1850.body; + __isset = other1850.__isset; + return *this; +} +void Package::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Package("; + out << "catName=" << to_string(catName); + out << ", " << "dbName=" << to_string(dbName); + out << ", " << "packageName=" << to_string(packageName); + out << ", " << "ownerName=" << to_string(ownerName); + out << ", " << "header=" << to_string(header); + out << ", " << "body=" << to_string(body); + out << ")"; +} + + +GetAllWriteEventInfoRequest::~GetAllWriteEventInfoRequest() noexcept { +} + +GetAllWriteEventInfoRequest::GetAllWriteEventInfoRequest() noexcept + : txnId(0), + dbName(), + tableName() { +} + +void GetAllWriteEventInfoRequest::__set_txnId(const int64_t val) { + this->txnId = val; +} + +void GetAllWriteEventInfoRequest::__set_dbName(const std::string& val) { + this->dbName = val; +__isset.dbName = true; +} + +void GetAllWriteEventInfoRequest::__set_tableName(const std::string& val) { + this->tableName = val; +__isset.tableName = true; +} +std::ostream& operator<<(std::ostream& out, const GetAllWriteEventInfoRequest& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t GetAllWriteEventInfoRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_txnId = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->txnId); + isset_txnId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->dbName); + this->__isset.dbName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_txnId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t GetAllWriteEventInfoRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GetAllWriteEventInfoRequest"); + + xfer += oprot->writeFieldBegin("txnId", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->txnId); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.dbName) { + xfer += oprot->writeFieldBegin("dbName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->dbName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(GetAllWriteEventInfoRequest &a, GetAllWriteEventInfoRequest &b) noexcept { + using ::std::swap; + swap(a.txnId, b.txnId); + swap(a.dbName, b.dbName); + swap(a.tableName, b.tableName); + swap(a.__isset, b.__isset); +} + +bool GetAllWriteEventInfoRequest::operator==(const GetAllWriteEventInfoRequest & rhs) const +{ + if (!(txnId == rhs.txnId)) + return false; + if (__isset.dbName != rhs.__isset.dbName) + return false; + else if (__isset.dbName && !(dbName == rhs.dbName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + return true; +} + +GetAllWriteEventInfoRequest::GetAllWriteEventInfoRequest(const GetAllWriteEventInfoRequest& other1851) { + txnId = other1851.txnId; + dbName = other1851.dbName; + tableName = other1851.tableName; + __isset = other1851.__isset; +} +GetAllWriteEventInfoRequest& GetAllWriteEventInfoRequest::operator=(const GetAllWriteEventInfoRequest& other1852) { + txnId = other1852.txnId; + dbName = other1852.dbName; + tableName = other1852.tableName; + __isset = other1852.__isset; + return *this; +} +void GetAllWriteEventInfoRequest::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GetAllWriteEventInfoRequest("; + out << "txnId=" << to_string(txnId); + out << ", " << "dbName="; (__isset.dbName ? (out << to_string(dbName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ")"; +} + + +MetaException::~MetaException() noexcept { +} + +MetaException::MetaException() noexcept + : message() { +} + +void MetaException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const MetaException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t MetaException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t MetaException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("MetaException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(MetaException &a, MetaException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool MetaException::operator==(const MetaException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +MetaException::MetaException(const MetaException& other1853) : TException() { + message = other1853.message; + __isset = other1853.__isset; +} +MetaException& MetaException::operator=(const MetaException& other1854) { + message = other1854.message; + __isset = other1854.__isset; + return *this; +} +void MetaException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "MetaException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* MetaException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: MetaException"; + } +} + + +UnknownTableException::~UnknownTableException() noexcept { +} + +UnknownTableException::UnknownTableException() noexcept + : message() { +} + +void UnknownTableException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const UnknownTableException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UnknownTableException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t UnknownTableException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UnknownTableException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UnknownTableException &a, UnknownTableException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool UnknownTableException::operator==(const UnknownTableException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +UnknownTableException::UnknownTableException(const UnknownTableException& other1855) : TException() { + message = other1855.message; + __isset = other1855.__isset; +} +UnknownTableException& UnknownTableException::operator=(const UnknownTableException& other1856) { + message = other1856.message; + __isset = other1856.__isset; + return *this; +} +void UnknownTableException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UnknownTableException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* UnknownTableException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: UnknownTableException"; + } +} + + +UnknownDBException::~UnknownDBException() noexcept { +} + +UnknownDBException::UnknownDBException() noexcept + : message() { +} + +void UnknownDBException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const UnknownDBException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UnknownDBException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t UnknownDBException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UnknownDBException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UnknownDBException &a, UnknownDBException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool UnknownDBException::operator==(const UnknownDBException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +UnknownDBException::UnknownDBException(const UnknownDBException& other1857) : TException() { + message = other1857.message; + __isset = other1857.__isset; +} +UnknownDBException& UnknownDBException::operator=(const UnknownDBException& other1858) { + message = other1858.message; + __isset = other1858.__isset; + return *this; +} +void UnknownDBException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UnknownDBException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* UnknownDBException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: UnknownDBException"; + } +} + + +AlreadyExistsException::~AlreadyExistsException() noexcept { +} + +AlreadyExistsException::AlreadyExistsException() noexcept + : message() { +} + +void AlreadyExistsException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const AlreadyExistsException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t AlreadyExistsException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t AlreadyExistsException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("AlreadyExistsException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(AlreadyExistsException &a, AlreadyExistsException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool AlreadyExistsException::operator==(const AlreadyExistsException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +AlreadyExistsException::AlreadyExistsException(const AlreadyExistsException& other1859) : TException() { + message = other1859.message; + __isset = other1859.__isset; +} +AlreadyExistsException& AlreadyExistsException::operator=(const AlreadyExistsException& other1860) { + message = other1860.message; + __isset = other1860.__isset; + return *this; +} +void AlreadyExistsException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "AlreadyExistsException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* AlreadyExistsException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: AlreadyExistsException"; + } +} + + +InvalidPartitionException::~InvalidPartitionException() noexcept { +} + +InvalidPartitionException::InvalidPartitionException() noexcept + : message() { +} + +void InvalidPartitionException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const InvalidPartitionException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t InvalidPartitionException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t InvalidPartitionException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("InvalidPartitionException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(InvalidPartitionException &a, InvalidPartitionException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool InvalidPartitionException::operator==(const InvalidPartitionException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +InvalidPartitionException::InvalidPartitionException(const InvalidPartitionException& other1861) : TException() { + message = other1861.message; + __isset = other1861.__isset; +} +InvalidPartitionException& InvalidPartitionException::operator=(const InvalidPartitionException& other1862) { + message = other1862.message; + __isset = other1862.__isset; + return *this; +} +void InvalidPartitionException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "InvalidPartitionException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* InvalidPartitionException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: InvalidPartitionException"; + } +} + + +UnknownPartitionException::~UnknownPartitionException() noexcept { +} + +UnknownPartitionException::UnknownPartitionException() noexcept + : message() { +} + +void UnknownPartitionException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const UnknownPartitionException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t UnknownPartitionException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t UnknownPartitionException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("UnknownPartitionException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(UnknownPartitionException &a, UnknownPartitionException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool UnknownPartitionException::operator==(const UnknownPartitionException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +UnknownPartitionException::UnknownPartitionException(const UnknownPartitionException& other1863) : TException() { + message = other1863.message; + __isset = other1863.__isset; +} +UnknownPartitionException& UnknownPartitionException::operator=(const UnknownPartitionException& other1864) { + message = other1864.message; + __isset = other1864.__isset; + return *this; +} +void UnknownPartitionException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "UnknownPartitionException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* UnknownPartitionException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: UnknownPartitionException"; + } +} + + +InvalidObjectException::~InvalidObjectException() noexcept { +} + +InvalidObjectException::InvalidObjectException() noexcept + : message() { +} + +void InvalidObjectException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const InvalidObjectException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t InvalidObjectException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t InvalidObjectException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("InvalidObjectException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(InvalidObjectException &a, InvalidObjectException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool InvalidObjectException::operator==(const InvalidObjectException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +InvalidObjectException::InvalidObjectException(const InvalidObjectException& other1865) : TException() { + message = other1865.message; + __isset = other1865.__isset; +} +InvalidObjectException& InvalidObjectException::operator=(const InvalidObjectException& other1866) { + message = other1866.message; + __isset = other1866.__isset; + return *this; +} +void InvalidObjectException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "InvalidObjectException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* InvalidObjectException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: InvalidObjectException"; + } +} + + +NoSuchObjectException::~NoSuchObjectException() noexcept { +} + +NoSuchObjectException::NoSuchObjectException() noexcept + : message() { +} + +void NoSuchObjectException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const NoSuchObjectException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NoSuchObjectException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t NoSuchObjectException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NoSuchObjectException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NoSuchObjectException &a, NoSuchObjectException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool NoSuchObjectException::operator==(const NoSuchObjectException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +NoSuchObjectException::NoSuchObjectException(const NoSuchObjectException& other1867) : TException() { + message = other1867.message; + __isset = other1867.__isset; +} +NoSuchObjectException& NoSuchObjectException::operator=(const NoSuchObjectException& other1868) { + message = other1868.message; + __isset = other1868.__isset; + return *this; +} +void NoSuchObjectException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NoSuchObjectException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* NoSuchObjectException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: NoSuchObjectException"; + } +} + + +InvalidOperationException::~InvalidOperationException() noexcept { +} + +InvalidOperationException::InvalidOperationException() noexcept + : message() { +} + +void InvalidOperationException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const InvalidOperationException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t InvalidOperationException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t InvalidOperationException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("InvalidOperationException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(InvalidOperationException &a, InvalidOperationException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool InvalidOperationException::operator==(const InvalidOperationException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +InvalidOperationException::InvalidOperationException(const InvalidOperationException& other1869) : TException() { + message = other1869.message; + __isset = other1869.__isset; +} +InvalidOperationException& InvalidOperationException::operator=(const InvalidOperationException& other1870) { + message = other1870.message; + __isset = other1870.__isset; + return *this; +} +void InvalidOperationException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "InvalidOperationException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* InvalidOperationException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: InvalidOperationException"; + } +} + + +ConfigValSecurityException::~ConfigValSecurityException() noexcept { +} + +ConfigValSecurityException::ConfigValSecurityException() noexcept + : message() { +} + +void ConfigValSecurityException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const ConfigValSecurityException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t ConfigValSecurityException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ConfigValSecurityException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ConfigValSecurityException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ConfigValSecurityException &a, ConfigValSecurityException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool ConfigValSecurityException::operator==(const ConfigValSecurityException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +ConfigValSecurityException::ConfigValSecurityException(const ConfigValSecurityException& other1871) : TException() { + message = other1871.message; + __isset = other1871.__isset; +} +ConfigValSecurityException& ConfigValSecurityException::operator=(const ConfigValSecurityException& other1872) { + message = other1872.message; + __isset = other1872.__isset; + return *this; +} +void ConfigValSecurityException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ConfigValSecurityException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* ConfigValSecurityException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: ConfigValSecurityException"; + } +} + + +InvalidInputException::~InvalidInputException() noexcept { +} + +InvalidInputException::InvalidInputException() noexcept + : message() { +} + +void InvalidInputException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const InvalidInputException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t InvalidInputException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t InvalidInputException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("InvalidInputException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(InvalidInputException &a, InvalidInputException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool InvalidInputException::operator==(const InvalidInputException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +InvalidInputException::InvalidInputException(const InvalidInputException& other1873) : TException() { + message = other1873.message; + __isset = other1873.__isset; +} +InvalidInputException& InvalidInputException::operator=(const InvalidInputException& other1874) { + message = other1874.message; + __isset = other1874.__isset; + return *this; +} +void InvalidInputException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "InvalidInputException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* InvalidInputException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: InvalidInputException"; + } +} + + +NoSuchTxnException::~NoSuchTxnException() noexcept { +} + +NoSuchTxnException::NoSuchTxnException() noexcept + : message() { +} + +void NoSuchTxnException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const NoSuchTxnException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NoSuchTxnException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t NoSuchTxnException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NoSuchTxnException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NoSuchTxnException &a, NoSuchTxnException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool NoSuchTxnException::operator==(const NoSuchTxnException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +NoSuchTxnException::NoSuchTxnException(const NoSuchTxnException& other1875) : TException() { + message = other1875.message; + __isset = other1875.__isset; +} +NoSuchTxnException& NoSuchTxnException::operator=(const NoSuchTxnException& other1876) { + message = other1876.message; + __isset = other1876.__isset; + return *this; +} +void NoSuchTxnException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NoSuchTxnException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* NoSuchTxnException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: NoSuchTxnException"; + } +} + + +TxnAbortedException::~TxnAbortedException() noexcept { +} + +TxnAbortedException::TxnAbortedException() noexcept + : message() { +} + +void TxnAbortedException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const TxnAbortedException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TxnAbortedException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TxnAbortedException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TxnAbortedException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TxnAbortedException &a, TxnAbortedException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool TxnAbortedException::operator==(const TxnAbortedException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +TxnAbortedException::TxnAbortedException(const TxnAbortedException& other1877) : TException() { + message = other1877.message; + __isset = other1877.__isset; +} +TxnAbortedException& TxnAbortedException::operator=(const TxnAbortedException& other1878) { + message = other1878.message; + __isset = other1878.__isset; + return *this; +} +void TxnAbortedException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TxnAbortedException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* TxnAbortedException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: TxnAbortedException"; + } +} + + +TxnOpenException::~TxnOpenException() noexcept { +} + +TxnOpenException::TxnOpenException() noexcept + : message() { +} + +void TxnOpenException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const TxnOpenException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TxnOpenException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TxnOpenException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TxnOpenException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TxnOpenException &a, TxnOpenException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool TxnOpenException::operator==(const TxnOpenException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +TxnOpenException::TxnOpenException(const TxnOpenException& other1879) : TException() { + message = other1879.message; + __isset = other1879.__isset; +} +TxnOpenException& TxnOpenException::operator=(const TxnOpenException& other1880) { + message = other1880.message; + __isset = other1880.__isset; + return *this; +} +void TxnOpenException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TxnOpenException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* TxnOpenException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: TxnOpenException"; + } +} + + +NoSuchLockException::~NoSuchLockException() noexcept { +} + +NoSuchLockException::NoSuchLockException() noexcept + : message() { +} + +void NoSuchLockException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const NoSuchLockException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NoSuchLockException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t NoSuchLockException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NoSuchLockException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NoSuchLockException &a, NoSuchLockException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool NoSuchLockException::operator==(const NoSuchLockException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +NoSuchLockException::NoSuchLockException(const NoSuchLockException& other1881) : TException() { + message = other1881.message; + __isset = other1881.__isset; +} +NoSuchLockException& NoSuchLockException::operator=(const NoSuchLockException& other1882) { + message = other1882.message; + __isset = other1882.__isset; + return *this; +} +void NoSuchLockException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NoSuchLockException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* NoSuchLockException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: NoSuchLockException"; + } +} + + +CompactionAbortedException::~CompactionAbortedException() noexcept { +} + +CompactionAbortedException::CompactionAbortedException() noexcept + : message() { +} + +void CompactionAbortedException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const CompactionAbortedException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t CompactionAbortedException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t CompactionAbortedException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("CompactionAbortedException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(CompactionAbortedException &a, CompactionAbortedException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool CompactionAbortedException::operator==(const CompactionAbortedException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +CompactionAbortedException::CompactionAbortedException(const CompactionAbortedException& other1883) : TException() { + message = other1883.message; + __isset = other1883.__isset; +} +CompactionAbortedException& CompactionAbortedException::operator=(const CompactionAbortedException& other1884) { + message = other1884.message; + __isset = other1884.__isset; + return *this; +} +void CompactionAbortedException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "CompactionAbortedException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* CompactionAbortedException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: CompactionAbortedException"; + } +} + + +NoSuchCompactionException::~NoSuchCompactionException() noexcept { +} + +NoSuchCompactionException::NoSuchCompactionException() noexcept + : message() { +} + +void NoSuchCompactionException::__set_message(const std::string& val) { + this->message = val; +} +std::ostream& operator<<(std::ostream& out, const NoSuchCompactionException& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t NoSuchCompactionException::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t NoSuchCompactionException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("NoSuchCompactionException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(NoSuchCompactionException &a, NoSuchCompactionException &b) noexcept { + using ::std::swap; + swap(a.message, b.message); + swap(a.__isset, b.__isset); +} + +bool NoSuchCompactionException::operator==(const NoSuchCompactionException & rhs) const +{ + if (!(message == rhs.message)) + return false; + return true; +} + +NoSuchCompactionException::NoSuchCompactionException(const NoSuchCompactionException& other1885) : TException() { + message = other1885.message; + __isset = other1885.__isset; +} +NoSuchCompactionException& NoSuchCompactionException::operator=(const NoSuchCompactionException& other1886) { + message = other1886.message; + __isset = other1886.__isset; + return *this; +} +void NoSuchCompactionException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "NoSuchCompactionException("; + out << "message=" << to_string(message); + out << ")"; +} + +const char* NoSuchCompactionException::what() const noexcept { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: NoSuchCompactionException"; + } +} + +}}} // namespace diff --git a/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.h b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.h new file mode 100644 index 000000000..07e790141 --- /dev/null +++ b/src/iceberg/catalog/hive/gen-cpp/hive_metastore_types.h @@ -0,0 +1,15912 @@ +/** + * Autogenerated by Thrift Compiler (0.23.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef hive_metastore_TYPES_H +#define hive_metastore_TYPES_H + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include "fb303_types.h" + + +namespace Apache { namespace Hadoop { namespace Hive { + +struct HiveObjectType { + enum type { + GLOBAL = 1, + DATABASE = 2, + TABLE = 3, + PARTITION = 4, + COLUMN = 5, + DATACONNECTOR = 6 + }; +}; + +extern const std::map _HiveObjectType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const HiveObjectType::type& val); + +std::string to_string(const HiveObjectType::type& val); + +struct PrincipalType { + enum type { + USER = 1, + ROLE = 2, + GROUP = 3 + }; +}; + +extern const std::map _PrincipalType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const PrincipalType::type& val); + +std::string to_string(const PrincipalType::type& val); + +struct PartitionEventType { + enum type { + LOAD_DONE = 1 + }; +}; + +extern const std::map _PartitionEventType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const PartitionEventType::type& val); + +std::string to_string(const PartitionEventType::type& val); + +struct TxnState { + enum type { + COMMITTED = 1, + ABORTED = 2, + OPEN = 3 + }; +}; + +extern const std::map _TxnState_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TxnState::type& val); + +std::string to_string(const TxnState::type& val); + +struct LockLevel { + enum type { + DB = 1, + TABLE = 2, + PARTITION = 3 + }; +}; + +extern const std::map _LockLevel_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const LockLevel::type& val); + +std::string to_string(const LockLevel::type& val); + +struct LockState { + enum type { + ACQUIRED = 1, + WAITING = 2, + ABORT = 3, + NOT_ACQUIRED = 4 + }; +}; + +extern const std::map _LockState_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const LockState::type& val); + +std::string to_string(const LockState::type& val); + +struct LockType { + enum type { + SHARED_READ = 1, + SHARED_WRITE = 2, + EXCLUSIVE = 3, + EXCL_WRITE = 4 + }; +}; + +extern const std::map _LockType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const LockType::type& val); + +std::string to_string(const LockType::type& val); + +struct CompactionType { + enum type { + MINOR = 1, + MAJOR = 2, + REBALANCE = 3, + ABORT_TXN_CLEANUP = 4 + }; +}; + +extern const std::map _CompactionType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const CompactionType::type& val); + +std::string to_string(const CompactionType::type& val); + +struct GrantRevokeType { + enum type { + GRANT = 1, + REVOKE = 2 + }; +}; + +extern const std::map _GrantRevokeType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const GrantRevokeType::type& val); + +std::string to_string(const GrantRevokeType::type& val); + +struct DataOperationType { + enum type { + SELECT = 1, + INSERT = 2, + UPDATE = 3, + DELETE = 4, + UNSET = 5, + NO_TXN = 6 + }; +}; + +extern const std::map _DataOperationType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const DataOperationType::type& val); + +std::string to_string(const DataOperationType::type& val); + +struct EventRequestType { + enum type { + INSERT = 1, + UPDATE = 2, + DELETE = 3 + }; +}; + +extern const std::map _EventRequestType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const EventRequestType::type& val); + +std::string to_string(const EventRequestType::type& val); + +struct SerdeType { + enum type { + HIVE = 1, + SCHEMA_REGISTRY = 2 + }; +}; + +extern const std::map _SerdeType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const SerdeType::type& val); + +std::string to_string(const SerdeType::type& val); + +struct SchemaType { + enum type { + HIVE = 1, + AVRO = 2 + }; +}; + +extern const std::map _SchemaType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const SchemaType::type& val); + +std::string to_string(const SchemaType::type& val); + +struct SchemaCompatibility { + enum type { + NONE = 1, + BACKWARD = 2, + FORWARD = 3, + BOTH = 4 + }; +}; + +extern const std::map _SchemaCompatibility_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const SchemaCompatibility::type& val); + +std::string to_string(const SchemaCompatibility::type& val); + +struct SchemaValidation { + enum type { + LATEST = 1, + ALL = 2 + }; +}; + +extern const std::map _SchemaValidation_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const SchemaValidation::type& val); + +std::string to_string(const SchemaValidation::type& val); + +struct SchemaVersionState { + enum type { + INITIATED = 1, + START_REVIEW = 2, + CHANGES_REQUIRED = 3, + REVIEWED = 4, + ENABLED = 5, + DISABLED = 6, + ARCHIVED = 7, + DELETED = 8 + }; +}; + +extern const std::map _SchemaVersionState_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const SchemaVersionState::type& val); + +std::string to_string(const SchemaVersionState::type& val); + +struct DatabaseType { + enum type { + NATIVE = 1, + REMOTE = 2 + }; +}; + +extern const std::map _DatabaseType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const DatabaseType::type& val); + +std::string to_string(const DatabaseType::type& val); + +struct FunctionType { + enum type { + JAVA = 1 + }; +}; + +extern const std::map _FunctionType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const FunctionType::type& val); + +std::string to_string(const FunctionType::type& val); + +struct ResourceType { + enum type { + JAR = 1, + FILE = 2, + ARCHIVE = 3 + }; +}; + +extern const std::map _ResourceType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const ResourceType::type& val); + +std::string to_string(const ResourceType::type& val); + +struct TxnType { + enum type { + DEFAULT = 0, + REPL_CREATED = 1, + READ_ONLY = 2, + COMPACTION = 3, + MATER_VIEW_REBUILD = 4, + SOFT_DELETE = 5, + REBALANCE_COMPACTION = 6 + }; +}; + +extern const std::map _TxnType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TxnType::type& val); + +std::string to_string(const TxnType::type& val); + +struct GetTablesExtRequestFields { + enum type { + ACCESS_TYPE = 1, + PROCESSOR_CAPABILITIES = 2, + ALL = 2147483647 + }; +}; + +extern const std::map _GetTablesExtRequestFields_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const GetTablesExtRequestFields::type& val); + +std::string to_string(const GetTablesExtRequestFields::type& val); + +struct CompactionMetricsMetricType { + enum type { + NUM_OBSOLETE_DELTAS = 0, + NUM_DELTAS = 1, + NUM_SMALL_DELTAS = 2 + }; +}; + +extern const std::map _CompactionMetricsMetricType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const CompactionMetricsMetricType::type& val); + +std::string to_string(const CompactionMetricsMetricType::type& val); + +struct FileMetadataExprType { + enum type { + ORC_SARG = 1 + }; +}; + +extern const std::map _FileMetadataExprType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const FileMetadataExprType::type& val); + +std::string to_string(const FileMetadataExprType::type& val); + +struct ClientCapability { + enum type { + TEST_CAPABILITY = 1, + INSERT_ONLY_TABLES = 2 + }; +}; + +extern const std::map _ClientCapability_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const ClientCapability::type& val); + +std::string to_string(const ClientCapability::type& val); + +struct WMResourcePlanStatus { + enum type { + ACTIVE = 1, + ENABLED = 2, + DISABLED = 3 + }; +}; + +extern const std::map _WMResourcePlanStatus_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const WMResourcePlanStatus::type& val); + +std::string to_string(const WMResourcePlanStatus::type& val); + +struct WMPoolSchedulingPolicy { + enum type { + FAIR = 1, + FIFO = 2 + }; +}; + +extern const std::map _WMPoolSchedulingPolicy_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const WMPoolSchedulingPolicy::type& val); + +std::string to_string(const WMPoolSchedulingPolicy::type& val); + +struct ScheduledQueryMaintenanceRequestType { + enum type { + CREATE = 1, + ALTER = 2, + DROP = 3 + }; +}; + +extern const std::map _ScheduledQueryMaintenanceRequestType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryMaintenanceRequestType::type& val); + +std::string to_string(const ScheduledQueryMaintenanceRequestType::type& val); + +struct QueryState { + enum type { + INITED = 0, + EXECUTING = 1, + FAILED = 2, + FINISHED = 3, + TIMED_OUT = 4, + AUTO_DISABLED = 5 + }; +}; + +extern const std::map _QueryState_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const QueryState::type& val); + +std::string to_string(const QueryState::type& val); + +struct PartitionFilterMode { + enum type { + BY_NAMES = 0, + BY_VALUES = 1, + BY_EXPR = 2 + }; +}; + +extern const std::map _PartitionFilterMode_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const PartitionFilterMode::type& val); + +std::string to_string(const PartitionFilterMode::type& val); + +class Version; + +class FieldSchema; + +class EnvironmentContext; + +class SQLPrimaryKey; + +class SQLForeignKey; + +class SQLUniqueConstraint; + +class SQLNotNullConstraint; + +class SQLDefaultConstraint; + +class SQLCheckConstraint; + +class SQLAllTableConstraints; + +class Type; + +class PropertySetRequest; + +class PropertyGetRequest; + +class PropertyGetResponse; + +class HiveObjectRef; + +class PrivilegeGrantInfo; + +class HiveObjectPrivilege; + +class PrivilegeBag; + +class PrincipalPrivilegeSet; + +class GrantRevokePrivilegeRequest; + +class GrantRevokePrivilegeResponse; + +class TruncateTableRequest; + +class TruncateTableResponse; + +class Role; + +class RolePrincipalGrant; + +class GetRoleGrantsForPrincipalRequest; + +class GetRoleGrantsForPrincipalResponse; + +class GetPrincipalsInRoleRequest; + +class GetPrincipalsInRoleResponse; + +class GrantRevokeRoleRequest; + +class GrantRevokeRoleResponse; + +class Catalog; + +class CreateCatalogRequest; + +class AlterCatalogRequest; + +class GetCatalogRequest; + +class GetCatalogResponse; + +class GetCatalogsResponse; + +class DropCatalogRequest; + +class Database; + +class SerDeInfo; + +class Order; + +class SkewedInfo; + +class StorageDescriptor; + +class CreationMetadata; + +class BooleanColumnStatsData; + +class DoubleColumnStatsData; + +class LongColumnStatsData; + +class StringColumnStatsData; + +class BinaryColumnStatsData; + +class Decimal; + +class DecimalColumnStatsData; + +class Date; + +class DateColumnStatsData; + +class Timestamp; + +class TimestampColumnStatsData; + +class ColumnStatisticsData; + +class ColumnStatisticsObj; + +class ColumnStatisticsDesc; + +class ColumnStatistics; + +class FileMetadata; + +class ObjectDictionary; + +class Table; + +class SourceTable; + +class Partition; + +class PartitionWithoutSD; + +class PartitionSpecWithSharedSD; + +class PartitionListComposingSpec; + +class PartitionSpec; + +class AggrStats; + +class SetPartitionsStatsRequest; + +class SetPartitionsStatsResponse; + +class Schema; + +class PrimaryKeysRequest; + +class PrimaryKeysResponse; + +class ForeignKeysRequest; + +class ForeignKeysResponse; + +class UniqueConstraintsRequest; + +class UniqueConstraintsResponse; + +class NotNullConstraintsRequest; + +class NotNullConstraintsResponse; + +class DefaultConstraintsRequest; + +class DefaultConstraintsResponse; + +class CheckConstraintsRequest; + +class CheckConstraintsResponse; + +class AllTableConstraintsRequest; + +class AllTableConstraintsResponse; + +class DropConstraintRequest; + +class AddPrimaryKeyRequest; + +class AddForeignKeyRequest; + +class AddUniqueConstraintRequest; + +class AddNotNullConstraintRequest; + +class AddDefaultConstraintRequest; + +class AddCheckConstraintRequest; + +class PartitionsByExprResult; + +class PartitionsSpecByExprResult; + +class PartitionsByExprRequest; + +class TableStatsResult; + +class PartitionsStatsResult; + +class TableStatsRequest; + +class PartitionsStatsRequest; + +class AddPartitionsResult; + +class AddPartitionsRequest; + +class DropPartitionsResult; + +class DropPartitionsExpr; + +class RequestPartsSpec; + +class DropPartitionsRequest; + +class DropPartitionRequest; + +class PartitionValuesRequest; + +class PartitionValuesRow; + +class PartitionValuesResponse; + +class GetPartitionsByNamesRequest; + +class GetPartitionsByNamesResult; + +class DataConnector; + +class ResourceUri; + +class Function; + +class TxnInfo; + +class GetOpenTxnsInfoResponse; + +class GetOpenTxnsResponse; + +class OpenTxnRequest; + +class OpenTxnsResponse; + +class AbortTxnRequest; + +class AbortTxnsRequest; + +class CommitTxnKeyValue; + +class WriteEventInfo; + +class ReplLastIdInfo; + +class UpdateTransactionalStatsRequest; + +class CommitTxnRequest; + +class ReplTblWriteIdStateRequest; + +class GetValidWriteIdsRequest; + +class TableValidWriteIds; + +class GetValidWriteIdsResponse; + +class TxnToWriteId; + +class AllocateTableWriteIdsRequest; + +class AllocateTableWriteIdsResponse; + +class MaxAllocatedTableWriteIdRequest; + +class MaxAllocatedTableWriteIdResponse; + +class SeedTableWriteIdsRequest; + +class SeedTxnIdRequest; + +class LockComponent; + +class LockRequest; + +class LockResponse; + +class CheckLockRequest; + +class UnlockRequest; + +class ShowLocksRequest; + +class ShowLocksResponseElement; + +class ShowLocksResponse; + +class HeartbeatRequest; + +class HeartbeatTxnRangeRequest; + +class HeartbeatTxnRangeResponse; + +class CompactionRequest; + +class CompactionInfoStruct; + +class OptionalCompactionInfoStruct; + +class CompactionMetricsDataStruct; + +class CompactionMetricsDataResponse; + +class CompactionMetricsDataRequest; + +class CompactionResponse; + +class ShowCompactRequest; + +class ShowCompactResponseElement; + +class ShowCompactResponse; + +class AbortCompactionRequest; + +class AbortCompactionResponseElement; + +class AbortCompactResponse; + +class GetLatestCommittedCompactionInfoRequest; + +class GetLatestCommittedCompactionInfoResponse; + +class FindNextCompactRequest; + +class AddDynamicPartitions; + +class BasicTxnInfo; + +class NotificationEventRequest; + +class NotificationEvent; + +class NotificationEventResponse; + +class CurrentNotificationEventId; + +class NotificationEventsCountRequest; + +class NotificationEventsCountResponse; + +class InsertEventRequestData; + +class FireEventRequestData; + +class FireEventRequest; + +class FireEventResponse; + +class WriteNotificationLogRequest; + +class WriteNotificationLogResponse; + +class WriteNotificationLogBatchRequest; + +class WriteNotificationLogBatchResponse; + +class MetadataPpdResult; + +class GetFileMetadataByExprResult; + +class GetFileMetadataByExprRequest; + +class GetFileMetadataResult; + +class GetFileMetadataRequest; + +class PutFileMetadataResult; + +class PutFileMetadataRequest; + +class ClearFileMetadataResult; + +class ClearFileMetadataRequest; + +class CacheFileMetadataResult; + +class CacheFileMetadataRequest; + +class GetAllFunctionsResponse; + +class ClientCapabilities; + +class GetProjectionsSpec; + +class GetTableRequest; + +class GetTableResult; + +class GetTablesRequest; + +class GetTablesResult; + +class GetTablesExtRequest; + +class ExtendedTableInfo; + +class DropTableRequest; + +class GetDatabaseRequest; + +class AlterDatabaseRequest; + +class DropDatabaseRequest; + +class CmRecycleRequest; + +class CmRecycleResponse; + +class TableMeta; + +class Materialization; + +class WMResourcePlan; + +class WMNullableResourcePlan; + +class WMPool; + +class WMNullablePool; + +class WMTrigger; + +class WMMapping; + +class WMPoolTrigger; + +class WMFullResourcePlan; + +class WMCreateResourcePlanRequest; + +class WMCreateResourcePlanResponse; + +class WMGetActiveResourcePlanRequest; + +class WMGetActiveResourcePlanResponse; + +class WMGetResourcePlanRequest; + +class WMGetResourcePlanResponse; + +class WMGetAllResourcePlanRequest; + +class WMGetAllResourcePlanResponse; + +class WMAlterResourcePlanRequest; + +class WMAlterResourcePlanResponse; + +class WMValidateResourcePlanRequest; + +class WMValidateResourcePlanResponse; + +class WMDropResourcePlanRequest; + +class WMDropResourcePlanResponse; + +class WMCreateTriggerRequest; + +class WMCreateTriggerResponse; + +class WMAlterTriggerRequest; + +class WMAlterTriggerResponse; + +class WMDropTriggerRequest; + +class WMDropTriggerResponse; + +class WMGetTriggersForResourePlanRequest; + +class WMGetTriggersForResourePlanResponse; + +class WMCreatePoolRequest; + +class WMCreatePoolResponse; + +class WMAlterPoolRequest; + +class WMAlterPoolResponse; + +class WMDropPoolRequest; + +class WMDropPoolResponse; + +class WMCreateOrUpdateMappingRequest; + +class WMCreateOrUpdateMappingResponse; + +class WMDropMappingRequest; + +class WMDropMappingResponse; + +class WMCreateOrDropTriggerToPoolMappingRequest; + +class WMCreateOrDropTriggerToPoolMappingResponse; + +class ISchema; + +class ISchemaName; + +class AlterISchemaRequest; + +class SchemaVersion; + +class SchemaVersionDescriptor; + +class FindSchemasByColsRqst; + +class FindSchemasByColsResp; + +class MapSchemaVersionToSerdeRequest; + +class SetSchemaVersionStateRequest; + +class GetSerdeRequest; + +class RuntimeStat; + +class GetRuntimeStatsRequest; + +class CreateTableRequest; + +class CreateDatabaseRequest; + +class CreateDataConnectorRequest; + +class GetDataConnectorRequest; + +class AlterDataConnectorRequest; + +class DropDataConnectorRequest; + +class ScheduledQueryPollRequest; + +class ScheduledQueryKey; + +class ScheduledQueryPollResponse; + +class ScheduledQuery; + +class ScheduledQueryMaintenanceRequest; + +class ScheduledQueryProgressInfo; + +class AlterPartitionsRequest; + +class AppendPartitionsRequest; + +class AlterPartitionsResponse; + +class RenamePartitionRequest; + +class RenamePartitionResponse; + +class AlterTableRequest; + +class AlterTableResponse; + +class GetPartitionsFilterSpec; + +class GetPartitionsResponse; + +class GetPartitionsRequest; + +class GetFieldsRequest; + +class GetFieldsResponse; + +class GetSchemaRequest; + +class GetSchemaResponse; + +class GetPartitionRequest; + +class GetPartitionResponse; + +class PartitionsRequest; + +class PartitionsResponse; + +class GetPartitionsByFilterRequest; + +class GetPartitionNamesPsRequest; + +class GetPartitionNamesPsResponse; + +class GetPartitionsPsWithAuthRequest; + +class GetPartitionsPsWithAuthResponse; + +class ReplicationMetrics; + +class ReplicationMetricList; + +class GetReplicationMetricsRequest; + +class GetOpenTxnsRequest; + +class StoredProcedureRequest; + +class ListStoredProcedureRequest; + +class StoredProcedure; + +class AddPackageRequest; + +class GetPackageRequest; + +class DropPackageRequest; + +class ListPackageRequest; + +class Package; + +class GetAllWriteEventInfoRequest; + +class MetaException; + +class UnknownTableException; + +class UnknownDBException; + +class AlreadyExistsException; + +class InvalidPartitionException; + +class UnknownPartitionException; + +class InvalidObjectException; + +class NoSuchObjectException; + +class InvalidOperationException; + +class ConfigValSecurityException; + +class InvalidInputException; + +class NoSuchTxnException; + +class TxnAbortedException; + +class TxnOpenException; + +class NoSuchLockException; + +class CompactionAbortedException; + +class NoSuchCompactionException; + +typedef struct _Version__isset { + _Version__isset() : version(false), comments(false) {} + bool version :1; + bool comments :1; +} _Version__isset; + +class Version : public virtual ::apache::thrift::TBase { + public: + + Version(const Version&); + Version& operator=(const Version&); + Version() noexcept; + + virtual ~Version() noexcept; + std::string version; + std::string comments; + + _Version__isset __isset; + + void __set_version(const std::string& val); + + void __set_comments(const std::string& val); + + bool operator == (const Version & rhs) const; + bool operator != (const Version &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Version & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Version &a, Version &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Version& obj); + +typedef struct _FieldSchema__isset { + _FieldSchema__isset() : name(false), type(false), comment(false) {} + bool name :1; + bool type :1; + bool comment :1; +} _FieldSchema__isset; + +class FieldSchema : public virtual ::apache::thrift::TBase { + public: + + FieldSchema(const FieldSchema&); + FieldSchema& operator=(const FieldSchema&); + FieldSchema() noexcept; + + virtual ~FieldSchema() noexcept; + std::string name; + std::string type; + std::string comment; + + _FieldSchema__isset __isset; + + void __set_name(const std::string& val); + + void __set_type(const std::string& val); + + void __set_comment(const std::string& val); + + bool operator == (const FieldSchema & rhs) const; + bool operator != (const FieldSchema &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FieldSchema & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FieldSchema &a, FieldSchema &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FieldSchema& obj); + +typedef struct _EnvironmentContext__isset { + _EnvironmentContext__isset() : properties(false) {} + bool properties :1; +} _EnvironmentContext__isset; + +class EnvironmentContext : public virtual ::apache::thrift::TBase { + public: + + EnvironmentContext(const EnvironmentContext&); + EnvironmentContext& operator=(const EnvironmentContext&); + EnvironmentContext() noexcept; + + virtual ~EnvironmentContext() noexcept; + std::map properties; + + _EnvironmentContext__isset __isset; + + void __set_properties(const std::map & val); + + bool operator == (const EnvironmentContext & rhs) const; + bool operator != (const EnvironmentContext &rhs) const { + return !(*this == rhs); + } + + bool operator < (const EnvironmentContext & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(EnvironmentContext &a, EnvironmentContext &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const EnvironmentContext& obj); + +typedef struct _SQLPrimaryKey__isset { + _SQLPrimaryKey__isset() : table_db(false), table_name(false), column_name(false), key_seq(false), pk_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false), catName(false) {} + bool table_db :1; + bool table_name :1; + bool column_name :1; + bool key_seq :1; + bool pk_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; + bool catName :1; +} _SQLPrimaryKey__isset; + +class SQLPrimaryKey : public virtual ::apache::thrift::TBase { + public: + + SQLPrimaryKey(const SQLPrimaryKey&); + SQLPrimaryKey& operator=(const SQLPrimaryKey&); + SQLPrimaryKey() noexcept; + + virtual ~SQLPrimaryKey() noexcept; + std::string table_db; + std::string table_name; + std::string column_name; + int32_t key_seq; + std::string pk_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + std::string catName; + + _SQLPrimaryKey__isset __isset; + + void __set_table_db(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_column_name(const std::string& val); + + void __set_key_seq(const int32_t val); + + void __set_pk_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + void __set_catName(const std::string& val); + + bool operator == (const SQLPrimaryKey & rhs) const; + bool operator != (const SQLPrimaryKey &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLPrimaryKey & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLPrimaryKey &a, SQLPrimaryKey &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLPrimaryKey& obj); + +typedef struct _SQLForeignKey__isset { + _SQLForeignKey__isset() : pktable_db(false), pktable_name(false), pkcolumn_name(false), fktable_db(false), fktable_name(false), fkcolumn_name(false), key_seq(false), update_rule(false), delete_rule(false), fk_name(false), pk_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false), catName(false) {} + bool pktable_db :1; + bool pktable_name :1; + bool pkcolumn_name :1; + bool fktable_db :1; + bool fktable_name :1; + bool fkcolumn_name :1; + bool key_seq :1; + bool update_rule :1; + bool delete_rule :1; + bool fk_name :1; + bool pk_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; + bool catName :1; +} _SQLForeignKey__isset; + +class SQLForeignKey : public virtual ::apache::thrift::TBase { + public: + + SQLForeignKey(const SQLForeignKey&); + SQLForeignKey& operator=(const SQLForeignKey&); + SQLForeignKey() noexcept; + + virtual ~SQLForeignKey() noexcept; + std::string pktable_db; + std::string pktable_name; + std::string pkcolumn_name; + std::string fktable_db; + std::string fktable_name; + std::string fkcolumn_name; + int32_t key_seq; + int32_t update_rule; + int32_t delete_rule; + std::string fk_name; + std::string pk_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + std::string catName; + + _SQLForeignKey__isset __isset; + + void __set_pktable_db(const std::string& val); + + void __set_pktable_name(const std::string& val); + + void __set_pkcolumn_name(const std::string& val); + + void __set_fktable_db(const std::string& val); + + void __set_fktable_name(const std::string& val); + + void __set_fkcolumn_name(const std::string& val); + + void __set_key_seq(const int32_t val); + + void __set_update_rule(const int32_t val); + + void __set_delete_rule(const int32_t val); + + void __set_fk_name(const std::string& val); + + void __set_pk_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + void __set_catName(const std::string& val); + + bool operator == (const SQLForeignKey & rhs) const; + bool operator != (const SQLForeignKey &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLForeignKey & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLForeignKey &a, SQLForeignKey &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLForeignKey& obj); + +typedef struct _SQLUniqueConstraint__isset { + _SQLUniqueConstraint__isset() : catName(false), table_db(false), table_name(false), column_name(false), key_seq(false), uk_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false) {} + bool catName :1; + bool table_db :1; + bool table_name :1; + bool column_name :1; + bool key_seq :1; + bool uk_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; +} _SQLUniqueConstraint__isset; + +class SQLUniqueConstraint : public virtual ::apache::thrift::TBase { + public: + + SQLUniqueConstraint(const SQLUniqueConstraint&); + SQLUniqueConstraint& operator=(const SQLUniqueConstraint&); + SQLUniqueConstraint() noexcept; + + virtual ~SQLUniqueConstraint() noexcept; + std::string catName; + std::string table_db; + std::string table_name; + std::string column_name; + int32_t key_seq; + std::string uk_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + + _SQLUniqueConstraint__isset __isset; + + void __set_catName(const std::string& val); + + void __set_table_db(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_column_name(const std::string& val); + + void __set_key_seq(const int32_t val); + + void __set_uk_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + bool operator == (const SQLUniqueConstraint & rhs) const; + bool operator != (const SQLUniqueConstraint &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLUniqueConstraint & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLUniqueConstraint &a, SQLUniqueConstraint &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLUniqueConstraint& obj); + +typedef struct _SQLNotNullConstraint__isset { + _SQLNotNullConstraint__isset() : catName(false), table_db(false), table_name(false), column_name(false), nn_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false) {} + bool catName :1; + bool table_db :1; + bool table_name :1; + bool column_name :1; + bool nn_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; +} _SQLNotNullConstraint__isset; + +class SQLNotNullConstraint : public virtual ::apache::thrift::TBase { + public: + + SQLNotNullConstraint(const SQLNotNullConstraint&); + SQLNotNullConstraint& operator=(const SQLNotNullConstraint&); + SQLNotNullConstraint() noexcept; + + virtual ~SQLNotNullConstraint() noexcept; + std::string catName; + std::string table_db; + std::string table_name; + std::string column_name; + std::string nn_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + + _SQLNotNullConstraint__isset __isset; + + void __set_catName(const std::string& val); + + void __set_table_db(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_column_name(const std::string& val); + + void __set_nn_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + bool operator == (const SQLNotNullConstraint & rhs) const; + bool operator != (const SQLNotNullConstraint &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLNotNullConstraint & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLNotNullConstraint &a, SQLNotNullConstraint &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLNotNullConstraint& obj); + +typedef struct _SQLDefaultConstraint__isset { + _SQLDefaultConstraint__isset() : catName(false), table_db(false), table_name(false), column_name(false), default_value(false), dc_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false) {} + bool catName :1; + bool table_db :1; + bool table_name :1; + bool column_name :1; + bool default_value :1; + bool dc_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; +} _SQLDefaultConstraint__isset; + +class SQLDefaultConstraint : public virtual ::apache::thrift::TBase { + public: + + SQLDefaultConstraint(const SQLDefaultConstraint&); + SQLDefaultConstraint& operator=(const SQLDefaultConstraint&); + SQLDefaultConstraint() noexcept; + + virtual ~SQLDefaultConstraint() noexcept; + std::string catName; + std::string table_db; + std::string table_name; + std::string column_name; + std::string default_value; + std::string dc_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + + _SQLDefaultConstraint__isset __isset; + + void __set_catName(const std::string& val); + + void __set_table_db(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_column_name(const std::string& val); + + void __set_default_value(const std::string& val); + + void __set_dc_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + bool operator == (const SQLDefaultConstraint & rhs) const; + bool operator != (const SQLDefaultConstraint &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLDefaultConstraint & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLDefaultConstraint &a, SQLDefaultConstraint &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLDefaultConstraint& obj); + +typedef struct _SQLCheckConstraint__isset { + _SQLCheckConstraint__isset() : catName(false), table_db(false), table_name(false), column_name(false), check_expression(false), dc_name(false), enable_cstr(false), validate_cstr(false), rely_cstr(false) {} + bool catName :1; + bool table_db :1; + bool table_name :1; + bool column_name :1; + bool check_expression :1; + bool dc_name :1; + bool enable_cstr :1; + bool validate_cstr :1; + bool rely_cstr :1; +} _SQLCheckConstraint__isset; + +class SQLCheckConstraint : public virtual ::apache::thrift::TBase { + public: + + SQLCheckConstraint(const SQLCheckConstraint&); + SQLCheckConstraint& operator=(const SQLCheckConstraint&); + SQLCheckConstraint() noexcept; + + virtual ~SQLCheckConstraint() noexcept; + std::string catName; + std::string table_db; + std::string table_name; + std::string column_name; + std::string check_expression; + std::string dc_name; + bool enable_cstr; + bool validate_cstr; + bool rely_cstr; + + _SQLCheckConstraint__isset __isset; + + void __set_catName(const std::string& val); + + void __set_table_db(const std::string& val); + + void __set_table_name(const std::string& val); + + void __set_column_name(const std::string& val); + + void __set_check_expression(const std::string& val); + + void __set_dc_name(const std::string& val); + + void __set_enable_cstr(const bool val); + + void __set_validate_cstr(const bool val); + + void __set_rely_cstr(const bool val); + + bool operator == (const SQLCheckConstraint & rhs) const; + bool operator != (const SQLCheckConstraint &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLCheckConstraint & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLCheckConstraint &a, SQLCheckConstraint &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLCheckConstraint& obj); + +typedef struct _SQLAllTableConstraints__isset { + _SQLAllTableConstraints__isset() : primaryKeys(false), foreignKeys(false), uniqueConstraints(false), notNullConstraints(false), defaultConstraints(false), checkConstraints(false) {} + bool primaryKeys :1; + bool foreignKeys :1; + bool uniqueConstraints :1; + bool notNullConstraints :1; + bool defaultConstraints :1; + bool checkConstraints :1; +} _SQLAllTableConstraints__isset; + +class SQLAllTableConstraints : public virtual ::apache::thrift::TBase { + public: + + SQLAllTableConstraints(const SQLAllTableConstraints&); + SQLAllTableConstraints& operator=(const SQLAllTableConstraints&); + SQLAllTableConstraints() noexcept; + + virtual ~SQLAllTableConstraints() noexcept; + std::vector primaryKeys; + std::vector foreignKeys; + std::vector uniqueConstraints; + std::vector notNullConstraints; + std::vector defaultConstraints; + std::vector checkConstraints; + + _SQLAllTableConstraints__isset __isset; + + void __set_primaryKeys(const std::vector & val); + + void __set_foreignKeys(const std::vector & val); + + void __set_uniqueConstraints(const std::vector & val); + + void __set_notNullConstraints(const std::vector & val); + + void __set_defaultConstraints(const std::vector & val); + + void __set_checkConstraints(const std::vector & val); + + bool operator == (const SQLAllTableConstraints & rhs) const; + bool operator != (const SQLAllTableConstraints &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SQLAllTableConstraints & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SQLAllTableConstraints &a, SQLAllTableConstraints &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SQLAllTableConstraints& obj); + +typedef struct _Type__isset { + _Type__isset() : name(false), type1(false), type2(false), fields(false) {} + bool name :1; + bool type1 :1; + bool type2 :1; + bool fields :1; +} _Type__isset; + +class Type : public virtual ::apache::thrift::TBase { + public: + + Type(const Type&); + Type& operator=(const Type&); + Type() noexcept; + + virtual ~Type() noexcept; + std::string name; + std::string type1; + std::string type2; + std::vector fields; + + _Type__isset __isset; + + void __set_name(const std::string& val); + + void __set_type1(const std::string& val); + + void __set_type2(const std::string& val); + + void __set_fields(const std::vector & val); + + bool operator == (const Type & rhs) const; + bool operator != (const Type &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Type & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Type &a, Type &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Type& obj); + +typedef struct _PropertySetRequest__isset { + _PropertySetRequest__isset() : propertyMap(false) {} + bool propertyMap :1; +} _PropertySetRequest__isset; + +class PropertySetRequest : public virtual ::apache::thrift::TBase { + public: + + PropertySetRequest(const PropertySetRequest&); + PropertySetRequest& operator=(const PropertySetRequest&); + PropertySetRequest() noexcept; + + virtual ~PropertySetRequest() noexcept; + std::string nameSpace; + std::map propertyMap; + + _PropertySetRequest__isset __isset; + + void __set_nameSpace(const std::string& val); + + void __set_propertyMap(const std::map & val); + + bool operator == (const PropertySetRequest & rhs) const; + bool operator != (const PropertySetRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PropertySetRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PropertySetRequest &a, PropertySetRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PropertySetRequest& obj); + +typedef struct _PropertyGetRequest__isset { + _PropertyGetRequest__isset() : mapPrefix(false), mapPredicate(false), mapSelection(false) {} + bool mapPrefix :1; + bool mapPredicate :1; + bool mapSelection :1; +} _PropertyGetRequest__isset; + +class PropertyGetRequest : public virtual ::apache::thrift::TBase { + public: + + PropertyGetRequest(const PropertyGetRequest&); + PropertyGetRequest& operator=(const PropertyGetRequest&); + PropertyGetRequest() noexcept; + + virtual ~PropertyGetRequest() noexcept; + std::string nameSpace; + std::string mapPrefix; + std::string mapPredicate; + std::vector mapSelection; + + _PropertyGetRequest__isset __isset; + + void __set_nameSpace(const std::string& val); + + void __set_mapPrefix(const std::string& val); + + void __set_mapPredicate(const std::string& val); + + void __set_mapSelection(const std::vector & val); + + bool operator == (const PropertyGetRequest & rhs) const; + bool operator != (const PropertyGetRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PropertyGetRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PropertyGetRequest &a, PropertyGetRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PropertyGetRequest& obj); + +typedef struct _PropertyGetResponse__isset { + _PropertyGetResponse__isset() : properties(false) {} + bool properties :1; +} _PropertyGetResponse__isset; + +class PropertyGetResponse : public virtual ::apache::thrift::TBase { + public: + + PropertyGetResponse(const PropertyGetResponse&); + PropertyGetResponse& operator=(const PropertyGetResponse&); + PropertyGetResponse() noexcept; + + virtual ~PropertyGetResponse() noexcept; + std::map > properties; + + _PropertyGetResponse__isset __isset; + + void __set_properties(const std::map > & val); + + bool operator == (const PropertyGetResponse & rhs) const; + bool operator != (const PropertyGetResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PropertyGetResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PropertyGetResponse &a, PropertyGetResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PropertyGetResponse& obj); + +typedef struct _HiveObjectRef__isset { + _HiveObjectRef__isset() : objectType(false), dbName(false), objectName(false), partValues(false), columnName(false), catName(false) {} + bool objectType :1; + bool dbName :1; + bool objectName :1; + bool partValues :1; + bool columnName :1; + bool catName :1; +} _HiveObjectRef__isset; + +class HiveObjectRef : public virtual ::apache::thrift::TBase { + public: + + HiveObjectRef(const HiveObjectRef&); + HiveObjectRef& operator=(const HiveObjectRef&); + HiveObjectRef() noexcept; + + virtual ~HiveObjectRef() noexcept; + /** + * + * @see HiveObjectType + */ + HiveObjectType::type objectType; + std::string dbName; + std::string objectName; + std::vector partValues; + std::string columnName; + std::string catName; + + _HiveObjectRef__isset __isset; + + void __set_objectType(const HiveObjectType::type val); + + void __set_dbName(const std::string& val); + + void __set_objectName(const std::string& val); + + void __set_partValues(const std::vector & val); + + void __set_columnName(const std::string& val); + + void __set_catName(const std::string& val); + + bool operator == (const HiveObjectRef & rhs) const; + bool operator != (const HiveObjectRef &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HiveObjectRef & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HiveObjectRef &a, HiveObjectRef &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const HiveObjectRef& obj); + +typedef struct _PrivilegeGrantInfo__isset { + _PrivilegeGrantInfo__isset() : privilege(false), createTime(false), grantor(false), grantorType(false), grantOption(false) {} + bool privilege :1; + bool createTime :1; + bool grantor :1; + bool grantorType :1; + bool grantOption :1; +} _PrivilegeGrantInfo__isset; + +class PrivilegeGrantInfo : public virtual ::apache::thrift::TBase { + public: + + PrivilegeGrantInfo(const PrivilegeGrantInfo&); + PrivilegeGrantInfo& operator=(const PrivilegeGrantInfo&); + PrivilegeGrantInfo() noexcept; + + virtual ~PrivilegeGrantInfo() noexcept; + std::string privilege; + int32_t createTime; + std::string grantor; + /** + * + * @see PrincipalType + */ + PrincipalType::type grantorType; + bool grantOption; + + _PrivilegeGrantInfo__isset __isset; + + void __set_privilege(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_grantor(const std::string& val); + + void __set_grantorType(const PrincipalType::type val); + + void __set_grantOption(const bool val); + + bool operator == (const PrivilegeGrantInfo & rhs) const; + bool operator != (const PrivilegeGrantInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PrivilegeGrantInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PrivilegeGrantInfo &a, PrivilegeGrantInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PrivilegeGrantInfo& obj); + +typedef struct _HiveObjectPrivilege__isset { + _HiveObjectPrivilege__isset() : hiveObject(false), principalName(false), principalType(false), grantInfo(false), authorizer(false) {} + bool hiveObject :1; + bool principalName :1; + bool principalType :1; + bool grantInfo :1; + bool authorizer :1; +} _HiveObjectPrivilege__isset; + +class HiveObjectPrivilege : public virtual ::apache::thrift::TBase { + public: + + HiveObjectPrivilege(const HiveObjectPrivilege&); + HiveObjectPrivilege& operator=(const HiveObjectPrivilege&); + HiveObjectPrivilege() noexcept; + + virtual ~HiveObjectPrivilege() noexcept; + HiveObjectRef hiveObject; + std::string principalName; + /** + * + * @see PrincipalType + */ + PrincipalType::type principalType; + PrivilegeGrantInfo grantInfo; + std::string authorizer; + + _HiveObjectPrivilege__isset __isset; + + void __set_hiveObject(const HiveObjectRef& val); + + void __set_principalName(const std::string& val); + + void __set_principalType(const PrincipalType::type val); + + void __set_grantInfo(const PrivilegeGrantInfo& val); + + void __set_authorizer(const std::string& val); + + bool operator == (const HiveObjectPrivilege & rhs) const; + bool operator != (const HiveObjectPrivilege &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HiveObjectPrivilege & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HiveObjectPrivilege &a, HiveObjectPrivilege &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const HiveObjectPrivilege& obj); + +typedef struct _PrivilegeBag__isset { + _PrivilegeBag__isset() : privileges(false) {} + bool privileges :1; +} _PrivilegeBag__isset; + +class PrivilegeBag : public virtual ::apache::thrift::TBase { + public: + + PrivilegeBag(const PrivilegeBag&); + PrivilegeBag& operator=(const PrivilegeBag&); + PrivilegeBag() noexcept; + + virtual ~PrivilegeBag() noexcept; + std::vector privileges; + + _PrivilegeBag__isset __isset; + + void __set_privileges(const std::vector & val); + + bool operator == (const PrivilegeBag & rhs) const; + bool operator != (const PrivilegeBag &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PrivilegeBag & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PrivilegeBag &a, PrivilegeBag &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PrivilegeBag& obj); + +typedef struct _PrincipalPrivilegeSet__isset { + _PrincipalPrivilegeSet__isset() : userPrivileges(false), groupPrivileges(false), rolePrivileges(false) {} + bool userPrivileges :1; + bool groupPrivileges :1; + bool rolePrivileges :1; +} _PrincipalPrivilegeSet__isset; + +class PrincipalPrivilegeSet : public virtual ::apache::thrift::TBase { + public: + + PrincipalPrivilegeSet(const PrincipalPrivilegeSet&); + PrincipalPrivilegeSet& operator=(const PrincipalPrivilegeSet&); + PrincipalPrivilegeSet() noexcept; + + virtual ~PrincipalPrivilegeSet() noexcept; + std::map > userPrivileges; + std::map > groupPrivileges; + std::map > rolePrivileges; + + _PrincipalPrivilegeSet__isset __isset; + + void __set_userPrivileges(const std::map > & val); + + void __set_groupPrivileges(const std::map > & val); + + void __set_rolePrivileges(const std::map > & val); + + bool operator == (const PrincipalPrivilegeSet & rhs) const; + bool operator != (const PrincipalPrivilegeSet &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PrincipalPrivilegeSet & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PrincipalPrivilegeSet &a, PrincipalPrivilegeSet &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PrincipalPrivilegeSet& obj); + +typedef struct _GrantRevokePrivilegeRequest__isset { + _GrantRevokePrivilegeRequest__isset() : requestType(false), privileges(false), revokeGrantOption(false) {} + bool requestType :1; + bool privileges :1; + bool revokeGrantOption :1; +} _GrantRevokePrivilegeRequest__isset; + +class GrantRevokePrivilegeRequest : public virtual ::apache::thrift::TBase { + public: + + GrantRevokePrivilegeRequest(const GrantRevokePrivilegeRequest&); + GrantRevokePrivilegeRequest& operator=(const GrantRevokePrivilegeRequest&); + GrantRevokePrivilegeRequest() noexcept; + + virtual ~GrantRevokePrivilegeRequest() noexcept; + /** + * + * @see GrantRevokeType + */ + GrantRevokeType::type requestType; + PrivilegeBag privileges; + bool revokeGrantOption; + + _GrantRevokePrivilegeRequest__isset __isset; + + void __set_requestType(const GrantRevokeType::type val); + + void __set_privileges(const PrivilegeBag& val); + + void __set_revokeGrantOption(const bool val); + + bool operator == (const GrantRevokePrivilegeRequest & rhs) const; + bool operator != (const GrantRevokePrivilegeRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GrantRevokePrivilegeRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GrantRevokePrivilegeRequest &a, GrantRevokePrivilegeRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GrantRevokePrivilegeRequest& obj); + +typedef struct _GrantRevokePrivilegeResponse__isset { + _GrantRevokePrivilegeResponse__isset() : success(false) {} + bool success :1; +} _GrantRevokePrivilegeResponse__isset; + +class GrantRevokePrivilegeResponse : public virtual ::apache::thrift::TBase { + public: + + GrantRevokePrivilegeResponse(const GrantRevokePrivilegeResponse&) noexcept; + GrantRevokePrivilegeResponse& operator=(const GrantRevokePrivilegeResponse&) noexcept; + GrantRevokePrivilegeResponse() noexcept; + + virtual ~GrantRevokePrivilegeResponse() noexcept; + bool success; + + _GrantRevokePrivilegeResponse__isset __isset; + + void __set_success(const bool val); + + bool operator == (const GrantRevokePrivilegeResponse & rhs) const; + bool operator != (const GrantRevokePrivilegeResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GrantRevokePrivilegeResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GrantRevokePrivilegeResponse &a, GrantRevokePrivilegeResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GrantRevokePrivilegeResponse& obj); + +typedef struct _TruncateTableRequest__isset { + _TruncateTableRequest__isset() : partNames(false), writeId(true), validWriteIdList(false), environmentContext(false) {} + bool partNames :1; + bool writeId :1; + bool validWriteIdList :1; + bool environmentContext :1; +} _TruncateTableRequest__isset; + +class TruncateTableRequest : public virtual ::apache::thrift::TBase { + public: + + TruncateTableRequest(const TruncateTableRequest&); + TruncateTableRequest& operator=(const TruncateTableRequest&); + TruncateTableRequest() noexcept; + + virtual ~TruncateTableRequest() noexcept; + std::string dbName; + std::string tableName; + std::vector partNames; + int64_t writeId; + std::string validWriteIdList; + EnvironmentContext environmentContext; + + _TruncateTableRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partNames(const std::vector & val); + + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_environmentContext(const EnvironmentContext& val); + + bool operator == (const TruncateTableRequest & rhs) const; + bool operator != (const TruncateTableRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TruncateTableRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TruncateTableRequest &a, TruncateTableRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TruncateTableRequest& obj); + + +class TruncateTableResponse : public virtual ::apache::thrift::TBase { + public: + + TruncateTableResponse(const TruncateTableResponse&) noexcept; + TruncateTableResponse& operator=(const TruncateTableResponse&) noexcept; + TruncateTableResponse() noexcept; + + virtual ~TruncateTableResponse() noexcept; + + bool operator == (const TruncateTableResponse & /* rhs */) const; + bool operator != (const TruncateTableResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TruncateTableResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TruncateTableResponse &a, TruncateTableResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TruncateTableResponse& obj); + +typedef struct _Role__isset { + _Role__isset() : roleName(false), createTime(false), ownerName(false) {} + bool roleName :1; + bool createTime :1; + bool ownerName :1; +} _Role__isset; + +class Role : public virtual ::apache::thrift::TBase { + public: + + Role(const Role&); + Role& operator=(const Role&); + Role() noexcept; + + virtual ~Role() noexcept; + std::string roleName; + int32_t createTime; + std::string ownerName; + + _Role__isset __isset; + + void __set_roleName(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_ownerName(const std::string& val); + + bool operator == (const Role & rhs) const; + bool operator != (const Role &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Role & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Role &a, Role &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Role& obj); + +typedef struct _RolePrincipalGrant__isset { + _RolePrincipalGrant__isset() : roleName(false), principalName(false), principalType(false), grantOption(false), grantTime(false), grantorName(false), grantorPrincipalType(false) {} + bool roleName :1; + bool principalName :1; + bool principalType :1; + bool grantOption :1; + bool grantTime :1; + bool grantorName :1; + bool grantorPrincipalType :1; +} _RolePrincipalGrant__isset; + +class RolePrincipalGrant : public virtual ::apache::thrift::TBase { + public: + + RolePrincipalGrant(const RolePrincipalGrant&); + RolePrincipalGrant& operator=(const RolePrincipalGrant&); + RolePrincipalGrant() noexcept; + + virtual ~RolePrincipalGrant() noexcept; + std::string roleName; + std::string principalName; + /** + * + * @see PrincipalType + */ + PrincipalType::type principalType; + bool grantOption; + int32_t grantTime; + std::string grantorName; + /** + * + * @see PrincipalType + */ + PrincipalType::type grantorPrincipalType; + + _RolePrincipalGrant__isset __isset; + + void __set_roleName(const std::string& val); + + void __set_principalName(const std::string& val); + + void __set_principalType(const PrincipalType::type val); + + void __set_grantOption(const bool val); + + void __set_grantTime(const int32_t val); + + void __set_grantorName(const std::string& val); + + void __set_grantorPrincipalType(const PrincipalType::type val); + + bool operator == (const RolePrincipalGrant & rhs) const; + bool operator != (const RolePrincipalGrant &rhs) const { + return !(*this == rhs); + } + + bool operator < (const RolePrincipalGrant & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(RolePrincipalGrant &a, RolePrincipalGrant &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const RolePrincipalGrant& obj); + + +class GetRoleGrantsForPrincipalRequest : public virtual ::apache::thrift::TBase { + public: + + GetRoleGrantsForPrincipalRequest(const GetRoleGrantsForPrincipalRequest&); + GetRoleGrantsForPrincipalRequest& operator=(const GetRoleGrantsForPrincipalRequest&); + GetRoleGrantsForPrincipalRequest() noexcept; + + virtual ~GetRoleGrantsForPrincipalRequest() noexcept; + std::string principal_name; + /** + * + * @see PrincipalType + */ + PrincipalType::type principal_type; + + void __set_principal_name(const std::string& val); + + void __set_principal_type(const PrincipalType::type val); + + bool operator == (const GetRoleGrantsForPrincipalRequest & rhs) const; + bool operator != (const GetRoleGrantsForPrincipalRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetRoleGrantsForPrincipalRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetRoleGrantsForPrincipalRequest &a, GetRoleGrantsForPrincipalRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetRoleGrantsForPrincipalRequest& obj); + + +class GetRoleGrantsForPrincipalResponse : public virtual ::apache::thrift::TBase { + public: + + GetRoleGrantsForPrincipalResponse(const GetRoleGrantsForPrincipalResponse&); + GetRoleGrantsForPrincipalResponse& operator=(const GetRoleGrantsForPrincipalResponse&); + GetRoleGrantsForPrincipalResponse() noexcept; + + virtual ~GetRoleGrantsForPrincipalResponse() noexcept; + std::vector principalGrants; + + void __set_principalGrants(const std::vector & val); + + bool operator == (const GetRoleGrantsForPrincipalResponse & rhs) const; + bool operator != (const GetRoleGrantsForPrincipalResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetRoleGrantsForPrincipalResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetRoleGrantsForPrincipalResponse &a, GetRoleGrantsForPrincipalResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetRoleGrantsForPrincipalResponse& obj); + + +class GetPrincipalsInRoleRequest : public virtual ::apache::thrift::TBase { + public: + + GetPrincipalsInRoleRequest(const GetPrincipalsInRoleRequest&); + GetPrincipalsInRoleRequest& operator=(const GetPrincipalsInRoleRequest&); + GetPrincipalsInRoleRequest() noexcept; + + virtual ~GetPrincipalsInRoleRequest() noexcept; + std::string roleName; + + void __set_roleName(const std::string& val); + + bool operator == (const GetPrincipalsInRoleRequest & rhs) const; + bool operator != (const GetPrincipalsInRoleRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPrincipalsInRoleRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPrincipalsInRoleRequest &a, GetPrincipalsInRoleRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPrincipalsInRoleRequest& obj); + + +class GetPrincipalsInRoleResponse : public virtual ::apache::thrift::TBase { + public: + + GetPrincipalsInRoleResponse(const GetPrincipalsInRoleResponse&); + GetPrincipalsInRoleResponse& operator=(const GetPrincipalsInRoleResponse&); + GetPrincipalsInRoleResponse() noexcept; + + virtual ~GetPrincipalsInRoleResponse() noexcept; + std::vector principalGrants; + + void __set_principalGrants(const std::vector & val); + + bool operator == (const GetPrincipalsInRoleResponse & rhs) const; + bool operator != (const GetPrincipalsInRoleResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPrincipalsInRoleResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPrincipalsInRoleResponse &a, GetPrincipalsInRoleResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPrincipalsInRoleResponse& obj); + +typedef struct _GrantRevokeRoleRequest__isset { + _GrantRevokeRoleRequest__isset() : requestType(false), roleName(false), principalName(false), principalType(false), grantor(false), grantorType(false), grantOption(false) {} + bool requestType :1; + bool roleName :1; + bool principalName :1; + bool principalType :1; + bool grantor :1; + bool grantorType :1; + bool grantOption :1; +} _GrantRevokeRoleRequest__isset; + +class GrantRevokeRoleRequest : public virtual ::apache::thrift::TBase { + public: + + GrantRevokeRoleRequest(const GrantRevokeRoleRequest&); + GrantRevokeRoleRequest& operator=(const GrantRevokeRoleRequest&); + GrantRevokeRoleRequest() noexcept; + + virtual ~GrantRevokeRoleRequest() noexcept; + /** + * + * @see GrantRevokeType + */ + GrantRevokeType::type requestType; + std::string roleName; + std::string principalName; + /** + * + * @see PrincipalType + */ + PrincipalType::type principalType; + std::string grantor; + /** + * + * @see PrincipalType + */ + PrincipalType::type grantorType; + bool grantOption; + + _GrantRevokeRoleRequest__isset __isset; + + void __set_requestType(const GrantRevokeType::type val); + + void __set_roleName(const std::string& val); + + void __set_principalName(const std::string& val); + + void __set_principalType(const PrincipalType::type val); + + void __set_grantor(const std::string& val); + + void __set_grantorType(const PrincipalType::type val); + + void __set_grantOption(const bool val); + + bool operator == (const GrantRevokeRoleRequest & rhs) const; + bool operator != (const GrantRevokeRoleRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GrantRevokeRoleRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GrantRevokeRoleRequest &a, GrantRevokeRoleRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GrantRevokeRoleRequest& obj); + +typedef struct _GrantRevokeRoleResponse__isset { + _GrantRevokeRoleResponse__isset() : success(false) {} + bool success :1; +} _GrantRevokeRoleResponse__isset; + +class GrantRevokeRoleResponse : public virtual ::apache::thrift::TBase { + public: + + GrantRevokeRoleResponse(const GrantRevokeRoleResponse&) noexcept; + GrantRevokeRoleResponse& operator=(const GrantRevokeRoleResponse&) noexcept; + GrantRevokeRoleResponse() noexcept; + + virtual ~GrantRevokeRoleResponse() noexcept; + bool success; + + _GrantRevokeRoleResponse__isset __isset; + + void __set_success(const bool val); + + bool operator == (const GrantRevokeRoleResponse & rhs) const; + bool operator != (const GrantRevokeRoleResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GrantRevokeRoleResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GrantRevokeRoleResponse &a, GrantRevokeRoleResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GrantRevokeRoleResponse& obj); + +typedef struct _Catalog__isset { + _Catalog__isset() : name(false), description(false), locationUri(false), createTime(false) {} + bool name :1; + bool description :1; + bool locationUri :1; + bool createTime :1; +} _Catalog__isset; + +class Catalog : public virtual ::apache::thrift::TBase { + public: + + Catalog(const Catalog&); + Catalog& operator=(const Catalog&); + Catalog() noexcept; + + virtual ~Catalog() noexcept; + std::string name; + std::string description; + std::string locationUri; + int32_t createTime; + + _Catalog__isset __isset; + + void __set_name(const std::string& val); + + void __set_description(const std::string& val); + + void __set_locationUri(const std::string& val); + + void __set_createTime(const int32_t val); + + bool operator == (const Catalog & rhs) const; + bool operator != (const Catalog &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Catalog & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Catalog &a, Catalog &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Catalog& obj); + +typedef struct _CreateCatalogRequest__isset { + _CreateCatalogRequest__isset() : catalog(false) {} + bool catalog :1; +} _CreateCatalogRequest__isset; + +class CreateCatalogRequest : public virtual ::apache::thrift::TBase { + public: + + CreateCatalogRequest(const CreateCatalogRequest&); + CreateCatalogRequest& operator=(const CreateCatalogRequest&); + CreateCatalogRequest() noexcept; + + virtual ~CreateCatalogRequest() noexcept; + Catalog catalog; + + _CreateCatalogRequest__isset __isset; + + void __set_catalog(const Catalog& val); + + bool operator == (const CreateCatalogRequest & rhs) const; + bool operator != (const CreateCatalogRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CreateCatalogRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CreateCatalogRequest &a, CreateCatalogRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CreateCatalogRequest& obj); + +typedef struct _AlterCatalogRequest__isset { + _AlterCatalogRequest__isset() : name(false), newCat(false) {} + bool name :1; + bool newCat :1; +} _AlterCatalogRequest__isset; + +class AlterCatalogRequest : public virtual ::apache::thrift::TBase { + public: + + AlterCatalogRequest(const AlterCatalogRequest&); + AlterCatalogRequest& operator=(const AlterCatalogRequest&); + AlterCatalogRequest() noexcept; + + virtual ~AlterCatalogRequest() noexcept; + std::string name; + Catalog newCat; + + _AlterCatalogRequest__isset __isset; + + void __set_name(const std::string& val); + + void __set_newCat(const Catalog& val); + + bool operator == (const AlterCatalogRequest & rhs) const; + bool operator != (const AlterCatalogRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterCatalogRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterCatalogRequest &a, AlterCatalogRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterCatalogRequest& obj); + +typedef struct _GetCatalogRequest__isset { + _GetCatalogRequest__isset() : name(false) {} + bool name :1; +} _GetCatalogRequest__isset; + +class GetCatalogRequest : public virtual ::apache::thrift::TBase { + public: + + GetCatalogRequest(const GetCatalogRequest&); + GetCatalogRequest& operator=(const GetCatalogRequest&); + GetCatalogRequest() noexcept; + + virtual ~GetCatalogRequest() noexcept; + std::string name; + + _GetCatalogRequest__isset __isset; + + void __set_name(const std::string& val); + + bool operator == (const GetCatalogRequest & rhs) const; + bool operator != (const GetCatalogRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetCatalogRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetCatalogRequest &a, GetCatalogRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetCatalogRequest& obj); + +typedef struct _GetCatalogResponse__isset { + _GetCatalogResponse__isset() : catalog(false) {} + bool catalog :1; +} _GetCatalogResponse__isset; + +class GetCatalogResponse : public virtual ::apache::thrift::TBase { + public: + + GetCatalogResponse(const GetCatalogResponse&); + GetCatalogResponse& operator=(const GetCatalogResponse&); + GetCatalogResponse() noexcept; + + virtual ~GetCatalogResponse() noexcept; + Catalog catalog; + + _GetCatalogResponse__isset __isset; + + void __set_catalog(const Catalog& val); + + bool operator == (const GetCatalogResponse & rhs) const; + bool operator != (const GetCatalogResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetCatalogResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetCatalogResponse &a, GetCatalogResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetCatalogResponse& obj); + +typedef struct _GetCatalogsResponse__isset { + _GetCatalogsResponse__isset() : names(false) {} + bool names :1; +} _GetCatalogsResponse__isset; + +class GetCatalogsResponse : public virtual ::apache::thrift::TBase { + public: + + GetCatalogsResponse(const GetCatalogsResponse&); + GetCatalogsResponse& operator=(const GetCatalogsResponse&); + GetCatalogsResponse() noexcept; + + virtual ~GetCatalogsResponse() noexcept; + std::vector names; + + _GetCatalogsResponse__isset __isset; + + void __set_names(const std::vector & val); + + bool operator == (const GetCatalogsResponse & rhs) const; + bool operator != (const GetCatalogsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetCatalogsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetCatalogsResponse &a, GetCatalogsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetCatalogsResponse& obj); + +typedef struct _DropCatalogRequest__isset { + _DropCatalogRequest__isset() : name(false) {} + bool name :1; +} _DropCatalogRequest__isset; + +class DropCatalogRequest : public virtual ::apache::thrift::TBase { + public: + + DropCatalogRequest(const DropCatalogRequest&); + DropCatalogRequest& operator=(const DropCatalogRequest&); + DropCatalogRequest() noexcept; + + virtual ~DropCatalogRequest() noexcept; + std::string name; + + _DropCatalogRequest__isset __isset; + + void __set_name(const std::string& val); + + bool operator == (const DropCatalogRequest & rhs) const; + bool operator != (const DropCatalogRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropCatalogRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropCatalogRequest &a, DropCatalogRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropCatalogRequest& obj); + +typedef struct _Database__isset { + _Database__isset() : name(false), description(false), locationUri(false), parameters(false), privileges(false), ownerName(false), ownerType(false), catalogName(false), createTime(false), managedLocationUri(false), type(false), connector_name(false), remote_dbname(false) {} + bool name :1; + bool description :1; + bool locationUri :1; + bool parameters :1; + bool privileges :1; + bool ownerName :1; + bool ownerType :1; + bool catalogName :1; + bool createTime :1; + bool managedLocationUri :1; + bool type :1; + bool connector_name :1; + bool remote_dbname :1; +} _Database__isset; + +class Database : public virtual ::apache::thrift::TBase { + public: + + Database(const Database&); + Database& operator=(const Database&); + Database() noexcept; + + virtual ~Database() noexcept; + std::string name; + std::string description; + std::string locationUri; + std::map parameters; + PrincipalPrivilegeSet privileges; + std::string ownerName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + std::string catalogName; + int32_t createTime; + std::string managedLocationUri; + /** + * + * @see DatabaseType + */ + DatabaseType::type type; + std::string connector_name; + std::string remote_dbname; + + _Database__isset __isset; + + void __set_name(const std::string& val); + + void __set_description(const std::string& val); + + void __set_locationUri(const std::string& val); + + void __set_parameters(const std::map & val); + + void __set_privileges(const PrincipalPrivilegeSet& val); + + void __set_ownerName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + void __set_catalogName(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_managedLocationUri(const std::string& val); + + void __set_type(const DatabaseType::type val); + + void __set_connector_name(const std::string& val); + + void __set_remote_dbname(const std::string& val); + + bool operator == (const Database & rhs) const; + bool operator != (const Database &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Database & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Database &a, Database &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Database& obj); + +typedef struct _SerDeInfo__isset { + _SerDeInfo__isset() : name(false), serializationLib(false), parameters(false), description(false), serializerClass(false), deserializerClass(false), serdeType(false) {} + bool name :1; + bool serializationLib :1; + bool parameters :1; + bool description :1; + bool serializerClass :1; + bool deserializerClass :1; + bool serdeType :1; +} _SerDeInfo__isset; + +class SerDeInfo : public virtual ::apache::thrift::TBase { + public: + + SerDeInfo(const SerDeInfo&); + SerDeInfo& operator=(const SerDeInfo&); + SerDeInfo() noexcept; + + virtual ~SerDeInfo() noexcept; + std::string name; + std::string serializationLib; + std::map parameters; + std::string description; + std::string serializerClass; + std::string deserializerClass; + /** + * + * @see SerdeType + */ + SerdeType::type serdeType; + + _SerDeInfo__isset __isset; + + void __set_name(const std::string& val); + + void __set_serializationLib(const std::string& val); + + void __set_parameters(const std::map & val); + + void __set_description(const std::string& val); + + void __set_serializerClass(const std::string& val); + + void __set_deserializerClass(const std::string& val); + + void __set_serdeType(const SerdeType::type val); + + bool operator == (const SerDeInfo & rhs) const; + bool operator != (const SerDeInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SerDeInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SerDeInfo &a, SerDeInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SerDeInfo& obj); + +typedef struct _Order__isset { + _Order__isset() : col(false), order(false) {} + bool col :1; + bool order :1; +} _Order__isset; + +class Order : public virtual ::apache::thrift::TBase { + public: + + Order(const Order&); + Order& operator=(const Order&); + Order() noexcept; + + virtual ~Order() noexcept; + std::string col; + int32_t order; + + _Order__isset __isset; + + void __set_col(const std::string& val); + + void __set_order(const int32_t val); + + bool operator == (const Order & rhs) const; + bool operator != (const Order &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Order & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Order &a, Order &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Order& obj); + +typedef struct _SkewedInfo__isset { + _SkewedInfo__isset() : skewedColNames(false), skewedColValues(false), skewedColValueLocationMaps(false) {} + bool skewedColNames :1; + bool skewedColValues :1; + bool skewedColValueLocationMaps :1; +} _SkewedInfo__isset; + +class SkewedInfo : public virtual ::apache::thrift::TBase { + public: + + SkewedInfo(const SkewedInfo&); + SkewedInfo& operator=(const SkewedInfo&); + SkewedInfo() noexcept; + + virtual ~SkewedInfo() noexcept; + std::vector skewedColNames; + std::vector > skewedColValues; + std::map , std::string> skewedColValueLocationMaps; + + _SkewedInfo__isset __isset; + + void __set_skewedColNames(const std::vector & val); + + void __set_skewedColValues(const std::vector > & val); + + void __set_skewedColValueLocationMaps(const std::map , std::string> & val); + + bool operator == (const SkewedInfo & rhs) const; + bool operator != (const SkewedInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SkewedInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SkewedInfo &a, SkewedInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SkewedInfo& obj); + +typedef struct _StorageDescriptor__isset { + _StorageDescriptor__isset() : cols(false), location(false), inputFormat(false), outputFormat(false), compressed(false), numBuckets(false), serdeInfo(false), bucketCols(false), sortCols(false), parameters(false), skewedInfo(false), storedAsSubDirectories(false) {} + bool cols :1; + bool location :1; + bool inputFormat :1; + bool outputFormat :1; + bool compressed :1; + bool numBuckets :1; + bool serdeInfo :1; + bool bucketCols :1; + bool sortCols :1; + bool parameters :1; + bool skewedInfo :1; + bool storedAsSubDirectories :1; +} _StorageDescriptor__isset; + +class StorageDescriptor : public virtual ::apache::thrift::TBase { + public: + + StorageDescriptor(const StorageDescriptor&); + StorageDescriptor& operator=(const StorageDescriptor&); + StorageDescriptor() noexcept; + + virtual ~StorageDescriptor() noexcept; + std::vector cols; + std::string location; + std::string inputFormat; + std::string outputFormat; + bool compressed; + int32_t numBuckets; + SerDeInfo serdeInfo; + std::vector bucketCols; + std::vector sortCols; + std::map parameters; + SkewedInfo skewedInfo; + bool storedAsSubDirectories; + + _StorageDescriptor__isset __isset; + + void __set_cols(const std::vector & val); + + void __set_location(const std::string& val); + + void __set_inputFormat(const std::string& val); + + void __set_outputFormat(const std::string& val); + + void __set_compressed(const bool val); + + void __set_numBuckets(const int32_t val); + + void __set_serdeInfo(const SerDeInfo& val); + + void __set_bucketCols(const std::vector & val); + + void __set_sortCols(const std::vector & val); + + void __set_parameters(const std::map & val); + + void __set_skewedInfo(const SkewedInfo& val); + + void __set_storedAsSubDirectories(const bool val); + + bool operator == (const StorageDescriptor & rhs) const; + bool operator != (const StorageDescriptor &rhs) const { + return !(*this == rhs); + } + + bool operator < (const StorageDescriptor & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(StorageDescriptor &a, StorageDescriptor &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const StorageDescriptor& obj); + +typedef struct _CreationMetadata__isset { + _CreationMetadata__isset() : validTxnList(false), materializationTime(false), sourceTables(false) {} + bool validTxnList :1; + bool materializationTime :1; + bool sourceTables :1; +} _CreationMetadata__isset; + +class CreationMetadata : public virtual ::apache::thrift::TBase { + public: + + CreationMetadata(const CreationMetadata&); + CreationMetadata& operator=(const CreationMetadata&); + CreationMetadata() noexcept; + + virtual ~CreationMetadata() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::set tablesUsed; + std::string validTxnList; + int64_t materializationTime; + std::vector sourceTables; + + _CreationMetadata__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_tablesUsed(const std::set & val); + + void __set_validTxnList(const std::string& val); + + void __set_materializationTime(const int64_t val); + + void __set_sourceTables(const std::vector & val); + + bool operator == (const CreationMetadata & rhs) const; + bool operator != (const CreationMetadata &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CreationMetadata & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CreationMetadata &a, CreationMetadata &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CreationMetadata& obj); + +typedef struct _BooleanColumnStatsData__isset { + _BooleanColumnStatsData__isset() : bitVectors(false) {} + bool bitVectors :1; +} _BooleanColumnStatsData__isset; + +class BooleanColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + BooleanColumnStatsData(const BooleanColumnStatsData&); + BooleanColumnStatsData& operator=(const BooleanColumnStatsData&); + BooleanColumnStatsData() noexcept; + + virtual ~BooleanColumnStatsData() noexcept; + int64_t numTrues; + int64_t numFalses; + int64_t numNulls; + std::string bitVectors; + + _BooleanColumnStatsData__isset __isset; + + void __set_numTrues(const int64_t val); + + void __set_numFalses(const int64_t val); + + void __set_numNulls(const int64_t val); + + void __set_bitVectors(const std::string& val); + + bool operator == (const BooleanColumnStatsData & rhs) const; + bool operator != (const BooleanColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const BooleanColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(BooleanColumnStatsData &a, BooleanColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const BooleanColumnStatsData& obj); + +typedef struct _DoubleColumnStatsData__isset { + _DoubleColumnStatsData__isset() : lowValue(false), highValue(false), bitVectors(false), histogram(false) {} + bool lowValue :1; + bool highValue :1; + bool bitVectors :1; + bool histogram :1; +} _DoubleColumnStatsData__isset; + +class DoubleColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + DoubleColumnStatsData(const DoubleColumnStatsData&); + DoubleColumnStatsData& operator=(const DoubleColumnStatsData&); + DoubleColumnStatsData() noexcept; + + virtual ~DoubleColumnStatsData() noexcept; + double lowValue; + double highValue; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + std::string histogram; + + _DoubleColumnStatsData__isset __isset; + + void __set_lowValue(const double val); + + void __set_highValue(const double val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + void __set_histogram(const std::string& val); + + bool operator == (const DoubleColumnStatsData & rhs) const; + bool operator != (const DoubleColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DoubleColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DoubleColumnStatsData &a, DoubleColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DoubleColumnStatsData& obj); + +typedef struct _LongColumnStatsData__isset { + _LongColumnStatsData__isset() : lowValue(false), highValue(false), bitVectors(false), histogram(false) {} + bool lowValue :1; + bool highValue :1; + bool bitVectors :1; + bool histogram :1; +} _LongColumnStatsData__isset; + +class LongColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + LongColumnStatsData(const LongColumnStatsData&); + LongColumnStatsData& operator=(const LongColumnStatsData&); + LongColumnStatsData() noexcept; + + virtual ~LongColumnStatsData() noexcept; + int64_t lowValue; + int64_t highValue; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + std::string histogram; + + _LongColumnStatsData__isset __isset; + + void __set_lowValue(const int64_t val); + + void __set_highValue(const int64_t val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + void __set_histogram(const std::string& val); + + bool operator == (const LongColumnStatsData & rhs) const; + bool operator != (const LongColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const LongColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(LongColumnStatsData &a, LongColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const LongColumnStatsData& obj); + +typedef struct _StringColumnStatsData__isset { + _StringColumnStatsData__isset() : bitVectors(false) {} + bool bitVectors :1; +} _StringColumnStatsData__isset; + +class StringColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + StringColumnStatsData(const StringColumnStatsData&); + StringColumnStatsData& operator=(const StringColumnStatsData&); + StringColumnStatsData() noexcept; + + virtual ~StringColumnStatsData() noexcept; + int64_t maxColLen; + double avgColLen; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + + _StringColumnStatsData__isset __isset; + + void __set_maxColLen(const int64_t val); + + void __set_avgColLen(const double val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + bool operator == (const StringColumnStatsData & rhs) const; + bool operator != (const StringColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const StringColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(StringColumnStatsData &a, StringColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const StringColumnStatsData& obj); + +typedef struct _BinaryColumnStatsData__isset { + _BinaryColumnStatsData__isset() : bitVectors(false) {} + bool bitVectors :1; +} _BinaryColumnStatsData__isset; + +class BinaryColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + BinaryColumnStatsData(const BinaryColumnStatsData&); + BinaryColumnStatsData& operator=(const BinaryColumnStatsData&); + BinaryColumnStatsData() noexcept; + + virtual ~BinaryColumnStatsData() noexcept; + int64_t maxColLen; + double avgColLen; + int64_t numNulls; + std::string bitVectors; + + _BinaryColumnStatsData__isset __isset; + + void __set_maxColLen(const int64_t val); + + void __set_avgColLen(const double val); + + void __set_numNulls(const int64_t val); + + void __set_bitVectors(const std::string& val); + + bool operator == (const BinaryColumnStatsData & rhs) const; + bool operator != (const BinaryColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const BinaryColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(BinaryColumnStatsData &a, BinaryColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const BinaryColumnStatsData& obj); + + +class Decimal : public virtual ::apache::thrift::TBase { + public: + + Decimal(const Decimal&); + Decimal& operator=(const Decimal&); + Decimal() noexcept; + + virtual ~Decimal() noexcept; + int16_t scale; + std::string unscaled; + + void __set_scale(const int16_t val); + + void __set_unscaled(const std::string& val); + + bool operator == (const Decimal & rhs) const; + bool operator != (const Decimal &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Decimal & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Decimal &a, Decimal &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Decimal& obj); + +typedef struct _DecimalColumnStatsData__isset { + _DecimalColumnStatsData__isset() : lowValue(false), highValue(false), bitVectors(false), histogram(false) {} + bool lowValue :1; + bool highValue :1; + bool bitVectors :1; + bool histogram :1; +} _DecimalColumnStatsData__isset; + +class DecimalColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + DecimalColumnStatsData(const DecimalColumnStatsData&); + DecimalColumnStatsData& operator=(const DecimalColumnStatsData&); + DecimalColumnStatsData() noexcept; + + virtual ~DecimalColumnStatsData() noexcept; + Decimal lowValue; + Decimal highValue; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + std::string histogram; + + _DecimalColumnStatsData__isset __isset; + + void __set_lowValue(const Decimal& val); + + void __set_highValue(const Decimal& val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + void __set_histogram(const std::string& val); + + bool operator == (const DecimalColumnStatsData & rhs) const; + bool operator != (const DecimalColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DecimalColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DecimalColumnStatsData &a, DecimalColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DecimalColumnStatsData& obj); + + +class Date : public virtual ::apache::thrift::TBase { + public: + + Date(const Date&) noexcept; + Date& operator=(const Date&) noexcept; + Date() noexcept; + + virtual ~Date() noexcept; + int64_t daysSinceEpoch; + + void __set_daysSinceEpoch(const int64_t val); + + bool operator == (const Date & rhs) const; + bool operator != (const Date &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Date & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Date &a, Date &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Date& obj); + +typedef struct _DateColumnStatsData__isset { + _DateColumnStatsData__isset() : lowValue(false), highValue(false), bitVectors(false), histogram(false) {} + bool lowValue :1; + bool highValue :1; + bool bitVectors :1; + bool histogram :1; +} _DateColumnStatsData__isset; + +class DateColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + DateColumnStatsData(const DateColumnStatsData&); + DateColumnStatsData& operator=(const DateColumnStatsData&); + DateColumnStatsData() noexcept; + + virtual ~DateColumnStatsData() noexcept; + Date lowValue; + Date highValue; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + std::string histogram; + + _DateColumnStatsData__isset __isset; + + void __set_lowValue(const Date& val); + + void __set_highValue(const Date& val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + void __set_histogram(const std::string& val); + + bool operator == (const DateColumnStatsData & rhs) const; + bool operator != (const DateColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DateColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DateColumnStatsData &a, DateColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DateColumnStatsData& obj); + + +class Timestamp : public virtual ::apache::thrift::TBase { + public: + + Timestamp(const Timestamp&) noexcept; + Timestamp& operator=(const Timestamp&) noexcept; + Timestamp() noexcept; + + virtual ~Timestamp() noexcept; + int64_t secondsSinceEpoch; + + void __set_secondsSinceEpoch(const int64_t val); + + bool operator == (const Timestamp & rhs) const; + bool operator != (const Timestamp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Timestamp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Timestamp &a, Timestamp &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Timestamp& obj); + +typedef struct _TimestampColumnStatsData__isset { + _TimestampColumnStatsData__isset() : lowValue(false), highValue(false), bitVectors(false), histogram(false) {} + bool lowValue :1; + bool highValue :1; + bool bitVectors :1; + bool histogram :1; +} _TimestampColumnStatsData__isset; + +class TimestampColumnStatsData : public virtual ::apache::thrift::TBase { + public: + + TimestampColumnStatsData(const TimestampColumnStatsData&); + TimestampColumnStatsData& operator=(const TimestampColumnStatsData&); + TimestampColumnStatsData() noexcept; + + virtual ~TimestampColumnStatsData() noexcept; + Timestamp lowValue; + Timestamp highValue; + int64_t numNulls; + int64_t numDVs; + std::string bitVectors; + std::string histogram; + + _TimestampColumnStatsData__isset __isset; + + void __set_lowValue(const Timestamp& val); + + void __set_highValue(const Timestamp& val); + + void __set_numNulls(const int64_t val); + + void __set_numDVs(const int64_t val); + + void __set_bitVectors(const std::string& val); + + void __set_histogram(const std::string& val); + + bool operator == (const TimestampColumnStatsData & rhs) const; + bool operator != (const TimestampColumnStatsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TimestampColumnStatsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TimestampColumnStatsData &a, TimestampColumnStatsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TimestampColumnStatsData& obj); + +typedef struct _ColumnStatisticsData__isset { + _ColumnStatisticsData__isset() : booleanStats(false), longStats(false), doubleStats(false), stringStats(false), binaryStats(false), decimalStats(false), dateStats(false), timestampStats(false) {} + bool booleanStats :1; + bool longStats :1; + bool doubleStats :1; + bool stringStats :1; + bool binaryStats :1; + bool decimalStats :1; + bool dateStats :1; + bool timestampStats :1; +} _ColumnStatisticsData__isset; + +class ColumnStatisticsData : public virtual ::apache::thrift::TBase { + public: + + ColumnStatisticsData(const ColumnStatisticsData&); + ColumnStatisticsData& operator=(const ColumnStatisticsData&); + ColumnStatisticsData() noexcept; + + virtual ~ColumnStatisticsData() noexcept; + BooleanColumnStatsData booleanStats; + LongColumnStatsData longStats; + DoubleColumnStatsData doubleStats; + StringColumnStatsData stringStats; + BinaryColumnStatsData binaryStats; + DecimalColumnStatsData decimalStats; + DateColumnStatsData dateStats; + TimestampColumnStatsData timestampStats; + + _ColumnStatisticsData__isset __isset; + + void __set_booleanStats(const BooleanColumnStatsData& val); + + void __set_longStats(const LongColumnStatsData& val); + + void __set_doubleStats(const DoubleColumnStatsData& val); + + void __set_stringStats(const StringColumnStatsData& val); + + void __set_binaryStats(const BinaryColumnStatsData& val); + + void __set_decimalStats(const DecimalColumnStatsData& val); + + void __set_dateStats(const DateColumnStatsData& val); + + void __set_timestampStats(const TimestampColumnStatsData& val); + + bool operator == (const ColumnStatisticsData & rhs) const; + bool operator != (const ColumnStatisticsData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnStatisticsData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ColumnStatisticsData &a, ColumnStatisticsData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsData& obj); + + +class ColumnStatisticsObj : public virtual ::apache::thrift::TBase { + public: + + ColumnStatisticsObj(const ColumnStatisticsObj&); + ColumnStatisticsObj& operator=(const ColumnStatisticsObj&); + ColumnStatisticsObj() noexcept; + + virtual ~ColumnStatisticsObj() noexcept; + std::string colName; + std::string colType; + ColumnStatisticsData statsData; + + void __set_colName(const std::string& val); + + void __set_colType(const std::string& val); + + void __set_statsData(const ColumnStatisticsData& val); + + bool operator == (const ColumnStatisticsObj & rhs) const; + bool operator != (const ColumnStatisticsObj &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnStatisticsObj & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ColumnStatisticsObj &a, ColumnStatisticsObj &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsObj& obj); + +typedef struct _ColumnStatisticsDesc__isset { + _ColumnStatisticsDesc__isset() : partName(false), lastAnalyzed(false), catName(false) {} + bool partName :1; + bool lastAnalyzed :1; + bool catName :1; +} _ColumnStatisticsDesc__isset; + +class ColumnStatisticsDesc : public virtual ::apache::thrift::TBase { + public: + + ColumnStatisticsDesc(const ColumnStatisticsDesc&); + ColumnStatisticsDesc& operator=(const ColumnStatisticsDesc&); + ColumnStatisticsDesc() noexcept; + + virtual ~ColumnStatisticsDesc() noexcept; + bool isTblLevel; + std::string dbName; + std::string tableName; + std::string partName; + int64_t lastAnalyzed; + std::string catName; + + _ColumnStatisticsDesc__isset __isset; + + void __set_isTblLevel(const bool val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partName(const std::string& val); + + void __set_lastAnalyzed(const int64_t val); + + void __set_catName(const std::string& val); + + bool operator == (const ColumnStatisticsDesc & rhs) const; + bool operator != (const ColumnStatisticsDesc &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnStatisticsDesc & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ColumnStatisticsDesc &a, ColumnStatisticsDesc &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ColumnStatisticsDesc& obj); + +typedef struct _ColumnStatistics__isset { + _ColumnStatistics__isset() : isStatsCompliant(false), engine(true) {} + bool isStatsCompliant :1; + bool engine :1; +} _ColumnStatistics__isset; + +class ColumnStatistics : public virtual ::apache::thrift::TBase { + public: + + ColumnStatistics(const ColumnStatistics&); + ColumnStatistics& operator=(const ColumnStatistics&); + ColumnStatistics(); + + virtual ~ColumnStatistics() noexcept; + ColumnStatisticsDesc statsDesc; + std::vector statsObj; + bool isStatsCompliant; + std::string engine; + + _ColumnStatistics__isset __isset; + + void __set_statsDesc(const ColumnStatisticsDesc& val); + + void __set_statsObj(const std::vector & val); + + void __set_isStatsCompliant(const bool val); + + void __set_engine(const std::string& val); + + bool operator == (const ColumnStatistics & rhs) const; + bool operator != (const ColumnStatistics &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnStatistics & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ColumnStatistics &a, ColumnStatistics &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ColumnStatistics& obj); + +typedef struct _FileMetadata__isset { + _FileMetadata__isset() : type(true), version(true), data(false) {} + bool type :1; + bool version :1; + bool data :1; +} _FileMetadata__isset; + +class FileMetadata : public virtual ::apache::thrift::TBase { + public: + + FileMetadata(const FileMetadata&); + FileMetadata& operator=(const FileMetadata&); + FileMetadata() noexcept; + + virtual ~FileMetadata() noexcept; + int8_t type; + int8_t version; + std::vector data; + + _FileMetadata__isset __isset; + + void __set_type(const int8_t val); + + void __set_version(const int8_t val); + + void __set_data(const std::vector & val); + + bool operator == (const FileMetadata & rhs) const; + bool operator != (const FileMetadata &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FileMetadata & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FileMetadata &a, FileMetadata &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FileMetadata& obj); + + +class ObjectDictionary : public virtual ::apache::thrift::TBase { + public: + + ObjectDictionary(const ObjectDictionary&); + ObjectDictionary& operator=(const ObjectDictionary&); + ObjectDictionary() noexcept; + + virtual ~ObjectDictionary() noexcept; + std::map > values; + + void __set_values(const std::map > & val); + + bool operator == (const ObjectDictionary & rhs) const; + bool operator != (const ObjectDictionary &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ObjectDictionary & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ObjectDictionary &a, ObjectDictionary &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ObjectDictionary& obj); + +typedef struct _Table__isset { + _Table__isset() : tableName(false), dbName(false), owner(false), createTime(false), lastAccessTime(false), retention(false), sd(false), partitionKeys(false), parameters(false), viewOriginalText(false), viewExpandedText(false), tableType(false), privileges(false), temporary(true), rewriteEnabled(false), creationMetadata(false), catName(false), ownerType(true), writeId(true), isStatsCompliant(false), colStats(false), accessType(false), requiredReadCapabilities(false), requiredWriteCapabilities(false), id(false), fileMetadata(false), dictionary(false), txnId(false) {} + bool tableName :1; + bool dbName :1; + bool owner :1; + bool createTime :1; + bool lastAccessTime :1; + bool retention :1; + bool sd :1; + bool partitionKeys :1; + bool parameters :1; + bool viewOriginalText :1; + bool viewExpandedText :1; + bool tableType :1; + bool privileges :1; + bool temporary :1; + bool rewriteEnabled :1; + bool creationMetadata :1; + bool catName :1; + bool ownerType :1; + bool writeId :1; + bool isStatsCompliant :1; + bool colStats :1; + bool accessType :1; + bool requiredReadCapabilities :1; + bool requiredWriteCapabilities :1; + bool id :1; + bool fileMetadata :1; + bool dictionary :1; + bool txnId :1; +} _Table__isset; + +class Table : public virtual ::apache::thrift::TBase { + public: + + Table(const Table&); + Table& operator=(const Table&); + Table() noexcept; + + virtual ~Table() noexcept; + std::string tableName; + std::string dbName; + std::string owner; + int32_t createTime; + int32_t lastAccessTime; + int32_t retention; + StorageDescriptor sd; + std::vector partitionKeys; + std::map parameters; + std::string viewOriginalText; + std::string viewExpandedText; + std::string tableType; + PrincipalPrivilegeSet privileges; + bool temporary; + bool rewriteEnabled; + CreationMetadata creationMetadata; + std::string catName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + int64_t writeId; + bool isStatsCompliant; + ColumnStatistics colStats; + int8_t accessType; + std::vector requiredReadCapabilities; + std::vector requiredWriteCapabilities; + int64_t id; + FileMetadata fileMetadata; + ObjectDictionary dictionary; + int64_t txnId; + + _Table__isset __isset; + + void __set_tableName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_owner(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_lastAccessTime(const int32_t val); + + void __set_retention(const int32_t val); + + void __set_sd(const StorageDescriptor& val); + + void __set_partitionKeys(const std::vector & val); + + void __set_parameters(const std::map & val); + + void __set_viewOriginalText(const std::string& val); + + void __set_viewExpandedText(const std::string& val); + + void __set_tableType(const std::string& val); + + void __set_privileges(const PrincipalPrivilegeSet& val); + + void __set_temporary(const bool val); + + void __set_rewriteEnabled(const bool val); + + void __set_creationMetadata(const CreationMetadata& val); + + void __set_catName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + void __set_writeId(const int64_t val); + + void __set_isStatsCompliant(const bool val); + + void __set_colStats(const ColumnStatistics& val); + + void __set_accessType(const int8_t val); + + void __set_requiredReadCapabilities(const std::vector & val); + + void __set_requiredWriteCapabilities(const std::vector & val); + + void __set_id(const int64_t val); + + void __set_fileMetadata(const FileMetadata& val); + + void __set_dictionary(const ObjectDictionary& val); + + void __set_txnId(const int64_t val); + + bool operator == (const Table & rhs) const; + bool operator != (const Table &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Table & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Table &a, Table &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Table& obj); + + +class SourceTable : public virtual ::apache::thrift::TBase { + public: + + SourceTable(const SourceTable&); + SourceTable& operator=(const SourceTable&); + SourceTable() noexcept; + + virtual ~SourceTable() noexcept; + Table table; + int64_t insertedCount; + int64_t updatedCount; + int64_t deletedCount; + + void __set_table(const Table& val); + + void __set_insertedCount(const int64_t val); + + void __set_updatedCount(const int64_t val); + + void __set_deletedCount(const int64_t val); + + bool operator == (const SourceTable & rhs) const; + bool operator != (const SourceTable &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SourceTable & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SourceTable &a, SourceTable &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SourceTable& obj); + +typedef struct _Partition__isset { + _Partition__isset() : values(false), dbName(false), tableName(false), createTime(false), lastAccessTime(false), sd(false), parameters(false), privileges(false), catName(false), writeId(true), isStatsCompliant(false), colStats(false), fileMetadata(false) {} + bool values :1; + bool dbName :1; + bool tableName :1; + bool createTime :1; + bool lastAccessTime :1; + bool sd :1; + bool parameters :1; + bool privileges :1; + bool catName :1; + bool writeId :1; + bool isStatsCompliant :1; + bool colStats :1; + bool fileMetadata :1; +} _Partition__isset; + +class Partition : public virtual ::apache::thrift::TBase { + public: + + Partition(const Partition&); + Partition& operator=(const Partition&); + Partition() noexcept; + + virtual ~Partition() noexcept; + std::vector values; + std::string dbName; + std::string tableName; + int32_t createTime; + int32_t lastAccessTime; + StorageDescriptor sd; + std::map parameters; + PrincipalPrivilegeSet privileges; + std::string catName; + int64_t writeId; + bool isStatsCompliant; + ColumnStatistics colStats; + FileMetadata fileMetadata; + + _Partition__isset __isset; + + void __set_values(const std::vector & val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_lastAccessTime(const int32_t val); + + void __set_sd(const StorageDescriptor& val); + + void __set_parameters(const std::map & val); + + void __set_privileges(const PrincipalPrivilegeSet& val); + + void __set_catName(const std::string& val); + + void __set_writeId(const int64_t val); + + void __set_isStatsCompliant(const bool val); + + void __set_colStats(const ColumnStatistics& val); + + void __set_fileMetadata(const FileMetadata& val); + + bool operator == (const Partition & rhs) const; + bool operator != (const Partition &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Partition & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Partition &a, Partition &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Partition& obj); + +typedef struct _PartitionWithoutSD__isset { + _PartitionWithoutSD__isset() : values(false), createTime(false), lastAccessTime(false), relativePath(false), parameters(false), privileges(false) {} + bool values :1; + bool createTime :1; + bool lastAccessTime :1; + bool relativePath :1; + bool parameters :1; + bool privileges :1; +} _PartitionWithoutSD__isset; + +class PartitionWithoutSD : public virtual ::apache::thrift::TBase { + public: + + PartitionWithoutSD(const PartitionWithoutSD&); + PartitionWithoutSD& operator=(const PartitionWithoutSD&); + PartitionWithoutSD() noexcept; + + virtual ~PartitionWithoutSD() noexcept; + std::vector values; + int32_t createTime; + int32_t lastAccessTime; + std::string relativePath; + std::map parameters; + PrincipalPrivilegeSet privileges; + + _PartitionWithoutSD__isset __isset; + + void __set_values(const std::vector & val); + + void __set_createTime(const int32_t val); + + void __set_lastAccessTime(const int32_t val); + + void __set_relativePath(const std::string& val); + + void __set_parameters(const std::map & val); + + void __set_privileges(const PrincipalPrivilegeSet& val); + + bool operator == (const PartitionWithoutSD & rhs) const; + bool operator != (const PartitionWithoutSD &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionWithoutSD & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionWithoutSD &a, PartitionWithoutSD &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionWithoutSD& obj); + +typedef struct _PartitionSpecWithSharedSD__isset { + _PartitionSpecWithSharedSD__isset() : partitions(false), sd(false) {} + bool partitions :1; + bool sd :1; +} _PartitionSpecWithSharedSD__isset; + +class PartitionSpecWithSharedSD : public virtual ::apache::thrift::TBase { + public: + + PartitionSpecWithSharedSD(const PartitionSpecWithSharedSD&); + PartitionSpecWithSharedSD& operator=(const PartitionSpecWithSharedSD&); + PartitionSpecWithSharedSD() noexcept; + + virtual ~PartitionSpecWithSharedSD() noexcept; + std::vector partitions; + StorageDescriptor sd; + + _PartitionSpecWithSharedSD__isset __isset; + + void __set_partitions(const std::vector & val); + + void __set_sd(const StorageDescriptor& val); + + bool operator == (const PartitionSpecWithSharedSD & rhs) const; + bool operator != (const PartitionSpecWithSharedSD &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionSpecWithSharedSD & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionSpecWithSharedSD &a, PartitionSpecWithSharedSD &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionSpecWithSharedSD& obj); + +typedef struct _PartitionListComposingSpec__isset { + _PartitionListComposingSpec__isset() : partitions(false) {} + bool partitions :1; +} _PartitionListComposingSpec__isset; + +class PartitionListComposingSpec : public virtual ::apache::thrift::TBase { + public: + + PartitionListComposingSpec(const PartitionListComposingSpec&); + PartitionListComposingSpec& operator=(const PartitionListComposingSpec&); + PartitionListComposingSpec() noexcept; + + virtual ~PartitionListComposingSpec() noexcept; + std::vector partitions; + + _PartitionListComposingSpec__isset __isset; + + void __set_partitions(const std::vector & val); + + bool operator == (const PartitionListComposingSpec & rhs) const; + bool operator != (const PartitionListComposingSpec &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionListComposingSpec & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionListComposingSpec &a, PartitionListComposingSpec &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionListComposingSpec& obj); + +typedef struct _PartitionSpec__isset { + _PartitionSpec__isset() : dbName(false), tableName(false), rootPath(false), sharedSDPartitionSpec(false), partitionList(false), catName(false), writeId(true), isStatsCompliant(false) {} + bool dbName :1; + bool tableName :1; + bool rootPath :1; + bool sharedSDPartitionSpec :1; + bool partitionList :1; + bool catName :1; + bool writeId :1; + bool isStatsCompliant :1; +} _PartitionSpec__isset; + +class PartitionSpec : public virtual ::apache::thrift::TBase { + public: + + PartitionSpec(const PartitionSpec&); + PartitionSpec& operator=(const PartitionSpec&); + PartitionSpec() noexcept; + + virtual ~PartitionSpec() noexcept; + std::string dbName; + std::string tableName; + std::string rootPath; + PartitionSpecWithSharedSD sharedSDPartitionSpec; + PartitionListComposingSpec partitionList; + std::string catName; + int64_t writeId; + bool isStatsCompliant; + + _PartitionSpec__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_rootPath(const std::string& val); + + void __set_sharedSDPartitionSpec(const PartitionSpecWithSharedSD& val); + + void __set_partitionList(const PartitionListComposingSpec& val); + + void __set_catName(const std::string& val); + + void __set_writeId(const int64_t val); + + void __set_isStatsCompliant(const bool val); + + bool operator == (const PartitionSpec & rhs) const; + bool operator != (const PartitionSpec &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionSpec & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionSpec &a, PartitionSpec &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionSpec& obj); + +typedef struct _AggrStats__isset { + _AggrStats__isset() : isStatsCompliant(false) {} + bool isStatsCompliant :1; +} _AggrStats__isset; + +class AggrStats : public virtual ::apache::thrift::TBase { + public: + + AggrStats(const AggrStats&); + AggrStats& operator=(const AggrStats&); + AggrStats() noexcept; + + virtual ~AggrStats() noexcept; + std::vector colStats; + int64_t partsFound; + bool isStatsCompliant; + + _AggrStats__isset __isset; + + void __set_colStats(const std::vector & val); + + void __set_partsFound(const int64_t val); + + void __set_isStatsCompliant(const bool val); + + bool operator == (const AggrStats & rhs) const; + bool operator != (const AggrStats &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AggrStats & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AggrStats &a, AggrStats &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AggrStats& obj); + +typedef struct _SetPartitionsStatsRequest__isset { + _SetPartitionsStatsRequest__isset() : needMerge(false), writeId(true), validWriteIdList(false), engine(true) {} + bool needMerge :1; + bool writeId :1; + bool validWriteIdList :1; + bool engine :1; +} _SetPartitionsStatsRequest__isset; + +class SetPartitionsStatsRequest : public virtual ::apache::thrift::TBase { + public: + + SetPartitionsStatsRequest(const SetPartitionsStatsRequest&); + SetPartitionsStatsRequest& operator=(const SetPartitionsStatsRequest&); + SetPartitionsStatsRequest(); + + virtual ~SetPartitionsStatsRequest() noexcept; + std::vector colStats; + bool needMerge; + int64_t writeId; + std::string validWriteIdList; + std::string engine; + + _SetPartitionsStatsRequest__isset __isset; + + void __set_colStats(const std::vector & val); + + void __set_needMerge(const bool val); + + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_engine(const std::string& val); + + bool operator == (const SetPartitionsStatsRequest & rhs) const; + bool operator != (const SetPartitionsStatsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SetPartitionsStatsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SetPartitionsStatsRequest &a, SetPartitionsStatsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SetPartitionsStatsRequest& obj); + + +class SetPartitionsStatsResponse : public virtual ::apache::thrift::TBase { + public: + + SetPartitionsStatsResponse(const SetPartitionsStatsResponse&) noexcept; + SetPartitionsStatsResponse& operator=(const SetPartitionsStatsResponse&) noexcept; + SetPartitionsStatsResponse() noexcept; + + virtual ~SetPartitionsStatsResponse() noexcept; + bool result; + + void __set_result(const bool val); + + bool operator == (const SetPartitionsStatsResponse & rhs) const; + bool operator != (const SetPartitionsStatsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SetPartitionsStatsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SetPartitionsStatsResponse &a, SetPartitionsStatsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SetPartitionsStatsResponse& obj); + +typedef struct _Schema__isset { + _Schema__isset() : fieldSchemas(false), properties(false) {} + bool fieldSchemas :1; + bool properties :1; +} _Schema__isset; + +class Schema : public virtual ::apache::thrift::TBase { + public: + + Schema(const Schema&); + Schema& operator=(const Schema&); + Schema() noexcept; + + virtual ~Schema() noexcept; + std::vector fieldSchemas; + std::map properties; + + _Schema__isset __isset; + + void __set_fieldSchemas(const std::vector & val); + + void __set_properties(const std::map & val); + + bool operator == (const Schema & rhs) const; + bool operator != (const Schema &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Schema & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Schema &a, Schema &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Schema& obj); + +typedef struct _PrimaryKeysRequest__isset { + _PrimaryKeysRequest__isset() : catName(false), validWriteIdList(false), tableId(true) {} + bool catName :1; + bool validWriteIdList :1; + bool tableId :1; +} _PrimaryKeysRequest__isset; + +class PrimaryKeysRequest : public virtual ::apache::thrift::TBase { + public: + + PrimaryKeysRequest(const PrimaryKeysRequest&); + PrimaryKeysRequest& operator=(const PrimaryKeysRequest&); + PrimaryKeysRequest() noexcept; + + virtual ~PrimaryKeysRequest() noexcept; + std::string db_name; + std::string tbl_name; + std::string catName; + std::string validWriteIdList; + int64_t tableId; + + _PrimaryKeysRequest__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const PrimaryKeysRequest & rhs) const; + bool operator != (const PrimaryKeysRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PrimaryKeysRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PrimaryKeysRequest &a, PrimaryKeysRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PrimaryKeysRequest& obj); + + +class PrimaryKeysResponse : public virtual ::apache::thrift::TBase { + public: + + PrimaryKeysResponse(const PrimaryKeysResponse&); + PrimaryKeysResponse& operator=(const PrimaryKeysResponse&); + PrimaryKeysResponse() noexcept; + + virtual ~PrimaryKeysResponse() noexcept; + std::vector primaryKeys; + + void __set_primaryKeys(const std::vector & val); + + bool operator == (const PrimaryKeysResponse & rhs) const; + bool operator != (const PrimaryKeysResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PrimaryKeysResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PrimaryKeysResponse &a, PrimaryKeysResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PrimaryKeysResponse& obj); + +typedef struct _ForeignKeysRequest__isset { + _ForeignKeysRequest__isset() : parent_db_name(false), parent_tbl_name(false), foreign_db_name(false), foreign_tbl_name(false), catName(false), validWriteIdList(false), tableId(true) {} + bool parent_db_name :1; + bool parent_tbl_name :1; + bool foreign_db_name :1; + bool foreign_tbl_name :1; + bool catName :1; + bool validWriteIdList :1; + bool tableId :1; +} _ForeignKeysRequest__isset; + +class ForeignKeysRequest : public virtual ::apache::thrift::TBase { + public: + + ForeignKeysRequest(const ForeignKeysRequest&); + ForeignKeysRequest& operator=(const ForeignKeysRequest&); + ForeignKeysRequest() noexcept; + + virtual ~ForeignKeysRequest() noexcept; + std::string parent_db_name; + std::string parent_tbl_name; + std::string foreign_db_name; + std::string foreign_tbl_name; + std::string catName; + std::string validWriteIdList; + int64_t tableId; + + _ForeignKeysRequest__isset __isset; + + void __set_parent_db_name(const std::string& val); + + void __set_parent_tbl_name(const std::string& val); + + void __set_foreign_db_name(const std::string& val); + + void __set_foreign_tbl_name(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const ForeignKeysRequest & rhs) const; + bool operator != (const ForeignKeysRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ForeignKeysRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ForeignKeysRequest &a, ForeignKeysRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ForeignKeysRequest& obj); + + +class ForeignKeysResponse : public virtual ::apache::thrift::TBase { + public: + + ForeignKeysResponse(const ForeignKeysResponse&); + ForeignKeysResponse& operator=(const ForeignKeysResponse&); + ForeignKeysResponse() noexcept; + + virtual ~ForeignKeysResponse() noexcept; + std::vector foreignKeys; + + void __set_foreignKeys(const std::vector & val); + + bool operator == (const ForeignKeysResponse & rhs) const; + bool operator != (const ForeignKeysResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ForeignKeysResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ForeignKeysResponse &a, ForeignKeysResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ForeignKeysResponse& obj); + +typedef struct _UniqueConstraintsRequest__isset { + _UniqueConstraintsRequest__isset() : validWriteIdList(false), tableId(true) {} + bool validWriteIdList :1; + bool tableId :1; +} _UniqueConstraintsRequest__isset; + +class UniqueConstraintsRequest : public virtual ::apache::thrift::TBase { + public: + + UniqueConstraintsRequest(const UniqueConstraintsRequest&); + UniqueConstraintsRequest& operator=(const UniqueConstraintsRequest&); + UniqueConstraintsRequest() noexcept; + + virtual ~UniqueConstraintsRequest() noexcept; + std::string catName; + std::string db_name; + std::string tbl_name; + std::string validWriteIdList; + int64_t tableId; + + _UniqueConstraintsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const UniqueConstraintsRequest & rhs) const; + bool operator != (const UniqueConstraintsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UniqueConstraintsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(UniqueConstraintsRequest &a, UniqueConstraintsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UniqueConstraintsRequest& obj); + + +class UniqueConstraintsResponse : public virtual ::apache::thrift::TBase { + public: + + UniqueConstraintsResponse(const UniqueConstraintsResponse&); + UniqueConstraintsResponse& operator=(const UniqueConstraintsResponse&); + UniqueConstraintsResponse() noexcept; + + virtual ~UniqueConstraintsResponse() noexcept; + std::vector uniqueConstraints; + + void __set_uniqueConstraints(const std::vector & val); + + bool operator == (const UniqueConstraintsResponse & rhs) const; + bool operator != (const UniqueConstraintsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UniqueConstraintsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(UniqueConstraintsResponse &a, UniqueConstraintsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UniqueConstraintsResponse& obj); + +typedef struct _NotNullConstraintsRequest__isset { + _NotNullConstraintsRequest__isset() : validWriteIdList(false), tableId(true) {} + bool validWriteIdList :1; + bool tableId :1; +} _NotNullConstraintsRequest__isset; + +class NotNullConstraintsRequest : public virtual ::apache::thrift::TBase { + public: + + NotNullConstraintsRequest(const NotNullConstraintsRequest&); + NotNullConstraintsRequest& operator=(const NotNullConstraintsRequest&); + NotNullConstraintsRequest() noexcept; + + virtual ~NotNullConstraintsRequest() noexcept; + std::string catName; + std::string db_name; + std::string tbl_name; + std::string validWriteIdList; + int64_t tableId; + + _NotNullConstraintsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const NotNullConstraintsRequest & rhs) const; + bool operator != (const NotNullConstraintsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotNullConstraintsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotNullConstraintsRequest &a, NotNullConstraintsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotNullConstraintsRequest& obj); + + +class NotNullConstraintsResponse : public virtual ::apache::thrift::TBase { + public: + + NotNullConstraintsResponse(const NotNullConstraintsResponse&); + NotNullConstraintsResponse& operator=(const NotNullConstraintsResponse&); + NotNullConstraintsResponse() noexcept; + + virtual ~NotNullConstraintsResponse() noexcept; + std::vector notNullConstraints; + + void __set_notNullConstraints(const std::vector & val); + + bool operator == (const NotNullConstraintsResponse & rhs) const; + bool operator != (const NotNullConstraintsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotNullConstraintsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotNullConstraintsResponse &a, NotNullConstraintsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotNullConstraintsResponse& obj); + +typedef struct _DefaultConstraintsRequest__isset { + _DefaultConstraintsRequest__isset() : validWriteIdList(false), tableId(true) {} + bool validWriteIdList :1; + bool tableId :1; +} _DefaultConstraintsRequest__isset; + +class DefaultConstraintsRequest : public virtual ::apache::thrift::TBase { + public: + + DefaultConstraintsRequest(const DefaultConstraintsRequest&); + DefaultConstraintsRequest& operator=(const DefaultConstraintsRequest&); + DefaultConstraintsRequest() noexcept; + + virtual ~DefaultConstraintsRequest() noexcept; + std::string catName; + std::string db_name; + std::string tbl_name; + std::string validWriteIdList; + int64_t tableId; + + _DefaultConstraintsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const DefaultConstraintsRequest & rhs) const; + bool operator != (const DefaultConstraintsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DefaultConstraintsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DefaultConstraintsRequest &a, DefaultConstraintsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DefaultConstraintsRequest& obj); + + +class DefaultConstraintsResponse : public virtual ::apache::thrift::TBase { + public: + + DefaultConstraintsResponse(const DefaultConstraintsResponse&); + DefaultConstraintsResponse& operator=(const DefaultConstraintsResponse&); + DefaultConstraintsResponse() noexcept; + + virtual ~DefaultConstraintsResponse() noexcept; + std::vector defaultConstraints; + + void __set_defaultConstraints(const std::vector & val); + + bool operator == (const DefaultConstraintsResponse & rhs) const; + bool operator != (const DefaultConstraintsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DefaultConstraintsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DefaultConstraintsResponse &a, DefaultConstraintsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DefaultConstraintsResponse& obj); + +typedef struct _CheckConstraintsRequest__isset { + _CheckConstraintsRequest__isset() : validWriteIdList(false), tableId(true) {} + bool validWriteIdList :1; + bool tableId :1; +} _CheckConstraintsRequest__isset; + +class CheckConstraintsRequest : public virtual ::apache::thrift::TBase { + public: + + CheckConstraintsRequest(const CheckConstraintsRequest&); + CheckConstraintsRequest& operator=(const CheckConstraintsRequest&); + CheckConstraintsRequest() noexcept; + + virtual ~CheckConstraintsRequest() noexcept; + std::string catName; + std::string db_name; + std::string tbl_name; + std::string validWriteIdList; + int64_t tableId; + + _CheckConstraintsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const CheckConstraintsRequest & rhs) const; + bool operator != (const CheckConstraintsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CheckConstraintsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CheckConstraintsRequest &a, CheckConstraintsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CheckConstraintsRequest& obj); + + +class CheckConstraintsResponse : public virtual ::apache::thrift::TBase { + public: + + CheckConstraintsResponse(const CheckConstraintsResponse&); + CheckConstraintsResponse& operator=(const CheckConstraintsResponse&); + CheckConstraintsResponse() noexcept; + + virtual ~CheckConstraintsResponse() noexcept; + std::vector checkConstraints; + + void __set_checkConstraints(const std::vector & val); + + bool operator == (const CheckConstraintsResponse & rhs) const; + bool operator != (const CheckConstraintsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CheckConstraintsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CheckConstraintsResponse &a, CheckConstraintsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CheckConstraintsResponse& obj); + +typedef struct _AllTableConstraintsRequest__isset { + _AllTableConstraintsRequest__isset() : validWriteIdList(false), tableId(true) {} + bool validWriteIdList :1; + bool tableId :1; +} _AllTableConstraintsRequest__isset; + +class AllTableConstraintsRequest : public virtual ::apache::thrift::TBase { + public: + + AllTableConstraintsRequest(const AllTableConstraintsRequest&); + AllTableConstraintsRequest& operator=(const AllTableConstraintsRequest&); + AllTableConstraintsRequest() noexcept; + + virtual ~AllTableConstraintsRequest() noexcept; + std::string dbName; + std::string tblName; + std::string catName; + std::string validWriteIdList; + int64_t tableId; + + _AllTableConstraintsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_tableId(const int64_t val); + + bool operator == (const AllTableConstraintsRequest & rhs) const; + bool operator != (const AllTableConstraintsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AllTableConstraintsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AllTableConstraintsRequest &a, AllTableConstraintsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AllTableConstraintsRequest& obj); + + +class AllTableConstraintsResponse : public virtual ::apache::thrift::TBase { + public: + + AllTableConstraintsResponse(const AllTableConstraintsResponse&); + AllTableConstraintsResponse& operator=(const AllTableConstraintsResponse&); + AllTableConstraintsResponse() noexcept; + + virtual ~AllTableConstraintsResponse() noexcept; + SQLAllTableConstraints allTableConstraints; + + void __set_allTableConstraints(const SQLAllTableConstraints& val); + + bool operator == (const AllTableConstraintsResponse & rhs) const; + bool operator != (const AllTableConstraintsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AllTableConstraintsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AllTableConstraintsResponse &a, AllTableConstraintsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AllTableConstraintsResponse& obj); + +typedef struct _DropConstraintRequest__isset { + _DropConstraintRequest__isset() : catName(false) {} + bool catName :1; +} _DropConstraintRequest__isset; + +class DropConstraintRequest : public virtual ::apache::thrift::TBase { + public: + + DropConstraintRequest(const DropConstraintRequest&); + DropConstraintRequest& operator=(const DropConstraintRequest&); + DropConstraintRequest() noexcept; + + virtual ~DropConstraintRequest() noexcept; + std::string dbname; + std::string tablename; + std::string constraintname; + std::string catName; + + _DropConstraintRequest__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_constraintname(const std::string& val); + + void __set_catName(const std::string& val); + + bool operator == (const DropConstraintRequest & rhs) const; + bool operator != (const DropConstraintRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropConstraintRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropConstraintRequest &a, DropConstraintRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropConstraintRequest& obj); + + +class AddPrimaryKeyRequest : public virtual ::apache::thrift::TBase { + public: + + AddPrimaryKeyRequest(const AddPrimaryKeyRequest&); + AddPrimaryKeyRequest& operator=(const AddPrimaryKeyRequest&); + AddPrimaryKeyRequest() noexcept; + + virtual ~AddPrimaryKeyRequest() noexcept; + std::vector primaryKeyCols; + + void __set_primaryKeyCols(const std::vector & val); + + bool operator == (const AddPrimaryKeyRequest & rhs) const; + bool operator != (const AddPrimaryKeyRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddPrimaryKeyRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddPrimaryKeyRequest &a, AddPrimaryKeyRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddPrimaryKeyRequest& obj); + + +class AddForeignKeyRequest : public virtual ::apache::thrift::TBase { + public: + + AddForeignKeyRequest(const AddForeignKeyRequest&); + AddForeignKeyRequest& operator=(const AddForeignKeyRequest&); + AddForeignKeyRequest() noexcept; + + virtual ~AddForeignKeyRequest() noexcept; + std::vector foreignKeyCols; + + void __set_foreignKeyCols(const std::vector & val); + + bool operator == (const AddForeignKeyRequest & rhs) const; + bool operator != (const AddForeignKeyRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddForeignKeyRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddForeignKeyRequest &a, AddForeignKeyRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddForeignKeyRequest& obj); + + +class AddUniqueConstraintRequest : public virtual ::apache::thrift::TBase { + public: + + AddUniqueConstraintRequest(const AddUniqueConstraintRequest&); + AddUniqueConstraintRequest& operator=(const AddUniqueConstraintRequest&); + AddUniqueConstraintRequest() noexcept; + + virtual ~AddUniqueConstraintRequest() noexcept; + std::vector uniqueConstraintCols; + + void __set_uniqueConstraintCols(const std::vector & val); + + bool operator == (const AddUniqueConstraintRequest & rhs) const; + bool operator != (const AddUniqueConstraintRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddUniqueConstraintRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddUniqueConstraintRequest &a, AddUniqueConstraintRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddUniqueConstraintRequest& obj); + + +class AddNotNullConstraintRequest : public virtual ::apache::thrift::TBase { + public: + + AddNotNullConstraintRequest(const AddNotNullConstraintRequest&); + AddNotNullConstraintRequest& operator=(const AddNotNullConstraintRequest&); + AddNotNullConstraintRequest() noexcept; + + virtual ~AddNotNullConstraintRequest() noexcept; + std::vector notNullConstraintCols; + + void __set_notNullConstraintCols(const std::vector & val); + + bool operator == (const AddNotNullConstraintRequest & rhs) const; + bool operator != (const AddNotNullConstraintRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddNotNullConstraintRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddNotNullConstraintRequest &a, AddNotNullConstraintRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddNotNullConstraintRequest& obj); + + +class AddDefaultConstraintRequest : public virtual ::apache::thrift::TBase { + public: + + AddDefaultConstraintRequest(const AddDefaultConstraintRequest&); + AddDefaultConstraintRequest& operator=(const AddDefaultConstraintRequest&); + AddDefaultConstraintRequest() noexcept; + + virtual ~AddDefaultConstraintRequest() noexcept; + std::vector defaultConstraintCols; + + void __set_defaultConstraintCols(const std::vector & val); + + bool operator == (const AddDefaultConstraintRequest & rhs) const; + bool operator != (const AddDefaultConstraintRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddDefaultConstraintRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddDefaultConstraintRequest &a, AddDefaultConstraintRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddDefaultConstraintRequest& obj); + + +class AddCheckConstraintRequest : public virtual ::apache::thrift::TBase { + public: + + AddCheckConstraintRequest(const AddCheckConstraintRequest&); + AddCheckConstraintRequest& operator=(const AddCheckConstraintRequest&); + AddCheckConstraintRequest() noexcept; + + virtual ~AddCheckConstraintRequest() noexcept; + std::vector checkConstraintCols; + + void __set_checkConstraintCols(const std::vector & val); + + bool operator == (const AddCheckConstraintRequest & rhs) const; + bool operator != (const AddCheckConstraintRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddCheckConstraintRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddCheckConstraintRequest &a, AddCheckConstraintRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddCheckConstraintRequest& obj); + + +class PartitionsByExprResult : public virtual ::apache::thrift::TBase { + public: + + PartitionsByExprResult(const PartitionsByExprResult&); + PartitionsByExprResult& operator=(const PartitionsByExprResult&); + PartitionsByExprResult() noexcept; + + virtual ~PartitionsByExprResult() noexcept; + std::vector partitions; + bool hasUnknownPartitions; + + void __set_partitions(const std::vector & val); + + void __set_hasUnknownPartitions(const bool val); + + bool operator == (const PartitionsByExprResult & rhs) const; + bool operator != (const PartitionsByExprResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsByExprResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsByExprResult &a, PartitionsByExprResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsByExprResult& obj); + + +class PartitionsSpecByExprResult : public virtual ::apache::thrift::TBase { + public: + + PartitionsSpecByExprResult(const PartitionsSpecByExprResult&); + PartitionsSpecByExprResult& operator=(const PartitionsSpecByExprResult&); + PartitionsSpecByExprResult() noexcept; + + virtual ~PartitionsSpecByExprResult() noexcept; + std::vector partitionsSpec; + bool hasUnknownPartitions; + + void __set_partitionsSpec(const std::vector & val); + + void __set_hasUnknownPartitions(const bool val); + + bool operator == (const PartitionsSpecByExprResult & rhs) const; + bool operator != (const PartitionsSpecByExprResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsSpecByExprResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsSpecByExprResult &a, PartitionsSpecByExprResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsSpecByExprResult& obj); + +typedef struct _PartitionsByExprRequest__isset { + _PartitionsByExprRequest__isset() : defaultPartitionName(false), maxParts(true), catName(false), order(false), validWriteIdList(false), id(true), skipColumnSchemaForPartition(false), includeParamKeyPattern(false), excludeParamKeyPattern(false) {} + bool defaultPartitionName :1; + bool maxParts :1; + bool catName :1; + bool order :1; + bool validWriteIdList :1; + bool id :1; + bool skipColumnSchemaForPartition :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; +} _PartitionsByExprRequest__isset; + +class PartitionsByExprRequest : public virtual ::apache::thrift::TBase { + public: + + PartitionsByExprRequest(const PartitionsByExprRequest&); + PartitionsByExprRequest& operator=(const PartitionsByExprRequest&); + PartitionsByExprRequest() noexcept; + + virtual ~PartitionsByExprRequest() noexcept; + std::string dbName; + std::string tblName; + std::string expr; + std::string defaultPartitionName; + int16_t maxParts; + std::string catName; + std::string order; + std::string validWriteIdList; + int64_t id; + bool skipColumnSchemaForPartition; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + + _PartitionsByExprRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_expr(const std::string& val); + + void __set_defaultPartitionName(const std::string& val); + + void __set_maxParts(const int16_t val); + + void __set_catName(const std::string& val); + + void __set_order(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + bool operator == (const PartitionsByExprRequest & rhs) const; + bool operator != (const PartitionsByExprRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsByExprRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsByExprRequest &a, PartitionsByExprRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsByExprRequest& obj); + +typedef struct _TableStatsResult__isset { + _TableStatsResult__isset() : isStatsCompliant(false) {} + bool isStatsCompliant :1; +} _TableStatsResult__isset; + +class TableStatsResult : public virtual ::apache::thrift::TBase { + public: + + TableStatsResult(const TableStatsResult&); + TableStatsResult& operator=(const TableStatsResult&); + TableStatsResult() noexcept; + + virtual ~TableStatsResult() noexcept; + std::vector tableStats; + bool isStatsCompliant; + + _TableStatsResult__isset __isset; + + void __set_tableStats(const std::vector & val); + + void __set_isStatsCompliant(const bool val); + + bool operator == (const TableStatsResult & rhs) const; + bool operator != (const TableStatsResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TableStatsResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TableStatsResult &a, TableStatsResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TableStatsResult& obj); + +typedef struct _PartitionsStatsResult__isset { + _PartitionsStatsResult__isset() : isStatsCompliant(false) {} + bool isStatsCompliant :1; +} _PartitionsStatsResult__isset; + +class PartitionsStatsResult : public virtual ::apache::thrift::TBase { + public: + + PartitionsStatsResult(const PartitionsStatsResult&); + PartitionsStatsResult& operator=(const PartitionsStatsResult&); + PartitionsStatsResult() noexcept; + + virtual ~PartitionsStatsResult() noexcept; + std::map > partStats; + bool isStatsCompliant; + + _PartitionsStatsResult__isset __isset; + + void __set_partStats(const std::map > & val); + + void __set_isStatsCompliant(const bool val); + + bool operator == (const PartitionsStatsResult & rhs) const; + bool operator != (const PartitionsStatsResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsStatsResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsStatsResult &a, PartitionsStatsResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsStatsResult& obj); + +typedef struct _TableStatsRequest__isset { + _TableStatsRequest__isset() : catName(false), validWriteIdList(false), engine(true), id(true) {} + bool catName :1; + bool validWriteIdList :1; + bool engine :1; + bool id :1; +} _TableStatsRequest__isset; + +class TableStatsRequest : public virtual ::apache::thrift::TBase { + public: + + TableStatsRequest(const TableStatsRequest&); + TableStatsRequest& operator=(const TableStatsRequest&); + TableStatsRequest(); + + virtual ~TableStatsRequest() noexcept; + std::string dbName; + std::string tblName; + std::vector colNames; + std::string catName; + std::string validWriteIdList; + std::string engine; + int64_t id; + + _TableStatsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_colNames(const std::vector & val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_engine(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const TableStatsRequest & rhs) const; + bool operator != (const TableStatsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TableStatsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TableStatsRequest &a, TableStatsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TableStatsRequest& obj); + +typedef struct _PartitionsStatsRequest__isset { + _PartitionsStatsRequest__isset() : catName(false), validWriteIdList(false), engine(true) {} + bool catName :1; + bool validWriteIdList :1; + bool engine :1; +} _PartitionsStatsRequest__isset; + +class PartitionsStatsRequest : public virtual ::apache::thrift::TBase { + public: + + PartitionsStatsRequest(const PartitionsStatsRequest&); + PartitionsStatsRequest& operator=(const PartitionsStatsRequest&); + PartitionsStatsRequest(); + + virtual ~PartitionsStatsRequest() noexcept; + std::string dbName; + std::string tblName; + std::vector colNames; + std::vector partNames; + std::string catName; + std::string validWriteIdList; + std::string engine; + + _PartitionsStatsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_colNames(const std::vector & val); + + void __set_partNames(const std::vector & val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_engine(const std::string& val); + + bool operator == (const PartitionsStatsRequest & rhs) const; + bool operator != (const PartitionsStatsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsStatsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsStatsRequest &a, PartitionsStatsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsStatsRequest& obj); + +typedef struct _AddPartitionsResult__isset { + _AddPartitionsResult__isset() : partitions(false), isStatsCompliant(false), partitionColSchema(false) {} + bool partitions :1; + bool isStatsCompliant :1; + bool partitionColSchema :1; +} _AddPartitionsResult__isset; + +class AddPartitionsResult : public virtual ::apache::thrift::TBase { + public: + + AddPartitionsResult(const AddPartitionsResult&); + AddPartitionsResult& operator=(const AddPartitionsResult&); + AddPartitionsResult() noexcept; + + virtual ~AddPartitionsResult() noexcept; + std::vector partitions; + bool isStatsCompliant; + std::vector partitionColSchema; + + _AddPartitionsResult__isset __isset; + + void __set_partitions(const std::vector & val); + + void __set_isStatsCompliant(const bool val); + + void __set_partitionColSchema(const std::vector & val); + + bool operator == (const AddPartitionsResult & rhs) const; + bool operator != (const AddPartitionsResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddPartitionsResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddPartitionsResult &a, AddPartitionsResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddPartitionsResult& obj); + +typedef struct _AddPartitionsRequest__isset { + _AddPartitionsRequest__isset() : needResult(true), catName(false), validWriteIdList(false), skipColumnSchemaForPartition(false), partitionColSchema(false), environmentContext(false) {} + bool needResult :1; + bool catName :1; + bool validWriteIdList :1; + bool skipColumnSchemaForPartition :1; + bool partitionColSchema :1; + bool environmentContext :1; +} _AddPartitionsRequest__isset; + +class AddPartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + AddPartitionsRequest(const AddPartitionsRequest&); + AddPartitionsRequest& operator=(const AddPartitionsRequest&); + AddPartitionsRequest() noexcept; + + virtual ~AddPartitionsRequest() noexcept; + std::string dbName; + std::string tblName; + std::vector parts; + bool ifNotExists; + bool needResult; + std::string catName; + std::string validWriteIdList; + bool skipColumnSchemaForPartition; + std::vector partitionColSchema; + EnvironmentContext environmentContext; + + _AddPartitionsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_parts(const std::vector & val); + + void __set_ifNotExists(const bool val); + + void __set_needResult(const bool val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_partitionColSchema(const std::vector & val); + + void __set_environmentContext(const EnvironmentContext& val); + + bool operator == (const AddPartitionsRequest & rhs) const; + bool operator != (const AddPartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddPartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddPartitionsRequest &a, AddPartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddPartitionsRequest& obj); + +typedef struct _DropPartitionsResult__isset { + _DropPartitionsResult__isset() : partitions(false) {} + bool partitions :1; +} _DropPartitionsResult__isset; + +class DropPartitionsResult : public virtual ::apache::thrift::TBase { + public: + + DropPartitionsResult(const DropPartitionsResult&); + DropPartitionsResult& operator=(const DropPartitionsResult&); + DropPartitionsResult() noexcept; + + virtual ~DropPartitionsResult() noexcept; + std::vector partitions; + + _DropPartitionsResult__isset __isset; + + void __set_partitions(const std::vector & val); + + bool operator == (const DropPartitionsResult & rhs) const; + bool operator != (const DropPartitionsResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropPartitionsResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropPartitionsResult &a, DropPartitionsResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropPartitionsResult& obj); + +typedef struct _DropPartitionsExpr__isset { + _DropPartitionsExpr__isset() : partArchiveLevel(false) {} + bool partArchiveLevel :1; +} _DropPartitionsExpr__isset; + +class DropPartitionsExpr : public virtual ::apache::thrift::TBase { + public: + + DropPartitionsExpr(const DropPartitionsExpr&); + DropPartitionsExpr& operator=(const DropPartitionsExpr&); + DropPartitionsExpr() noexcept; + + virtual ~DropPartitionsExpr() noexcept; + std::string expr; + int32_t partArchiveLevel; + + _DropPartitionsExpr__isset __isset; + + void __set_expr(const std::string& val); + + void __set_partArchiveLevel(const int32_t val); + + bool operator == (const DropPartitionsExpr & rhs) const; + bool operator != (const DropPartitionsExpr &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropPartitionsExpr & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropPartitionsExpr &a, DropPartitionsExpr &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropPartitionsExpr& obj); + +typedef struct _RequestPartsSpec__isset { + _RequestPartsSpec__isset() : names(false), exprs(false) {} + bool names :1; + bool exprs :1; +} _RequestPartsSpec__isset; + +class RequestPartsSpec : public virtual ::apache::thrift::TBase { + public: + + RequestPartsSpec(const RequestPartsSpec&); + RequestPartsSpec& operator=(const RequestPartsSpec&); + RequestPartsSpec() noexcept; + + virtual ~RequestPartsSpec() noexcept; + std::vector names; + std::vector exprs; + + _RequestPartsSpec__isset __isset; + + void __set_names(const std::vector & val); + + void __set_exprs(const std::vector & val); + + bool operator == (const RequestPartsSpec & rhs) const; + bool operator != (const RequestPartsSpec &rhs) const { + return !(*this == rhs); + } + + bool operator < (const RequestPartsSpec & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(RequestPartsSpec &a, RequestPartsSpec &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const RequestPartsSpec& obj); + +typedef struct _DropPartitionsRequest__isset { + _DropPartitionsRequest__isset() : deleteData(false), ifExists(true), ignoreProtection(false), environmentContext(false), needResult(true), catName(false), skipColumnSchemaForPartition(false) {} + bool deleteData :1; + bool ifExists :1; + bool ignoreProtection :1; + bool environmentContext :1; + bool needResult :1; + bool catName :1; + bool skipColumnSchemaForPartition :1; +} _DropPartitionsRequest__isset; + +class DropPartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + DropPartitionsRequest(const DropPartitionsRequest&); + DropPartitionsRequest& operator=(const DropPartitionsRequest&); + DropPartitionsRequest() noexcept; + + virtual ~DropPartitionsRequest() noexcept; + std::string dbName; + std::string tblName; + RequestPartsSpec parts; + bool deleteData; + bool ifExists; + bool ignoreProtection; + EnvironmentContext environmentContext; + bool needResult; + std::string catName; + bool skipColumnSchemaForPartition; + + _DropPartitionsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_parts(const RequestPartsSpec& val); + + void __set_deleteData(const bool val); + + void __set_ifExists(const bool val); + + void __set_ignoreProtection(const bool val); + + void __set_environmentContext(const EnvironmentContext& val); + + void __set_needResult(const bool val); + + void __set_catName(const std::string& val); + + void __set_skipColumnSchemaForPartition(const bool val); + + bool operator == (const DropPartitionsRequest & rhs) const; + bool operator != (const DropPartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropPartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropPartitionsRequest &a, DropPartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropPartitionsRequest& obj); + +typedef struct _DropPartitionRequest__isset { + _DropPartitionRequest__isset() : catName(false), partName(false), partVals(false), deleteData(false), environmentContext(false) {} + bool catName :1; + bool partName :1; + bool partVals :1; + bool deleteData :1; + bool environmentContext :1; +} _DropPartitionRequest__isset; + +class DropPartitionRequest : public virtual ::apache::thrift::TBase { + public: + + DropPartitionRequest(const DropPartitionRequest&); + DropPartitionRequest& operator=(const DropPartitionRequest&); + DropPartitionRequest() noexcept; + + virtual ~DropPartitionRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::string partName; + std::vector partVals; + bool deleteData; + EnvironmentContext environmentContext; + + _DropPartitionRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partName(const std::string& val); + + void __set_partVals(const std::vector & val); + + void __set_deleteData(const bool val); + + void __set_environmentContext(const EnvironmentContext& val); + + bool operator == (const DropPartitionRequest & rhs) const; + bool operator != (const DropPartitionRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropPartitionRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropPartitionRequest &a, DropPartitionRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropPartitionRequest& obj); + +typedef struct _PartitionValuesRequest__isset { + _PartitionValuesRequest__isset() : applyDistinct(true), filter(false), partitionOrder(false), ascending(true), maxParts(true), catName(false), validWriteIdList(false) {} + bool applyDistinct :1; + bool filter :1; + bool partitionOrder :1; + bool ascending :1; + bool maxParts :1; + bool catName :1; + bool validWriteIdList :1; +} _PartitionValuesRequest__isset; + +class PartitionValuesRequest : public virtual ::apache::thrift::TBase { + public: + + PartitionValuesRequest(const PartitionValuesRequest&); + PartitionValuesRequest& operator=(const PartitionValuesRequest&); + PartitionValuesRequest() noexcept; + + virtual ~PartitionValuesRequest() noexcept; + std::string dbName; + std::string tblName; + std::vector partitionKeys; + bool applyDistinct; + std::string filter; + std::vector partitionOrder; + bool ascending; + int64_t maxParts; + std::string catName; + std::string validWriteIdList; + + _PartitionValuesRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partitionKeys(const std::vector & val); + + void __set_applyDistinct(const bool val); + + void __set_filter(const std::string& val); + + void __set_partitionOrder(const std::vector & val); + + void __set_ascending(const bool val); + + void __set_maxParts(const int64_t val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + bool operator == (const PartitionValuesRequest & rhs) const; + bool operator != (const PartitionValuesRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionValuesRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionValuesRequest &a, PartitionValuesRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionValuesRequest& obj); + + +class PartitionValuesRow : public virtual ::apache::thrift::TBase { + public: + + PartitionValuesRow(const PartitionValuesRow&); + PartitionValuesRow& operator=(const PartitionValuesRow&); + PartitionValuesRow() noexcept; + + virtual ~PartitionValuesRow() noexcept; + std::vector row; + + void __set_row(const std::vector & val); + + bool operator == (const PartitionValuesRow & rhs) const; + bool operator != (const PartitionValuesRow &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionValuesRow & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionValuesRow &a, PartitionValuesRow &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionValuesRow& obj); + + +class PartitionValuesResponse : public virtual ::apache::thrift::TBase { + public: + + PartitionValuesResponse(const PartitionValuesResponse&); + PartitionValuesResponse& operator=(const PartitionValuesResponse&); + PartitionValuesResponse() noexcept; + + virtual ~PartitionValuesResponse() noexcept; + std::vector partitionValues; + + void __set_partitionValues(const std::vector & val); + + bool operator == (const PartitionValuesResponse & rhs) const; + bool operator != (const PartitionValuesResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionValuesResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionValuesResponse &a, PartitionValuesResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionValuesResponse& obj); + +typedef struct _GetPartitionsByNamesRequest__isset { + _GetPartitionsByNamesRequest__isset() : names(false), get_col_stats(false), processorCapabilities(false), processorIdentifier(false), engine(true), validWriteIdList(false), getFileMetadata(false), id(true), skipColumnSchemaForPartition(false), includeParamKeyPattern(false), excludeParamKeyPattern(false) {} + bool names :1; + bool get_col_stats :1; + bool processorCapabilities :1; + bool processorIdentifier :1; + bool engine :1; + bool validWriteIdList :1; + bool getFileMetadata :1; + bool id :1; + bool skipColumnSchemaForPartition :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; +} _GetPartitionsByNamesRequest__isset; + +class GetPartitionsByNamesRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsByNamesRequest(const GetPartitionsByNamesRequest&); + GetPartitionsByNamesRequest& operator=(const GetPartitionsByNamesRequest&); + GetPartitionsByNamesRequest(); + + virtual ~GetPartitionsByNamesRequest() noexcept; + std::string db_name; + std::string tbl_name; + std::vector names; + bool get_col_stats; + std::vector processorCapabilities; + std::string processorIdentifier; + std::string engine; + std::string validWriteIdList; + bool getFileMetadata; + int64_t id; + bool skipColumnSchemaForPartition; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + + _GetPartitionsByNamesRequest__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_names(const std::vector & val); + + void __set_get_col_stats(const bool val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + void __set_engine(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_getFileMetadata(const bool val); + + void __set_id(const int64_t val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + bool operator == (const GetPartitionsByNamesRequest & rhs) const; + bool operator != (const GetPartitionsByNamesRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsByNamesRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsByNamesRequest &a, GetPartitionsByNamesRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsByNamesRequest& obj); + +typedef struct _GetPartitionsByNamesResult__isset { + _GetPartitionsByNamesResult__isset() : dictionary(false) {} + bool dictionary :1; +} _GetPartitionsByNamesResult__isset; + +class GetPartitionsByNamesResult : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsByNamesResult(const GetPartitionsByNamesResult&); + GetPartitionsByNamesResult& operator=(const GetPartitionsByNamesResult&); + GetPartitionsByNamesResult() noexcept; + + virtual ~GetPartitionsByNamesResult() noexcept; + std::vector partitions; + ObjectDictionary dictionary; + + _GetPartitionsByNamesResult__isset __isset; + + void __set_partitions(const std::vector & val); + + void __set_dictionary(const ObjectDictionary& val); + + bool operator == (const GetPartitionsByNamesResult & rhs) const; + bool operator != (const GetPartitionsByNamesResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsByNamesResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsByNamesResult &a, GetPartitionsByNamesResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsByNamesResult& obj); + +typedef struct _DataConnector__isset { + _DataConnector__isset() : name(false), type(false), url(false), description(false), parameters(false), ownerName(false), ownerType(false), createTime(false) {} + bool name :1; + bool type :1; + bool url :1; + bool description :1; + bool parameters :1; + bool ownerName :1; + bool ownerType :1; + bool createTime :1; +} _DataConnector__isset; + +class DataConnector : public virtual ::apache::thrift::TBase { + public: + + DataConnector(const DataConnector&); + DataConnector& operator=(const DataConnector&); + DataConnector() noexcept; + + virtual ~DataConnector() noexcept; + std::string name; + std::string type; + std::string url; + std::string description; + std::map parameters; + std::string ownerName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + int32_t createTime; + + _DataConnector__isset __isset; + + void __set_name(const std::string& val); + + void __set_type(const std::string& val); + + void __set_url(const std::string& val); + + void __set_description(const std::string& val); + + void __set_parameters(const std::map & val); + + void __set_ownerName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + void __set_createTime(const int32_t val); + + bool operator == (const DataConnector & rhs) const; + bool operator != (const DataConnector &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DataConnector & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DataConnector &a, DataConnector &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DataConnector& obj); + +typedef struct _ResourceUri__isset { + _ResourceUri__isset() : resourceType(false), uri(false) {} + bool resourceType :1; + bool uri :1; +} _ResourceUri__isset; + +class ResourceUri : public virtual ::apache::thrift::TBase { + public: + + ResourceUri(const ResourceUri&); + ResourceUri& operator=(const ResourceUri&); + ResourceUri() noexcept; + + virtual ~ResourceUri() noexcept; + /** + * + * @see ResourceType + */ + ResourceType::type resourceType; + std::string uri; + + _ResourceUri__isset __isset; + + void __set_resourceType(const ResourceType::type val); + + void __set_uri(const std::string& val); + + bool operator == (const ResourceUri & rhs) const; + bool operator != (const ResourceUri &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ResourceUri & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ResourceUri &a, ResourceUri &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ResourceUri& obj); + +typedef struct _Function__isset { + _Function__isset() : functionName(false), dbName(false), className(false), ownerName(false), ownerType(false), createTime(false), functionType(false), resourceUris(false), catName(false) {} + bool functionName :1; + bool dbName :1; + bool className :1; + bool ownerName :1; + bool ownerType :1; + bool createTime :1; + bool functionType :1; + bool resourceUris :1; + bool catName :1; +} _Function__isset; + +class Function : public virtual ::apache::thrift::TBase { + public: + + Function(const Function&); + Function& operator=(const Function&); + Function() noexcept; + + virtual ~Function() noexcept; + std::string functionName; + std::string dbName; + std::string className; + std::string ownerName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + int32_t createTime; + /** + * + * @see FunctionType + */ + FunctionType::type functionType; + std::vector resourceUris; + std::string catName; + + _Function__isset __isset; + + void __set_functionName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_className(const std::string& val); + + void __set_ownerName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + void __set_createTime(const int32_t val); + + void __set_functionType(const FunctionType::type val); + + void __set_resourceUris(const std::vector & val); + + void __set_catName(const std::string& val); + + bool operator == (const Function & rhs) const; + bool operator != (const Function &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Function & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Function &a, Function &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Function& obj); + +typedef struct _TxnInfo__isset { + _TxnInfo__isset() : agentInfo(true), heartbeatCount(true), metaInfo(false), startedTime(false), lastHeartbeatTime(false) {} + bool agentInfo :1; + bool heartbeatCount :1; + bool metaInfo :1; + bool startedTime :1; + bool lastHeartbeatTime :1; +} _TxnInfo__isset; + +class TxnInfo : public virtual ::apache::thrift::TBase { + public: + + TxnInfo(const TxnInfo&); + TxnInfo& operator=(const TxnInfo&); + TxnInfo(); + + virtual ~TxnInfo() noexcept; + int64_t id; + /** + * + * @see TxnState + */ + TxnState::type state; + std::string user; + std::string hostname; + std::string agentInfo; + int32_t heartbeatCount; + std::string metaInfo; + int64_t startedTime; + int64_t lastHeartbeatTime; + + _TxnInfo__isset __isset; + + void __set_id(const int64_t val); + + void __set_state(const TxnState::type val); + + void __set_user(const std::string& val); + + void __set_hostname(const std::string& val); + + void __set_agentInfo(const std::string& val); + + void __set_heartbeatCount(const int32_t val); + + void __set_metaInfo(const std::string& val); + + void __set_startedTime(const int64_t val); + + void __set_lastHeartbeatTime(const int64_t val); + + bool operator == (const TxnInfo & rhs) const; + bool operator != (const TxnInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TxnInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TxnInfo &a, TxnInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TxnInfo& obj); + + +class GetOpenTxnsInfoResponse : public virtual ::apache::thrift::TBase { + public: + + GetOpenTxnsInfoResponse(const GetOpenTxnsInfoResponse&); + GetOpenTxnsInfoResponse& operator=(const GetOpenTxnsInfoResponse&); + GetOpenTxnsInfoResponse() noexcept; + + virtual ~GetOpenTxnsInfoResponse() noexcept; + int64_t txn_high_water_mark; + std::vector open_txns; + + void __set_txn_high_water_mark(const int64_t val); + + void __set_open_txns(const std::vector & val); + + bool operator == (const GetOpenTxnsInfoResponse & rhs) const; + bool operator != (const GetOpenTxnsInfoResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetOpenTxnsInfoResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetOpenTxnsInfoResponse &a, GetOpenTxnsInfoResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsInfoResponse& obj); + +typedef struct _GetOpenTxnsResponse__isset { + _GetOpenTxnsResponse__isset() : min_open_txn(false) {} + bool min_open_txn :1; +} _GetOpenTxnsResponse__isset; + +class GetOpenTxnsResponse : public virtual ::apache::thrift::TBase { + public: + + GetOpenTxnsResponse(const GetOpenTxnsResponse&); + GetOpenTxnsResponse& operator=(const GetOpenTxnsResponse&); + GetOpenTxnsResponse() noexcept; + + virtual ~GetOpenTxnsResponse() noexcept; + int64_t txn_high_water_mark; + std::vector open_txns; + int64_t min_open_txn; + std::string abortedBits; + + _GetOpenTxnsResponse__isset __isset; + + void __set_txn_high_water_mark(const int64_t val); + + void __set_open_txns(const std::vector & val); + + void __set_min_open_txn(const int64_t val); + + void __set_abortedBits(const std::string& val); + + bool operator == (const GetOpenTxnsResponse & rhs) const; + bool operator != (const GetOpenTxnsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetOpenTxnsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetOpenTxnsResponse &a, GetOpenTxnsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsResponse& obj); + +typedef struct _OpenTxnRequest__isset { + _OpenTxnRequest__isset() : agentInfo(true), replPolicy(false), replSrcTxnIds(false), txn_type(true) {} + bool agentInfo :1; + bool replPolicy :1; + bool replSrcTxnIds :1; + bool txn_type :1; +} _OpenTxnRequest__isset; + +class OpenTxnRequest : public virtual ::apache::thrift::TBase { + public: + + OpenTxnRequest(const OpenTxnRequest&); + OpenTxnRequest& operator=(const OpenTxnRequest&); + OpenTxnRequest(); + + virtual ~OpenTxnRequest() noexcept; + int32_t num_txns; + std::string user; + std::string hostname; + std::string agentInfo; + std::string replPolicy; + std::vector replSrcTxnIds; + /** + * + * @see TxnType + */ + TxnType::type txn_type; + + _OpenTxnRequest__isset __isset; + + void __set_num_txns(const int32_t val); + + void __set_user(const std::string& val); + + void __set_hostname(const std::string& val); + + void __set_agentInfo(const std::string& val); + + void __set_replPolicy(const std::string& val); + + void __set_replSrcTxnIds(const std::vector & val); + + void __set_txn_type(const TxnType::type val); + + bool operator == (const OpenTxnRequest & rhs) const; + bool operator != (const OpenTxnRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const OpenTxnRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(OpenTxnRequest &a, OpenTxnRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const OpenTxnRequest& obj); + + +class OpenTxnsResponse : public virtual ::apache::thrift::TBase { + public: + + OpenTxnsResponse(const OpenTxnsResponse&); + OpenTxnsResponse& operator=(const OpenTxnsResponse&); + OpenTxnsResponse() noexcept; + + virtual ~OpenTxnsResponse() noexcept; + std::vector txn_ids; + + void __set_txn_ids(const std::vector & val); + + bool operator == (const OpenTxnsResponse & rhs) const; + bool operator != (const OpenTxnsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const OpenTxnsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(OpenTxnsResponse &a, OpenTxnsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const OpenTxnsResponse& obj); + +typedef struct _AbortTxnRequest__isset { + _AbortTxnRequest__isset() : replPolicy(false), txn_type(false), errorCode(false) {} + bool replPolicy :1; + bool txn_type :1; + bool errorCode :1; +} _AbortTxnRequest__isset; + +class AbortTxnRequest : public virtual ::apache::thrift::TBase { + public: + + AbortTxnRequest(const AbortTxnRequest&); + AbortTxnRequest& operator=(const AbortTxnRequest&); + AbortTxnRequest() noexcept; + + virtual ~AbortTxnRequest() noexcept; + int64_t txnid; + std::string replPolicy; + /** + * + * @see TxnType + */ + TxnType::type txn_type; + int64_t errorCode; + + _AbortTxnRequest__isset __isset; + + void __set_txnid(const int64_t val); + + void __set_replPolicy(const std::string& val); + + void __set_txn_type(const TxnType::type val); + + void __set_errorCode(const int64_t val); + + bool operator == (const AbortTxnRequest & rhs) const; + bool operator != (const AbortTxnRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AbortTxnRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AbortTxnRequest &a, AbortTxnRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AbortTxnRequest& obj); + +typedef struct _AbortTxnsRequest__isset { + _AbortTxnsRequest__isset() : errorCode(false) {} + bool errorCode :1; +} _AbortTxnsRequest__isset; + +class AbortTxnsRequest : public virtual ::apache::thrift::TBase { + public: + + AbortTxnsRequest(const AbortTxnsRequest&); + AbortTxnsRequest& operator=(const AbortTxnsRequest&); + AbortTxnsRequest() noexcept; + + virtual ~AbortTxnsRequest() noexcept; + std::vector txn_ids; + int64_t errorCode; + + _AbortTxnsRequest__isset __isset; + + void __set_txn_ids(const std::vector & val); + + void __set_errorCode(const int64_t val); + + bool operator == (const AbortTxnsRequest & rhs) const; + bool operator != (const AbortTxnsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AbortTxnsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AbortTxnsRequest &a, AbortTxnsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AbortTxnsRequest& obj); + + +class CommitTxnKeyValue : public virtual ::apache::thrift::TBase { + public: + + CommitTxnKeyValue(const CommitTxnKeyValue&); + CommitTxnKeyValue& operator=(const CommitTxnKeyValue&); + CommitTxnKeyValue() noexcept; + + virtual ~CommitTxnKeyValue() noexcept; + int64_t tableId; + std::string key; + std::string value; + + void __set_tableId(const int64_t val); + + void __set_key(const std::string& val); + + void __set_value(const std::string& val); + + bool operator == (const CommitTxnKeyValue & rhs) const; + bool operator != (const CommitTxnKeyValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CommitTxnKeyValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CommitTxnKeyValue &a, CommitTxnKeyValue &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CommitTxnKeyValue& obj); + +typedef struct _WriteEventInfo__isset { + _WriteEventInfo__isset() : partition(false), tableObj(false), partitionObj(false) {} + bool partition :1; + bool tableObj :1; + bool partitionObj :1; +} _WriteEventInfo__isset; + +class WriteEventInfo : public virtual ::apache::thrift::TBase { + public: + + WriteEventInfo(const WriteEventInfo&); + WriteEventInfo& operator=(const WriteEventInfo&); + WriteEventInfo() noexcept; + + virtual ~WriteEventInfo() noexcept; + int64_t writeId; + std::string database; + std::string table; + std::string files; + std::string partition; + std::string tableObj; + std::string partitionObj; + + _WriteEventInfo__isset __isset; + + void __set_writeId(const int64_t val); + + void __set_database(const std::string& val); + + void __set_table(const std::string& val); + + void __set_files(const std::string& val); + + void __set_partition(const std::string& val); + + void __set_tableObj(const std::string& val); + + void __set_partitionObj(const std::string& val); + + bool operator == (const WriteEventInfo & rhs) const; + bool operator != (const WriteEventInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WriteEventInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WriteEventInfo &a, WriteEventInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WriteEventInfo& obj); + +typedef struct _ReplLastIdInfo__isset { + _ReplLastIdInfo__isset() : table(false), catalog(false), partitionList(false) {} + bool table :1; + bool catalog :1; + bool partitionList :1; +} _ReplLastIdInfo__isset; + +class ReplLastIdInfo : public virtual ::apache::thrift::TBase { + public: + + ReplLastIdInfo(const ReplLastIdInfo&); + ReplLastIdInfo& operator=(const ReplLastIdInfo&); + ReplLastIdInfo() noexcept; + + virtual ~ReplLastIdInfo() noexcept; + std::string database; + int64_t lastReplId; + std::string table; + std::string catalog; + std::vector partitionList; + + _ReplLastIdInfo__isset __isset; + + void __set_database(const std::string& val); + + void __set_lastReplId(const int64_t val); + + void __set_table(const std::string& val); + + void __set_catalog(const std::string& val); + + void __set_partitionList(const std::vector & val); + + bool operator == (const ReplLastIdInfo & rhs) const; + bool operator != (const ReplLastIdInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ReplLastIdInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ReplLastIdInfo &a, ReplLastIdInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ReplLastIdInfo& obj); + + +class UpdateTransactionalStatsRequest : public virtual ::apache::thrift::TBase { + public: + + UpdateTransactionalStatsRequest(const UpdateTransactionalStatsRequest&) noexcept; + UpdateTransactionalStatsRequest& operator=(const UpdateTransactionalStatsRequest&) noexcept; + UpdateTransactionalStatsRequest() noexcept; + + virtual ~UpdateTransactionalStatsRequest() noexcept; + int64_t tableId; + int64_t insertCount; + int64_t updatedCount; + int64_t deletedCount; + + void __set_tableId(const int64_t val); + + void __set_insertCount(const int64_t val); + + void __set_updatedCount(const int64_t val); + + void __set_deletedCount(const int64_t val); + + bool operator == (const UpdateTransactionalStatsRequest & rhs) const; + bool operator != (const UpdateTransactionalStatsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UpdateTransactionalStatsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(UpdateTransactionalStatsRequest &a, UpdateTransactionalStatsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UpdateTransactionalStatsRequest& obj); + +typedef struct _CommitTxnRequest__isset { + _CommitTxnRequest__isset() : replPolicy(false), writeEventInfos(false), replLastIdInfo(false), keyValue(false), exclWriteEnabled(true), txn_type(false) {} + bool replPolicy :1; + bool writeEventInfos :1; + bool replLastIdInfo :1; + bool keyValue :1; + bool exclWriteEnabled :1; + bool txn_type :1; +} _CommitTxnRequest__isset; + +class CommitTxnRequest : public virtual ::apache::thrift::TBase { + public: + + CommitTxnRequest(const CommitTxnRequest&); + CommitTxnRequest& operator=(const CommitTxnRequest&); + CommitTxnRequest() noexcept; + + virtual ~CommitTxnRequest() noexcept; + int64_t txnid; + std::string replPolicy; + std::vector writeEventInfos; + ReplLastIdInfo replLastIdInfo; + CommitTxnKeyValue keyValue; + bool exclWriteEnabled; + /** + * + * @see TxnType + */ + TxnType::type txn_type; + + _CommitTxnRequest__isset __isset; + + void __set_txnid(const int64_t val); + + void __set_replPolicy(const std::string& val); + + void __set_writeEventInfos(const std::vector & val); + + void __set_replLastIdInfo(const ReplLastIdInfo& val); + + void __set_keyValue(const CommitTxnKeyValue& val); + + void __set_exclWriteEnabled(const bool val); + + void __set_txn_type(const TxnType::type val); + + bool operator == (const CommitTxnRequest & rhs) const; + bool operator != (const CommitTxnRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CommitTxnRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CommitTxnRequest &a, CommitTxnRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CommitTxnRequest& obj); + +typedef struct _ReplTblWriteIdStateRequest__isset { + _ReplTblWriteIdStateRequest__isset() : partNames(false) {} + bool partNames :1; +} _ReplTblWriteIdStateRequest__isset; + +class ReplTblWriteIdStateRequest : public virtual ::apache::thrift::TBase { + public: + + ReplTblWriteIdStateRequest(const ReplTblWriteIdStateRequest&); + ReplTblWriteIdStateRequest& operator=(const ReplTblWriteIdStateRequest&); + ReplTblWriteIdStateRequest() noexcept; + + virtual ~ReplTblWriteIdStateRequest() noexcept; + std::string validWriteIdlist; + std::string user; + std::string hostName; + std::string dbName; + std::string tableName; + std::vector partNames; + + _ReplTblWriteIdStateRequest__isset __isset; + + void __set_validWriteIdlist(const std::string& val); + + void __set_user(const std::string& val); + + void __set_hostName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partNames(const std::vector & val); + + bool operator == (const ReplTblWriteIdStateRequest & rhs) const; + bool operator != (const ReplTblWriteIdStateRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ReplTblWriteIdStateRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ReplTblWriteIdStateRequest &a, ReplTblWriteIdStateRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ReplTblWriteIdStateRequest& obj); + +typedef struct _GetValidWriteIdsRequest__isset { + _GetValidWriteIdsRequest__isset() : validTxnList(false), writeId(false) {} + bool validTxnList :1; + bool writeId :1; +} _GetValidWriteIdsRequest__isset; + +class GetValidWriteIdsRequest : public virtual ::apache::thrift::TBase { + public: + + GetValidWriteIdsRequest(const GetValidWriteIdsRequest&); + GetValidWriteIdsRequest& operator=(const GetValidWriteIdsRequest&); + GetValidWriteIdsRequest() noexcept; + + virtual ~GetValidWriteIdsRequest() noexcept; + std::vector fullTableNames; + std::string validTxnList; + int64_t writeId; + + _GetValidWriteIdsRequest__isset __isset; + + void __set_fullTableNames(const std::vector & val); + + void __set_validTxnList(const std::string& val); + + void __set_writeId(const int64_t val); + + bool operator == (const GetValidWriteIdsRequest & rhs) const; + bool operator != (const GetValidWriteIdsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetValidWriteIdsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetValidWriteIdsRequest &a, GetValidWriteIdsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetValidWriteIdsRequest& obj); + +typedef struct _TableValidWriteIds__isset { + _TableValidWriteIds__isset() : minOpenWriteId(false) {} + bool minOpenWriteId :1; +} _TableValidWriteIds__isset; + +class TableValidWriteIds : public virtual ::apache::thrift::TBase { + public: + + TableValidWriteIds(const TableValidWriteIds&); + TableValidWriteIds& operator=(const TableValidWriteIds&); + TableValidWriteIds() noexcept; + + virtual ~TableValidWriteIds() noexcept; + std::string fullTableName; + int64_t writeIdHighWaterMark; + std::vector invalidWriteIds; + int64_t minOpenWriteId; + std::string abortedBits; + + _TableValidWriteIds__isset __isset; + + void __set_fullTableName(const std::string& val); + + void __set_writeIdHighWaterMark(const int64_t val); + + void __set_invalidWriteIds(const std::vector & val); + + void __set_minOpenWriteId(const int64_t val); + + void __set_abortedBits(const std::string& val); + + bool operator == (const TableValidWriteIds & rhs) const; + bool operator != (const TableValidWriteIds &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TableValidWriteIds & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TableValidWriteIds &a, TableValidWriteIds &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TableValidWriteIds& obj); + + +class GetValidWriteIdsResponse : public virtual ::apache::thrift::TBase { + public: + + GetValidWriteIdsResponse(const GetValidWriteIdsResponse&); + GetValidWriteIdsResponse& operator=(const GetValidWriteIdsResponse&); + GetValidWriteIdsResponse() noexcept; + + virtual ~GetValidWriteIdsResponse() noexcept; + std::vector tblValidWriteIds; + + void __set_tblValidWriteIds(const std::vector & val); + + bool operator == (const GetValidWriteIdsResponse & rhs) const; + bool operator != (const GetValidWriteIdsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetValidWriteIdsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetValidWriteIdsResponse &a, GetValidWriteIdsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetValidWriteIdsResponse& obj); + + +class TxnToWriteId : public virtual ::apache::thrift::TBase { + public: + + TxnToWriteId(const TxnToWriteId&) noexcept; + TxnToWriteId& operator=(const TxnToWriteId&) noexcept; + TxnToWriteId() noexcept; + + virtual ~TxnToWriteId() noexcept; + int64_t txnId; + int64_t writeId; + + void __set_txnId(const int64_t val); + + void __set_writeId(const int64_t val); + + bool operator == (const TxnToWriteId & rhs) const; + bool operator != (const TxnToWriteId &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TxnToWriteId & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TxnToWriteId &a, TxnToWriteId &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TxnToWriteId& obj); + +typedef struct _AllocateTableWriteIdsRequest__isset { + _AllocateTableWriteIdsRequest__isset() : txnIds(false), replPolicy(false), srcTxnToWriteIdList(false), reallocate(true) {} + bool txnIds :1; + bool replPolicy :1; + bool srcTxnToWriteIdList :1; + bool reallocate :1; +} _AllocateTableWriteIdsRequest__isset; + +class AllocateTableWriteIdsRequest : public virtual ::apache::thrift::TBase { + public: + + AllocateTableWriteIdsRequest(const AllocateTableWriteIdsRequest&); + AllocateTableWriteIdsRequest& operator=(const AllocateTableWriteIdsRequest&); + AllocateTableWriteIdsRequest() noexcept; + + virtual ~AllocateTableWriteIdsRequest() noexcept; + std::string dbName; + std::string tableName; + std::vector txnIds; + std::string replPolicy; + std::vector srcTxnToWriteIdList; + bool reallocate; + + _AllocateTableWriteIdsRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_txnIds(const std::vector & val); + + void __set_replPolicy(const std::string& val); + + void __set_srcTxnToWriteIdList(const std::vector & val); + + void __set_reallocate(const bool val); + + bool operator == (const AllocateTableWriteIdsRequest & rhs) const; + bool operator != (const AllocateTableWriteIdsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AllocateTableWriteIdsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AllocateTableWriteIdsRequest &a, AllocateTableWriteIdsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AllocateTableWriteIdsRequest& obj); + + +class AllocateTableWriteIdsResponse : public virtual ::apache::thrift::TBase { + public: + + AllocateTableWriteIdsResponse(const AllocateTableWriteIdsResponse&); + AllocateTableWriteIdsResponse& operator=(const AllocateTableWriteIdsResponse&); + AllocateTableWriteIdsResponse() noexcept; + + virtual ~AllocateTableWriteIdsResponse() noexcept; + std::vector txnToWriteIds; + + void __set_txnToWriteIds(const std::vector & val); + + bool operator == (const AllocateTableWriteIdsResponse & rhs) const; + bool operator != (const AllocateTableWriteIdsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AllocateTableWriteIdsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AllocateTableWriteIdsResponse &a, AllocateTableWriteIdsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AllocateTableWriteIdsResponse& obj); + + +class MaxAllocatedTableWriteIdRequest : public virtual ::apache::thrift::TBase { + public: + + MaxAllocatedTableWriteIdRequest(const MaxAllocatedTableWriteIdRequest&); + MaxAllocatedTableWriteIdRequest& operator=(const MaxAllocatedTableWriteIdRequest&); + MaxAllocatedTableWriteIdRequest() noexcept; + + virtual ~MaxAllocatedTableWriteIdRequest() noexcept; + std::string dbName; + std::string tableName; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + bool operator == (const MaxAllocatedTableWriteIdRequest & rhs) const; + bool operator != (const MaxAllocatedTableWriteIdRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const MaxAllocatedTableWriteIdRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(MaxAllocatedTableWriteIdRequest &a, MaxAllocatedTableWriteIdRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const MaxAllocatedTableWriteIdRequest& obj); + + +class MaxAllocatedTableWriteIdResponse : public virtual ::apache::thrift::TBase { + public: + + MaxAllocatedTableWriteIdResponse(const MaxAllocatedTableWriteIdResponse&) noexcept; + MaxAllocatedTableWriteIdResponse& operator=(const MaxAllocatedTableWriteIdResponse&) noexcept; + MaxAllocatedTableWriteIdResponse() noexcept; + + virtual ~MaxAllocatedTableWriteIdResponse() noexcept; + int64_t maxWriteId; + + void __set_maxWriteId(const int64_t val); + + bool operator == (const MaxAllocatedTableWriteIdResponse & rhs) const; + bool operator != (const MaxAllocatedTableWriteIdResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const MaxAllocatedTableWriteIdResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(MaxAllocatedTableWriteIdResponse &a, MaxAllocatedTableWriteIdResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const MaxAllocatedTableWriteIdResponse& obj); + + +class SeedTableWriteIdsRequest : public virtual ::apache::thrift::TBase { + public: + + SeedTableWriteIdsRequest(const SeedTableWriteIdsRequest&); + SeedTableWriteIdsRequest& operator=(const SeedTableWriteIdsRequest&); + SeedTableWriteIdsRequest() noexcept; + + virtual ~SeedTableWriteIdsRequest() noexcept; + std::string dbName; + std::string tableName; + int64_t seedWriteId; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_seedWriteId(const int64_t val); + + bool operator == (const SeedTableWriteIdsRequest & rhs) const; + bool operator != (const SeedTableWriteIdsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SeedTableWriteIdsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SeedTableWriteIdsRequest &a, SeedTableWriteIdsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SeedTableWriteIdsRequest& obj); + + +class SeedTxnIdRequest : public virtual ::apache::thrift::TBase { + public: + + SeedTxnIdRequest(const SeedTxnIdRequest&) noexcept; + SeedTxnIdRequest& operator=(const SeedTxnIdRequest&) noexcept; + SeedTxnIdRequest() noexcept; + + virtual ~SeedTxnIdRequest() noexcept; + int64_t seedTxnId; + + void __set_seedTxnId(const int64_t val); + + bool operator == (const SeedTxnIdRequest & rhs) const; + bool operator != (const SeedTxnIdRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SeedTxnIdRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SeedTxnIdRequest &a, SeedTxnIdRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SeedTxnIdRequest& obj); + +typedef struct _LockComponent__isset { + _LockComponent__isset() : tablename(false), partitionname(false), operationType(true), isTransactional(true), isDynamicPartitionWrite(true) {} + bool tablename :1; + bool partitionname :1; + bool operationType :1; + bool isTransactional :1; + bool isDynamicPartitionWrite :1; +} _LockComponent__isset; + +class LockComponent : public virtual ::apache::thrift::TBase { + public: + + LockComponent(const LockComponent&); + LockComponent& operator=(const LockComponent&); + LockComponent() noexcept; + + virtual ~LockComponent() noexcept; + /** + * + * @see LockType + */ + LockType::type type; + /** + * + * @see LockLevel + */ + LockLevel::type level; + std::string dbname; + std::string tablename; + std::string partitionname; + /** + * + * @see DataOperationType + */ + DataOperationType::type operationType; + bool isTransactional; + bool isDynamicPartitionWrite; + + _LockComponent__isset __isset; + + void __set_type(const LockType::type val); + + void __set_level(const LockLevel::type val); + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionname(const std::string& val); + + void __set_operationType(const DataOperationType::type val); + + void __set_isTransactional(const bool val); + + void __set_isDynamicPartitionWrite(const bool val); + + bool operator == (const LockComponent & rhs) const; + bool operator != (const LockComponent &rhs) const { + return !(*this == rhs); + } + + bool operator < (const LockComponent & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(LockComponent &a, LockComponent &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const LockComponent& obj); + +typedef struct _LockRequest__isset { + _LockRequest__isset() : txnid(false), agentInfo(true), zeroWaitReadEnabled(true), exclusiveCTAS(true), locklessReadsEnabled(true) {} + bool txnid :1; + bool agentInfo :1; + bool zeroWaitReadEnabled :1; + bool exclusiveCTAS :1; + bool locklessReadsEnabled :1; +} _LockRequest__isset; + +class LockRequest : public virtual ::apache::thrift::TBase { + public: + + LockRequest(const LockRequest&); + LockRequest& operator=(const LockRequest&); + LockRequest(); + + virtual ~LockRequest() noexcept; + std::vector component; + int64_t txnid; + std::string user; + std::string hostname; + std::string agentInfo; + bool zeroWaitReadEnabled; + bool exclusiveCTAS; + bool locklessReadsEnabled; + + _LockRequest__isset __isset; + + void __set_component(const std::vector & val); + + void __set_txnid(const int64_t val); + + void __set_user(const std::string& val); + + void __set_hostname(const std::string& val); + + void __set_agentInfo(const std::string& val); + + void __set_zeroWaitReadEnabled(const bool val); + + void __set_exclusiveCTAS(const bool val); + + void __set_locklessReadsEnabled(const bool val); + + bool operator == (const LockRequest & rhs) const; + bool operator != (const LockRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const LockRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(LockRequest &a, LockRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const LockRequest& obj); + +typedef struct _LockResponse__isset { + _LockResponse__isset() : errorMessage(false) {} + bool errorMessage :1; +} _LockResponse__isset; + +class LockResponse : public virtual ::apache::thrift::TBase { + public: + + LockResponse(const LockResponse&); + LockResponse& operator=(const LockResponse&); + LockResponse() noexcept; + + virtual ~LockResponse() noexcept; + int64_t lockid; + /** + * + * @see LockState + */ + LockState::type state; + std::string errorMessage; + + _LockResponse__isset __isset; + + void __set_lockid(const int64_t val); + + void __set_state(const LockState::type val); + + void __set_errorMessage(const std::string& val); + + bool operator == (const LockResponse & rhs) const; + bool operator != (const LockResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const LockResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(LockResponse &a, LockResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const LockResponse& obj); + +typedef struct _CheckLockRequest__isset { + _CheckLockRequest__isset() : txnid(false), elapsed_ms(false) {} + bool txnid :1; + bool elapsed_ms :1; +} _CheckLockRequest__isset; + +class CheckLockRequest : public virtual ::apache::thrift::TBase { + public: + + CheckLockRequest(const CheckLockRequest&) noexcept; + CheckLockRequest& operator=(const CheckLockRequest&) noexcept; + CheckLockRequest() noexcept; + + virtual ~CheckLockRequest() noexcept; + int64_t lockid; + int64_t txnid; + int64_t elapsed_ms; + + _CheckLockRequest__isset __isset; + + void __set_lockid(const int64_t val); + + void __set_txnid(const int64_t val); + + void __set_elapsed_ms(const int64_t val); + + bool operator == (const CheckLockRequest & rhs) const; + bool operator != (const CheckLockRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CheckLockRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CheckLockRequest &a, CheckLockRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CheckLockRequest& obj); + + +class UnlockRequest : public virtual ::apache::thrift::TBase { + public: + + UnlockRequest(const UnlockRequest&) noexcept; + UnlockRequest& operator=(const UnlockRequest&) noexcept; + UnlockRequest() noexcept; + + virtual ~UnlockRequest() noexcept; + int64_t lockid; + + void __set_lockid(const int64_t val); + + bool operator == (const UnlockRequest & rhs) const; + bool operator != (const UnlockRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnlockRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(UnlockRequest &a, UnlockRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UnlockRequest& obj); + +typedef struct _ShowLocksRequest__isset { + _ShowLocksRequest__isset() : dbname(false), tablename(false), partname(false), isExtended(true), txnid(false) {} + bool dbname :1; + bool tablename :1; + bool partname :1; + bool isExtended :1; + bool txnid :1; +} _ShowLocksRequest__isset; + +class ShowLocksRequest : public virtual ::apache::thrift::TBase { + public: + + ShowLocksRequest(const ShowLocksRequest&); + ShowLocksRequest& operator=(const ShowLocksRequest&); + ShowLocksRequest() noexcept; + + virtual ~ShowLocksRequest() noexcept; + std::string dbname; + std::string tablename; + std::string partname; + bool isExtended; + int64_t txnid; + + _ShowLocksRequest__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partname(const std::string& val); + + void __set_isExtended(const bool val); + + void __set_txnid(const int64_t val); + + bool operator == (const ShowLocksRequest & rhs) const; + bool operator != (const ShowLocksRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowLocksRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowLocksRequest &a, ShowLocksRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowLocksRequest& obj); + +typedef struct _ShowLocksResponseElement__isset { + _ShowLocksResponseElement__isset() : tablename(false), partname(false), txnid(false), acquiredat(false), heartbeatCount(true), agentInfo(false), blockedByExtId(false), blockedByIntId(false), lockIdInternal(false) {} + bool tablename :1; + bool partname :1; + bool txnid :1; + bool acquiredat :1; + bool heartbeatCount :1; + bool agentInfo :1; + bool blockedByExtId :1; + bool blockedByIntId :1; + bool lockIdInternal :1; +} _ShowLocksResponseElement__isset; + +class ShowLocksResponseElement : public virtual ::apache::thrift::TBase { + public: + + ShowLocksResponseElement(const ShowLocksResponseElement&); + ShowLocksResponseElement& operator=(const ShowLocksResponseElement&); + ShowLocksResponseElement() noexcept; + + virtual ~ShowLocksResponseElement() noexcept; + int64_t lockid; + std::string dbname; + std::string tablename; + std::string partname; + /** + * + * @see LockState + */ + LockState::type state; + /** + * + * @see LockType + */ + LockType::type type; + int64_t txnid; + int64_t lastheartbeat; + int64_t acquiredat; + std::string user; + std::string hostname; + int32_t heartbeatCount; + std::string agentInfo; + int64_t blockedByExtId; + int64_t blockedByIntId; + int64_t lockIdInternal; + + _ShowLocksResponseElement__isset __isset; + + void __set_lockid(const int64_t val); + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partname(const std::string& val); + + void __set_state(const LockState::type val); + + void __set_type(const LockType::type val); + + void __set_txnid(const int64_t val); + + void __set_lastheartbeat(const int64_t val); + + void __set_acquiredat(const int64_t val); + + void __set_user(const std::string& val); + + void __set_hostname(const std::string& val); + + void __set_heartbeatCount(const int32_t val); + + void __set_agentInfo(const std::string& val); + + void __set_blockedByExtId(const int64_t val); + + void __set_blockedByIntId(const int64_t val); + + void __set_lockIdInternal(const int64_t val); + + bool operator == (const ShowLocksResponseElement & rhs) const; + bool operator != (const ShowLocksResponseElement &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowLocksResponseElement & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowLocksResponseElement &a, ShowLocksResponseElement &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowLocksResponseElement& obj); + +typedef struct _ShowLocksResponse__isset { + _ShowLocksResponse__isset() : locks(false) {} + bool locks :1; +} _ShowLocksResponse__isset; + +class ShowLocksResponse : public virtual ::apache::thrift::TBase { + public: + + ShowLocksResponse(const ShowLocksResponse&); + ShowLocksResponse& operator=(const ShowLocksResponse&); + ShowLocksResponse() noexcept; + + virtual ~ShowLocksResponse() noexcept; + std::vector locks; + + _ShowLocksResponse__isset __isset; + + void __set_locks(const std::vector & val); + + bool operator == (const ShowLocksResponse & rhs) const; + bool operator != (const ShowLocksResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowLocksResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowLocksResponse &a, ShowLocksResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowLocksResponse& obj); + +typedef struct _HeartbeatRequest__isset { + _HeartbeatRequest__isset() : lockid(false), txnid(false) {} + bool lockid :1; + bool txnid :1; +} _HeartbeatRequest__isset; + +class HeartbeatRequest : public virtual ::apache::thrift::TBase { + public: + + HeartbeatRequest(const HeartbeatRequest&) noexcept; + HeartbeatRequest& operator=(const HeartbeatRequest&) noexcept; + HeartbeatRequest() noexcept; + + virtual ~HeartbeatRequest() noexcept; + int64_t lockid; + int64_t txnid; + + _HeartbeatRequest__isset __isset; + + void __set_lockid(const int64_t val); + + void __set_txnid(const int64_t val); + + bool operator == (const HeartbeatRequest & rhs) const; + bool operator != (const HeartbeatRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HeartbeatRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HeartbeatRequest &a, HeartbeatRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const HeartbeatRequest& obj); + + +class HeartbeatTxnRangeRequest : public virtual ::apache::thrift::TBase { + public: + + HeartbeatTxnRangeRequest(const HeartbeatTxnRangeRequest&) noexcept; + HeartbeatTxnRangeRequest& operator=(const HeartbeatTxnRangeRequest&) noexcept; + HeartbeatTxnRangeRequest() noexcept; + + virtual ~HeartbeatTxnRangeRequest() noexcept; + int64_t min; + int64_t max; + + void __set_min(const int64_t val); + + void __set_max(const int64_t val); + + bool operator == (const HeartbeatTxnRangeRequest & rhs) const; + bool operator != (const HeartbeatTxnRangeRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HeartbeatTxnRangeRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HeartbeatTxnRangeRequest &a, HeartbeatTxnRangeRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const HeartbeatTxnRangeRequest& obj); + + +class HeartbeatTxnRangeResponse : public virtual ::apache::thrift::TBase { + public: + + HeartbeatTxnRangeResponse(const HeartbeatTxnRangeResponse&); + HeartbeatTxnRangeResponse& operator=(const HeartbeatTxnRangeResponse&); + HeartbeatTxnRangeResponse() noexcept; + + virtual ~HeartbeatTxnRangeResponse() noexcept; + std::set aborted; + std::set nosuch; + + void __set_aborted(const std::set & val); + + void __set_nosuch(const std::set & val); + + bool operator == (const HeartbeatTxnRangeResponse & rhs) const; + bool operator != (const HeartbeatTxnRangeResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HeartbeatTxnRangeResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HeartbeatTxnRangeResponse &a, HeartbeatTxnRangeResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const HeartbeatTxnRangeResponse& obj); + +typedef struct _CompactionRequest__isset { + _CompactionRequest__isset() : partitionname(false), runas(false), properties(false), initiatorId(false), initiatorVersion(false), poolName(false), numberOfBuckets(false), orderByClause(false) {} + bool partitionname :1; + bool runas :1; + bool properties :1; + bool initiatorId :1; + bool initiatorVersion :1; + bool poolName :1; + bool numberOfBuckets :1; + bool orderByClause :1; +} _CompactionRequest__isset; + +class CompactionRequest : public virtual ::apache::thrift::TBase { + public: + + CompactionRequest(const CompactionRequest&); + CompactionRequest& operator=(const CompactionRequest&); + CompactionRequest() noexcept; + + virtual ~CompactionRequest() noexcept; + std::string dbname; + std::string tablename; + std::string partitionname; + /** + * + * @see CompactionType + */ + CompactionType::type type; + std::string runas; + std::map properties; + std::string initiatorId; + std::string initiatorVersion; + std::string poolName; + int32_t numberOfBuckets; + std::string orderByClause; + + _CompactionRequest__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionname(const std::string& val); + + void __set_type(const CompactionType::type val); + + void __set_runas(const std::string& val); + + void __set_properties(const std::map & val); + + void __set_initiatorId(const std::string& val); + + void __set_initiatorVersion(const std::string& val); + + void __set_poolName(const std::string& val); + + void __set_numberOfBuckets(const int32_t val); + + void __set_orderByClause(const std::string& val); + + bool operator == (const CompactionRequest & rhs) const; + bool operator != (const CompactionRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionRequest &a, CompactionRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionRequest& obj); + +typedef struct _CompactionInfoStruct__isset { + _CompactionInfoStruct__isset() : partitionname(false), runas(false), properties(false), toomanyaborts(false), state(false), workerId(false), start(false), highestWriteId(false), errorMessage(false), hasoldabort(false), enqueueTime(false), retryRetention(false), poolname(false), numberOfBuckets(false), orderByClause(false) {} + bool partitionname :1; + bool runas :1; + bool properties :1; + bool toomanyaborts :1; + bool state :1; + bool workerId :1; + bool start :1; + bool highestWriteId :1; + bool errorMessage :1; + bool hasoldabort :1; + bool enqueueTime :1; + bool retryRetention :1; + bool poolname :1; + bool numberOfBuckets :1; + bool orderByClause :1; +} _CompactionInfoStruct__isset; + +class CompactionInfoStruct : public virtual ::apache::thrift::TBase { + public: + + CompactionInfoStruct(const CompactionInfoStruct&); + CompactionInfoStruct& operator=(const CompactionInfoStruct&); + CompactionInfoStruct() noexcept; + + virtual ~CompactionInfoStruct() noexcept; + int64_t id; + std::string dbname; + std::string tablename; + std::string partitionname; + /** + * + * @see CompactionType + */ + CompactionType::type type; + std::string runas; + std::string properties; + bool toomanyaborts; + std::string state; + std::string workerId; + int64_t start; + int64_t highestWriteId; + std::string errorMessage; + bool hasoldabort; + int64_t enqueueTime; + int64_t retryRetention; + std::string poolname; + int32_t numberOfBuckets; + std::string orderByClause; + + _CompactionInfoStruct__isset __isset; + + void __set_id(const int64_t val); + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionname(const std::string& val); + + void __set_type(const CompactionType::type val); + + void __set_runas(const std::string& val); + + void __set_properties(const std::string& val); + + void __set_toomanyaborts(const bool val); + + void __set_state(const std::string& val); + + void __set_workerId(const std::string& val); + + void __set_start(const int64_t val); + + void __set_highestWriteId(const int64_t val); + + void __set_errorMessage(const std::string& val); + + void __set_hasoldabort(const bool val); + + void __set_enqueueTime(const int64_t val); + + void __set_retryRetention(const int64_t val); + + void __set_poolname(const std::string& val); + + void __set_numberOfBuckets(const int32_t val); + + void __set_orderByClause(const std::string& val); + + bool operator == (const CompactionInfoStruct & rhs) const; + bool operator != (const CompactionInfoStruct &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionInfoStruct & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionInfoStruct &a, CompactionInfoStruct &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionInfoStruct& obj); + +typedef struct _OptionalCompactionInfoStruct__isset { + _OptionalCompactionInfoStruct__isset() : ci(false) {} + bool ci :1; +} _OptionalCompactionInfoStruct__isset; + +class OptionalCompactionInfoStruct : public virtual ::apache::thrift::TBase { + public: + + OptionalCompactionInfoStruct(const OptionalCompactionInfoStruct&); + OptionalCompactionInfoStruct& operator=(const OptionalCompactionInfoStruct&); + OptionalCompactionInfoStruct() noexcept; + + virtual ~OptionalCompactionInfoStruct() noexcept; + CompactionInfoStruct ci; + + _OptionalCompactionInfoStruct__isset __isset; + + void __set_ci(const CompactionInfoStruct& val); + + bool operator == (const OptionalCompactionInfoStruct & rhs) const; + bool operator != (const OptionalCompactionInfoStruct &rhs) const { + return !(*this == rhs); + } + + bool operator < (const OptionalCompactionInfoStruct & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(OptionalCompactionInfoStruct &a, OptionalCompactionInfoStruct &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const OptionalCompactionInfoStruct& obj); + +typedef struct _CompactionMetricsDataStruct__isset { + _CompactionMetricsDataStruct__isset() : partitionname(false) {} + bool partitionname :1; +} _CompactionMetricsDataStruct__isset; + +class CompactionMetricsDataStruct : public virtual ::apache::thrift::TBase { + public: + + CompactionMetricsDataStruct(const CompactionMetricsDataStruct&); + CompactionMetricsDataStruct& operator=(const CompactionMetricsDataStruct&); + CompactionMetricsDataStruct() noexcept; + + virtual ~CompactionMetricsDataStruct() noexcept; + std::string dbname; + std::string tblname; + std::string partitionname; + /** + * + * @see CompactionMetricsMetricType + */ + CompactionMetricsMetricType::type type; + int32_t metricvalue; + int32_t version; + int32_t threshold; + + _CompactionMetricsDataStruct__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tblname(const std::string& val); + + void __set_partitionname(const std::string& val); + + void __set_type(const CompactionMetricsMetricType::type val); + + void __set_metricvalue(const int32_t val); + + void __set_version(const int32_t val); + + void __set_threshold(const int32_t val); + + bool operator == (const CompactionMetricsDataStruct & rhs) const; + bool operator != (const CompactionMetricsDataStruct &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionMetricsDataStruct & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionMetricsDataStruct &a, CompactionMetricsDataStruct &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataStruct& obj); + +typedef struct _CompactionMetricsDataResponse__isset { + _CompactionMetricsDataResponse__isset() : data(false) {} + bool data :1; +} _CompactionMetricsDataResponse__isset; + +class CompactionMetricsDataResponse : public virtual ::apache::thrift::TBase { + public: + + CompactionMetricsDataResponse(const CompactionMetricsDataResponse&); + CompactionMetricsDataResponse& operator=(const CompactionMetricsDataResponse&); + CompactionMetricsDataResponse() noexcept; + + virtual ~CompactionMetricsDataResponse() noexcept; + CompactionMetricsDataStruct data; + + _CompactionMetricsDataResponse__isset __isset; + + void __set_data(const CompactionMetricsDataStruct& val); + + bool operator == (const CompactionMetricsDataResponse & rhs) const; + bool operator != (const CompactionMetricsDataResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionMetricsDataResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionMetricsDataResponse &a, CompactionMetricsDataResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataResponse& obj); + +typedef struct _CompactionMetricsDataRequest__isset { + _CompactionMetricsDataRequest__isset() : partitionName(false) {} + bool partitionName :1; +} _CompactionMetricsDataRequest__isset; + +class CompactionMetricsDataRequest : public virtual ::apache::thrift::TBase { + public: + + CompactionMetricsDataRequest(const CompactionMetricsDataRequest&); + CompactionMetricsDataRequest& operator=(const CompactionMetricsDataRequest&); + CompactionMetricsDataRequest() noexcept; + + virtual ~CompactionMetricsDataRequest() noexcept; + std::string dbName; + std::string tblName; + std::string partitionName; + /** + * + * @see CompactionMetricsMetricType + */ + CompactionMetricsMetricType::type type; + + _CompactionMetricsDataRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partitionName(const std::string& val); + + void __set_type(const CompactionMetricsMetricType::type val); + + bool operator == (const CompactionMetricsDataRequest & rhs) const; + bool operator != (const CompactionMetricsDataRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionMetricsDataRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionMetricsDataRequest &a, CompactionMetricsDataRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionMetricsDataRequest& obj); + +typedef struct _CompactionResponse__isset { + _CompactionResponse__isset() : errormessage(false) {} + bool errormessage :1; +} _CompactionResponse__isset; + +class CompactionResponse : public virtual ::apache::thrift::TBase { + public: + + CompactionResponse(const CompactionResponse&); + CompactionResponse& operator=(const CompactionResponse&); + CompactionResponse() noexcept; + + virtual ~CompactionResponse() noexcept; + int64_t id; + std::string state; + bool accepted; + std::string errormessage; + + _CompactionResponse__isset __isset; + + void __set_id(const int64_t val); + + void __set_state(const std::string& val); + + void __set_accepted(const bool val); + + void __set_errormessage(const std::string& val); + + bool operator == (const CompactionResponse & rhs) const; + bool operator != (const CompactionResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CompactionResponse &a, CompactionResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionResponse& obj); + +typedef struct _ShowCompactRequest__isset { + _ShowCompactRequest__isset() : id(false), poolName(false), dbName(false), tbName(false), partName(false), type(false), state(false), limit(false), order(false) {} + bool id :1; + bool poolName :1; + bool dbName :1; + bool tbName :1; + bool partName :1; + bool type :1; + bool state :1; + bool limit :1; + bool order :1; +} _ShowCompactRequest__isset; + +class ShowCompactRequest : public virtual ::apache::thrift::TBase { + public: + + ShowCompactRequest(const ShowCompactRequest&); + ShowCompactRequest& operator=(const ShowCompactRequest&); + ShowCompactRequest() noexcept; + + virtual ~ShowCompactRequest() noexcept; + int64_t id; + std::string poolName; + std::string dbName; + std::string tbName; + std::string partName; + /** + * + * @see CompactionType + */ + CompactionType::type type; + std::string state; + int64_t limit; + std::string order; + + _ShowCompactRequest__isset __isset; + + void __set_id(const int64_t val); + + void __set_poolName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tbName(const std::string& val); + + void __set_partName(const std::string& val); + + void __set_type(const CompactionType::type val); + + void __set_state(const std::string& val); + + void __set_limit(const int64_t val); + + void __set_order(const std::string& val); + + bool operator == (const ShowCompactRequest & rhs) const; + bool operator != (const ShowCompactRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowCompactRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowCompactRequest &a, ShowCompactRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowCompactRequest& obj); + +typedef struct _ShowCompactResponseElement__isset { + _ShowCompactResponseElement__isset() : partitionname(false), workerid(false), start(false), runAs(false), hightestTxnId(false), metaInfo(false), endTime(false), hadoopJobId(true), id(false), errorMessage(false), enqueueTime(false), workerVersion(false), initiatorId(false), initiatorVersion(false), cleanerStart(false), poolName(false), nextTxnId(false), txnId(false), commitTime(false), hightestWriteId(false) {} + bool partitionname :1; + bool workerid :1; + bool start :1; + bool runAs :1; + bool hightestTxnId :1; + bool metaInfo :1; + bool endTime :1; + bool hadoopJobId :1; + bool id :1; + bool errorMessage :1; + bool enqueueTime :1; + bool workerVersion :1; + bool initiatorId :1; + bool initiatorVersion :1; + bool cleanerStart :1; + bool poolName :1; + bool nextTxnId :1; + bool txnId :1; + bool commitTime :1; + bool hightestWriteId :1; +} _ShowCompactResponseElement__isset; + +class ShowCompactResponseElement : public virtual ::apache::thrift::TBase { + public: + + ShowCompactResponseElement(const ShowCompactResponseElement&); + ShowCompactResponseElement& operator=(const ShowCompactResponseElement&); + ShowCompactResponseElement(); + + virtual ~ShowCompactResponseElement() noexcept; + std::string dbname; + std::string tablename; + std::string partitionname; + /** + * + * @see CompactionType + */ + CompactionType::type type; + std::string state; + std::string workerid; + int64_t start; + std::string runAs; + int64_t hightestTxnId; + std::string metaInfo; + int64_t endTime; + std::string hadoopJobId; + int64_t id; + std::string errorMessage; + int64_t enqueueTime; + std::string workerVersion; + std::string initiatorId; + std::string initiatorVersion; + int64_t cleanerStart; + std::string poolName; + int64_t nextTxnId; + int64_t txnId; + int64_t commitTime; + int64_t hightestWriteId; + + _ShowCompactResponseElement__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionname(const std::string& val); + + void __set_type(const CompactionType::type val); + + void __set_state(const std::string& val); + + void __set_workerid(const std::string& val); + + void __set_start(const int64_t val); + + void __set_runAs(const std::string& val); + + void __set_hightestTxnId(const int64_t val); + + void __set_metaInfo(const std::string& val); + + void __set_endTime(const int64_t val); + + void __set_hadoopJobId(const std::string& val); + + void __set_id(const int64_t val); + + void __set_errorMessage(const std::string& val); + + void __set_enqueueTime(const int64_t val); + + void __set_workerVersion(const std::string& val); + + void __set_initiatorId(const std::string& val); + + void __set_initiatorVersion(const std::string& val); + + void __set_cleanerStart(const int64_t val); + + void __set_poolName(const std::string& val); + + void __set_nextTxnId(const int64_t val); + + void __set_txnId(const int64_t val); + + void __set_commitTime(const int64_t val); + + void __set_hightestWriteId(const int64_t val); + + bool operator == (const ShowCompactResponseElement & rhs) const; + bool operator != (const ShowCompactResponseElement &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowCompactResponseElement & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowCompactResponseElement &a, ShowCompactResponseElement &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowCompactResponseElement& obj); + + +class ShowCompactResponse : public virtual ::apache::thrift::TBase { + public: + + ShowCompactResponse(const ShowCompactResponse&); + ShowCompactResponse& operator=(const ShowCompactResponse&); + ShowCompactResponse() noexcept; + + virtual ~ShowCompactResponse() noexcept; + std::vector compacts; + + void __set_compacts(const std::vector & val); + + bool operator == (const ShowCompactResponse & rhs) const; + bool operator != (const ShowCompactResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ShowCompactResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ShowCompactResponse &a, ShowCompactResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ShowCompactResponse& obj); + +typedef struct _AbortCompactionRequest__isset { + _AbortCompactionRequest__isset() : type(false), poolName(false) {} + bool type :1; + bool poolName :1; +} _AbortCompactionRequest__isset; + +class AbortCompactionRequest : public virtual ::apache::thrift::TBase { + public: + + AbortCompactionRequest(const AbortCompactionRequest&); + AbortCompactionRequest& operator=(const AbortCompactionRequest&); + AbortCompactionRequest() noexcept; + + virtual ~AbortCompactionRequest() noexcept; + std::vector compactionIds; + std::string type; + std::string poolName; + + _AbortCompactionRequest__isset __isset; + + void __set_compactionIds(const std::vector & val); + + void __set_type(const std::string& val); + + void __set_poolName(const std::string& val); + + bool operator == (const AbortCompactionRequest & rhs) const; + bool operator != (const AbortCompactionRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AbortCompactionRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AbortCompactionRequest &a, AbortCompactionRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AbortCompactionRequest& obj); + +typedef struct _AbortCompactionResponseElement__isset { + _AbortCompactionResponseElement__isset() : status(false), message(false) {} + bool status :1; + bool message :1; +} _AbortCompactionResponseElement__isset; + +class AbortCompactionResponseElement : public virtual ::apache::thrift::TBase { + public: + + AbortCompactionResponseElement(const AbortCompactionResponseElement&); + AbortCompactionResponseElement& operator=(const AbortCompactionResponseElement&); + AbortCompactionResponseElement() noexcept; + + virtual ~AbortCompactionResponseElement() noexcept; + int64_t compactionId; + std::string status; + std::string message; + + _AbortCompactionResponseElement__isset __isset; + + void __set_compactionId(const int64_t val); + + void __set_status(const std::string& val); + + void __set_message(const std::string& val); + + bool operator == (const AbortCompactionResponseElement & rhs) const; + bool operator != (const AbortCompactionResponseElement &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AbortCompactionResponseElement & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AbortCompactionResponseElement &a, AbortCompactionResponseElement &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AbortCompactionResponseElement& obj); + + +class AbortCompactResponse : public virtual ::apache::thrift::TBase { + public: + + AbortCompactResponse(const AbortCompactResponse&); + AbortCompactResponse& operator=(const AbortCompactResponse&); + AbortCompactResponse() noexcept; + + virtual ~AbortCompactResponse() noexcept; + std::map abortedcompacts; + + void __set_abortedcompacts(const std::map & val); + + bool operator == (const AbortCompactResponse & rhs) const; + bool operator != (const AbortCompactResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AbortCompactResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AbortCompactResponse &a, AbortCompactResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AbortCompactResponse& obj); + +typedef struct _GetLatestCommittedCompactionInfoRequest__isset { + _GetLatestCommittedCompactionInfoRequest__isset() : partitionnames(false), lastCompactionId(false) {} + bool partitionnames :1; + bool lastCompactionId :1; +} _GetLatestCommittedCompactionInfoRequest__isset; + +class GetLatestCommittedCompactionInfoRequest : public virtual ::apache::thrift::TBase { + public: + + GetLatestCommittedCompactionInfoRequest(const GetLatestCommittedCompactionInfoRequest&); + GetLatestCommittedCompactionInfoRequest& operator=(const GetLatestCommittedCompactionInfoRequest&); + GetLatestCommittedCompactionInfoRequest() noexcept; + + virtual ~GetLatestCommittedCompactionInfoRequest() noexcept; + std::string dbname; + std::string tablename; + std::vector partitionnames; + int64_t lastCompactionId; + + _GetLatestCommittedCompactionInfoRequest__isset __isset; + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionnames(const std::vector & val); + + void __set_lastCompactionId(const int64_t val); + + bool operator == (const GetLatestCommittedCompactionInfoRequest & rhs) const; + bool operator != (const GetLatestCommittedCompactionInfoRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetLatestCommittedCompactionInfoRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetLatestCommittedCompactionInfoRequest &a, GetLatestCommittedCompactionInfoRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetLatestCommittedCompactionInfoRequest& obj); + + +class GetLatestCommittedCompactionInfoResponse : public virtual ::apache::thrift::TBase { + public: + + GetLatestCommittedCompactionInfoResponse(const GetLatestCommittedCompactionInfoResponse&); + GetLatestCommittedCompactionInfoResponse& operator=(const GetLatestCommittedCompactionInfoResponse&); + GetLatestCommittedCompactionInfoResponse() noexcept; + + virtual ~GetLatestCommittedCompactionInfoResponse() noexcept; + std::vector compactions; + + void __set_compactions(const std::vector & val); + + bool operator == (const GetLatestCommittedCompactionInfoResponse & rhs) const; + bool operator != (const GetLatestCommittedCompactionInfoResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetLatestCommittedCompactionInfoResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetLatestCommittedCompactionInfoResponse &a, GetLatestCommittedCompactionInfoResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetLatestCommittedCompactionInfoResponse& obj); + +typedef struct _FindNextCompactRequest__isset { + _FindNextCompactRequest__isset() : workerId(false), workerVersion(false), poolName(false) {} + bool workerId :1; + bool workerVersion :1; + bool poolName :1; +} _FindNextCompactRequest__isset; + +class FindNextCompactRequest : public virtual ::apache::thrift::TBase { + public: + + FindNextCompactRequest(const FindNextCompactRequest&); + FindNextCompactRequest& operator=(const FindNextCompactRequest&); + FindNextCompactRequest() noexcept; + + virtual ~FindNextCompactRequest() noexcept; + std::string workerId; + std::string workerVersion; + std::string poolName; + + _FindNextCompactRequest__isset __isset; + + void __set_workerId(const std::string& val); + + void __set_workerVersion(const std::string& val); + + void __set_poolName(const std::string& val); + + bool operator == (const FindNextCompactRequest & rhs) const; + bool operator != (const FindNextCompactRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FindNextCompactRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FindNextCompactRequest &a, FindNextCompactRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FindNextCompactRequest& obj); + +typedef struct _AddDynamicPartitions__isset { + _AddDynamicPartitions__isset() : operationType(true) {} + bool operationType :1; +} _AddDynamicPartitions__isset; + +class AddDynamicPartitions : public virtual ::apache::thrift::TBase { + public: + + AddDynamicPartitions(const AddDynamicPartitions&); + AddDynamicPartitions& operator=(const AddDynamicPartitions&); + AddDynamicPartitions() noexcept; + + virtual ~AddDynamicPartitions() noexcept; + int64_t txnid; + int64_t writeid; + std::string dbname; + std::string tablename; + std::vector partitionnames; + /** + * + * @see DataOperationType + */ + DataOperationType::type operationType; + + _AddDynamicPartitions__isset __isset; + + void __set_txnid(const int64_t val); + + void __set_writeid(const int64_t val); + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionnames(const std::vector & val); + + void __set_operationType(const DataOperationType::type val); + + bool operator == (const AddDynamicPartitions & rhs) const; + bool operator != (const AddDynamicPartitions &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddDynamicPartitions & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddDynamicPartitions &a, AddDynamicPartitions &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddDynamicPartitions& obj); + +typedef struct _BasicTxnInfo__isset { + _BasicTxnInfo__isset() : time(false), txnid(false), dbname(false), tablename(false), partitionname(false) {} + bool time :1; + bool txnid :1; + bool dbname :1; + bool tablename :1; + bool partitionname :1; +} _BasicTxnInfo__isset; + +class BasicTxnInfo : public virtual ::apache::thrift::TBase { + public: + + BasicTxnInfo(const BasicTxnInfo&); + BasicTxnInfo& operator=(const BasicTxnInfo&); + BasicTxnInfo() noexcept; + + virtual ~BasicTxnInfo() noexcept; + bool isnull; + int64_t time; + int64_t txnid; + std::string dbname; + std::string tablename; + std::string partitionname; + + _BasicTxnInfo__isset __isset; + + void __set_isnull(const bool val); + + void __set_time(const int64_t val); + + void __set_txnid(const int64_t val); + + void __set_dbname(const std::string& val); + + void __set_tablename(const std::string& val); + + void __set_partitionname(const std::string& val); + + bool operator == (const BasicTxnInfo & rhs) const; + bool operator != (const BasicTxnInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const BasicTxnInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(BasicTxnInfo &a, BasicTxnInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const BasicTxnInfo& obj); + +typedef struct _NotificationEventRequest__isset { + _NotificationEventRequest__isset() : maxEvents(false), eventTypeSkipList(false), catName(false), dbName(false), tableNames(false) {} + bool maxEvents :1; + bool eventTypeSkipList :1; + bool catName :1; + bool dbName :1; + bool tableNames :1; +} _NotificationEventRequest__isset; + +class NotificationEventRequest : public virtual ::apache::thrift::TBase { + public: + + NotificationEventRequest(const NotificationEventRequest&); + NotificationEventRequest& operator=(const NotificationEventRequest&); + NotificationEventRequest() noexcept; + + virtual ~NotificationEventRequest() noexcept; + int64_t lastEvent; + int32_t maxEvents; + std::vector eventTypeSkipList; + std::string catName; + std::string dbName; + std::vector tableNames; + + _NotificationEventRequest__isset __isset; + + void __set_lastEvent(const int64_t val); + + void __set_maxEvents(const int32_t val); + + void __set_eventTypeSkipList(const std::vector & val); + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableNames(const std::vector & val); + + bool operator == (const NotificationEventRequest & rhs) const; + bool operator != (const NotificationEventRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotificationEventRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotificationEventRequest &a, NotificationEventRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotificationEventRequest& obj); + +typedef struct _NotificationEvent__isset { + _NotificationEvent__isset() : dbName(false), tableName(false), messageFormat(false), catName(false) {} + bool dbName :1; + bool tableName :1; + bool messageFormat :1; + bool catName :1; +} _NotificationEvent__isset; + +class NotificationEvent : public virtual ::apache::thrift::TBase { + public: + + NotificationEvent(const NotificationEvent&); + NotificationEvent& operator=(const NotificationEvent&); + NotificationEvent() noexcept; + + virtual ~NotificationEvent() noexcept; + int64_t eventId; + int32_t eventTime; + std::string eventType; + std::string dbName; + std::string tableName; + std::string message; + std::string messageFormat; + std::string catName; + + _NotificationEvent__isset __isset; + + void __set_eventId(const int64_t val); + + void __set_eventTime(const int32_t val); + + void __set_eventType(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_message(const std::string& val); + + void __set_messageFormat(const std::string& val); + + void __set_catName(const std::string& val); + + bool operator == (const NotificationEvent & rhs) const; + bool operator != (const NotificationEvent &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotificationEvent & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotificationEvent &a, NotificationEvent &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotificationEvent& obj); + + +class NotificationEventResponse : public virtual ::apache::thrift::TBase { + public: + + NotificationEventResponse(const NotificationEventResponse&); + NotificationEventResponse& operator=(const NotificationEventResponse&); + NotificationEventResponse() noexcept; + + virtual ~NotificationEventResponse() noexcept; + std::vector events; + + void __set_events(const std::vector & val); + + bool operator == (const NotificationEventResponse & rhs) const; + bool operator != (const NotificationEventResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotificationEventResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotificationEventResponse &a, NotificationEventResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotificationEventResponse& obj); + + +class CurrentNotificationEventId : public virtual ::apache::thrift::TBase { + public: + + CurrentNotificationEventId(const CurrentNotificationEventId&) noexcept; + CurrentNotificationEventId& operator=(const CurrentNotificationEventId&) noexcept; + CurrentNotificationEventId() noexcept; + + virtual ~CurrentNotificationEventId() noexcept; + int64_t eventId; + + void __set_eventId(const int64_t val); + + bool operator == (const CurrentNotificationEventId & rhs) const; + bool operator != (const CurrentNotificationEventId &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CurrentNotificationEventId & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CurrentNotificationEventId &a, CurrentNotificationEventId &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CurrentNotificationEventId& obj); + +typedef struct _NotificationEventsCountRequest__isset { + _NotificationEventsCountRequest__isset() : catName(false), toEventId(false), limit(false), tableNames(false) {} + bool catName :1; + bool toEventId :1; + bool limit :1; + bool tableNames :1; +} _NotificationEventsCountRequest__isset; + +class NotificationEventsCountRequest : public virtual ::apache::thrift::TBase { + public: + + NotificationEventsCountRequest(const NotificationEventsCountRequest&); + NotificationEventsCountRequest& operator=(const NotificationEventsCountRequest&); + NotificationEventsCountRequest() noexcept; + + virtual ~NotificationEventsCountRequest() noexcept; + int64_t fromEventId; + std::string dbName; + std::string catName; + int64_t toEventId; + int64_t limit; + std::vector tableNames; + + _NotificationEventsCountRequest__isset __isset; + + void __set_fromEventId(const int64_t val); + + void __set_dbName(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_toEventId(const int64_t val); + + void __set_limit(const int64_t val); + + void __set_tableNames(const std::vector & val); + + bool operator == (const NotificationEventsCountRequest & rhs) const; + bool operator != (const NotificationEventsCountRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotificationEventsCountRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotificationEventsCountRequest &a, NotificationEventsCountRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotificationEventsCountRequest& obj); + + +class NotificationEventsCountResponse : public virtual ::apache::thrift::TBase { + public: + + NotificationEventsCountResponse(const NotificationEventsCountResponse&) noexcept; + NotificationEventsCountResponse& operator=(const NotificationEventsCountResponse&) noexcept; + NotificationEventsCountResponse() noexcept; + + virtual ~NotificationEventsCountResponse() noexcept; + int64_t eventsCount; + + void __set_eventsCount(const int64_t val); + + bool operator == (const NotificationEventsCountResponse & rhs) const; + bool operator != (const NotificationEventsCountResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotificationEventsCountResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(NotificationEventsCountResponse &a, NotificationEventsCountResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NotificationEventsCountResponse& obj); + +typedef struct _InsertEventRequestData__isset { + _InsertEventRequestData__isset() : replace(false), filesAddedChecksum(false), subDirectoryList(false), partitionVal(false) {} + bool replace :1; + bool filesAddedChecksum :1; + bool subDirectoryList :1; + bool partitionVal :1; +} _InsertEventRequestData__isset; + +class InsertEventRequestData : public virtual ::apache::thrift::TBase { + public: + + InsertEventRequestData(const InsertEventRequestData&); + InsertEventRequestData& operator=(const InsertEventRequestData&); + InsertEventRequestData() noexcept; + + virtual ~InsertEventRequestData() noexcept; + bool replace; + std::vector filesAdded; + std::vector filesAddedChecksum; + std::vector subDirectoryList; + std::vector partitionVal; + + _InsertEventRequestData__isset __isset; + + void __set_replace(const bool val); + + void __set_filesAdded(const std::vector & val); + + void __set_filesAddedChecksum(const std::vector & val); + + void __set_subDirectoryList(const std::vector & val); + + void __set_partitionVal(const std::vector & val); + + bool operator == (const InsertEventRequestData & rhs) const; + bool operator != (const InsertEventRequestData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InsertEventRequestData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(InsertEventRequestData &a, InsertEventRequestData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const InsertEventRequestData& obj); + +typedef struct _FireEventRequestData__isset { + _FireEventRequestData__isset() : insertData(false), insertDatas(false), refreshEvent(false) {} + bool insertData :1; + bool insertDatas :1; + bool refreshEvent :1; +} _FireEventRequestData__isset; + +class FireEventRequestData : public virtual ::apache::thrift::TBase { + public: + + FireEventRequestData(const FireEventRequestData&); + FireEventRequestData& operator=(const FireEventRequestData&); + FireEventRequestData() noexcept; + + virtual ~FireEventRequestData() noexcept; + InsertEventRequestData insertData; + std::vector insertDatas; + bool refreshEvent; + + _FireEventRequestData__isset __isset; + + void __set_insertData(const InsertEventRequestData& val); + + void __set_insertDatas(const std::vector & val); + + void __set_refreshEvent(const bool val); + + bool operator == (const FireEventRequestData & rhs) const; + bool operator != (const FireEventRequestData &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FireEventRequestData & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FireEventRequestData &a, FireEventRequestData &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FireEventRequestData& obj); + +typedef struct _FireEventRequest__isset { + _FireEventRequest__isset() : dbName(false), tableName(false), partitionVals(false), catName(false), tblParams(false) {} + bool dbName :1; + bool tableName :1; + bool partitionVals :1; + bool catName :1; + bool tblParams :1; +} _FireEventRequest__isset; + +class FireEventRequest : public virtual ::apache::thrift::TBase { + public: + + FireEventRequest(const FireEventRequest&); + FireEventRequest& operator=(const FireEventRequest&); + FireEventRequest() noexcept; + + virtual ~FireEventRequest() noexcept; + bool successful; + FireEventRequestData data; + std::string dbName; + std::string tableName; + std::vector partitionVals; + std::string catName; + std::map tblParams; + + _FireEventRequest__isset __isset; + + void __set_successful(const bool val); + + void __set_data(const FireEventRequestData& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partitionVals(const std::vector & val); + + void __set_catName(const std::string& val); + + void __set_tblParams(const std::map & val); + + bool operator == (const FireEventRequest & rhs) const; + bool operator != (const FireEventRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FireEventRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FireEventRequest &a, FireEventRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FireEventRequest& obj); + +typedef struct _FireEventResponse__isset { + _FireEventResponse__isset() : eventIds(false) {} + bool eventIds :1; +} _FireEventResponse__isset; + +class FireEventResponse : public virtual ::apache::thrift::TBase { + public: + + FireEventResponse(const FireEventResponse&); + FireEventResponse& operator=(const FireEventResponse&); + FireEventResponse() noexcept; + + virtual ~FireEventResponse() noexcept; + std::vector eventIds; + + _FireEventResponse__isset __isset; + + void __set_eventIds(const std::vector & val); + + bool operator == (const FireEventResponse & rhs) const; + bool operator != (const FireEventResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FireEventResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FireEventResponse &a, FireEventResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FireEventResponse& obj); + +typedef struct _WriteNotificationLogRequest__isset { + _WriteNotificationLogRequest__isset() : partitionVals(false) {} + bool partitionVals :1; +} _WriteNotificationLogRequest__isset; + +class WriteNotificationLogRequest : public virtual ::apache::thrift::TBase { + public: + + WriteNotificationLogRequest(const WriteNotificationLogRequest&); + WriteNotificationLogRequest& operator=(const WriteNotificationLogRequest&); + WriteNotificationLogRequest() noexcept; + + virtual ~WriteNotificationLogRequest() noexcept; + int64_t txnId; + int64_t writeId; + std::string db; + std::string table; + InsertEventRequestData fileInfo; + std::vector partitionVals; + + _WriteNotificationLogRequest__isset __isset; + + void __set_txnId(const int64_t val); + + void __set_writeId(const int64_t val); + + void __set_db(const std::string& val); + + void __set_table(const std::string& val); + + void __set_fileInfo(const InsertEventRequestData& val); + + void __set_partitionVals(const std::vector & val); + + bool operator == (const WriteNotificationLogRequest & rhs) const; + bool operator != (const WriteNotificationLogRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WriteNotificationLogRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WriteNotificationLogRequest &a, WriteNotificationLogRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogRequest& obj); + + +class WriteNotificationLogResponse : public virtual ::apache::thrift::TBase { + public: + + WriteNotificationLogResponse(const WriteNotificationLogResponse&) noexcept; + WriteNotificationLogResponse& operator=(const WriteNotificationLogResponse&) noexcept; + WriteNotificationLogResponse() noexcept; + + virtual ~WriteNotificationLogResponse() noexcept; + + bool operator == (const WriteNotificationLogResponse & /* rhs */) const; + bool operator != (const WriteNotificationLogResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WriteNotificationLogResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WriteNotificationLogResponse &a, WriteNotificationLogResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogResponse& obj); + + +class WriteNotificationLogBatchRequest : public virtual ::apache::thrift::TBase { + public: + + WriteNotificationLogBatchRequest(const WriteNotificationLogBatchRequest&); + WriteNotificationLogBatchRequest& operator=(const WriteNotificationLogBatchRequest&); + WriteNotificationLogBatchRequest() noexcept; + + virtual ~WriteNotificationLogBatchRequest() noexcept; + std::string catalog; + std::string db; + std::string table; + std::vector requestList; + + void __set_catalog(const std::string& val); + + void __set_db(const std::string& val); + + void __set_table(const std::string& val); + + void __set_requestList(const std::vector & val); + + bool operator == (const WriteNotificationLogBatchRequest & rhs) const; + bool operator != (const WriteNotificationLogBatchRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WriteNotificationLogBatchRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WriteNotificationLogBatchRequest &a, WriteNotificationLogBatchRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogBatchRequest& obj); + + +class WriteNotificationLogBatchResponse : public virtual ::apache::thrift::TBase { + public: + + WriteNotificationLogBatchResponse(const WriteNotificationLogBatchResponse&) noexcept; + WriteNotificationLogBatchResponse& operator=(const WriteNotificationLogBatchResponse&) noexcept; + WriteNotificationLogBatchResponse() noexcept; + + virtual ~WriteNotificationLogBatchResponse() noexcept; + + bool operator == (const WriteNotificationLogBatchResponse & /* rhs */) const; + bool operator != (const WriteNotificationLogBatchResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WriteNotificationLogBatchResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WriteNotificationLogBatchResponse &a, WriteNotificationLogBatchResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WriteNotificationLogBatchResponse& obj); + +typedef struct _MetadataPpdResult__isset { + _MetadataPpdResult__isset() : metadata(false), includeBitset(false) {} + bool metadata :1; + bool includeBitset :1; +} _MetadataPpdResult__isset; + +class MetadataPpdResult : public virtual ::apache::thrift::TBase { + public: + + MetadataPpdResult(const MetadataPpdResult&); + MetadataPpdResult& operator=(const MetadataPpdResult&); + MetadataPpdResult() noexcept; + + virtual ~MetadataPpdResult() noexcept; + std::string metadata; + std::string includeBitset; + + _MetadataPpdResult__isset __isset; + + void __set_metadata(const std::string& val); + + void __set_includeBitset(const std::string& val); + + bool operator == (const MetadataPpdResult & rhs) const; + bool operator != (const MetadataPpdResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const MetadataPpdResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(MetadataPpdResult &a, MetadataPpdResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const MetadataPpdResult& obj); + + +class GetFileMetadataByExprResult : public virtual ::apache::thrift::TBase { + public: + + GetFileMetadataByExprResult(const GetFileMetadataByExprResult&); + GetFileMetadataByExprResult& operator=(const GetFileMetadataByExprResult&); + GetFileMetadataByExprResult() noexcept; + + virtual ~GetFileMetadataByExprResult() noexcept; + std::map metadata; + bool isSupported; + + void __set_metadata(const std::map & val); + + void __set_isSupported(const bool val); + + bool operator == (const GetFileMetadataByExprResult & rhs) const; + bool operator != (const GetFileMetadataByExprResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFileMetadataByExprResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFileMetadataByExprResult &a, GetFileMetadataByExprResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFileMetadataByExprResult& obj); + +typedef struct _GetFileMetadataByExprRequest__isset { + _GetFileMetadataByExprRequest__isset() : doGetFooters(false), type(false) {} + bool doGetFooters :1; + bool type :1; +} _GetFileMetadataByExprRequest__isset; + +class GetFileMetadataByExprRequest : public virtual ::apache::thrift::TBase { + public: + + GetFileMetadataByExprRequest(const GetFileMetadataByExprRequest&); + GetFileMetadataByExprRequest& operator=(const GetFileMetadataByExprRequest&); + GetFileMetadataByExprRequest() noexcept; + + virtual ~GetFileMetadataByExprRequest() noexcept; + std::vector fileIds; + std::string expr; + bool doGetFooters; + /** + * + * @see FileMetadataExprType + */ + FileMetadataExprType::type type; + + _GetFileMetadataByExprRequest__isset __isset; + + void __set_fileIds(const std::vector & val); + + void __set_expr(const std::string& val); + + void __set_doGetFooters(const bool val); + + void __set_type(const FileMetadataExprType::type val); + + bool operator == (const GetFileMetadataByExprRequest & rhs) const; + bool operator != (const GetFileMetadataByExprRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFileMetadataByExprRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFileMetadataByExprRequest &a, GetFileMetadataByExprRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFileMetadataByExprRequest& obj); + + +class GetFileMetadataResult : public virtual ::apache::thrift::TBase { + public: + + GetFileMetadataResult(const GetFileMetadataResult&); + GetFileMetadataResult& operator=(const GetFileMetadataResult&); + GetFileMetadataResult() noexcept; + + virtual ~GetFileMetadataResult() noexcept; + std::map metadata; + bool isSupported; + + void __set_metadata(const std::map & val); + + void __set_isSupported(const bool val); + + bool operator == (const GetFileMetadataResult & rhs) const; + bool operator != (const GetFileMetadataResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFileMetadataResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFileMetadataResult &a, GetFileMetadataResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFileMetadataResult& obj); + + +class GetFileMetadataRequest : public virtual ::apache::thrift::TBase { + public: + + GetFileMetadataRequest(const GetFileMetadataRequest&); + GetFileMetadataRequest& operator=(const GetFileMetadataRequest&); + GetFileMetadataRequest() noexcept; + + virtual ~GetFileMetadataRequest() noexcept; + std::vector fileIds; + + void __set_fileIds(const std::vector & val); + + bool operator == (const GetFileMetadataRequest & rhs) const; + bool operator != (const GetFileMetadataRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFileMetadataRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFileMetadataRequest &a, GetFileMetadataRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFileMetadataRequest& obj); + + +class PutFileMetadataResult : public virtual ::apache::thrift::TBase { + public: + + PutFileMetadataResult(const PutFileMetadataResult&) noexcept; + PutFileMetadataResult& operator=(const PutFileMetadataResult&) noexcept; + PutFileMetadataResult() noexcept; + + virtual ~PutFileMetadataResult() noexcept; + + bool operator == (const PutFileMetadataResult & /* rhs */) const; + bool operator != (const PutFileMetadataResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PutFileMetadataResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PutFileMetadataResult &a, PutFileMetadataResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PutFileMetadataResult& obj); + +typedef struct _PutFileMetadataRequest__isset { + _PutFileMetadataRequest__isset() : type(false) {} + bool type :1; +} _PutFileMetadataRequest__isset; + +class PutFileMetadataRequest : public virtual ::apache::thrift::TBase { + public: + + PutFileMetadataRequest(const PutFileMetadataRequest&); + PutFileMetadataRequest& operator=(const PutFileMetadataRequest&); + PutFileMetadataRequest() noexcept; + + virtual ~PutFileMetadataRequest() noexcept; + std::vector fileIds; + std::vector metadata; + /** + * + * @see FileMetadataExprType + */ + FileMetadataExprType::type type; + + _PutFileMetadataRequest__isset __isset; + + void __set_fileIds(const std::vector & val); + + void __set_metadata(const std::vector & val); + + void __set_type(const FileMetadataExprType::type val); + + bool operator == (const PutFileMetadataRequest & rhs) const; + bool operator != (const PutFileMetadataRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PutFileMetadataRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PutFileMetadataRequest &a, PutFileMetadataRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PutFileMetadataRequest& obj); + + +class ClearFileMetadataResult : public virtual ::apache::thrift::TBase { + public: + + ClearFileMetadataResult(const ClearFileMetadataResult&) noexcept; + ClearFileMetadataResult& operator=(const ClearFileMetadataResult&) noexcept; + ClearFileMetadataResult() noexcept; + + virtual ~ClearFileMetadataResult() noexcept; + + bool operator == (const ClearFileMetadataResult & /* rhs */) const; + bool operator != (const ClearFileMetadataResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ClearFileMetadataResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ClearFileMetadataResult &a, ClearFileMetadataResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ClearFileMetadataResult& obj); + + +class ClearFileMetadataRequest : public virtual ::apache::thrift::TBase { + public: + + ClearFileMetadataRequest(const ClearFileMetadataRequest&); + ClearFileMetadataRequest& operator=(const ClearFileMetadataRequest&); + ClearFileMetadataRequest() noexcept; + + virtual ~ClearFileMetadataRequest() noexcept; + std::vector fileIds; + + void __set_fileIds(const std::vector & val); + + bool operator == (const ClearFileMetadataRequest & rhs) const; + bool operator != (const ClearFileMetadataRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ClearFileMetadataRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ClearFileMetadataRequest &a, ClearFileMetadataRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ClearFileMetadataRequest& obj); + + +class CacheFileMetadataResult : public virtual ::apache::thrift::TBase { + public: + + CacheFileMetadataResult(const CacheFileMetadataResult&) noexcept; + CacheFileMetadataResult& operator=(const CacheFileMetadataResult&) noexcept; + CacheFileMetadataResult() noexcept; + + virtual ~CacheFileMetadataResult() noexcept; + bool isSupported; + + void __set_isSupported(const bool val); + + bool operator == (const CacheFileMetadataResult & rhs) const; + bool operator != (const CacheFileMetadataResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CacheFileMetadataResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CacheFileMetadataResult &a, CacheFileMetadataResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CacheFileMetadataResult& obj); + +typedef struct _CacheFileMetadataRequest__isset { + _CacheFileMetadataRequest__isset() : partName(false), isAllParts(false) {} + bool partName :1; + bool isAllParts :1; +} _CacheFileMetadataRequest__isset; + +class CacheFileMetadataRequest : public virtual ::apache::thrift::TBase { + public: + + CacheFileMetadataRequest(const CacheFileMetadataRequest&); + CacheFileMetadataRequest& operator=(const CacheFileMetadataRequest&); + CacheFileMetadataRequest() noexcept; + + virtual ~CacheFileMetadataRequest() noexcept; + std::string dbName; + std::string tblName; + std::string partName; + bool isAllParts; + + _CacheFileMetadataRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partName(const std::string& val); + + void __set_isAllParts(const bool val); + + bool operator == (const CacheFileMetadataRequest & rhs) const; + bool operator != (const CacheFileMetadataRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CacheFileMetadataRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CacheFileMetadataRequest &a, CacheFileMetadataRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CacheFileMetadataRequest& obj); + +typedef struct _GetAllFunctionsResponse__isset { + _GetAllFunctionsResponse__isset() : functions(false) {} + bool functions :1; +} _GetAllFunctionsResponse__isset; + +class GetAllFunctionsResponse : public virtual ::apache::thrift::TBase { + public: + + GetAllFunctionsResponse(const GetAllFunctionsResponse&); + GetAllFunctionsResponse& operator=(const GetAllFunctionsResponse&); + GetAllFunctionsResponse() noexcept; + + virtual ~GetAllFunctionsResponse() noexcept; + std::vector functions; + + _GetAllFunctionsResponse__isset __isset; + + void __set_functions(const std::vector & val); + + bool operator == (const GetAllFunctionsResponse & rhs) const; + bool operator != (const GetAllFunctionsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetAllFunctionsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetAllFunctionsResponse &a, GetAllFunctionsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetAllFunctionsResponse& obj); + + +class ClientCapabilities : public virtual ::apache::thrift::TBase { + public: + + ClientCapabilities(const ClientCapabilities&); + ClientCapabilities& operator=(const ClientCapabilities&); + ClientCapabilities() noexcept; + + virtual ~ClientCapabilities() noexcept; + std::vector values; + + void __set_values(const std::vector & val); + + bool operator == (const ClientCapabilities & rhs) const; + bool operator != (const ClientCapabilities &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ClientCapabilities & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ClientCapabilities &a, ClientCapabilities &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ClientCapabilities& obj); + +typedef struct _GetProjectionsSpec__isset { + _GetProjectionsSpec__isset() : fieldList(false), includeParamKeyPattern(false), excludeParamKeyPattern(false) {} + bool fieldList :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; +} _GetProjectionsSpec__isset; + +class GetProjectionsSpec : public virtual ::apache::thrift::TBase { + public: + + GetProjectionsSpec(const GetProjectionsSpec&); + GetProjectionsSpec& operator=(const GetProjectionsSpec&); + GetProjectionsSpec() noexcept; + + virtual ~GetProjectionsSpec() noexcept; + std::vector fieldList; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + + _GetProjectionsSpec__isset __isset; + + void __set_fieldList(const std::vector & val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + bool operator == (const GetProjectionsSpec & rhs) const; + bool operator != (const GetProjectionsSpec &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetProjectionsSpec & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetProjectionsSpec &a, GetProjectionsSpec &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetProjectionsSpec& obj); + +typedef struct _GetTableRequest__isset { + _GetTableRequest__isset() : capabilities(false), catName(false), validWriteIdList(false), getColumnStats(false), processorCapabilities(false), processorIdentifier(false), engine(true), id(true) {} + bool capabilities :1; + bool catName :1; + bool validWriteIdList :1; + bool getColumnStats :1; + bool processorCapabilities :1; + bool processorIdentifier :1; + bool engine :1; + bool id :1; +} _GetTableRequest__isset; + +class GetTableRequest : public virtual ::apache::thrift::TBase { + public: + + GetTableRequest(const GetTableRequest&); + GetTableRequest& operator=(const GetTableRequest&); + GetTableRequest(); + + virtual ~GetTableRequest() noexcept; + std::string dbName; + std::string tblName; + ClientCapabilities capabilities; + std::string catName; + std::string validWriteIdList; + bool getColumnStats; + std::vector processorCapabilities; + std::string processorIdentifier; + std::string engine; + int64_t id; + + _GetTableRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_capabilities(const ClientCapabilities& val); + + void __set_catName(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_getColumnStats(const bool val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + void __set_engine(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const GetTableRequest & rhs) const; + bool operator != (const GetTableRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetTableRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetTableRequest &a, GetTableRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetTableRequest& obj); + +typedef struct _GetTableResult__isset { + _GetTableResult__isset() : isStatsCompliant(false) {} + bool isStatsCompliant :1; +} _GetTableResult__isset; + +class GetTableResult : public virtual ::apache::thrift::TBase { + public: + + GetTableResult(const GetTableResult&); + GetTableResult& operator=(const GetTableResult&); + GetTableResult() noexcept; + + virtual ~GetTableResult() noexcept; + Table table; + bool isStatsCompliant; + + _GetTableResult__isset __isset; + + void __set_table(const Table& val); + + void __set_isStatsCompliant(const bool val); + + bool operator == (const GetTableResult & rhs) const; + bool operator != (const GetTableResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetTableResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetTableResult &a, GetTableResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetTableResult& obj); + +typedef struct _GetTablesRequest__isset { + _GetTablesRequest__isset() : tblNames(false), capabilities(false), catName(false), processorCapabilities(false), processorIdentifier(false), projectionSpec(false), tablesPattern(false) {} + bool tblNames :1; + bool capabilities :1; + bool catName :1; + bool processorCapabilities :1; + bool processorIdentifier :1; + bool projectionSpec :1; + bool tablesPattern :1; +} _GetTablesRequest__isset; + +class GetTablesRequest : public virtual ::apache::thrift::TBase { + public: + + GetTablesRequest(const GetTablesRequest&); + GetTablesRequest& operator=(const GetTablesRequest&); + GetTablesRequest() noexcept; + + virtual ~GetTablesRequest() noexcept; + std::string dbName; + std::vector tblNames; + ClientCapabilities capabilities; + std::string catName; + std::vector processorCapabilities; + std::string processorIdentifier; + GetProjectionsSpec projectionSpec; + std::string tablesPattern; + + _GetTablesRequest__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tblNames(const std::vector & val); + + void __set_capabilities(const ClientCapabilities& val); + + void __set_catName(const std::string& val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + void __set_projectionSpec(const GetProjectionsSpec& val); + + void __set_tablesPattern(const std::string& val); + + bool operator == (const GetTablesRequest & rhs) const; + bool operator != (const GetTablesRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetTablesRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetTablesRequest &a, GetTablesRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetTablesRequest& obj); + + +class GetTablesResult : public virtual ::apache::thrift::TBase { + public: + + GetTablesResult(const GetTablesResult&); + GetTablesResult& operator=(const GetTablesResult&); + GetTablesResult() noexcept; + + virtual ~GetTablesResult() noexcept; + std::vector
tables; + + void __set_tables(const std::vector
& val); + + bool operator == (const GetTablesResult & rhs) const; + bool operator != (const GetTablesResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetTablesResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetTablesResult &a, GetTablesResult &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetTablesResult& obj); + +typedef struct _GetTablesExtRequest__isset { + _GetTablesExtRequest__isset() : limit(false), processorCapabilities(false), processorIdentifier(false) {} + bool limit :1; + bool processorCapabilities :1; + bool processorIdentifier :1; +} _GetTablesExtRequest__isset; + +class GetTablesExtRequest : public virtual ::apache::thrift::TBase { + public: + + GetTablesExtRequest(const GetTablesExtRequest&); + GetTablesExtRequest& operator=(const GetTablesExtRequest&); + GetTablesExtRequest() noexcept; + + virtual ~GetTablesExtRequest() noexcept; + std::string catalog; + std::string database; + std::string tableNamePattern; + int32_t requestedFields; + int32_t limit; + std::vector processorCapabilities; + std::string processorIdentifier; + + _GetTablesExtRequest__isset __isset; + + void __set_catalog(const std::string& val); + + void __set_database(const std::string& val); + + void __set_tableNamePattern(const std::string& val); + + void __set_requestedFields(const int32_t val); + + void __set_limit(const int32_t val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + bool operator == (const GetTablesExtRequest & rhs) const; + bool operator != (const GetTablesExtRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetTablesExtRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetTablesExtRequest &a, GetTablesExtRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetTablesExtRequest& obj); + +typedef struct _ExtendedTableInfo__isset { + _ExtendedTableInfo__isset() : accessType(false), requiredReadCapabilities(false), requiredWriteCapabilities(false) {} + bool accessType :1; + bool requiredReadCapabilities :1; + bool requiredWriteCapabilities :1; +} _ExtendedTableInfo__isset; + +class ExtendedTableInfo : public virtual ::apache::thrift::TBase { + public: + + ExtendedTableInfo(const ExtendedTableInfo&); + ExtendedTableInfo& operator=(const ExtendedTableInfo&); + ExtendedTableInfo() noexcept; + + virtual ~ExtendedTableInfo() noexcept; + std::string tblName; + int32_t accessType; + std::vector requiredReadCapabilities; + std::vector requiredWriteCapabilities; + + _ExtendedTableInfo__isset __isset; + + void __set_tblName(const std::string& val); + + void __set_accessType(const int32_t val); + + void __set_requiredReadCapabilities(const std::vector & val); + + void __set_requiredWriteCapabilities(const std::vector & val); + + bool operator == (const ExtendedTableInfo & rhs) const; + bool operator != (const ExtendedTableInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ExtendedTableInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ExtendedTableInfo &a, ExtendedTableInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ExtendedTableInfo& obj); + +typedef struct _DropTableRequest__isset { + _DropTableRequest__isset() : catalogName(false), deleteData(false), envContext(false), dropPartitions(false) {} + bool catalogName :1; + bool deleteData :1; + bool envContext :1; + bool dropPartitions :1; +} _DropTableRequest__isset; + +class DropTableRequest : public virtual ::apache::thrift::TBase { + public: + + DropTableRequest(const DropTableRequest&); + DropTableRequest& operator=(const DropTableRequest&); + DropTableRequest() noexcept; + + virtual ~DropTableRequest() noexcept; + std::string catalogName; + std::string dbName; + std::string tableName; + bool deleteData; + EnvironmentContext envContext; + bool dropPartitions; + + _DropTableRequest__isset __isset; + + void __set_catalogName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_deleteData(const bool val); + + void __set_envContext(const EnvironmentContext& val); + + void __set_dropPartitions(const bool val); + + bool operator == (const DropTableRequest & rhs) const; + bool operator != (const DropTableRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropTableRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropTableRequest &a, DropTableRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropTableRequest& obj); + +typedef struct _GetDatabaseRequest__isset { + _GetDatabaseRequest__isset() : name(false), catalogName(false), processorCapabilities(false), processorIdentifier(false) {} + bool name :1; + bool catalogName :1; + bool processorCapabilities :1; + bool processorIdentifier :1; +} _GetDatabaseRequest__isset; + +class GetDatabaseRequest : public virtual ::apache::thrift::TBase { + public: + + GetDatabaseRequest(const GetDatabaseRequest&); + GetDatabaseRequest& operator=(const GetDatabaseRequest&); + GetDatabaseRequest() noexcept; + + virtual ~GetDatabaseRequest() noexcept; + std::string name; + std::string catalogName; + std::vector processorCapabilities; + std::string processorIdentifier; + + _GetDatabaseRequest__isset __isset; + + void __set_name(const std::string& val); + + void __set_catalogName(const std::string& val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + bool operator == (const GetDatabaseRequest & rhs) const; + bool operator != (const GetDatabaseRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetDatabaseRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetDatabaseRequest &a, GetDatabaseRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetDatabaseRequest& obj); + + +class AlterDatabaseRequest : public virtual ::apache::thrift::TBase { + public: + + AlterDatabaseRequest(const AlterDatabaseRequest&); + AlterDatabaseRequest& operator=(const AlterDatabaseRequest&); + AlterDatabaseRequest() noexcept; + + virtual ~AlterDatabaseRequest() noexcept; + std::string oldDbName; + Database newDb; + + void __set_oldDbName(const std::string& val); + + void __set_newDb(const Database& val); + + bool operator == (const AlterDatabaseRequest & rhs) const; + bool operator != (const AlterDatabaseRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterDatabaseRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterDatabaseRequest &a, AlterDatabaseRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterDatabaseRequest& obj); + +typedef struct _DropDatabaseRequest__isset { + _DropDatabaseRequest__isset() : catalogName(false), softDelete(true), txnId(true), deleteManagedDir(true) {} + bool catalogName :1; + bool softDelete :1; + bool txnId :1; + bool deleteManagedDir :1; +} _DropDatabaseRequest__isset; + +class DropDatabaseRequest : public virtual ::apache::thrift::TBase { + public: + + DropDatabaseRequest(const DropDatabaseRequest&); + DropDatabaseRequest& operator=(const DropDatabaseRequest&); + DropDatabaseRequest() noexcept; + + virtual ~DropDatabaseRequest() noexcept; + std::string name; + std::string catalogName; + bool ignoreUnknownDb; + bool deleteData; + bool cascade; + bool softDelete; + int64_t txnId; + bool deleteManagedDir; + + _DropDatabaseRequest__isset __isset; + + void __set_name(const std::string& val); + + void __set_catalogName(const std::string& val); + + void __set_ignoreUnknownDb(const bool val); + + void __set_deleteData(const bool val); + + void __set_cascade(const bool val); + + void __set_softDelete(const bool val); + + void __set_txnId(const int64_t val); + + void __set_deleteManagedDir(const bool val); + + bool operator == (const DropDatabaseRequest & rhs) const; + bool operator != (const DropDatabaseRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropDatabaseRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropDatabaseRequest &a, DropDatabaseRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropDatabaseRequest& obj); + + +class CmRecycleRequest : public virtual ::apache::thrift::TBase { + public: + + CmRecycleRequest(const CmRecycleRequest&); + CmRecycleRequest& operator=(const CmRecycleRequest&); + CmRecycleRequest() noexcept; + + virtual ~CmRecycleRequest() noexcept; + std::string dataPath; + bool purge; + + void __set_dataPath(const std::string& val); + + void __set_purge(const bool val); + + bool operator == (const CmRecycleRequest & rhs) const; + bool operator != (const CmRecycleRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CmRecycleRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CmRecycleRequest &a, CmRecycleRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CmRecycleRequest& obj); + + +class CmRecycleResponse : public virtual ::apache::thrift::TBase { + public: + + CmRecycleResponse(const CmRecycleResponse&) noexcept; + CmRecycleResponse& operator=(const CmRecycleResponse&) noexcept; + CmRecycleResponse() noexcept; + + virtual ~CmRecycleResponse() noexcept; + + bool operator == (const CmRecycleResponse & /* rhs */) const; + bool operator != (const CmRecycleResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CmRecycleResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CmRecycleResponse &a, CmRecycleResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CmRecycleResponse& obj); + +typedef struct _TableMeta__isset { + _TableMeta__isset() : comments(false), catName(false), ownerName(false), ownerType(false) {} + bool comments :1; + bool catName :1; + bool ownerName :1; + bool ownerType :1; +} _TableMeta__isset; + +class TableMeta : public virtual ::apache::thrift::TBase { + public: + + TableMeta(const TableMeta&); + TableMeta& operator=(const TableMeta&); + TableMeta() noexcept; + + virtual ~TableMeta() noexcept; + std::string dbName; + std::string tableName; + std::string tableType; + std::string comments; + std::string catName; + std::string ownerName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + + _TableMeta__isset __isset; + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_tableType(const std::string& val); + + void __set_comments(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_ownerName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + bool operator == (const TableMeta & rhs) const; + bool operator != (const TableMeta &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TableMeta & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TableMeta &a, TableMeta &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TableMeta& obj); + + +class Materialization : public virtual ::apache::thrift::TBase { + public: + + Materialization(const Materialization&) noexcept; + Materialization& operator=(const Materialization&) noexcept; + Materialization() noexcept; + + virtual ~Materialization() noexcept; + bool sourceTablesUpdateDeleteModified; + bool sourceTablesCompacted; + + void __set_sourceTablesUpdateDeleteModified(const bool val); + + void __set_sourceTablesCompacted(const bool val); + + bool operator == (const Materialization & rhs) const; + bool operator != (const Materialization &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Materialization & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Materialization &a, Materialization &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Materialization& obj); + +typedef struct _WMResourcePlan__isset { + _WMResourcePlan__isset() : status(false), queryParallelism(false), defaultPoolPath(false), ns(false) {} + bool status :1; + bool queryParallelism :1; + bool defaultPoolPath :1; + bool ns :1; +} _WMResourcePlan__isset; + +class WMResourcePlan : public virtual ::apache::thrift::TBase { + public: + + WMResourcePlan(const WMResourcePlan&); + WMResourcePlan& operator=(const WMResourcePlan&); + WMResourcePlan() noexcept; + + virtual ~WMResourcePlan() noexcept; + std::string name; + /** + * + * @see WMResourcePlanStatus + */ + WMResourcePlanStatus::type status; + int32_t queryParallelism; + std::string defaultPoolPath; + std::string ns; + + _WMResourcePlan__isset __isset; + + void __set_name(const std::string& val); + + void __set_status(const WMResourcePlanStatus::type val); + + void __set_queryParallelism(const int32_t val); + + void __set_defaultPoolPath(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMResourcePlan & rhs) const; + bool operator != (const WMResourcePlan &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMResourcePlan & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMResourcePlan &a, WMResourcePlan &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMResourcePlan& obj); + +typedef struct _WMNullableResourcePlan__isset { + _WMNullableResourcePlan__isset() : name(false), status(false), queryParallelism(false), isSetQueryParallelism(false), defaultPoolPath(false), isSetDefaultPoolPath(false), ns(false) {} + bool name :1; + bool status :1; + bool queryParallelism :1; + bool isSetQueryParallelism :1; + bool defaultPoolPath :1; + bool isSetDefaultPoolPath :1; + bool ns :1; +} _WMNullableResourcePlan__isset; + +class WMNullableResourcePlan : public virtual ::apache::thrift::TBase { + public: + + WMNullableResourcePlan(const WMNullableResourcePlan&); + WMNullableResourcePlan& operator=(const WMNullableResourcePlan&); + WMNullableResourcePlan() noexcept; + + virtual ~WMNullableResourcePlan() noexcept; + std::string name; + /** + * + * @see WMResourcePlanStatus + */ + WMResourcePlanStatus::type status; + int32_t queryParallelism; + bool isSetQueryParallelism; + std::string defaultPoolPath; + bool isSetDefaultPoolPath; + std::string ns; + + _WMNullableResourcePlan__isset __isset; + + void __set_name(const std::string& val); + + void __set_status(const WMResourcePlanStatus::type val); + + void __set_queryParallelism(const int32_t val); + + void __set_isSetQueryParallelism(const bool val); + + void __set_defaultPoolPath(const std::string& val); + + void __set_isSetDefaultPoolPath(const bool val); + + void __set_ns(const std::string& val); + + bool operator == (const WMNullableResourcePlan & rhs) const; + bool operator != (const WMNullableResourcePlan &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMNullableResourcePlan & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMNullableResourcePlan &a, WMNullableResourcePlan &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMNullableResourcePlan& obj); + +typedef struct _WMPool__isset { + _WMPool__isset() : allocFraction(false), queryParallelism(false), schedulingPolicy(false), ns(false) {} + bool allocFraction :1; + bool queryParallelism :1; + bool schedulingPolicy :1; + bool ns :1; +} _WMPool__isset; + +class WMPool : public virtual ::apache::thrift::TBase { + public: + + WMPool(const WMPool&); + WMPool& operator=(const WMPool&); + WMPool() noexcept; + + virtual ~WMPool() noexcept; + std::string resourcePlanName; + std::string poolPath; + double allocFraction; + int32_t queryParallelism; + std::string schedulingPolicy; + std::string ns; + + _WMPool__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_poolPath(const std::string& val); + + void __set_allocFraction(const double val); + + void __set_queryParallelism(const int32_t val); + + void __set_schedulingPolicy(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMPool & rhs) const; + bool operator != (const WMPool &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMPool & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMPool &a, WMPool &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMPool& obj); + +typedef struct _WMNullablePool__isset { + _WMNullablePool__isset() : allocFraction(false), queryParallelism(false), schedulingPolicy(false), isSetSchedulingPolicy(false), ns(false) {} + bool allocFraction :1; + bool queryParallelism :1; + bool schedulingPolicy :1; + bool isSetSchedulingPolicy :1; + bool ns :1; +} _WMNullablePool__isset; + +class WMNullablePool : public virtual ::apache::thrift::TBase { + public: + + WMNullablePool(const WMNullablePool&); + WMNullablePool& operator=(const WMNullablePool&); + WMNullablePool() noexcept; + + virtual ~WMNullablePool() noexcept; + std::string resourcePlanName; + std::string poolPath; + double allocFraction; + int32_t queryParallelism; + std::string schedulingPolicy; + bool isSetSchedulingPolicy; + std::string ns; + + _WMNullablePool__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_poolPath(const std::string& val); + + void __set_allocFraction(const double val); + + void __set_queryParallelism(const int32_t val); + + void __set_schedulingPolicy(const std::string& val); + + void __set_isSetSchedulingPolicy(const bool val); + + void __set_ns(const std::string& val); + + bool operator == (const WMNullablePool & rhs) const; + bool operator != (const WMNullablePool &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMNullablePool & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMNullablePool &a, WMNullablePool &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMNullablePool& obj); + +typedef struct _WMTrigger__isset { + _WMTrigger__isset() : triggerExpression(false), actionExpression(false), isInUnmanaged(false), ns(false) {} + bool triggerExpression :1; + bool actionExpression :1; + bool isInUnmanaged :1; + bool ns :1; +} _WMTrigger__isset; + +class WMTrigger : public virtual ::apache::thrift::TBase { + public: + + WMTrigger(const WMTrigger&); + WMTrigger& operator=(const WMTrigger&); + WMTrigger() noexcept; + + virtual ~WMTrigger() noexcept; + std::string resourcePlanName; + std::string triggerName; + std::string triggerExpression; + std::string actionExpression; + bool isInUnmanaged; + std::string ns; + + _WMTrigger__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_triggerName(const std::string& val); + + void __set_triggerExpression(const std::string& val); + + void __set_actionExpression(const std::string& val); + + void __set_isInUnmanaged(const bool val); + + void __set_ns(const std::string& val); + + bool operator == (const WMTrigger & rhs) const; + bool operator != (const WMTrigger &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMTrigger & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMTrigger &a, WMTrigger &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMTrigger& obj); + +typedef struct _WMMapping__isset { + _WMMapping__isset() : poolPath(false), ordering(false), ns(false) {} + bool poolPath :1; + bool ordering :1; + bool ns :1; +} _WMMapping__isset; + +class WMMapping : public virtual ::apache::thrift::TBase { + public: + + WMMapping(const WMMapping&); + WMMapping& operator=(const WMMapping&); + WMMapping() noexcept; + + virtual ~WMMapping() noexcept; + std::string resourcePlanName; + std::string entityType; + std::string entityName; + std::string poolPath; + int32_t ordering; + std::string ns; + + _WMMapping__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_entityType(const std::string& val); + + void __set_entityName(const std::string& val); + + void __set_poolPath(const std::string& val); + + void __set_ordering(const int32_t val); + + void __set_ns(const std::string& val); + + bool operator == (const WMMapping & rhs) const; + bool operator != (const WMMapping &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMMapping & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMMapping &a, WMMapping &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMMapping& obj); + +typedef struct _WMPoolTrigger__isset { + _WMPoolTrigger__isset() : ns(false) {} + bool ns :1; +} _WMPoolTrigger__isset; + +class WMPoolTrigger : public virtual ::apache::thrift::TBase { + public: + + WMPoolTrigger(const WMPoolTrigger&); + WMPoolTrigger& operator=(const WMPoolTrigger&); + WMPoolTrigger() noexcept; + + virtual ~WMPoolTrigger() noexcept; + std::string pool; + std::string trigger; + std::string ns; + + _WMPoolTrigger__isset __isset; + + void __set_pool(const std::string& val); + + void __set_trigger(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMPoolTrigger & rhs) const; + bool operator != (const WMPoolTrigger &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMPoolTrigger & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMPoolTrigger &a, WMPoolTrigger &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMPoolTrigger& obj); + +typedef struct _WMFullResourcePlan__isset { + _WMFullResourcePlan__isset() : mappings(false), triggers(false), poolTriggers(false) {} + bool mappings :1; + bool triggers :1; + bool poolTriggers :1; +} _WMFullResourcePlan__isset; + +class WMFullResourcePlan : public virtual ::apache::thrift::TBase { + public: + + WMFullResourcePlan(const WMFullResourcePlan&); + WMFullResourcePlan& operator=(const WMFullResourcePlan&); + WMFullResourcePlan() noexcept; + + virtual ~WMFullResourcePlan() noexcept; + WMResourcePlan plan; + std::vector pools; + std::vector mappings; + std::vector triggers; + std::vector poolTriggers; + + _WMFullResourcePlan__isset __isset; + + void __set_plan(const WMResourcePlan& val); + + void __set_pools(const std::vector & val); + + void __set_mappings(const std::vector & val); + + void __set_triggers(const std::vector & val); + + void __set_poolTriggers(const std::vector & val); + + bool operator == (const WMFullResourcePlan & rhs) const; + bool operator != (const WMFullResourcePlan &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMFullResourcePlan & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMFullResourcePlan &a, WMFullResourcePlan &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMFullResourcePlan& obj); + +typedef struct _WMCreateResourcePlanRequest__isset { + _WMCreateResourcePlanRequest__isset() : resourcePlan(false), copyFrom(false) {} + bool resourcePlan :1; + bool copyFrom :1; +} _WMCreateResourcePlanRequest__isset; + +class WMCreateResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMCreateResourcePlanRequest(const WMCreateResourcePlanRequest&); + WMCreateResourcePlanRequest& operator=(const WMCreateResourcePlanRequest&); + WMCreateResourcePlanRequest() noexcept; + + virtual ~WMCreateResourcePlanRequest() noexcept; + WMResourcePlan resourcePlan; + std::string copyFrom; + + _WMCreateResourcePlanRequest__isset __isset; + + void __set_resourcePlan(const WMResourcePlan& val); + + void __set_copyFrom(const std::string& val); + + bool operator == (const WMCreateResourcePlanRequest & rhs) const; + bool operator != (const WMCreateResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateResourcePlanRequest &a, WMCreateResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateResourcePlanRequest& obj); + + +class WMCreateResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMCreateResourcePlanResponse(const WMCreateResourcePlanResponse&) noexcept; + WMCreateResourcePlanResponse& operator=(const WMCreateResourcePlanResponse&) noexcept; + WMCreateResourcePlanResponse() noexcept; + + virtual ~WMCreateResourcePlanResponse() noexcept; + + bool operator == (const WMCreateResourcePlanResponse & /* rhs */) const; + bool operator != (const WMCreateResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateResourcePlanResponse &a, WMCreateResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateResourcePlanResponse& obj); + +typedef struct _WMGetActiveResourcePlanRequest__isset { + _WMGetActiveResourcePlanRequest__isset() : ns(false) {} + bool ns :1; +} _WMGetActiveResourcePlanRequest__isset; + +class WMGetActiveResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMGetActiveResourcePlanRequest(const WMGetActiveResourcePlanRequest&); + WMGetActiveResourcePlanRequest& operator=(const WMGetActiveResourcePlanRequest&); + WMGetActiveResourcePlanRequest() noexcept; + + virtual ~WMGetActiveResourcePlanRequest() noexcept; + std::string ns; + + _WMGetActiveResourcePlanRequest__isset __isset; + + void __set_ns(const std::string& val); + + bool operator == (const WMGetActiveResourcePlanRequest & rhs) const; + bool operator != (const WMGetActiveResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetActiveResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetActiveResourcePlanRequest &a, WMGetActiveResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetActiveResourcePlanRequest& obj); + +typedef struct _WMGetActiveResourcePlanResponse__isset { + _WMGetActiveResourcePlanResponse__isset() : resourcePlan(false) {} + bool resourcePlan :1; +} _WMGetActiveResourcePlanResponse__isset; + +class WMGetActiveResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMGetActiveResourcePlanResponse(const WMGetActiveResourcePlanResponse&); + WMGetActiveResourcePlanResponse& operator=(const WMGetActiveResourcePlanResponse&); + WMGetActiveResourcePlanResponse() noexcept; + + virtual ~WMGetActiveResourcePlanResponse() noexcept; + WMFullResourcePlan resourcePlan; + + _WMGetActiveResourcePlanResponse__isset __isset; + + void __set_resourcePlan(const WMFullResourcePlan& val); + + bool operator == (const WMGetActiveResourcePlanResponse & rhs) const; + bool operator != (const WMGetActiveResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetActiveResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetActiveResourcePlanResponse &a, WMGetActiveResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetActiveResourcePlanResponse& obj); + +typedef struct _WMGetResourcePlanRequest__isset { + _WMGetResourcePlanRequest__isset() : resourcePlanName(false), ns(false) {} + bool resourcePlanName :1; + bool ns :1; +} _WMGetResourcePlanRequest__isset; + +class WMGetResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMGetResourcePlanRequest(const WMGetResourcePlanRequest&); + WMGetResourcePlanRequest& operator=(const WMGetResourcePlanRequest&); + WMGetResourcePlanRequest() noexcept; + + virtual ~WMGetResourcePlanRequest() noexcept; + std::string resourcePlanName; + std::string ns; + + _WMGetResourcePlanRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMGetResourcePlanRequest & rhs) const; + bool operator != (const WMGetResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetResourcePlanRequest &a, WMGetResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetResourcePlanRequest& obj); + +typedef struct _WMGetResourcePlanResponse__isset { + _WMGetResourcePlanResponse__isset() : resourcePlan(false) {} + bool resourcePlan :1; +} _WMGetResourcePlanResponse__isset; + +class WMGetResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMGetResourcePlanResponse(const WMGetResourcePlanResponse&); + WMGetResourcePlanResponse& operator=(const WMGetResourcePlanResponse&); + WMGetResourcePlanResponse() noexcept; + + virtual ~WMGetResourcePlanResponse() noexcept; + WMFullResourcePlan resourcePlan; + + _WMGetResourcePlanResponse__isset __isset; + + void __set_resourcePlan(const WMFullResourcePlan& val); + + bool operator == (const WMGetResourcePlanResponse & rhs) const; + bool operator != (const WMGetResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetResourcePlanResponse &a, WMGetResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetResourcePlanResponse& obj); + +typedef struct _WMGetAllResourcePlanRequest__isset { + _WMGetAllResourcePlanRequest__isset() : ns(false) {} + bool ns :1; +} _WMGetAllResourcePlanRequest__isset; + +class WMGetAllResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMGetAllResourcePlanRequest(const WMGetAllResourcePlanRequest&); + WMGetAllResourcePlanRequest& operator=(const WMGetAllResourcePlanRequest&); + WMGetAllResourcePlanRequest() noexcept; + + virtual ~WMGetAllResourcePlanRequest() noexcept; + std::string ns; + + _WMGetAllResourcePlanRequest__isset __isset; + + void __set_ns(const std::string& val); + + bool operator == (const WMGetAllResourcePlanRequest & rhs) const; + bool operator != (const WMGetAllResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetAllResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetAllResourcePlanRequest &a, WMGetAllResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetAllResourcePlanRequest& obj); + +typedef struct _WMGetAllResourcePlanResponse__isset { + _WMGetAllResourcePlanResponse__isset() : resourcePlans(false) {} + bool resourcePlans :1; +} _WMGetAllResourcePlanResponse__isset; + +class WMGetAllResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMGetAllResourcePlanResponse(const WMGetAllResourcePlanResponse&); + WMGetAllResourcePlanResponse& operator=(const WMGetAllResourcePlanResponse&); + WMGetAllResourcePlanResponse() noexcept; + + virtual ~WMGetAllResourcePlanResponse() noexcept; + std::vector resourcePlans; + + _WMGetAllResourcePlanResponse__isset __isset; + + void __set_resourcePlans(const std::vector & val); + + bool operator == (const WMGetAllResourcePlanResponse & rhs) const; + bool operator != (const WMGetAllResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetAllResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetAllResourcePlanResponse &a, WMGetAllResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetAllResourcePlanResponse& obj); + +typedef struct _WMAlterResourcePlanRequest__isset { + _WMAlterResourcePlanRequest__isset() : resourcePlanName(false), resourcePlan(false), isEnableAndActivate(false), isForceDeactivate(false), isReplace(false), ns(false) {} + bool resourcePlanName :1; + bool resourcePlan :1; + bool isEnableAndActivate :1; + bool isForceDeactivate :1; + bool isReplace :1; + bool ns :1; +} _WMAlterResourcePlanRequest__isset; + +class WMAlterResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMAlterResourcePlanRequest(const WMAlterResourcePlanRequest&); + WMAlterResourcePlanRequest& operator=(const WMAlterResourcePlanRequest&); + WMAlterResourcePlanRequest() noexcept; + + virtual ~WMAlterResourcePlanRequest() noexcept; + std::string resourcePlanName; + WMNullableResourcePlan resourcePlan; + bool isEnableAndActivate; + bool isForceDeactivate; + bool isReplace; + std::string ns; + + _WMAlterResourcePlanRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_resourcePlan(const WMNullableResourcePlan& val); + + void __set_isEnableAndActivate(const bool val); + + void __set_isForceDeactivate(const bool val); + + void __set_isReplace(const bool val); + + void __set_ns(const std::string& val); + + bool operator == (const WMAlterResourcePlanRequest & rhs) const; + bool operator != (const WMAlterResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterResourcePlanRequest &a, WMAlterResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterResourcePlanRequest& obj); + +typedef struct _WMAlterResourcePlanResponse__isset { + _WMAlterResourcePlanResponse__isset() : fullResourcePlan(false) {} + bool fullResourcePlan :1; +} _WMAlterResourcePlanResponse__isset; + +class WMAlterResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMAlterResourcePlanResponse(const WMAlterResourcePlanResponse&); + WMAlterResourcePlanResponse& operator=(const WMAlterResourcePlanResponse&); + WMAlterResourcePlanResponse() noexcept; + + virtual ~WMAlterResourcePlanResponse() noexcept; + WMFullResourcePlan fullResourcePlan; + + _WMAlterResourcePlanResponse__isset __isset; + + void __set_fullResourcePlan(const WMFullResourcePlan& val); + + bool operator == (const WMAlterResourcePlanResponse & rhs) const; + bool operator != (const WMAlterResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterResourcePlanResponse &a, WMAlterResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterResourcePlanResponse& obj); + +typedef struct _WMValidateResourcePlanRequest__isset { + _WMValidateResourcePlanRequest__isset() : resourcePlanName(false), ns(false) {} + bool resourcePlanName :1; + bool ns :1; +} _WMValidateResourcePlanRequest__isset; + +class WMValidateResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMValidateResourcePlanRequest(const WMValidateResourcePlanRequest&); + WMValidateResourcePlanRequest& operator=(const WMValidateResourcePlanRequest&); + WMValidateResourcePlanRequest() noexcept; + + virtual ~WMValidateResourcePlanRequest() noexcept; + std::string resourcePlanName; + std::string ns; + + _WMValidateResourcePlanRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMValidateResourcePlanRequest & rhs) const; + bool operator != (const WMValidateResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMValidateResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMValidateResourcePlanRequest &a, WMValidateResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMValidateResourcePlanRequest& obj); + +typedef struct _WMValidateResourcePlanResponse__isset { + _WMValidateResourcePlanResponse__isset() : errors(false), warnings(false) {} + bool errors :1; + bool warnings :1; +} _WMValidateResourcePlanResponse__isset; + +class WMValidateResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMValidateResourcePlanResponse(const WMValidateResourcePlanResponse&); + WMValidateResourcePlanResponse& operator=(const WMValidateResourcePlanResponse&); + WMValidateResourcePlanResponse() noexcept; + + virtual ~WMValidateResourcePlanResponse() noexcept; + std::vector errors; + std::vector warnings; + + _WMValidateResourcePlanResponse__isset __isset; + + void __set_errors(const std::vector & val); + + void __set_warnings(const std::vector & val); + + bool operator == (const WMValidateResourcePlanResponse & rhs) const; + bool operator != (const WMValidateResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMValidateResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMValidateResourcePlanResponse &a, WMValidateResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMValidateResourcePlanResponse& obj); + +typedef struct _WMDropResourcePlanRequest__isset { + _WMDropResourcePlanRequest__isset() : resourcePlanName(false), ns(false) {} + bool resourcePlanName :1; + bool ns :1; +} _WMDropResourcePlanRequest__isset; + +class WMDropResourcePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMDropResourcePlanRequest(const WMDropResourcePlanRequest&); + WMDropResourcePlanRequest& operator=(const WMDropResourcePlanRequest&); + WMDropResourcePlanRequest() noexcept; + + virtual ~WMDropResourcePlanRequest() noexcept; + std::string resourcePlanName; + std::string ns; + + _WMDropResourcePlanRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMDropResourcePlanRequest & rhs) const; + bool operator != (const WMDropResourcePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropResourcePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropResourcePlanRequest &a, WMDropResourcePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropResourcePlanRequest& obj); + + +class WMDropResourcePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMDropResourcePlanResponse(const WMDropResourcePlanResponse&) noexcept; + WMDropResourcePlanResponse& operator=(const WMDropResourcePlanResponse&) noexcept; + WMDropResourcePlanResponse() noexcept; + + virtual ~WMDropResourcePlanResponse() noexcept; + + bool operator == (const WMDropResourcePlanResponse & /* rhs */) const; + bool operator != (const WMDropResourcePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropResourcePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropResourcePlanResponse &a, WMDropResourcePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropResourcePlanResponse& obj); + +typedef struct _WMCreateTriggerRequest__isset { + _WMCreateTriggerRequest__isset() : trigger(false) {} + bool trigger :1; +} _WMCreateTriggerRequest__isset; + +class WMCreateTriggerRequest : public virtual ::apache::thrift::TBase { + public: + + WMCreateTriggerRequest(const WMCreateTriggerRequest&); + WMCreateTriggerRequest& operator=(const WMCreateTriggerRequest&); + WMCreateTriggerRequest() noexcept; + + virtual ~WMCreateTriggerRequest() noexcept; + WMTrigger trigger; + + _WMCreateTriggerRequest__isset __isset; + + void __set_trigger(const WMTrigger& val); + + bool operator == (const WMCreateTriggerRequest & rhs) const; + bool operator != (const WMCreateTriggerRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateTriggerRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateTriggerRequest &a, WMCreateTriggerRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateTriggerRequest& obj); + + +class WMCreateTriggerResponse : public virtual ::apache::thrift::TBase { + public: + + WMCreateTriggerResponse(const WMCreateTriggerResponse&) noexcept; + WMCreateTriggerResponse& operator=(const WMCreateTriggerResponse&) noexcept; + WMCreateTriggerResponse() noexcept; + + virtual ~WMCreateTriggerResponse() noexcept; + + bool operator == (const WMCreateTriggerResponse & /* rhs */) const; + bool operator != (const WMCreateTriggerResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateTriggerResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateTriggerResponse &a, WMCreateTriggerResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateTriggerResponse& obj); + +typedef struct _WMAlterTriggerRequest__isset { + _WMAlterTriggerRequest__isset() : trigger(false) {} + bool trigger :1; +} _WMAlterTriggerRequest__isset; + +class WMAlterTriggerRequest : public virtual ::apache::thrift::TBase { + public: + + WMAlterTriggerRequest(const WMAlterTriggerRequest&); + WMAlterTriggerRequest& operator=(const WMAlterTriggerRequest&); + WMAlterTriggerRequest() noexcept; + + virtual ~WMAlterTriggerRequest() noexcept; + WMTrigger trigger; + + _WMAlterTriggerRequest__isset __isset; + + void __set_trigger(const WMTrigger& val); + + bool operator == (const WMAlterTriggerRequest & rhs) const; + bool operator != (const WMAlterTriggerRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterTriggerRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterTriggerRequest &a, WMAlterTriggerRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterTriggerRequest& obj); + + +class WMAlterTriggerResponse : public virtual ::apache::thrift::TBase { + public: + + WMAlterTriggerResponse(const WMAlterTriggerResponse&) noexcept; + WMAlterTriggerResponse& operator=(const WMAlterTriggerResponse&) noexcept; + WMAlterTriggerResponse() noexcept; + + virtual ~WMAlterTriggerResponse() noexcept; + + bool operator == (const WMAlterTriggerResponse & /* rhs */) const; + bool operator != (const WMAlterTriggerResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterTriggerResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterTriggerResponse &a, WMAlterTriggerResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterTriggerResponse& obj); + +typedef struct _WMDropTriggerRequest__isset { + _WMDropTriggerRequest__isset() : resourcePlanName(false), triggerName(false), ns(false) {} + bool resourcePlanName :1; + bool triggerName :1; + bool ns :1; +} _WMDropTriggerRequest__isset; + +class WMDropTriggerRequest : public virtual ::apache::thrift::TBase { + public: + + WMDropTriggerRequest(const WMDropTriggerRequest&); + WMDropTriggerRequest& operator=(const WMDropTriggerRequest&); + WMDropTriggerRequest() noexcept; + + virtual ~WMDropTriggerRequest() noexcept; + std::string resourcePlanName; + std::string triggerName; + std::string ns; + + _WMDropTriggerRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_triggerName(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMDropTriggerRequest & rhs) const; + bool operator != (const WMDropTriggerRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropTriggerRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropTriggerRequest &a, WMDropTriggerRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropTriggerRequest& obj); + + +class WMDropTriggerResponse : public virtual ::apache::thrift::TBase { + public: + + WMDropTriggerResponse(const WMDropTriggerResponse&) noexcept; + WMDropTriggerResponse& operator=(const WMDropTriggerResponse&) noexcept; + WMDropTriggerResponse() noexcept; + + virtual ~WMDropTriggerResponse() noexcept; + + bool operator == (const WMDropTriggerResponse & /* rhs */) const; + bool operator != (const WMDropTriggerResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropTriggerResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropTriggerResponse &a, WMDropTriggerResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropTriggerResponse& obj); + +typedef struct _WMGetTriggersForResourePlanRequest__isset { + _WMGetTriggersForResourePlanRequest__isset() : resourcePlanName(false), ns(false) {} + bool resourcePlanName :1; + bool ns :1; +} _WMGetTriggersForResourePlanRequest__isset; + +class WMGetTriggersForResourePlanRequest : public virtual ::apache::thrift::TBase { + public: + + WMGetTriggersForResourePlanRequest(const WMGetTriggersForResourePlanRequest&); + WMGetTriggersForResourePlanRequest& operator=(const WMGetTriggersForResourePlanRequest&); + WMGetTriggersForResourePlanRequest() noexcept; + + virtual ~WMGetTriggersForResourePlanRequest() noexcept; + std::string resourcePlanName; + std::string ns; + + _WMGetTriggersForResourePlanRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMGetTriggersForResourePlanRequest & rhs) const; + bool operator != (const WMGetTriggersForResourePlanRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetTriggersForResourePlanRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetTriggersForResourePlanRequest &a, WMGetTriggersForResourePlanRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetTriggersForResourePlanRequest& obj); + +typedef struct _WMGetTriggersForResourePlanResponse__isset { + _WMGetTriggersForResourePlanResponse__isset() : triggers(false) {} + bool triggers :1; +} _WMGetTriggersForResourePlanResponse__isset; + +class WMGetTriggersForResourePlanResponse : public virtual ::apache::thrift::TBase { + public: + + WMGetTriggersForResourePlanResponse(const WMGetTriggersForResourePlanResponse&); + WMGetTriggersForResourePlanResponse& operator=(const WMGetTriggersForResourePlanResponse&); + WMGetTriggersForResourePlanResponse() noexcept; + + virtual ~WMGetTriggersForResourePlanResponse() noexcept; + std::vector triggers; + + _WMGetTriggersForResourePlanResponse__isset __isset; + + void __set_triggers(const std::vector & val); + + bool operator == (const WMGetTriggersForResourePlanResponse & rhs) const; + bool operator != (const WMGetTriggersForResourePlanResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMGetTriggersForResourePlanResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMGetTriggersForResourePlanResponse &a, WMGetTriggersForResourePlanResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMGetTriggersForResourePlanResponse& obj); + +typedef struct _WMCreatePoolRequest__isset { + _WMCreatePoolRequest__isset() : pool(false) {} + bool pool :1; +} _WMCreatePoolRequest__isset; + +class WMCreatePoolRequest : public virtual ::apache::thrift::TBase { + public: + + WMCreatePoolRequest(const WMCreatePoolRequest&); + WMCreatePoolRequest& operator=(const WMCreatePoolRequest&); + WMCreatePoolRequest() noexcept; + + virtual ~WMCreatePoolRequest() noexcept; + WMPool pool; + + _WMCreatePoolRequest__isset __isset; + + void __set_pool(const WMPool& val); + + bool operator == (const WMCreatePoolRequest & rhs) const; + bool operator != (const WMCreatePoolRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreatePoolRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreatePoolRequest &a, WMCreatePoolRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreatePoolRequest& obj); + + +class WMCreatePoolResponse : public virtual ::apache::thrift::TBase { + public: + + WMCreatePoolResponse(const WMCreatePoolResponse&) noexcept; + WMCreatePoolResponse& operator=(const WMCreatePoolResponse&) noexcept; + WMCreatePoolResponse() noexcept; + + virtual ~WMCreatePoolResponse() noexcept; + + bool operator == (const WMCreatePoolResponse & /* rhs */) const; + bool operator != (const WMCreatePoolResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreatePoolResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreatePoolResponse &a, WMCreatePoolResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreatePoolResponse& obj); + +typedef struct _WMAlterPoolRequest__isset { + _WMAlterPoolRequest__isset() : pool(false), poolPath(false) {} + bool pool :1; + bool poolPath :1; +} _WMAlterPoolRequest__isset; + +class WMAlterPoolRequest : public virtual ::apache::thrift::TBase { + public: + + WMAlterPoolRequest(const WMAlterPoolRequest&); + WMAlterPoolRequest& operator=(const WMAlterPoolRequest&); + WMAlterPoolRequest() noexcept; + + virtual ~WMAlterPoolRequest() noexcept; + WMNullablePool pool; + std::string poolPath; + + _WMAlterPoolRequest__isset __isset; + + void __set_pool(const WMNullablePool& val); + + void __set_poolPath(const std::string& val); + + bool operator == (const WMAlterPoolRequest & rhs) const; + bool operator != (const WMAlterPoolRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterPoolRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterPoolRequest &a, WMAlterPoolRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterPoolRequest& obj); + + +class WMAlterPoolResponse : public virtual ::apache::thrift::TBase { + public: + + WMAlterPoolResponse(const WMAlterPoolResponse&) noexcept; + WMAlterPoolResponse& operator=(const WMAlterPoolResponse&) noexcept; + WMAlterPoolResponse() noexcept; + + virtual ~WMAlterPoolResponse() noexcept; + + bool operator == (const WMAlterPoolResponse & /* rhs */) const; + bool operator != (const WMAlterPoolResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMAlterPoolResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMAlterPoolResponse &a, WMAlterPoolResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMAlterPoolResponse& obj); + +typedef struct _WMDropPoolRequest__isset { + _WMDropPoolRequest__isset() : resourcePlanName(false), poolPath(false), ns(false) {} + bool resourcePlanName :1; + bool poolPath :1; + bool ns :1; +} _WMDropPoolRequest__isset; + +class WMDropPoolRequest : public virtual ::apache::thrift::TBase { + public: + + WMDropPoolRequest(const WMDropPoolRequest&); + WMDropPoolRequest& operator=(const WMDropPoolRequest&); + WMDropPoolRequest() noexcept; + + virtual ~WMDropPoolRequest() noexcept; + std::string resourcePlanName; + std::string poolPath; + std::string ns; + + _WMDropPoolRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_poolPath(const std::string& val); + + void __set_ns(const std::string& val); + + bool operator == (const WMDropPoolRequest & rhs) const; + bool operator != (const WMDropPoolRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropPoolRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropPoolRequest &a, WMDropPoolRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropPoolRequest& obj); + + +class WMDropPoolResponse : public virtual ::apache::thrift::TBase { + public: + + WMDropPoolResponse(const WMDropPoolResponse&) noexcept; + WMDropPoolResponse& operator=(const WMDropPoolResponse&) noexcept; + WMDropPoolResponse() noexcept; + + virtual ~WMDropPoolResponse() noexcept; + + bool operator == (const WMDropPoolResponse & /* rhs */) const; + bool operator != (const WMDropPoolResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropPoolResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropPoolResponse &a, WMDropPoolResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropPoolResponse& obj); + +typedef struct _WMCreateOrUpdateMappingRequest__isset { + _WMCreateOrUpdateMappingRequest__isset() : mapping(false), update(false) {} + bool mapping :1; + bool update :1; +} _WMCreateOrUpdateMappingRequest__isset; + +class WMCreateOrUpdateMappingRequest : public virtual ::apache::thrift::TBase { + public: + + WMCreateOrUpdateMappingRequest(const WMCreateOrUpdateMappingRequest&); + WMCreateOrUpdateMappingRequest& operator=(const WMCreateOrUpdateMappingRequest&); + WMCreateOrUpdateMappingRequest() noexcept; + + virtual ~WMCreateOrUpdateMappingRequest() noexcept; + WMMapping mapping; + bool update; + + _WMCreateOrUpdateMappingRequest__isset __isset; + + void __set_mapping(const WMMapping& val); + + void __set_update(const bool val); + + bool operator == (const WMCreateOrUpdateMappingRequest & rhs) const; + bool operator != (const WMCreateOrUpdateMappingRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateOrUpdateMappingRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateOrUpdateMappingRequest &a, WMCreateOrUpdateMappingRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateOrUpdateMappingRequest& obj); + + +class WMCreateOrUpdateMappingResponse : public virtual ::apache::thrift::TBase { + public: + + WMCreateOrUpdateMappingResponse(const WMCreateOrUpdateMappingResponse&) noexcept; + WMCreateOrUpdateMappingResponse& operator=(const WMCreateOrUpdateMappingResponse&) noexcept; + WMCreateOrUpdateMappingResponse() noexcept; + + virtual ~WMCreateOrUpdateMappingResponse() noexcept; + + bool operator == (const WMCreateOrUpdateMappingResponse & /* rhs */) const; + bool operator != (const WMCreateOrUpdateMappingResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateOrUpdateMappingResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateOrUpdateMappingResponse &a, WMCreateOrUpdateMappingResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateOrUpdateMappingResponse& obj); + +typedef struct _WMDropMappingRequest__isset { + _WMDropMappingRequest__isset() : mapping(false) {} + bool mapping :1; +} _WMDropMappingRequest__isset; + +class WMDropMappingRequest : public virtual ::apache::thrift::TBase { + public: + + WMDropMappingRequest(const WMDropMappingRequest&); + WMDropMappingRequest& operator=(const WMDropMappingRequest&); + WMDropMappingRequest() noexcept; + + virtual ~WMDropMappingRequest() noexcept; + WMMapping mapping; + + _WMDropMappingRequest__isset __isset; + + void __set_mapping(const WMMapping& val); + + bool operator == (const WMDropMappingRequest & rhs) const; + bool operator != (const WMDropMappingRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropMappingRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropMappingRequest &a, WMDropMappingRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropMappingRequest& obj); + + +class WMDropMappingResponse : public virtual ::apache::thrift::TBase { + public: + + WMDropMappingResponse(const WMDropMappingResponse&) noexcept; + WMDropMappingResponse& operator=(const WMDropMappingResponse&) noexcept; + WMDropMappingResponse() noexcept; + + virtual ~WMDropMappingResponse() noexcept; + + bool operator == (const WMDropMappingResponse & /* rhs */) const; + bool operator != (const WMDropMappingResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMDropMappingResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMDropMappingResponse &a, WMDropMappingResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMDropMappingResponse& obj); + +typedef struct _WMCreateOrDropTriggerToPoolMappingRequest__isset { + _WMCreateOrDropTriggerToPoolMappingRequest__isset() : resourcePlanName(false), triggerName(false), poolPath(false), drop(false), ns(false) {} + bool resourcePlanName :1; + bool triggerName :1; + bool poolPath :1; + bool drop :1; + bool ns :1; +} _WMCreateOrDropTriggerToPoolMappingRequest__isset; + +class WMCreateOrDropTriggerToPoolMappingRequest : public virtual ::apache::thrift::TBase { + public: + + WMCreateOrDropTriggerToPoolMappingRequest(const WMCreateOrDropTriggerToPoolMappingRequest&); + WMCreateOrDropTriggerToPoolMappingRequest& operator=(const WMCreateOrDropTriggerToPoolMappingRequest&); + WMCreateOrDropTriggerToPoolMappingRequest() noexcept; + + virtual ~WMCreateOrDropTriggerToPoolMappingRequest() noexcept; + std::string resourcePlanName; + std::string triggerName; + std::string poolPath; + bool drop; + std::string ns; + + _WMCreateOrDropTriggerToPoolMappingRequest__isset __isset; + + void __set_resourcePlanName(const std::string& val); + + void __set_triggerName(const std::string& val); + + void __set_poolPath(const std::string& val); + + void __set_drop(const bool val); + + void __set_ns(const std::string& val); + + bool operator == (const WMCreateOrDropTriggerToPoolMappingRequest & rhs) const; + bool operator != (const WMCreateOrDropTriggerToPoolMappingRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateOrDropTriggerToPoolMappingRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateOrDropTriggerToPoolMappingRequest &a, WMCreateOrDropTriggerToPoolMappingRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateOrDropTriggerToPoolMappingRequest& obj); + + +class WMCreateOrDropTriggerToPoolMappingResponse : public virtual ::apache::thrift::TBase { + public: + + WMCreateOrDropTriggerToPoolMappingResponse(const WMCreateOrDropTriggerToPoolMappingResponse&) noexcept; + WMCreateOrDropTriggerToPoolMappingResponse& operator=(const WMCreateOrDropTriggerToPoolMappingResponse&) noexcept; + WMCreateOrDropTriggerToPoolMappingResponse() noexcept; + + virtual ~WMCreateOrDropTriggerToPoolMappingResponse() noexcept; + + bool operator == (const WMCreateOrDropTriggerToPoolMappingResponse & /* rhs */) const; + bool operator != (const WMCreateOrDropTriggerToPoolMappingResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const WMCreateOrDropTriggerToPoolMappingResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(WMCreateOrDropTriggerToPoolMappingResponse &a, WMCreateOrDropTriggerToPoolMappingResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const WMCreateOrDropTriggerToPoolMappingResponse& obj); + +typedef struct _ISchema__isset { + _ISchema__isset() : schemaType(false), name(false), catName(false), dbName(false), compatibility(false), validationLevel(false), canEvolve(false), schemaGroup(false), description(false) {} + bool schemaType :1; + bool name :1; + bool catName :1; + bool dbName :1; + bool compatibility :1; + bool validationLevel :1; + bool canEvolve :1; + bool schemaGroup :1; + bool description :1; +} _ISchema__isset; + +class ISchema : public virtual ::apache::thrift::TBase { + public: + + ISchema(const ISchema&); + ISchema& operator=(const ISchema&); + ISchema() noexcept; + + virtual ~ISchema() noexcept; + /** + * + * @see SchemaType + */ + SchemaType::type schemaType; + std::string name; + std::string catName; + std::string dbName; + /** + * + * @see SchemaCompatibility + */ + SchemaCompatibility::type compatibility; + /** + * + * @see SchemaValidation + */ + SchemaValidation::type validationLevel; + bool canEvolve; + std::string schemaGroup; + std::string description; + + _ISchema__isset __isset; + + void __set_schemaType(const SchemaType::type val); + + void __set_name(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_compatibility(const SchemaCompatibility::type val); + + void __set_validationLevel(const SchemaValidation::type val); + + void __set_canEvolve(const bool val); + + void __set_schemaGroup(const std::string& val); + + void __set_description(const std::string& val); + + bool operator == (const ISchema & rhs) const; + bool operator != (const ISchema &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ISchema & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ISchema &a, ISchema &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ISchema& obj); + +typedef struct _ISchemaName__isset { + _ISchemaName__isset() : catName(false), dbName(false), schemaName(false) {} + bool catName :1; + bool dbName :1; + bool schemaName :1; +} _ISchemaName__isset; + +class ISchemaName : public virtual ::apache::thrift::TBase { + public: + + ISchemaName(const ISchemaName&); + ISchemaName& operator=(const ISchemaName&); + ISchemaName() noexcept; + + virtual ~ISchemaName() noexcept; + std::string catName; + std::string dbName; + std::string schemaName; + + _ISchemaName__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_schemaName(const std::string& val); + + bool operator == (const ISchemaName & rhs) const; + bool operator != (const ISchemaName &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ISchemaName & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ISchemaName &a, ISchemaName &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ISchemaName& obj); + +typedef struct _AlterISchemaRequest__isset { + _AlterISchemaRequest__isset() : name(false), newSchema(false) {} + bool name :1; + bool newSchema :1; +} _AlterISchemaRequest__isset; + +class AlterISchemaRequest : public virtual ::apache::thrift::TBase { + public: + + AlterISchemaRequest(const AlterISchemaRequest&); + AlterISchemaRequest& operator=(const AlterISchemaRequest&); + AlterISchemaRequest() noexcept; + + virtual ~AlterISchemaRequest() noexcept; + ISchemaName name; + ISchema newSchema; + + _AlterISchemaRequest__isset __isset; + + void __set_name(const ISchemaName& val); + + void __set_newSchema(const ISchema& val); + + bool operator == (const AlterISchemaRequest & rhs) const; + bool operator != (const AlterISchemaRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterISchemaRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterISchemaRequest &a, AlterISchemaRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterISchemaRequest& obj); + +typedef struct _SchemaVersion__isset { + _SchemaVersion__isset() : schema(false), version(false), createdAt(false), cols(false), state(false), description(false), schemaText(false), fingerprint(false), name(false), serDe(false) {} + bool schema :1; + bool version :1; + bool createdAt :1; + bool cols :1; + bool state :1; + bool description :1; + bool schemaText :1; + bool fingerprint :1; + bool name :1; + bool serDe :1; +} _SchemaVersion__isset; + +class SchemaVersion : public virtual ::apache::thrift::TBase { + public: + + SchemaVersion(const SchemaVersion&); + SchemaVersion& operator=(const SchemaVersion&); + SchemaVersion() noexcept; + + virtual ~SchemaVersion() noexcept; + ISchemaName schema; + int32_t version; + int64_t createdAt; + std::vector cols; + /** + * + * @see SchemaVersionState + */ + SchemaVersionState::type state; + std::string description; + std::string schemaText; + std::string fingerprint; + std::string name; + SerDeInfo serDe; + + _SchemaVersion__isset __isset; + + void __set_schema(const ISchemaName& val); + + void __set_version(const int32_t val); + + void __set_createdAt(const int64_t val); + + void __set_cols(const std::vector & val); + + void __set_state(const SchemaVersionState::type val); + + void __set_description(const std::string& val); + + void __set_schemaText(const std::string& val); + + void __set_fingerprint(const std::string& val); + + void __set_name(const std::string& val); + + void __set_serDe(const SerDeInfo& val); + + bool operator == (const SchemaVersion & rhs) const; + bool operator != (const SchemaVersion &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SchemaVersion & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SchemaVersion &a, SchemaVersion &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SchemaVersion& obj); + +typedef struct _SchemaVersionDescriptor__isset { + _SchemaVersionDescriptor__isset() : schema(false), version(false) {} + bool schema :1; + bool version :1; +} _SchemaVersionDescriptor__isset; + +class SchemaVersionDescriptor : public virtual ::apache::thrift::TBase { + public: + + SchemaVersionDescriptor(const SchemaVersionDescriptor&); + SchemaVersionDescriptor& operator=(const SchemaVersionDescriptor&); + SchemaVersionDescriptor() noexcept; + + virtual ~SchemaVersionDescriptor() noexcept; + ISchemaName schema; + int32_t version; + + _SchemaVersionDescriptor__isset __isset; + + void __set_schema(const ISchemaName& val); + + void __set_version(const int32_t val); + + bool operator == (const SchemaVersionDescriptor & rhs) const; + bool operator != (const SchemaVersionDescriptor &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SchemaVersionDescriptor & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SchemaVersionDescriptor &a, SchemaVersionDescriptor &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SchemaVersionDescriptor& obj); + +typedef struct _FindSchemasByColsRqst__isset { + _FindSchemasByColsRqst__isset() : colName(false), colNamespace(false), type(false) {} + bool colName :1; + bool colNamespace :1; + bool type :1; +} _FindSchemasByColsRqst__isset; + +class FindSchemasByColsRqst : public virtual ::apache::thrift::TBase { + public: + + FindSchemasByColsRqst(const FindSchemasByColsRqst&); + FindSchemasByColsRqst& operator=(const FindSchemasByColsRqst&); + FindSchemasByColsRqst() noexcept; + + virtual ~FindSchemasByColsRqst() noexcept; + std::string colName; + std::string colNamespace; + std::string type; + + _FindSchemasByColsRqst__isset __isset; + + void __set_colName(const std::string& val); + + void __set_colNamespace(const std::string& val); + + void __set_type(const std::string& val); + + bool operator == (const FindSchemasByColsRqst & rhs) const; + bool operator != (const FindSchemasByColsRqst &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FindSchemasByColsRqst & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FindSchemasByColsRqst &a, FindSchemasByColsRqst &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FindSchemasByColsRqst& obj); + +typedef struct _FindSchemasByColsResp__isset { + _FindSchemasByColsResp__isset() : schemaVersions(false) {} + bool schemaVersions :1; +} _FindSchemasByColsResp__isset; + +class FindSchemasByColsResp : public virtual ::apache::thrift::TBase { + public: + + FindSchemasByColsResp(const FindSchemasByColsResp&); + FindSchemasByColsResp& operator=(const FindSchemasByColsResp&); + FindSchemasByColsResp() noexcept; + + virtual ~FindSchemasByColsResp() noexcept; + std::vector schemaVersions; + + _FindSchemasByColsResp__isset __isset; + + void __set_schemaVersions(const std::vector & val); + + bool operator == (const FindSchemasByColsResp & rhs) const; + bool operator != (const FindSchemasByColsResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const FindSchemasByColsResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(FindSchemasByColsResp &a, FindSchemasByColsResp &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const FindSchemasByColsResp& obj); + +typedef struct _MapSchemaVersionToSerdeRequest__isset { + _MapSchemaVersionToSerdeRequest__isset() : schemaVersion(false), serdeName(false) {} + bool schemaVersion :1; + bool serdeName :1; +} _MapSchemaVersionToSerdeRequest__isset; + +class MapSchemaVersionToSerdeRequest : public virtual ::apache::thrift::TBase { + public: + + MapSchemaVersionToSerdeRequest(const MapSchemaVersionToSerdeRequest&); + MapSchemaVersionToSerdeRequest& operator=(const MapSchemaVersionToSerdeRequest&); + MapSchemaVersionToSerdeRequest() noexcept; + + virtual ~MapSchemaVersionToSerdeRequest() noexcept; + SchemaVersionDescriptor schemaVersion; + std::string serdeName; + + _MapSchemaVersionToSerdeRequest__isset __isset; + + void __set_schemaVersion(const SchemaVersionDescriptor& val); + + void __set_serdeName(const std::string& val); + + bool operator == (const MapSchemaVersionToSerdeRequest & rhs) const; + bool operator != (const MapSchemaVersionToSerdeRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const MapSchemaVersionToSerdeRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(MapSchemaVersionToSerdeRequest &a, MapSchemaVersionToSerdeRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const MapSchemaVersionToSerdeRequest& obj); + +typedef struct _SetSchemaVersionStateRequest__isset { + _SetSchemaVersionStateRequest__isset() : schemaVersion(false), state(false) {} + bool schemaVersion :1; + bool state :1; +} _SetSchemaVersionStateRequest__isset; + +class SetSchemaVersionStateRequest : public virtual ::apache::thrift::TBase { + public: + + SetSchemaVersionStateRequest(const SetSchemaVersionStateRequest&); + SetSchemaVersionStateRequest& operator=(const SetSchemaVersionStateRequest&); + SetSchemaVersionStateRequest() noexcept; + + virtual ~SetSchemaVersionStateRequest() noexcept; + SchemaVersionDescriptor schemaVersion; + /** + * + * @see SchemaVersionState + */ + SchemaVersionState::type state; + + _SetSchemaVersionStateRequest__isset __isset; + + void __set_schemaVersion(const SchemaVersionDescriptor& val); + + void __set_state(const SchemaVersionState::type val); + + bool operator == (const SetSchemaVersionStateRequest & rhs) const; + bool operator != (const SetSchemaVersionStateRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SetSchemaVersionStateRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(SetSchemaVersionStateRequest &a, SetSchemaVersionStateRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const SetSchemaVersionStateRequest& obj); + +typedef struct _GetSerdeRequest__isset { + _GetSerdeRequest__isset() : serdeName(false) {} + bool serdeName :1; +} _GetSerdeRequest__isset; + +class GetSerdeRequest : public virtual ::apache::thrift::TBase { + public: + + GetSerdeRequest(const GetSerdeRequest&); + GetSerdeRequest& operator=(const GetSerdeRequest&); + GetSerdeRequest() noexcept; + + virtual ~GetSerdeRequest() noexcept; + std::string serdeName; + + _GetSerdeRequest__isset __isset; + + void __set_serdeName(const std::string& val); + + bool operator == (const GetSerdeRequest & rhs) const; + bool operator != (const GetSerdeRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetSerdeRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetSerdeRequest &a, GetSerdeRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetSerdeRequest& obj); + +typedef struct _RuntimeStat__isset { + _RuntimeStat__isset() : createTime(false) {} + bool createTime :1; +} _RuntimeStat__isset; + +class RuntimeStat : public virtual ::apache::thrift::TBase { + public: + + RuntimeStat(const RuntimeStat&); + RuntimeStat& operator=(const RuntimeStat&); + RuntimeStat() noexcept; + + virtual ~RuntimeStat() noexcept; + int32_t createTime; + int32_t weight; + std::string payload; + + _RuntimeStat__isset __isset; + + void __set_createTime(const int32_t val); + + void __set_weight(const int32_t val); + + void __set_payload(const std::string& val); + + bool operator == (const RuntimeStat & rhs) const; + bool operator != (const RuntimeStat &rhs) const { + return !(*this == rhs); + } + + bool operator < (const RuntimeStat & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(RuntimeStat &a, RuntimeStat &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const RuntimeStat& obj); + + +class GetRuntimeStatsRequest : public virtual ::apache::thrift::TBase { + public: + + GetRuntimeStatsRequest(const GetRuntimeStatsRequest&) noexcept; + GetRuntimeStatsRequest& operator=(const GetRuntimeStatsRequest&) noexcept; + GetRuntimeStatsRequest() noexcept; + + virtual ~GetRuntimeStatsRequest() noexcept; + int32_t maxWeight; + int32_t maxCreateTime; + + void __set_maxWeight(const int32_t val); + + void __set_maxCreateTime(const int32_t val); + + bool operator == (const GetRuntimeStatsRequest & rhs) const; + bool operator != (const GetRuntimeStatsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetRuntimeStatsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetRuntimeStatsRequest &a, GetRuntimeStatsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetRuntimeStatsRequest& obj); + +typedef struct _CreateTableRequest__isset { + _CreateTableRequest__isset() : envContext(false), primaryKeys(false), foreignKeys(false), uniqueConstraints(false), notNullConstraints(false), defaultConstraints(false), checkConstraints(false), processorCapabilities(false), processorIdentifier(false) {} + bool envContext :1; + bool primaryKeys :1; + bool foreignKeys :1; + bool uniqueConstraints :1; + bool notNullConstraints :1; + bool defaultConstraints :1; + bool checkConstraints :1; + bool processorCapabilities :1; + bool processorIdentifier :1; +} _CreateTableRequest__isset; + +class CreateTableRequest : public virtual ::apache::thrift::TBase { + public: + + CreateTableRequest(const CreateTableRequest&); + CreateTableRequest& operator=(const CreateTableRequest&); + CreateTableRequest() noexcept; + + virtual ~CreateTableRequest() noexcept; + Table table; + EnvironmentContext envContext; + std::vector primaryKeys; + std::vector foreignKeys; + std::vector uniqueConstraints; + std::vector notNullConstraints; + std::vector defaultConstraints; + std::vector checkConstraints; + std::vector processorCapabilities; + std::string processorIdentifier; + + _CreateTableRequest__isset __isset; + + void __set_table(const Table& val); + + void __set_envContext(const EnvironmentContext& val); + + void __set_primaryKeys(const std::vector & val); + + void __set_foreignKeys(const std::vector & val); + + void __set_uniqueConstraints(const std::vector & val); + + void __set_notNullConstraints(const std::vector & val); + + void __set_defaultConstraints(const std::vector & val); + + void __set_checkConstraints(const std::vector & val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + bool operator == (const CreateTableRequest & rhs) const; + bool operator != (const CreateTableRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CreateTableRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CreateTableRequest &a, CreateTableRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CreateTableRequest& obj); + +typedef struct _CreateDatabaseRequest__isset { + _CreateDatabaseRequest__isset() : description(false), locationUri(false), parameters(false), privileges(false), ownerName(false), ownerType(false), catalogName(false), createTime(false), managedLocationUri(false), type(false), dataConnectorName(false), remote_dbname(false) {} + bool description :1; + bool locationUri :1; + bool parameters :1; + bool privileges :1; + bool ownerName :1; + bool ownerType :1; + bool catalogName :1; + bool createTime :1; + bool managedLocationUri :1; + bool type :1; + bool dataConnectorName :1; + bool remote_dbname :1; +} _CreateDatabaseRequest__isset; + +class CreateDatabaseRequest : public virtual ::apache::thrift::TBase { + public: + + CreateDatabaseRequest(const CreateDatabaseRequest&); + CreateDatabaseRequest& operator=(const CreateDatabaseRequest&); + CreateDatabaseRequest() noexcept; + + virtual ~CreateDatabaseRequest() noexcept; + std::string databaseName; + std::string description; + std::string locationUri; + std::map parameters; + PrincipalPrivilegeSet privileges; + std::string ownerName; + /** + * + * @see PrincipalType + */ + PrincipalType::type ownerType; + std::string catalogName; + int32_t createTime; + std::string managedLocationUri; + /** + * + * @see DatabaseType + */ + DatabaseType::type type; + std::string dataConnectorName; + std::string remote_dbname; + + _CreateDatabaseRequest__isset __isset; + + void __set_databaseName(const std::string& val); + + void __set_description(const std::string& val); + + void __set_locationUri(const std::string& val); + + void __set_parameters(const std::map & val); + + void __set_privileges(const PrincipalPrivilegeSet& val); + + void __set_ownerName(const std::string& val); + + void __set_ownerType(const PrincipalType::type val); + + void __set_catalogName(const std::string& val); + + void __set_createTime(const int32_t val); + + void __set_managedLocationUri(const std::string& val); + + void __set_type(const DatabaseType::type val); + + void __set_dataConnectorName(const std::string& val); + + void __set_remote_dbname(const std::string& val); + + bool operator == (const CreateDatabaseRequest & rhs) const; + bool operator != (const CreateDatabaseRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CreateDatabaseRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CreateDatabaseRequest &a, CreateDatabaseRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CreateDatabaseRequest& obj); + + +class CreateDataConnectorRequest : public virtual ::apache::thrift::TBase { + public: + + CreateDataConnectorRequest(const CreateDataConnectorRequest&); + CreateDataConnectorRequest& operator=(const CreateDataConnectorRequest&); + CreateDataConnectorRequest() noexcept; + + virtual ~CreateDataConnectorRequest() noexcept; + DataConnector connector; + + void __set_connector(const DataConnector& val); + + bool operator == (const CreateDataConnectorRequest & rhs) const; + bool operator != (const CreateDataConnectorRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CreateDataConnectorRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(CreateDataConnectorRequest &a, CreateDataConnectorRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CreateDataConnectorRequest& obj); + + +class GetDataConnectorRequest : public virtual ::apache::thrift::TBase { + public: + + GetDataConnectorRequest(const GetDataConnectorRequest&); + GetDataConnectorRequest& operator=(const GetDataConnectorRequest&); + GetDataConnectorRequest() noexcept; + + virtual ~GetDataConnectorRequest() noexcept; + std::string connectorName; + + void __set_connectorName(const std::string& val); + + bool operator == (const GetDataConnectorRequest & rhs) const; + bool operator != (const GetDataConnectorRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetDataConnectorRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetDataConnectorRequest &a, GetDataConnectorRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetDataConnectorRequest& obj); + + +class AlterDataConnectorRequest : public virtual ::apache::thrift::TBase { + public: + + AlterDataConnectorRequest(const AlterDataConnectorRequest&); + AlterDataConnectorRequest& operator=(const AlterDataConnectorRequest&); + AlterDataConnectorRequest() noexcept; + + virtual ~AlterDataConnectorRequest() noexcept; + std::string connectorName; + DataConnector newConnector; + + void __set_connectorName(const std::string& val); + + void __set_newConnector(const DataConnector& val); + + bool operator == (const AlterDataConnectorRequest & rhs) const; + bool operator != (const AlterDataConnectorRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterDataConnectorRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterDataConnectorRequest &a, AlterDataConnectorRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterDataConnectorRequest& obj); + +typedef struct _DropDataConnectorRequest__isset { + _DropDataConnectorRequest__isset() : ifNotExists(false), checkReferences(false) {} + bool ifNotExists :1; + bool checkReferences :1; +} _DropDataConnectorRequest__isset; + +class DropDataConnectorRequest : public virtual ::apache::thrift::TBase { + public: + + DropDataConnectorRequest(const DropDataConnectorRequest&); + DropDataConnectorRequest& operator=(const DropDataConnectorRequest&); + DropDataConnectorRequest() noexcept; + + virtual ~DropDataConnectorRequest() noexcept; + std::string connectorName; + bool ifNotExists; + bool checkReferences; + + _DropDataConnectorRequest__isset __isset; + + void __set_connectorName(const std::string& val); + + void __set_ifNotExists(const bool val); + + void __set_checkReferences(const bool val); + + bool operator == (const DropDataConnectorRequest & rhs) const; + bool operator != (const DropDataConnectorRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropDataConnectorRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropDataConnectorRequest &a, DropDataConnectorRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropDataConnectorRequest& obj); + + +class ScheduledQueryPollRequest : public virtual ::apache::thrift::TBase { + public: + + ScheduledQueryPollRequest(const ScheduledQueryPollRequest&); + ScheduledQueryPollRequest& operator=(const ScheduledQueryPollRequest&); + ScheduledQueryPollRequest() noexcept; + + virtual ~ScheduledQueryPollRequest() noexcept; + std::string clusterNamespace; + + void __set_clusterNamespace(const std::string& val); + + bool operator == (const ScheduledQueryPollRequest & rhs) const; + bool operator != (const ScheduledQueryPollRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQueryPollRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQueryPollRequest &a, ScheduledQueryPollRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryPollRequest& obj); + + +class ScheduledQueryKey : public virtual ::apache::thrift::TBase { + public: + + ScheduledQueryKey(const ScheduledQueryKey&); + ScheduledQueryKey& operator=(const ScheduledQueryKey&); + ScheduledQueryKey() noexcept; + + virtual ~ScheduledQueryKey() noexcept; + std::string scheduleName; + std::string clusterNamespace; + + void __set_scheduleName(const std::string& val); + + void __set_clusterNamespace(const std::string& val); + + bool operator == (const ScheduledQueryKey & rhs) const; + bool operator != (const ScheduledQueryKey &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQueryKey & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQueryKey &a, ScheduledQueryKey &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryKey& obj); + +typedef struct _ScheduledQueryPollResponse__isset { + _ScheduledQueryPollResponse__isset() : scheduleKey(false), executionId(false), query(false), user(false) {} + bool scheduleKey :1; + bool executionId :1; + bool query :1; + bool user :1; +} _ScheduledQueryPollResponse__isset; + +class ScheduledQueryPollResponse : public virtual ::apache::thrift::TBase { + public: + + ScheduledQueryPollResponse(const ScheduledQueryPollResponse&); + ScheduledQueryPollResponse& operator=(const ScheduledQueryPollResponse&); + ScheduledQueryPollResponse() noexcept; + + virtual ~ScheduledQueryPollResponse() noexcept; + ScheduledQueryKey scheduleKey; + int64_t executionId; + std::string query; + std::string user; + + _ScheduledQueryPollResponse__isset __isset; + + void __set_scheduleKey(const ScheduledQueryKey& val); + + void __set_executionId(const int64_t val); + + void __set_query(const std::string& val); + + void __set_user(const std::string& val); + + bool operator == (const ScheduledQueryPollResponse & rhs) const; + bool operator != (const ScheduledQueryPollResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQueryPollResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQueryPollResponse &a, ScheduledQueryPollResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryPollResponse& obj); + +typedef struct _ScheduledQuery__isset { + _ScheduledQuery__isset() : enabled(false), schedule(false), user(false), query(false), nextExecution(false) {} + bool enabled :1; + bool schedule :1; + bool user :1; + bool query :1; + bool nextExecution :1; +} _ScheduledQuery__isset; + +class ScheduledQuery : public virtual ::apache::thrift::TBase { + public: + + ScheduledQuery(const ScheduledQuery&); + ScheduledQuery& operator=(const ScheduledQuery&); + ScheduledQuery() noexcept; + + virtual ~ScheduledQuery() noexcept; + ScheduledQueryKey scheduleKey; + bool enabled; + std::string schedule; + std::string user; + std::string query; + int32_t nextExecution; + + _ScheduledQuery__isset __isset; + + void __set_scheduleKey(const ScheduledQueryKey& val); + + void __set_enabled(const bool val); + + void __set_schedule(const std::string& val); + + void __set_user(const std::string& val); + + void __set_query(const std::string& val); + + void __set_nextExecution(const int32_t val); + + bool operator == (const ScheduledQuery & rhs) const; + bool operator != (const ScheduledQuery &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQuery & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQuery &a, ScheduledQuery &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQuery& obj); + + +class ScheduledQueryMaintenanceRequest : public virtual ::apache::thrift::TBase { + public: + + ScheduledQueryMaintenanceRequest(const ScheduledQueryMaintenanceRequest&); + ScheduledQueryMaintenanceRequest& operator=(const ScheduledQueryMaintenanceRequest&); + ScheduledQueryMaintenanceRequest() noexcept; + + virtual ~ScheduledQueryMaintenanceRequest() noexcept; + /** + * + * @see ScheduledQueryMaintenanceRequestType + */ + ScheduledQueryMaintenanceRequestType::type type; + ScheduledQuery scheduledQuery; + + void __set_type(const ScheduledQueryMaintenanceRequestType::type val); + + void __set_scheduledQuery(const ScheduledQuery& val); + + bool operator == (const ScheduledQueryMaintenanceRequest & rhs) const; + bool operator != (const ScheduledQueryMaintenanceRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQueryMaintenanceRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQueryMaintenanceRequest &a, ScheduledQueryMaintenanceRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryMaintenanceRequest& obj); + +typedef struct _ScheduledQueryProgressInfo__isset { + _ScheduledQueryProgressInfo__isset() : errorMessage(false) {} + bool errorMessage :1; +} _ScheduledQueryProgressInfo__isset; + +class ScheduledQueryProgressInfo : public virtual ::apache::thrift::TBase { + public: + + ScheduledQueryProgressInfo(const ScheduledQueryProgressInfo&); + ScheduledQueryProgressInfo& operator=(const ScheduledQueryProgressInfo&); + ScheduledQueryProgressInfo() noexcept; + + virtual ~ScheduledQueryProgressInfo() noexcept; + int64_t scheduledExecutionId; + /** + * + * @see QueryState + */ + QueryState::type state; + std::string executorQueryId; + std::string errorMessage; + + _ScheduledQueryProgressInfo__isset __isset; + + void __set_scheduledExecutionId(const int64_t val); + + void __set_state(const QueryState::type val); + + void __set_executorQueryId(const std::string& val); + + void __set_errorMessage(const std::string& val); + + bool operator == (const ScheduledQueryProgressInfo & rhs) const; + bool operator != (const ScheduledQueryProgressInfo &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ScheduledQueryProgressInfo & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ScheduledQueryProgressInfo &a, ScheduledQueryProgressInfo &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ScheduledQueryProgressInfo& obj); + +typedef struct _AlterPartitionsRequest__isset { + _AlterPartitionsRequest__isset() : catName(false), environmentContext(false), writeId(true), validWriteIdList(false), skipColumnSchemaForPartition(false), partitionColSchema(false) {} + bool catName :1; + bool environmentContext :1; + bool writeId :1; + bool validWriteIdList :1; + bool skipColumnSchemaForPartition :1; + bool partitionColSchema :1; +} _AlterPartitionsRequest__isset; + +class AlterPartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + AlterPartitionsRequest(const AlterPartitionsRequest&); + AlterPartitionsRequest& operator=(const AlterPartitionsRequest&); + AlterPartitionsRequest() noexcept; + + virtual ~AlterPartitionsRequest() noexcept; + std::string catName; + std::string dbName; + std::string tableName; + std::vector partitions; + EnvironmentContext environmentContext; + int64_t writeId; + std::string validWriteIdList; + bool skipColumnSchemaForPartition; + std::vector partitionColSchema; + + _AlterPartitionsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partitions(const std::vector & val); + + void __set_environmentContext(const EnvironmentContext& val); + + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_partitionColSchema(const std::vector & val); + + bool operator == (const AlterPartitionsRequest & rhs) const; + bool operator != (const AlterPartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterPartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterPartitionsRequest &a, AlterPartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterPartitionsRequest& obj); + +typedef struct _AppendPartitionsRequest__isset { + _AppendPartitionsRequest__isset() : catalogName(false), name(false), partVals(false), environmentContext(false) {} + bool catalogName :1; + bool name :1; + bool partVals :1; + bool environmentContext :1; +} _AppendPartitionsRequest__isset; + +class AppendPartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + AppendPartitionsRequest(const AppendPartitionsRequest&); + AppendPartitionsRequest& operator=(const AppendPartitionsRequest&); + AppendPartitionsRequest() noexcept; + + virtual ~AppendPartitionsRequest() noexcept; + std::string catalogName; + std::string dbName; + std::string tableName; + std::string name; + std::vector partVals; + EnvironmentContext environmentContext; + + _AppendPartitionsRequest__isset __isset; + + void __set_catalogName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_name(const std::string& val); + + void __set_partVals(const std::vector & val); + + void __set_environmentContext(const EnvironmentContext& val); + + bool operator == (const AppendPartitionsRequest & rhs) const; + bool operator != (const AppendPartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AppendPartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AppendPartitionsRequest &a, AppendPartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AppendPartitionsRequest& obj); + + +class AlterPartitionsResponse : public virtual ::apache::thrift::TBase { + public: + + AlterPartitionsResponse(const AlterPartitionsResponse&) noexcept; + AlterPartitionsResponse& operator=(const AlterPartitionsResponse&) noexcept; + AlterPartitionsResponse() noexcept; + + virtual ~AlterPartitionsResponse() noexcept; + + bool operator == (const AlterPartitionsResponse & /* rhs */) const; + bool operator != (const AlterPartitionsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterPartitionsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterPartitionsResponse &a, AlterPartitionsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterPartitionsResponse& obj); + +typedef struct _RenamePartitionRequest__isset { + _RenamePartitionRequest__isset() : catName(false), validWriteIdList(false), txnId(false), clonePart(false) {} + bool catName :1; + bool validWriteIdList :1; + bool txnId :1; + bool clonePart :1; +} _RenamePartitionRequest__isset; + +class RenamePartitionRequest : public virtual ::apache::thrift::TBase { + public: + + RenamePartitionRequest(const RenamePartitionRequest&); + RenamePartitionRequest& operator=(const RenamePartitionRequest&); + RenamePartitionRequest() noexcept; + + virtual ~RenamePartitionRequest() noexcept; + std::string catName; + std::string dbName; + std::string tableName; + std::vector partVals; + Partition newPart; + std::string validWriteIdList; + int64_t txnId; + bool clonePart; + + _RenamePartitionRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_partVals(const std::vector & val); + + void __set_newPart(const Partition& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_txnId(const int64_t val); + + void __set_clonePart(const bool val); + + bool operator == (const RenamePartitionRequest & rhs) const; + bool operator != (const RenamePartitionRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const RenamePartitionRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(RenamePartitionRequest &a, RenamePartitionRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const RenamePartitionRequest& obj); + + +class RenamePartitionResponse : public virtual ::apache::thrift::TBase { + public: + + RenamePartitionResponse(const RenamePartitionResponse&) noexcept; + RenamePartitionResponse& operator=(const RenamePartitionResponse&) noexcept; + RenamePartitionResponse() noexcept; + + virtual ~RenamePartitionResponse() noexcept; + + bool operator == (const RenamePartitionResponse & /* rhs */) const; + bool operator != (const RenamePartitionResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const RenamePartitionResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(RenamePartitionResponse &a, RenamePartitionResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const RenamePartitionResponse& obj); + +typedef struct _AlterTableRequest__isset { + _AlterTableRequest__isset() : catName(false), environmentContext(false), writeId(true), validWriteIdList(false), processorCapabilities(false), processorIdentifier(false), expectedParameterKey(false), expectedParameterValue(false) {} + bool catName :1; + bool environmentContext :1; + bool writeId :1; + bool validWriteIdList :1; + bool processorCapabilities :1; + bool processorIdentifier :1; + bool expectedParameterKey :1; + bool expectedParameterValue :1; +} _AlterTableRequest__isset; + +class AlterTableRequest : public virtual ::apache::thrift::TBase { + public: + + AlterTableRequest(const AlterTableRequest&); + AlterTableRequest& operator=(const AlterTableRequest&); + AlterTableRequest() noexcept; + + virtual ~AlterTableRequest() noexcept; + std::string catName; + std::string dbName; + std::string tableName; + Table table; + EnvironmentContext environmentContext; + int64_t writeId; + std::string validWriteIdList; + std::vector processorCapabilities; + std::string processorIdentifier; + std::string expectedParameterKey; + std::string expectedParameterValue; + + _AlterTableRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + void __set_table(const Table& val); + + void __set_environmentContext(const EnvironmentContext& val); + + void __set_writeId(const int64_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + void __set_expectedParameterKey(const std::string& val); + + void __set_expectedParameterValue(const std::string& val); + + bool operator == (const AlterTableRequest & rhs) const; + bool operator != (const AlterTableRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterTableRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterTableRequest &a, AlterTableRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterTableRequest& obj); + + +class AlterTableResponse : public virtual ::apache::thrift::TBase { + public: + + AlterTableResponse(const AlterTableResponse&) noexcept; + AlterTableResponse& operator=(const AlterTableResponse&) noexcept; + AlterTableResponse() noexcept; + + virtual ~AlterTableResponse() noexcept; + + bool operator == (const AlterTableResponse & /* rhs */) const; + bool operator != (const AlterTableResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlterTableResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AlterTableResponse &a, AlterTableResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlterTableResponse& obj); + +typedef struct _GetPartitionsFilterSpec__isset { + _GetPartitionsFilterSpec__isset() : filterMode(false), filters(false) {} + bool filterMode :1; + bool filters :1; +} _GetPartitionsFilterSpec__isset; + +class GetPartitionsFilterSpec : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsFilterSpec(const GetPartitionsFilterSpec&); + GetPartitionsFilterSpec& operator=(const GetPartitionsFilterSpec&); + GetPartitionsFilterSpec() noexcept; + + virtual ~GetPartitionsFilterSpec() noexcept; + /** + * + * @see PartitionFilterMode + */ + PartitionFilterMode::type filterMode; + std::vector filters; + + _GetPartitionsFilterSpec__isset __isset; + + void __set_filterMode(const PartitionFilterMode::type val); + + void __set_filters(const std::vector & val); + + bool operator == (const GetPartitionsFilterSpec & rhs) const; + bool operator != (const GetPartitionsFilterSpec &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsFilterSpec & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsFilterSpec &a, GetPartitionsFilterSpec &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsFilterSpec& obj); + +typedef struct _GetPartitionsResponse__isset { + _GetPartitionsResponse__isset() : partitionSpec(false) {} + bool partitionSpec :1; +} _GetPartitionsResponse__isset; + +class GetPartitionsResponse : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsResponse(const GetPartitionsResponse&); + GetPartitionsResponse& operator=(const GetPartitionsResponse&); + GetPartitionsResponse() noexcept; + + virtual ~GetPartitionsResponse() noexcept; + std::vector partitionSpec; + + _GetPartitionsResponse__isset __isset; + + void __set_partitionSpec(const std::vector & val); + + bool operator == (const GetPartitionsResponse & rhs) const; + bool operator != (const GetPartitionsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsResponse &a, GetPartitionsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsResponse& obj); + +typedef struct _GetPartitionsRequest__isset { + _GetPartitionsRequest__isset() : catName(false), dbName(false), tblName(false), withAuth(false), user(false), groupNames(false), projectionSpec(false), filterSpec(false), processorCapabilities(false), processorIdentifier(false), validWriteIdList(false) {} + bool catName :1; + bool dbName :1; + bool tblName :1; + bool withAuth :1; + bool user :1; + bool groupNames :1; + bool projectionSpec :1; + bool filterSpec :1; + bool processorCapabilities :1; + bool processorIdentifier :1; + bool validWriteIdList :1; +} _GetPartitionsRequest__isset; + +class GetPartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsRequest(const GetPartitionsRequest&); + GetPartitionsRequest& operator=(const GetPartitionsRequest&); + GetPartitionsRequest() noexcept; + + virtual ~GetPartitionsRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + bool withAuth; + std::string user; + std::vector groupNames; + GetProjectionsSpec projectionSpec; + GetPartitionsFilterSpec filterSpec; + std::vector processorCapabilities; + std::string processorIdentifier; + std::string validWriteIdList; + + _GetPartitionsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_withAuth(const bool val); + + void __set_user(const std::string& val); + + void __set_groupNames(const std::vector & val); + + void __set_projectionSpec(const GetProjectionsSpec& val); + + void __set_filterSpec(const GetPartitionsFilterSpec& val); + + void __set_processorCapabilities(const std::vector & val); + + void __set_processorIdentifier(const std::string& val); + + void __set_validWriteIdList(const std::string& val); + + bool operator == (const GetPartitionsRequest & rhs) const; + bool operator != (const GetPartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsRequest &a, GetPartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsRequest& obj); + +typedef struct _GetFieldsRequest__isset { + _GetFieldsRequest__isset() : catName(false), envContext(false), validWriteIdList(false), id(true) {} + bool catName :1; + bool envContext :1; + bool validWriteIdList :1; + bool id :1; +} _GetFieldsRequest__isset; + +class GetFieldsRequest : public virtual ::apache::thrift::TBase { + public: + + GetFieldsRequest(const GetFieldsRequest&); + GetFieldsRequest& operator=(const GetFieldsRequest&); + GetFieldsRequest() noexcept; + + virtual ~GetFieldsRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + EnvironmentContext envContext; + std::string validWriteIdList; + int64_t id; + + _GetFieldsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_envContext(const EnvironmentContext& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const GetFieldsRequest & rhs) const; + bool operator != (const GetFieldsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFieldsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFieldsRequest &a, GetFieldsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFieldsRequest& obj); + + +class GetFieldsResponse : public virtual ::apache::thrift::TBase { + public: + + GetFieldsResponse(const GetFieldsResponse&); + GetFieldsResponse& operator=(const GetFieldsResponse&); + GetFieldsResponse() noexcept; + + virtual ~GetFieldsResponse() noexcept; + std::vector fields; + + void __set_fields(const std::vector & val); + + bool operator == (const GetFieldsResponse & rhs) const; + bool operator != (const GetFieldsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetFieldsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetFieldsResponse &a, GetFieldsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetFieldsResponse& obj); + +typedef struct _GetSchemaRequest__isset { + _GetSchemaRequest__isset() : catName(false), envContext(false), validWriteIdList(false), id(true) {} + bool catName :1; + bool envContext :1; + bool validWriteIdList :1; + bool id :1; +} _GetSchemaRequest__isset; + +class GetSchemaRequest : public virtual ::apache::thrift::TBase { + public: + + GetSchemaRequest(const GetSchemaRequest&); + GetSchemaRequest& operator=(const GetSchemaRequest&); + GetSchemaRequest() noexcept; + + virtual ~GetSchemaRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + EnvironmentContext envContext; + std::string validWriteIdList; + int64_t id; + + _GetSchemaRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_envContext(const EnvironmentContext& val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const GetSchemaRequest & rhs) const; + bool operator != (const GetSchemaRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetSchemaRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetSchemaRequest &a, GetSchemaRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetSchemaRequest& obj); + + +class GetSchemaResponse : public virtual ::apache::thrift::TBase { + public: + + GetSchemaResponse(const GetSchemaResponse&); + GetSchemaResponse& operator=(const GetSchemaResponse&); + GetSchemaResponse() noexcept; + + virtual ~GetSchemaResponse() noexcept; + std::vector fields; + + void __set_fields(const std::vector & val); + + bool operator == (const GetSchemaResponse & rhs) const; + bool operator != (const GetSchemaResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetSchemaResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetSchemaResponse &a, GetSchemaResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetSchemaResponse& obj); + +typedef struct _GetPartitionRequest__isset { + _GetPartitionRequest__isset() : catName(false), validWriteIdList(false), id(true) {} + bool catName :1; + bool validWriteIdList :1; + bool id :1; +} _GetPartitionRequest__isset; + +class GetPartitionRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionRequest(const GetPartitionRequest&); + GetPartitionRequest& operator=(const GetPartitionRequest&); + GetPartitionRequest() noexcept; + + virtual ~GetPartitionRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::vector partVals; + std::string validWriteIdList; + int64_t id; + + _GetPartitionRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partVals(const std::vector & val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const GetPartitionRequest & rhs) const; + bool operator != (const GetPartitionRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionRequest &a, GetPartitionRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionRequest& obj); + + +class GetPartitionResponse : public virtual ::apache::thrift::TBase { + public: + + GetPartitionResponse(const GetPartitionResponse&); + GetPartitionResponse& operator=(const GetPartitionResponse&); + GetPartitionResponse() noexcept; + + virtual ~GetPartitionResponse() noexcept; + Partition partition; + + void __set_partition(const Partition& val); + + bool operator == (const GetPartitionResponse & rhs) const; + bool operator != (const GetPartitionResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionResponse &a, GetPartitionResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionResponse& obj); + +typedef struct _PartitionsRequest__isset { + _PartitionsRequest__isset() : catName(false), maxParts(true), validWriteIdList(false), id(true), skipColumnSchemaForPartition(false), includeParamKeyPattern(false), excludeParamKeyPattern(false) {} + bool catName :1; + bool maxParts :1; + bool validWriteIdList :1; + bool id :1; + bool skipColumnSchemaForPartition :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; +} _PartitionsRequest__isset; + +class PartitionsRequest : public virtual ::apache::thrift::TBase { + public: + + PartitionsRequest(const PartitionsRequest&); + PartitionsRequest& operator=(const PartitionsRequest&); + PartitionsRequest() noexcept; + + virtual ~PartitionsRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + int16_t maxParts; + std::string validWriteIdList; + int64_t id; + bool skipColumnSchemaForPartition; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + + _PartitionsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_maxParts(const int16_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + bool operator == (const PartitionsRequest & rhs) const; + bool operator != (const PartitionsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsRequest &a, PartitionsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsRequest& obj); + + +class PartitionsResponse : public virtual ::apache::thrift::TBase { + public: + + PartitionsResponse(const PartitionsResponse&); + PartitionsResponse& operator=(const PartitionsResponse&); + PartitionsResponse() noexcept; + + virtual ~PartitionsResponse() noexcept; + std::vector partitions; + + void __set_partitions(const std::vector & val); + + bool operator == (const PartitionsResponse & rhs) const; + bool operator != (const PartitionsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const PartitionsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(PartitionsResponse &a, PartitionsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const PartitionsResponse& obj); + +typedef struct _GetPartitionsByFilterRequest__isset { + _GetPartitionsByFilterRequest__isset() : catName(false), dbName(false), tblName(false), filter(false), maxParts(true), skipColumnSchemaForPartition(false), includeParamKeyPattern(false), excludeParamKeyPattern(false) {} + bool catName :1; + bool dbName :1; + bool tblName :1; + bool filter :1; + bool maxParts :1; + bool skipColumnSchemaForPartition :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; +} _GetPartitionsByFilterRequest__isset; + +class GetPartitionsByFilterRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsByFilterRequest(const GetPartitionsByFilterRequest&); + GetPartitionsByFilterRequest& operator=(const GetPartitionsByFilterRequest&); + GetPartitionsByFilterRequest() noexcept; + + virtual ~GetPartitionsByFilterRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::string filter; + int16_t maxParts; + bool skipColumnSchemaForPartition; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + + _GetPartitionsByFilterRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_filter(const std::string& val); + + void __set_maxParts(const int16_t val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + bool operator == (const GetPartitionsByFilterRequest & rhs) const; + bool operator != (const GetPartitionsByFilterRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsByFilterRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsByFilterRequest &a, GetPartitionsByFilterRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsByFilterRequest& obj); + +typedef struct _GetPartitionNamesPsRequest__isset { + _GetPartitionNamesPsRequest__isset() : catName(false), partValues(false), maxParts(true), validWriteIdList(false), id(true) {} + bool catName :1; + bool partValues :1; + bool maxParts :1; + bool validWriteIdList :1; + bool id :1; +} _GetPartitionNamesPsRequest__isset; + +class GetPartitionNamesPsRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionNamesPsRequest(const GetPartitionNamesPsRequest&); + GetPartitionNamesPsRequest& operator=(const GetPartitionNamesPsRequest&); + GetPartitionNamesPsRequest() noexcept; + + virtual ~GetPartitionNamesPsRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::vector partValues; + int16_t maxParts; + std::string validWriteIdList; + int64_t id; + + _GetPartitionNamesPsRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partValues(const std::vector & val); + + void __set_maxParts(const int16_t val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + bool operator == (const GetPartitionNamesPsRequest & rhs) const; + bool operator != (const GetPartitionNamesPsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionNamesPsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionNamesPsRequest &a, GetPartitionNamesPsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionNamesPsRequest& obj); + + +class GetPartitionNamesPsResponse : public virtual ::apache::thrift::TBase { + public: + + GetPartitionNamesPsResponse(const GetPartitionNamesPsResponse&); + GetPartitionNamesPsResponse& operator=(const GetPartitionNamesPsResponse&); + GetPartitionNamesPsResponse() noexcept; + + virtual ~GetPartitionNamesPsResponse() noexcept; + std::vector names; + + void __set_names(const std::vector & val); + + bool operator == (const GetPartitionNamesPsResponse & rhs) const; + bool operator != (const GetPartitionNamesPsResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionNamesPsResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionNamesPsResponse &a, GetPartitionNamesPsResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionNamesPsResponse& obj); + +typedef struct _GetPartitionsPsWithAuthRequest__isset { + _GetPartitionsPsWithAuthRequest__isset() : catName(false), partVals(false), maxParts(true), userName(false), groupNames(false), validWriteIdList(false), id(true), skipColumnSchemaForPartition(false), includeParamKeyPattern(false), excludeParamKeyPattern(false), partNames(false) {} + bool catName :1; + bool partVals :1; + bool maxParts :1; + bool userName :1; + bool groupNames :1; + bool validWriteIdList :1; + bool id :1; + bool skipColumnSchemaForPartition :1; + bool includeParamKeyPattern :1; + bool excludeParamKeyPattern :1; + bool partNames :1; +} _GetPartitionsPsWithAuthRequest__isset; + +class GetPartitionsPsWithAuthRequest : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsPsWithAuthRequest(const GetPartitionsPsWithAuthRequest&); + GetPartitionsPsWithAuthRequest& operator=(const GetPartitionsPsWithAuthRequest&); + GetPartitionsPsWithAuthRequest() noexcept; + + virtual ~GetPartitionsPsWithAuthRequest() noexcept; + std::string catName; + std::string dbName; + std::string tblName; + std::vector partVals; + int16_t maxParts; + std::string userName; + std::vector groupNames; + std::string validWriteIdList; + int64_t id; + bool skipColumnSchemaForPartition; + std::string includeParamKeyPattern; + std::string excludeParamKeyPattern; + std::vector partNames; + + _GetPartitionsPsWithAuthRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_tblName(const std::string& val); + + void __set_partVals(const std::vector & val); + + void __set_maxParts(const int16_t val); + + void __set_userName(const std::string& val); + + void __set_groupNames(const std::vector & val); + + void __set_validWriteIdList(const std::string& val); + + void __set_id(const int64_t val); + + void __set_skipColumnSchemaForPartition(const bool val); + + void __set_includeParamKeyPattern(const std::string& val); + + void __set_excludeParamKeyPattern(const std::string& val); + + void __set_partNames(const std::vector & val); + + bool operator == (const GetPartitionsPsWithAuthRequest & rhs) const; + bool operator != (const GetPartitionsPsWithAuthRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsPsWithAuthRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsPsWithAuthRequest &a, GetPartitionsPsWithAuthRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsPsWithAuthRequest& obj); + + +class GetPartitionsPsWithAuthResponse : public virtual ::apache::thrift::TBase { + public: + + GetPartitionsPsWithAuthResponse(const GetPartitionsPsWithAuthResponse&); + GetPartitionsPsWithAuthResponse& operator=(const GetPartitionsPsWithAuthResponse&); + GetPartitionsPsWithAuthResponse() noexcept; + + virtual ~GetPartitionsPsWithAuthResponse() noexcept; + std::vector partitions; + + void __set_partitions(const std::vector & val); + + bool operator == (const GetPartitionsPsWithAuthResponse & rhs) const; + bool operator != (const GetPartitionsPsWithAuthResponse &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPartitionsPsWithAuthResponse & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPartitionsPsWithAuthResponse &a, GetPartitionsPsWithAuthResponse &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPartitionsPsWithAuthResponse& obj); + +typedef struct _ReplicationMetrics__isset { + _ReplicationMetrics__isset() : metadata(false), progress(false), messageFormat(false) {} + bool metadata :1; + bool progress :1; + bool messageFormat :1; +} _ReplicationMetrics__isset; + +class ReplicationMetrics : public virtual ::apache::thrift::TBase { + public: + + ReplicationMetrics(const ReplicationMetrics&); + ReplicationMetrics& operator=(const ReplicationMetrics&); + ReplicationMetrics() noexcept; + + virtual ~ReplicationMetrics() noexcept; + int64_t scheduledExecutionId; + std::string policy; + int64_t dumpExecutionId; + std::string metadata; + std::string progress; + std::string messageFormat; + + _ReplicationMetrics__isset __isset; + + void __set_scheduledExecutionId(const int64_t val); + + void __set_policy(const std::string& val); + + void __set_dumpExecutionId(const int64_t val); + + void __set_metadata(const std::string& val); + + void __set_progress(const std::string& val); + + void __set_messageFormat(const std::string& val); + + bool operator == (const ReplicationMetrics & rhs) const; + bool operator != (const ReplicationMetrics &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ReplicationMetrics & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ReplicationMetrics &a, ReplicationMetrics &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ReplicationMetrics& obj); + + +class ReplicationMetricList : public virtual ::apache::thrift::TBase { + public: + + ReplicationMetricList(const ReplicationMetricList&); + ReplicationMetricList& operator=(const ReplicationMetricList&); + ReplicationMetricList() noexcept; + + virtual ~ReplicationMetricList() noexcept; + std::vector replicationMetricList; + + void __set_replicationMetricList(const std::vector & val); + + bool operator == (const ReplicationMetricList & rhs) const; + bool operator != (const ReplicationMetricList &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ReplicationMetricList & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ReplicationMetricList &a, ReplicationMetricList &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ReplicationMetricList& obj); + +typedef struct _GetReplicationMetricsRequest__isset { + _GetReplicationMetricsRequest__isset() : scheduledExecutionId(false), policy(false), dumpExecutionId(false) {} + bool scheduledExecutionId :1; + bool policy :1; + bool dumpExecutionId :1; +} _GetReplicationMetricsRequest__isset; + +class GetReplicationMetricsRequest : public virtual ::apache::thrift::TBase { + public: + + GetReplicationMetricsRequest(const GetReplicationMetricsRequest&); + GetReplicationMetricsRequest& operator=(const GetReplicationMetricsRequest&); + GetReplicationMetricsRequest() noexcept; + + virtual ~GetReplicationMetricsRequest() noexcept; + int64_t scheduledExecutionId; + std::string policy; + int64_t dumpExecutionId; + + _GetReplicationMetricsRequest__isset __isset; + + void __set_scheduledExecutionId(const int64_t val); + + void __set_policy(const std::string& val); + + void __set_dumpExecutionId(const int64_t val); + + bool operator == (const GetReplicationMetricsRequest & rhs) const; + bool operator != (const GetReplicationMetricsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetReplicationMetricsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetReplicationMetricsRequest &a, GetReplicationMetricsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetReplicationMetricsRequest& obj); + +typedef struct _GetOpenTxnsRequest__isset { + _GetOpenTxnsRequest__isset() : excludeTxnTypes(false) {} + bool excludeTxnTypes :1; +} _GetOpenTxnsRequest__isset; + +class GetOpenTxnsRequest : public virtual ::apache::thrift::TBase { + public: + + GetOpenTxnsRequest(const GetOpenTxnsRequest&); + GetOpenTxnsRequest& operator=(const GetOpenTxnsRequest&); + GetOpenTxnsRequest() noexcept; + + virtual ~GetOpenTxnsRequest() noexcept; + std::vector excludeTxnTypes; + + _GetOpenTxnsRequest__isset __isset; + + void __set_excludeTxnTypes(const std::vector & val); + + bool operator == (const GetOpenTxnsRequest & rhs) const; + bool operator != (const GetOpenTxnsRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetOpenTxnsRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetOpenTxnsRequest &a, GetOpenTxnsRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetOpenTxnsRequest& obj); + + +class StoredProcedureRequest : public virtual ::apache::thrift::TBase { + public: + + StoredProcedureRequest(const StoredProcedureRequest&); + StoredProcedureRequest& operator=(const StoredProcedureRequest&); + StoredProcedureRequest() noexcept; + + virtual ~StoredProcedureRequest() noexcept; + std::string catName; + std::string dbName; + std::string procName; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_procName(const std::string& val); + + bool operator == (const StoredProcedureRequest & rhs) const; + bool operator != (const StoredProcedureRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const StoredProcedureRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(StoredProcedureRequest &a, StoredProcedureRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const StoredProcedureRequest& obj); + +typedef struct _ListStoredProcedureRequest__isset { + _ListStoredProcedureRequest__isset() : dbName(false) {} + bool dbName :1; +} _ListStoredProcedureRequest__isset; + +class ListStoredProcedureRequest : public virtual ::apache::thrift::TBase { + public: + + ListStoredProcedureRequest(const ListStoredProcedureRequest&); + ListStoredProcedureRequest& operator=(const ListStoredProcedureRequest&); + ListStoredProcedureRequest() noexcept; + + virtual ~ListStoredProcedureRequest() noexcept; + std::string catName; + std::string dbName; + + _ListStoredProcedureRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + bool operator == (const ListStoredProcedureRequest & rhs) const; + bool operator != (const ListStoredProcedureRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ListStoredProcedureRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ListStoredProcedureRequest &a, ListStoredProcedureRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ListStoredProcedureRequest& obj); + +typedef struct _StoredProcedure__isset { + _StoredProcedure__isset() : name(false), dbName(false), catName(false), ownerName(false), source(false) {} + bool name :1; + bool dbName :1; + bool catName :1; + bool ownerName :1; + bool source :1; +} _StoredProcedure__isset; + +class StoredProcedure : public virtual ::apache::thrift::TBase { + public: + + StoredProcedure(const StoredProcedure&); + StoredProcedure& operator=(const StoredProcedure&); + StoredProcedure() noexcept; + + virtual ~StoredProcedure() noexcept; + std::string name; + std::string dbName; + std::string catName; + std::string ownerName; + std::string source; + + _StoredProcedure__isset __isset; + + void __set_name(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_catName(const std::string& val); + + void __set_ownerName(const std::string& val); + + void __set_source(const std::string& val); + + bool operator == (const StoredProcedure & rhs) const; + bool operator != (const StoredProcedure &rhs) const { + return !(*this == rhs); + } + + bool operator < (const StoredProcedure & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(StoredProcedure &a, StoredProcedure &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const StoredProcedure& obj); + +typedef struct _AddPackageRequest__isset { + _AddPackageRequest__isset() : catName(false), dbName(false), packageName(false), ownerName(false), header(false), body(false) {} + bool catName :1; + bool dbName :1; + bool packageName :1; + bool ownerName :1; + bool header :1; + bool body :1; +} _AddPackageRequest__isset; + +class AddPackageRequest : public virtual ::apache::thrift::TBase { + public: + + AddPackageRequest(const AddPackageRequest&); + AddPackageRequest& operator=(const AddPackageRequest&); + AddPackageRequest() noexcept; + + virtual ~AddPackageRequest() noexcept; + std::string catName; + std::string dbName; + std::string packageName; + std::string ownerName; + std::string header; + std::string body; + + _AddPackageRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_packageName(const std::string& val); + + void __set_ownerName(const std::string& val); + + void __set_header(const std::string& val); + + void __set_body(const std::string& val); + + bool operator == (const AddPackageRequest & rhs) const; + bool operator != (const AddPackageRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AddPackageRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(AddPackageRequest &a, AddPackageRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AddPackageRequest& obj); + + +class GetPackageRequest : public virtual ::apache::thrift::TBase { + public: + + GetPackageRequest(const GetPackageRequest&); + GetPackageRequest& operator=(const GetPackageRequest&); + GetPackageRequest() noexcept; + + virtual ~GetPackageRequest() noexcept; + std::string catName; + std::string dbName; + std::string packageName; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_packageName(const std::string& val); + + bool operator == (const GetPackageRequest & rhs) const; + bool operator != (const GetPackageRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetPackageRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetPackageRequest &a, GetPackageRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetPackageRequest& obj); + + +class DropPackageRequest : public virtual ::apache::thrift::TBase { + public: + + DropPackageRequest(const DropPackageRequest&); + DropPackageRequest& operator=(const DropPackageRequest&); + DropPackageRequest() noexcept; + + virtual ~DropPackageRequest() noexcept; + std::string catName; + std::string dbName; + std::string packageName; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_packageName(const std::string& val); + + bool operator == (const DropPackageRequest & rhs) const; + bool operator != (const DropPackageRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const DropPackageRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(DropPackageRequest &a, DropPackageRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const DropPackageRequest& obj); + +typedef struct _ListPackageRequest__isset { + _ListPackageRequest__isset() : dbName(false) {} + bool dbName :1; +} _ListPackageRequest__isset; + +class ListPackageRequest : public virtual ::apache::thrift::TBase { + public: + + ListPackageRequest(const ListPackageRequest&); + ListPackageRequest& operator=(const ListPackageRequest&); + ListPackageRequest() noexcept; + + virtual ~ListPackageRequest() noexcept; + std::string catName; + std::string dbName; + + _ListPackageRequest__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + bool operator == (const ListPackageRequest & rhs) const; + bool operator != (const ListPackageRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ListPackageRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ListPackageRequest &a, ListPackageRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ListPackageRequest& obj); + +typedef struct _Package__isset { + _Package__isset() : catName(false), dbName(false), packageName(false), ownerName(false), header(false), body(false) {} + bool catName :1; + bool dbName :1; + bool packageName :1; + bool ownerName :1; + bool header :1; + bool body :1; +} _Package__isset; + +class Package : public virtual ::apache::thrift::TBase { + public: + + Package(const Package&); + Package& operator=(const Package&); + Package() noexcept; + + virtual ~Package() noexcept; + std::string catName; + std::string dbName; + std::string packageName; + std::string ownerName; + std::string header; + std::string body; + + _Package__isset __isset; + + void __set_catName(const std::string& val); + + void __set_dbName(const std::string& val); + + void __set_packageName(const std::string& val); + + void __set_ownerName(const std::string& val); + + void __set_header(const std::string& val); + + void __set_body(const std::string& val); + + bool operator == (const Package & rhs) const; + bool operator != (const Package &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Package & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Package &a, Package &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const Package& obj); + +typedef struct _GetAllWriteEventInfoRequest__isset { + _GetAllWriteEventInfoRequest__isset() : dbName(false), tableName(false) {} + bool dbName :1; + bool tableName :1; +} _GetAllWriteEventInfoRequest__isset; + +class GetAllWriteEventInfoRequest : public virtual ::apache::thrift::TBase { + public: + + GetAllWriteEventInfoRequest(const GetAllWriteEventInfoRequest&); + GetAllWriteEventInfoRequest& operator=(const GetAllWriteEventInfoRequest&); + GetAllWriteEventInfoRequest() noexcept; + + virtual ~GetAllWriteEventInfoRequest() noexcept; + int64_t txnId; + std::string dbName; + std::string tableName; + + _GetAllWriteEventInfoRequest__isset __isset; + + void __set_txnId(const int64_t val); + + void __set_dbName(const std::string& val); + + void __set_tableName(const std::string& val); + + bool operator == (const GetAllWriteEventInfoRequest & rhs) const; + bool operator != (const GetAllWriteEventInfoRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GetAllWriteEventInfoRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot) override; + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const override; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GetAllWriteEventInfoRequest &a, GetAllWriteEventInfoRequest &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const GetAllWriteEventInfoRequest& obj); + +typedef struct _MetaException__isset { + _MetaException__isset() : message(false) {} + bool message :1; +} _MetaException__isset; + +class MetaException : public ::apache::thrift::TException { + public: + + MetaException(const MetaException&); + MetaException& operator=(const MetaException&); + MetaException() noexcept; + + virtual ~MetaException() noexcept; + std::string message; + + _MetaException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const MetaException & rhs) const; + bool operator != (const MetaException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const MetaException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(MetaException &a, MetaException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const MetaException& obj); + +typedef struct _UnknownTableException__isset { + _UnknownTableException__isset() : message(false) {} + bool message :1; +} _UnknownTableException__isset; + +class UnknownTableException : public ::apache::thrift::TException { + public: + + UnknownTableException(const UnknownTableException&); + UnknownTableException& operator=(const UnknownTableException&); + UnknownTableException() noexcept; + + virtual ~UnknownTableException() noexcept; + std::string message; + + _UnknownTableException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const UnknownTableException & rhs) const; + bool operator != (const UnknownTableException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnknownTableException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(UnknownTableException &a, UnknownTableException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UnknownTableException& obj); + +typedef struct _UnknownDBException__isset { + _UnknownDBException__isset() : message(false) {} + bool message :1; +} _UnknownDBException__isset; + +class UnknownDBException : public ::apache::thrift::TException { + public: + + UnknownDBException(const UnknownDBException&); + UnknownDBException& operator=(const UnknownDBException&); + UnknownDBException() noexcept; + + virtual ~UnknownDBException() noexcept; + std::string message; + + _UnknownDBException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const UnknownDBException & rhs) const; + bool operator != (const UnknownDBException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnknownDBException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(UnknownDBException &a, UnknownDBException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UnknownDBException& obj); + +typedef struct _AlreadyExistsException__isset { + _AlreadyExistsException__isset() : message(false) {} + bool message :1; +} _AlreadyExistsException__isset; + +class AlreadyExistsException : public ::apache::thrift::TException { + public: + + AlreadyExistsException(const AlreadyExistsException&); + AlreadyExistsException& operator=(const AlreadyExistsException&); + AlreadyExistsException() noexcept; + + virtual ~AlreadyExistsException() noexcept; + std::string message; + + _AlreadyExistsException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const AlreadyExistsException & rhs) const; + bool operator != (const AlreadyExistsException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AlreadyExistsException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(AlreadyExistsException &a, AlreadyExistsException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const AlreadyExistsException& obj); + +typedef struct _InvalidPartitionException__isset { + _InvalidPartitionException__isset() : message(false) {} + bool message :1; +} _InvalidPartitionException__isset; + +class InvalidPartitionException : public ::apache::thrift::TException { + public: + + InvalidPartitionException(const InvalidPartitionException&); + InvalidPartitionException& operator=(const InvalidPartitionException&); + InvalidPartitionException() noexcept; + + virtual ~InvalidPartitionException() noexcept; + std::string message; + + _InvalidPartitionException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const InvalidPartitionException & rhs) const; + bool operator != (const InvalidPartitionException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidPartitionException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(InvalidPartitionException &a, InvalidPartitionException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const InvalidPartitionException& obj); + +typedef struct _UnknownPartitionException__isset { + _UnknownPartitionException__isset() : message(false) {} + bool message :1; +} _UnknownPartitionException__isset; + +class UnknownPartitionException : public ::apache::thrift::TException { + public: + + UnknownPartitionException(const UnknownPartitionException&); + UnknownPartitionException& operator=(const UnknownPartitionException&); + UnknownPartitionException() noexcept; + + virtual ~UnknownPartitionException() noexcept; + std::string message; + + _UnknownPartitionException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const UnknownPartitionException & rhs) const; + bool operator != (const UnknownPartitionException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnknownPartitionException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(UnknownPartitionException &a, UnknownPartitionException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const UnknownPartitionException& obj); + +typedef struct _InvalidObjectException__isset { + _InvalidObjectException__isset() : message(false) {} + bool message :1; +} _InvalidObjectException__isset; + +class InvalidObjectException : public ::apache::thrift::TException { + public: + + InvalidObjectException(const InvalidObjectException&); + InvalidObjectException& operator=(const InvalidObjectException&); + InvalidObjectException() noexcept; + + virtual ~InvalidObjectException() noexcept; + std::string message; + + _InvalidObjectException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const InvalidObjectException & rhs) const; + bool operator != (const InvalidObjectException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidObjectException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(InvalidObjectException &a, InvalidObjectException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const InvalidObjectException& obj); + +typedef struct _NoSuchObjectException__isset { + _NoSuchObjectException__isset() : message(false) {} + bool message :1; +} _NoSuchObjectException__isset; + +class NoSuchObjectException : public ::apache::thrift::TException { + public: + + NoSuchObjectException(const NoSuchObjectException&); + NoSuchObjectException& operator=(const NoSuchObjectException&); + NoSuchObjectException() noexcept; + + virtual ~NoSuchObjectException() noexcept; + std::string message; + + _NoSuchObjectException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const NoSuchObjectException & rhs) const; + bool operator != (const NoSuchObjectException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NoSuchObjectException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(NoSuchObjectException &a, NoSuchObjectException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NoSuchObjectException& obj); + +typedef struct _InvalidOperationException__isset { + _InvalidOperationException__isset() : message(false) {} + bool message :1; +} _InvalidOperationException__isset; + +class InvalidOperationException : public ::apache::thrift::TException { + public: + + InvalidOperationException(const InvalidOperationException&); + InvalidOperationException& operator=(const InvalidOperationException&); + InvalidOperationException() noexcept; + + virtual ~InvalidOperationException() noexcept; + std::string message; + + _InvalidOperationException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const InvalidOperationException & rhs) const; + bool operator != (const InvalidOperationException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidOperationException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(InvalidOperationException &a, InvalidOperationException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const InvalidOperationException& obj); + +typedef struct _ConfigValSecurityException__isset { + _ConfigValSecurityException__isset() : message(false) {} + bool message :1; +} _ConfigValSecurityException__isset; + +class ConfigValSecurityException : public ::apache::thrift::TException { + public: + + ConfigValSecurityException(const ConfigValSecurityException&); + ConfigValSecurityException& operator=(const ConfigValSecurityException&); + ConfigValSecurityException() noexcept; + + virtual ~ConfigValSecurityException() noexcept; + std::string message; + + _ConfigValSecurityException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const ConfigValSecurityException & rhs) const; + bool operator != (const ConfigValSecurityException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ConfigValSecurityException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(ConfigValSecurityException &a, ConfigValSecurityException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const ConfigValSecurityException& obj); + +typedef struct _InvalidInputException__isset { + _InvalidInputException__isset() : message(false) {} + bool message :1; +} _InvalidInputException__isset; + +class InvalidInputException : public ::apache::thrift::TException { + public: + + InvalidInputException(const InvalidInputException&); + InvalidInputException& operator=(const InvalidInputException&); + InvalidInputException() noexcept; + + virtual ~InvalidInputException() noexcept; + std::string message; + + _InvalidInputException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const InvalidInputException & rhs) const; + bool operator != (const InvalidInputException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidInputException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(InvalidInputException &a, InvalidInputException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const InvalidInputException& obj); + +typedef struct _NoSuchTxnException__isset { + _NoSuchTxnException__isset() : message(false) {} + bool message :1; +} _NoSuchTxnException__isset; + +class NoSuchTxnException : public ::apache::thrift::TException { + public: + + NoSuchTxnException(const NoSuchTxnException&); + NoSuchTxnException& operator=(const NoSuchTxnException&); + NoSuchTxnException() noexcept; + + virtual ~NoSuchTxnException() noexcept; + std::string message; + + _NoSuchTxnException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const NoSuchTxnException & rhs) const; + bool operator != (const NoSuchTxnException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NoSuchTxnException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(NoSuchTxnException &a, NoSuchTxnException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NoSuchTxnException& obj); + +typedef struct _TxnAbortedException__isset { + _TxnAbortedException__isset() : message(false) {} + bool message :1; +} _TxnAbortedException__isset; + +class TxnAbortedException : public ::apache::thrift::TException { + public: + + TxnAbortedException(const TxnAbortedException&); + TxnAbortedException& operator=(const TxnAbortedException&); + TxnAbortedException() noexcept; + + virtual ~TxnAbortedException() noexcept; + std::string message; + + _TxnAbortedException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const TxnAbortedException & rhs) const; + bool operator != (const TxnAbortedException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TxnAbortedException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(TxnAbortedException &a, TxnAbortedException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TxnAbortedException& obj); + +typedef struct _TxnOpenException__isset { + _TxnOpenException__isset() : message(false) {} + bool message :1; +} _TxnOpenException__isset; + +class TxnOpenException : public ::apache::thrift::TException { + public: + + TxnOpenException(const TxnOpenException&); + TxnOpenException& operator=(const TxnOpenException&); + TxnOpenException() noexcept; + + virtual ~TxnOpenException() noexcept; + std::string message; + + _TxnOpenException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const TxnOpenException & rhs) const; + bool operator != (const TxnOpenException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TxnOpenException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(TxnOpenException &a, TxnOpenException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const TxnOpenException& obj); + +typedef struct _NoSuchLockException__isset { + _NoSuchLockException__isset() : message(false) {} + bool message :1; +} _NoSuchLockException__isset; + +class NoSuchLockException : public ::apache::thrift::TException { + public: + + NoSuchLockException(const NoSuchLockException&); + NoSuchLockException& operator=(const NoSuchLockException&); + NoSuchLockException() noexcept; + + virtual ~NoSuchLockException() noexcept; + std::string message; + + _NoSuchLockException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const NoSuchLockException & rhs) const; + bool operator != (const NoSuchLockException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NoSuchLockException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(NoSuchLockException &a, NoSuchLockException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NoSuchLockException& obj); + +typedef struct _CompactionAbortedException__isset { + _CompactionAbortedException__isset() : message(false) {} + bool message :1; +} _CompactionAbortedException__isset; + +class CompactionAbortedException : public ::apache::thrift::TException { + public: + + CompactionAbortedException(const CompactionAbortedException&); + CompactionAbortedException& operator=(const CompactionAbortedException&); + CompactionAbortedException() noexcept; + + virtual ~CompactionAbortedException() noexcept; + std::string message; + + _CompactionAbortedException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const CompactionAbortedException & rhs) const; + bool operator != (const CompactionAbortedException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CompactionAbortedException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(CompactionAbortedException &a, CompactionAbortedException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const CompactionAbortedException& obj); + +typedef struct _NoSuchCompactionException__isset { + _NoSuchCompactionException__isset() : message(false) {} + bool message :1; +} _NoSuchCompactionException__isset; + +class NoSuchCompactionException : public ::apache::thrift::TException { + public: + + NoSuchCompactionException(const NoSuchCompactionException&); + NoSuchCompactionException& operator=(const NoSuchCompactionException&); + NoSuchCompactionException() noexcept; + + virtual ~NoSuchCompactionException() noexcept; + std::string message; + + _NoSuchCompactionException__isset __isset; + + void __set_message(const std::string& val); + + bool operator == (const NoSuchCompactionException & rhs) const; + bool operator != (const NoSuchCompactionException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NoSuchCompactionException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const noexcept override; +}; + +void swap(NoSuchCompactionException &a, NoSuchCompactionException &b) noexcept; + +std::ostream& operator<<(std::ostream& out, const NoSuchCompactionException& obj); + +}}} // namespace + +#endif diff --git a/thirdparty/hive_metastore/README.md b/thirdparty/hive_metastore/README.md index 9865e4655..96839d9a3 100644 --- a/thirdparty/hive_metastore/README.md +++ b/thirdparty/hive_metastore/README.md @@ -34,7 +34,7 @@ is reproducible and future updates are deterministic. | File | Upstream | Tag | Commit | | --- | --- | --- | --- | -| `hive_metastore.thrift` | [apache/hive](https://github.com/apache/hive) — `standalone-metastore/src/main/thrift/hive_metastore.thrift` | `rel/release-3.1.3` | [`04c1b307d1bbd1ae268ad47dc36ca4f50c6d9cd8`](https://github.com/apache/hive/blob/04c1b307d1bbd1ae268ad47dc36ca4f50c6d9cd8/standalone-metastore/src/main/thrift/hive_metastore.thrift) | +| `hive_metastore.thrift` | [apache/hive](https://github.com/apache/hive) — `standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift` | `rel/release-4.0.1` | [`d4c36d45eb3b23abf17d9a9848371a145291ffd4`](https://github.com/apache/hive/blob/d4c36d45eb3b23abf17d9a9848371a145291ffd4/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift) | | `share/fb303/if/fb303.thrift` | [apache/thrift](https://github.com/apache/thrift) — `contrib/fb303/if/fb303.thrift` | `v0.14.0` | [`8411e189b0af09e5baad34031555870cf692c1ad`](https://github.com/apache/thrift/blob/8411e189b0af09e5baad34031555870cf692c1ad/contrib/fb303/if/fb303.thrift) | `fb303.thrift` is the Facebook fb303 management service IDL, transitively diff --git a/thirdparty/hive_metastore/hive_metastore.thrift b/thirdparty/hive_metastore/hive_metastore.thrift index 97344d9e1..f292b210f 100644 --- a/thirdparty/hive_metastore/hive_metastore.thrift +++ b/thirdparty/hive_metastore/hive_metastore.thrift @@ -29,6 +29,10 @@ namespace php metastore namespace cpp Apache.Hadoop.Hive const string DDL_TIME = "transient_lastDdlTime" +const byte ACCESSTYPE_NONE = 1; +const byte ACCESSTYPE_READONLY = 2; +const byte ACCESSTYPE_WRITEONLY = 4; +const byte ACCESSTYPE_READWRITE = 8; struct Version { 1: string version, @@ -41,6 +45,14 @@ struct FieldSchema { 3: string comment } +// Key-value store to be used with selected +// Metastore APIs (create, alter methods). +// The client can pass environment properties / configs that can be +// accessed in hooks. +struct EnvironmentContext { + 1: map properties +} + struct SQLPrimaryKey { 1: string table_db, // table schema 2: string table_name, // table name @@ -118,6 +130,15 @@ struct SQLCheckConstraint { 9: bool rely_cstr // Rely/No Rely } +struct SQLAllTableConstraints { + 1: optional list primaryKeys, + 2: optional list foreignKeys, + 3: optional list uniqueConstraints, + 4: optional list notNullConstraints, + 5: optional list defaultConstraints, + 6: optional list checkConstraints +} + struct Type { 1: string name, // one of the types in PrimitiveTypes or CollectionTypes or User defined types 2: optional string type1, // object type if the name is 'list' (LIST_TYPE), key type if the name is 'map' (MAP_TYPE) @@ -131,6 +152,7 @@ enum HiveObjectType { TABLE = 3, PARTITION = 4, COLUMN = 5, + DATACONNECTOR = 6, } enum PrincipalType { @@ -142,6 +164,24 @@ enum PrincipalType { const string HIVE_FILTER_FIELD_OWNER = "hive_filter_field_owner__" const string HIVE_FILTER_FIELD_PARAMS = "hive_filter_field_params__" const string HIVE_FILTER_FIELD_LAST_ACCESS = "hive_filter_field_last_access__" +const string HIVE_FILTER_FIELD_TABLE_NAME = "hive_filter_field_tableName__" +const string HIVE_FILTER_FIELD_TABLE_TYPE = "hive_filter_field_tableType__" + +struct PropertySetRequest { + 1: required string nameSpace; + 2: map propertyMap; +} + +struct PropertyGetRequest { + 1: required string nameSpace; + 2: string mapPrefix; + 3: optional string mapPredicate; + 4: optional list mapSelection; +} + +struct PropertyGetResponse { + 1: map> properties; +} enum PartitionEventType { LOAD_DONE = 1, @@ -171,11 +211,14 @@ enum LockType { SHARED_READ = 1, SHARED_WRITE = 2, EXCLUSIVE = 3, + EXCL_WRITE = 4, } enum CompactionType { MINOR = 1, MAJOR = 2, + REBALANCE = 3, + ABORT_TXN_CLEANUP = 4, } enum GrantRevokeType { @@ -233,6 +276,11 @@ enum SchemaVersionState { DELETED = 8 } +enum DatabaseType { + NATIVE = 1, + REMOTE = 2 +} + struct HiveObjectRef{ 1: HiveObjectType objectType, 2: string dbName, @@ -278,6 +326,18 @@ struct GrantRevokePrivilegeResponse { 1: optional bool success; } +struct TruncateTableRequest { + 1: required string dbName, + 2: required string tableName, + 3: optional list partNames, + 4: optional i64 writeId=-1, + 5: optional string validWriteIdList, + 6: optional EnvironmentContext environmentContext +} + +struct TruncateTableResponse { +} + struct Role { 1: string roleName, 2: i32 createTime, @@ -329,9 +389,10 @@ struct GrantRevokeRoleResponse { struct Catalog { 1: string name, // Name of the catalog 2: optional string description, // description of the catalog - 3: string locationUri // default storage location. When databases are created in - // this catalog, if they do not specify a location, they will - // be placed in this location. + 3: string locationUri, // default storage location. When databases are created in + // this catalog, if they do not specify a location, they will + // be placed in this location. + 4: optional i32 createTime // creation time of catalog in seconds since epoch } struct CreateCatalogRequest { @@ -368,7 +429,12 @@ struct Database { 5: optional PrincipalPrivilegeSet privileges, 6: optional string ownerName, 7: optional PrincipalType ownerType, - 8: optional string catalogName + 8: optional string catalogName, + 9: optional i32 createTime, // creation time of database in seconds since epoch + 10: optional string managedLocationUri, // directory for managed tables + 11: optional DatabaseType type, + 12: optional string connector_name, + 13: optional string remote_dbname } // This object holds the information needed by SerDes @@ -411,65 +477,14 @@ struct StorageDescriptor { 12: optional bool storedAsSubDirectories // stored as subdirectories or not } -// table information -struct Table { - 1: string tableName, // name of the table - 2: string dbName, // database name ('default') - 3: string owner, // owner of this table - 4: i32 createTime, // creation time of the table - 5: i32 lastAccessTime, // last access time (usually this will be filled from HDFS and shouldn't be relied on) - 6: i32 retention, // retention time - 7: StorageDescriptor sd, // storage descriptor of the table - 8: list partitionKeys, // partition keys of the table. only primitive types are supported - 9: map parameters, // to store comments or any other user level parameters - 10: string viewOriginalText, // original view text, null for non-view - 11: string viewExpandedText, // expanded view text, null for non-view - 12: string tableType, // table type enum, e.g. EXTERNAL_TABLE - 13: optional PrincipalPrivilegeSet privileges, - 14: optional bool temporary=false, - 15: optional bool rewriteEnabled, // rewrite enabled or not - 16: optional CreationMetadata creationMetadata, // only for MVs, it stores table names used and txn list at MV creation - 17: optional string catName, // Name of the catalog the table is in - 18: optional PrincipalType ownerType = PrincipalType.USER // owner type of this table (default to USER for backward compatibility) -} - -struct Partition { - 1: list values // string value is converted to appropriate partition key type - 2: string dbName, - 3: string tableName, - 4: i32 createTime, - 5: i32 lastAccessTime, - 6: StorageDescriptor sd, - 7: map parameters, - 8: optional PrincipalPrivilegeSet privileges, - 9: optional string catName -} - -struct PartitionWithoutSD { - 1: list values // string value is converted to appropriate partition key type - 2: i32 createTime, - 3: i32 lastAccessTime, - 4: string relativePath, - 5: map parameters, - 6: optional PrincipalPrivilegeSet privileges -} - -struct PartitionSpecWithSharedSD { - 1: list partitions, - 2: StorageDescriptor sd, -} - -struct PartitionListComposingSpec { - 1: list partitions -} - -struct PartitionSpec { - 1: string dbName, - 2: string tableName, - 3: string rootPath, - 4: optional PartitionSpecWithSharedSD sharedSDPartitionSpec, - 5: optional PartitionListComposingSpec partitionList, - 6: optional string catName +struct CreationMetadata { + 1: required string catName, + 2: required string dbName, + 3: required string tblName, + 4: required set tablesUsed, + 5: optional string validTxnList, + 6: optional i64 materializationTime, + 7: optional list sourceTables } // column statistics @@ -485,7 +500,8 @@ struct DoubleColumnStatsData { 2: optional double highValue, 3: required i64 numNulls, 4: required i64 numDVs, -5: optional binary bitVectors +5: optional binary bitVectors, +6: optional binary histogram } struct LongColumnStatsData { @@ -493,7 +509,8 @@ struct LongColumnStatsData { 2: optional i64 highValue, 3: required i64 numNulls, 4: required i64 numDVs, -5: optional binary bitVectors +5: optional binary bitVectors, +6: optional binary histogram } struct StringColumnStatsData { @@ -522,7 +539,8 @@ struct DecimalColumnStatsData { 2: optional Decimal highValue, 3: required i64 numNulls, 4: required i64 numDVs, -5: optional binary bitVectors +5: optional binary bitVectors, +6: optional binary histogram } struct Date { @@ -534,7 +552,21 @@ struct DateColumnStatsData { 2: optional Date highValue, 3: required i64 numNulls, 4: required i64 numDVs, -5: optional binary bitVectors +5: optional binary bitVectors, +6: optional binary histogram +} + +struct Timestamp { +1: required i64 secondsSinceEpoch +} + +struct TimestampColumnStatsData { +1: optional Timestamp lowValue, +2: optional Timestamp highValue, +3: required i64 numNulls, +4: required i64 numDVs, +5: optional binary bitVectors, +6: optional binary histogram } union ColumnStatisticsData { @@ -544,7 +576,8 @@ union ColumnStatisticsData { 4: StringColumnStatsData stringStats, 5: BinaryColumnStatsData binaryStats, 6: DecimalColumnStatsData decimalStats, -7: DateColumnStatsData dateStats +7: DateColumnStatsData dateStats, +8: TimestampColumnStatsData timestampStats } struct ColumnStatisticsObj { @@ -564,17 +597,139 @@ struct ColumnStatisticsDesc { struct ColumnStatistics { 1: required ColumnStatisticsDesc statsDesc, -2: required list statsObj; +2: required list statsObj, +3: optional bool isStatsCompliant, // Are the stats isolation-level-compliant with the + // the calling query? +4: optional string engine = "hive" +} + +// FileMetadata represents the table-level (in case of unpartitioned) or partition-level +// file metadata. Each partition could have more than 1 files and hence the list of +// binary data field. Each value in data field corresponds to metadata for one file. +struct FileMetadata { + // current supported type mappings are + // 1 -> IMPALA + 1: byte type = 1 + 2: byte version = 1 + 3: list data +} + +// this field can be used to store repeatitive information +// (like network addresses in filemetadata). Instead of +// sending the same object repeatedly, we can send the indices +// corresponding to the object in this list. +struct ObjectDictionary { + // the key can be used to determine the object type + // the value is the list of the objects which can be accessed + // using their indices. These indices can be used to send instead of + // full object which can reduce the payload significantly in case of + // repetitive objects. + 1: required map> values +} + +// table information +struct Table { + 1: string tableName, // name of the table + 2: string dbName, // database name ('default') + 3: string owner, // owner of this table + 4: i32 createTime, // creation time of the table + 5: i32 lastAccessTime, // last access time (usually this will be filled from HDFS and shouldn't be relied on) + 6: i32 retention, // retention time + 7: StorageDescriptor sd, // storage descriptor of the table + 8: list partitionKeys, // partition keys of the table. only primitive types are supported + 9: map parameters, // to store comments or any other user level parameters + 10: string viewOriginalText, // original view text, null for non-view + 11: string viewExpandedText, // expanded view text, null for non-view + 12: string tableType, // table type enum, e.g. EXTERNAL_TABLE + 13: optional PrincipalPrivilegeSet privileges, + 14: optional bool temporary=false, + 15: optional bool rewriteEnabled, // rewrite enabled or not + 16: optional CreationMetadata creationMetadata, // only for MVs, it stores table names used and txn list at MV creation + 17: optional string catName, // Name of the catalog the table is in + 18: optional PrincipalType ownerType = PrincipalType.USER, // owner type of this table (default to USER for backward compatibility) + 19: optional i64 writeId=-1, + 20: optional bool isStatsCompliant, + 21: optional ColumnStatistics colStats, // column statistics for table + 22: optional byte accessType, + 23: optional list requiredReadCapabilities, + 24: optional list requiredWriteCapabilities + 25: optional i64 id, // id of the table. It will be ignored if set. It's only for + // read purposes + 26: optional FileMetadata fileMetadata, // optional serialized file-metadata for this table + // for certain execution engines + 27: optional ObjectDictionary dictionary, + 28: optional i64 txnId, // txnId associated with the table creation +} + +struct SourceTable { + 1: required Table table, + 2: required i64 insertedCount, + 3: required i64 updatedCount, + 4: required i64 deletedCount +} + +struct Partition { + 1: list values // string value is converted to appropriate partition key type + 2: string dbName, + 3: string tableName, + 4: i32 createTime, + 5: i32 lastAccessTime, + 6: StorageDescriptor sd, + 7: map parameters, + 8: optional PrincipalPrivilegeSet privileges, + 9: optional string catName, + 10: optional i64 writeId=-1, + 11: optional bool isStatsCompliant, + 12: optional ColumnStatistics colStats, // column statistics for partition + 13: optional FileMetadata fileMetadata // optional serialized file-metadata useful for certain execution engines +} + +struct PartitionWithoutSD { + 1: list values // string value is converted to appropriate partition key type + 2: i32 createTime, + 3: i32 lastAccessTime, + 4: string relativePath, + 5: map parameters, + 6: optional PrincipalPrivilegeSet privileges +} + +struct PartitionSpecWithSharedSD { + 1: list partitions, + 2: StorageDescriptor sd, +} + + +struct PartitionListComposingSpec { + 1: list partitions +} + +struct PartitionSpec { + 1: string dbName, + 2: string tableName, + 3: string rootPath, + 4: optional PartitionSpecWithSharedSD sharedSDPartitionSpec, + 5: optional PartitionListComposingSpec partitionList, + 6: optional string catName, + 7: optional i64 writeId=-1, + 8: optional bool isStatsCompliant } struct AggrStats { 1: required list colStats, -2: required i64 partsFound // number of partitions for which stats were found +2: required i64 partsFound, // number of partitions for which stats were found +3: optional bool isStatsCompliant } struct SetPartitionsStatsRequest { 1: required list colStats, -2: optional bool needMerge //stats need to be merged with the existing stats +2: optional bool needMerge, //stats need to be merged with the existing stats +3: optional i64 writeId=-1, // writeId for the current query that updates the stats +4: optional string validWriteIdList, // valid write id list for the table for which this struct is being sent +5: optional string engine = "hive" //engine creating the current request +} + +struct SetPartitionsStatsResponse { +1: required bool result; } // schema of the table/query results etc. @@ -584,18 +739,12 @@ struct Schema { 2: map properties } -// Key-value store to be used with selected -// Metastore APIs (create, alter methods). -// The client can pass environment properties / configs that can be -// accessed in hooks. -struct EnvironmentContext { - 1: map properties -} - struct PrimaryKeysRequest { 1: required string db_name, 2: required string tbl_name, - 3: optional string catName + 3: optional string catName, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 } struct PrimaryKeysResponse { @@ -606,8 +755,10 @@ struct ForeignKeysRequest { 1: string parent_db_name, 2: string parent_tbl_name, 3: string foreign_db_name, - 4: string foreign_tbl_name - 5: optional string catName // No cross catalog constraints + 4: string foreign_tbl_name, + 5: optional string catName, // No cross catalog constraints + 6: optional string validWriteIdList, + 7: optional i64 tableId=-1 } struct ForeignKeysResponse { @@ -618,6 +769,8 @@ struct UniqueConstraintsRequest { 1: required string catName, 2: required string db_name, 3: required string tbl_name, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 } struct UniqueConstraintsResponse { @@ -628,6 +781,8 @@ struct NotNullConstraintsRequest { 1: required string catName, 2: required string db_name, 3: required string tbl_name, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 } struct NotNullConstraintsResponse { @@ -637,7 +792,9 @@ struct NotNullConstraintsResponse { struct DefaultConstraintsRequest { 1: required string catName, 2: required string db_name, - 3: required string tbl_name + 3: required string tbl_name, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 } struct DefaultConstraintsResponse { @@ -647,13 +804,26 @@ struct DefaultConstraintsResponse { struct CheckConstraintsRequest { 1: required string catName, 2: required string db_name, - 3: required string tbl_name + 3: required string tbl_name, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 } struct CheckConstraintsResponse { 1: required list checkConstraints } +struct AllTableConstraintsRequest { + 1: required string dbName, + 2: required string tblName, + 3: required string catName, + 4: optional string validWriteIdList, + 5: optional i64 tableId=-1 +} + +struct AllTableConstraintsResponse { + 1: required SQLAllTableConstraints allTableConstraints +} struct DropConstraintRequest { 1: required string dbname, @@ -693,28 +863,46 @@ struct PartitionsByExprResult { 2: required bool hasUnknownPartitions } +// Return type for get_partitions_spec_by_expr +struct PartitionsSpecByExprResult { +1: required list partitionsSpec, +// Whether the results has any (currently, all) partitions which may or may not match +2: required bool hasUnknownPartitions +} + struct PartitionsByExprRequest { 1: required string dbName, 2: required string tblName, 3: required binary expr, 4: optional string defaultPartitionName, - 5: optional i16 maxParts=-1 - 6: optional string catName + 5: optional i16 maxParts=-1, + 6: optional string catName, + 7: optional string order + 8: optional string validWriteIdList, + 9: optional i64 id=-1, // table id + 10: optional bool skipColumnSchemaForPartition, + 11: optional string includeParamKeyPattern, + 12: optional string excludeParamKeyPattern } struct TableStatsResult { - 1: required list tableStats + 1: required list tableStats, + 2: optional bool isStatsCompliant } struct PartitionsStatsResult { - 1: required map> partStats + 1: required map> partStats, + 2: optional bool isStatsCompliant } struct TableStatsRequest { 1: required string dbName, 2: required string tblName, 3: required list colNames - 4: optional string catName + 4: optional string catName, + 5: optional string validWriteIdList, // valid write id list for the table for which this struct is being sent + 6: optional string engine = "hive", //engine creating the current request + 7: optional i64 id=-1 // table id } struct PartitionsStatsRequest { @@ -722,12 +910,16 @@ struct PartitionsStatsRequest { 2: required string tblName, 3: required list colNames, 4: required list partNames, - 5: optional string catName + 5: optional string catName, + 6: optional string validWriteIdList, // valid write id list for the table for which this struct is being sent + 7: optional string engine = "hive" //engine creating the current request } // Return type for add_partitions_req struct AddPartitionsResult { 1: optional list partitions, + 2: optional bool isStatsCompliant, + 3: optional list partitionColSchema } // Request type for add_partitions_req @@ -737,7 +929,11 @@ struct AddPartitionsRequest { 3: required list parts, 4: required bool ifNotExists, 5: optional bool needResult=true, - 6: optional string catName + 6: optional string catName, + 7: optional string validWriteIdList, + 8: optional bool skipColumnSchemaForPartition, + 9: optional list partitionColSchema, + 10: optional EnvironmentContext environmentContext } // Return type for drop_partitions_req @@ -766,7 +962,18 @@ struct DropPartitionsRequest { 6: optional bool ignoreProtection, 7: optional EnvironmentContext environmentContext, 8: optional bool needResult=true, - 9: optional string catName + 9: optional string catName, + 10: optional bool skipColumnSchemaForPartition +} + +struct DropPartitionRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional string partName, + 5: optional list partVals, + 6: optional bool deleteData, + 7: optional EnvironmentContext environmentContext } struct PartitionValuesRequest { @@ -778,7 +985,8 @@ struct PartitionValuesRequest { 6: optional list partitionOrder; 7: optional bool ascending = true; 8: optional i64 maxParts = -1; - 9: optional string catName + 9: optional string catName, + 10: optional string validWriteIdList } struct PartitionValuesRow { @@ -789,6 +997,38 @@ struct PartitionValuesResponse { 1: required list partitionValues; } +struct GetPartitionsByNamesRequest { + 1: required string db_name, + 2: required string tbl_name, + 3: optional list names, + 4: optional bool get_col_stats, + 5: optional list processorCapabilities, + 6: optional string processorIdentifier, + 7: optional string engine = "hive", + 8: optional string validWriteIdList, + 9: optional bool getFileMetadata, + 10: optional i64 id=-1, // table id + 11: optional bool skipColumnSchemaForPartition, + 12: optional string includeParamKeyPattern, + 13: optional string excludeParamKeyPattern +} + +struct GetPartitionsByNamesResult { + 1: required list partitions + 2: optional ObjectDictionary dictionary +} + +struct DataConnector { + 1: string name, + 2: string type, + 3: string url, + 4: optional string description, + 5: optional map parameters, + 6: optional string ownerName, + 7: optional PrincipalType ownerType, + 8: optional i32 createTime +} + enum FunctionType { JAVA = 1, } @@ -799,6 +1039,23 @@ enum ResourceType { ARCHIVE = 3, } +enum TxnType { + DEFAULT = 0, + REPL_CREATED = 1, + READ_ONLY = 2, + COMPACTION = 3, + MATER_VIEW_REBUILD = 4, + SOFT_DELETE = 5, + REBALANCE_COMPACTION = 6 +} + +// specifies which info to return with GetTablesExtRequest +enum GetTablesExtRequestFields { + ACCESS_TYPE = 1, // return accessType + PROCESSOR_CAPABILITIES = 2, // return ALL Capabilities for each Tables + ALL = 2147483647 +} + struct ResourceUri { 1: ResourceType resourceType, 2: string uri, @@ -849,6 +1106,7 @@ struct OpenTxnRequest { 4: optional string agentInfo = "Unknown", 5: optional string replPolicy, 6: optional list replSrcTxnIds, + 7: optional TxnType txn_type = TxnType.DEFAULT, } struct OpenTxnsResponse { @@ -858,15 +1116,57 @@ struct OpenTxnsResponse { struct AbortTxnRequest { 1: required i64 txnid, 2: optional string replPolicy, + 3: optional TxnType txn_type, + 4: optional i64 errorCode, } struct AbortTxnsRequest { 1: required list txn_ids, + 2: optional i64 errorCode, +} + +struct CommitTxnKeyValue { + 1: required i64 tableId, + 2: required string key, + 3: required string value, +} + +struct WriteEventInfo { + 1: required i64 writeId, + 2: required string database, + 3: required string table, + 4: required string files, + 5: optional string partition, + 6: optional string tableObj, // repl txn task does not need table object for commit + 7: optional string partitionObj, +} + +struct ReplLastIdInfo { + 1: required string database, + 2: required i64 lastReplId, + 3: optional string table, + 4: optional string catalog, + 5: optional list partitionList, +} + +struct UpdateTransactionalStatsRequest { + 1: required i64 tableId, + 2: required i64 insertCount, + 3: required i64 updatedCount, + 4: required i64 deletedCount, } struct CommitTxnRequest { 1: required i64 txnid, 2: optional string replPolicy, + // Information related to write operations done in this transaction. + 3: optional list writeEventInfos, + // Information to update the last repl id of table/partition along with commit txn (replication from 2.6 to 3.0) + 4: optional ReplLastIdInfo replLastIdInfo, + // An optional key/value to store atomically with the transaction + 5: optional CommitTxnKeyValue keyValue, + 6: optional bool exclWriteEnabled = true, + 7: optional TxnType txn_type, } struct ReplTblWriteIdStateRequest { @@ -881,7 +1181,8 @@ struct ReplTblWriteIdStateRequest { // Request msg to get the valid write ids list for the given list of tables wrt to input validTxnList struct GetValidWriteIdsRequest { 1: required list fullTableNames, // Full table names of format . - 2: required string validTxnList, // Valid txn list string wrt the current txn of the caller + 2: optional string validTxnList, // Valid txn list string wrt the current txn of the caller + 3: optional i64 writeId, //write id to be used to get the current txn id } // Valid Write ID list of one table wrt to current txn @@ -898,6 +1199,12 @@ struct GetValidWriteIdsResponse { 1: required list tblValidWriteIds, } +// Map for allocated write id against the txn for which it is allocated +struct TxnToWriteId { + 1: required i64 txnId, + 2: required i64 writeId, +} + // Request msg to allocate table write ids for the given list of txns struct AllocateTableWriteIdsRequest { 1: required string dbName, @@ -908,18 +1215,31 @@ struct AllocateTableWriteIdsRequest { 4: optional string replPolicy, // The list is assumed to be sorted by both txnids and write ids. The write id list is assumed to be contiguous. 5: optional list srcTxnToWriteIdList, -} - -// Map for allocated write id against the txn for which it is allocated -struct TxnToWriteId { - 1: required i64 txnId, - 2: required i64 writeId, + // If false, reuse previously allocate writeIds for txnIds. If true, remove older txnId to writeIds mappings + // and regenerate (this is useful during re-compilation when we need to ensure writeIds are regenerated) + 6: optional bool reallocate = false; } struct AllocateTableWriteIdsResponse { 1: required list txnToWriteIds, } +struct MaxAllocatedTableWriteIdRequest { + 1: required string dbName, + 2: required string tableName, +} +struct MaxAllocatedTableWriteIdResponse { + 1: required i64 maxWriteId, +} +struct SeedTableWriteIdsRequest { + 1: required string dbName, + 2: required string tableName, + 3: required i64 seedWriteId, +} +struct SeedTxnIdRequest { + 1: required i64 seedTxnId, +} + struct LockComponent { 1: required LockType type, 2: required LockLevel level, @@ -937,11 +1257,15 @@ struct LockRequest { 3: required string user, // used in 'show locks' to help admins find who has open locks 4: required string hostname, // used in 'show locks' to help admins find who has open locks 5: optional string agentInfo = "Unknown", + 6: optional bool zeroWaitReadEnabled = false, + 7: optional bool exclusiveCTAS = false, + 8: optional bool locklessReadsEnabled = false } struct LockResponse { 1: required i64 lockid, 2: required LockState state, + 3: optional string errorMessage } struct CheckLockRequest { @@ -959,6 +1283,7 @@ struct ShowLocksRequest { 2: optional string tablename, 3: optional string partname, 4: optional bool isExtended=false, + 5: optional i64 txnid, } struct ShowLocksResponseElement { @@ -1000,21 +1325,89 @@ struct HeartbeatTxnRangeResponse { } struct CompactionRequest { - 1: required string dbname, - 2: required string tablename, - 3: optional string partitionname, - 4: required CompactionType type, - 5: optional string runas, + 1: required string dbname + 2: required string tablename + 3: optional string partitionname + 4: required CompactionType type + 5: optional string runas 6: optional map properties + 7: optional string initiatorId + 8: optional string initiatorVersion + 9: optional string poolName + 10: optional i32 numberOfBuckets + 11: optional string orderByClause; +} + +struct CompactionInfoStruct { + 1: required i64 id, + 2: required string dbname, + 3: required string tablename, + 4: optional string partitionname, + 5: required CompactionType type, + 6: optional string runas, + 7: optional string properties, + 8: optional bool toomanyaborts, + 9: optional string state, + 10: optional string workerId, + 11: optional i64 start, + 12: optional i64 highestWriteId, + 13: optional string errorMessage, + 14: optional bool hasoldabort, + 15: optional i64 enqueueTime, + 16: optional i64 retryRetention, + 17: optional string poolname + 18: optional i32 numberOfBuckets + 19: optional string orderByClause; +} + +struct OptionalCompactionInfoStruct { + 1: optional CompactionInfoStruct ci, +} + +enum CompactionMetricsMetricType { + NUM_OBSOLETE_DELTAS, + NUM_DELTAS, + NUM_SMALL_DELTAS, +} + +struct CompactionMetricsDataStruct { + 1: required string dbname + 2: required string tblname + 3: optional string partitionname + 4: required CompactionMetricsMetricType type + 5: required i32 metricvalue + 6: required i32 version + 7: required i32 threshold +} + +struct CompactionMetricsDataResponse { + 1: optional CompactionMetricsDataStruct data +} + +struct CompactionMetricsDataRequest { + 1: required string dbName, + 2: required string tblName, + 3: optional string partitionName + 4: required CompactionMetricsMetricType type } struct CompactionResponse { 1: required i64 id, 2: required string state, - 3: required bool accepted + 3: required bool accepted, + 4: optional string errormessage } struct ShowCompactRequest { + 1: optional i64 id, + 2: optional string poolName, + 3: optional string dbName, + 4: optional string tbName, + 5: optional string partName, + 6: optional CompactionType type, + 7: optional string state, + 8: optional i64 limit, + 9: optional string order } struct ShowCompactResponseElement { @@ -1031,12 +1424,57 @@ struct ShowCompactResponseElement { 11: optional i64 endTime, 12: optional string hadoopJobId = "None", 13: optional i64 id, + 14: optional string errorMessage, + 15: optional i64 enqueueTime, + 16: optional string workerVersion, + 17: optional string initiatorId, + 18: optional string initiatorVersion, + 19: optional i64 cleanerStart, + 20: optional string poolName, + 21: optional i64 nextTxnId, + 22: optional i64 txnId, + 23: optional i64 commitTime, + 24: optional i64 hightestWriteId + } struct ShowCompactResponse { 1: required list compacts, } +struct AbortCompactionRequest { + 1: required list compactionIds, + 2: optional string type, + 3: optional string poolName +} + +struct AbortCompactionResponseElement { + 1: required i64 compactionId, + 2: optional string status, + 3: optional string message +} + +struct AbortCompactResponse { + 1: required map abortedcompacts, +} + +struct GetLatestCommittedCompactionInfoRequest { + 1: required string dbname, + 2: required string tablename, + 3: optional list partitionnames, + 4: optional i64 lastCompactionId, +} + +struct GetLatestCommittedCompactionInfoResponse { + 1: required list compactions, +} + +struct FindNextCompactRequest { + 1: optional string workerId, + 2: optional string workerVersion, + 3: optional string poolName +} + struct AddDynamicPartitions { 1: required i64 txnid, 2: required i64 writeid, @@ -1055,18 +1493,14 @@ struct BasicTxnInfo { 6: optional string partitionname } -struct CreationMetadata { - 1: required string catName - 2: required string dbName, - 3: required string tblName, - 4: required set tablesUsed, - 5: optional string validTxnList, - 6: optional i64 materializationTime -} struct NotificationEventRequest { 1: required i64 lastEvent, 2: optional i32 maxEvents, + 3: optional list eventTypeSkipList, + 4: optional string catName, + 5: optional string dbName, + 6: optional list tableNames } struct NotificationEvent { @@ -1091,7 +1525,10 @@ struct CurrentNotificationEventId { struct NotificationEventsCountRequest { 1: required i64 fromEventId, 2: required string dbName, - 3: optional string catName + 3: optional string catName, + 4: optional i64 toEventId, + 5: optional i64 limit, + 6: optional list tableNames } struct NotificationEventsCountResponse { @@ -1103,10 +1540,18 @@ struct InsertEventRequestData { 2: required list filesAdded, // Checksum of files (hex string of checksum byte payload) 3: optional list filesAddedChecksum, + // Used by acid operation to create the sub directory + 4: optional list subDirectoryList, + // partition value which was inserted (used in case of bulk insert events) + 5: optional list partitionVal } union FireEventRequestData { - 1: InsertEventRequestData insertData + 1: optional InsertEventRequestData insertData, + // used to fire insert events on multiple partitions + 2: optional list insertDatas, + // Identify if it is a refresh or invalidate event + 3: optional bool refreshEvent } struct FireEventRequest { @@ -1116,11 +1561,37 @@ struct FireEventRequest { // subevent as I assume they'll be used across most event types. 3: optional string dbName, 4: optional string tableName, + // ignored if event request data contains multiple insert event datas 5: optional list partitionVals, 6: optional string catName, + 7: optional map tblParams, } struct FireEventResponse { + 1: list eventIds +} + +struct WriteNotificationLogRequest { + 1: required i64 txnId, + 2: required i64 writeId, + 3: required string db, + 4: required string table, + 5: required InsertEventRequestData fileInfo, + 6: optional list partitionVals, +} + +struct WriteNotificationLogResponse { + // NOP for now, this is just a place holder for future responses +} + +struct WriteNotificationLogBatchRequest { + 1: required string catalog, + 2: required string db, + 3: required string table, + 4: required list requestList, +} + +struct WriteNotificationLogBatchResponse { // NOP for now, this is just a place holder for future responses } @@ -1201,33 +1672,129 @@ enum ClientCapability { INSERT_ONLY_TABLES = 2 } - struct ClientCapabilities { 1: required list values } +/* + * Generic request API, providing different kinds of filtering and controlling output. + * + * The API entry point is get_partitions_with_specs() and getTables, which is based on a single + * request/response object model. + * + * The request defines any filtering that should be done for partitions as well as the list of fields that should be + * returned (this is called ProjectionSpec). Projection is simply a list of dot separated strings which represent + * the fields which that be returned. Projection may also include whitelist or blacklist of parameters to include in + * the partition. When both blacklist and whitelist are present, the blacklist supersedes the + * whitelist in case of conflicts. + * + * Filter spec is the generalization of various types of partition and table filtering. Partitions and tables can be + * filtered by names, by values or by partition expressions. + */ + +struct GetProjectionsSpec { + // fieldList is a list of dot separated strings which represent the fields which must be returned. + // Any other field which is not in the fieldList may be unset in the returned partitions (it + // is up to the implementation to decide whether it chooses to include or exclude such fields). + // E.g. setting the field list to sd.location, serdeInfo.name, sd.cols.name, sd.cols.type will + // return partitions which will have location field set in the storage descriptor. Also the serdeInfo + // in the returned storage descriptor will only have name field set. This applies to multi-valued + // fields as well like sd.cols, so in the example above only name and type fields will be set for sd.cols. + // If the fieldList is empty or not present, all the fields will be set + 1: list fieldList; + // SQL-92 compliant regex pattern for param keys to be included + // _ or % wildcards are supported. '_' represent one character and '%' represents 0 or more characters + // Currently this is unsupported when fetching tables. + 2: string includeParamKeyPattern; + // SQL-92 compliant regex pattern for param keys to be excluded + // _ or % wildcards are supported. '_' represent one character and '%' represents 0 or more characters + // Current this is unsupported when fetching tables. + 3: string excludeParamKeyPattern; +} + struct GetTableRequest { 1: required string dbName, 2: required string tblName, 3: optional ClientCapabilities capabilities, - 4: optional string catName + 4: optional string catName, + 6: optional string validWriteIdList, + 7: optional bool getColumnStats, + 8: optional list processorCapabilities, + 9: optional string processorIdentifier, + 10: optional string engine = "hive", + 11: optional i64 id=-1 // table id } struct GetTableResult { - 1: required Table table + 1: required Table table, + 2: optional bool isStatsCompliant } struct GetTablesRequest { 1: required string dbName, 2: optional list tblNames, 3: optional ClientCapabilities capabilities, - 4: optional string catName + 4: optional string catName, + 5: optional list processorCapabilities, + 6: optional string processorIdentifier, + 7: optional GetProjectionsSpec projectionSpec, + 8: optional string tablesPattern } struct GetTablesResult { 1: required list
tables } +struct GetTablesExtRequest { + 1: required string catalog, + 2: required string database, + 3: required string tableNamePattern, // table name matching pattern + 4: required i32 requestedFields, // ORed GetTablesExtRequestFields + 5: optional i32 limit, // maximum number of tables returned (0=all) + 6: optional list processorCapabilities, // list of capabilities “possessed” by the client + 7: optional string processorIdentifier +} + +// response to GetTablesExtRequest call +struct ExtendedTableInfo { + 1: required string tblName, // always returned + 2: optional i32 accessType, // if AccessType set + 3: optional list requiredReadCapabilities // capabilities required for read access + 4: optional list requiredWriteCapabilities // capabilities required for write access +} + +struct DropTableRequest { + 1: optional string catalogName, + 2: required string dbName, + 3: required string tableName, + 4: optional bool deleteData, + 5: optional EnvironmentContext envContext, + 6: optional bool dropPartitions +} + +struct GetDatabaseRequest { + 1: optional string name, + 2: optional string catalogName, + 3: optional list processorCapabilities, + 4: optional string processorIdentifier +} + +struct AlterDatabaseRequest { + 1: required string oldDbName, + 2: required Database newDb +} + +struct DropDatabaseRequest { + 1: required string name, + 2: optional string catalogName, + 3: required bool ignoreUnknownDb, + 4: required bool deleteData, + 5: required bool cascade, + 6: optional bool softDelete=false, + 7: optional i64 txnId=0, + 8: optional bool deleteManagedDir=true +} + // Request type for cm_recycle struct CmRecycleRequest { 1: required string dataPath, @@ -1244,10 +1811,13 @@ struct TableMeta { 3: required string tableType; 4: optional string comments; 5: optional string catName; + 6: optional string ownerName; + 7: optional PrincipalType ownerType; } struct Materialization { 1: required bool sourceTablesUpdateDeleteModified; + 2: required bool sourceTablesCompacted; } // Data types for workload management. @@ -1268,6 +1838,7 @@ struct WMResourcePlan { 2: optional WMResourcePlanStatus status; 3: optional i32 queryParallelism; 4: optional string defaultPoolPath; + 5: optional string ns; } struct WMNullableResourcePlan { @@ -1277,6 +1848,7 @@ struct WMNullableResourcePlan { 5: optional bool isSetQueryParallelism; 6: optional string defaultPoolPath; 7: optional bool isSetDefaultPoolPath; + 8: optional string ns; } struct WMPool { @@ -1285,6 +1857,7 @@ struct WMPool { 3: optional double allocFraction; 4: optional i32 queryParallelism; 5: optional string schedulingPolicy; + 6: optional string ns; } @@ -1295,6 +1868,7 @@ struct WMNullablePool { 4: optional i32 queryParallelism; 5: optional string schedulingPolicy; 6: optional bool isSetSchedulingPolicy; + 7: optional string ns; } struct WMTrigger { @@ -1303,6 +1877,7 @@ struct WMTrigger { 3: optional string triggerExpression; 4: optional string actionExpression; 5: optional bool isInUnmanaged; + 6: optional string ns; } struct WMMapping { @@ -1311,11 +1886,13 @@ struct WMMapping { 3: required string entityName; 4: optional string poolPath; 5: optional i32 ordering; + 6: optional string ns; } struct WMPoolTrigger { 1: required string pool; 2: required string trigger; + 3: optional string ns; } struct WMFullResourcePlan { @@ -1337,6 +1914,7 @@ struct WMCreateResourcePlanResponse { } struct WMGetActiveResourcePlanRequest { + 1: optional string ns; } struct WMGetActiveResourcePlanResponse { @@ -1345,6 +1923,7 @@ struct WMGetActiveResourcePlanResponse { struct WMGetResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMGetResourcePlanResponse { @@ -1352,6 +1931,7 @@ struct WMGetResourcePlanResponse { } struct WMGetAllResourcePlanRequest { + 1: optional string ns; } struct WMGetAllResourcePlanResponse { @@ -1364,6 +1944,7 @@ struct WMAlterResourcePlanRequest { 3: optional bool isEnableAndActivate; 4: optional bool isForceDeactivate; 5: optional bool isReplace; + 6: optional string ns; } struct WMAlterResourcePlanResponse { @@ -1372,6 +1953,7 @@ struct WMAlterResourcePlanResponse { struct WMValidateResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMValidateResourcePlanResponse { @@ -1381,6 +1963,7 @@ struct WMValidateResourcePlanResponse { struct WMDropResourcePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMDropResourcePlanResponse { @@ -1403,6 +1986,7 @@ struct WMAlterTriggerResponse { struct WMDropTriggerRequest { 1: optional string resourcePlanName; 2: optional string triggerName; + 3: optional string ns; } struct WMDropTriggerResponse { @@ -1410,6 +1994,7 @@ struct WMDropTriggerResponse { struct WMGetTriggersForResourePlanRequest { 1: optional string resourcePlanName; + 2: optional string ns; } struct WMGetTriggersForResourePlanResponse { @@ -1434,6 +2019,7 @@ struct WMAlterPoolResponse { struct WMDropPoolRequest { 1: optional string resourcePlanName; 2: optional string poolPath; + 3: optional string ns; } struct WMDropPoolResponse { @@ -1459,6 +2045,7 @@ struct WMCreateOrDropTriggerToPoolMappingRequest { 2: optional string triggerName; 3: optional string poolPath; 4: optional bool drop; + 5: optional string ns; } struct WMCreateOrDropTriggerToPoolMappingResponse { @@ -1542,6 +2129,374 @@ struct GetRuntimeStatsRequest { 2: required i32 maxCreateTime } +struct CreateTableRequest { + 1: required Table table, + 2: optional EnvironmentContext envContext, + 3: optional list primaryKeys, + 4: optional list foreignKeys, + 5: optional list uniqueConstraints, + 6: optional list notNullConstraints, + 7: optional list defaultConstraints, + 8: optional list checkConstraints, + 9: optional list processorCapabilities, + 10: optional string processorIdentifier +} + +struct CreateDatabaseRequest { + 1: required string databaseName, + 2: optional string description, + 3: optional string locationUri, + 4: optional map parameters, + 5: optional PrincipalPrivilegeSet privileges, + 6: optional string ownerName, + 7: optional PrincipalType ownerType, + 8: optional string catalogName, + 9: optional i32 createTime, + 10: optional string managedLocationUri, + 11: optional DatabaseType type, + 12: optional string dataConnectorName, + 13: optional string remote_dbname +} + +struct CreateDataConnectorRequest { + 1: required DataConnector connector +} + +struct GetDataConnectorRequest { + 1: required string connectorName +} + +struct AlterDataConnectorRequest { + 1: required string connectorName, + 2: required DataConnector newConnector +} + +struct DropDataConnectorRequest { + 1: required string connectorName, + 2: optional bool ifNotExists, + 3: optional bool checkReferences +} + +struct ScheduledQueryPollRequest { + 1: required string clusterNamespace +} + +struct ScheduledQueryKey { + 1: required string scheduleName, + 2: required string clusterNamespace, +} + +struct ScheduledQueryPollResponse { + 1: optional ScheduledQueryKey scheduleKey, + 2: optional i64 executionId, + 3: optional string query, + 4: optional string user, +} + +struct ScheduledQuery { + 1: required ScheduledQueryKey scheduleKey, + 2: optional bool enabled, + 4: optional string schedule, + 5: optional string user, + 6: optional string query, + 7: optional i32 nextExecution, +} + +enum ScheduledQueryMaintenanceRequestType { + CREATE = 1, + ALTER = 2, + DROP = 3, +} + +struct ScheduledQueryMaintenanceRequest { + 1: required ScheduledQueryMaintenanceRequestType type, + 2: required ScheduledQuery scheduledQuery, +} + +enum QueryState { + INITED, + EXECUTING, + FAILED, + FINISHED, + TIMED_OUT, + AUTO_DISABLED, +} + +struct ScheduledQueryProgressInfo{ + 1: required i64 scheduledExecutionId, + 2: required QueryState state, + 3: required string executorQueryId, + 4: optional string errorMessage, +} + +struct AlterPartitionsRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tableName, + 4: required list partitions, + 5: optional EnvironmentContext environmentContext, + 6: optional i64 writeId=-1, + 7: optional string validWriteIdList, + 8: optional bool skipColumnSchemaForPartition, + 9: optional list partitionColSchema +} + +struct AppendPartitionsRequest { + 1: optional string catalogName, + 2: required string dbName, + 3: required string tableName, + 4: optional string name, + 5: optional list partVals, + 6: optional EnvironmentContext environmentContext +} + +struct AlterPartitionsResponse { +} + +struct RenamePartitionRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tableName, + 4: required list partVals, + 5: required Partition newPart, + 6: optional string validWriteIdList, + 7: optional i64 txnId, // txnId associated with the rename operation + 8: optional bool clonePart // non-blocking rename +} + +struct RenamePartitionResponse { +} + +struct AlterTableRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tableName, + 4: required Table table, + 5: optional EnvironmentContext environmentContext, + 6: optional i64 writeId=-1, + 7: optional string validWriteIdList + 8: optional list processorCapabilities, + 9: optional string processorIdentifier, + 10: optional string expectedParameterKey, + 11: optional string expectedParameterValue +// TODO: also add cascade here, out of envCtx +} + +struct AlterTableResponse { +} + +enum PartitionFilterMode { + BY_NAMES, // filter by names + BY_VALUES, // filter by values + BY_EXPR // filter by expression +} + +struct GetPartitionsFilterSpec { + 7: optional PartitionFilterMode filterMode, + 8: optional list filters //used as list of partitionNames or list of values or expressions depending on mode +} + +struct GetPartitionsResponse { + 1: list partitionSpec +} + +struct GetPartitionsRequest { + 1: optional string catName, + 2: string dbName, + 3: string tblName, + 4: optional bool withAuth, + 5: optional string user, + 6: optional list groupNames, + 7: GetProjectionsSpec projectionSpec + 8: GetPartitionsFilterSpec filterSpec, + 9: optional list processorCapabilities, + 10: optional string processorIdentifier, + 11: optional string validWriteIdList +} + +struct GetFieldsRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional EnvironmentContext envContext, + 5: optional string validWriteIdList, + 6: optional i64 id=-1 // table id +} + +struct GetFieldsResponse { + 1: required list fields +} + +struct GetSchemaRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional EnvironmentContext envContext, + 5: optional string validWriteIdList, + 6: optional i64 id=-1 // table id +} + +struct GetSchemaResponse { + 1: required list fields +} + +struct GetPartitionRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: required list partVals, + 5: optional string validWriteIdList, + 6: optional i64 id=-1 // table id +} + +struct GetPartitionResponse { + 1: required Partition partition +} + +struct PartitionsRequest { // Not using Get prefix as that name is already used for a different method + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional i16 maxParts=-1, + 5: optional string validWriteIdList, + 6: optional i64 id=-1, // table id + 7: optional bool skipColumnSchemaForPartition, + 8: optional string includeParamKeyPattern, + 9: optional string excludeParamKeyPattern +} + +struct PartitionsResponse { // Not using Get prefix as that name is already used for a different method + 1: required list partitions +} + +struct GetPartitionsByFilterRequest { + 1: optional string catName, + 2: string dbName, + 3: string tblName, + 4: string filter, + 5: optional i16 maxParts=-1, + 6: optional bool skipColumnSchemaForPartition, + 7: optional string includeParamKeyPattern, + 8: optional string excludeParamKeyPattern +} + +struct GetPartitionNamesPsRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional list partValues, + 5: optional i16 maxParts=-1, + 6: optional string validWriteIdList, + 7: optional i64 id=-1 // table id +} + +struct GetPartitionNamesPsResponse { + 1: required list names +} + +struct GetPartitionsPsWithAuthRequest { + 1: optional string catName, + 2: required string dbName, + 3: required string tblName, + 4: optional list partVals, + 5: optional i16 maxParts=-1, + 6: optional string userName, + 7: optional list groupNames, + 8: optional string validWriteIdList, + 9: optional i64 id=-1 // table id + 10: optional bool skipColumnSchemaForPartition, + 11: optional string includeParamKeyPattern, + 12: optional string excludeParamKeyPattern, + 13: optional list partNames; +} + +struct GetPartitionsPsWithAuthResponse { + 1: required list partitions +} + +struct ReplicationMetrics{ + 1: required i64 scheduledExecutionId, + 2: required string policy, + 3: required i64 dumpExecutionId, + 4: optional string metadata, + 5: optional string progress, + 6: optional string messageFormat +} + +struct ReplicationMetricList{ + 1: required list replicationMetricList, +} + +struct GetReplicationMetricsRequest { + 1: optional i64 scheduledExecutionId, + 2: optional string policy, + 3: optional i64 dumpExecutionId +} + +struct GetOpenTxnsRequest { + 1: optional list excludeTxnTypes; +} + +struct StoredProcedureRequest { + 1: required string catName, + 2: required string dbName, + 3: required string procName +} + +struct ListStoredProcedureRequest { + 1: required string catName + 2: optional string dbName +} + +struct StoredProcedure { + 1: string name, + 2: string dbName, + 3: string catName, + 4: string ownerName, + 5: string source +} + +struct AddPackageRequest { + 1: string catName, + 2: string dbName, + 3: string packageName + 4: string ownerName, + 5: string header, + 6: string body +} + +struct GetPackageRequest { + 1: required string catName, + 2: required string dbName, + 3: required string packageName +} + +struct DropPackageRequest { + 1: required string catName, + 2: required string dbName, + 3: required string packageName +} + +struct ListPackageRequest { + 1: required string catName + 2: optional string dbName +} + +struct Package { + 1: string catName, + 2: string dbName, + 3: string packageName + 4: string ownerName, + 5: string header, + 6: string body +} + +struct GetAllWriteEventInfoRequest { + 1: required i64 txnId, + 2: optional string dbName, + 3: optional string tableName +} + // Exceptions. exception MetaException { @@ -1605,11 +2560,19 @@ exception NoSuchLockException { 1: string message } +exception CompactionAbortedException { + 1: string message +} + +exception NoSuchCompactionException { + 1: string message +} /** * This interface is live. */ service ThriftHiveMetastore extends fb303.FacebookService { + AbortCompactResponse abort_Compactions(1: AbortCompactionRequest rqst) string getMetaConf(1:string key) throws(1:MetaException o1) void setMetaConf(1:string key, 2:string value) throws(1:MetaException o1) @@ -1620,13 +2583,23 @@ service ThriftHiveMetastore extends fb303.FacebookService void drop_catalog(1: DropCatalogRequest catName) throws (1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) + void create_database_req(1:CreateDatabaseRequest createDatabaseRequest) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2) + Database get_database_req(1:GetDatabaseRequest request) throws(1:NoSuchObjectException o1, 2:MetaException o2) void drop_database(1:string name, 2:bool deleteData, 3:bool cascade) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + void drop_database_req(1:DropDatabaseRequest req) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) list get_databases(1:string pattern) throws(1:MetaException o1) list get_all_databases() throws(1:MetaException o1) void alter_database(1:string dbname, 2:Database db) throws(1:MetaException o1, 2:NoSuchObjectException o2) + void alter_database_req(1:AlterDatabaseRequest alterDbReq) throws(1:MetaException o1, 2:NoSuchObjectException o2) + + void create_dataconnector_req(1:CreateDataConnectorRequest connectorReq) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) + DataConnector get_dataconnector_req(1:GetDataConnectorRequest request) throws(1:NoSuchObjectException o1, 2:MetaException o2) + void drop_dataconnector_req(1:DropDataConnectorRequest dropDcReq) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3) + list get_dataconnectors() throws(1:MetaException o1) + void alter_dataconnector_req(1:AlterDataConnectorRequest alterReq) throws(1:MetaException o1, 2:NoSuchObjectException o2) - // returns the type with given name (make seperate calls for the dependent types if needed) + // returns the type with given name (make seperate calls for the dependent types if needed) Type get_type(1:string name) throws(1:MetaException o1, 2:NoSuchObjectException o2) bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3) bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2) @@ -1634,12 +2607,18 @@ service ThriftHiveMetastore extends fb303.FacebookService throws(1:MetaException o2) // Gets a list of FieldSchemas describing the columns of a particular table - list get_fields(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3), - list get_fields_with_environment_context(1: string db_name, 2: string table_name, 3:EnvironmentContext environment_context) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + list get_fields(1:string db_name, 2:string table_name) throws(1:MetaException o1, 2:UnknownTableException o2, 3:UnknownDBException o3) + list get_fields_with_environment_context(1:string db_name, 2:string table_name, 3:EnvironmentContext environment_context) throws(1:MetaException o1, 2:UnknownTableException o2, 3:UnknownDBException o3) + + GetFieldsResponse get_fields_req(1: GetFieldsRequest req) + throws(1:MetaException o1, 2:UnknownTableException o2, 3:UnknownDBException o3) // Gets a list of FieldSchemas describing both the columns and the partition keys of a particular table - list get_schema(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) - list get_schema_with_environment_context(1: string db_name, 2: string table_name, 3:EnvironmentContext environment_context) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + list get_schema(1:string db_name, 2:string table_name) throws(1:MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3) + list get_schema_with_environment_context(1:string db_name, 2:string table_name, 3:EnvironmentContext environment_context) throws(1:MetaException o1, 2:UnknownTableException o2, 3:UnknownDBException o3) + + GetSchemaResponse get_schema_req(1: GetSchemaRequest req) + throws(1:MetaException o1, 2:UnknownTableException o2, 3:UnknownDBException o3) // create a Hive table. Following fields must be set // tableName @@ -1657,11 +2636,14 @@ service ThriftHiveMetastore extends fb303.FacebookService 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) void create_table_with_constraints(1:Table tbl, 2: list primaryKeys, 3: list foreignKeys, - 4: list uniqueConstraints, 5: list notNullConstraints, - 6: list defaultConstraints, 7: list checkConstraints) + 4: list uniqueConstraints, 5: list notNullConstraints, + 6: list defaultConstraints, 7: list checkConstraints) throws (1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) + void create_table_req(1:CreateTableRequest request) throws (1:AlreadyExistsException o1, + 2:InvalidObjectException o2, 3:MetaException o3, + 4:NoSuchObjectException o4) void drop_constraint(1:DropConstraintRequest req) throws(1:NoSuchObjectException o1, 2:MetaException o3) void add_primary_key(1:AddPrimaryKeyRequest req) @@ -1676,7 +2658,8 @@ service ThriftHiveMetastore extends fb303.FacebookService throws(1:NoSuchObjectException o1, 2:MetaException o2) void add_check_constraint(1:AddCheckConstraintRequest req) throws(1:NoSuchObjectException o1, 2:MetaException o2) - + Table translate_table_dryrun(1:CreateTableRequest request) + throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) // drops the table and all the partitions associated with it if the table has partitions // delete data (including partitions) if deleteData is set to true void drop_table(1:string dbname, 2:string name, 3:bool deleteData) @@ -1684,18 +2667,20 @@ service ThriftHiveMetastore extends fb303.FacebookService void drop_table_with_environment_context(1:string dbname, 2:string name, 3:bool deleteData, 4:EnvironmentContext environment_context) throws(1:NoSuchObjectException o1, 2:MetaException o3) + void drop_table_req(1:DropTableRequest dropTableReq) + throws(1:NoSuchObjectException o1, 2:MetaException o3) void truncate_table(1:string dbName, 2:string tableName, 3:list partNames) throws(1:MetaException o1) + TruncateTableResponse truncate_table_req(1:TruncateTableRequest req) throws(1:MetaException o1) list get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1) list get_tables_by_type(1: string db_name, 2: string pattern, 3: string tableType) throws (1: MetaException o1) + list
get_all_materialized_view_objects_for_rewriting() throws (1:MetaException o1) list get_materialized_views_for_rewriting(1: string db_name) throws (1: MetaException o1) list get_table_meta(1: string db_patterns, 2: string tbl_patterns, 3: list tbl_types) throws (1: MetaException o1) list get_all_tables(1: string db_name) throws (1: MetaException o1) - Table get_table(1:string dbname, 2:string tbl_name) - throws (1:MetaException o1, 2:NoSuchObjectException o2) - list
get_table_objects_by_name(1:string dbname, 2:list tbl_names) + list get_tables_ext(1: GetTablesExtRequest req) throws (1: MetaException o1) GetTableResult get_table_req(1:GetTableRequest req) throws (1:MetaException o1, 2:NoSuchObjectException o2) GetTablesResult get_table_objects_by_name_req(1:GetTablesRequest req) throws (1:MetaException o1, 2:InvalidOperationException o2, 3:UnknownDBException o3) @@ -1751,6 +2736,11 @@ service ThriftHiveMetastore extends fb303.FacebookService // alter table not only applies to future partitions but also cascade to existing partitions void alter_table_with_cascade(1:string dbname, 2:string tbl_name, 3:Table new_tbl, 4:bool cascade) throws (1:InvalidOperationException o1, 2:MetaException o2) + AlterTableResponse alter_table_req(1:AlterTableRequest req) + throws (1:InvalidOperationException o1, 2:MetaException o2) + + + // the following applies to only tables that have partitions // * See notes on DDL_TIME Partition add_partition(1:Partition new_part) @@ -1770,6 +2760,8 @@ service ThriftHiveMetastore extends fb303.FacebookService Partition append_partition_with_environment_context(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:EnvironmentContext environment_context) throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) + Partition append_partition_req(1:AppendPartitionsRequest appendPartitionsReq) + throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) Partition append_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name) throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3) Partition append_partition_by_name_with_environment_context(1:string db_name, 2:string tbl_name, @@ -1780,6 +2772,8 @@ service ThriftHiveMetastore extends fb303.FacebookService bool drop_partition_with_environment_context(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:bool deleteData, 5:EnvironmentContext environment_context) throws(1:NoSuchObjectException o1, 2:MetaException o2) + bool drop_partition_req(1:DropPartitionRequest dropPartitionReq) + throws(1:NoSuchObjectException o1, 2:MetaException o2) bool drop_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name, 4:bool deleteData) throws(1:NoSuchObjectException o1, 2:MetaException o2) bool drop_partition_by_name_with_environment_context(1:string db_name, 2:string tbl_name, @@ -1790,6 +2784,8 @@ service ThriftHiveMetastore extends fb303.FacebookService Partition get_partition(1:string db_name, 2:string tbl_name, 3:list part_vals) throws(1:MetaException o1, 2:NoSuchObjectException o2) + GetPartitionResponse get_partition_req(1: GetPartitionRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) Partition exchange_partition(1:map partitionSpecs, 2:string source_db, 3:string source_table_name, 4:string dest_db, 5:string dest_table_name) throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3, @@ -1810,6 +2806,8 @@ service ThriftHiveMetastore extends fb303.FacebookService // If max parts is given then it will return only that many. list get_partitions(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1) throws(1:NoSuchObjectException o1, 2:MetaException o2) +PartitionsResponse get_partitions_req(1:PartitionsRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o2) list get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1, 4: string user_name, 5: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2) @@ -1818,7 +2816,8 @@ service ThriftHiveMetastore extends fb303.FacebookService list get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1) throws(1:NoSuchObjectException o1, 2:MetaException o2) - + list fetch_partition_names_req(1:PartitionsRequest partitionReq) + throws(1:NoSuchObjectException o1, 2:MetaException o2) PartitionValuesResponse get_partition_values(1:PartitionValuesRequest request) throws(1:MetaException o1, 2:NoSuchObjectException o2); @@ -1831,18 +2830,29 @@ service ThriftHiveMetastore extends fb303.FacebookService list get_partitions_ps(1:string db_name 2:string tbl_name 3:list part_vals, 4:i16 max_parts=-1) throws(1:MetaException o1, 2:NoSuchObjectException o2) - list get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1, + list get_partitions_ps_with_auth(1:string db_name, + 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1, 5: string user_name, 6: list group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2) + GetPartitionsPsWithAuthResponse get_partitions_ps_with_auth_req(1:GetPartitionsPsWithAuthRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) list get_partition_names_ps(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:i16 max_parts=-1) throws(1:MetaException o1, 2:NoSuchObjectException o2) + GetPartitionNamesPsResponse get_partition_names_ps_req(1:GetPartitionNamesPsRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + list get_partition_names_req(1:PartitionsByExprRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) // get the partitions matching the given partition filter list get_partitions_by_filter(1:string db_name 2:string tbl_name 3:string filter, 4:i16 max_parts=-1) throws(1:MetaException o1, 2:NoSuchObjectException o2) + list get_partitions_by_filter_req(1:GetPartitionsByFilterRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + // List partitions as PartitionSpec instances. list get_part_specs_by_filter(1:string db_name 2:string tbl_name 3:string filter, 4:i32 max_parts=-1) @@ -1855,12 +2865,25 @@ service ThriftHiveMetastore extends fb303.FacebookService throws(1:MetaException o1, 2:NoSuchObjectException o2) // get the partitions matching the given partition filter + // unlike get_partitions_by_expr, this returns PartitionSpec which contains deduplicated + // storage descriptor + PartitionsSpecByExprResult get_partitions_spec_by_expr(1:PartitionsByExprRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + + // get the partitions matching the given partition filter i32 get_num_partitions_by_filter(1:string db_name 2:string tbl_name 3:string filter) throws(1:MetaException o1, 2:NoSuchObjectException o2) // get partitions give a list of partition names list get_partitions_by_names(1:string db_name 2:string tbl_name 3:list names) - throws(1:MetaException o1, 2:NoSuchObjectException o2) + throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3) + GetPartitionsByNamesResult get_partitions_by_names_req(1:GetPartitionsByNamesRequest req) + throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:InvalidObjectException o3) + + // retrieve properties + PropertyGetResponse get_properties(1:PropertyGetRequest req) throws(1:MetaException e1, 2:NoSuchObjectException e2); + // set properties + bool set_properties(1:PropertySetRequest req) throws(1:MetaException e1, 2:NoSuchObjectException e2); // changes the partition to the new partition object. partition is identified from the part values // in the new_part @@ -1872,8 +2895,12 @@ service ThriftHiveMetastore extends fb303.FacebookService // prehooks are fired together followed by all post hooks void alter_partitions(1:string db_name, 2:string tbl_name, 3:list new_parts) throws (1:InvalidOperationException o1, 2:MetaException o2) + void alter_partitions_with_environment_context(1:string db_name, 2:string tbl_name, 3:list new_parts, 4:EnvironmentContext environment_context) throws (1:InvalidOperationException o1, 2:MetaException o2) + AlterPartitionsResponse alter_partitions_req(1:AlterPartitionsRequest req) + throws (1:InvalidOperationException o1, 2:MetaException o2) + void alter_partition_with_environment_context(1:string db_name, 2:string tbl_name, 3:Partition new_part, 4:EnvironmentContext environment_context) @@ -1885,6 +2912,9 @@ service ThriftHiveMetastore extends fb303.FacebookService void rename_partition(1:string db_name, 2:string tbl_name, 3:list part_vals, 4:Partition new_part) throws (1:InvalidOperationException o1, 2:MetaException o2) + RenamePartitionResponse rename_partition_req(1:RenamePartitionRequest req) + throws (1:InvalidOperationException o1, 2:MetaException o2) + // returns whether or not the partition name is valid based on the value of the config // hive.metastore.partition.name.whitelist.pattern bool partition_name_has_valid_characters(1:list part_vals, 2:bool throw_exception) @@ -1928,6 +2958,9 @@ service ThriftHiveMetastore extends fb303.FacebookService throws(1:MetaException o1, 2:NoSuchObjectException o2) CheckConstraintsResponse get_check_constraints(1:CheckConstraintsRequest request) throws(1:MetaException o1, 2:NoSuchObjectException o2) + // All table constrains + AllTableConstraintsResponse get_all_table_constraints(1:AllTableConstraintsRequest request) + throws(1:MetaException o1, 2:NoSuchObjectException o2) // column statistics interfaces @@ -1940,6 +2973,14 @@ service ThriftHiveMetastore extends fb303.FacebookService bool update_partition_column_statistics(1:ColumnStatistics stats_obj) throws (1:NoSuchObjectException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + SetPartitionsStatsResponse update_table_column_statistics_req(1:SetPartitionsStatsRequest req) throws (1:NoSuchObjectException o1, + 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + SetPartitionsStatsResponse update_partition_column_statistics_req(1:SetPartitionsStatsRequest req) throws (1:NoSuchObjectException o1, + 2:InvalidObjectException o2, 3:MetaException o3, 4:InvalidInputException o4) + + void update_transaction_statistics(1:UpdateTransactionalStatsRequest req) throws (1:MetaException o1) + + // get APIs return the column statistics corresponding to db_name, tbl_name, [part_name], col_name if // such statistics exists. If the required statistics doesn't exist, get APIs throw NoSuchObjectException // For instance, if get_table_column_statistics is called on a partitioned table for which only @@ -1962,10 +3003,10 @@ service ThriftHiveMetastore extends fb303.FacebookService // delete APIs attempt to delete column statistics, if found, associated with a given db_name, tbl_name, [part_name] // and col_name. If the delete API doesn't find the statistics record in the metastore, throws NoSuchObjectException // Delete API validates the input and if the input is invalid throws InvalidInputException/InvalidObjectException. - bool delete_partition_column_statistics(1:string db_name, 2:string tbl_name, 3:string part_name, 4:string col_name) throws + bool delete_partition_column_statistics(1:string db_name, 2:string tbl_name, 3:string part_name, 4:string col_name, 5:string engine) throws (1:NoSuchObjectException o1, 2:MetaException o2, 3:InvalidObjectException o3, 4:InvalidInputException o4) - bool delete_table_column_statistics(1:string db_name, 2:string tbl_name, 3:string col_name) throws + bool delete_table_column_statistics(1:string db_name, 2:string tbl_name, 3:string col_name, 4:string engine) throws (1:NoSuchObjectException o1, 2:MetaException o2, 3:InvalidObjectException o3, 4:InvalidInputException o4) @@ -2072,6 +3113,7 @@ service ThriftHiveMetastore extends fb303.FacebookService // Transaction and lock management calls // Get just list of open transactions + // Deprecated use get_open_txns_req GetOpenTxnsResponse get_open_txns() // Get list of open transactions with state (open, aborted) GetOpenTxnsInfoResponse get_open_txns_info() @@ -2079,11 +3121,18 @@ service ThriftHiveMetastore extends fb303.FacebookService void abort_txn(1:AbortTxnRequest rqst) throws (1:NoSuchTxnException o1) void abort_txns(1:AbortTxnsRequest rqst) throws (1:NoSuchTxnException o1) void commit_txn(1:CommitTxnRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + i64 get_latest_txnid_in_conflict(1:i64 txnId) throws (1:MetaException o1) void repl_tbl_writeid_state(1: ReplTblWriteIdStateRequest rqst) GetValidWriteIdsResponse get_valid_write_ids(1:GetValidWriteIdsRequest rqst) throws (1:NoSuchTxnException o1, 2:MetaException o2) + void add_write_ids_to_min_history(1:i64 txnId, 2: map writeIds) throws (1:MetaException o2) AllocateTableWriteIdsResponse allocate_table_write_ids(1:AllocateTableWriteIdsRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2, 3:MetaException o3) + MaxAllocatedTableWriteIdResponse get_max_allocated_table_write_id(1:MaxAllocatedTableWriteIdRequest rqst) + throws (1:MetaException o1) + void seed_write_id(1:SeedTableWriteIdsRequest rqst) + throws (1:MetaException o1) + void seed_txn_id(1:SeedTxnIdRequest rqst) throws (1:MetaException o1) LockResponse lock(1:LockRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) LockResponse check_lock(1:CheckLockRequest rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2, 3:NoSuchLockException o3) @@ -2094,7 +3143,21 @@ service ThriftHiveMetastore extends fb303.FacebookService void compact(1:CompactionRequest rqst) CompactionResponse compact2(1:CompactionRequest rqst) ShowCompactResponse show_compact(1:ShowCompactRequest rqst) + bool submit_for_cleanup(1:CompactionRequest o1, 2:i64 o2, 3:i64 o3) throws (1:MetaException o1) void add_dynamic_partitions(1:AddDynamicPartitions rqst) throws (1:NoSuchTxnException o1, 2:TxnAbortedException o2) + // Deprecated, use find_next_compact2() + OptionalCompactionInfoStruct find_next_compact(1: string workerId) throws(1:MetaException o1) + OptionalCompactionInfoStruct find_next_compact2(1: FindNextCompactRequest rqst) throws(1:MetaException o1) + void update_compactor_state(1: CompactionInfoStruct cr, 2: i64 txn_id) + list find_columns_with_stats(1: CompactionInfoStruct cr) + void mark_cleaned(1:CompactionInfoStruct cr) throws(1:MetaException o1) + void mark_compacted(1: CompactionInfoStruct cr) throws(1:MetaException o1) + void mark_failed(1: CompactionInfoStruct cr) throws(1:MetaException o1) + void mark_refused(1: CompactionInfoStruct cr) throws(1:MetaException o1) + bool update_compaction_metrics_data(1: CompactionMetricsDataStruct data) throws(1:MetaException o1) + void remove_compaction_metrics_data(1: CompactionMetricsDataRequest request) throws(1:MetaException o1) + void set_hadoop_jobid(1: string jobId, 2: i64 cq_id) + GetLatestCommittedCompactionInfoResponse get_latest_committed_compaction_info(1:GetLatestCommittedCompactionInfoRequest rqst) // Notification logging calls NotificationEventResponse get_next_notification(1:NotificationEventRequest rqst) @@ -2102,6 +3165,8 @@ service ThriftHiveMetastore extends fb303.FacebookService NotificationEventsCountResponse get_notification_events_count(1:NotificationEventsCountRequest rqst) FireEventResponse fire_listener_event(1:FireEventRequest rqst) void flushCache() + WriteNotificationLogResponse add_write_notification_log(1:WriteNotificationLogRequest rqst) + WriteNotificationLogBatchResponse add_write_notification_log_in_batch(1:WriteNotificationLogBatchRequest rqst) // Repl Change Management api CmRecycleResponse cm_recycle(1:CmRecycleRequest request) throws(1:MetaException o1) @@ -2169,7 +3234,7 @@ service ThriftHiveMetastore extends fb303.FacebookService // Schema calls void create_ischema(1:ISchema schema) throws(1:AlreadyExistsException o1, - NoSuchObjectException o2, 3:MetaException o3) + 2: NoSuchObjectException o2, 3:MetaException o3) void alter_ischema(1:AlterISchemaRequest rqst) throws(1:NoSuchObjectException o1, 2:MetaException o2) ISchema get_ischema(1:ISchemaName name) throws (1:NoSuchObjectException o1, 2:MetaException o2) @@ -2203,6 +3268,29 @@ service ThriftHiveMetastore extends fb303.FacebookService void add_runtime_stats(1: RuntimeStat stat) throws(1:MetaException o1) list get_runtime_stats(1: GetRuntimeStatsRequest rqst) throws(1:MetaException o1) + + // get_partitions with filter and projectspec + GetPartitionsResponse get_partitions_with_specs(1: GetPartitionsRequest request) throws(1:MetaException o1) + + ScheduledQueryPollResponse scheduled_query_poll(1: ScheduledQueryPollRequest request) throws(1:MetaException o1) + void scheduled_query_maintenance(1: ScheduledQueryMaintenanceRequest request) throws(1:MetaException o1, 2:NoSuchObjectException o2, 3:AlreadyExistsException o3, 4:InvalidInputException o4) + void scheduled_query_progress(1: ScheduledQueryProgressInfo info) throws(1:MetaException o1, 2: InvalidOperationException o2) + ScheduledQuery get_scheduled_query(1: ScheduledQueryKey scheduleKey) throws(1:MetaException o1, 2:NoSuchObjectException o2) + + void add_replication_metrics(1: ReplicationMetricList replicationMetricList) throws(1:MetaException o1) + ReplicationMetricList get_replication_metrics(1: GetReplicationMetricsRequest rqst) throws(1:MetaException o1) + GetOpenTxnsResponse get_open_txns_req(1: GetOpenTxnsRequest getOpenTxnsRequest) + + void create_stored_procedure(1: StoredProcedure proc) throws(1:NoSuchObjectException o1, 2:MetaException o2) + StoredProcedure get_stored_procedure(1: StoredProcedureRequest request) throws (1:MetaException o1, 2:NoSuchObjectException o2) + void drop_stored_procedure(1: StoredProcedureRequest request) throws (1:MetaException o1) + list get_all_stored_procedures(1: ListStoredProcedureRequest request) throws (1:MetaException o1) + + Package find_package(1: GetPackageRequest request) throws (1:MetaException o1, 2:NoSuchObjectException o2) + void add_package(1: AddPackageRequest request) throws (1:MetaException o1) + list get_all_packages(1: ListPackageRequest request) throws (1:MetaException o1) + void drop_package(1: DropPackageRequest request) throws (1:MetaException o1) + list get_all_write_event_info(1: GetAllWriteEventInfoRequest request) throws (1:MetaException o1) } // * Note about the DDL_TIME: When creating or altering a table or a partition, @@ -2229,6 +3317,7 @@ const string META_TABLE_COLUMN_TYPES = "columns.types", const string BUCKET_FIELD_NAME = "bucket_field_name", const string BUCKET_COUNT = "bucket_count", const string FIELD_TO_DIMENSION = "field_to_dimension", +const string IF_PURGE = "ifPurge", const string META_TABLE_NAME = "name", const string META_TABLE_DB = "db", const string META_TABLE_LOCATION = "location", @@ -2239,6 +3328,22 @@ const string FILE_INPUT_FORMAT = "file.inputformat", const string FILE_OUTPUT_FORMAT = "file.outputformat", const string META_TABLE_STORAGE = "storage_handler", const string TABLE_IS_TRANSACTIONAL = "transactional", -const string TABLE_NO_AUTO_COMPACT = "no_auto_compaction", +const string NO_AUTO_COMPACT = "no_auto_compaction", const string TABLE_TRANSACTIONAL_PROPERTIES = "transactional_properties", const string TABLE_BUCKETING_VERSION = "bucketing_version", +const string DRUID_CONFIG_PREFIX = "druid.", +const string JDBC_CONFIG_PREFIX = "hive.sql.", +const string TABLE_IS_CTAS = "created_with_ctas", +const string TABLE_IS_CTLT = "created_with_ctlt", +const string PARTITION_TRANSFORM_SPEC = "partition_transform_spec", +const string NO_CLEANUP = "no_cleanup", +const string CTAS_LEGACY_CONFIG = "create_table_as_external", +const string DEFAULT_TABLE_TYPE = "defaultTableType", + +// ACID +const string TXN_ID = "txnId", +const string WRITE_ID = "writeId", + +// Keys for alter table environment context parameters +const string EXPECTED_PARAMETER_KEY = "expected_parameter_key", +const string EXPECTED_PARAMETER_VALUE = "expected_parameter_value", From 2169e31616617f38d3d160f7bf09825f711a05d5 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Tue, 16 Jun 2026 16:30:17 +0800 Subject: [PATCH 094/151] feat(rest): add session-aware REST catalog (#750) Add SessionContext and SessionCatalog APIs, make RestCatalog a session-aware root, and bind REST catalog operations through default, contextual, and table-scoped catalog views. Route contextual and table auth through AuthManager, preserve table response config for scoped catalogs, and fail closed on unsupported table FileIO config. --- src/iceberg/CMakeLists.txt | 2 + src/iceberg/catalog/meson.build | 5 + src/iceberg/catalog/rest/auth/auth_manager.cc | 3 +- src/iceberg/catalog/rest/auth/auth_manager.h | 6 +- src/iceberg/catalog/rest/auth/oauth2_util.cc | 1 + .../rest/auth/sigv4_auth_manager_internal.h | 3 +- .../catalog/rest/auth/sigv4_manager.cc | 24 +- src/iceberg/catalog/rest/rest_catalog.cc | 581 ++++++++++++++---- src/iceberg/catalog/rest/rest_catalog.h | 120 +++- src/iceberg/catalog/rest/type_fwd.h | 2 +- src/iceberg/catalog/session_catalog.cc | 28 + src/iceberg/catalog/session_catalog.h | 65 ++ src/iceberg/catalog/session_context.cc | 30 + src/iceberg/catalog/session_context.h | 59 ++ src/iceberg/meson.build | 2 + src/iceberg/test/auth_manager_test.cc | 16 + .../test/rest_catalog_integration_test.cc | 85 ++- src/iceberg/test/sigv4_auth_test.cc | 41 +- src/iceberg/type_fwd.h | 2 + 19 files changed, 911 insertions(+), 164 deletions(-) create mode 100644 src/iceberg/catalog/session_catalog.cc create mode 100644 src/iceberg/catalog/session_catalog.h create mode 100644 src/iceberg/catalog/session_context.cc create mode 100644 src/iceberg/catalog/session_context.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 23e20dc59..04a9322a1 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -21,6 +21,8 @@ set(ICEBERG_SOURCES arrow_c_data_util.cc arrow_c_data_guard_internal.cc catalog/memory/in_memory_catalog.cc + catalog/session_catalog.cc + catalog/session_context.cc delete_file_index.cc expression/aggregate.cc expression/binder.cc diff --git a/src/iceberg/catalog/meson.build b/src/iceberg/catalog/meson.build index f19d673e7..1da2e533a 100644 --- a/src/iceberg/catalog/meson.build +++ b/src/iceberg/catalog/meson.build @@ -17,6 +17,11 @@ subdir('memory') +install_headers( + ['session_catalog.h', 'session_context.h'], + subdir: 'iceberg/catalog', +) + if get_option('rest').enabled() subdir('rest') endif diff --git a/src/iceberg/catalog/rest/auth/auth_manager.cc b/src/iceberg/catalog/rest/auth/auth_manager.cc index 247c1d538..10290489a 100644 --- a/src/iceberg/catalog/rest/auth/auth_manager.cc +++ b/src/iceberg/catalog/rest/auth/auth_manager.cc @@ -38,8 +38,7 @@ Result> AuthManager::InitSession( } Result> AuthManager::ContextualSession( - [[maybe_unused]] const std::unordered_map& context, - std::shared_ptr parent) { + [[maybe_unused]] const SessionContext& context, std::shared_ptr parent) { // By default, return the parent session as-is return parent; } diff --git a/src/iceberg/catalog/rest/auth/auth_manager.h b/src/iceberg/catalog/rest/auth/auth_manager.h index c192ecf2c..0a97c9b2a 100644 --- a/src/iceberg/catalog/rest/auth/auth_manager.h +++ b/src/iceberg/catalog/rest/auth/auth_manager.h @@ -70,13 +70,13 @@ class ICEBERG_REST_EXPORT AuthManager { /// This method is used by SessionCatalog to create sessions for different contexts /// (e.g., different users or tenants). /// - /// \param context Context properties (e.g., user credentials, tenant info). + /// \param context Session context (e.g., session ID, identity, credentials, + /// properties). /// \param parent Catalog session to inherit from or return as-is. /// \return A context-specific session, or the parent session if no context-specific /// session is needed, or an error if session creation fails. virtual Result> ContextualSession( - const std::unordered_map& context, - std::shared_ptr parent); + const SessionContext& context, std::shared_ptr parent); /// \brief Create or reuse a session scoped to a single table/view. /// diff --git a/src/iceberg/catalog/rest/auth/oauth2_util.cc b/src/iceberg/catalog/rest/auth/oauth2_util.cc index 0bb76da54..692ef47f3 100644 --- a/src/iceberg/catalog/rest/auth/oauth2_util.cc +++ b/src/iceberg/catalog/rest/auth/oauth2_util.cc @@ -21,6 +21,7 @@ #include +#include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/error_handlers.h" #include "iceberg/catalog/rest/http_client.h" diff --git a/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h b/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h index a4f42875d..53ec0853a 100644 --- a/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h +++ b/src/iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h @@ -126,8 +126,7 @@ class ICEBERG_REST_EXPORT SigV4AuthManager : public AuthManager { const std::unordered_map& properties) override; Result> ContextualSession( - const std::unordered_map& context, - std::shared_ptr parent) override; + const SessionContext& context, std::shared_ptr parent) override; Result> TableSession( const TableIdentifier& table, diff --git a/src/iceberg/catalog/rest/auth/sigv4_manager.cc b/src/iceberg/catalog/rest/auth/sigv4_manager.cc index b3cb4dbd4..6678f1b3f 100644 --- a/src/iceberg/catalog/rest/auth/sigv4_manager.cc +++ b/src/iceberg/catalog/rest/auth/sigv4_manager.cc @@ -19,6 +19,7 @@ #include "iceberg/catalog/rest/auth/auth_manager_internal.h" #include "iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h" +#include "iceberg/catalog/session_context.h" #include "iceberg/result.h" #if ICEBERG_SIGV4_ENABLED @@ -146,6 +147,19 @@ std::unordered_map MergeProperties( return merged; } +Result> ContextProperties( + const SessionContext& context) { + auto merged = context.properties; + for (const auto& [key, value] : context.credentials) { + auto [it, inserted] = merged.emplace(key, value); + if (!inserted && it->second != value) { + return InvalidArgument("Session context has conflicting values for property '{}'", + key); + } + } + return merged; +} + /// Matches Java RESTSigV4AuthSession: canonical headers carry /// Base64(SHA256(body)), canonical request trailer uses hex. class RestSigV4Signer : public Aws::Client::AWSAuthV4Signer { @@ -386,8 +400,7 @@ Result> SigV4AuthManager::CatalogSession( } Result> SigV4AuthManager::ContextualSession( - const std::unordered_map& context, - std::shared_ptr parent) { + const SessionContext& context, std::shared_ptr parent) { auto sigv4_parent = std::dynamic_pointer_cast(std::move(parent)); ICEBERG_PRECHECK(sigv4_parent != nullptr, "SigV4AuthManager parent must be a SigV4AuthSession"); @@ -395,10 +408,11 @@ Result> SigV4AuthManager::ContextualSession( ICEBERG_ASSIGN_OR_RAISE(auto delegate_session, delegate_->ContextualSession( context, sigv4_parent->delegate())); - auto merged = MergeProperties(catalog_properties_, context); + ICEBERG_ASSIGN_OR_RAISE(auto context_properties, ContextProperties(context)); + auto merged = MergeProperties(catalog_properties_, context_properties); ICEBERG_ASSIGN_OR_RAISE( - auto credentials, - ResolveCredentialsProvider(context, sigv4_parent->credentials_provider())); + auto credentials, ResolveCredentialsProvider(context_properties, + sigv4_parent->credentials_provider())); return WrapSession(std::move(delegate_session), merged, std::move(credentials)); } diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 6472adc4b..455c4d744 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -20,6 +20,8 @@ #include "iceberg/catalog/rest/rest_catalog.h" #include +#include +#include #include #include #include @@ -27,6 +29,7 @@ #include #include "iceberg/catalog/rest/auth/auth_managers.h" +#include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/catalog_properties.h" #include "iceberg/catalog/rest/constant.h" @@ -118,12 +121,288 @@ Result CaptureNoSuchNamespace(const auto& status) { return CaptureNoSuchObject(status, ErrorKind::kNoSuchNamespace); } +Status ValidateNoFileIOConfig( + const std::unordered_map& table_config) { + static const std::unordered_set kTableConfigHandledByAuthKeys = { + auth::AuthProperties::kAuthType, + auth::AuthProperties::kBasicUsername, + auth::AuthProperties::kBasicPassword, + auth::AuthProperties::kSigV4Enabled, + auth::AuthProperties::kSigV4DelegateAuthType, + auth::AuthProperties::kSigV4SigningRegion, + auth::AuthProperties::kSigV4SigningName, + auth::AuthProperties::kSigV4AccessKeyId, + auth::AuthProperties::kSigV4SecretAccessKey, + auth::AuthProperties::kSigV4SessionToken, + auth::AuthProperties::kToken.key(), + auth::AuthProperties::kCredential.key(), + auth::AuthProperties::kScope.key(), + auth::AuthProperties::kOAuth2ServerUri.key(), + auth::AuthProperties::kKeepRefreshed.key(), + auth::AuthProperties::kExchangeEnabled.key(), + auth::AuthProperties::kAudience.key(), + auth::AuthProperties::kResource.key(), + }; + + for (const auto& [key, _] : table_config) { + if (!kTableConfigHandledByAuthKeys.contains(key)) { + // Fail closed because unknown table config may be FileIO/storage config. + // TODO(gangwu): Build table-specific FileIO when REST storage + // credentials and table-level storage config are supported. + return NotImplemented( + "Table-specific FileIO is not implemented for table config key '{}'", key); + } + } + return {}; +} + +Status CheckBoundTable(const TableIdentifier& requested, const TableIdentifier& bound) { + if (requested == bound) { + return {}; + } + return InvalidArgument("Table-scoped catalog is bound to '{}', got '{}'", + ToString(bound), ToString(requested)); +} + } // namespace +class RestCatalog::ContextCatalog final + : public Catalog, + public std::enable_shared_from_this { + public: + ContextCatalog(std::shared_ptr root, SessionContext context) + : root_(std::move(root)), context_(std::move(context)) {} + + std::string_view name() const override { return root_->name(); } + + Result> ListNamespaces(const Namespace& ns) const override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->ListNamespaces(ns, *session); + } + + Status CreateNamespace( + const Namespace& ns, + const std::unordered_map& properties) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->CreateNamespace(ns, properties, *session); + } + + Result> GetNamespaceProperties( + const Namespace& ns) const override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->GetNamespaceProperties(ns, *session); + } + + Status DropNamespace(const Namespace& ns) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->DropNamespace(ns, *session); + } + + Result NamespaceExists(const Namespace& ns) const override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->NamespaceExists(ns, *session); + } + + Status UpdateNamespaceProperties( + const Namespace& ns, const std::unordered_map& updates, + const std::unordered_set& removals) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->UpdateNamespaceProperties(ns, updates, removals, *session); + } + + Result> ListTables(const Namespace& ns) const override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->ListTables(ns, *session); + } + + Result> CreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->CreateTable(identifier, schema, spec, order, location, properties, + context_, std::move(session)); + } + + Result> UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->UpdateTable(identifier, requirements, updates, context_, + std::move(session)); + } + + Result> StageCreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->StageCreateTable(identifier, schema, spec, order, location, properties, + context_, std::move(session)); + } + + Result TableExists(const TableIdentifier& identifier) const override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->TableExists(identifier, *session); + } + + Status RenameTable(const TableIdentifier& from, const TableIdentifier& to) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->RenameTable(from, to, *session); + } + + Status DropTable(const TableIdentifier& identifier, bool purge) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->DropTable(identifier, purge, *session); + } + + Result> LoadTable(const TableIdentifier& identifier) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->LoadTable(identifier, context_, session, session); + } + + Result> RegisterTable( + const TableIdentifier& identifier, + const std::string& metadata_file_location) override { + ICEBERG_ASSIGN_OR_RAISE(auto session, root_->ContextualAuthSession(context_)); + return root_->RegisterTable(identifier, metadata_file_location, context_, + std::move(session)); + } + + private: + std::shared_ptr root_; + SessionContext context_; +}; + +class RestCatalog::TableScopedCatalog final + : public Catalog, + public std::enable_shared_from_this { + public: + TableScopedCatalog(std::shared_ptr root, SessionContext context, + TableIdentifier identifier, + std::unordered_map table_config, + std::shared_ptr table_session) + : root_(std::move(root)), + context_(std::move(context)), + identifier_(std::move(identifier)), + table_config_(std::move(table_config)), + table_session_(std::move(table_session)) {} + + std::string_view name() const override { return root_->name(); } + + Result> ListNamespaces(const Namespace& /*ns*/) const override { + return NotSupported("Table-scoped catalog does not support ListNamespaces"); + } + + Status CreateNamespace( + const Namespace& /*ns*/, + const std::unordered_map& /*properties*/) override { + return NotSupported("Table-scoped catalog does not support CreateNamespace"); + } + + Result> GetNamespaceProperties( + const Namespace& /*ns*/) const override { + return NotSupported("Table-scoped catalog does not support GetNamespaceProperties"); + } + + Status DropNamespace(const Namespace& /*ns*/) override { + return NotSupported("Table-scoped catalog does not support DropNamespace"); + } + + Result NamespaceExists(const Namespace& /*ns*/) const override { + return NotSupported("Table-scoped catalog does not support NamespaceExists"); + } + + Status UpdateNamespaceProperties( + const Namespace& /*ns*/, + const std::unordered_map& /*updates*/, + const std::unordered_set& /*removals*/) override { + return NotSupported( + "Table-scoped catalog does not support UpdateNamespaceProperties"); + } + + Result> ListTables( + const Namespace& /*ns*/) const override { + return NotSupported("Table-scoped catalog does not support ListTables"); + } + + Result> CreateTable( + const TableIdentifier& identifier, const std::shared_ptr& /*schema*/, + const std::shared_ptr& /*spec*/, + const std::shared_ptr& /*order*/, const std::string& /*location*/, + const std::unordered_map& /*properties*/) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + return NotSupported("Table-scoped catalog does not support CreateTable"); + } + + Result> UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + ICEBERG_ASSIGN_OR_RAISE( + auto response, + root_->UpdateTableInternal(identifier, requirements, updates, *table_session_)); + return root_->MakeTableFromCommitResponse(identifier, std::move(response), context_, + table_config_, table_session_); + } + + Result> StageCreateTable( + const TableIdentifier& identifier, const std::shared_ptr& /*schema*/, + const std::shared_ptr& /*spec*/, + const std::shared_ptr& /*order*/, const std::string& /*location*/, + const std::unordered_map& /*properties*/) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + return NotSupported("Table-scoped catalog does not support StageCreateTable"); + } + + Result TableExists(const TableIdentifier& identifier) const override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + return root_->TableExists(identifier, *table_session_); + } + + Status RenameTable(const TableIdentifier& from, + const TableIdentifier& /*to*/) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(from, identifier_)); + return NotSupported("Table-scoped catalog does not support RenameTable"); + } + + Status DropTable(const TableIdentifier& identifier, bool /*purge*/) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + return NotSupported("Table-scoped catalog does not support DropTable"); + } + + Result> LoadTable(const TableIdentifier& identifier) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + ICEBERG_ASSIGN_OR_RAISE(auto contextual, root_->ContextualAuthSession(context_)); + return root_->LoadTable(identifier, context_, table_session_, std::move(contextual)); + } + + Result> RegisterTable( + const TableIdentifier& identifier, + const std::string& /*metadata_file_location*/) override { + ICEBERG_RETURN_UNEXPECTED(CheckBoundTable(identifier, identifier_)); + return NotSupported("Table-scoped catalog does not support RegisterTable"); + } + + private: + std::shared_ptr root_; + SessionContext context_; + TableIdentifier identifier_; + std::unordered_map table_config_; + std::shared_ptr table_session_; +}; + RestCatalog::~RestCatalog() { if (catalog_session_) { std::ignore = catalog_session_->Close(); } + if (auth_manager_) { + std::ignore = auth_manager_->Close(); + } } Result> RestCatalog::Make( @@ -178,10 +457,11 @@ Result> RestCatalog::Make( // Create FileIO with the final configuration ICEBERG_ASSIGN_OR_RAISE(auto file_io, MakeCatalogFileIO(final_config)); - return std::shared_ptr( - new RestCatalog(std::move(final_config), std::move(file_io), std::move(client), - std::move(paths), std::move(endpoints), std::move(auth_manager), - std::move(catalog_session), snapshot_mode)); + auto default_context = SessionContext::Empty(); + return std::shared_ptr(new RestCatalog( + std::move(final_config), std::move(file_io), std::move(client), std::move(paths), + std::move(endpoints), std::move(auth_manager), std::move(catalog_session), + snapshot_mode, std::move(default_context))); } RestCatalog::RestCatalog(RestCatalogProperties config, std::shared_ptr file_io, @@ -190,7 +470,7 @@ RestCatalog::RestCatalog(RestCatalogProperties config, std::shared_ptr f std::unordered_set endpoints, std::unique_ptr auth_manager, std::shared_ptr catalog_session, - SnapshotMode snapshot_mode) + SnapshotMode snapshot_mode, SessionContext default_context) : config_(std::move(config)), file_io_(std::move(file_io)), client_(std::move(client)), @@ -199,13 +479,50 @@ RestCatalog::RestCatalog(RestCatalogProperties config, std::shared_ptr f supported_endpoints_(std::move(endpoints)), auth_manager_(std::move(auth_manager)), catalog_session_(std::move(catalog_session)), - snapshot_mode_(snapshot_mode) { + snapshot_mode_(snapshot_mode), + default_context_(std::move(default_context)) { ICEBERG_DCHECK(catalog_session_ != nullptr, "catalog_session must not be null"); } std::string_view RestCatalog::name() const { return name_; } -Result> RestCatalog::ListNamespaces(const Namespace& ns) const { +Result> RestCatalog::AsCatalog() { + if (!default_catalog_) { + default_catalog_ = + std::make_shared(shared_from_this(), default_context_); + } + return default_catalog_; +} + +Result> RestCatalog::WithContext(SessionContext context) { + if (context.session_id.empty()) { + return InvalidArgument("Session context session_id must not be empty"); + } + return std::make_shared(shared_from_this(), std::move(context)); +} + +Result> RestCatalog::ContextualAuthSession( + const SessionContext& context) { + return auth_manager_->ContextualSession(context, catalog_session_); +} + +Result> RestCatalog::TableAuthSession( + const TableIdentifier& identifier, + const std::unordered_map& table_config, + std::shared_ptr contextual_session) { + return auth_manager_->TableSession(identifier, table_config, + std::move(contextual_session)); +} + +Result> RestCatalog::TableFileIO( + const SessionContext& /*context*/, + const std::unordered_map& table_config) const { + ICEBERG_RETURN_UNEXPECTED(ValidateNoFileIOConfig(table_config)); + return file_io_; +} + +Result> RestCatalog::ListNamespaces( + const Namespace& ns, auth::AuthSession& session) const { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::ListNamespaces()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Namespaces()); std::vector result; @@ -220,10 +537,9 @@ Result> RestCatalog::ListNamespaces(const Namespace& ns) if (!next_token.empty()) { params[kQueryParamPageToken] = next_token; } - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Get(path, params, /*headers=*/{}, *NamespaceErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Get(path, params, /*headers=*/{}, + *NamespaceErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto list_response, ListNamespacesResponseFromJson(json)); result.insert(result.end(), list_response.namespaces.begin(), @@ -237,74 +553,74 @@ Result> RestCatalog::ListNamespaces(const Namespace& ns) } Status RestCatalog::CreateNamespace( - const Namespace& ns, const std::unordered_map& properties) { + const Namespace& ns, const std::unordered_map& properties, + auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::CreateNamespace()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Namespaces()); CreateNamespaceRequest request{.namespace_ = ns, .properties = properties}; ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Post(path, json_request, /*headers=*/{}, - *NamespaceErrorHandler::Instance(), *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Post(path, json_request, /*headers=*/{}, + *NamespaceErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto create_response, CreateNamespaceResponseFromJson(json)); return {}; } Result> RestCatalog::GetNamespaceProperties( - const Namespace& ns) const { + const Namespace& ns, auth::AuthSession& session) const { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::GetNamespaceProperties()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Namespace_(ns)); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Get(path, /*params=*/{}, /*headers=*/{}, - *NamespaceErrorHandler::Instance(), *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Get(path, /*params=*/{}, /*headers=*/{}, + *NamespaceErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto get_response, GetNamespaceResponseFromJson(json)); return get_response.properties; } -Status RestCatalog::DropNamespace(const Namespace& ns) { +Status RestCatalog::DropNamespace(const Namespace& ns, auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::DropNamespace()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Namespace_(ns)); ICEBERG_ASSIGN_OR_RAISE( const auto response, client_->Delete(path, /*params=*/{}, /*headers=*/{}, - *DropNamespaceErrorHandler::Instance(), *catalog_session_)); + *DropNamespaceErrorHandler::Instance(), session)); return {}; } -Result RestCatalog::NamespaceExists(const Namespace& ns) const { +Result RestCatalog::NamespaceExists(const Namespace& ns, + auth::AuthSession& session) const { if (!supported_endpoints_.contains(Endpoint::NamespaceExists())) { // Fall back to GetNamespaceProperties - return CaptureNoSuchNamespace(GetNamespaceProperties(ns)); + return CaptureNoSuchNamespace(GetNamespaceProperties(ns, session)); } ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Namespace_(ns)); - return CaptureNoSuchNamespace(client_->Head( - path, /*headers=*/{}, *NamespaceErrorHandler::Instance(), *catalog_session_)); + return CaptureNoSuchNamespace( + client_->Head(path, /*headers=*/{}, *NamespaceErrorHandler::Instance(), session)); } Status RestCatalog::UpdateNamespaceProperties( const Namespace& ns, const std::unordered_map& updates, - const std::unordered_set& removals) { + const std::unordered_set& removals, auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::UpdateNamespace()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->NamespaceProperties(ns)); UpdateNamespacePropertiesRequest request{ .removals = std::vector(removals.begin(), removals.end()), .updates = updates}; ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Post(path, json_request, /*headers=*/{}, - *NamespaceErrorHandler::Instance(), *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Post(path, json_request, /*headers=*/{}, + *NamespaceErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto update_response, UpdateNamespacePropertiesResponseFromJson(json)); return {}; } -Result> RestCatalog::ListTables(const Namespace& ns) const { +Result> RestCatalog::ListTables( + const Namespace& ns, auth::AuthSession& session) const { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::ListTables()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Tables(ns)); std::vector result; @@ -314,10 +630,9 @@ Result> RestCatalog::ListTables(const Namespace& ns if (!next_token.empty()) { params[kQueryParamPageToken] = next_token; } - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Get(path, params, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Get(path, params, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto list_response, ListTablesResponseFromJson(json)); result.insert(result.end(), list_response.identifiers.begin(), @@ -334,7 +649,8 @@ Result RestCatalog::CreateTableInternal( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties, bool stage_create) { + const std::unordered_map& properties, bool stage_create, + auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::CreateTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Tables(identifier.ns)); @@ -349,16 +665,12 @@ Result RestCatalog::CreateTableInternal( }; ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Post(path, json_request, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Post(path, json_request, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); - // TODO: Wire table-specific auth config from LoadTableResponse once C++ has - // table-scoped REST operations or a table-scoped catalog wrapper. The current - // Table implementation routes refresh and commit back through Catalog. return load_result; } @@ -366,18 +678,22 @@ Result> RestCatalog::CreateTable( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties) { - ICEBERG_ASSIGN_OR_RAISE(auto result, - CreateTableInternal(identifier, schema, spec, order, location, - properties, /*stage_create=*/false)); - return Table::Make(identifier, std::move(result.metadata), - std::move(result.metadata_location), file_io_, shared_from_this()); + const std::unordered_map& properties, + const SessionContext& context, + std::shared_ptr contextual_session) { + ICEBERG_ASSIGN_OR_RAISE( + auto result, + CreateTableInternal(identifier, schema, spec, order, location, properties, + /*stage_create=*/false, *contextual_session)); + return MakeTableFromLoadResult(identifier, std::move(result), context, + std::move(contextual_session)); } -Result> RestCatalog::UpdateTable( +Result RestCatalog::UpdateTableInternal( const TableIdentifier& identifier, const std::vector>& requirements, - const std::vector>& updates) { + const std::vector>& updates, + auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::UpdateTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Table(identifier)); @@ -392,35 +708,60 @@ Result> RestCatalog::UpdateTable( } ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Post(path, json_request, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Post(path, json_request, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto commit_response, CommitTableResponseFromJson(json)); + return commit_response; +} - return Table::Make(identifier, std::move(commit_response.metadata), - std::move(commit_response.metadata_location), file_io_, - shared_from_this()); +Result> RestCatalog::UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates, + const SessionContext& context, + std::shared_ptr contextual_session) { + ICEBERG_ASSIGN_OR_RAISE( + auto response, + UpdateTableInternal(identifier, requirements, updates, *contextual_session)); + std::unordered_map table_config; + ICEBERG_ASSIGN_OR_RAISE( + auto table_session, + TableAuthSession(identifier, table_config, std::move(contextual_session))); + return MakeTableFromCommitResponse(identifier, std::move(response), context, + table_config, std::move(table_session)); } Result> RestCatalog::StageCreateTable( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties) { - ICEBERG_ASSIGN_OR_RAISE(auto result, - CreateTableInternal(identifier, schema, spec, order, location, - properties, /*stage_create=*/true)); - ICEBERG_ASSIGN_OR_RAISE(auto staged_table, - StagedTable::Make(identifier, std::move(result.metadata), - std::move(result.metadata_location), file_io_, - shared_from_this())); + const std::unordered_map& properties, + const SessionContext& context, + std::shared_ptr contextual_session) { + ICEBERG_ASSIGN_OR_RAISE( + auto result, + CreateTableInternal(identifier, schema, spec, order, location, properties, + /*stage_create=*/true, *contextual_session)); + auto table_config = std::move(result.config); + ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + ICEBERG_ASSIGN_OR_RAISE( + auto table_session, + TableAuthSession(identifier, table_config, std::move(contextual_session))); + auto table_catalog = std::make_shared( + shared_from_this(), context, identifier, table_config, std::move(table_session)); + ICEBERG_ASSIGN_OR_RAISE( + auto staged_table, + StagedTable::Make(identifier, std::move(result.metadata), + std::move(result.metadata_location), std::move(table_io), + std::move(table_catalog))); return Transaction::Make(std::move(staged_table), TransactionKind::kCreate); } -Status RestCatalog::DropTable(const TableIdentifier& identifier, bool purge) { +Status RestCatalog::DropTable(const TableIdentifier& identifier, bool purge, + auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::DeleteTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Table(identifier)); @@ -428,40 +769,40 @@ Status RestCatalog::DropTable(const TableIdentifier& identifier, bool purge) { if (purge) { params["purgeRequested"] = "true"; } - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Delete(path, params, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Delete(path, params, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); return {}; } -Result RestCatalog::TableExists(const TableIdentifier& identifier) const { +Result RestCatalog::TableExists(const TableIdentifier& identifier, + auth::AuthSession& session) const { if (!supported_endpoints_.contains(Endpoint::TableExists())) { // Fall back to call LoadTable - return CaptureNoSuchTable(LoadTableInternal(identifier)); + return CaptureNoSuchTable(LoadTableInternal(identifier, session)); } ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Table(identifier)); - return CaptureNoSuchTable(client_->Head( - path, /*headers=*/{}, *TableErrorHandler::Instance(), *catalog_session_)); + return CaptureNoSuchTable( + client_->Head(path, /*headers=*/{}, *TableErrorHandler::Instance(), session)); } -Status RestCatalog::RenameTable(const TableIdentifier& from, const TableIdentifier& to) { +Status RestCatalog::RenameTable(const TableIdentifier& from, const TableIdentifier& to, + auth::AuthSession& session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::RenameTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Rename()); RenameTableRequest request{.source = from, .destination = to}; ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Post(path, json_request, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Post(path, json_request, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); return {}; } -Result RestCatalog::LoadTableInternal( - const TableIdentifier& identifier) const { +Result RestCatalog::LoadTableInternal(const TableIdentifier& identifier, + auth::AuthSession& session) const { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::LoadTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Table(identifier)); @@ -472,26 +813,27 @@ Result RestCatalog::LoadTableInternal( params["snapshots"] = "all"; } - ICEBERG_ASSIGN_OR_RAISE( - const auto response, - client_->Get(path, params, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); - return response.body(); + ICEBERG_ASSIGN_OR_RAISE(const auto response, + client_->Get(path, params, /*headers=*/{}, + *TableErrorHandler::Instance(), session)); + ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); + return LoadTableResultFromJson(json); } -Result> RestCatalog::LoadTable(const TableIdentifier& identifier) { - ICEBERG_ASSIGN_OR_RAISE(const auto body, LoadTableInternal(identifier)); - ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(body)); - ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); - // TODO: Support table-specific auth config and per-table FileIO from the REST - // load response when table-scoped REST operations are introduced. - return Table::Make(identifier, std::move(load_result.metadata), - std::move(load_result.metadata_location), file_io_, - shared_from_this()); +Result> RestCatalog::LoadTable( + const TableIdentifier& identifier, const SessionContext& context, + std::shared_ptr request_session, + std::shared_ptr contextual_session) { + ICEBERG_ASSIGN_OR_RAISE(auto load_result, + LoadTableInternal(identifier, *request_session)); + return MakeTableFromLoadResult(identifier, std::move(load_result), context, + std::move(contextual_session)); } Result> RestCatalog::RegisterTable( - const TableIdentifier& identifier, const std::string& metadata_file_location) { + const TableIdentifier& identifier, const std::string& metadata_file_location, + const SessionContext& context, + std::shared_ptr contextual_session) { ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::RegisterTable()); ICEBERG_ASSIGN_OR_RAISE(auto path, paths_->Register(identifier.ns)); @@ -504,15 +846,44 @@ Result> RestCatalog::RegisterTable( ICEBERG_ASSIGN_OR_RAISE( const auto response, client_->Post(path, json_request, /*headers=*/{}, *TableErrorHandler::Instance(), - *catalog_session_)); + *contextual_session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto load_result, LoadTableResultFromJson(json)); - // TODO: Support table-specific auth config and per-table FileIO from the REST - // register response when table-scoped REST operations are introduced. - return Table::Make(identifier, std::move(load_result.metadata), - std::move(load_result.metadata_location), file_io_, - shared_from_this()); + return MakeTableFromLoadResult(identifier, std::move(load_result), context, + std::move(contextual_session)); +} + +Result> RestCatalog::MakeTableFromLoadResult( + const TableIdentifier& identifier, LoadTableResult result, + const SessionContext& context, + std::shared_ptr contextual_session) { + auto table_config = std::move(result.config); + ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + ICEBERG_ASSIGN_OR_RAISE( + auto table_session, + TableAuthSession(identifier, table_config, std::move(contextual_session))); + auto table_catalog = std::make_shared( + shared_from_this(), context, identifier, table_config, table_session); + return Table::Make(identifier, std::move(result.metadata), + std::move(result.metadata_location), std::move(table_io), + std::move(table_catalog)); +} + +Result> RestCatalog::MakeTableFromCommitResponse( + const TableIdentifier& identifier, CommitTableResponse response, + const SessionContext& context, + const std::unordered_map& table_config, + std::shared_ptr table_session) { + // TODO(gangwu): If the REST commit response grows table config or + // storage credentials, derive a replacement table session/FileIO from that + // response. The current table commit response does not define config. + ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + auto table_catalog = std::make_shared( + shared_from_this(), context, identifier, table_config, table_session); + return Table::Make(identifier, std::move(response.metadata), + std::move(response.metadata_location), std::move(table_io), + std::move(table_catalog)); } } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/rest_catalog.h b/src/iceberg/catalog/rest/rest_catalog.h index 4fd4db5b8..e693ceba3 100644 --- a/src/iceberg/catalog/rest/rest_catalog.h +++ b/src/iceberg/catalog/rest/rest_catalog.h @@ -28,6 +28,8 @@ #include "iceberg/catalog/rest/endpoint.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/catalog/rest/type_fwd.h" +#include "iceberg/catalog/session_catalog.h" +#include "iceberg/catalog/session_context.h" #include "iceberg/result.h" /// \file iceberg/catalog/rest/rest_catalog.h @@ -35,9 +37,10 @@ namespace iceberg::rest { -/// \brief Rest catalog implementation. -class ICEBERG_REST_EXPORT RestCatalog : public Catalog, - public std::enable_shared_from_this { +/// \brief Session-aware REST catalog root. +class ICEBERG_REST_EXPORT RestCatalog final + : public SessionCatalog, + public std::enable_shared_from_this { public: ~RestCatalog() override; @@ -51,69 +54,122 @@ class ICEBERG_REST_EXPORT RestCatalog : public Catalog, std::string_view name() const override; - Result> ListNamespaces(const Namespace& ns) const override; + Result> AsCatalog() override; - Status CreateNamespace( - const Namespace& ns, - const std::unordered_map& properties) override; + Result> WithContext(SessionContext context) override; + + private: + class ContextCatalog; + class TableScopedCatalog; + + RestCatalog(RestCatalogProperties config, std::shared_ptr file_io, + std::unique_ptr client, std::unique_ptr paths, + std::unordered_set endpoints, + std::unique_ptr auth_manager, + std::shared_ptr catalog_session, + SnapshotMode snapshot_mode, SessionContext default_context); + + Result> ContextualAuthSession( + const SessionContext& context); + + Result> TableAuthSession( + const TableIdentifier& identifier, + const std::unordered_map& table_config, + std::shared_ptr contextual_session); + + Result> TableFileIO( + const SessionContext& context, + const std::unordered_map& table_config) const; + + Result> ListNamespaces(const Namespace& ns, + auth::AuthSession& session) const; + + Status CreateNamespace(const Namespace& ns, + const std::unordered_map& properties, + auth::AuthSession& session); Result> GetNamespaceProperties( - const Namespace& ns) const override; + const Namespace& ns, auth::AuthSession& session) const; - Status DropNamespace(const Namespace& ns) override; + Status DropNamespace(const Namespace& ns, auth::AuthSession& session); - Result NamespaceExists(const Namespace& ns) const override; + Result NamespaceExists(const Namespace& ns, auth::AuthSession& session) const; Status UpdateNamespaceProperties( const Namespace& ns, const std::unordered_map& updates, - const std::unordered_set& removals) override; + const std::unordered_set& removals, auth::AuthSession& session); - Result> ListTables(const Namespace& ns) const override; + Result> ListTables(const Namespace& ns, + auth::AuthSession& session) const; Result> CreateTable( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties) override; + const std::unordered_map& properties, + const SessionContext& context, + std::shared_ptr contextual_session); Result> UpdateTable( const TableIdentifier& identifier, const std::vector>& requirements, - const std::vector>& updates) override; + const std::vector>& updates, + const SessionContext& context, + std::shared_ptr contextual_session); Result> StageCreateTable( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties) override; + const std::unordered_map& properties, + const SessionContext& context, + std::shared_ptr contextual_session); - Result TableExists(const TableIdentifier& identifier) const override; + Result TableExists(const TableIdentifier& identifier, + auth::AuthSession& session) const; - Status RenameTable(const TableIdentifier& from, const TableIdentifier& to) override; + Status RenameTable(const TableIdentifier& from, const TableIdentifier& to, + auth::AuthSession& session); - Status DropTable(const TableIdentifier& identifier, bool purge) override; + Status DropTable(const TableIdentifier& identifier, bool purge, + auth::AuthSession& session); - Result> LoadTable(const TableIdentifier& identifier) override; + Result> LoadTable( + const TableIdentifier& identifier, const SessionContext& context, + std::shared_ptr request_session, + std::shared_ptr contextual_session); Result> RegisterTable( - const TableIdentifier& identifier, - const std::string& metadata_file_location) override; + const TableIdentifier& identifier, const std::string& metadata_file_location, + const SessionContext& context, + std::shared_ptr contextual_session); - private: - RestCatalog(RestCatalogProperties config, std::shared_ptr file_io, - std::unique_ptr client, std::unique_ptr paths, - std::unordered_set endpoints, - std::unique_ptr auth_manager, - std::shared_ptr catalog_session, - SnapshotMode snapshot_mode); - - Result LoadTableInternal(const TableIdentifier& identifier) const; + Result LoadTableInternal(const TableIdentifier& identifier, + auth::AuthSession& session) const; Result CreateTableInternal( const TableIdentifier& identifier, const std::shared_ptr& schema, const std::shared_ptr& spec, const std::shared_ptr& order, const std::string& location, - const std::unordered_map& properties, bool stage_create); + const std::unordered_map& properties, bool stage_create, + auth::AuthSession& session); + + Result UpdateTableInternal( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates, + auth::AuthSession& session); + + Result> MakeTableFromLoadResult( + const TableIdentifier& identifier, LoadTableResult result, + const SessionContext& context, + std::shared_ptr contextual_session); + + Result> MakeTableFromCommitResponse( + const TableIdentifier& identifier, CommitTableResponse response, + const SessionContext& context, + const std::unordered_map& table_config, + std::shared_ptr table_session); RestCatalogProperties config_; std::shared_ptr file_io_; @@ -124,6 +180,8 @@ class ICEBERG_REST_EXPORT RestCatalog : public Catalog, std::unique_ptr auth_manager_; std::shared_ptr catalog_session_; SnapshotMode snapshot_mode_; + SessionContext default_context_; + std::shared_ptr default_catalog_; }; } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/type_fwd.h b/src/iceberg/catalog/rest/type_fwd.h index 62bc14d12..ee684b245 100644 --- a/src/iceberg/catalog/rest/type_fwd.h +++ b/src/iceberg/catalog/rest/type_fwd.h @@ -22,10 +22,10 @@ /// \file iceberg/catalog/rest/type_fwd.h /// Forward declarations and enum definitions for Iceberg REST API types. -#include "iceberg/catalog/rest/auth/auth_properties.h" namespace iceberg::rest { struct ErrorResponse; +struct CommitTableResponse; struct LoadTableResult; struct OAuthTokenResponse; diff --git a/src/iceberg/catalog/session_catalog.cc b/src/iceberg/catalog/session_catalog.cc new file mode 100644 index 000000000..7afe72ebe --- /dev/null +++ b/src/iceberg/catalog/session_catalog.cc @@ -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. + */ + +#include "iceberg/catalog/session_catalog.h" + +namespace iceberg { + +SessionCatalog::SessionCatalog() = default; + +SessionCatalog::~SessionCatalog() = default; + +} // namespace iceberg diff --git a/src/iceberg/catalog/session_catalog.h b/src/iceberg/catalog/session_catalog.h new file mode 100644 index 000000000..2d7aeae25 --- /dev/null +++ b/src/iceberg/catalog/session_catalog.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +class Catalog; + +/// \brief Factory interface for creating context-bound catalog views. +/// +/// `SessionCatalog` is not a replacement for `Catalog` and does not duplicate +/// table or namespace operations. It is a small root interface for catalogs that +/// can bind the standard `Catalog` API to a `SessionContext`. +/// +/// Call `AsCatalog()` for the catalog's default session, or `WithContext()` when +/// the caller has an explicit session identity, properties, or credentials. +class ICEBERG_EXPORT SessionCatalog { + public: + virtual ~SessionCatalog(); + + /// \brief Catalog name. + virtual std::string_view name() const = 0; + + /// \brief Return a `Catalog` view bound to the catalog's default session. + /// + /// Implementations may cache and return the same default catalog view on + /// repeated calls. + virtual Result> AsCatalog() = 0; + + /// \brief Return a `Catalog` view bound to the supplied session context. + /// + /// Implementations should reject invalid contexts, such as an empty + /// `SessionContext::session_id`. Returned catalog views use the normal + /// `Catalog` interface for all table and namespace operations. + virtual Result> WithContext(SessionContext context) = 0; + + protected: + SessionCatalog(); +}; + +} // namespace iceberg diff --git a/src/iceberg/catalog/session_context.cc b/src/iceberg/catalog/session_context.cc new file mode 100644 index 000000000..efd10ff16 --- /dev/null +++ b/src/iceberg/catalog/session_context.cc @@ -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. + */ + +#include "iceberg/catalog/session_context.h" + +#include "iceberg/util/uuid.h" + +namespace iceberg { + +SessionContext SessionContext::Empty() { + return SessionContext{.session_id = Uuid::GenerateV4().ToString()}; +} + +} // namespace iceberg diff --git a/src/iceberg/catalog/session_context.h b/src/iceberg/catalog/session_context.h new file mode 100644 index 000000000..7dee828e1 --- /dev/null +++ b/src/iceberg/catalog/session_context.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/iceberg_export.h" + +namespace iceberg { + +/// \brief Session state used to bind catalog operations to a caller context. +/// +/// Session context is the isolation boundary for session-aware catalogs. REST +/// catalogs use `session_id` to derive contextual authentication sessions while +/// keeping user-visible catalog operations on the normal `Catalog` interface. +/// +/// The type is intentionally an aggregate so callers can construct it with +/// designated initializers. `properties` and `credentials` are kept separate so +/// authentication implementations can detect conflicting keys instead of +/// silently overriding credentials. +struct ICEBERG_EXPORT SessionContext { + /// Unique session identifier. Explicit contexts must provide a non-empty ID. + std::string session_id; + + /// Caller identity. Empty means no identity was supplied. This value is + /// descriptive and is not implicitly inserted into authentication properties. + std::string identity; + + /// Sensitive context-specific credentials, such as delegated auth material. + std::unordered_map credentials; + + /// Non-secret context-specific properties, such as tenant or auth options. + std::unordered_map properties; + + /// \brief Create an empty caller context with a generated non-empty session ID. + /// + /// Each call returns a distinct session ID. + static SessionContext Empty(); +}; + +} // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index d0e7d07c2..f0b103828 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -46,6 +46,8 @@ iceberg_sources = files( 'arrow_c_data_guard_internal.cc', 'arrow_c_data_util.cc', 'catalog/memory/in_memory_catalog.cc', + 'catalog/session_catalog.cc', + 'catalog/session_context.cc', 'delete_file_index.cc', 'expression/aggregate.cc', 'expression/binder.cc', diff --git a/src/iceberg/test/auth_manager_test.cc b/src/iceberg/test/auth_manager_test.cc index 22ecef864..19526b7e3 100644 --- a/src/iceberg/test/auth_manager_test.cc +++ b/src/iceberg/test/auth_manager_test.cc @@ -40,6 +40,7 @@ #include "iceberg/catalog/rest/error_handlers.h" #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" +#include "iceberg/catalog/session_context.h" #include "iceberg/json_serde_internal.h" #include "iceberg/test/matchers.h" #include "iceberg/util/base64.h" @@ -90,6 +91,21 @@ TEST_F(AuthManagerTest, LoadNoopAuthManagerInferred) { ASSERT_THAT(manager_result, IsOk()); } +TEST_F(AuthManagerTest, NoopContextualSessionReturnsParentSession) { + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", {})); + ICEBERG_UNWRAP_OR_FAIL(auto parent, manager->CatalogSession(client_, {})); + + SessionContext context{ + .session_id = "tenant-a", + .identity = "user-a", + .credentials = {{"credential-key", "credential-value"}}, + .properties = {{"property-key", "property-value"}}, + }; + ICEBERG_UNWRAP_OR_FAIL(auto contextual, manager->ContextualSession(context, parent)); + + EXPECT_EQ(contextual, parent); +} + TEST_F(AuthManagerTest, HttpHeadersAreCaseInsensitiveSingleValueMap) { HttpHeaders headers; headers.emplace("Authorization", "Bearer first"); diff --git a/src/iceberg/test/rest_catalog_integration_test.cc b/src/iceberg/test/rest_catalog_integration_test.cc index 3de7e722a..104602c46 100644 --- a/src/iceberg/test/rest_catalog_integration_test.cc +++ b/src/iceberg/test/rest_catalog_integration_test.cc @@ -39,6 +39,7 @@ #include "iceberg/catalog/rest/http_client.h" #include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/rest_catalog.h" +#include "iceberg/catalog/session_context.h" #include "iceberg/file_io_registry.h" #include "iceberg/partition_spec.h" #include "iceberg/result.h" @@ -123,12 +124,12 @@ class RestCatalogIntegrationTest : public ::testing::Test { static void TearDownTestSuite() { docker_compose_.reset(); } /// Create a catalog with default configuration. - Result> CreateCatalog() { + Result> CreateCatalog() { return CreateCatalogWithProperties({}); } /// Create a catalog with additional properties merged on top of defaults. - Result> CreateCatalogWithProperties( + Result> CreateCatalogWithProperties( const std::unordered_map& extra) { auto config = RestCatalogProperties::default_properties(); config.Set(RestCatalogProperties::kUri, CatalogUri()) @@ -139,18 +140,19 @@ class RestCatalogIntegrationTest : public ::testing::Test { for (const auto& [k, v] : extra) { config.mutable_configs()[k] = v; } - return RestCatalog::Make(config); + ICEBERG_ASSIGN_OR_RAISE(auto root, RestCatalog::Make(config)); + return root->AsCatalog(); } /// Create a catalog configured with a specific snapshot loading mode. - Result> CreateCatalogWithSnapshotMode( + Result> CreateCatalogWithSnapshotMode( const std::string& mode) { return CreateCatalogWithProperties( {{RestCatalogProperties::kSnapshotLoadingMode.key(), mode}}); } /// Convenience: create a namespace and return the catalog. - Result> CreateCatalogAndNamespace(const Namespace& ns) { + Result> CreateCatalogAndNamespace(const Namespace& ns) { ICEBERG_ASSIGN_OR_RAISE(auto catalog, CreateCatalog()); auto status = catalog->CreateNamespace(ns, {}); if (!status.has_value()) { @@ -169,7 +171,7 @@ class RestCatalogIntegrationTest : public ::testing::Test { /// Create a table with default schema and no partitioning. Result> CreateDefaultTable( - const std::shared_ptr& catalog, const TableIdentifier& table_id, + const std::shared_ptr& catalog, const TableIdentifier& table_id, const std::unordered_map& props = {}) { return catalog->CreateTable(table_id, DefaultSchema(), PartitionSpec::Unpartitioned(), SortOrder::Unsorted(), "", props); @@ -179,8 +181,26 @@ class RestCatalogIntegrationTest : public ::testing::Test { }; TEST_F(RestCatalogIntegrationTest, MakeCatalogSuccess) { - ICEBERG_UNWRAP_OR_FAIL(auto catalog, CreateCatalog()); - EXPECT_EQ(catalog->name(), kCatalogName); + auto config = RestCatalogProperties::default_properties(); + config.Set(RestCatalogProperties::kUri, CatalogUri()) + .Set(RestCatalogProperties::kName, std::string(kCatalogName)) + .Set(RestCatalogProperties::kWarehouse, std::string(kWarehouseName)); + config.mutable_configs()[std::string(RestCatalogProperties::kIOImpl.key())] = + std::string(kStdFileIOImpl); + + ICEBERG_UNWRAP_OR_FAIL(auto root, RestCatalog::Make(config)); + EXPECT_EQ(root->name(), kCatalogName); + + ICEBERG_UNWRAP_OR_FAIL(auto first_default, root->AsCatalog()); + ICEBERG_UNWRAP_OR_FAIL(auto second_default, root->AsCatalog()); + EXPECT_EQ(first_default, second_default); + + SessionContext context{.session_id = "tenant-a"}; + ICEBERG_UNWRAP_OR_FAIL(auto first_context, root->WithContext(context)); + ICEBERG_UNWRAP_OR_FAIL(auto second_context, root->WithContext(context)); + EXPECT_NE(first_context, second_context); + + EXPECT_THAT(root->WithContext(SessionContext{}), IsError(ErrorKind::kInvalidArgument)); } TEST_F(RestCatalogIntegrationTest, FetchServerConfigDirect) { @@ -418,6 +438,49 @@ TEST_F(RestCatalogIntegrationTest, UpdateTable) { EXPECT_EQ(updated->metadata()->properties.configs().at("key1"), "value1"); } +TEST_F(RestCatalogIntegrationTest, LoadedTableUsesTableScopedCatalog) { + // TODO(gangwu): Add a focused mock REST server/auth manager test that + // asserts exact ContextualSession and TableSession inputs, including table + // response config. The Docker REST fixture currently returns empty config. + Namespace ns{.levels = {"test_table_scoped_catalog"}}; + ICEBERG_UNWRAP_OR_FAIL(auto catalog, CreateCatalogAndNamespace(ns)); + + TableIdentifier table_id{.ns = ns, .name = "t1"}; + ASSERT_THAT(CreateDefaultTable(catalog, table_id), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto loaded, catalog->LoadTable(table_id)); + ASSERT_THAT(loaded->Refresh(), IsOk()); + + TableIdentifier other_id{.ns = ns, .name = "other"}; + EXPECT_THAT(loaded->catalog()->LoadTable(other_id), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(loaded->catalog()->CreateTable(other_id, DefaultSchema(), + PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), "", {}), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(loaded->catalog()->StageCreateTable(other_id, DefaultSchema(), + PartitionSpec::Unpartitioned(), + SortOrder::Unsorted(), "", {}), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(loaded->catalog()->RegisterTable(other_id, "file:/tmp/metadata.json"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(loaded->catalog()->DropTable(other_id, /*purge=*/false), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(loaded->catalog()->DropTable(table_id, /*purge=*/false), + IsError(ErrorKind::kNotSupported)); + + std::vector> requirements; + requirements.push_back(std::make_unique(loaded->uuid())); + + std::vector> updates; + updates.push_back(std::make_unique( + std::unordered_map{{"scoped", "true"}})); + + ICEBERG_UNWRAP_OR_FAIL(auto updated, + loaded->catalog()->UpdateTable(table_id, requirements, updates)); + EXPECT_EQ(updated->metadata()->properties.configs().at("scoped"), "true"); +} + TEST_F(RestCatalogIntegrationTest, RegisterTable) { Namespace ns{.levels = {"test_register_table"}}; ICEBERG_UNWRAP_OR_FAIL(auto catalog, CreateCatalogAndNamespace(ns)); @@ -447,6 +510,12 @@ TEST_F(RestCatalogIntegrationTest, StageCreateTable) { EXPECT_EQ(txn->table()->name(), table_id); + TableIdentifier other_id{.ns = ns, .name = "other"}; + EXPECT_THAT(txn->table()->catalog()->LoadTable(other_id), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(txn->table()->catalog()->DropTable(table_id, /*purge=*/false), + IsError(ErrorKind::kNotSupported)); + // Not yet visible in catalog ICEBERG_UNWRAP_OR_FAIL(auto before, catalog->TableExists(table_id)); EXPECT_FALSE(before); diff --git a/src/iceberg/test/sigv4_auth_test.cc b/src/iceberg/test/sigv4_auth_test.cc index ac8c36b63..12d18792f 100644 --- a/src/iceberg/test/sigv4_auth_test.cc +++ b/src/iceberg/test/sigv4_auth_test.cc @@ -38,6 +38,7 @@ # include "iceberg/catalog/rest/auth/auth_session.h" # include "iceberg/catalog/rest/auth/sigv4_auth_manager_internal.h" # include "iceberg/catalog/rest/http_client.h" +# include "iceberg/catalog/session_context.h" # include "iceberg/table_identifier.h" # include "iceberg/test/matchers.h" @@ -403,7 +404,10 @@ TEST_F(SigV4AuthTest, DerivedCredentialOverridesMustBeComplete) { manager->CatalogSession(client_, properties)); auto context_result = manager->ContextualSession( - {{AuthProperties::kSigV4SecretAccessKey, "context-secret"}}, catalog_session); + SessionContext{ + .session_id = "ctx-incomplete", + .properties = {{AuthProperties::kSigV4SecretAccessKey, "context-secret"}}}, + catalog_session); EXPECT_THAT(context_result, IsError(ErrorKind::kInvalidArgument)); EXPECT_THAT(context_result, HasErrorMessage("must be set together")); @@ -447,10 +451,13 @@ TEST_F(SigV4AuthTest, ContextualSessionOverridesProperties) { ICEBERG_UNWRAP_OR_FAIL( auto ctx_session, - manager->ContextualSession({{AuthProperties::kSigV4AccessKeyId, "id2"}, - {AuthProperties::kSigV4SecretAccessKey, "secret2"}, - {AuthProperties::kSigV4SigningRegion, "eu-west-1"}}, - catalog_session)); + manager->ContextualSession( + SessionContext{ + .session_id = "ctx-overrides", + .credentials = {{AuthProperties::kSigV4AccessKeyId, "id2"}, + {AuthProperties::kSigV4SecretAccessKey, "secret2"}}, + .properties = {{AuthProperties::kSigV4SigningRegion, "eu-west-1"}}}, + catalog_session)); ICEBERG_UNWRAP_OR_FAIL( auto signed_request, @@ -492,8 +499,11 @@ TEST_F(SigV4AuthTest, TableSessionIgnoresContextualOverrides) { manager->CatalogSession(client_, properties)); ICEBERG_UNWRAP_OR_FAIL( auto ctx_session, - manager->ContextualSession({{AuthProperties::kSigV4SigningRegion, "eu-west-1"}}, - catalog_session)); + manager->ContextualSession( + SessionContext{ + .session_id = "ctx-region", + .properties = {{AuthProperties::kSigV4SigningRegion, "eu-west-1"}}}, + catalog_session)); iceberg::TableIdentifier table_id{.ns = iceberg::Namespace{{"db1"}}, .name = "table1"}; ICEBERG_UNWRAP_OR_FAIL(auto table_session, @@ -507,6 +517,23 @@ TEST_F(SigV4AuthTest, TableSessionIgnoresContextualOverrides) { HasSubstr("us-west-2")); } +TEST_F(SigV4AuthTest, ContextualSessionRejectsConflictingKeys) { + auto properties = MakeSigV4Properties(); + ICEBERG_UNWRAP_OR_FAIL(auto manager, AuthManagers::Load("test-catalog", properties)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog_session, + manager->CatalogSession(client_, properties)); + + auto result = manager->ContextualSession( + SessionContext{ + .session_id = "ctx-conflict", + .credentials = {{AuthProperties::kSigV4AccessKeyId, "credential-id"}}, + .properties = {{AuthProperties::kSigV4AccessKeyId, "property-id"}}}, + catalog_session); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("conflicting values")); +} + } // namespace iceberg::rest::auth #endif // ICEBERG_SIGV4_ENABLED diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 2ed2835a7..bb4da67e5 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -207,6 +207,8 @@ using UncheckedStructLikeSet = StructLikeSet; /// \brief Catalog class Catalog; class LocationProvider; +class SessionCatalog; +struct SessionContext; /// \brief Table. class Table; From fc9781f4b3ed168e4eed701d4f6074bfc909d789 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Tue, 16 Jun 2026 10:40:12 +0200 Subject: [PATCH 095/151] fix(rest): reject empty namespace separators (#740) ## Summary - Reject empty REST namespace separators in namespace encode/decode helpers. - Reject empty namespace separators when constructing `ResourcePaths`. - Add regression coverage for direct helper calls and the resource path config boundary. ## Why `DecodeNamespace` advances by `separator.size()` after each match. An empty separator never advances the cursor, so a misconfigured separator can hang namespace parsing. ## Testing - `cmake -S . -B build-rest -G Ninja -DICEBERG_BUILD_BUNDLE=OFF -DICEBERG_BUILD_REST=ON -DICEBERG_BUILD_HIVE=OFF -DICEBERG_BUILD_SQL_CATALOG=OFF` - `cmake --build build-rest --target rest_catalog_test` - `ctest --test-dir build-rest -R rest_catalog_test --output-on-failure` --- src/iceberg/catalog/rest/resource_paths.cc | 2 ++ src/iceberg/catalog/rest/rest_util.cc | 13 +++++++++++++ src/iceberg/test/rest_util_test.cc | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/src/iceberg/catalog/rest/resource_paths.cc b/src/iceberg/catalog/rest/resource_paths.cc index 354400c4d..d18dd4636 100644 --- a/src/iceberg/catalog/rest/resource_paths.cc +++ b/src/iceberg/catalog/rest/resource_paths.cc @@ -34,6 +34,8 @@ Result> ResourcePaths::Make( if (base_uri.empty()) { return InvalidArgument("Base URI is empty"); } + ICEBERG_PRECHECK(!namespace_separator.empty(), + "REST namespace separator cannot be empty"); return std::unique_ptr( new ResourcePaths(std::move(base_uri), prefix, namespace_separator)); } diff --git a/src/iceberg/catalog/rest/rest_util.cc b/src/iceberg/catalog/rest/rest_util.cc index 15f093d32..cc69abe64 100644 --- a/src/iceberg/catalog/rest/rest_util.cc +++ b/src/iceberg/catalog/rest/rest_util.cc @@ -30,6 +30,15 @@ namespace iceberg::rest { +namespace { + +Status ValidateNamespaceSeparator(std::string_view separator) { + ICEBERG_PRECHECK(!separator.empty(), "REST namespace separator cannot be empty"); + return {}; +} + +} // namespace + std::string_view TrimTrailingSlash(std::string_view str) { while (!str.empty() && str.back() == '/') { str.remove_suffix(1); @@ -67,6 +76,8 @@ Result DecodeString(std::string_view str_to_decode) { Result EncodeNamespace(const Namespace& ns_to_encode, std::string_view separator) { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceSeparator(separator)); + if (ns_to_encode.levels.empty()) { return ""; } @@ -85,6 +96,8 @@ Result EncodeNamespace(const Namespace& ns_to_encode, Result DecodeNamespace(std::string_view str_to_decode, std::string_view separator) { + ICEBERG_RETURN_UNEXPECTED(ValidateNamespaceSeparator(separator)); + if (str_to_decode.empty()) { return Namespace{.levels = {}}; } diff --git a/src/iceberg/test/rest_util_test.cc b/src/iceberg/test/rest_util_test.cc index 47431ccd3..0035afca0 100644 --- a/src/iceberg/test/rest_util_test.cc +++ b/src/iceberg/test/rest_util_test.cc @@ -25,6 +25,7 @@ #include "iceberg/catalog/rest/catalog_properties.h" #include "iceberg/catalog/rest/endpoint.h" +#include "iceberg/catalog/rest/resource_paths.h" #include "iceberg/table_identifier.h" #include "iceberg/test/matchers.h" @@ -83,6 +84,25 @@ TEST(RestUtilTest, RoundTripNamespaceWithCustomSeparator) { HasValue(::testing::Eq(ns))); } +TEST(RestUtilTest, NamespaceRejectsEmptySeparator) { + auto expect_empty_separator_error = [](const auto& result) { + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("REST namespace separator cannot be empty")); + }; + + expect_empty_separator_error(EncodeNamespace(Namespace{.levels = {"dogs"}}, "")); + expect_empty_separator_error(EncodeNamespace(Namespace{.levels = {}}, "")); + expect_empty_separator_error(DecodeNamespace("dogs", "")); + expect_empty_separator_error(DecodeNamespace("", "")); +} + +TEST(RestUtilTest, ResourcePathsRejectsEmptyNamespaceSeparator) { + auto result = ResourcePaths::Make("https://catalog.example.com", "", ""); + + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("REST namespace separator cannot be empty")); +} + TEST(RestUtilTest, EncodeString) { // RFC 3986 unreserved characters should not be encoded EXPECT_THAT(EncodeString("abc123XYZ"), HasValue(::testing::Eq("abc123XYZ"))); From a2bbf180cd0a8ef51ff7510e182a9efe10d25e39 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Wed, 17 Jun 2026 07:26:21 +0200 Subject: [PATCH 096/151] fix: validate truncate widths in utility entrypoints (#739) ## Summary - Reject non-positive widths in the `TruncateLiteral` and `TruncateLiteralMax` utility entrypoints. - Reject zero width in `TruncateUTF8Max`, which returns a `Result` and can report invalid input directly. - Add regression coverage for zero and negative widths across numeric, decimal, string, and binary literal truncation. ## Why The truncate transform validates its width before creating a transform function, but the utility functions can also be called directly. Without a guard there, invalid widths can reach modulo operations or iterator arithmetic in the type-specific implementations. ## Testing - `cmake --build build --target util_test` - `ctest --test-dir build -R util_test --output-on-failure` --- src/iceberg/test/truncate_util_test.cc | 42 ++++++++++++++++++++++++++ src/iceberg/util/truncate_util.cc | 21 +++++++++++++ 2 files changed, 63 insertions(+) diff --git a/src/iceberg/test/truncate_util_test.cc b/src/iceberg/test/truncate_util_test.cc index f39e10cae..10093e440 100644 --- a/src/iceberg/test/truncate_util_test.cc +++ b/src/iceberg/test/truncate_util_test.cc @@ -51,6 +51,26 @@ TEST(TruncateUtilTest, TruncateLiteral) { Literal::Binary(std::vector(expected.begin(), expected.end()))); } +TEST(TruncateUtilTest, TruncateLiteralRejectsInvalidWidth) { + std::vector data{1, 2, 3}; + + auto expect_invalid_width = [](const auto& result) { + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Width must be positive")); + }; + + for (int32_t width : {0, -1}) { + SCOPED_TRACE(width); + expect_invalid_width(TruncateUtils::TruncateLiteral(Literal::Int(1), width)); + expect_invalid_width(TruncateUtils::TruncateLiteral(Literal::Long(1), width)); + expect_invalid_width( + TruncateUtils::TruncateLiteral(Literal::Decimal(1065, 4, 2), width)); + expect_invalid_width( + TruncateUtils::TruncateLiteral(Literal::String("iceberg"), width)); + expect_invalid_width(TruncateUtils::TruncateLiteral(Literal::Binary(data), width)); + } +} + TEST(TruncateUtilTest, TruncateBinaryMax) { std::vector test1{1, 1, 2}; std::vector test2{1, 1, 0xFF, 2}; @@ -190,4 +210,26 @@ TEST(TruncateUtilTest, TruncateStringMax) { EXPECT_EQ(result9_2, Literal::String(test9_2_expected)); } +TEST(TruncateUtilTest, TruncateLiteralMaxRejectsInvalidWidth) { + std::vector data{1, 2, 3}; + + auto expect_invalid_width = [](const auto& result) { + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Width must be positive")); + }; + + for (int32_t width : {0, -1}) { + SCOPED_TRACE(width); + expect_invalid_width( + TruncateUtils::TruncateLiteralMax(Literal::String("iceberg"), width)); + expect_invalid_width(TruncateUtils::TruncateLiteralMax(Literal::Binary(data), width)); + } +} + +TEST(TruncateUtilTest, TruncateUTF8MaxRejectsZeroWidth) { + auto result = TruncateUtils::TruncateUTF8Max("iceberg", 0); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Width must be positive")); +} + } // namespace iceberg diff --git a/src/iceberg/util/truncate_util.cc b/src/iceberg/util/truncate_util.cc index 1778000f9..a7622578d 100644 --- a/src/iceberg/util/truncate_util.cc +++ b/src/iceberg/util/truncate_util.cc @@ -26,6 +26,7 @@ #include "iceberg/expression/literal.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" +#include "iceberg/util/macros.h" namespace iceberg { @@ -34,6 +35,20 @@ constexpr uint32_t kUtf8MaxCodePoint = 0x10FFFF; constexpr uint32_t kUtf8MinSurrogate = 0xD800; constexpr uint32_t kUtf8MaxSurrogate = 0xDFFF; +Status ValidateTruncateWidth(int32_t width) { + if (width <= 0) { + return InvalidArgument("Width must be positive, got {}", width); + } + return {}; +} + +Status ValidateTruncateWidth(size_t width) { + if (width == 0) { + return InvalidArgument("Width must be positive, got 0"); + } + return {}; +} + std::optional DecodeUtf8CodePoint(std::string_view source) { if (source.empty()) { return std::nullopt; @@ -205,6 +220,8 @@ Result> TruncateLiteralMaxImpl( Result> TruncateUtils::TruncateUTF8Max( const std::string& source, size_t L) { + ICEBERG_RETURN_UNEXPECTED(ValidateTruncateWidth(L)); + std::string truncated = TruncateUTF8(source, L); if (truncated == source) { return truncated; @@ -253,6 +270,8 @@ Decimal TruncateUtils::TruncateDecimal(const Decimal& decimal, int32_t width) { return TruncateLiteralImpl(literal, width); Result TruncateUtils::TruncateLiteral(const Literal& literal, int32_t width) { + ICEBERG_RETURN_UNEXPECTED(ValidateTruncateWidth(width)); + if (literal.IsNull()) [[unlikely]] { // Return null as is return literal; @@ -280,6 +299,8 @@ Result TruncateUtils::TruncateLiteral(const Literal& literal, int32_t w Result> TruncateUtils::TruncateLiteralMax(const Literal& literal, int32_t width) { + ICEBERG_RETURN_UNEXPECTED(ValidateTruncateWidth(width)); + if (literal.IsNull()) [[unlikely]] { // Return null as is return literal; From cf0af5b1b8aaf0df971f1c0ee07e83e68b0f6567 Mon Sep 17 00:00:00 2001 From: Rahul Goel Date: Wed, 17 Jun 2026 01:27:46 -0400 Subject: [PATCH 097/151] fix: cast to unsigned char in ASCII case conversion (#748) fix: cast to unsigned char in ASCII case conversion `std::tolower`/`toupper` are UB when passed a negative `char`, which is what you get for any non-ASCII byte in a signed `char`. `StringUtils::ToLower`, `ToUpper`, and `EqualsIgnoreCase` all did this. Cast through `unsigned char`. Behavior for ASCII is unchanged; this doesn't add Unicode case folding, just fixes the UB. Related: #613 --------- Co-authored-by: Claude Opus 4.8 --- src/iceberg/test/string_util_test.cc | 28 ++++++++++++++++++++++++++++ src/iceberg/util/string_util.h | 23 ++++++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/iceberg/test/string_util_test.cc b/src/iceberg/test/string_util_test.cc index 402588114..a3fd03760 100644 --- a/src/iceberg/test/string_util_test.cc +++ b/src/iceberg/test/string_util_test.cc @@ -41,4 +41,32 @@ TEST(StringUtilsTest, ToUpper) { ASSERT_EQ(StringUtils::ToUpper("123"), "123"); } +// Non-ASCII (multibyte UTF-8) bytes have the high bit set, i.e. are negative when stored +// in a signed char. Only ASCII letters are converted; multibyte bytes pass through +// unchanged. The non-ASCII strings are written as explicit UTF-8 byte escapes so the test +// does not depend on the source-file encoding. See +// https://github.com/apache/iceberg-cpp/issues/613. +TEST(StringUtilsTest, NonAsciiPassThrough) { + // "Naïve" -> "naïve" (ï = U+00EF = 0xC3 0xAF; only the ASCII letters change). + ASSERT_EQ(StringUtils::ToLower("Na\xC3\xAFve"), "na\xC3\xAFve"); + // "café" -> "CAFé" (é = U+00E9 = 0xC3 0xA9 stays unchanged). + ASSERT_EQ(StringUtils::ToUpper("caf\xC3\xA9"), "CAF\xC3\xA9"); + // "日本語" (0xE6 0x97 0xA5 0xE6 0x9C 0xAC 0xE8 0xAA 0x9E) is returned verbatim. + ASSERT_EQ(StringUtils::ToLower("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), + "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"); + ASSERT_EQ(StringUtils::ToUpper("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"), + "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"); +} + +TEST(StringUtilsTest, EqualsIgnoreCase) { + ASSERT_TRUE(StringUtils::EqualsIgnoreCase("AbC", "abc")); + ASSERT_TRUE(StringUtils::EqualsIgnoreCase("", "")); + ASSERT_FALSE(StringUtils::EqualsIgnoreCase("abc", "abcd")); + ASSERT_FALSE(StringUtils::EqualsIgnoreCase("abc", "abd")); + // ASCII case is folded; non-ASCII bytes are compared as-is. ("Café" vs "café") + ASSERT_TRUE(StringUtils::EqualsIgnoreCase("Caf\xC3\xA9", "caf\xC3\xA9")); + // "café" vs "cafe": the multibyte é differs from ASCII 'e'. + ASSERT_FALSE(StringUtils::EqualsIgnoreCase("caf\xC3\xA9", "cafe")); +} + } // namespace iceberg diff --git a/src/iceberg/util/string_util.h b/src/iceberg/util/string_util.h index 36dfba30f..01b6087b8 100644 --- a/src/iceberg/util/string_util.h +++ b/src/iceberg/util/string_util.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include #include @@ -40,19 +41,22 @@ concept FromChars = requires(const char* p, T& v) { std::from_chars(p, p, v); }; class ICEBERG_EXPORT StringUtils { public: + // NOTE: These convert ASCII letters only; all other bytes, including non-ASCII + // (multibyte UTF-8) bytes, are passed through unchanged. + // See https://github.com/apache/iceberg-cpp/issues/613. static std::string ToLower(std::string_view str) { - return str | std::ranges::views::transform([](char c) { return std::tolower(c); }) | + return str | std::ranges::views::transform(ToLowerAscii) | std::ranges::to(); } static std::string ToUpper(std::string_view str) { - return str | std::ranges::views::transform([](char c) { return std::toupper(c); }) | + return str | std::ranges::views::transform(ToUpperAscii) | std::ranges::to(); } static bool EqualsIgnoreCase(std::string_view lhs, std::string_view rhs) { return std::ranges::equal( - lhs, rhs, [](char lc, char rc) { return std::tolower(lc) == std::tolower(rc); }); + lhs, rhs, [](char lc, char rc) { return ToLowerAscii(lc) == ToLowerAscii(rc); }); } static bool StartsWithIgnoreCase(std::string_view str, std::string_view prefix) { @@ -128,6 +132,19 @@ class ICEBERG_EXPORT StringUtils { } return value; } + + private: + // ASCII-only case conversion using explicit range checks rather than + // std::tolower/std::toupper. This is independent of the current C locale and never + // touches non-ASCII (high-bit) bytes, so multibyte UTF-8 sequences are preserved. It + // also sidesteps the undefined behavior of passing a negative char to . + static constexpr char ToLowerAscii(char c) noexcept { + return (c >= 'A' && c <= 'Z') ? static_cast(c - 'A' + 'a') : c; + } + + static constexpr char ToUpperAscii(char c) noexcept { + return (c >= 'a' && c <= 'z') ? static_cast(c - 'a' + 'A') : c; + } }; /// \brief Transparent hash function that supports std::string_view as lookup key From 8bbda0ccf54e372f5efcbdb9c0c86e26af413ef6 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Wed, 17 Jun 2026 13:28:43 +0800 Subject: [PATCH 098/151] feat: implement purge support in DropTable for InMemoryCatalog and SqlCatalog (#744) When purge=true, delete all metadata files (current + metadata log entries) before unregistering the table. Old log files are deleted first so the current metadata file remains as an anchor for retries. --- .../catalog/memory/in_memory_catalog.cc | 18 +++++++++++++++- src/iceberg/catalog/sql/sql_catalog.cc | 21 ++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/iceberg/catalog/memory/in_memory_catalog.cc b/src/iceberg/catalog/memory/in_memory_catalog.cc index 35593ed93..6148ef4e6 100644 --- a/src/iceberg/catalog/memory/in_memory_catalog.cc +++ b/src/iceberg/catalog/memory/in_memory_catalog.cc @@ -22,6 +22,7 @@ #include #include +#include "iceberg/file_io.h" #include "iceberg/table.h" #include "iceberg/table_identifier.h" #include "iceberg/table_metadata.h" @@ -511,7 +512,22 @@ Result InMemoryCatalog::TableExists(const TableIdentifier& identifier) con Status InMemoryCatalog::DropTable(const TableIdentifier& identifier, bool purge) { std::unique_lock lock(mutex_); - // TODO(Guotao): Delete all metadata files if purge is true. + if (purge && file_io_) { + ICEBERG_ASSIGN_OR_RAISE(auto metadata_location, + root_namespace_->GetTableMetadataLocation(identifier)); + ICEBERG_ASSIGN_OR_RAISE(auto metadata, + TableMetadataUtil::Read(*file_io_, metadata_location)); + // Delete previous metadata files from the log first, so that if deletion + // fails and is retried, the current metadata file still exists as an + // anchor to locate any remaining old files. + std::vector files_to_delete; + files_to_delete.reserve(metadata->metadata_log.size()); + for (const auto& entry : metadata->metadata_log) { + files_to_delete.push_back(entry.metadata_file); + } + std::ignore = file_io_->DeleteFiles(files_to_delete); + std::ignore = file_io_->DeleteFile(metadata_location); + } return root_namespace_->UnregisterTable(identifier); } diff --git a/src/iceberg/catalog/sql/sql_catalog.cc b/src/iceberg/catalog/sql/sql_catalog.cc index eb066bacb..cfe155f76 100644 --- a/src/iceberg/catalog/sql/sql_catalog.cc +++ b/src/iceberg/catalog/sql/sql_catalog.cc @@ -24,6 +24,7 @@ #include #include "iceberg/catalog/sql/config.h" +#include "iceberg/file_io.h" #include "iceberg/table.h" #include "iceberg/table_identifier.h" #include "iceberg/table_metadata.h" @@ -507,11 +508,25 @@ Result> SqlCatalog::StageCreateTable( Status SqlCatalog::DropTable(const TableIdentifier& identifier, bool purge) { ICEBERG_RETURN_UNEXPECTED(ValidateTableIdentifier(identifier)); - if (purge) { - // TODO(zhjwpku): Delete the table data and metadata files when purge is requested. - } const std::string ns_str = NamespaceToString(identifier.ns); + + if (purge && file_io_) { + ICEBERG_ASSIGN_OR_RAISE(auto metadata_location, + store_->GetTableMetadataLocation(ns_str, identifier.name)); + if (metadata_location.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(auto metadata, + TableMetadataUtil::Read(*file_io_, *metadata_location)); + // Delete previous metadata files from the log first, so that if deletion + // fails and is retried, the current metadata file still exists as an + // anchor to locate any remaining old files. + for (const auto& entry : metadata->metadata_log) { + std::ignore = file_io_->DeleteFile(entry.metadata_file); + } + std::ignore = file_io_->DeleteFile(*metadata_location); + } + } + ICEBERG_ASSIGN_OR_RAISE(auto affected, store_->DeleteTable(ns_str, identifier.name)); if (affected == 0) { return NoSuchTable("Table does not exist: {}", identifier.ToString()); From 92feae1e06604fcd7a170b973784a245332464dc Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Thu, 18 Jun 2026 23:45:52 +0800 Subject: [PATCH 099/151] fix: fast append should not contain deleted file during retry process (#706) --- src/iceberg/test/fast_append_test.cc | 61 +++++++++++++++++++ src/iceberg/update/fast_append.cc | 51 +++++++++++++--- src/iceberg/update/fast_append.h | 13 +++- src/iceberg/update/merging_snapshot_update.cc | 17 +----- src/iceberg/update/snapshot_update.cc | 22 +++++++ src/iceberg/update/snapshot_update.h | 2 + 6 files changed, 139 insertions(+), 27 deletions(-) diff --git a/src/iceberg/test/fast_append_test.cc b/src/iceberg/test/fast_append_test.cc index 98956ba7c..32224d117 100644 --- a/src/iceberg/test/fast_append_test.cc +++ b/src/iceberg/test/fast_append_test.cc @@ -20,13 +20,20 @@ #include "iceberg/update/fast_append.h" #include +#include +#include +#include #include #include #include "iceberg/avro/avro_register.h" +#include "iceberg/constants.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_writer.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" +#include "iceberg/snapshot.h" #include "iceberg/table_metadata.h" #include "iceberg/test/matchers.h" #include "iceberg/test/test_resource.h" @@ -72,6 +79,23 @@ class FastAppendTest : public UpdateTestBase { return data_file; } + Result WriteManifest( + const std::string& path, const std::vector>& files) { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, ManifestWriter::MakeWriter(table_->metadata()->format_version, + kInvalidSnapshotId, path, file_io_, spec_, + schema_, ManifestContent::kData)); + for (const auto& file : files) { + ManifestEntry entry; + entry.status = ManifestStatus::kAdded; + entry.snapshot_id = std::nullopt; + entry.data_file = file; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + std::shared_ptr spec_; std::shared_ptr schema_; std::shared_ptr file_a_; @@ -90,6 +114,9 @@ TEST_F(FastAppendTest, AppendDataFile) { EXPECT_EQ(snapshot->summary.at("added-data-files"), "1"); EXPECT_EQ(snapshot->summary.at("added-records"), "100"); EXPECT_EQ(snapshot->summary.at("added-files-size"), "1024"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); } TEST_F(FastAppendTest, AppendMultipleDataFiles) { @@ -172,6 +199,40 @@ TEST_F(FastAppendTest, FinalizeIgnoresCleanupDeleteFailure) { IsOk()); } +TEST_F(FastAppendTest, RetryCopiesAppendManifestAgain) { + table_->metadata()->format_version = 1; + const auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_})); + + std::shared_ptr fast_append; + ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); + std::vector deleted_paths; + fast_append->DeleteWith([&](const std::string& deleted_path) { + deleted_paths.push_back(deleted_path); + return file_io_->DeleteFile(deleted_path); + }); + fast_append->AppendManifest(manifest); + + auto& update = static_cast(*fast_append); + // First Apply() copies the input manifest because v1 cannot inherit snapshot IDs. + ICEBERG_UNWRAP_OR_FAIL(auto first_apply, update.Apply()); + SnapshotCache first_cache(first_apply.snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto first_manifests, first_cache.Manifests(file_io_)); + ASSERT_EQ(first_manifests.size(), 1U); + const auto first_rewritten_path = first_manifests[0].manifest_path; + EXPECT_NE(first_rewritten_path, path); + + // Second Apply() simulates retry cleanup, then copies the original manifest again. + ICEBERG_UNWRAP_OR_FAIL(auto second_apply, update.Apply()); + EXPECT_THAT(deleted_paths, testing::Contains(first_rewritten_path)); + + SnapshotCache second_cache(second_apply.snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto second_manifests, second_cache.Manifests(file_io_)); + ASSERT_EQ(second_manifests.size(), 1U); + EXPECT_NE(second_manifests[0].manifest_path, path); + EXPECT_NE(second_manifests[0].manifest_path, first_rewritten_path); +} + TEST_F(FastAppendTest, AppendDuplicateFile) { std::shared_ptr fast_append; ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); diff --git a/src/iceberg/update/fast_append.cc b/src/iceberg/update/fast_append.cc index 24f8e744f..4167387c7 100644 --- a/src/iceberg/update/fast_append.cc +++ b/src/iceberg/update/fast_append.cc @@ -26,7 +26,7 @@ #include "iceberg/manifest/manifest_entry.h" #include "iceberg/manifest/manifest_util_internal.h" #include "iceberg/snapshot.h" -#include "iceberg/table.h" +#include "iceberg/table.h" // IWYU pragma: keep #include "iceberg/table_metadata.h" #include "iceberg/table_properties.h" #include "iceberg/transaction.h" @@ -58,7 +58,7 @@ FastAppend& FastAppend::AppendFile(const std::shared_ptr& file) { auto [iter, inserted] = data_files.insert(file); if (inserted) { has_new_files_ = true; - ICEBERG_BUILDER_RETURN_IF_ERROR(summary_.AddedFile(*spec, *file)); + ICEBERG_BUILDER_RETURN_IF_ERROR(added_data_files_summary_.AddedFile(*spec, *file)); } return *this; @@ -75,11 +75,13 @@ FastAppend& FastAppend::AppendManifest(const ManifestFile& manifest) { "Sequence number must be assigned during commit"); if (can_inherit_snapshot_id() && manifest.added_snapshot_id == kInvalidSnapshotId) { - summary_.AddedManifest(manifest); + appended_manifests_summary_.AddedManifest(manifest); append_manifests_.push_back(manifest); } else { // The manifest must be rewritten with this update's snapshot ID - ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto copied_manifest, CopyManifest(manifest)); + ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto copied_manifest, + CopyManifest(manifest, /*update_summary=*/true)); + append_manifests_to_copy_.push_back(manifest); rewritten_append_manifests_.push_back(std::move(copied_manifest)); } @@ -93,6 +95,16 @@ Result> FastAppend::Apply( std::vector manifests; ICEBERG_ASSIGN_OR_RAISE(auto new_written_manifests, WriteNewManifests()); + // A retry cleanup deletes copied append manifests and clears the rewritten + // list; rebuild them from the original appended manifests before re-applying. + if (rewritten_append_manifests_.empty() && !append_manifests_to_copy_.empty()) { + for (const auto& manifest : append_manifests_to_copy_) { + ICEBERG_ASSIGN_OR_RAISE(auto copied_manifest, + CopyManifest(manifest, /*update_summary=*/false)); + rewritten_append_manifests_.push_back(std::move(copied_manifest)); + } + } + manifests.reserve(new_written_manifests.size() + append_manifests_.size() + rewritten_append_manifests_.size()); if (!new_written_manifests.empty()) { @@ -122,15 +134,31 @@ Result> FastAppend::Apply( snapshot_manifests.end()); } + manifest_count_summary_ = + BuildManifestCountSummary(manifests, /*replaced_manifests_count=*/0); + return manifests; } std::unordered_map FastAppend::Summary() { + summary_.Clear(); summary_.SetPartitionSummaryLimit( base().properties.Get(TableProperties::kWritePartitionSummaryLimit)); + summary_.Merge(added_data_files_summary_); + summary_.Merge(appended_manifests_summary_); + for (const auto& [property, value] : custom_summary_properties_) { + summary_.Set(property, value); + } + summary_.Merge(manifest_count_summary_); return summary_.Build(); } +void FastAppend::SetSummaryProperty(const std::string& property, + const std::string& value) { + custom_summary_properties_[property] = value; + SnapshotUpdate::SetSummaryProperty(property, value); +} + Status FastAppend::CleanUncommitted(const std::unordered_set& committed) { // Clean up new manifests that were written but not committed if (!new_manifests_.empty()) { @@ -151,24 +179,26 @@ Status FastAppend::CleanUncommitted(const std::unordered_set& commi std::ignore = DeleteFile(manifest.manifest_path); } } + rewritten_append_manifests_.clear(); } return {}; } bool FastAppend::CleanupAfterCommit() const { - // Cleanup after committing is disabled for FastAppend unless there are - // rewritten_append_manifests_ because: - // 1.) Appended manifests are never rewritten + // Cleanup after committing is disabled for FastAppend unless append manifests + // were copied or need to be copied on retry because: + // 1.) Directly appended manifests are never rewritten // 2.) Manifests which are written out as part of AppendFile are already cleaned // up between commit attempts in WriteNewManifests - return !rewritten_append_manifests_.empty(); + return !rewritten_append_manifests_.empty() || !append_manifests_to_copy_.empty(); } Result> FastAppend::Spec(int32_t spec_id) { return base().PartitionSpecById(spec_id); } -Result FastAppend::CopyManifest(const ManifestFile& manifest) { +Result FastAppend::CopyManifest(const ManifestFile& manifest, + bool update_summary) { const TableMetadata& current = base(); ICEBERG_ASSIGN_OR_RAISE(auto schema, current.Schema()); ICEBERG_ASSIGN_OR_RAISE(auto spec, @@ -180,7 +210,8 @@ Result FastAppend::CopyManifest(const ManifestFile& manifest) { // Copy the manifest with the new snapshot ID. return CopyAppendManifest(manifest, ctx_->table->io(), schema, spec, snapshot_id, - new_manifest_path, current.format_version, &summary_); + new_manifest_path, current.format_version, + update_summary ? &appended_manifests_summary_ : nullptr); } Result> FastAppend::WriteNewManifests() { diff --git a/src/iceberg/update/fast_append.h b/src/iceberg/update/fast_append.h index a04786c88..07018989c 100644 --- a/src/iceberg/update/fast_append.h +++ b/src/iceberg/update/fast_append.h @@ -72,6 +72,7 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate { const TableMetadata& metadata_to_update, const std::shared_ptr& snapshot) override; std::unordered_map Summary() override; + void SetSummaryProperty(const std::string& property, const std::string& value) override; Status CleanUncommitted(const std::unordered_set& committed) override; bool CleanupAfterCommit() const override; @@ -84,8 +85,9 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate { /// \brief Copy a manifest file with a new snapshot ID. /// /// \param manifest The manifest to copy + /// \param update_summary Whether to add copied entries to the append summary /// \return The copied manifest file - Result CopyManifest(const ManifestFile& manifest); + Result CopyManifest(const ManifestFile& manifest, bool update_summary); /// \brief Write new manifests for the accumulated data files. /// @@ -95,9 +97,18 @@ class ICEBERG_EXPORT FastAppend : public SnapshotUpdate { private: std::string table_name_; std::unordered_map new_data_files_by_spec_; + // Stable input summaries for retry-safe summary_ rebuilds. + SnapshotSummaryBuilder added_data_files_summary_; + SnapshotSummaryBuilder appended_manifests_summary_; + // User-provided summary properties restored after summary_ rebuilds. + std::unordered_map custom_summary_properties_; std::vector append_manifests_; + // Original manifests kept to recreate copied manifests after retry cleanup. + std::vector append_manifests_to_copy_; std::vector rewritten_append_manifests_; std::vector new_manifests_; + // Manifest count summary from the latest Apply() result. + SnapshotSummaryBuilder manifest_count_summary_; bool has_new_files_{false}; }; diff --git a/src/iceberg/update/merging_snapshot_update.cc b/src/iceberg/update/merging_snapshot_update.cc index a0d882d14..77d3c41c0 100644 --- a/src/iceberg/update/merging_snapshot_update.cc +++ b/src/iceberg/update/merging_snapshot_update.cc @@ -944,26 +944,11 @@ Result> MergingSnapshotUpdate::Apply( result.insert(result.end(), std::make_move_iterator(merged_deletes.begin()), std::make_move_iterator(merged_deletes.end())); - // Manifest count summary: unassigned manifests count as neither created nor kept. - int32_t manifests_created = 0; - int32_t manifests_kept = 0; - for (const auto& m : result) { - if (m.added_snapshot_id == snapshot_id) { - ++manifests_created; - } else if (m.added_snapshot_id != kInvalidSnapshotId) { - ++manifests_kept; - } - } int32_t replaced_manifests_count = data_filter_manager_->ReplacedManifestsCount() + delete_filter_manager_->ReplacedManifestsCount() + data_merge_manager_->ReplacedManifestsCount() + delete_merge_manager_->ReplacedManifestsCount(); - summary_builder().Set(SnapshotSummaryFields::kManifestsCreated, - std::to_string(manifests_created)); - summary_builder().Set(SnapshotSummaryFields::kManifestsKept, - std::to_string(manifests_kept)); - summary_builder().Set(SnapshotSummaryFields::kManifestsReplaced, - std::to_string(replaced_manifests_count)); + summary_builder().Merge(BuildManifestCountSummary(result, replaced_manifests_count)); return result; } diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index bb5376fa8..03f68cc94 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -424,6 +424,28 @@ std::string SnapshotUpdate::ManifestListPath() { return ctx_->MetadataFileLocation(filename); } +SnapshotSummaryBuilder SnapshotUpdate::BuildManifestCountSummary( + std::span manifests, int32_t replaced_manifests_count) { + SnapshotSummaryBuilder summary; + int32_t manifests_created = 0; + int32_t manifests_kept = 0; + int64_t snapshot_id = SnapshotId(); + for (const auto& manifest : manifests) { + if (manifest.added_snapshot_id == snapshot_id) { + ++manifests_created; + } else if (manifest.added_snapshot_id != kInvalidSnapshotId) { + ++manifests_kept; + } + } + + summary.Set(SnapshotSummaryFields::kManifestsCreated, + std::to_string(manifests_created)); + summary.Set(SnapshotSummaryFields::kManifestsKept, std::to_string(manifests_kept)); + summary.Set(SnapshotSummaryFields::kManifestsReplaced, + std::to_string(replaced_manifests_count)); + return summary; +} + std::string SnapshotUpdate::ManifestPath() { // Generate manifest path // Format: {metadata_location}/{uuid}-m{manifest_count}.avro diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index 03a74e788..7397034b3 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -216,6 +216,8 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { std::string ManifestPath(); std::string ManifestListPath(); SnapshotSummaryBuilder& summary_builder() { return summary_; } + SnapshotSummaryBuilder BuildManifestCountSummary( + std::span manifests, int32_t replaced_manifests_count); private: /// \brief Returns the snapshot summary from the implementation and updates totals. From 9a2e21da10be52410bfcdb71e836341cb785c98c Mon Sep 17 00:00:00 2001 From: wzhuo Date: Fri, 19 Jun 2026 05:31:09 +0800 Subject: [PATCH 100/151] fix: skip only null partition value rows in ParseDataFile (#756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary `ParseDataFile()` in `manifest_reader.cc` iterated over rows for each partition child field and used `break` to skip null partition values. `break` exits the entire inner row loop, so once a null value was encountered, **all subsequent rows for that partition column were skipped** and never had their partition values parsed. The fix changes `break` to `continue`, so only the current null row is skipped while the remaining rows are still processed. ## Changes - `src/iceberg/manifest/manifest_reader.cc`: `break` → `continue` in the partition-value row loop. - `src/iceberg/test/manifest_reader_test.cc`: add regression test `NullPartitionValueDoesNotSkipSubsequentRows` that writes a manifest with a null partition value before non-null ones and verifies the later rows are parsed correctly. ## Testing - New test passes for manifest versions V1/V2/V3. - Confirmed the test fails with the original `break` (`partition.num_fields()` is 0 instead of 1 for rows after the null one). - Full `manifest_test` suite passes (171 tests). --- src/iceberg/manifest/manifest_reader.cc | 68 ++++++++++----------- src/iceberg/test/manifest_reader_test.cc | 75 ++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 33 deletions(-) diff --git a/src/iceberg/manifest/manifest_reader.cc b/src/iceberg/manifest/manifest_reader.cc index bc7572591..8757b5d61 100644 --- a/src/iceberg/manifest/manifest_reader.cc +++ b/src/iceberg/manifest/manifest_reader.cc @@ -389,39 +389,40 @@ Result> ParseManifestList(ArrowSchema* arrow_schema, } Status ParsePartitionValues(ArrowArrayView* view, int64_t row_idx, + const std::shared_ptr& field_type, std::vector& manifest_entries) { + auto& partition = manifest_entries[row_idx].data_file->partition; + if (view->storage_type == ArrowType::NANOARROW_TYPE_NA || + ArrowArrayViewIsNull(view, row_idx)) { + partition.AddValue(Literal::Null(field_type)); + return {}; + } switch (view->storage_type) { - case ArrowType::NANOARROW_TYPE_BOOL: { - auto value = ArrowArrayViewGetUIntUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue( - Literal::Boolean(value != 0)); - } break; - case ArrowType::NANOARROW_TYPE_INT32: { - auto value = ArrowArrayViewGetIntUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue(Literal::Int(value)); - } break; - case ArrowType::NANOARROW_TYPE_INT64: { - auto value = ArrowArrayViewGetIntUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue(Literal::Long(value)); - } break; - case ArrowType::NANOARROW_TYPE_FLOAT: { - auto value = ArrowArrayViewGetDoubleUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue(Literal::Float(value)); - } break; - case ArrowType::NANOARROW_TYPE_DOUBLE: { - auto value = ArrowArrayViewGetDoubleUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue(Literal::Double(value)); - } break; + case ArrowType::NANOARROW_TYPE_BOOL: + partition.AddValue( + Literal::Boolean(ArrowArrayViewGetUIntUnsafe(view, row_idx) != 0)); + break; + case ArrowType::NANOARROW_TYPE_INT32: + partition.AddValue(Literal::Int(ArrowArrayViewGetIntUnsafe(view, row_idx))); + break; + case ArrowType::NANOARROW_TYPE_INT64: + partition.AddValue(Literal::Long(ArrowArrayViewGetIntUnsafe(view, row_idx))); + break; + case ArrowType::NANOARROW_TYPE_FLOAT: + partition.AddValue(Literal::Float(ArrowArrayViewGetDoubleUnsafe(view, row_idx))); + break; + case ArrowType::NANOARROW_TYPE_DOUBLE: + partition.AddValue(Literal::Double(ArrowArrayViewGetDoubleUnsafe(view, row_idx))); + break; case ArrowType::NANOARROW_TYPE_STRING: { - auto value = ArrowArrayViewGetStringUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue( - Literal::String(std::string(value.data, value.size_bytes))); + auto str_value = ArrowArrayViewGetStringUnsafe(view, row_idx); + partition.AddValue( + Literal::String(std::string(str_value.data, str_value.size_bytes))); } break; case ArrowType::NANOARROW_TYPE_BINARY: { - auto buffer = ArrowArrayViewGetBytesUnsafe(view, row_idx); - manifest_entries[row_idx].data_file->partition.AddValue( - Literal::Binary(std::vector(buffer.data.as_char, - buffer.data.as_char + buffer.size_bytes))); + auto buf_value = ArrowArrayViewGetBytesUnsafe(view, row_idx); + partition.AddValue(Literal::Binary(std::vector( + buf_value.data.as_char, buf_value.data.as_char + buf_value.size_bytes))); } break; default: return InvalidManifest("Unsupported type {} for partition values", @@ -473,14 +474,15 @@ Status ParseDataFile(const std::shared_ptr& data_file_schema, case DataFile::kPartitionFieldId: { ICEBERG_RETURN_UNEXPECTED( AssertViewType(field_view, ArrowType::NANOARROW_TYPE_STRUCT, field_name)); + const auto& partition_type = + internal::checked_cast(*field->get().type()); for (int64_t part_idx = 0; part_idx < field_view->n_children; part_idx++) { auto part_view = field_view->children[part_idx]; + auto part_field_type = internal::checked_pointer_cast( + partition_type.fields()[part_idx].type()); for (int64_t row_idx = 0; row_idx < part_view->length; row_idx++) { - if (ArrowArrayViewIsNull(part_view, row_idx)) { - break; - } - ICEBERG_RETURN_UNEXPECTED( - ParsePartitionValues(part_view, row_idx, manifest_entries)); + ICEBERG_RETURN_UNEXPECTED(ParsePartitionValues( + part_view, row_idx, part_field_type, manifest_entries)); } } } break; diff --git a/src/iceberg/test/manifest_reader_test.cc b/src/iceberg/test/manifest_reader_test.cc index 4a17eacaa..b57b0bc4a 100644 --- a/src/iceberg/test/manifest_reader_test.cc +++ b/src/iceberg/test/manifest_reader_test.cc @@ -288,6 +288,81 @@ TEST_P(TestManifestReader, TestManifestReaderWithPartitionMetadata) { EXPECT_EQ(read_entry.data_file->partition.values()[0], Literal::Int(0)); } +TEST_P(TestManifestReader, NullPartitionValuePreservedPositionallyAcrossRows) { + auto version = GetParam(); + + // Two partition fields, with several entries. The first entry has a null in + // partition field 0. The null must be preserved as a typed null in place so + // that (a) the tuple keeps one value per partition field (arity matches the + // spec), (b) the non-null value for field 1 stays in position 1 instead of + // shifting into position 0, and (c) parsing of the remaining rows is not + // aborted. This mirrors Iceberg Java's PartitionData, a fixed-size positional + // array that stores null in place. + auto multi_schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(/*field_id=*/3, "id", int32()), + SchemaField::MakeRequired(/*field_id=*/4, "data", string())}); + + std::shared_ptr multi_spec; + ICEBERG_UNWRAP_OR_FAIL( + multi_spec, + PartitionSpec::Make( + /*spec_id=*/0, {PartitionField(/*source_id=*/3, /*field_id=*/1000, "id_part", + Transform::Identity()), + PartitionField(/*source_id=*/4, /*field_id=*/1001, + "data_bucket", Transform::Bucket(16))})); + + const std::string manifest_path = MakeManifestPath(); + auto writer_result = ManifestWriter::MakeWriter( + version, /*snapshot_id=*/1000L, manifest_path, file_io_, multi_spec, multi_schema, + ManifestContent::kData, /*first_row_id=*/0L); + ASSERT_THAT(writer_result, IsOk()); + auto writer = std::move(writer_result.value()); + + // First entry: partition field 0 (identity int) is null, field 1 (bucket) is 9. + auto file_null = + MakeDataFile("/path/to/data-null.parquet", + PartitionValues({Literal::Null(int32()), Literal::Int(9)})); + auto file_b = MakeDataFile("/path/to/data-b.parquet", + PartitionValues({Literal::Int(1), Literal::Int(5)})); + auto file_c = MakeDataFile("/path/to/data-c.parquet", + PartitionValues({Literal::Int(2), Literal::Int(7)})); + ASSERT_THAT( + writer->WriteEntry(MakeEntry(ManifestStatus::kAdded, 1000L, std::move(file_null))), + IsOk()); + ASSERT_THAT( + writer->WriteEntry(MakeEntry(ManifestStatus::kAdded, 1000L, std::move(file_b))), + IsOk()); + ASSERT_THAT( + writer->WriteEntry(MakeEntry(ManifestStatus::kAdded, 1000L, std::move(file_c))), + IsOk()); + ASSERT_THAT(writer->Close(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto manifest, writer->ToManifestFile()); + + ICEBERG_UNWRAP_OR_FAIL( + auto reader, ManifestReader::Make(manifest, file_io_, multi_schema, multi_spec)); + ICEBERG_UNWRAP_OR_FAIL(auto read_entries, reader->Entries()); + + ASSERT_EQ(read_entries.size(), 3U); + + // The null-partition row keeps both fields: a null in position 0 and the + // non-null value in position 1 (no shifting). + EXPECT_EQ(read_entries[0].data_file->file_path, "/path/to/data-null.parquet"); + ASSERT_EQ(read_entries[0].data_file->partition.num_fields(), 2); + EXPECT_TRUE(read_entries[0].data_file->partition.values()[0].IsNull()); + EXPECT_EQ(read_entries[0].data_file->partition.values()[1], Literal::Int(9)); + + // Rows after the null one must still have their partition values parsed. + EXPECT_EQ(read_entries[1].data_file->file_path, "/path/to/data-b.parquet"); + ASSERT_EQ(read_entries[1].data_file->partition.num_fields(), 2); + EXPECT_EQ(read_entries[1].data_file->partition.values()[0], Literal::Int(1)); + EXPECT_EQ(read_entries[1].data_file->partition.values()[1], Literal::Int(5)); + + EXPECT_EQ(read_entries[2].data_file->file_path, "/path/to/data-c.parquet"); + ASSERT_EQ(read_entries[2].data_file->partition.num_fields(), 2); + EXPECT_EQ(read_entries[2].data_file->partition.values()[0], Literal::Int(2)); + EXPECT_EQ(read_entries[2].data_file->partition.values()[1], Literal::Int(7)); +} + TEST_P(TestManifestReader, ReadsEntriesWhenPartitionSourceFieldIsMissing) { auto version = GetParam(); auto file = MakeDataFile("/path/to/historical-data.parquet", From 6f50a39d2680160b19d21e25844b98bf32e0ddd5 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Fri, 19 Jun 2026 05:31:30 +0800 Subject: [PATCH 101/151] feat: add uniqueValue optimization for notEq/notIn in InclusiveMetricsEvaluator (#754) When a column has a single unique value (no nulls, no NaNs, and lower bound == upper bound), notEq(X) and notIn({...X...}) can prune files where that unique value matches the predicate, returning ROWS_CANNOT_MATCH. Previously these always returned ROWS_MIGHT_MATCH, never pruning. This mirrors the upstream Java InclusiveMetricsEvaluator.uniqueValue() logic. The StrictMetricsEvaluator is unchanged: its existing bounds-based notEq/notIn logic already covers the single-value case, matching upstream Java which has no uniqueValue helper there. Ports the corresponding testNotEqWithSingleValue/testNotInWithSingleValue cases from the Java test suite. --------- Co-authored-by: Junwang Zhao --- .../expression/inclusive_metrics_evaluator.cc | 43 ++++- .../test/inclusive_metrics_evaluator_test.cc | 154 ++++++++++++++++++ 2 files changed, 196 insertions(+), 1 deletion(-) diff --git a/src/iceberg/expression/inclusive_metrics_evaluator.cc b/src/iceberg/expression/inclusive_metrics_evaluator.cc index 29f5aba24..79ec23665 100644 --- a/src/iceberg/expression/inclusive_metrics_evaluator.cc +++ b/src/iceberg/expression/inclusive_metrics_evaluator.cc @@ -223,6 +223,13 @@ class InclusiveMetricsVisitor : public BoundVisitor { Result NotEq(const std::shared_ptr& expr, const Literal& lit) override { // because the bounds are not necessarily a min or max value, this cannot be answered // using them. notEq(col, X) with (X, Y) doesn't guarantee that X is a value in col. + // However, when min == max and the file has no nulls or NaN values, we can safely + // prune if that value equals the literal. + ICEBERG_ASSIGN_OR_RAISE(auto value, UniqueValue(expr)); + if (value.has_value() && value.value() == lit) { + return kRowCannotMatch; + } + return kRowsMightMatch; } @@ -271,7 +278,13 @@ class InclusiveMetricsVisitor : public BoundVisitor { const BoundSetPredicate::LiteralSet& literal_set) override { // because the bounds are not necessarily a min or max value, this cannot be answered // using them. notIn(col, {X, ...}) with (X, Y) doesn't guarantee that X is a value in - // col. + // col. However, when min == max and the file has no nulls or NaN values, we can + // safely prune if that value is in the exclusion set. + ICEBERG_ASSIGN_OR_RAISE(auto value, UniqueValue(expr)); + if (value.has_value() && literal_set.contains(value.value())) { + return kRowCannotMatch; + } + return kRowsMightMatch; } @@ -416,6 +429,34 @@ class InclusiveMetricsVisitor : public BoundVisitor { // TODO(xiao.dong) handle extract lower and upper bounds } + /// Returns the column's single value if all rows contain the same value. Defined as a + /// column with no nulls, no NaNs, and lower bound equals upper bound. Returns + /// std::nullopt otherwise. + Result> UniqueValue(const std::shared_ptr& expr) { + int32_t id = expr->reference()->field().field_id(); + if (MayContainNull(id)) { + return std::nullopt; + } + + ICEBERG_ASSIGN_OR_RAISE(auto lower, LowerBound(expr)); + ICEBERG_ASSIGN_OR_RAISE(auto upper, UpperBound(expr)); + if (!lower.has_value() || !upper.has_value() || lower->IsNull() || upper->IsNull() || + lower->IsNaN() || upper->IsNaN()) { + return std::nullopt; + } + + auto nan_it = data_file_.nan_value_counts.find(id); + if (nan_it != data_file_.nan_value_counts.cend() && nan_it->second != 0) { + return std::nullopt; + } + + if (lower.value() != upper.value()) { + return std::nullopt; + } + + return lower; + } + Result> ParseLowerBound(const BoundReference& ref) { int32_t id = ref.field().field_id(); auto type = ref.type(); diff --git a/src/iceberg/test/inclusive_metrics_evaluator_test.cc b/src/iceberg/test/inclusive_metrics_evaluator_test.cc index 27867f1a4..f4e24ffe0 100644 --- a/src/iceberg/test/inclusive_metrics_evaluator_test.cc +++ b/src/iceberg/test/inclusive_metrics_evaluator_test.cc @@ -945,4 +945,158 @@ TEST_F(InclusiveMetricsEvaluatorMigratedTest, IntegerNotInTest) { RunTest(Expressions::NotIn("id", ids), kRowsMightMatch, file1_); } +TEST_F(InclusiveMetricsEvaluatorMigratedTest, NotEqWithSingleValue) { + // file has a range of values, cannot prune based on a single literal + auto range_of_values = std::make_shared(); + range_of_values->file_path = "range_of_values"; + range_of_values->file_format = FileFormatType::kParquet; + range_of_values->record_count = 10; + range_of_values->value_counts = {{3, 10L}}; + range_of_values->null_value_counts = {{3, 0L}}; + range_of_values->nan_value_counts = {{3, 0L}}; + range_of_values->lower_bounds = {{3, Literal::String("aaa").Serialize().value()}}; + range_of_values->upper_bounds = {{3, Literal::String("zzz").Serialize().value()}}; + RunTest(Expressions::NotEqual("required", Literal::String("aaa")), kRowsMightMatch, + range_of_values); + + // file contains a single value (lower == upper) with no nulls/NaNs + auto single_value = std::make_shared(); + single_value->file_path = "single_value"; + single_value->file_format = FileFormatType::kParquet; + single_value->record_count = 10; + single_value->value_counts = {{3, 10L}}; + single_value->null_value_counts = {{3, 0L}}; + single_value->nan_value_counts = {{3, 0L}}; + single_value->lower_bounds = {{3, Literal::String("abc").Serialize().value()}}; + single_value->upper_bounds = {{3, Literal::String("abc").Serialize().value()}}; + // single value equals the literal -> rows cannot match + RunTest(Expressions::NotEqual("required", Literal::String("abc")), kRowCannotMatch, + single_value); + // single value differs from the literal -> rows might match + RunTest(Expressions::NotEqual("required", Literal::String("def")), kRowsMightMatch, + single_value); + + // single value but the file has nulls, which satisfy the != predicate + auto single_value_with_nulls = std::make_shared(); + single_value_with_nulls->file_path = "single_value_nulls"; + single_value_with_nulls->file_format = FileFormatType::kParquet; + single_value_with_nulls->record_count = 10; + single_value_with_nulls->value_counts = {{3, 10L}}; + single_value_with_nulls->null_value_counts = {{3, 2L}}; + single_value_with_nulls->nan_value_counts = {{3, 0L}}; + single_value_with_nulls->lower_bounds = { + {3, Literal::String("abc").Serialize().value()}}; + single_value_with_nulls->upper_bounds = { + {3, Literal::String("abc").Serialize().value()}}; + RunTest(Expressions::NotEqual("required", Literal::String("abc")), kRowsMightMatch, + single_value_with_nulls); + + // single value but the file has NaNs, which satisfy the != predicate + auto single_value_with_nan = std::make_shared(); + single_value_with_nan->file_path = "single_value_nan"; + single_value_with_nan->file_format = FileFormatType::kParquet; + single_value_with_nan->record_count = 10; + single_value_with_nan->value_counts = {{9, 10L}}; + single_value_with_nan->null_value_counts = {{9, 0L}}; + single_value_with_nan->nan_value_counts = {{9, 2L}}; + single_value_with_nan->lower_bounds = {{9, Literal::Float(5.0F).Serialize().value()}}; + single_value_with_nan->upper_bounds = {{9, Literal::Float(5.0F).Serialize().value()}}; + RunTest(Expressions::NotEqual("no_nans", Literal::Float(5.0F)), kRowsMightMatch, + single_value_with_nan); + + // bounds are NaN -> unreliable, cannot prune + auto single_value_nan_bounds = std::make_shared(); + single_value_nan_bounds->file_path = "single_value_nan_bounds"; + single_value_nan_bounds->file_format = FileFormatType::kParquet; + single_value_nan_bounds->record_count = 10; + single_value_nan_bounds->value_counts = {{9, 10L}}; + single_value_nan_bounds->null_value_counts = {{9, 0L}}; + single_value_nan_bounds->nan_value_counts = {{9, 0L}}; + single_value_nan_bounds->lower_bounds = { + {9, Literal::Float(kFloatNan).Serialize().value()}}; + single_value_nan_bounds->upper_bounds = { + {9, Literal::Float(kFloatNan).Serialize().value()}}; + RunTest(Expressions::NotEqual("no_nans", Literal::Float(5.0F)), kRowsMightMatch, + single_value_nan_bounds); +} + +TEST_F(InclusiveMetricsEvaluatorMigratedTest, NotInWithSingleValue) { + // file has a range of values, cannot prune based on the exclusion set + auto range_of_values = std::make_shared(); + range_of_values->file_path = "range_of_values"; + range_of_values->file_format = FileFormatType::kParquet; + range_of_values->record_count = 10; + range_of_values->value_counts = {{3, 10L}}; + range_of_values->null_value_counts = {{3, 0L}}; + range_of_values->nan_value_counts = {{3, 0L}}; + range_of_values->lower_bounds = {{3, Literal::String("aaa").Serialize().value()}}; + range_of_values->upper_bounds = {{3, Literal::String("zzz").Serialize().value()}}; + RunTest( + Expressions::NotIn("required", {Literal::String("aaa"), Literal::String("bbb")}), + kRowsMightMatch, range_of_values); + + // file contains a single value (lower == upper) with no nulls/NaNs + auto single_value = std::make_shared(); + single_value->file_path = "single_value"; + single_value->file_format = FileFormatType::kParquet; + single_value->record_count = 10; + single_value->value_counts = {{3, 10L}}; + single_value->null_value_counts = {{3, 0L}}; + single_value->nan_value_counts = {{3, 0L}}; + single_value->lower_bounds = {{3, Literal::String("abc").Serialize().value()}}; + single_value->upper_bounds = {{3, Literal::String("abc").Serialize().value()}}; + // single value is in the exclusion set -> rows cannot match + RunTest( + Expressions::NotIn("required", {Literal::String("abc"), Literal::String("def")}), + kRowCannotMatch, single_value); + // single value is not in the exclusion set -> rows might match + RunTest( + Expressions::NotIn("required", {Literal::String("def"), Literal::String("ghi")}), + kRowsMightMatch, single_value); + + // single value but the file has nulls, which satisfy the notIn predicate + auto single_value_with_nulls = std::make_shared(); + single_value_with_nulls->file_path = "single_value_nulls"; + single_value_with_nulls->file_format = FileFormatType::kParquet; + single_value_with_nulls->record_count = 10; + single_value_with_nulls->value_counts = {{3, 10L}}; + single_value_with_nulls->null_value_counts = {{3, 2L}}; + single_value_with_nulls->nan_value_counts = {{3, 0L}}; + single_value_with_nulls->lower_bounds = { + {3, Literal::String("abc").Serialize().value()}}; + single_value_with_nulls->upper_bounds = { + {3, Literal::String("abc").Serialize().value()}}; + RunTest( + Expressions::NotIn("required", {Literal::String("abc"), Literal::String("def")}), + kRowsMightMatch, single_value_with_nulls); + + // single value but the file has NaNs, which satisfy the notIn predicate + auto single_value_with_nan = std::make_shared(); + single_value_with_nan->file_path = "single_value_nan"; + single_value_with_nan->file_format = FileFormatType::kParquet; + single_value_with_nan->record_count = 10; + single_value_with_nan->value_counts = {{9, 10L}}; + single_value_with_nan->null_value_counts = {{9, 0L}}; + single_value_with_nan->nan_value_counts = {{9, 2L}}; + single_value_with_nan->lower_bounds = {{9, Literal::Float(5.0F).Serialize().value()}}; + single_value_with_nan->upper_bounds = {{9, Literal::Float(5.0F).Serialize().value()}}; + RunTest(Expressions::NotIn("no_nans", {Literal::Float(5.0F)}), kRowsMightMatch, + single_value_with_nan); + + // bounds are NaN -> unreliable, cannot prune + auto single_value_nan_bounds = std::make_shared(); + single_value_nan_bounds->file_path = "single_value_nan_bounds"; + single_value_nan_bounds->file_format = FileFormatType::kParquet; + single_value_nan_bounds->record_count = 10; + single_value_nan_bounds->value_counts = {{9, 10L}}; + single_value_nan_bounds->null_value_counts = {{9, 0L}}; + single_value_nan_bounds->nan_value_counts = {{9, 0L}}; + single_value_nan_bounds->lower_bounds = { + {9, Literal::Float(kFloatNan).Serialize().value()}}; + single_value_nan_bounds->upper_bounds = { + {9, Literal::Float(kFloatNan).Serialize().value()}}; + RunTest(Expressions::NotIn("no_nans", {Literal::Float(5.0F)}), kRowsMightMatch, + single_value_nan_bounds); +} + } // namespace iceberg From 6452715fde84837cdb42707376f025c638f60397 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Fri, 19 Jun 2026 05:31:43 +0800 Subject: [PATCH 102/151] fix: MergingSnapshotUpdate should not contain deleted file during retry (#707) --- .../test/merging_snapshot_update_test.cc | 32 +++++++++++++++++++ src/iceberg/update/merging_snapshot_update.cc | 18 ++++++++--- src/iceberg/update/merging_snapshot_update.h | 5 ++- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc index 69ee10b91..1b50a124e 100644 --- a/src/iceberg/test/merging_snapshot_update_test.cc +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -882,6 +882,38 @@ TEST_F(MergingSnapshotUpdateTest, AddManifestCopiesManifestWithAssignedSnapshotI EXPECT_NE(data_manifests[0].manifest_path, path); } +TEST_F(MergingSnapshotUpdateTest, AddManifestRetryCopiesManifestAgain) { + auto path = table_location_ + "/metadata/retry-input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_})); + manifest.added_snapshot_id = 12345; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AppendManifest(manifest), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto first_apply, static_cast(*op).Apply()); + SnapshotCache first_snapshot_cache(first_apply.snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto first_manifests, + first_snapshot_cache.DataManifests(file_io_)); + ASSERT_EQ(first_manifests.size(), 1U); + EXPECT_NE(first_manifests[0].manifest_path, path); + + ICEBERG_UNWRAP_OR_FAIL(auto second_apply, static_cast(*op).Apply()); + SnapshotCache second_snapshot_cache(second_apply.snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto second_manifests, + second_snapshot_cache.DataManifests(file_io_)); + ASSERT_EQ(second_manifests.size(), 1U); + EXPECT_NE(second_manifests[0].manifest_path, path); + EXPECT_NE(second_manifests[0].manifest_path, first_manifests[0].manifest_path); + + std::vector second_manifest_vector(second_manifests.begin(), + second_manifests.end()); + ICEBERG_UNWRAP_OR_FAIL(auto entries, + ReadAllEntries(second_manifest_vector, *table_->metadata())); + ASSERT_EQ(entries.size(), 1U); + ASSERT_NE(entries[0].data_file, nullptr); + EXPECT_EQ(entries[0].data_file->file_path, file_a_->file_path); +} + TEST_F(MergingSnapshotUpdateTest, AddManifestRejectsManifestWithFirstRowId) { auto path = table_location_ + "/metadata/rowid.avro"; ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_})); diff --git a/src/iceberg/update/merging_snapshot_update.cc b/src/iceberg/update/merging_snapshot_update.cc index 77d3c41c0..c4d108dcb 100644 --- a/src/iceberg/update/merging_snapshot_update.cc +++ b/src/iceberg/update/merging_snapshot_update.cc @@ -649,20 +649,23 @@ Status MergingSnapshotUpdate::AddManifest(ManifestFile manifest) { appended_manifests_summary_.AddedManifest(manifest); append_manifests_.push_back(std::move(manifest)); } else { - ICEBERG_ASSIGN_OR_RAISE(auto copied, CopyManifest(manifest)); + ICEBERG_ASSIGN_OR_RAISE(auto copied, CopyManifest(manifest, /*update_summary=*/true)); + append_manifests_to_copy_.push_back(std::move(manifest)); rewritten_append_manifests_.push_back(std::move(copied)); } return {}; } -Result MergingSnapshotUpdate::CopyManifest(const ManifestFile& manifest) { +Result MergingSnapshotUpdate::CopyManifest(const ManifestFile& manifest, + bool update_summary) { const TableMetadata& current = base(); ICEBERG_ASSIGN_OR_RAISE(auto schema, SnapshotUtil::SchemaFor(current, target_branch())); ICEBERG_ASSIGN_OR_RAISE(auto spec, current.PartitionSpecById(manifest.partition_spec_id)); std::string path = ManifestPath(); return CopyAppendManifest(manifest, ctx_->table->io(), schema, spec, SnapshotId(), path, - current.format_version, &appended_manifests_summary_); + current.format_version, + update_summary ? &appended_manifests_summary_ : nullptr); } // ------------------------------------------------------------------------- @@ -890,6 +893,13 @@ Result> MergingSnapshotUpdate::Apply( // Step 4: Write (or retrieve cached) new data manifests. ICEBERG_ASSIGN_OR_RAISE(auto written_data_manifests, WriteNewDataManifests()); + if (rewritten_append_manifests_.empty() && !append_manifests_to_copy_.empty()) { + for (const auto& manifest : append_manifests_to_copy_) { + ICEBERG_ASSIGN_OR_RAISE(auto copied, CopyManifest(manifest, + /*update_summary=*/false)); + rewritten_append_manifests_.push_back(std::move(copied)); + } + } // Incorporate append manifests (from AddManifest), stamping each with the // current snapshot ID. append_manifests_ are used directly (inherit path); @@ -972,7 +982,7 @@ Status MergingSnapshotUpdate::CleanUncommittedAppends( DeleteUncommitted(cached_new_delete_manifests_, committed, /*clear=*/true)); // rewritten_append_manifests_ are always owned by the table. ICEBERG_RETURN_UNEXPECTED( - DeleteUncommitted(rewritten_append_manifests_, committed, /*clear=*/false)); + DeleteUncommitted(rewritten_append_manifests_, committed, /*clear=*/true)); // append_manifests_ are only owned by the table if the commit succeeded. if (!committed.empty()) { diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h index 5d4e128e9..879403222 100644 --- a/src/iceberg/update/merging_snapshot_update.h +++ b/src/iceberg/update/merging_snapshot_update.h @@ -318,7 +318,8 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { /// \brief Copy a manifest with the current snapshot ID, for use when snapshot /// ID inheritance is not possible. - Result CopyManifest(const ManifestFile& manifest); + /// \param update_summary Whether to add copied entries to the append summary + Result CopyManifest(const ManifestFile& manifest, bool update_summary); Status AddDeleteFile(std::shared_ptr file, std::optional data_sequence_number); @@ -371,6 +372,8 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { // Manifests passed via AddManifest(): inherit path (no copy needed) and // rewrite path (must be copied with the current snapshot ID). std::vector append_manifests_; + // Original manifests kept to recreate copied manifests after retry cleanup. + std::vector append_manifests_to_copy_; std::vector rewritten_append_manifests_; // Set to true when new files are staged after the cache was populated, so the From 950fbfffc5130102a3e3ee10818ff124a218ae1b Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Fri, 19 Jun 2026 20:25:09 +0800 Subject: [PATCH 103/151] chore(ci): enable sccache for Meson Windows builds (#761) --- .github/workflows/rc.yml | 1 + .github/workflows/test.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 91d630814..7241981c5 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -16,6 +16,7 @@ # under the License. name: RC + on: push: tags: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04b43986f..652999f61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,10 +156,20 @@ jobs: run: | echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Setup sccache + if: ${{ startsWith(matrix.runs-on, 'windows') }} + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 + - name: Enable sccache + if: ${{ startsWith(matrix.runs-on, 'windows') }} + shell: bash + run: echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" - name: Build Iceberg run: | meson setup builddir ${{ matrix.meson-setup-args || '' }} meson compile -C builddir + - name: Show sccache stats + if: ${{ startsWith(matrix.runs-on, 'windows') }} + run: sccache --show-stats - name: Test Iceberg run: | meson test -C builddir --timeout-multiplier 0 --print-errorlogs From 255657beae7d142e574acefc17a9e50c56ffca99 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sat, 20 Jun 2026 19:27:26 +0800 Subject: [PATCH 104/151] feat: add merge append (#699) --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/table.cc | 11 + src/iceberg/table.h | 5 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/merge_append_test.cc | 1509 +++++++++++++++++++++++++ src/iceberg/test/table_test.cc | 1 + src/iceberg/transaction.cc | 8 + src/iceberg/transaction.h | 3 + src/iceberg/type_fwd.h | 1 + src/iceberg/update/merge_append.cc | 64 ++ src/iceberg/update/merge_append.h | 69 ++ src/iceberg/update/meson.build | 1 + 13 files changed, 1675 insertions(+) create mode 100644 src/iceberg/test/merge_append_test.cc create mode 100644 src/iceberg/update/merge_append.cc create mode 100644 src/iceberg/update/merge_append.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 04a9322a1..d4224cd65 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -101,6 +101,7 @@ set(ICEBERG_SOURCES type.cc update/expire_snapshots.cc update/fast_append.cc + update/merge_append.cc update/merging_snapshot_update.cc update/pending_update.cc update/set_snapshot.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index f0b103828..508d5e0bf 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -126,6 +126,7 @@ iceberg_sources = files( 'type.cc', 'update/expire_snapshots.cc', 'update/fast_append.cc', + 'update/merge_append.cc', 'update/merging_snapshot_update.cc', 'update/pending_update.cc', 'update/set_snapshot.cc', diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index ba83de123..9e8a35bd4 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -33,6 +33,7 @@ #include "iceberg/transaction.h" #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" +#include "iceberg/update/merge_append.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" #include "iceberg/update/update_location.h" @@ -217,6 +218,12 @@ Result> Table::NewFastAppend() { return FastAppend::Make(name().name, std::move(ctx)); } +Result> Table::NewMergeAppend() { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); + return MergeAppend::Make(name().name, std::move(ctx)); +} + Result> Table::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE( auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); @@ -316,6 +323,10 @@ Result> StaticTable::NewFastAppend() { return NotSupported("Cannot create a fast append for a static table"); } +Result> StaticTable::NewMergeAppend() { + return NotSupported("Cannot create a merge append for a static table"); +} + Result> StaticTable::NewSnapshotManager() { return NotSupported("Cannot create a snapshot manager for a static table"); } diff --git a/src/iceberg/table.h b/src/iceberg/table.h index a5e102686..45f4bd961 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -176,6 +176,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Create a new FastAppend to append data files and commit the changes. virtual Result> NewFastAppend(); + /// \brief Create a new MergeAppend to append data files and merge manifests. + virtual Result> NewMergeAppend(); + /// \brief Create a new SnapshotManager to manage snapshots and snapshot references. virtual Result> NewSnapshotManager(); @@ -243,6 +246,8 @@ class ICEBERG_EXPORT StaticTable : public Table { Result> NewFastAppend() override; + Result> NewMergeAppend() override; + Result> NewSnapshotManager() override; private: diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 0a7db5ed2..0e738924f 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -225,6 +225,7 @@ if(ICEBERG_BUILD_BUNDLE) expire_snapshots_test.cc fast_append_test.cc manifest_filter_manager_test.cc + merge_append_test.cc merging_snapshot_update_test.cc name_mapping_update_test.cc snapshot_manager_test.cc diff --git a/src/iceberg/test/merge_append_test.cc b/src/iceberg/test/merge_append_test.cc new file mode 100644 index 000000000..601d9476e --- /dev/null +++ b/src/iceberg/test/merge_append_test.cc @@ -0,0 +1,1509 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/merge_append.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/constants.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/manifest/manifest_writer.h" +#include "iceberg/partition_spec.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/table_properties.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/mock_catalog.h" +#include "iceberg/test/test_resource.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/transaction.h" +#include "iceberg/update/fast_append.h" +#include "iceberg/update/update_partition_spec.h" +#include "iceberg/update/update_properties.h" +#include "iceberg/util/uuid.h" + +namespace iceberg { + +namespace { + +// RollingManifestWriter checks whether to roll every 250 rows. +constexpr size_t kManifestFileGroupSizeForTest = 250; + +} // namespace + +class MergeAppendTestBase : public UpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + std::string TableName() const override { return "minimal_table"; } + + void SetUp() override { + table_ident_ = TableIdentifier{.name = TableName()}; + table_location_ = "/warehouse/" + TableName(); + + InitializeFileIO(); + RegisterMinimalTable(format_version()); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + file_c_ = MakeDataFile("/data/file_c.parquet", /*partition_x=*/3L); + file_d_ = MakeDataFile("/data/file_d.parquet", /*partition_x=*/4L); + } + + void RegisterMinimalTable(int8_t format_version) { + auto metadata_location = std::format("{}/metadata/00001-{}.metadata.json", + table_location_, Uuid::GenerateV7().ToString()); + ICEBERG_UNWRAP_OR_FAIL( + auto metadata, ReadTableMetadataFromResource("TableMetadataV2ValidMinimal.json")); + metadata->format_version = format_version; + metadata->location = table_location_; + metadata->next_row_id = TableMetadata::kInitialRowId; + + ASSERT_THAT(TableMetadataUtil::Write(*file_io_, metadata_location, *metadata), + IsOk()); + ICEBERG_UNWRAP_OR_FAIL(table_, + catalog_->RegisterTable(table_ident_, metadata_location)); + } + + virtual int8_t format_version() const { + return TableMetadata::kDefaultTableFormatVersion; + } + + virtual std::string branch() const { return std::string(SnapshotRef::kMainBranch); } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + return MakeDataFile(path, spec_, {Literal::Long(partition_x)}); + } + + std::vector> MakeDataFiles(std::string_view prefix, + size_t count) { + std::vector> files; + files.reserve(count); + for (size_t i = 0; i < count; ++i) { + files.push_back(MakeDataFile(std::format("{}/file_{}.parquet", prefix, i), + static_cast(i % 2))); + } + return files; + } + + std::shared_ptr MakeDataFile(const std::string& path, + std::shared_ptr spec, + std::vector partition_values) { + auto file = std::make_shared(); + file->content = DataFile::Content::kData; + file->file_path = table_location_ + path; + file->file_format = FileFormatType::kParquet; + file->partition = PartitionValues(std::move(partition_values)); + file->file_size_in_bytes = 1024; + file->record_count = 100; + file->partition_spec_id = spec->spec_id(); + return file; + } + + Result WriteManifest( + const std::string& path, const std::vector>& files) { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, ManifestWriter::MakeWriter( + format_version(), std::nullopt, path, file_io_, spec_, schema_, + ManifestContent::kData, /*first_row_id=*/std::nullopt)); + for (const auto& file : files) { + ManifestEntry entry; + entry.status = ManifestStatus::kAdded; + entry.snapshot_id = std::nullopt; + entry.data_file = file; + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + + Result WriteManifestEntries(const std::string& path, + const std::vector& entries) { + ICEBERG_ASSIGN_OR_RAISE( + auto writer, ManifestWriter::MakeWriter( + format_version(), std::nullopt, path, file_io_, spec_, schema_, + ManifestContent::kData, /*first_row_id=*/std::nullopt)); + for (const auto& entry : entries) { + switch (entry.status) { + case ManifestStatus::kAdded: + ICEBERG_RETURN_UNEXPECTED(writer->WriteAddedEntry(entry)); + break; + case ManifestStatus::kExisting: + ICEBERG_RETURN_UNEXPECTED(writer->WriteExistingEntry(entry)); + break; + case ManifestStatus::kDeleted: + ICEBERG_RETURN_UNEXPECTED(writer->WriteDeletedEntry(entry)); + break; + } + } + ICEBERG_RETURN_UNEXPECTED(writer->Close()); + return writer->ToManifestFile(); + } + + ManifestFile MakeEmptyAppendManifest(std::string path) { + ManifestFile manifest; + manifest.manifest_path = std::move(path); + manifest.content = ManifestContent::kData; + manifest.added_snapshot_id = kInvalidSnapshotId; + manifest.sequence_number = kInvalidSequenceNumber; + manifest.added_files_count = 0; + manifest.existing_files_count = 0; + manifest.deleted_files_count = 0; + return manifest; + } + + void SetManifestMinMergeCount(int count) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestMinMergeCount.key()), + std::to_string(count)); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + void SetManifestTargetSizeBytes(int64_t size_bytes) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestTargetSizeBytes.key()), + std::to_string(size_bytes)); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + void SetSnapshotIdInheritanceEnabled() { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kSnapshotIdInheritanceEnabled.key()), "true"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + void SetCommitRetryProperties(int32_t retries) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kCommitNumRetries.key()), + std::to_string(retries)); + props->Set(std::string(TableProperties::kCommitMinRetryWaitMs.key()), "1"); + props->Set(std::string(TableProperties::kCommitMaxRetryWaitMs.key()), "1"); + props->Set(std::string(TableProperties::kCommitTotalRetryTimeMs.key()), "1000"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + void BindTableWithFailingCommits(int failures, int* update_call_count = nullptr) { + auto mock_catalog = std::make_shared<::testing::NiceMock>(); + std::weak_ptr<::testing::NiceMock> weak_catalog = mock_catalog; + + ON_CALL(*mock_catalog, LoadTable(::testing::_)) + .WillByDefault([this, weak_catalog](const TableIdentifier& identifier) + -> Result> { + ICEBERG_ASSIGN_OR_RAISE(auto loaded, catalog_->LoadTable(identifier)); + auto catalog = weak_catalog.lock(); + ICEBERG_PRECHECK(catalog != nullptr, "Mock catalog expired"); + return Table::Make(loaded->name(), loaded->metadata(), + std::string(loaded->metadata_file_location()), loaded->io(), + catalog); + }); + + ON_CALL(*mock_catalog, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [this, weak_catalog, failures, update_call_count]( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) mutable + -> Result> { + if (update_call_count != nullptr) { + ++*update_call_count; + } + if (failures-- > 0) { + return CommitFailed("Injected failure"); + } + ICEBERG_ASSIGN_OR_RAISE( + auto updated, catalog_->UpdateTable(identifier, requirements, updates)); + auto catalog = weak_catalog.lock(); + ICEBERG_PRECHECK(catalog != nullptr, "Mock catalog expired"); + return Table::Make(updated->name(), updated->metadata(), + std::string(updated->metadata_file_location()), + updated->io(), catalog); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto bound_table, + Table::Make(table_->name(), table_->metadata(), + std::string(table_->metadata_file_location()), + table_->io(), mock_catalog)); + table_ = std::move(bound_table); + mock_catalogs_.push_back(std::move(mock_catalog)); + } + + // Create a MergeAppend already targeting branch(), so each test runs against + // both the main branch and a named branch without per-call boilerplate. + Result> NewBranchMergeAppend() { + ICEBERG_ASSIGN_OR_RAISE(auto append, table_->NewMergeAppend()); + append->SetTargetBranch(branch()); + return append; + } + + Result> NewBranchFastAppend() { + ICEBERG_ASSIGN_OR_RAISE(auto append, table_->NewFastAppend()); + append->SetTargetBranch(branch()); + return append; + } + + // Returns the snapshot referenced by branch(), so tests work uniformly whether + // they commit to the main branch or to a named branch. + Result> CurrentSnapshot() { + const auto& refs = table_->metadata()->refs; + auto it = refs.find(branch()); + if (it == refs.end()) { + return NotFound("No snapshot ref for branch '{}'", branch()); + } + return table_->SnapshotById(it->second->snapshot_id); + } + + Result> CurrentDataManifests() { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot, CurrentSnapshot()); + return DataManifests(snapshot); + } + + Result> SnapshotForBranch(const TableMetadata& metadata) { + auto it = metadata.refs.find(branch()); + if (it == metadata.refs.end()) { + return NotFound("No snapshot ref for branch '{}'", branch()); + } + return metadata.SnapshotById(it->second->snapshot_id); + } + + Result> DataManifests( + const std::shared_ptr& snapshot) { + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, snapshot_cache.DataManifests(file_io_)); + return std::vector(manifests.begin(), manifests.end()); + } + + bool FileExists(const std::string& path) { + auto input_file = file_io_->NewInputFile(path); + if (!input_file.has_value()) { + return false; + } + return input_file.value()->Size().has_value(); + } + + Result> ReadEntries(const ManifestFile& manifest) { + return ReadAllEntries(std::span(&manifest, 1)); + } + + Result> ReadAllEntries( + std::span manifests) { + std::vector result; + for (const auto& manifest : manifests) { + ICEBERG_ASSIGN_OR_RAISE( + auto spec, table_->metadata()->PartitionSpecById(manifest.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, file_io_, schema_, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + result.insert(result.end(), entries.begin(), entries.end()); + } + return result; + } + + std::vector ManifestPaths(const std::vector& manifests) { + std::vector paths; + paths.reserve(manifests.size()); + for (const auto& manifest : manifests) { + paths.push_back(manifest.manifest_path); + } + return paths; + } + + const ManifestFile* FindManifestByPath(const std::vector& manifests, + const std::string& path) { + auto it = std::ranges::find_if(manifests, [&path](const ManifestFile& manifest) { + return manifest.manifest_path == path; + }); + return it == manifests.end() ? nullptr : &*it; + } + + const ManifestFile* FindManifestForSpec(const std::vector& manifests, + int32_t spec_id) { + auto it = std::ranges::find_if(manifests, [spec_id](const ManifestFile& manifest) { + return manifest.partition_spec_id == spec_id; + }); + return it == manifests.end() ? nullptr : &*it; + } + + void ExpectManifestEntries(const ManifestFile& manifest, + const std::vector>& expected_files, + const std::vector& expected_statuses) { + ASSERT_EQ(expected_files.size(), expected_statuses.size()); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadEntries(manifest)); + ASSERT_EQ(entries.size(), expected_files.size()); + for (size_t i = 0; i < entries.size(); ++i) { + EXPECT_EQ(entries[i].status, expected_statuses[i]); + ASSERT_NE(entries[i].data_file, nullptr); + EXPECT_EQ(entries[i].data_file->file_path, expected_files[i]->file_path); + EXPECT_EQ(entries[i].data_file->partition_spec_id, + expected_files[i]->partition_spec_id); + } + } + + void ExpectAllEntriesAcrossManifests( + std::span manifests, + const std::vector>& expected_files, + ManifestStatus expected_status) { + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(manifests)); + ASSERT_EQ(entries.size(), expected_files.size()); + + std::vector expected_paths; + expected_paths.reserve(expected_files.size()); + for (const auto& file : expected_files) { + expected_paths.push_back(file->file_path); + } + + std::vector actual_paths; + actual_paths.reserve(entries.size()); + for (const auto& entry : entries) { + EXPECT_EQ(entry.status, expected_status); + ASSERT_NE(entry.data_file, nullptr); + actual_paths.push_back(entry.data_file->file_path); + } + EXPECT_THAT(actual_paths, ::testing::UnorderedElementsAreArray(expected_paths)); + } + + void ExpectAllEntryPathsAcrossManifests( + std::span manifests, + const std::vector>& expected_files) { + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadAllEntries(manifests)); + ASSERT_EQ(entries.size(), expected_files.size()); + + std::vector expected_paths; + expected_paths.reserve(expected_files.size()); + for (const auto& file : expected_files) { + expected_paths.push_back(file->file_path); + } + + std::vector actual_paths; + actual_paths.reserve(entries.size()); + for (const auto& entry : entries) { + ASSERT_NE(entry.data_file, nullptr); + actual_paths.push_back(entry.data_file->file_path); + } + EXPECT_THAT(actual_paths, ::testing::UnorderedElementsAreArray(expected_paths)); + } + + void ExpectManifestEntriesMatchFiles( + const ManifestFile& manifest, + std::span> expected_files) { + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadEntries(manifest)); + ASSERT_EQ(entries.size(), expected_files.size()); + for (size_t i = 0; i < entries.size(); ++i) { + EXPECT_EQ(entries[i].status, ManifestStatus::kAdded); + ASSERT_NE(entries[i].data_file, nullptr); + EXPECT_EQ(entries[i].data_file->file_path, expected_files[i]->file_path); + } + } + + void ExpectManifestEntries(const ManifestFile& manifest, + const std::vector>& expected_files, + const std::vector& expected_statuses, + const std::vector& expected_snapshot_ids, + const std::vector& expected_sequence_numbers, + const std::vector& expected_file_sequence_numbers) { + ASSERT_EQ(expected_files.size(), expected_statuses.size()); + ASSERT_EQ(expected_files.size(), expected_snapshot_ids.size()); + ASSERT_EQ(expected_files.size(), expected_sequence_numbers.size()); + ASSERT_EQ(expected_files.size(), expected_file_sequence_numbers.size()); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadEntries(manifest)); + ASSERT_EQ(entries.size(), expected_files.size()); + for (size_t i = 0; i < entries.size(); ++i) { + EXPECT_EQ(entries[i].status, expected_statuses[i]); + EXPECT_EQ(entries[i].snapshot_id, expected_snapshot_ids[i]); + EXPECT_EQ(entries[i].sequence_number, expected_sequence_numbers[i]); + EXPECT_EQ(entries[i].file_sequence_number, expected_file_sequence_numbers[i]); + ASSERT_NE(entries[i].data_file, nullptr); + EXPECT_EQ(entries[i].data_file->file_path, expected_files[i]->file_path); + EXPECT_EQ(entries[i].data_file->partition_spec_id, + expected_files[i]->partition_spec_id); + } + } + + void ExpectAppendManifestError(ManifestFile manifest, + const std::string& expected_message) { + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendManifest(manifest); + + auto result = append->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage(expected_message)); + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; + std::shared_ptr file_c_; + std::shared_ptr file_d_; + std::vector>> mock_catalogs_; +}; + +class MergeAppendTest + : public MergeAppendTestBase, + public ::testing::WithParamInterface> { + protected: + int8_t format_version() const override { return std::get<0>(GetParam()); } + std::string branch() const override { return std::get<1>(GetParam()); } +}; + +TEST_F(MergeAppendTestBase, AppendNullFile) { + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(nullptr); + + auto result = append->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot add a null data file")); +} + +TEST_P(MergeAppendTest, AddManyFiles) { + EXPECT_THAT(CurrentSnapshot(), IsError(ErrorKind::kNotFound)); + + constexpr size_t kManifestCount = 2; + constexpr size_t kFileCount = kManifestFileGroupSizeForTest * kManifestCount; + SetManifestTargetSizeBytes(10); + auto files = MakeDataFiles("/data/many", kFileCount); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + for (const auto& file : files) { + append->AppendFile(file); + } + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), + std::to_string(kFileCount)); + + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + EXPECT_EQ(data_manifests.size(), kManifestCount); + ExpectAllEntriesAcrossManifests(data_manifests, files, ManifestStatus::kAdded); +} + +TEST_P(MergeAppendTest, AddManyFilesWithConsistentOrdering) { + constexpr size_t kManifestCount = 3; + constexpr size_t kFileCount = kManifestFileGroupSizeForTest * kManifestCount; + SetManifestTargetSizeBytes(10); + + auto files = MakeDataFiles("/data/ordered", kFileCount); + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + for (const auto& file : files) { + append->AppendFile(file); + } + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), kManifestCount); + for (size_t i = 0; i < kManifestCount; ++i) { + auto first = + files.begin() + static_cast(i * kManifestFileGroupSizeForTest); + auto last = first + static_cast(kManifestFileGroupSizeForTest); + std::vector> expected(first, last); + ExpectManifestEntriesMatchFiles(data_manifests[i], expected); + } +} + +TEST_P(MergeAppendTest, EmptyTableAppend) { + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(file_a_).AppendFile(file_b_); + + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "200"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedFileSize), "2048"); + EXPECT_EQ(table_->metadata()->last_sequence_number, snapshot->sequence_number); + + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + EXPECT_EQ(data_manifests[0].added_snapshot_id, snapshot->snapshot_id); + EXPECT_EQ(data_manifests[0].sequence_number, snapshot->sequence_number); + ExpectManifestEntries(data_manifests[0], {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {snapshot->snapshot_id, snapshot->snapshot_id}, + {snapshot->sequence_number, snapshot->sequence_number}, + {snapshot->sequence_number, snapshot->sequence_number}); +} + +TEST_P(MergeAppendTest, EmptyTableAppendFilesWithDifferentSpecs) { + ICEBERG_UNWRAP_OR_FAIL(auto update_spec, table_->NewUpdatePartitionSpec()); + update_spec->AddField("y"); + EXPECT_THAT(update_spec->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto new_spec, table_->spec()); + + auto file_new_spec = MakeDataFile("/data/file_new_spec.parquet", new_spec, + {Literal::Long(5L), Literal::Long(6L)}); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(file_a_).AppendFile(file_new_spec); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + std::vector manifest_files(data_manifests.begin(), data_manifests.end()); + ASSERT_EQ(manifest_files.size(), 2U); + + auto* old_spec_manifest = FindManifestForSpec(manifest_files, spec_->spec_id()); + ASSERT_NE(old_spec_manifest, nullptr); + ExpectManifestEntries(*old_spec_manifest, {file_a_}, {ManifestStatus::kAdded}); + + auto* new_spec_manifest = FindManifestForSpec(manifest_files, new_spec->spec_id()); + ASSERT_NE(new_spec_manifest, nullptr); + ExpectManifestEntries(*new_spec_manifest, {file_new_spec}, {ManifestStatus::kAdded}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); +} + +TEST_P(MergeAppendTest, EmptyTableAppendManifest) { + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendManifest(manifest); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + if (format_version() == 1) { + EXPECT_NE(data_manifests[0].manifest_path, path); + } else { + EXPECT_EQ(data_manifests[0].manifest_path, path); + } + ExpectManifestEntries(data_manifests[0], {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {snapshot->snapshot_id, snapshot->snapshot_id}, + {snapshot->sequence_number, snapshot->sequence_number}, + {snapshot->sequence_number, snapshot->sequence_number}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); +} + +TEST_P(MergeAppendTest, EmptyTableAppendFilesAndManifest) { + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(file_c_).AppendFile(file_d_).AppendManifest(manifest); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + EXPECT_EQ(data_manifests.size(), 2U); + + if (format_version() == 1) { + EXPECT_EQ(FindManifestByPath(data_manifests, path), nullptr); + ExpectAllEntriesAcrossManifests(data_manifests, {file_a_, file_b_, file_c_, file_d_}, + ManifestStatus::kAdded); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "4"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "4"); + return; + } + + auto* inherited_manifest = FindManifestByPath(data_manifests, path); + ASSERT_NE(inherited_manifest, nullptr); + ExpectManifestEntries(*inherited_manifest, {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}); + + auto appended_manifest = std::ranges::find_if( + data_manifests, + [&path](const ManifestFile& manifest) { return manifest.manifest_path != path; }); + ASSERT_NE(appended_manifest, data_manifests.end()); + ExpectManifestEntries(*appended_manifest, {file_c_, file_d_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "4"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "4"); +} + +TEST_P(MergeAppendTest, MergeWithAppendFilesAndManifest) { + SetManifestMinMergeCount(1); + + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(file_c_).AppendFile(file_d_).AppendManifest(manifest); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, snapshot_cache.DataManifests(file_io_)); + ASSERT_EQ(data_manifests.size(), 1U); + EXPECT_NE(data_manifests[0].manifest_path, path); + + ExpectManifestEntries(data_manifests[0], {file_c_, file_d_, file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded, + ManifestStatus::kAdded, ManifestStatus::kAdded}, + {snapshot->snapshot_id, snapshot->snapshot_id, + snapshot->snapshot_id, snapshot->snapshot_id}, + {snapshot->sequence_number, snapshot->sequence_number, + snapshot->sequence_number, snapshot->sequence_number}, + {snapshot->sequence_number, snapshot->sequence_number, + snapshot->sequence_number, snapshot->sequence_number}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "4"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); +} + +TEST_P(MergeAppendTest, MergeWithExistingManifest) { + SetManifestMinMergeCount(1); + + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_).AppendFile(file_b_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto second_append, NewBranchMergeAppend()); + second_append->AppendFile(file_c_).AppendFile(file_d_); + EXPECT_THAT(second_append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + ExpectManifestEntries( + data_manifests[0], {file_c_, file_d_, file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded, ManifestStatus::kExisting, + ManifestStatus::kExisting}, + {second_snapshot->snapshot_id, second_snapshot->snapshot_id, + first_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {second_snapshot->sequence_number, second_snapshot->sequence_number, + first_snapshot->sequence_number, first_snapshot->sequence_number}, + {second_snapshot->sequence_number, second_snapshot->sequence_number, + first_snapshot->sequence_number, first_snapshot->sequence_number}); +} + +TEST_P(MergeAppendTest, ManifestMergeMinCount) { + if (format_version() >= 3) { + GTEST_SKIP() << "skips format version 3+"; + } + + auto path_a1 = table_location_ + "/metadata/input-a1.avro"; + auto path_c1 = table_location_ + "/metadata/input-c1.avro"; + auto path_d1 = table_location_ + "/metadata/input-d1.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest_a1, WriteManifest(path_a1, {file_a_})); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_c1, WriteManifest(path_c1, {file_c_})); + ICEBERG_UNWRAP_OR_FAIL(auto manifest_d1, WriteManifest(path_d1, {file_d_})); + + SetManifestMinMergeCount(2); + SetManifestTargetSizeBytes(manifest_c1.manifest_length + manifest_d1.manifest_length + + 100); + + ICEBERG_UNWRAP_OR_FAIL(auto append1, NewBranchMergeAppend()); + append1->AppendManifest(manifest_a1) + .AppendManifest(manifest_c1) + .AppendManifest(manifest_d1); + EXPECT_THAT(append1->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto first_manifests, CurrentDataManifests()); + ASSERT_EQ(first_manifests.size(), 2U); + ExpectManifestEntries(first_manifests[0], {file_a_}, {ManifestStatus::kAdded}, + {first_snapshot->snapshot_id}, {first_snapshot->sequence_number}, + {first_snapshot->sequence_number}); + ExpectManifestEntries( + first_manifests[1], {file_c_, file_d_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {first_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}); + EXPECT_EQ(first_snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "2"); + EXPECT_EQ(first_snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(first_snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); + + ICEBERG_UNWRAP_OR_FAIL( + auto manifest_a2, + WriteManifest(table_location_ + "/metadata/input-a2.avro", {file_a_})); + ICEBERG_UNWRAP_OR_FAIL( + auto manifest_c2, + WriteManifest(table_location_ + "/metadata/input-c2.avro", {file_c_})); + ICEBERG_UNWRAP_OR_FAIL( + auto manifest_d2, + WriteManifest(table_location_ + "/metadata/input-d2.avro", {file_d_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append2, NewBranchMergeAppend()); + append2->AppendManifest(manifest_a2) + .AppendManifest(manifest_c2) + .AppendManifest(manifest_d2); + EXPECT_THAT(append2->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto second_manifests, CurrentDataManifests()); + ASSERT_EQ(second_manifests.size(), 3U); + ExpectManifestEntries(second_manifests[0], {file_a_}, {ManifestStatus::kAdded}, + {second_snapshot->snapshot_id}, + {second_snapshot->sequence_number}, + {second_snapshot->sequence_number}); + ExpectManifestEntries( + second_manifests[1], {file_c_, file_d_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {second_snapshot->snapshot_id, second_snapshot->snapshot_id}, + {second_snapshot->sequence_number, second_snapshot->sequence_number}, + {second_snapshot->sequence_number, second_snapshot->sequence_number}); + ExpectManifestEntries( + second_manifests[2], {file_a_, file_c_, file_d_}, + {ManifestStatus::kExisting, ManifestStatus::kExisting, ManifestStatus::kExisting}, + {first_snapshot->snapshot_id, first_snapshot->snapshot_id, + first_snapshot->snapshot_id}, + {first_snapshot->sequence_number, first_snapshot->sequence_number, + first_snapshot->sequence_number}, + {first_snapshot->sequence_number, first_snapshot->sequence_number, + first_snapshot->sequence_number}); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "3"); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "3"); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "2"); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_P(MergeAppendTest, ManifestsMergeIntoOne) { + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto first_manifests, CurrentDataManifests()); + ASSERT_EQ(first_manifests.size(), 1U); + ExpectManifestEntries(first_manifests[0], {file_a_}, {ManifestStatus::kAdded}, + {first_snapshot->snapshot_id}, {first_snapshot->sequence_number}, + {first_snapshot->sequence_number}); + + ICEBERG_UNWRAP_OR_FAIL(auto second_append, NewBranchMergeAppend()); + second_append->AppendFile(file_b_); + EXPECT_THAT(second_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto second_manifests, CurrentDataManifests()); + ASSERT_EQ(second_manifests.size(), 2U); + ExpectManifestEntries(second_manifests[0], {file_b_}, {ManifestStatus::kAdded}, + {second_snapshot->snapshot_id}, + {second_snapshot->sequence_number}, + {second_snapshot->sequence_number}); + ExpectManifestEntries(second_manifests[1], {file_a_}, {ManifestStatus::kAdded}, + {first_snapshot->snapshot_id}, {first_snapshot->sequence_number}, + {first_snapshot->sequence_number}); + + auto path_c = table_location_ + "/metadata/input-m0.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest_c, WriteManifest(path_c, {file_c_})); + ICEBERG_UNWRAP_OR_FAIL(auto third_append, NewBranchMergeAppend()); + third_append->AppendManifest(manifest_c); + EXPECT_THAT(third_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto third_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto third_manifests, CurrentDataManifests()); + ASSERT_EQ(third_manifests.size(), 3U); + ExpectManifestEntries(third_manifests[0], {file_c_}, {ManifestStatus::kAdded}, + {third_snapshot->snapshot_id}, {third_snapshot->sequence_number}, + {third_snapshot->sequence_number}); + ExpectManifestEntries(third_manifests[1], {file_b_}, {ManifestStatus::kAdded}, + {second_snapshot->snapshot_id}, + {second_snapshot->sequence_number}, + {second_snapshot->sequence_number}); + ExpectManifestEntries(third_manifests[2], {file_a_}, {ManifestStatus::kAdded}, + {first_snapshot->snapshot_id}, {first_snapshot->sequence_number}, + {first_snapshot->sequence_number}); + + SetManifestMinMergeCount(1); + + auto path_d = table_location_ + "/metadata/input-m1.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest_d, WriteManifest(path_d, {file_d_})); + ICEBERG_UNWRAP_OR_FAIL(auto fourth_append, NewBranchMergeAppend()); + fourth_append->AppendManifest(manifest_d); + EXPECT_THAT(fourth_append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto fourth_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + ExpectManifestEntries( + data_manifests[0], {file_d_, file_c_, file_b_, file_a_}, + {ManifestStatus::kAdded, ManifestStatus::kExisting, ManifestStatus::kExisting, + ManifestStatus::kExisting}, + {fourth_snapshot->snapshot_id, third_snapshot->snapshot_id, + second_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {fourth_snapshot->sequence_number, third_snapshot->sequence_number, + second_snapshot->sequence_number, first_snapshot->sequence_number}, + {fourth_snapshot->sequence_number, third_snapshot->sequence_number, + second_snapshot->sequence_number, first_snapshot->sequence_number}); +} + +TEST_P(MergeAppendTest, ManifestDoNotMergeMinCount) { + SetManifestMinMergeCount(4); + + auto path1 = table_location_ + "/metadata/input1.avro"; + auto path2 = table_location_ + "/metadata/input2.avro"; + auto path3 = table_location_ + "/metadata/input3.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest1, WriteManifest(path1, {file_a_, file_b_})); + ICEBERG_UNWRAP_OR_FAIL(auto manifest2, WriteManifest(path2, {file_c_})); + ICEBERG_UNWRAP_OR_FAIL(auto manifest3, WriteManifest(path3, {file_d_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendManifest(manifest1).AppendManifest(manifest2).AppendManifest(manifest3); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + EXPECT_EQ(data_manifests.size(), 3U); + + if (format_version() == 1) { + EXPECT_EQ(FindManifestByPath(data_manifests, path1), nullptr); + EXPECT_EQ(FindManifestByPath(data_manifests, path2), nullptr); + EXPECT_EQ(FindManifestByPath(data_manifests, path3), nullptr); + ExpectAllEntriesAcrossManifests(data_manifests, {file_a_, file_b_, file_c_, file_d_}, + ManifestStatus::kAdded); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "4"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "3"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); + return; + } + + EXPECT_THAT(ManifestPaths(data_manifests), + ::testing::UnorderedElementsAre(path1, path2, path3)); + + auto* manifest_1 = FindManifestByPath(data_manifests, path1); + ASSERT_NE(manifest_1, nullptr); + ExpectManifestEntries(*manifest_1, {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}); + + auto* manifest_2 = FindManifestByPath(data_manifests, path2); + ASSERT_NE(manifest_2, nullptr); + ExpectManifestEntries(*manifest_2, {file_c_}, {ManifestStatus::kAdded}); + + auto* manifest_3 = FindManifestByPath(data_manifests, path3); + ASSERT_NE(manifest_3, nullptr); + ExpectManifestEntries(*manifest_3, {file_d_}, {ManifestStatus::kAdded}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "4"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "3"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_P(MergeAppendTest, MinMergeCount) { + SetManifestMinMergeCount(4); + + ICEBERG_UNWRAP_OR_FAIL(auto fast_append_a, NewBranchFastAppend()); + fast_append_a->AppendFile(file_a_); + EXPECT_THAT(fast_append_a->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto fast_append_b, NewBranchFastAppend()); + fast_append_b->AppendFile(file_b_); + EXPECT_THAT(fast_append_b->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto append_c, NewBranchMergeAppend()); + append_c->AppendFile(file_c_); + EXPECT_THAT(append_c->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot_before_merge, CurrentSnapshot()); + SnapshotCache before_cache(snapshot_before_merge.get()); + ICEBERG_UNWRAP_OR_FAIL(auto manifests_before_merge, + before_cache.DataManifests(file_io_)); + EXPECT_EQ(manifests_before_merge.size(), 3U); + + ICEBERG_UNWRAP_OR_FAIL(auto append_d, NewBranchMergeAppend()); + append_d->AppendFile(file_d_); + EXPECT_THAT(append_d->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + EXPECT_EQ(data_manifests.size(), 1U); + ExpectManifestEntries(data_manifests[0], {file_d_, file_c_, file_b_, file_a_}, + {ManifestStatus::kAdded, ManifestStatus::kExisting, + ManifestStatus::kExisting, ManifestStatus::kExisting}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "3"); +} + +TEST_P(MergeAppendTest, MergeSizeTargetWithExistingManifest) { + SetManifestTargetSizeBytes(10); + + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_).AppendFile(file_b_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto initial_manifests, CurrentDataManifests()); + ASSERT_EQ(initial_manifests.size(), 1U); + auto initial_manifest = initial_manifests[0]; + + ICEBERG_UNWRAP_OR_FAIL(auto second_append, NewBranchMergeAppend()); + second_append->AppendFile(file_c_).AppendFile(file_d_); + EXPECT_THAT(second_append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 2U); + + auto* kept_manifest = + FindManifestByPath(data_manifests, initial_manifest.manifest_path); + ASSERT_NE(kept_manifest, nullptr); + ExpectManifestEntries( + *kept_manifest, {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {first_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}); + + auto new_manifest = std::ranges::find_if( + data_manifests, [&initial_manifest](const ManifestFile& manifest) { + return manifest.manifest_path != initial_manifest.manifest_path; + }); + ASSERT_NE(new_manifest, data_manifests.end()); + ExpectManifestEntries( + *new_manifest, {file_c_, file_d_}, {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {second_snapshot->snapshot_id, second_snapshot->snapshot_id}, + {second_snapshot->sequence_number, second_snapshot->sequence_number}, + {second_snapshot->sequence_number, second_snapshot->sequence_number}); + + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsKept), "1"); + EXPECT_EQ(second_snapshot->summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); +} + +TEST_P(MergeAppendTest, ChangedPartitionSpec) { + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_).AppendFile(file_b_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto initial_manifests, CurrentDataManifests()); + ASSERT_EQ(initial_manifests.size(), 1U); + auto initial_manifest = initial_manifests[0]; + + ICEBERG_UNWRAP_OR_FAIL(auto update_spec, table_->NewUpdatePartitionSpec()); + update_spec->AddField("y"); + EXPECT_THAT(update_spec->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto new_spec, table_->spec()); + auto file_new_spec = MakeDataFile("/data/file_new_spec.parquet", new_spec, + {Literal::Long(5L), Literal::Long(6L)}); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendFile(file_new_spec); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 2U); + + auto* old_spec_manifest = + FindManifestByPath(data_manifests, initial_manifest.manifest_path); + ASSERT_NE(old_spec_manifest, nullptr); + ExpectManifestEntries( + *old_spec_manifest, {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {first_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}, + {first_snapshot->sequence_number, first_snapshot->sequence_number}); + + auto* new_spec_manifest = FindManifestForSpec(data_manifests, new_spec->spec_id()); + ASSERT_NE(new_spec_manifest, nullptr); + ExpectManifestEntries(*new_spec_manifest, {file_new_spec}, {ManifestStatus::kAdded}, + {second_snapshot->snapshot_id}, + {second_snapshot->sequence_number}, + {second_snapshot->sequence_number}); +} + +TEST_P(MergeAppendTest, ChangedPartitionSpecMergeExisting) { + ICEBERG_UNWRAP_OR_FAIL(auto append_a, NewBranchMergeAppend()); + append_a->AppendFile(file_a_); + EXPECT_THAT(append_a->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto fast_append_b, NewBranchFastAppend()); + fast_append_b->AppendFile(file_b_); + EXPECT_THAT(fast_append_b->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto unmerged_manifests, CurrentDataManifests()); + ASSERT_EQ(unmerged_manifests.size(), 2U); + auto unmerged_paths = ManifestPaths(unmerged_manifests); + + ICEBERG_UNWRAP_OR_FAIL(auto update_spec, table_->NewUpdatePartitionSpec()); + update_spec->AddField("y"); + EXPECT_THAT(update_spec->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto new_spec, table_->spec()); + auto file_new_spec = MakeDataFile("/data/file_new_spec.parquet", new_spec, + {Literal::Long(5L), Literal::Long(6L)}); + + ICEBERG_UNWRAP_OR_FAIL(auto append_new_spec, NewBranchMergeAppend()); + append_new_spec->AppendFile(file_new_spec); + EXPECT_THAT(append_new_spec->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto third_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 2U); + for (const auto& old_path : unmerged_paths) { + EXPECT_EQ(FindManifestByPath(data_manifests, old_path), nullptr); + } + + auto* new_spec_manifest = FindManifestForSpec(data_manifests, new_spec->spec_id()); + ASSERT_NE(new_spec_manifest, nullptr); + ExpectManifestEntries(*new_spec_manifest, {file_new_spec}, {ManifestStatus::kAdded}, + {third_snapshot->snapshot_id}, {third_snapshot->sequence_number}, + {third_snapshot->sequence_number}); + + auto* old_spec_manifest = FindManifestForSpec(data_manifests, spec_->spec_id()); + ASSERT_NE(old_spec_manifest, nullptr); + ExpectManifestEntries( + *old_spec_manifest, {file_b_, file_a_}, + {ManifestStatus::kExisting, ManifestStatus::kExisting}, + {second_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {second_snapshot->sequence_number, first_snapshot->sequence_number}, + {second_snapshot->sequence_number, first_snapshot->sequence_number}); +} + +TEST_P(MergeAppendTest, Failure) { + SetManifestMinMergeCount(1); + SetCommitRetryProperties(1); + + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto initial_manifests, CurrentDataManifests()); + ASSERT_EQ(initial_manifests.size(), 1U); + auto initial_manifest = initial_manifests[0]; + + int update_call_count = 0; + BindTableWithFailingCommits(/*failures=*/2, &update_call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); + append->SetTargetBranch(branch()); + append->AppendFile(file_b_); + EXPECT_THAT(append->Commit(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto pending_snapshot, SnapshotForBranch(txn->current())); + ICEBERG_UNWRAP_OR_FAIL(auto pending_manifests, DataManifests(pending_snapshot)); + ASSERT_EQ(pending_manifests.size(), 1U); + auto new_manifest = pending_manifests[0]; + EXPECT_TRUE(FileExists(new_manifest.manifest_path)); + ExpectManifestEntries(new_manifest, {file_b_, file_a_}, + {ManifestStatus::kAdded, ManifestStatus::kExisting}); + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_THAT(result, HasErrorMessage("Injected failure")); + EXPECT_EQ(update_call_count, 2); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto current_snapshot, CurrentSnapshot()); + EXPECT_EQ(current_snapshot->snapshot_id, first_snapshot->snapshot_id); + ICEBERG_UNWRAP_OR_FAIL(auto current_manifests, CurrentDataManifests()); + ASSERT_EQ(current_manifests.size(), 1U); + EXPECT_EQ(current_manifests[0].manifest_path, initial_manifest.manifest_path); + ExpectManifestEntries(current_manifests[0], {file_a_}, {ManifestStatus::kAdded}); + EXPECT_FALSE(FileExists(new_manifest.manifest_path)); +} + +TEST_P(MergeAppendTest, AppendManifestCleanup) { + SetCommitRetryProperties(1); + int update_call_count = 0; + BindTableWithFailingCommits(/*failures=*/2, &update_call_count); + const auto seq_before = table_->metadata()->last_sequence_number; + + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + EXPECT_TRUE(FileExists(manifest.manifest_path)); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); + append->SetTargetBranch(branch()); + append->AppendManifest(manifest); + EXPECT_THAT(append->Commit(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto pending_snapshot, SnapshotForBranch(txn->current())); + ICEBERG_UNWRAP_OR_FAIL(auto pending_manifests, DataManifests(pending_snapshot)); + ASSERT_EQ(pending_manifests.size(), 1U); + auto new_manifest = pending_manifests[0]; + EXPECT_TRUE(FileExists(new_manifest.manifest_path)); + if (format_version() == 1) { + EXPECT_NE(new_manifest.manifest_path, manifest.manifest_path); + } else { + EXPECT_EQ(new_manifest.manifest_path, manifest.manifest_path); + } + + auto result = txn->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_THAT(result, HasErrorMessage("Injected failure")); + EXPECT_EQ(update_call_count, 2); + + EXPECT_THAT(table_->Refresh(), IsOk()); + EXPECT_THAT(CurrentSnapshot(), IsError(ErrorKind::kNotFound)); + EXPECT_EQ(table_->metadata()->last_sequence_number, seq_before); + if (format_version() == 1) { + EXPECT_FALSE(FileExists(new_manifest.manifest_path)); + EXPECT_TRUE(FileExists(manifest.manifest_path)); + } else { + EXPECT_TRUE(FileExists(new_manifest.manifest_path)); + } +} + +TEST_P(MergeAppendTest, Recovery) { + SetManifestMinMergeCount(1); + SetCommitRetryProperties(3); + + ICEBERG_UNWRAP_OR_FAIL(auto first_append, NewBranchMergeAppend()); + first_append->AppendFile(file_a_); + EXPECT_THAT(first_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto initial_manifests, CurrentDataManifests()); + ASSERT_EQ(initial_manifests.size(), 1U); + auto initial_manifest = initial_manifests[0]; + + int update_call_count = 0; + BindTableWithFailingCommits(/*failures=*/3, &update_call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); + append->SetTargetBranch(branch()); + append->AppendFile(file_b_); + EXPECT_THAT(append->Commit(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto pending_snapshot, SnapshotForBranch(txn->current())); + ICEBERG_UNWRAP_OR_FAIL(auto pending_manifests, DataManifests(pending_snapshot)); + ASSERT_EQ(pending_manifests.size(), 1U); + auto pending_manifest = pending_manifests[0]; + EXPECT_TRUE(FileExists(pending_manifest.manifest_path)); + ExpectManifestEntries(pending_manifest, {file_b_, file_a_}, + {ManifestStatus::kAdded, ManifestStatus::kExisting}); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot_before_commit, CurrentSnapshot()); + EXPECT_EQ(snapshot_before_commit->snapshot_id, first_snapshot->snapshot_id); + EXPECT_EQ(table_->metadata()->last_sequence_number, first_snapshot->sequence_number); + + EXPECT_THAT(txn->Commit(), IsOk()); + EXPECT_EQ(update_call_count, 4); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + EXPECT_EQ(data_manifests[0].manifest_path, pending_manifest.manifest_path); + EXPECT_TRUE(FileExists(pending_manifest.manifest_path)); + ExpectManifestEntries( + data_manifests[0], {file_b_, file_a_}, + {ManifestStatus::kAdded, ManifestStatus::kExisting}, + {second_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {second_snapshot->sequence_number, first_snapshot->sequence_number}, + {second_snapshot->sequence_number, first_snapshot->sequence_number}); + EXPECT_NE(data_manifests[0].manifest_path, initial_manifest.manifest_path); +} + +TEST_P(MergeAppendTest, AppendManifestWithSnapshotIdInheritance) { + SetSnapshotIdInheritanceEnabled(); + + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendManifest(manifest); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + EXPECT_EQ(data_manifests[0].manifest_path, manifest.manifest_path); + ExpectManifestEntries(data_manifests[0], {file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded}, + {snapshot->snapshot_id, snapshot->snapshot_id}, + {snapshot->sequence_number, snapshot->sequence_number}, + {snapshot->sequence_number, snapshot->sequence_number}); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "200"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalRecords), "200"); +} + +TEST_P(MergeAppendTest, MergedAppendManifestCleanupWithSnapshotIdInheritance) { + SetSnapshotIdInheritanceEnabled(); + SetManifestMinMergeCount(1); + + auto path1 = table_location_ + "/metadata/manifest-file-1.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest1, WriteManifest(path1, {file_a_, file_b_})); + ICEBERG_UNWRAP_OR_FAIL(auto append1, NewBranchMergeAppend()); + append1->AppendManifest(manifest1); + EXPECT_THAT(append1->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, CurrentSnapshot()); + EXPECT_TRUE(FileExists(manifest1.manifest_path)); + + auto path2 = table_location_ + "/metadata/manifest-file-2.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest2, WriteManifest(path2, {file_c_, file_d_})); + ICEBERG_UNWRAP_OR_FAIL(auto append2, NewBranchMergeAppend()); + append2->AppendManifest(manifest2); + EXPECT_THAT(append2->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto second_snapshot, CurrentSnapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, CurrentDataManifests()); + ASSERT_EQ(data_manifests.size(), 1U); + ExpectManifestEntries( + data_manifests[0], {file_c_, file_d_, file_a_, file_b_}, + {ManifestStatus::kAdded, ManifestStatus::kAdded, ManifestStatus::kExisting, + ManifestStatus::kExisting}, + {second_snapshot->snapshot_id, second_snapshot->snapshot_id, + first_snapshot->snapshot_id, first_snapshot->snapshot_id}, + {second_snapshot->sequence_number, second_snapshot->sequence_number, + first_snapshot->sequence_number, first_snapshot->sequence_number}, + {second_snapshot->sequence_number, second_snapshot->sequence_number, + first_snapshot->sequence_number, first_snapshot->sequence_number}); + EXPECT_FALSE(FileExists(manifest2.manifest_path)); +} + +TEST_P(MergeAppendTest, AppendManifestFailureWithSnapshotIdInheritance) { + SetSnapshotIdInheritanceEnabled(); + SetCommitRetryProperties(1); + BindTableWithFailingCommits(/*failures=*/2); + const auto seq_before = table_->metadata()->last_sequence_number; + + auto path = table_location_ + "/metadata/input.avro"; + ICEBERG_UNWRAP_OR_FAIL(auto manifest, WriteManifest(path, {file_a_, file_b_})); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchMergeAppend()); + append->AppendManifest(manifest); + auto result = append->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_THAT(result, HasErrorMessage("Injected failure")); + + EXPECT_THAT(table_->Refresh(), IsOk()); + EXPECT_THAT(CurrentSnapshot(), IsError(ErrorKind::kNotFound)); + EXPECT_EQ(table_->metadata()->last_sequence_number, seq_before); + EXPECT_TRUE(FileExists(manifest.manifest_path)); +} + +TEST_P(MergeAppendTest, TransactionNewMergeAppendCommits) { + ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); + append->SetTargetBranch(branch()); + append->AppendFile(file_a_); + EXPECT_THAT(append->Commit(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto committed_table, txn->Commit()); + + const auto& refs = committed_table->metadata()->refs; + auto ref_it = refs.find(branch()); + ASSERT_NE(ref_it, refs.end()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, + committed_table->SnapshotById(ref_it->second->snapshot_id)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); +} + +TEST_P(MergeAppendTest, InvalidAppendManifestWithExistingEntry) { + ManifestEntry entry; + entry.status = ManifestStatus::kExisting; + entry.snapshot_id = 12345; + entry.sequence_number = 1; + entry.file_sequence_number = 1; + entry.data_file = file_a_; + + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteManifestEntries(table_location_ + "/metadata/existing.avro", {entry})); + ExpectAppendManifestError(manifest, "Cannot append manifest with existing files"); +} + +TEST_P(MergeAppendTest, InvalidAppendManifestWithDeletedEntry) { + ManifestEntry entry; + entry.status = ManifestStatus::kDeleted; + entry.snapshot_id = 12345; + entry.sequence_number = 1; + entry.file_sequence_number = 1; + entry.data_file = file_a_; + + ICEBERG_UNWRAP_OR_FAIL( + auto manifest, + WriteManifestEntries(table_location_ + "/metadata/deleted.avro", {entry})); + ExpectAppendManifestError(manifest, "Cannot append manifest with deleted files"); +} + +TEST_F(MergeAppendTestBase, InvalidAppendManifestWithExistingFilesSummary) { + auto manifest = MakeEmptyAppendManifest(table_location_ + "/metadata/existing.avro"); + manifest.existing_files_count = 1; + + ExpectAppendManifestError(manifest, "Cannot append manifest with existing files"); +} + +TEST_F(MergeAppendTestBase, InvalidAppendManifestWithDeletedFilesSummary) { + auto manifest = MakeEmptyAppendManifest(table_location_ + "/metadata/deleted.avro"); + manifest.deleted_files_count = 1; + + ExpectAppendManifestError(manifest, "Cannot append manifest with deleted files"); +} + +TEST_F(MergeAppendTestBase, InvalidAppendManifestWithAssignedSnapshotId) { + auto manifest = + MakeEmptyAppendManifest(table_location_ + "/metadata/assigned-snapshot.avro"); + manifest.added_snapshot_id = 12345; + + ExpectAppendManifestError(manifest, "Snapshot id must be assigned during commit"); +} + +TEST_F(MergeAppendTestBase, InvalidAppendManifestWithAssignedSequenceNumber) { + auto manifest = + MakeEmptyAppendManifest(table_location_ + "/metadata/assigned-sequence.avro"); + manifest.sequence_number = 7; + + ExpectAppendManifestError(manifest, "Sequence number must be assigned during commit"); +} + +TEST_P(MergeAppendTest, DefaultPartitionSummaries) { + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchFastAppend()); + append->AppendFile(file_a_); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + const auto& summary = snapshot->summary; + size_t partition_summary_count = 0; + for (const auto& [key, value] : summary) { + std::ignore = value; + if (key.starts_with(SnapshotSummaryFields::kChangedPartitionPrefix)) { + ++partition_summary_count; + } + } + EXPECT_EQ(partition_summary_count, 0U); + EXPECT_FALSE(summary.contains(SnapshotSummaryFields::kPartitionSummaryProp)); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kChangedPartitionCountProp), "1"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_P(MergeAppendTest, IncludedPartitionSummaries) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kWritePartitionSummaryLimit.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchFastAppend()); + append->AppendFile(file_a_); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + const auto& summary = snapshot->summary; + size_t partition_summary_count = 0; + for (const auto& [key, value] : summary) { + std::ignore = value; + if (key.starts_with(SnapshotSummaryFields::kChangedPartitionPrefix)) { + ++partition_summary_count; + } + } + EXPECT_EQ(partition_summary_count, 1U); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kPartitionSummaryProp), "true"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kChangedPartitionCountProp), "1"); + ASSERT_TRUE(summary.contains(SnapshotSummaryFields::kChangedPartitionPrefix + "x=1")); + const auto& partition_summary = + summary.at(SnapshotSummaryFields::kChangedPartitionPrefix + "x=1"); + EXPECT_THAT(partition_summary, + ::testing::HasSubstr(SnapshotSummaryFields::kAddedDataFiles + "=1")); + EXPECT_THAT(partition_summary, + ::testing::HasSubstr(SnapshotSummaryFields::kAddedRecords + "=100")); + EXPECT_THAT(partition_summary, + ::testing::HasSubstr(SnapshotSummaryFields::kAddedFileSize + "=1024")); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +TEST_P(MergeAppendTest, IncludedPartitionSummaryLimit) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kWritePartitionSummaryLimit.key()), "1"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto append, NewBranchFastAppend()); + append->AppendFile(file_a_).AppendFile(file_b_); + EXPECT_THAT(append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, CurrentSnapshot()); + const auto& summary = snapshot->summary; + size_t partition_summary_count = 0; + for (const auto& [key, value] : summary) { + std::ignore = value; + if (key.starts_with(SnapshotSummaryFields::kChangedPartitionPrefix)) { + ++partition_summary_count; + } + } + EXPECT_EQ(partition_summary_count, 0U); + EXPECT_FALSE(summary.contains(SnapshotSummaryFields::kPartitionSummaryProp)); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kChangedPartitionCountProp), "2"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsCreated), "1"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsReplaced), "0"); + EXPECT_EQ(summary.at(SnapshotSummaryFields::kManifestsKept), "0"); +} + +INSTANTIATE_TEST_SUITE_P( + MergeAppendVersions, MergeAppendTest, + ::testing::Combine(::testing::Values(1, 2, 3), + ::testing::Values(std::string(SnapshotRef::kMainBranch), + std::string("testBranch"))), + [](const ::testing::TestParamInfo>& info) { + const auto& branch = std::get<1>(info.param); + return "V" + std::to_string(std::get<0>(info.param)) + "_" + + (branch == SnapshotRef::kMainBranch ? std::string("main") : branch); + }); + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index 9cfe9063e..881c4fdd0 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -160,6 +160,7 @@ TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) { EXPECT_THAT(table->NewUpdateStatistics(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewUpdatePartitionStatistics(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewFastAppend(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewMergeAppend(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported)); } diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index 00ac0e790..673f43769 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -34,6 +34,7 @@ #include "iceberg/table_update.h" #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" +#include "iceberg/update/merge_append.h" #include "iceberg/update/pending_update.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" @@ -489,6 +490,13 @@ Result> Transaction::NewFastAppend() { return fast_append; } +Result> Transaction::NewMergeAppend() { + ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr merge_append, + MergeAppend::Make(ctx_->table->name().name, ctx_)); + ICEBERG_RETURN_UNEXPECTED(AddUpdate(merge_append)); + return merge_append; +} + Result> Transaction::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_statistics, UpdateStatistics::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index 60fe935f3..0cc4cb9ac 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -106,6 +106,9 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> NewFastAppend(); + /// \brief Create a new MergeAppend to append data files and merge manifests. + Result> NewMergeAppend(); + /// \brief Create a new SnapshotManager to manage snapshots. Result> NewSnapshotManager(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index bb4da67e5..c82da5132 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -225,6 +225,7 @@ class TransactionContext; /// \brief Update family. class ExpireSnapshots; class FastAppend; +class MergeAppend; class PendingUpdate; class SetSnapshot; class SnapshotManager; diff --git a/src/iceberg/update/merge_append.cc b/src/iceberg/update/merge_append.cc new file mode 100644 index 000000000..70cd7b8e7 --- /dev/null +++ b/src/iceberg/update/merge_append.cc @@ -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. + */ + +#include "iceberg/update/merge_append.h" + +#include "iceberg/constants.h" +#include "iceberg/manifest/manifest_list.h" +#include "iceberg/snapshot.h" +#include "iceberg/table_metadata.h" +#include "iceberg/transaction.h" +#include "iceberg/util/error_collector.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +Result> MergeAppend::Make( + std::string table_name, std::shared_ptr ctx) { + ICEBERG_PRECHECK(!table_name.empty(), "Table name cannot be empty"); + ICEBERG_PRECHECK(ctx != nullptr, "Cannot create MergeAppend without a context"); + return std::unique_ptr( + new MergeAppend(std::move(table_name), std::move(ctx))); +} + +MergeAppend::MergeAppend(std::string table_name, std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) {} + +MergeAppend& MergeAppend::AppendFile(const std::shared_ptr& file) { + ICEBERG_BUILDER_RETURN_IF_ERROR(AddDataFile(file)); + return *this; +} + +MergeAppend& MergeAppend::AppendManifest(const ManifestFile& manifest) { + ICEBERG_BUILDER_CHECK(!manifest.has_existing_files(), + "Cannot append manifest with existing files"); + ICEBERG_BUILDER_CHECK(!manifest.has_deleted_files(), + "Cannot append manifest with deleted files"); + ICEBERG_BUILDER_CHECK(manifest.added_snapshot_id == kInvalidSnapshotId, + "Snapshot id must be assigned during commit"); + ICEBERG_BUILDER_CHECK(manifest.sequence_number == kInvalidSequenceNumber, + "Sequence number must be assigned during commit"); + + ICEBERG_BUILDER_RETURN_IF_ERROR(AddManifest(manifest)); + return *this; +} + +std::string MergeAppend::operation() { return DataOperation::kAppend; } + +} // namespace iceberg diff --git a/src/iceberg/update/merge_append.h b/src/iceberg/update/merge_append.h new file mode 100644 index 000000000..8122a262c --- /dev/null +++ b/src/iceberg/update/merge_append.h @@ -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. + */ + +#pragma once + +/// \file iceberg/update/merge_append.h + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/merging_snapshot_update.h" + +namespace iceberg { + +/// \brief Append files while merging manifests when table properties allow it. +/// +/// MergeAppend uses the shared MergingSnapshotUpdate pipeline, so it can compact +/// newly written and existing manifests into fewer manifests during commit. +class ICEBERG_EXPORT MergeAppend : public MergingSnapshotUpdate { + public: + /// \brief Create a new MergeAppend instance. + /// + /// \param table_name The name of the table + /// \param ctx The transaction context to use for this update + /// \return A Result containing the MergeAppend instance or an error + static Result> Make( + std::string table_name, std::shared_ptr ctx); + + /// \brief Append a data file to this update. + /// + /// \param file The data file to append + /// \return Reference to this for method chaining + MergeAppend& AppendFile(const std::shared_ptr& file); + + /// \brief Append a data manifest to this update. + /// + /// The manifest must contain only added files. Snapshot ID and sequence number + /// assignment happen during commit. + /// + /// \param manifest The manifest file to append + /// \return Reference to this for method chaining + MergeAppend& AppendManifest(const ManifestFile& manifest); + + std::string operation() override; + + private: + explicit MergeAppend(std::string table_name, std::shared_ptr ctx); +}; + +} // namespace iceberg diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 6405f603f..031c79452 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -19,6 +19,7 @@ install_headers( [ 'expire_snapshots.h', 'fast_append.h', + 'merge_append.h', 'merging_snapshot_update.h', 'pending_update.h', 'set_snapshot.h', From e9a68b7e6b1407785b37fbf90a78044be9bc4166 Mon Sep 17 00:00:00 2001 From: lishuxu Date: Sat, 20 Jun 2026 20:10:47 +0800 Subject: [PATCH 105/151] fix(rest): avoid default catalog reference cycle (#764) Store the cached default catalog view as a weak_ptr so AsCatalog() can reuse a live view without keeping it alive from the RestCatalog root. --- src/iceberg/catalog/rest/rest_catalog.cc | 10 +++++--- src/iceberg/catalog/rest/rest_catalog.h | 2 +- .../test/rest_catalog_integration_test.cc | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 455c4d744..7c79b94d1 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -487,11 +487,13 @@ RestCatalog::RestCatalog(RestCatalogProperties config, std::shared_ptr f std::string_view RestCatalog::name() const { return name_; } Result> RestCatalog::AsCatalog() { - if (!default_catalog_) { - default_catalog_ = - std::make_shared(shared_from_this(), default_context_); + if (auto catalog = default_catalog_.lock()) { + return catalog; } - return default_catalog_; + + auto catalog = std::make_shared(shared_from_this(), default_context_); + default_catalog_ = catalog; + return catalog; } Result> RestCatalog::WithContext(SessionContext context) { diff --git a/src/iceberg/catalog/rest/rest_catalog.h b/src/iceberg/catalog/rest/rest_catalog.h index e693ceba3..76d2e54dc 100644 --- a/src/iceberg/catalog/rest/rest_catalog.h +++ b/src/iceberg/catalog/rest/rest_catalog.h @@ -181,7 +181,7 @@ class ICEBERG_REST_EXPORT RestCatalog final std::shared_ptr catalog_session_; SnapshotMode snapshot_mode_; SessionContext default_context_; - std::shared_ptr default_catalog_; + std::weak_ptr default_catalog_; }; } // namespace iceberg::rest diff --git a/src/iceberg/test/rest_catalog_integration_test.cc b/src/iceberg/test/rest_catalog_integration_test.cc index 104602c46..dcb292931 100644 --- a/src/iceberg/test/rest_catalog_integration_test.cc +++ b/src/iceberg/test/rest_catalog_integration_test.cc @@ -203,6 +203,31 @@ TEST_F(RestCatalogIntegrationTest, MakeCatalogSuccess) { EXPECT_THAT(root->WithContext(SessionContext{}), IsError(ErrorKind::kInvalidArgument)); } +TEST_F(RestCatalogIntegrationTest, DefaultCatalogCacheDoesNotKeepRootAlive) { + std::weak_ptr weak_root; + std::weak_ptr weak_catalog; + + { + auto config = RestCatalogProperties::default_properties(); + config.Set(RestCatalogProperties::kUri, CatalogUri()) + .Set(RestCatalogProperties::kName, std::string(kCatalogName)) + .Set(RestCatalogProperties::kWarehouse, std::string(kWarehouseName)); + config.mutable_configs()[std::string(RestCatalogProperties::kIOImpl.key())] = + std::string(kStdFileIOImpl); + + ICEBERG_UNWRAP_OR_FAIL(auto root, RestCatalog::Make(config)); + ICEBERG_UNWRAP_OR_FAIL(auto catalog, root->AsCatalog()); + ICEBERG_UNWRAP_OR_FAIL(auto same_catalog, root->AsCatalog()); + + weak_root = root; + weak_catalog = catalog; + EXPECT_EQ(catalog, same_catalog); + } + + EXPECT_TRUE(weak_catalog.expired()); + EXPECT_TRUE(weak_root.expired()); +} + TEST_F(RestCatalogIntegrationTest, FetchServerConfigDirect) { HttpClient client({}); auto noop_session = auth::AuthSession::MakeDefault({}); From 6f503f9af75978a34b13dfab121a9cbdc9268b6a Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Sun, 21 Jun 2026 23:49:29 +0800 Subject: [PATCH 106/151] feat: add DeleteFiles update API (#709) ## Summary - Add a DeleteFiles snapshot update API and wire it through table and transaction update flows. - Add DeleteFiles implementation/build integration. - Add coverage for path matching, case-insensitive row filters, empty delete commits, and strict-projection partial-match rejection. ## Validation - `cmake --build build --target table_update_test` - `./build/src/iceberg/test/table_update_test '--gtest_filter=DeleteFilesTest.*'` Co-authored-by: Codex --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/table.cc | 7 + src/iceberg/table.h | 3 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/delete_files_test.cc | 203 ++++++++++++++++++++++++++ src/iceberg/transaction.cc | 8 + src/iceberg/transaction.h | 3 + src/iceberg/type_fwd.h | 1 + src/iceberg/update/delete_files.cc | 79 ++++++++++ src/iceberg/update/delete_files.h | 72 +++++++++ src/iceberg/update/meson.build | 1 + 12 files changed, 380 insertions(+) create mode 100644 src/iceberg/test/delete_files_test.cc create mode 100644 src/iceberg/update/delete_files.cc create mode 100644 src/iceberg/update/delete_files.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index d4224cd65..b3cc8a7a9 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -99,6 +99,7 @@ set(ICEBERG_SOURCES transform.cc transform_function.cc type.cc + update/delete_files.cc update/expire_snapshots.cc update/fast_append.cc update/merge_append.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 508d5e0bf..0c467605b 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -124,6 +124,7 @@ iceberg_sources = files( 'transform.cc', 'transform_function.cc', 'type.cc', + 'update/delete_files.cc', 'update/expire_snapshots.cc', 'update/fast_append.cc', 'update/merge_append.cc', diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index 9e8a35bd4..817e5917c 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -31,6 +31,7 @@ #include "iceberg/table_properties.h" #include "iceberg/table_scan.h" #include "iceberg/transaction.h" +#include "iceberg/update/delete_files.h" #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" @@ -224,6 +225,12 @@ Result> Table::NewMergeAppend() { return MergeAppend::Make(name().name, std::move(ctx)); } +Result> Table::NewDeleteFiles() { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); + return DeleteFiles::Make(name().name, std::move(ctx)); +} + Result> Table::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE( auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); diff --git a/src/iceberg/table.h b/src/iceberg/table.h index 45f4bd961..b71a1ddbc 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -179,6 +179,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Create a new MergeAppend to append data files and merge manifests. virtual Result> NewMergeAppend(); + /// \brief Create a new DeleteFiles to delete data files and commit the changes. + virtual Result> NewDeleteFiles(); + /// \brief Create a new SnapshotManager to manage snapshots and snapshot references. virtual Result> NewSnapshotManager(); diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 0e738924f..1d8ea472b 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -222,6 +222,7 @@ if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(table_update_test USE_BUNDLE SOURCES + delete_files_test.cc expire_snapshots_test.cc fast_append_test.cc manifest_filter_manager_test.cc diff --git a/src/iceberg/test/delete_files_test.cc b/src/iceberg/test/delete_files_test.cc new file mode 100644 index 000000000..7c547ac49 --- /dev/null +++ b/src/iceberg/test/delete_files_test.cc @@ -0,0 +1,203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/delete_files.h" + +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/expression/literal.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/update/fast_append.h" + +namespace iceberg { + +class DeleteFilesTest : public MinimalUpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + MinimalUpdateTestBase::SetUp(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + auto file = std::make_shared(); + file->content = DataFile::Content::kData; + file->file_path = table_location_ + path; + file->file_format = FileFormatType::kParquet; + file->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + file->file_size_in_bytes = 1024; + file->record_count = 100; + file->partition_spec_id = spec_->spec_id(); + return file; + } + + void SetLongBounds(const std::shared_ptr& file, int32_t field_id, + int64_t lower, int64_t upper) { + ASSERT_NE(file, nullptr); + ICEBERG_UNWRAP_OR_FAIL(auto lower_bound, Literal::Long(lower).Serialize()); + ICEBERG_UNWRAP_OR_FAIL(auto upper_bound, Literal::Long(upper).Serialize()); + file->value_counts[field_id] = file->record_count; + file->null_value_counts[field_id] = 0; + file->lower_bounds[field_id] = lower_bound; + file->upper_bounds[field_id] = upper_bound; + } + + void CommitFiles(const std::vector>& files) { + ICEBERG_UNWRAP_OR_FAIL(auto append, table_->NewFastAppend()); + for (const auto& file : files) { + append->AppendFile(file); + } + ASSERT_THAT(append->Commit(), IsOk()); + ASSERT_THAT(table_->Refresh(), IsOk()); + } + + void CommitInitialFiles() { CommitFiles({file_a_, file_b_}); } + + void ExpectOneFileDeleted() { + ASSERT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kDelete); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedRecords), "100"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedFileSize), "1024"); + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; + + static constexpr int32_t kYFieldId = 2; +}; + +TEST_F(DeleteFilesTest, DeleteFileByPath) { + CommitInitialFiles(); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFile(file_a_->file_path); + + EXPECT_THAT(delete_files->Commit(), IsOk()); + ExpectOneFileDeleted(); +} + +TEST_F(DeleteFilesTest, DeleteFileByDataFile) { + CommitInitialFiles(); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFile(file_a_); + + EXPECT_THAT(delete_files->Commit(), IsOk()); + ExpectOneFileDeleted(); +} + +TEST_F(DeleteFilesTest, DeleteFromRowFilterCaseInsensitive) { + CommitInitialFiles(); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->CaseSensitive(false).DeleteFromRowFilter( + Expressions::Equal("X", Literal::Long(1L))); + + EXPECT_THAT(delete_files->Commit(), IsOk()); + ExpectOneFileDeleted(); +} + +TEST_F(DeleteFilesTest, EmptyDeleteCommit) { + CommitInitialFiles(); + ICEBERG_UNWRAP_OR_FAIL(auto previous_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + + EXPECT_THAT(delete_files->Commit(), IsOk()); + + ASSERT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + ASSERT_TRUE(snapshot->parent_snapshot_id.has_value()); + EXPECT_EQ(snapshot->parent_snapshot_id.value(), previous_snapshot->snapshot_id); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kDelete); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kDeletedDataFiles), 0U); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kDeletedRecords), 0U); + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kRemovedFileSize), 0U); +} + +TEST_F(DeleteFilesTest, DeleteFromRowFilter) { + CommitInitialFiles(); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFromRowFilter(Expressions::Equal("x", Literal::Long(1L))); + + EXPECT_THAT(delete_files->Commit(), IsOk()); + ExpectOneFileDeleted(); +} + +TEST_F(DeleteFilesTest, DeleteFromRowFilterRejectsPartialMatchFile) { + auto partial_match_file = MakeDataFile("/data/partial_match.parquet", + /*partition_x=*/1L); + SetLongBounds(partial_match_file, kYFieldId, /*lower=*/0L, /*upper=*/10L); + CommitFiles({partial_match_file}); + ICEBERG_UNWRAP_OR_FAIL(auto previous_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFromRowFilter(Expressions::Equal("y", Literal::Long(5L))); + + auto status = delete_files->Commit(); + EXPECT_THAT(status, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(status, + HasErrorMessage("Cannot delete file where some, but not all, rows match " + "filter")); + EXPECT_THAT(status, HasErrorMessage(partial_match_file->file_path)); + + ASSERT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->snapshot_id, previous_snapshot->snapshot_id); +} + +TEST_F(DeleteFilesTest, ValidateFilesExistRejectsMissingPath) { + CommitInitialFiles(); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFile(table_location_ + "/data/missing.parquet") + .ValidateFilesExist(); + + auto status = delete_files->Commit(); + EXPECT_THAT(status, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(status, HasErrorMessage("Missing required files to delete")); +} + +} // namespace iceberg diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index 673f43769..ac1f08241 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -32,6 +32,7 @@ #include "iceberg/table_requirement.h" #include "iceberg/table_requirements.h" #include "iceberg/table_update.h" +#include "iceberg/update/delete_files.h" #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" @@ -497,6 +498,13 @@ Result> Transaction::NewMergeAppend() { return merge_append; } +Result> Transaction::NewDeleteFiles() { + ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr delete_files, + DeleteFiles::Make(ctx_->table->name().name, ctx_)); + ICEBERG_RETURN_UNEXPECTED(AddUpdate(delete_files)); + return delete_files; +} + Result> Transaction::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_statistics, UpdateStatistics::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index 0cc4cb9ac..52a0605c6 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -109,6 +109,9 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> NewMergeAppend(); + /// \brief Create a new DeleteFiles to delete data files and commit the changes. + Result> NewDeleteFiles(); + /// \brief Create a new SnapshotManager to manage snapshots. Result> NewSnapshotManager(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index c82da5132..6c34d3a8d 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -223,6 +223,7 @@ class Transaction; class TransactionContext; /// \brief Update family. +class DeleteFiles; class ExpireSnapshots; class FastAppend; class MergeAppend; diff --git a/src/iceberg/update/delete_files.cc b/src/iceberg/update/delete_files.cc new file mode 100644 index 000000000..9759e3eb9 --- /dev/null +++ b/src/iceberg/update/delete_files.cc @@ -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. + */ + +#include "iceberg/update/delete_files.h" + +#include +#include +#include + +#include "iceberg/snapshot.h" +#include "iceberg/transaction.h" +#include "iceberg/util/error_collector.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +Result> DeleteFiles::Make( + std::string table_name, std::shared_ptr ctx) { + ICEBERG_PRECHECK(!table_name.empty(), "Table name cannot be empty"); + ICEBERG_PRECHECK(ctx != nullptr, "Cannot create DeleteFiles without a context"); + return std::unique_ptr( + new DeleteFiles(std::move(table_name), std::move(ctx))); +} + +DeleteFiles::DeleteFiles(std::string table_name, std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) {} + +DeleteFiles& DeleteFiles::DeleteFile(std::string_view path) { + ICEBERG_BUILDER_CHECK(!path.empty(), "Cannot delete an empty file path"); + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteByPath(path)); + return *this; +} + +DeleteFiles& DeleteFiles::DeleteFile(const std::shared_ptr& file) { + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDataFile(file)); + return *this; +} + +DeleteFiles& DeleteFiles::DeleteFromRowFilter(std::shared_ptr expr) { + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteByRowFilter(std::move(expr))); + return *this; +} + +DeleteFiles& DeleteFiles::CaseSensitive(bool case_sensitive) { + MergingSnapshotUpdate::CaseSensitive(case_sensitive); + return *this; +} + +DeleteFiles& DeleteFiles::ValidateFilesExist() { + validate_files_to_delete_exist_ = true; + return *this; +} + +std::string DeleteFiles::operation() { return DataOperation::kDelete; } + +Status DeleteFiles::Validate(const TableMetadata&, const std::shared_ptr&) { + if (validate_files_to_delete_exist_) { + FailMissingDeletePaths(); + } + return {}; +} + +} // namespace iceberg diff --git a/src/iceberg/update/delete_files.h b/src/iceberg/update/delete_files.h new file mode 100644 index 000000000..1be08e35b --- /dev/null +++ b/src/iceberg/update/delete_files.h @@ -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. + */ + +#pragma once + +/// \file iceberg/update/delete_files.h + +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/merging_snapshot_update.h" + +namespace iceberg { + +/// \brief API for deleting data files from a table. +/// +/// This accumulates data-file deletions, produces a new snapshot, and commits that +/// snapshot as current. File paths are matched exactly against table metadata values; +/// equivalent but differently-normalized URIs are not considered matches. +class ICEBERG_EXPORT DeleteFiles : public MergingSnapshotUpdate { + public: + static Result> Make( + std::string table_name, std::shared_ptr ctx); + + /// \brief Delete a data-file path from the table. + DeleteFiles& DeleteFile(std::string_view path); + + /// \brief Delete a data file tracked by object identity and path. + DeleteFiles& DeleteFile(const std::shared_ptr& file); + + /// \brief Delete files whose rows all match the given expression. + DeleteFiles& DeleteFromRowFilter(std::shared_ptr expr); + + /// \brief Set case sensitivity for expression binding. + DeleteFiles& CaseSensitive(bool case_sensitive); + + /// \brief Validate that explicitly requested deleted files still exist. + DeleteFiles& ValidateFilesExist(); + + std::string operation() override; + + protected: + Status Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) override; + + private: + DeleteFiles(std::string table_name, std::shared_ptr ctx); + + bool validate_files_to_delete_exist_ = false; +}; + +} // namespace iceberg diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 031c79452..9f950e8d0 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -17,6 +17,7 @@ install_headers( [ + 'delete_files.h', 'expire_snapshots.h', 'fast_append.h', 'merge_append.h', From 82b0adb1ab8989f8e5df47cb58419a28727ca2a7 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Mon, 22 Jun 2026 16:08:12 +0800 Subject: [PATCH 107/151] chore: make pre-commit and ci clang-format version consistent (#769) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 522923a47..cd468a464 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: ^src/iceberg/catalog/hive/gen-cpp/ - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.8 + rev: v22.1.5 hooks: - id: clang-format exclude_types: [json] From 28163ce3ff26963b0310dff6dbcf2f6c14f94748 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Mon, 22 Jun 2026 16:42:41 +0800 Subject: [PATCH 108/151] feat: parallelize reading manifests (#697) --- src/iceberg/manifest/manifest_group.cc | 119 +++++++----- src/iceberg/manifest/manifest_group.h | 11 ++ src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/executor_util_test.cc | 189 ++++++++++++++++++ src/iceberg/test/manifest_group_test.cc | 5 + src/iceberg/test/meson.build | 1 + src/iceberg/util/executor_util_internal.h | 221 ++++++++++++++++++++++ 7 files changed, 499 insertions(+), 48 deletions(-) create mode 100644 src/iceberg/test/executor_util_test.cc create mode 100644 src/iceberg/util/executor_util_internal.h diff --git a/src/iceberg/manifest/manifest_group.cc b/src/iceberg/manifest/manifest_group.cc index 61bb57da2..932f3bf3d 100644 --- a/src/iceberg/manifest/manifest_group.cc +++ b/src/iceberg/manifest/manifest_group.cc @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include #include @@ -41,6 +43,7 @@ #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/content_file_util.h" +#include "iceberg/util/executor_util_internal.h" #include "iceberg/util/macros.h" namespace iceberg { @@ -189,6 +192,11 @@ ManifestGroup& ManifestGroup::ColumnsToKeepStats(std::unordered_set col return *this; } +ManifestGroup& ManifestGroup::PlanWith(OptionalExecutor executor) { + executor_ = executor; + return *this; +} + Result>> ManifestGroup::PlanFiles() { auto create_file_scan_tasks = [this](std::vector&& entries, @@ -343,10 +351,23 @@ Result> ManifestGroup::MakeReader( Result>> ManifestGroup::ReadEntries() { + // TODO(zehua): Replace with a thread-safe LRU cache. + std::shared_mutex eval_cache_mutex; std::unordered_map> eval_cache; + auto get_manifest_evaluator = [&](int32_t spec_id) -> Result { - if (eval_cache.contains(spec_id)) { - return eval_cache[spec_id].get(); + { + std::shared_lock lock(eval_cache_mutex); + auto iter = eval_cache.find(spec_id); + if (iter != eval_cache.end()) { + return iter->second.get(); + } + } + + std::lock_guard lock(eval_cache_mutex); + auto iter = eval_cache.find(spec_id); + if (iter != eval_cache.end()) { + return iter->second.get(); } auto spec_iter = specs_by_id_.find(spec_id); @@ -376,61 +397,63 @@ ManifestGroup::ReadEntries() { Evaluator::Make(*DataFileFilterSchema(), file_filter_, case_sensitive_)); } - std::unordered_map> result; + return ParallelCollect( + executor_, data_manifests_, + [&](const ManifestFile& manifest) + -> Result>> { + const int32_t spec_id = manifest.partition_spec_id; - // TODO(gangwu): Parallelize reading manifests - for (const auto& manifest : data_manifests_) { - const int32_t spec_id = manifest.partition_spec_id; - - ICEBERG_ASSIGN_OR_RAISE(auto manifest_evaluator, get_manifest_evaluator(spec_id)); - ICEBERG_ASSIGN_OR_RAISE(bool should_match, manifest_evaluator->Evaluate(manifest)); - if (!should_match) { - // Skip this manifest because it doesn't match partition filter - continue; - } + ICEBERG_ASSIGN_OR_RAISE(auto manifest_evaluator, get_manifest_evaluator(spec_id)); + ICEBERG_ASSIGN_OR_RAISE(bool should_match, + manifest_evaluator->Evaluate(manifest)); + if (!should_match) { + // Skip this manifest because it doesn't match partition filter + return {}; + } - if (ignore_deleted_) { - // only scan manifests that have entries other than deletes - if (!manifest.has_added_files() && !manifest.has_existing_files()) { - continue; - } - } + if (ignore_deleted_) { + // only scan manifests that have entries other than deletes + if (!manifest.has_added_files() && !manifest.has_existing_files()) { + return {}; + } + } - if (ignore_existing_) { - // only scan manifests that have entries other than existing - if (!manifest.has_added_files() && !manifest.has_deleted_files()) { - continue; - } - } + if (ignore_existing_) { + // only scan manifests that have entries other than existing + if (!manifest.has_added_files() && !manifest.has_deleted_files()) { + return {}; + } + } - // Read manifest entries - ICEBERG_ASSIGN_OR_RAISE(auto reader, MakeReader(manifest)); - ICEBERG_ASSIGN_OR_RAISE(auto entries, - ignore_deleted_ ? reader->LiveEntries() : reader->Entries()); + // Read manifest entries + ICEBERG_ASSIGN_OR_RAISE(auto reader, MakeReader(manifest)); + ICEBERG_ASSIGN_OR_RAISE( + auto entries, ignore_deleted_ ? reader->LiveEntries() : reader->Entries()); - for (auto& entry : entries) { - if (ignore_existing_ && entry.status == ManifestStatus::kExisting) { - continue; - } + std::unordered_map> manifest_result; - if (data_file_evaluator != nullptr) { - DataFileStructLike data_file(*entry.data_file); - ICEBERG_ASSIGN_OR_RAISE(bool should_match, - data_file_evaluator->Evaluate(data_file)); - if (!should_match) { - continue; - } - } + for (auto& entry : entries) { + if (ignore_existing_ && entry.status == ManifestStatus::kExisting) { + continue; + } - if (!manifest_entry_predicate_(entry)) { - continue; - } + if (data_file_evaluator != nullptr) { + DataFileStructLike data_file(*entry.data_file); + ICEBERG_ASSIGN_OR_RAISE(bool should_match, + data_file_evaluator->Evaluate(data_file)); + if (!should_match) { + continue; + } + } - result[spec_id].push_back(std::move(entry)); - } - } + if (!manifest_entry_predicate_(entry)) { + continue; + } - return result; + manifest_result[spec_id].push_back(std::move(entry)); + } + return manifest_result; + }); } } // namespace iceberg diff --git a/src/iceberg/manifest/manifest_group.h b/src/iceberg/manifest/manifest_group.h index 10b552786..09ae4a503 100644 --- a/src/iceberg/manifest/manifest_group.h +++ b/src/iceberg/manifest/manifest_group.h @@ -36,6 +36,7 @@ #include "iceberg/result.h" #include "iceberg/type_fwd.h" #include "iceberg/util/error_collector.h" +#include "iceberg/util/executor.h" namespace iceberg { @@ -94,6 +95,9 @@ class ICEBERG_EXPORT ManifestGroup : public ErrorCollector { /// \brief Set a custom manifest entry filter predicate. /// + /// When an executor is configured with PlanWith(), this predicate may be called + /// concurrently. Callers must synchronize any captured mutable state. + /// /// \param predicate A function that returns true if the entry should be included. ManifestGroup& FilterManifestEntries( std::function predicate); @@ -120,6 +124,12 @@ class ICEBERG_EXPORT ManifestGroup : public ErrorCollector { /// \param column_ids Field IDs of columns whose statistics should be preserved. ManifestGroup& ColumnsToKeepStats(std::unordered_set column_ids); + /// \brief Configure an optional executor for manifest planning. + /// + /// \param executor Executor to use, or std::nullopt to plan manifests serially. + /// \return Reference to this for method chaining. + ManifestGroup& PlanWith(OptionalExecutor executor); + /// \brief Plan scan tasks for all matching data files. Result>> PlanFiles(); @@ -158,6 +168,7 @@ class ICEBERG_EXPORT ManifestGroup : public ErrorCollector { std::function manifest_entry_predicate_; std::vector columns_; std::unordered_set columns_to_keep_stats_; + OptionalExecutor executor_; bool case_sensitive_ = true; bool ignore_deleted_ = false; bool ignore_existing_ = false; diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 1d8ea472b..c8c815797 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -139,6 +139,7 @@ add_iceberg_test(util_test lazy_test.cc location_util_test.cc math_util_internal_test.cc + executor_util_test.cc roaring_position_bitmap_test.cc position_delete_index_test.cc position_delete_range_consumer_test.cc diff --git a/src/iceberg/test/executor_util_test.cc b/src/iceberg/test/executor_util_test.cc new file mode 100644 index 000000000..3bb9ad9fc --- /dev/null +++ b/src/iceberg/test/executor_util_test.cc @@ -0,0 +1,189 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "iceberg/result.h" +#include "iceberg/test/executor.h" +#include "iceberg/test/matchers.h" +#include "iceberg/util/executor_util_internal.h" + +namespace iceberg { + +using ::testing::ElementsAre; +using ::testing::Pair; +using ::testing::UnorderedElementsAre; + +namespace { + +struct IntTask { + Result> operator()(int) { + return Result>{std::vector{}}; + } +}; + +struct BoolTask { + Result> operator()(bool) { + return Result>{std::vector{}}; + } +}; + +static_assert(internal::ParallelCollectible&, IntTask>); +static_assert( + std::same_as&>(), + IntTask{})), + Result>>); +static_assert(!internal::ParallelCollectible); +static_assert(!internal::ParallelCollectible&, BoolTask>); + +} // namespace + +TEST(ParallelReduceTest, MergesSets) { + std::vector> values = {{1, 2}, {2, 3}, {}}; + + auto result = ParallelReduce>::Reduce(values); + + EXPECT_THAT(result, UnorderedElementsAre(1, 2, 3)); +} + +TEST(ParallelReduceTest, JoinsVectors) { + std::vector> values = {{1, 2}, {}, {3}}; + + auto result = ParallelReduce>::Reduce(values); + + EXPECT_THAT(result, ElementsAre(1, 2, 3)); +} + +TEST(ParallelReduceTest, MergesMapsAndAppendsDuplicateVectors) { + std::vector>> values = { + {{1, {"a"}}, {2, {"b"}}}, {{1, {"c"}}, {3, {"d"}}}}; + + auto result = + ParallelReduce>>::Reduce(values); + + EXPECT_THAT(result, + UnorderedElementsAre(Pair(1, ElementsAre("a", "c")), + Pair(2, ElementsAre("b")), Pair(3, ElementsAre("d")))); +} + +TEST(ParallelReduceTest, ReducesPairElements) { + using Value = std::pair, std::vector>; + + std::vector values = {{{1}, {"a"}}, {{2}, {"b"}}}; + + auto result = ParallelReduce::Reduce(values); + + EXPECT_THAT(result.first, UnorderedElementsAre(1, 2)); + EXPECT_THAT(result.second, ElementsAre("a", "b")); +} + +TEST(ParallelReduceTest, ReducesTupleElements) { + using Value = std::tuple, std::vector>; + + std::vector values = {{{1}, {"a"}}, {{2}, {"b"}}}; + + auto result = ParallelReduce::Reduce(values); + + EXPECT_THAT(std::get<0>(result), UnorderedElementsAre(1, 2)); + EXPECT_THAT(std::get<1>(result), ElementsAre("a", "b")); +} + +TEST(ParallelReduceTest, ReducesViewElements) { + using Value = std::tuple, std::vector>; + + std::vector values = {{{0}, {"skip"}}, {{1}, {"a"}}, {{2}, {"b"}}}; + + auto result = ParallelReduce::Reduce(values | std::views::drop(1)); + + EXPECT_THAT(std::get<0>(result), UnorderedElementsAre(1, 2)); + EXPECT_THAT(std::get<1>(result), ElementsAre("a", "b")); +} + +TEST(ParallelCollectTest, CollectsSingleRange) { + std::vector input = {1, 2, 3}; + + auto result = ParallelCollect(std::nullopt, input, [](int value) { + return Result>{{value * 2}}; + }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(*result, UnorderedElementsAre(2, 4, 6)); +} + +TEST(ParallelCollectTest, KeepsTupleResultFromSingleRange) { + std::vector input = {1, 2}; + + auto result = ParallelCollect( + std::nullopt, input, + [](int value) + -> Result, std::vector>> { + return {{{value}, {std::to_string(value)}}}; + }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(std::get<0>(*result), UnorderedElementsAre(1, 2)); + EXPECT_THAT(std::get<1>(*result), ElementsAre("1", "2")); +} + +TEST(ParallelCollectTest, CollectsMultipleRanges) { + test::ThreadExecutor executor; + std::vector left = {1, 2}; + std::vector right = {"a", "b"}; + + auto result = ParallelCollect( + std::ref(executor), left, + [](int value) { return Result>{{value}}; }, right, + [](const std::string& value) { return Result>{{value}}; }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(std::get<0>(*result), UnorderedElementsAre(1, 2)); + EXPECT_THAT(std::get<1>(*result), ElementsAre("a", "b")); + EXPECT_EQ(executor.submit_count(), 4); +} + +TEST(ParallelCollectTest, PropagatesTaskErrors) { + std::vector input = {1, 2, 3}; + std::atomic calls = 0; + + auto result = ParallelCollect(std::nullopt, input, [&calls](int value) { + calls.fetch_add(1, std::memory_order_relaxed); + if (value == 2) { + return Result>{ValidationFailed("bad value")}; + } + return Result>{{value}}; + }); + + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_EQ(calls.load(std::memory_order_relaxed), 3); +} + +} // namespace iceberg diff --git a/src/iceberg/test/manifest_group_test.cc b/src/iceberg/test/manifest_group_test.cc index 70e2cea99..aa2d6810d 100644 --- a/src/iceberg/test/manifest_group_test.cc +++ b/src/iceberg/test/manifest_group_test.cc @@ -39,6 +39,7 @@ #include "iceberg/partition_spec.h" #include "iceberg/schema.h" #include "iceberg/table_scan.h" +#include "iceberg/test/executor.h" #include "iceberg/test/matchers.h" #include "iceberg/transform.h" #include "iceberg/type.h" @@ -625,11 +626,15 @@ TEST_P(ManifestGroupTest, MultipleDataManifests) { auto group, ManifestGroup::Make(file_io_, schema_, GetSpecsById(), std::move(manifests))); + test::ThreadExecutor executor; + group->PlanWith(std::ref(executor)); + // Plan files - should return files from both manifests ICEBERG_UNWRAP_OR_FAIL(auto tasks, group->PlanFiles()); ASSERT_EQ(tasks.size(), 2); EXPECT_THAT(GetPaths(tasks), testing::UnorderedElementsAre("/path/to/data1.parquet", "/path/to/data2.parquet")); + EXPECT_EQ(executor.submit_count(), 2); } TEST_P(ManifestGroupTest, PartitionFilter) { diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index a76a15553..a17d9841a 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -93,6 +93,7 @@ iceberg_tests = { 'data_file_set_test.cc', 'decimal_test.cc', 'endian_test.cc', + 'executor_util_test.cc', 'file_io_test.cc', 'formatter_test.cc', 'lazy_test.cc', diff --git a/src/iceberg/util/executor_util_internal.h b/src/iceberg/util/executor_util_internal.h new file mode 100644 index 000000000..5eed3a8bd --- /dev/null +++ b/src/iceberg/util/executor_util_internal.h @@ -0,0 +1,221 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/result.h" +#include "iceberg/util/executor.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/task_group.h" + +namespace iceberg { + +template +struct ParallelReduce; + +namespace internal { + +template +concept ParallelReducible = requires(std::vector& values) { + typename ParallelReduce::result_type; + { + ParallelReduce::Reduce(values) + } -> std::same_as::result_type>; +}; + +template +using ParallelCollectValueT = + ResultValueT&, + std::add_lvalue_reference_t>>>>; + +template +struct ParallelCollectTraits { + using args_tuple_type = std::tuple; + using input_type = std::tuple_element_t; + using task_type = std::tuple_element_t; + using value_type = ParallelCollectValueT; +}; + +template +concept ParallelCollectible = + std::ranges::forward_range && std::ranges::sized_range && + std::is_lvalue_reference_v> && + requires(std::remove_reference_t& task, + std::ranges::range_reference_t item) { + { std::invoke(task, item) } -> AsResult; + requires(!std::same_as>); + requires std::default_initializable>; + requires ParallelReducible, Options...>; + }; + +} // namespace internal + +template +struct ParallelReduce> { + using result_type = std::unordered_set; + + template + static result_type Reduce(Values&& values) { + result_type result; + for (auto&& value : values) { + result.merge(value); + } + return result; + } +}; + +template +struct ParallelReduce> { + using result_type = std::vector; + + template + static result_type Reduce(Values&& values) { + return std::forward(values) | std::views::join | std::views::as_rvalue | + std::ranges::to(); + } +}; + +template +struct ParallelReduce, MapArgs...>> { + using result_type = std::unordered_map, MapArgs...>; + + template + static result_type Reduce(Values&& values) { + result_type result; + for (auto&& value : values) { + result.merge(value); + for (auto& [key, entries] : value) { + auto& out = result[key]; + out.insert(out.end(), std::make_move_iterator(entries.begin()), + std::make_move_iterator(entries.end())); + } + } + return result; + } +}; + +template +struct ParallelReduce> { + using result_type = std::pair::result_type, + typename ParallelReduce::result_type>; + + template + static result_type Reduce(Values&& values) { + return {ParallelReduce::Reduce(values | std::views::elements<0>), + ParallelReduce::Reduce(values | std::views::elements<1>)}; + } +}; + +template +struct ParallelReduce> { + using result_type = std::tuple::result_type...>; + + template + static result_type Reduce(Values&& values) { + return Reduce(values, std::index_sequence_for{}); + } + + private: + template + static result_type Reduce(Values&& values, std::index_sequence) { + return result_type{ParallelReduce>>::Reduce( + values | std::views::elements)...}; + } +}; + +template + requires(sizeof...(Args) >= 2 && sizeof...(Args) % 2 == 0 && + [](std::index_sequence) consteval { + return (internal::ParallelCollectible< + typename internal::ParallelCollectTraits::input_type, + typename internal::ParallelCollectTraits::task_type, + Options...> && + ...); + }(std::make_index_sequence{})) +auto ParallelCollect(OptionalExecutor executor, Args&&... args) { + constexpr std::size_t pair_count = sizeof...(Args) / 2; + using indices = std::make_index_sequence; + + auto args_tuple = std::forward_as_tuple(std::forward(args)...); + + auto values_tuple = [&](std::index_sequence) { + return std::tuple{[&] { + using traits = internal::ParallelCollectTraits; + + return std::vector( + std::ranges::size(std::get(args_tuple))); + }()...}; + }(indices{}); + + auto reduce_all = [&](std::index_sequence) { + auto reduce_one = [&] { + using traits = internal::ParallelCollectTraits; + using value_type = typename traits::value_type; + return ParallelReduce::Reduce( + std::get(values_tuple)); + }; + + if constexpr (pair_count == 1) { + return reduce_one.template operator()<0>(); + } else { + return std::tuple{reduce_one.template operator()()...}; + } + }; + + using result_type = decltype(reduce_all(indices{})); + + TaskGroup group; + group.SetExecutor(executor); + + [&](std::index_sequence) { + ( + [&] { + for (auto&& [item, value] : + std::views::zip(std::get(args_tuple), std::get(values_tuple))) { + group.Submit([&]() -> Status { + ICEBERG_ASSIGN_OR_RAISE(value, + std::invoke(std::get(args_tuple), item)); + return {}; + }); + } + }(), + ...); + }(indices{}); + + auto status = std::move(group).Run(); + if (!status.has_value()) { + return Result(std::unexpected(status.error())); + } + + return Result(reduce_all(indices{})); +} + +} // namespace iceberg From a38e0cdef88a2cd3673a78e659cbadb575fa6c2e Mon Sep 17 00:00:00 2001 From: kamcheungting-db <91572897+kamcheungting-db@users.noreply.github.com> Date: Mon, 22 Jun 2026 02:14:36 -0700 Subject: [PATCH 109/151] feat(logging): add Logger interface and default logger (#723) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 2 of the logging stack (builds on #722). Adds the logging API and a swappable default logger — the foundation the backends and macros plug into. **What's here** - `Logger`: the pluggable sink interface (`ShouldLog` / `Log` / `SetLevel` / `Flush` / `Initialize`). `ShouldLog()` is the single source of truth for runtime filtering. - `LogMessage` owns its formatted text so a sink can safely keep a record; reserves an attributes field for future structured logging. - Process-global default logger: `GetDefaultLogger` / `SetDefaultLogger` / `SetDefaultLevel`, with a lock-free thread-local fast path so logging stays cheap. - `Initialize` applies the `level` property, so config-driven levels actually work. `CurrentLogger()` is safe to call even from a `thread_local` destructor during thread shutdown. - `logger.h` stays backend-agnostic (never includes the build config header), so consumers see one stable API regardless of backend. **Examples** — using the API directly (the `LOG_*` macros that wrap it arrive in #725): ```cpp // A custom sink, installed as the process default. class MySink : public Logger { public: bool ShouldLog(LogLevel level) const override { return level >= level_; } void Log(LogMessage&& m) noexcept override { write_line(m.message); } void SetLevel(LogLevel level) override { level_ = level; } LogLevel level() const override { return level_; } private: std::atomic level_{LogLevel::kInfo}; }; SetDefaultLogger(std::make_shared()); // install process-wide SetDefaultLevel(LogLevel::kDebug); // adjust the threshold auto logger = GetDefaultLogger(); // borrow the current default if (logger->ShouldLog(LogLevel::kInfo)) { logger->Log(LogMessage{.level = LogLevel::kInfo, .message = "scan ready"}); } // Or configure from catalog-style properties (applies the "level" key): auto sink = std::make_shared(); auto status = sink->Initialize({{std::string(kLevelProperty), "warn"}}); // -> kWarn ``` The same example is documented inline in `logger.h`. **Tests** — `logger_test`: default-logger API, level-from-property, invalid level rejected, concurrent swap/read, and logging during thread teardown. Built and run with clang/libc++ (spdlog ON and OFF). This pull request and its description were written by Isaac. --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/logging/logger.cc | 217 ++++++++++++ src/iceberg/logging/logger.h | 373 ++++++++++++++++++++ src/iceberg/logging/meson.build | 2 +- src/iceberg/meson.build | 1 + src/iceberg/test/CMakeLists.txt | 2 +- src/iceberg/test/logger_test.cc | 450 ++++++++++++++++++++++++ src/iceberg/test/logging_test_helpers.h | 84 +++++ src/iceberg/test/meson.build | 2 +- 9 files changed, 1129 insertions(+), 3 deletions(-) create mode 100644 src/iceberg/logging/logger.cc create mode 100644 src/iceberg/logging/logger.h create mode 100644 src/iceberg/test/logger_test.cc create mode 100644 src/iceberg/test/logging_test_helpers.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index b3cc8a7a9..ea76c641a 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -49,6 +49,7 @@ set(ICEBERG_SOURCES inheritable_metadata.cc json_serde.cc location_provider.cc + logging/logger.cc manifest/manifest_adapter.cc manifest/manifest_entry.cc manifest/manifest_filter_manager.cc diff --git a/src/iceberg/logging/logger.cc b/src/iceberg/logging/logger.cc new file mode 100644 index 000000000..3adbf75dd --- /dev/null +++ b/src/iceberg/logging/logger.cc @@ -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. + */ + +#include "iceberg/logging/logger.h" + +#include +#include +#include +#include +#include +#include + +namespace iceberg { + +namespace { + +/// \brief Logger that drops every record. +class NoopLogger final : public Logger { + public: + bool ShouldLog(LogLevel /*level*/) const noexcept override { return false; } + void Log(LogMessage&& /*message*/) noexcept override {} + void SetLevel(LogLevel /*level*/) noexcept override {} + LogLevel level() const noexcept override { return LogLevel::kOff; } + bool IsNoop() const override { return true; } +}; + +/// \brief Construct the process default logger for this build configuration. +/// +/// This block ships only the interface and the no-op logger; the concrete +/// std::cerr and spdlog sinks (and the build-config selection between them) +/// arrive in later blocks, which update this factory. +std::shared_ptr MakeDefaultLogger() { return std::make_shared(); } + +/// \brief The process-global default-logger slot. +struct DefaultSlot { + std::mutex mtx; + std::shared_ptr logger; + // Seeded to 1 so a fresh thread (tls_gen == 0) always refreshes on first use. + std::atomic gen{1}; + + DefaultSlot() : logger(MakeDefaultLogger()) {} +}; + +/// \brief Immortal (leaked, hence reachable -> LSan-clean) accessor for the slot. +DefaultSlot& Slot() { + static auto* slot = new DefaultSlot(); + return *slot; +} + +/// \brief A thread's cached view of the default logger and the generation it was +/// cached at. Heap-allocated per thread and freed at thread exit (see +/// AccessThreadCache). `override_` is the active ScopedLogger binding for this +/// thread (empty when none); when set it supersedes the cached default. +struct ThreadCache { + std::shared_ptr logger; + uint64_t gen = 0; // 0 != Slot().gen (seeded to 1) -> first use always refreshes + std::shared_ptr override_; // active ScopedLogger binding, empty if none +}; + +} // namespace + +std::shared_ptr Logger::Noop() { + // Intentionally leaked: reachable via the function-local static (LSan-clean) + // and never destroyed, so logging during static teardown stays safe. + static auto* instance = new std::shared_ptr(std::make_shared()); + return *instance; +} + +std::shared_ptr GetDefaultLogger() { + DefaultSlot& slot = Slot(); + std::lock_guard lock(slot.mtx); + return slot.logger; +} + +void SetDefaultLogger(std::shared_ptr logger) { + if (!logger) { + logger = Logger::Noop(); + } + DefaultSlot& slot = Slot(); + std::lock_guard lock(slot.mtx); + slot.logger = std::move(logger); + // Publish the swap; the mutex provides the happens-before, gen is a detector. + slot.gen.fetch_add(1, std::memory_order_relaxed); +} + +void SetDefaultLevel(LogLevel level) { + DefaultSlot& slot = Slot(); + std::lock_guard lock(slot.mtx); + slot.logger->SetLevel(level); +} + +namespace internal { + +namespace { + +/// \brief The one place the per-thread cache's lifetime is managed; shared by +/// CurrentLogger, GetCurrentLogger, and the ScopedLogger helpers. +/// +/// Safe to call from any thread_local destructor during teardown: `dead`/`cache` +/// are trivially destructible so their storage lives the whole thread, and `guard` +/// (the only one with a destructor) sets `dead` before freeing the cache -- so a +/// late caller gets nullptr instead of touching freed memory, in any order. +/// +/// \param create allocate the cache if absent (writers pass true; read-only +/// callers pass false so a query never allocates). Returns nullptr while tearing +/// down, or when !create and no cache exists -- caller falls back to global/noop. +ThreadCache* AccessThreadCache(bool create) noexcept { + static thread_local bool dead = false; + static thread_local ThreadCache* cache = nullptr; + static thread_local struct Guard { + ~Guard() { + dead = true; // mark BEFORE freeing, so a re-entrant log hits the fallback + delete cache; + cache = nullptr; + } + } guard; + std::ignore = guard; // mark the thread_local as intentionally used (its dtor is + // registered by reaching the declaration above) + + if (dead) return nullptr; + if (cache == nullptr && create) cache = new ThreadCache(); + return cache; +} + +} // namespace + +const std::shared_ptr& CurrentLogger() noexcept { + ThreadCache* cache = AccessThreadCache(/*create=*/true); + if (cache == nullptr) { + // Thread teardown after the cache was freed: serve an immortal no-op so a log + // from a later thread_local destructor is safe. Such teardown logs are dropped. + static auto* fallback = new std::shared_ptr(Logger::Noop()); + return *fallback; + } + + // A scoped override wins -- no lock, no gen load. After the cache check (deref is + // teardown-safe), before the refresh (keeps the override path cheapest). + if (cache->override_) return cache->override_; + + DefaultSlot& slot = Slot(); + uint64_t current = slot.gen.load(std::memory_order_relaxed); + if (current != cache->gen) { + std::lock_guard lock(slot.mtx); + cache->logger = slot.logger; + cache->gen = current; + } + return cache->logger; +} + +std::shared_ptr ExchangeThreadOverride(std::shared_ptr next) noexcept { + ThreadCache* cache = AccessThreadCache(/*create=*/true); + if (cache == nullptr) return {}; // tearing down -> binding a scope is a no-op + std::shared_ptr prev = std::move(cache->override_); + cache->override_ = std::move(next); + return prev; // empty == no override was active +} + +void RestoreThreadOverride(std::shared_ptr prev) noexcept { + ThreadCache* cache = AccessThreadCache(/*create=*/false); // never allocate to restore + if (cache == nullptr) return; // dead or never created -> nothing to restore + cache->override_ = std::move(prev); +} + +void Emit(Logger& logger, LogLevel level, const std::source_location& location, + std::string&& message) { + logger.Log(LogMessage{.level = level, + .message = std::move(message), + .location = location, + .attributes = {}}); +} + +void EmitFormatError(Logger& logger, LogLevel level, + const std::source_location& location) noexcept { + // Fixed short literal (<= 15 bytes, fits SSO on libstdc++/libc++/MSVC -> no heap + // allocation), no std::format, no retry. Cannot throw or recurse. + logger.Log(LogMessage{.level = level, + .message = std::string(""), + .location = location, + .attributes = {}}); +} + +} // namespace internal + +ScopedLogger::ScopedLogger(std::shared_ptr logger) noexcept + : previous_(internal::ExchangeThreadOverride(std::move(logger))) {} + +ScopedLogger::~ScopedLogger() { internal::RestoreThreadOverride(std::move(previous_)); } + +std::shared_ptr GetCurrentLogger() { + ThreadCache* cache = internal::AccessThreadCache(/*create=*/false); + if (cache == nullptr) { + // Teardown, or no per-thread cache ever created -> no override possible. + // GetDefaultLogger() touches only the immortal slot (no thread_local), so it + // stays valid during teardown, and is never null. + return GetDefaultLogger(); + } + if (cache->override_) return cache->override_; + return GetDefaultLogger(); +} + +} // namespace iceberg diff --git a/src/iceberg/logging/logger.h b/src/iceberg/logging/logger.h new file mode 100644 index 000000000..8a642f833 --- /dev/null +++ b/src/iceberg/logging/logger.h @@ -0,0 +1,373 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/logging/logger.h +/// \brief Pluggable logging interface and the process-global default logger. +/// +/// This header is backend-agnostic: it never includes the build-generated +/// backend configuration header and never references the spdlog feature macro, +/// so consumers see one stable API regardless of how the backend was configured. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/logging/log_level.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief A structured key/value attribute attached to a log record. +/// +/// Both key and value are owned so a sink may retain the record safely. Engine +/// loggers can surface these as discrete fields (query id, task id, table name, +/// snapshot id, file path, ...); see LogMessage::Builder to populate them. +struct ICEBERG_EXPORT LogAttribute { + std::string key; + std::string value; +}; + +/// \brief A single log record handed to a Logger. +/// +/// The formatted message is owned (moved in by the logging macros), so a sink +/// may safely retain the record beyond the Log() call. The member set must not +/// depend on the build's logging backend (the spdlog backend never appears here). +/// Use LogMessage::Builder for a readable way to assemble one, especially with +/// structured attributes. +struct ICEBERG_EXPORT LogMessage { + LogLevel level = LogLevel::kOff; + std::string message; + std::source_location location = std::source_location::current(); + std::vector attributes; + + class Builder; +}; + +/// \brief Fluent builder for LogMessage, the easy path to attach structured +/// attributes. +/// +/// Example: +/// auto record = LogMessage::Builder(LogLevel::kInfo) +/// .Message("scan finished") +/// .Attribute("table", table_name) +/// .Attribute("snapshot_id", std::to_string(id)) +/// .Build(); +/// logger->Log(std::move(record)); +/// +/// The location defaults to the caller's construction site (captured via the +/// constructor's default argument); override it with Location() (e.g. to forward +/// a caller's std::source_location). +class ICEBERG_EXPORT LogMessage::Builder { + public: + explicit Builder(LogLevel level, + std::source_location location = std::source_location::current()) + : level_(level), location_(location) {} + + /// \brief Set the already-formatted message text. + Builder& Message(std::string message) { + message_ = std::move(message); + return *this; + } + + /// \brief Append a structured key/value attribute. + Builder& Attribute(std::string key, std::string value) { + attributes_.push_back(LogAttribute{.key = std::move(key), .value = std::move(value)}); + return *this; + } + + /// \brief Override the record's source location (defaults to the build site). + Builder& Location(std::source_location location) { + location_ = location; + return *this; + } + + /// \brief Materialize the LogMessage, moving the accumulated state out. + LogMessage Build() { + return LogMessage{.level = level_, + .message = std::move(message_), + .location = location_, + .attributes = std::move(attributes_)}; + } + + private: + LogLevel level_; + std::string message_; + // `location_` is a trivially copyable members no need to move. + std::source_location location_; + std::vector attributes_; +}; + +/// \brief Well-known Logger::Initialize() property keys. +/// +/// `level` is honored by the base Logger::Initialize (parsed via +/// LogLevelFromString). `pattern` is honored by the formatting sinks +/// (CerrLogger, SpdLogger). +inline constexpr std::string_view kLevelProperty = "level"; +inline constexpr std::string_view kPatternProperty = "pattern"; + +/// \brief Pluggable logging sink. +/// +/// ShouldLog() is the single authority for runtime filtering -- the macros call +/// it on every (compile-time-enabled) statement, so level changes by any path +/// take effect immediately. Implementations must be thread-safe and must not +/// throw. They must also obey: +/// - No reentrancy: Log()/Flush() must not call the logging macros or +/// GetDefaultLogger() (UB -- deadlock with mutex-based sinks). +/// - level() is an accessor consistent with ShouldLog (used by SetDefaultLevel +/// and introspection); ShouldLog may implement finer logic than a level compare. +class ICEBERG_EXPORT Logger { + public: + virtual ~Logger() = default; + + /// \brief Property-based setup, called by Loggers::Load() before first use. + /// + /// The base implementation applies the "level" property (parsed via + /// LogLevelFromString); an unrecognized value is an InvalidArgument error. + /// Formatting sinks override this to also apply "pattern" and then delegate + /// to this base for "level". + virtual Status Initialize( + const std::unordered_map& properties) { + if (auto it = properties.find(std::string(kLevelProperty)); it != properties.end()) { + auto parsed = LogLevelFromString(it->second); + if (!parsed) return std::unexpected(parsed.error()); + SetLevel(*parsed); + } + return {}; + } + + /// \brief Cheap check whether a record at \p level would be emitted. + virtual bool ShouldLog(LogLevel level) const noexcept = 0; + + /// \brief Emit one (already-formatted) record, taking ownership. Must not throw. + virtual void Log(LogMessage&& message) noexcept = 0; + + /// \brief Set the minimum level this logger emits. + virtual void SetLevel(LogLevel level) noexcept = 0; + + /// \brief Return the minimum level this logger emits. + virtual LogLevel level() const noexcept = 0; + + /// \brief Flush any buffered output. Must not throw; best-effort on the fatal path. + virtual void Flush() noexcept {} + + /// \brief Return true if this logger is a no-op. + virtual bool IsNoop() const { return false; } + + /// \brief Return a shared, immortal no-op logger singleton. + static std::shared_ptr Noop(); +}; + +/// \brief Return the process-global default logger (never null). +/// +/// Off the hot path -- acquires the slot lock and returns an owning copy. The +/// logging macros use the cheaper internal hot-path accessor instead. +ICEBERG_EXPORT std::shared_ptr GetDefaultLogger(); + +/// \brief Return the effective logger for this thread (never null): the active +/// ScopedLogger binding if any, else the global default. +/// +/// Off the hot path -- returns an owning copy, e.g. to capture the current logger +/// and re-bind it on a worker thread (see ScopedLogger). During teardown, prefer +/// the Log(...) overloads over emitting through this handle. +ICEBERG_EXPORT std::shared_ptr GetCurrentLogger(); + +/// \brief Install a new process-global default logger. +/// +/// A null argument installs the no-op logger. Thread-safe; intended for +/// occasional (configuration-time) use rather than the hot path. +ICEBERG_EXPORT void SetDefaultLogger(std::shared_ptr logger); + +/// \brief Set the minimum level of the current default logger. +/// +/// Convenience for `GetDefaultLogger()->SetLevel(level)`. Filtering is always +/// decided by the logger's own ShouldLog(), so changing a logger's level by any +/// means (this, SetLevel on a held handle, or Initialize) takes effect immediately. +ICEBERG_EXPORT void SetDefaultLevel(LogLevel level); + +/// \brief Bind a logger for the current thread until this object leaves scope. +/// +/// The default logging path on this thread -- CurrentLogger(), Log(level, ...), +/// and the LOG_* macros -- routes to \p logger instead of the global default; +/// explicit Log(logger, ...) is unaffected. Bindings nest and restore on exit, and +/// nullptr masks any enclosing binding back to the global default. Lets an engine +/// route Iceberg's own logs into a per catalog/session/query/task context with no +/// call-site changes. +/// +/// \code +/// auto query_log = std::make_shared(); +/// iceberg::ScopedLogger bind(query_log); // this thread, this scope +/// iceberg::Log(LogLevel::kInfo, "scan {}", id); // -> query_log +/// \endcode +/// +/// Stack-only and same-thread (non-copyable, non-movable). For thread pools, +/// capture on the submitting thread and re-bind on the worker: +/// \code +/// auto captured = iceberg::GetCurrentLogger(); +/// pool.submit([captured, work] { iceberg::ScopedLogger bind(captured); work(); }); +/// \endcode +class ICEBERG_EXPORT ScopedLogger { + public: + explicit ScopedLogger(std::shared_ptr logger) noexcept; + ~ScopedLogger(); + + ScopedLogger(const ScopedLogger&) = delete; + ScopedLogger& operator=(const ScopedLogger&) = delete; + ScopedLogger(ScopedLogger&&) = delete; + ScopedLogger& operator=(ScopedLogger&&) = delete; + + private: + std::shared_ptr previous_; +}; + +// --------------------------------------------------------------------------- +// Using the API directly (the LOG_* macros that wrap this are added later in +// the stack). Example: a custom sink, installed as the process default. +// +// class MySink : public Logger { +// public: +// bool ShouldLog(LogLevel level) const noexcept override { return level >= level_; } +// void Log(LogMessage&& m) noexcept override { write_line(m.message); } +// void SetLevel(LogLevel level) noexcept override { level_ = level; } +// LogLevel level() const noexcept override { return level_; } +// private: +// std::atomic level_{LogLevel::kInfo}; +// }; +// +// SetDefaultLogger(std::make_shared()); // install process-wide +// SetDefaultLevel(LogLevel::kDebug); // adjust the threshold +// +// auto logger = GetDefaultLogger(); // borrow the current default +// if (logger->ShouldLog(LogLevel::kInfo)) { +// logger->Log(LogMessage{.level = LogLevel::kInfo, .message = "scan ready"}); +// } +// +// // Or configure from catalog-style properties (applies the "level" key): +// auto sink = std::make_shared(); +// auto status = sink->Initialize({{std::string(kLevelProperty), "warn"}}); // -> kWarn +// --------------------------------------------------------------------------- + +namespace internal { + +/// \brief Hot-path accessor for the default logger. +/// +/// Returns a reference to a thread-local cached shared_ptr that is refreshed +/// only when the default logger has changed (no lock / no refcount churn in +/// steady state). The reference is valid for the duration of the calling +/// statement. +ICEBERG_EXPORT const std::shared_ptr& CurrentLogger() noexcept; + +/// \brief Build a LogMessage from the already-formatted text and dispatch it. +/// +/// Declared ICEBERG_EXPORT because the logging macros expand into this call in +/// consumer translation units. +ICEBERG_EXPORT void Emit(Logger& logger, LogLevel level, + const std::source_location& location, std::string&& message); + +/// \brief Emit a fixed fallback record when formatting threw. +/// +/// noexcept, allocation-light (small/SSO literal), performs no std::format, and +/// does not recurse -- so the macro's "logging never throws" guarantee holds +/// even when a format argument throws. +ICEBERG_EXPORT void EmitFormatError(Logger& logger, LogLevel level, + const std::source_location& location) noexcept; + +/// \brief Runtime (non-literal) format-string helper. +/// +/// std::format requires a compile-time format string; this routes a runtime +/// string through std::vformat. Args are bound as named lvalues and the +/// arg-store is held in a named variable so it outlives the vformat call +/// (C++23 make_format_args rejects rvalues -- P2905 / LWG3631). +template +std::string VFormat(std::string_view fmt, Args&&... args) { + auto store = std::make_format_args(args...); + return std::vformat(fmt, store); +} + +/// \brief A checked format string bundled with the caller's source_location. +/// +/// The consteval constructor preserves std::format's compile-time format-string +/// checking while capturing the call site (the std::print/println technique), +/// so the function-style Log() can record an accurate file:line without a macro. +/// Used as a non-deduced parameter so the trailing args drive deduction. +template +struct FmtWithLoc { + std::format_string fmt; + std::source_location loc; + + template + requires std::convertible_to> + consteval FmtWithLoc( // NOLINT(google-explicit-constructor): mirrors + // std::format_string + const T& s, std::source_location loc = std::source_location::current()) + : fmt(s), loc(loc) {} +}; + +/// \brief Shared gate -> format -> emit body for the function-style Log() API. +/// +/// Formats only when the logger is enabled for \p level, and never throws (a +/// formatting failure routes to EmitFormatError, matching the macros). +template +void FormatAndEmit(Logger& logger, LogLevel level, const std::source_location& loc, + std::format_string fmt, Args&&... args) noexcept { + if (!logger.ShouldLog(level)) return; + try { + Emit(logger, level, loc, std::format(fmt, std::forward(args)...)); + } catch (...) { + EmitFormatError(logger, level, loc); + } +} + +} // namespace internal + +/// \brief Log to the process-default logger, std::format style. Formats only if +/// the level is enabled; never throws. +/// +/// Example: `iceberg::Log(LogLevel::kInfo, "loaded {} files", n);` +template +void Log(LogLevel level, internal::FmtWithLoc...> fmt, + Args&&... args) noexcept { + const std::shared_ptr& logger = internal::CurrentLogger(); + if (logger) { + internal::FormatAndEmit(*logger, level, fmt.loc, fmt.fmt, + std::forward(args)...); + } +} + +/// \brief Log to an explicit logger, std::format style. Formats only if enabled. +/// +/// Example: `iceberg::Log(logger, LogLevel::kWarn, "retry {}", attempt);` +template +void Log(Logger& logger, LogLevel level, + internal::FmtWithLoc...> fmt, + Args&&... args) noexcept { + internal::FormatAndEmit(logger, level, fmt.loc, fmt.fmt, std::forward(args)...); +} + +} // namespace iceberg diff --git a/src/iceberg/logging/meson.build b/src/iceberg/logging/meson.build index 3c286a196..3f7af4fec 100644 --- a/src/iceberg/logging/meson.build +++ b/src/iceberg/logging/meson.build @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -install_headers(['log_level.h'], subdir: 'iceberg/logging') +install_headers(['log_level.h', 'logger.h'], subdir: 'iceberg/logging') diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 0c467605b..7bd2e052c 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -74,6 +74,7 @@ iceberg_sources = files( 'inspect/snapshots_table.cc', 'json_serde.cc', 'location_provider.cc', + 'logging/logger.cc', 'manifest/manifest_adapter.cc', 'manifest/manifest_entry.cc', 'manifest/manifest_filter_manager.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index c8c815797..bf00c91ac 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -102,7 +102,7 @@ add_iceberg_test(table_test table_test.cc table_update_test.cc) -add_iceberg_test(logging_test SOURCES log_level_test.cc) +add_iceberg_test(logging_test SOURCES log_level_test.cc logger_test.cc) add_iceberg_test(expression_test SOURCES diff --git a/src/iceberg/test/logger_test.cc b/src/iceberg/test/logger_test.cc new file mode 100644 index 000000000..81d8e7f9b --- /dev/null +++ b/src/iceberg/test/logger_test.cc @@ -0,0 +1,450 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/logging/logger.h" + +#include +#include +#include +#include +#include + +#include + +#include "iceberg/logging/log_level.h" +#include "iceberg/test/logging_test_helpers.h" +#include "iceberg/test/matchers.h" + +namespace iceberg { + +TEST(LoggerTest, NoopIsSharedImmortalAndSilent) { + auto noop = Logger::Noop(); + ASSERT_NE(noop, nullptr); + EXPECT_TRUE(noop->IsNoop()); + EXPECT_FALSE(noop->ShouldLog(LogLevel::kFatal)); + EXPECT_EQ(noop->level(), LogLevel::kOff); + // Same singleton instance every call. + EXPECT_EQ(noop.get(), Logger::Noop().get()); +} + +TEST(LoggerTest, DefaultLoggerIsNeverNull) { EXPECT_NE(GetDefaultLogger(), nullptr); } + +TEST(LoggerTest, SetAndGetDefaultLogger) { + auto capturing = std::make_shared(); + ScopedDefaultLogger guard(capturing); + EXPECT_EQ(GetDefaultLogger().get(), capturing.get()); + EXPECT_EQ(internal::CurrentLogger().get(), capturing.get()); +} + +TEST(LoggerTest, SetNullFallsBackToNoop) { + ScopedDefaultLogger guard(std::make_shared()); + SetDefaultLogger(nullptr); + EXPECT_TRUE(GetDefaultLogger()->IsNoop()); +} + +TEST(LoggerTest, CurrentLoggerTracksSwaps) { + auto first = std::make_shared(); + auto second = std::make_shared(); + ScopedDefaultLogger guard(first); + EXPECT_EQ(internal::CurrentLogger().get(), first.get()); + SetDefaultLogger(second); + // Generation bump must invalidate the thread-local cache. + EXPECT_EQ(internal::CurrentLogger().get(), second.get()); +} + +TEST(LoggerTest, SetDefaultLevelUpdatesLogger) { + auto capturing = std::make_shared(); + ScopedDefaultLogger guard(capturing); + SetDefaultLevel(LogLevel::kError); + EXPECT_EQ(capturing->level(), LogLevel::kError); +} + +// Filtering is decided by the logger's own ShouldLog (no separate cached gate), +// so lowering a logger's level out-of-band (not via SetDefaultLevel) takes effect +// immediately -- this is the regression guard for the dropped g_effective_level gate. +TEST(LoggerTest, OutOfBandLevelLoweringTakesEffect) { + auto capturing = std::make_shared(); + capturing->SetLevel(LogLevel::kError); + ScopedDefaultLogger guard(capturing); + EXPECT_FALSE(internal::CurrentLogger()->ShouldLog(LogLevel::kInfo)); + capturing->SetLevel(LogLevel::kTrace); // lowered directly on the handle + EXPECT_TRUE(internal::CurrentLogger()->ShouldLog(LogLevel::kInfo)); +} + +TEST(LoggerTest, ConcurrentSwapAndReadIsSafe) { + // Stress CurrentLogger()/GetDefaultLogger() against SetDefaultLogger() swaps. + // Run under TSan in CI; here it asserts no crash and a valid logger throughout. + auto a = std::make_shared(); + auto b = std::make_shared(); + ScopedDefaultLogger guard(a); + std::atomic stop{false}; + std::atomic saw_null{false}; + std::vector readers; + for (int i = 0; i < 6; ++i) { + readers.emplace_back([&stop, &saw_null] { + // ASSERT_* doesn't propagate from non-main threads; record via a flag. + while (!stop.load(std::memory_order_relaxed)) { + const auto& l = internal::CurrentLogger(); + if (!l) saw_null.store(true, std::memory_order_relaxed); + std::ignore = l->ShouldLog(LogLevel::kError); + std::ignore = GetDefaultLogger(); + } + }); + } + for (int i = 0; i < 2000; ++i) SetDefaultLogger((i & 1) ? a : b); + stop.store(true, std::memory_order_relaxed); + for (auto& t : readers) t.join(); + EXPECT_FALSE(saw_null.load()); // CurrentLogger() is never null across swaps +} + +TEST(LoggerTest, InitializeAppliesLevelProperty) { + CapturingLogger logger; + auto status = logger.Initialize({{std::string(kLevelProperty), std::string("error")}}); + ASSERT_TRUE(status.has_value()); + EXPECT_EQ(logger.level(), LogLevel::kError); +} + +TEST(LoggerTest, InitializeRejectsInvalidLevel) { + CapturingLogger logger; + auto status = + logger.Initialize({{std::string(kLevelProperty), std::string("not-a-level")}}); + ASSERT_FALSE(status.has_value()); + EXPECT_THAT(status, IsError(ErrorKind::kInvalidArgument)); +} + +// Logging during thread teardown (from a thread_local destructor) must not crash. +// The per-thread cache is freed at thread exit, but CurrentLogger()'s teardown +// guard (a trivially-destructible "dead" flag whose storage outlives every +// thread_local) makes it safe even when the logging statement runs from a +// thread_local destroyed AFTER the cache -- the hard case. Probe is constructed +// before CurrentLogger() is first touched, so it is destroyed last. Run under +// ASan/TSan in CI for full signal. +TEST(LoggerTest, LoggingFromThreadLocalDestructorIsSafe) { + std::thread([] { + struct Probe { + ~Probe() { + const auto& logger = internal::CurrentLogger(); + if (logger) { + internal::Emit(*logger, LogLevel::kInfo, std::source_location::current(), + "from thread_local dtor"); + } + } + }; + static thread_local Probe probe; + std::ignore = probe; // construct Probe first ... + std::ignore = + internal::CurrentLogger(); // ... then the logger cache (destroyed first) + }).join(); + SUCCEED(); +} + +// Teardown interleaved with concurrent default-logger swaps: many short-lived +// threads each log from a thread_local destructor while another thread swaps the +// default logger. Exercises the per-thread cache being freed at thread exit at +// the same time the global slot is mutated. Run under ASan/TSan in CI. +TEST(LoggerTest, ConcurrentTeardownAndSwapIsSafe) { + auto a = std::make_shared(); + ScopedDefaultLogger guard(a); + std::atomic stop{false}; + std::thread swapper([&] { + auto b = std::make_shared(); + while (!stop.load(std::memory_order_relaxed)) { + SetDefaultLogger(b); + SetDefaultLogger(a); + } + }); + for (int i = 0; i < 100; ++i) { + std::thread worker([] { + struct Probe { + ~Probe() { + const auto& l = internal::CurrentLogger(); + if (l) l->ShouldLog(LogLevel::kError); + } + }; + static thread_local Probe probe; + std::ignore = probe; // constructed before the cache + std::ignore = internal::CurrentLogger(); // touch the cache in normal code + }); + worker.join(); // teardown runs concurrently with the swapper + } + stop.store(true, std::memory_order_relaxed); + swapper.join(); + SUCCEED(); +} + +// --- Per-context routing: ScopedLogger + GetCurrentLogger --- + +TEST(LoggerTest, ScopedLoggerOverridesDefaultPath) { + auto global = std::make_shared(); + auto scoped = std::make_shared(); + ScopedDefaultLogger guard(global); + { + ScopedLogger bind(scoped); + EXPECT_EQ(internal::CurrentLogger().get(), scoped.get()); + Log(LogLevel::kInfo, "hi {}", 1); + } + EXPECT_EQ(scoped->count(), 1u); + EXPECT_EQ(global->count(), 0u); +} + +TEST(LoggerTest, ScopedLoggerRestoresOnScopeExit) { + auto global = std::make_shared(); + auto scoped = std::make_shared(); + ScopedDefaultLogger guard(global); + { + ScopedLogger bind(scoped); + } + EXPECT_EQ(internal::CurrentLogger().get(), global.get()); + Log(LogLevel::kInfo, "back"); + EXPECT_EQ(global->count(), 1u); + EXPECT_EQ(scoped->count(), 0u); +} + +TEST(LoggerTest, ExplicitLoggerBypassesOverride) { + auto scoped = std::make_shared(); + auto explicit_sink = std::make_shared(); + ScopedDefaultLogger guard(std::make_shared()); + ScopedLogger bind(scoped); + Log(*explicit_sink, LogLevel::kInfo, "e {}", 1); + EXPECT_EQ(explicit_sink->count(), 1u); + EXPECT_EQ(scoped->count(), 0u); +} + +TEST(LoggerTest, NestedScopedLoggersRestoreInLifo) { + auto global = std::make_shared(); + auto x = std::make_shared(); + auto y = std::make_shared(); + ScopedDefaultLogger guard(global); + { + ScopedLogger a(x); + EXPECT_EQ(internal::CurrentLogger().get(), x.get()); + { + ScopedLogger b(y); + EXPECT_EQ(internal::CurrentLogger().get(), y.get()); + } + EXPECT_EQ(internal::CurrentLogger().get(), x.get()); + } + EXPECT_EQ(internal::CurrentLogger().get(), global.get()); +} + +TEST(LoggerTest, ScopedLoggerNullMasksToGlobalDefault) { + auto global = std::make_shared(); + auto x = std::make_shared(); + ScopedDefaultLogger guard(global); + ScopedLogger a(x); + { + ScopedLogger mask(nullptr); + EXPECT_EQ(internal::CurrentLogger().get(), global.get()); // not x, not Noop + EXPECT_FALSE(internal::CurrentLogger()->IsNoop()); + } + EXPECT_EQ(internal::CurrentLogger().get(), x.get()); // enclosing binding restored +} + +TEST(LoggerTest, GetCurrentLoggerReturnsOverrideThenDefault) { + auto global = std::make_shared(); + auto scoped = std::make_shared(); + ScopedDefaultLogger guard(global); + EXPECT_EQ(GetCurrentLogger().get(), global.get()); + { + ScopedLogger bind(scoped); + EXPECT_EQ(GetCurrentLogger().get(), scoped.get()); + } + EXPECT_EQ(GetCurrentLogger().get(), global.get()); +} + +TEST(LoggerTest, GetCurrentLoggerOnFreshThreadReturnsDefault) { + auto global = std::make_shared(); + ScopedDefaultLogger guard(global); + Logger* seen = nullptr; + std::thread([&] { seen = GetCurrentLogger().get(); }).join(); // never used a scope + EXPECT_EQ(seen, global.get()); +} + +TEST(LoggerTest, ThreadPoolPropagationPattern) { + auto global = std::make_shared(); + auto scoped = std::make_shared(); + ScopedDefaultLogger guard(global); + ScopedLogger bind(scoped); + auto captured = GetCurrentLogger(); // capture the effective logger at "submit" + EXPECT_EQ(captured.get(), scoped.get()); + std::thread([captured] { + ScopedLogger rebind(captured); // re-bind on the worker thread + Log(LogLevel::kInfo, "task {}", 7); + }).join(); + EXPECT_EQ(scoped->count(), 1u); + EXPECT_EQ(global->count(), 0u); +} + +TEST(LoggerTest, WorkerOverrideDoesNotLeakAcrossTasksOnReusedThread) { + auto global = std::make_shared(); + auto o1 = std::make_shared(); + ScopedDefaultLogger guard(global); + Logger* during = nullptr; + Logger* between = nullptr; + std::thread([&] { + { + ScopedLogger b1(o1); + during = GetCurrentLogger().get(); + } + between = GetCurrentLogger().get(); // no scope active -> global default + }).join(); + EXPECT_EQ(during, o1.get()); + EXPECT_EQ(between, global.get()); +} + +// Binding/unbinding a ScopedLogger from a thread_local destructor that runs after +// the per-thread cache was freed (Probe constructed before CurrentLogger is first +// touched) must no-op against the dead cache, never touch freed memory. Run under +// ASan/TSan in CI for full signal. +TEST(LoggerTest, ScopedLoggerBindUnbindDuringTeardownIsSafe) { + std::thread([] { + struct Probe { + ~Probe() { + ScopedLogger late(std::make_shared()); // ctor: no-op on dead + const auto& l = internal::CurrentLogger(); // -> Noop fallback + if (l) l->ShouldLog(LogLevel::kError); + } // ~ScopedLogger: restore is a no-op on dead + }; + static thread_local Probe probe; + std::ignore = probe; // constructed first + std::ignore = internal::CurrentLogger(); // cache created after -> freed first + }).join(); + SUCCEED(); +} + +// The override path deliberately skips the generation refresh, but a swap that +// happened while an override was active must still be observed on the first call +// after the override is popped (gen is monotonic). +TEST(LoggerTest, OverrideActiveSkipsGenRefreshButSwapStillSeenAfterPop) { + auto a = std::make_shared(); + auto b = std::make_shared(); + auto c = std::make_shared(); + ScopedDefaultLogger guard(a); + EXPECT_EQ(internal::CurrentLogger().get(), a.get()); + { + ScopedLogger bind(b); + SetDefaultLogger(c); // bump gen while the override is active + EXPECT_EQ(internal::CurrentLogger().get(), b.get()); // override wins + } + EXPECT_EQ(internal::CurrentLogger().get(), c.get()); // swap seen after pop +} + +// Many short-lived threads each bind a ScopedLogger and tear down while another +// thread swaps the global default. Run under ASan/TSan in CI. +TEST(LoggerTest, ConcurrentOverrideTeardownAndSwapIsSafe) { + auto a = std::make_shared(); + ScopedDefaultLogger guard(a); + std::atomic stop{false}; + std::thread swapper([&] { + auto b = std::make_shared(); + while (!stop.load(std::memory_order_relaxed)) { + SetDefaultLogger(b); + SetDefaultLogger(a); + } + }); + for (int i = 0; i < 100; ++i) { + std::thread worker([] { + auto local = std::make_shared(); + ScopedLogger bind(local); + const auto& l = internal::CurrentLogger(); + if (l) l->ShouldLog(LogLevel::kError); + }); + worker.join(); + } + stop.store(true, std::memory_order_relaxed); + swapper.join(); + SUCCEED(); +} + +// --- Function-style API (non-macro): overloaded Log() --- + +TEST(LoggerTest, LogToExplicitLoggerFormats) { + auto sink = std::make_shared(); + Log(*sink, LogLevel::kInfo, "x={} y={}", 1, 2); + auto records = sink->records(); + ASSERT_EQ(records.size(), 1u); + EXPECT_EQ(records[0].level, LogLevel::kInfo); + EXPECT_EQ(records[0].message, "x=1 y=2"); + EXPECT_NE(records[0].location.line(), 0u); // call-site location captured +} + +TEST(LoggerTest, LogRespectsLevelAndDoesNotFormatWhenDisabled) { + auto sink = std::make_shared(); + sink->SetLevel(LogLevel::kError); + Log(*sink, LogLevel::kInfo, "dropped {}", 1); + EXPECT_EQ(sink->count(), 0u); +} + +TEST(LoggerTest, LogToDefaultLoggerFormatStyle) { + auto sink = std::make_shared(); + ScopedDefaultLogger guard(sink); + Log(LogLevel::kWarn, "v={}", 7); + auto records = sink->records(); + ASSERT_EQ(records.size(), 1u); + EXPECT_EQ(records[0].level, LogLevel::kWarn); + EXPECT_EQ(records[0].message, "v=7"); +} + +// --- LogMessage::Builder (structured attributes) --- + +TEST(LoggerTest, BuilderAssemblesMessageAndAttributes) { + auto record = LogMessage::Builder(LogLevel::kInfo) + .Message("scan finished") + .Attribute("table", "db.t") + .Attribute("snapshot_id", "42") + .Build(); + EXPECT_EQ(record.level, LogLevel::kInfo); + EXPECT_EQ(record.message, "scan finished"); + ASSERT_EQ(record.attributes.size(), 2u); + EXPECT_EQ(record.attributes[0].key, "table"); + EXPECT_EQ(record.attributes[0].value, "db.t"); + EXPECT_EQ(record.attributes[1].key, "snapshot_id"); + EXPECT_EQ(record.attributes[1].value, "42"); +} + +TEST(LoggerTest, BuilderDefaultsAndEmitToSink) { + auto sink = std::make_shared(); + sink->Log(LogMessage::Builder(LogLevel::kError).Message("boom").Build()); + auto records = sink->records(); + ASSERT_EQ(records.size(), 1u); + EXPECT_EQ(records[0].level, LogLevel::kError); + EXPECT_EQ(records[0].message, "boom"); + EXPECT_TRUE(records[0].attributes.empty()); + EXPECT_NE(records[0].location.line(), 0u); // location defaulted at build site +} + +// The constructor captures source_location as a default argument, so without +// Location() the default is the caller's construction site (this file), not +// logger.h. The Builder is constructed exactly one line below `here`. +TEST(LoggerTest, BuilderDefaultLocationIsCallerSite) { + auto here = std::source_location::current(); + auto record = LogMessage::Builder(LogLevel::kInfo).Message("m").Build(); + EXPECT_STREQ(record.location.file_name(), here.file_name()); + EXPECT_EQ(record.location.line(), here.line() + 1); +} + +// Location() replaces the constructor default with the caller's site (file + line). +TEST(LoggerTest, BuilderLocationOverrideUsesCallerSite) { + auto caller = std::source_location::current(); + auto record = LogMessage::Builder(LogLevel::kDebug).Location(caller).Build(); + EXPECT_EQ(record.location.line(), caller.line()); + EXPECT_STREQ(record.location.file_name(), caller.file_name()); +} + +} // namespace iceberg diff --git a/src/iceberg/test/logging_test_helpers.h b/src/iceberg/test/logging_test_helpers.h new file mode 100644 index 000000000..f3999195e --- /dev/null +++ b/src/iceberg/test/logging_test_helpers.h @@ -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. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "iceberg/logging/logger.h" + +namespace iceberg { + +/// \brief Test sink that records every emitted LogMessage under a mutex. +class CapturingLogger : public Logger { + public: + bool ShouldLog(LogLevel level) const noexcept override { + return level >= level_.load(std::memory_order_relaxed); + } + + void Log(LogMessage&& message) noexcept override { + std::lock_guard lock(mutex_); + records_.push_back(std::move(message)); + } + + void SetLevel(LogLevel level) noexcept override { + level_.store(level, std::memory_order_relaxed); + } + LogLevel level() const noexcept override { + return level_.load(std::memory_order_relaxed); + } + + std::vector records() const { + std::lock_guard lock(mutex_); + return records_; + } + + std::size_t count() const { + std::lock_guard lock(mutex_); + return records_.size(); + } + + private: + mutable std::mutex mutex_; + std::atomic level_ = LogLevel::kTrace; + std::vector records_; +}; + +/// \brief RAII guard that restores the process default logger on scope exit, so +/// tests that swap the global default don't leak state into other tests. +class ScopedDefaultLogger { + public: + explicit ScopedDefaultLogger(std::shared_ptr logger) + : previous_(GetDefaultLogger()) { + SetDefaultLogger(std::move(logger)); + } + ~ScopedDefaultLogger() { SetDefaultLogger(previous_); } + + ScopedDefaultLogger(const ScopedDefaultLogger&) = delete; + ScopedDefaultLogger& operator=(const ScopedDefaultLogger&) = delete; + + private: + std::shared_ptr previous_; +}; + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index a17d9841a..6f9c4c31b 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -61,7 +61,7 @@ iceberg_tests = { 'table_update_test.cc', ), }, - 'logging_test': {'sources': files('log_level_test.cc')}, + 'logging_test': {'sources': files('log_level_test.cc', 'logger_test.cc')}, 'expression_test': { 'sources': files( 'aggregate_test.cc', From 0aff5e99c7f696d476e92face67d1dba34369e84 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 22 Jun 2026 04:28:29 -0500 Subject: [PATCH 110/151] ci: cache vcpkg packages on Windows builds (#766) ## What Cache the installed vcpkg packages on the Windows builds in `test` and `sql_catalog_test`, and skip the install step when the cache is present. ## Why Every Windows run reinstalls the same packages (zlib, nlohmann-json, nanoarrow, roaring, plus cpr / sqlite3) from scratch, costing a couple of minutes each time. Caching them removes that on every run after the first. This matches what `aws_test` already does. ## Validation A warm run reused the cached packages and skipped the install. The cache only rebuilds when the package list changes. Co-authored-by: Abanoub Doss --- .github/workflows/sql_catalog_test.yml | 9 ++++++++- .github/workflows/test.yml | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index cc95169af..79c6328b5 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -80,8 +80,15 @@ jobs: run: | echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV - - name: Install dependencies on Windows + - name: Cache vcpkg packages if: ${{ startsWith(matrix.runs-on, 'windows') }} + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + id: vcpkg-cache + with: + path: C:/vcpkg/installed + key: vcpkg-x64-windows-sql-catalog-${{ hashFiles('.github/workflows/sql_catalog_test.yml') }} + - name: Install dependencies on Windows + if: ${{ startsWith(matrix.runs-on, 'windows') && steps.vcpkg-cache.outputs.cache-hit != 'true' }} shell: pwsh run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows sqlite3:x64-windows diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 652999f61..6f420bde5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,7 +99,14 @@ jobs: uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: arch: x64 + - name: Cache vcpkg packages + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + id: vcpkg-cache + with: + path: C:/vcpkg/installed + key: vcpkg-x64-windows-test-${{ hashFiles('.github/workflows/test.yml') }} - name: Install dependencies + if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }} shell: pwsh run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows From 42b498f60c02314fbca02d3c97ae4f5c787b3fc5 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 22 Jun 2026 04:38:21 -0500 Subject: [PATCH 111/151] ci: cancel superseded runs in remaining workflows (#767) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What Add a concurrency block to the five workflows that don't have one — `cpp-linter`, `pre-commit`, `license_check`, `zizmor`, and `codeql`: ```yaml concurrency: group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} cancel-in-progress: true ``` ## Why The heavier workflows already cancel outdated runs, but these five don't - so pushing again to a PR leaves the old runs going and tying up runners. Grouping on `head_ref || sha` cancels superseded PR runs while leaving `main` and scheduled runs untouched. Co-authored-by: Abanoub Doss --- .github/workflows/codeql.yml | 4 ++++ .github/workflows/cpp-linter.yml | 4 ++++ .github/workflows/license_check.yml | 4 ++++ .github/workflows/pre-commit.yml | 4 ++++ .github/workflows/zizmor.yml | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 98090e34d..ae771aea4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,6 +28,10 @@ on: schedule: - cron: '16 4 * * 1' +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 834ade883..377e806ad 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -27,6 +27,10 @@ on: branches: - main +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + jobs: cpp-linter: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 361314812..ea037f1a3 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -21,6 +21,10 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review] +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d8a06a108..413eee866 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -25,6 +25,10 @@ on: - '**' - '!dependabot/**' +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + permissions: contents: write diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 5265d6f04..f6665ffae 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -26,6 +26,10 @@ on: types: [opened, synchronize, reopened, ready_for_review] branches: ["**"] +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + permissions: {} jobs: From 7fe2e93ed1d34a583098ce29e03b4a7851f213cc Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Tue, 23 Jun 2026 07:08:16 +0900 Subject: [PATCH 112/151] CI: Check ASF action allowlist on every PR (#772) Relates to: * https://github.com/apache/iceberg/issues/16934 * https://github.com/apache/iceberg/pull/16926 --- .github/workflows/asf-allowlist-check.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 85ee0f463..202852115 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -26,13 +26,9 @@ name: "ASF Allowlist Check" on: pull_request: types: [opened, synchronize, reopened, ready_for_review] - paths: - - ".github/**" push: branches: - main - paths: - - ".github/**" permissions: contents: read From 5c8c4e5d024ab72c1486a8d5ad32d67431dff894 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 23 Jun 2026 11:59:08 +0800 Subject: [PATCH 113/151] fix(rest): align error handlers with Java implementation (#763) While reviewing #614, I noticed that `PlanErrorHandler::Accept` does not match the behavior of the Java implementation. A detailed comparison with Java's `ErrorHandlers` revealed several gaps between iceberg-cpp and Iceberg Java. Some of these are oversights in the original implementation, while others correspond to improvements that were made later in Iceberg Java, including: * https://github.com/apache/iceberg/pull/13143 * https://github.com/apache/iceberg/pull/14927 * https://github.com/apache/iceberg/pull/15051 * https://github.com/apache/iceberg/pull/16059 This PR closes those gaps and brings the error handling behavior in iceberg-cpp closer to the Java implementation. --- src/iceberg/catalog/rest/auth/oauth2_util.cc | 2 +- src/iceberg/catalog/rest/error_handlers.cc | 157 ++++++++-- src/iceberg/catalog/rest/error_handlers.h | 67 ++++- src/iceberg/catalog/rest/http_client.cc | 16 +- src/iceberg/catalog/rest/rest_catalog.cc | 14 +- src/iceberg/result.h | 2 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/error_handlers_test.cc | 285 +++++++++++++++++++ src/iceberg/test/meson.build | 1 + 9 files changed, 488 insertions(+), 57 deletions(-) create mode 100644 src/iceberg/test/error_handlers_test.cc diff --git a/src/iceberg/catalog/rest/auth/oauth2_util.cc b/src/iceberg/catalog/rest/auth/oauth2_util.cc index 692ef47f3..d5e94821c 100644 --- a/src/iceberg/catalog/rest/auth/oauth2_util.cc +++ b/src/iceberg/catalog/rest/auth/oauth2_util.cc @@ -66,7 +66,7 @@ Result FetchToken(HttpClient& client, AuthSession& session, ICEBERG_ASSIGN_OR_RAISE( auto response, client.PostForm(properties.oauth2_server_uri(), form_data, - /*headers=*/{}, *DefaultErrorHandler::Instance(), session)); + /*headers=*/{}, *OAuthErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto token_response, FromJson(json)); diff --git a/src/iceberg/catalog/rest/error_handlers.cc b/src/iceberg/catalog/rest/error_handlers.cc index 67146e745..78696a49b 100644 --- a/src/iceberg/catalog/rest/error_handlers.cc +++ b/src/iceberg/catalog/rest/error_handlers.cc @@ -21,7 +21,11 @@ #include +#include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/types.h" +#include "iceberg/json_serde_internal.h" +#include "iceberg/util/json_util_internal.h" +#include "iceberg/util/macros.h" namespace iceberg::rest { @@ -31,8 +35,29 @@ constexpr std::string_view kIllegalArgumentException = "IllegalArgumentException constexpr std::string_view kNoSuchNamespaceException = "NoSuchNamespaceException"; constexpr std::string_view kNamespaceNotEmptyException = "NamespaceNotEmptyException"; constexpr std::string_view kNoSuchTableException = "NoSuchTableException"; -constexpr std::string_view kNoSuchPlanIdException = "NoSuchPlanIdException"; -constexpr std::string_view kNoSuchPlanTaskException = "NoSuchPlanTaskException"; +constexpr std::string_view kNotFoundException = "NotFoundException"; +constexpr std::string_view kRestException = "RESTException"; +constexpr std::string_view kInvalidClient = "invalid_client"; +constexpr std::string_view kInvalidRequest = "invalid_request"; +constexpr std::string_view kInvalidGrant = "invalid_grant"; +constexpr std::string_view kUnauthorizedClient = "unauthorized_client"; +constexpr std::string_view kUnsupportedGrantType = "unsupported_grant_type"; +constexpr std::string_view kInvalidScope = "invalid_scope"; +constexpr std::string_view kNull = "null"; +constexpr std::string_view kOAuthError = "error"; +constexpr std::string_view kOAuthErrorDescription = "error_description"; + +std::string_view NullIfEmpty(const std::string& value) { + if (value.empty()) { + return kNull; + } + return value; +} + +Status CreateRestError(const ErrorResponse& error) { + return RestError("Unable to process (code: {}, type: {}): {}", error.code, + NullIfEmpty(error.type), NullIfEmpty(error.message)); +} } // namespace @@ -63,7 +88,17 @@ Status DefaultErrorHandler::Accept(const ErrorResponse& error) const { return ServiceUnavailable("Service unavailable: {}", error.message); } - return RestError("Code: {}, message: {}", error.code, error.message); + return CreateRestError(error); +} + +Result DefaultErrorHandler::ParseResponse(uint32_t /*code*/, + const std::string& text) const { + if (text.empty()) { + return InvalidArgument("Empty response body"); + } + ICEBERG_ASSIGN_OR_RAISE(auto json_result, FromJsonString(text)); + ICEBERG_ASSIGN_OR_RAISE(auto error_result, ErrorResponseFromJson(json_result)); + return error_result; } const std::shared_ptr& NamespaceErrorHandler::Instance() { @@ -84,7 +119,7 @@ Status NamespaceErrorHandler::Accept(const ErrorResponse& error) const { case 409: return AlreadyExists(error.message); case 422: - return RestError("Unable to process: {}", error.message); + return CreateRestError(error); } return DefaultErrorHandler::Accept(error); @@ -104,37 +139,34 @@ Status DropNamespaceErrorHandler::Accept(const ErrorResponse& error) const { return NamespaceErrorHandler::Accept(error); } -const std::shared_ptr& TableErrorHandler::Instance() { - static const std::shared_ptr instance{new TableErrorHandler()}; +const std::shared_ptr& ConfigErrorHandler::Instance() { + static const std::shared_ptr instance{new ConfigErrorHandler()}; return instance; } -Status TableErrorHandler::Accept(const ErrorResponse& error) const { - switch (error.code) { - case 404: - if (error.type == kNoSuchNamespaceException) { - return NoSuchNamespace(error.message); - } - return NoSuchTable(error.message); - case 409: - return AlreadyExists(error.message); +Status ConfigErrorHandler::Accept(const ErrorResponse& error) const { + if (error.code == 404 && !error.type.empty() && error.type != kRestException) { + return NoSuchWarehouse(error.message); } return DefaultErrorHandler::Accept(error); } -const std::shared_ptr& ViewErrorHandler::Instance() { - static const std::shared_ptr instance{new ViewErrorHandler()}; +const std::shared_ptr& TableErrorHandler::Instance() { + static const std::shared_ptr instance{new TableErrorHandler()}; return instance; } -Status ViewErrorHandler::Accept(const ErrorResponse& error) const { +Status TableErrorHandler::Accept(const ErrorResponse& error) const { switch (error.code) { case 404: if (error.type == kNoSuchNamespaceException) { return NoSuchNamespace(error.message); } - return NoSuchView(error.message); + if (error.type == kNotFoundException) { + return NotFound(error.message); + } + return NoSuchTable(error.message); case 409: return AlreadyExists(error.message); } @@ -164,6 +196,23 @@ Status TableCommitErrorHandler::Accept(const ErrorResponse& error) const { return DefaultErrorHandler::Accept(error); } +const std::shared_ptr& CreateTableErrorHandler::Instance() { + static const std::shared_ptr instance{ + new CreateTableErrorHandler()}; + return instance; +} + +Status CreateTableErrorHandler::Accept(const ErrorResponse& error) const { + switch (error.code) { + case 404: + return NoSuchNamespace(error.message); + case 409: + return AlreadyExists(error.message); + } + + return TableCommitErrorHandler::Accept(error); +} + const std::shared_ptr& ViewCommitErrorHandler::Instance() { static const std::shared_ptr instance{ new ViewCommitErrorHandler()}; @@ -186,6 +235,25 @@ Status ViewCommitErrorHandler::Accept(const ErrorResponse& error) const { return DefaultErrorHandler::Accept(error); } +const std::shared_ptr& ViewErrorHandler::Instance() { + static const std::shared_ptr instance{new ViewErrorHandler()}; + return instance; +} + +Status ViewErrorHandler::Accept(const ErrorResponse& error) const { + switch (error.code) { + case 404: + if (error.type == kNoSuchNamespaceException) { + return NoSuchNamespace(error.message); + } + return NoSuchView(error.message); + case 409: + return AlreadyExists(error.message); + } + + return DefaultErrorHandler::Accept(error); +} + const std::shared_ptr& PlanErrorHandler::Instance() { static const std::shared_ptr instance{new PlanErrorHandler()}; return instance; @@ -200,12 +268,7 @@ Status PlanErrorHandler::Accept(const ErrorResponse& error) const { if (error.type == kNoSuchTableException) { return NoSuchTable(error.message); } - if (error.type == kNoSuchPlanIdException) { - return NoSuchPlanId(error.message); - } - return NotFound(error.message); - case 406: - return NotSupported(error.message); + return NoSuchPlanId(error.message); } return DefaultErrorHandler::Accept(error); @@ -225,13 +288,49 @@ Status PlanTaskErrorHandler::Accept(const ErrorResponse& error) const { if (error.type == kNoSuchTableException) { return NoSuchTable(error.message); } - if (error.type == kNoSuchPlanTaskException) { - return NoSuchPlanTask(error.message); - } - return NotFound(error.message); + return NoSuchPlanTask(error.message); } return DefaultErrorHandler::Accept(error); } +const std::shared_ptr& OAuthErrorHandler::Instance() { + static const std::shared_ptr instance{new OAuthErrorHandler()}; + return instance; +} + +Status OAuthErrorHandler::Accept(const ErrorResponse& error) const { + if (!error.type.empty()) { + if (error.type == kInvalidClient) { + return NotAuthorized("Not authorized: {}: {}", error.type, + NullIfEmpty(error.message)); + } + if (error.type == kInvalidRequest || error.type == kInvalidGrant || + error.type == kUnauthorizedClient || error.type == kUnsupportedGrantType || + error.type == kInvalidScope) { + return BadRequest("Malformed request: {}: {}", error.type, + NullIfEmpty(error.message)); + } + } + + return CreateRestError(error); +} + +Result OAuthErrorHandler::ParseResponse(uint32_t code, + const std::string& text) const { + if (text.empty()) { + return InvalidArgument("Empty response body"); + } + + ICEBERG_ASSIGN_OR_RAISE(auto json_result, FromJsonString(text)); + + ErrorResponse error; + error.code = code; + ICEBERG_ASSIGN_OR_RAISE(error.type, + GetJsonValue(json_result, kOAuthError)); + ICEBERG_ASSIGN_OR_RAISE(error.message, GetJsonValueOrDefault( + json_result, kOAuthErrorDescription)); + return error; +} + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/error_handlers.h b/src/iceberg/catalog/rest/error_handlers.h index ee338fb3e..e77a0c71d 100644 --- a/src/iceberg/catalog/rest/error_handlers.h +++ b/src/iceberg/catalog/rest/error_handlers.h @@ -19,10 +19,12 @@ #pragma once +#include #include +#include #include "iceberg/catalog/rest/iceberg_rest_export.h" -#include "iceberg/catalog/rest/type_fwd.h" +#include "iceberg/catalog/rest/types.h" #include "iceberg/result.h" /// \file iceberg/catalog/rest/error_handlers.h @@ -41,6 +43,14 @@ class ICEBERG_REST_EXPORT ErrorHandler { /// \param error The error response parsed from the HTTP response body /// \return An Error object with appropriate ErrorKind and message virtual Status Accept(const ErrorResponse& error) const = 0; + + /// \brief Parse an HTTP error response body. + /// + /// \param code The HTTP status code from the failed response + /// \param text The HTTP response body + /// \return The parsed error response + virtual Result ParseResponse(uint32_t code, + const std::string& text) const = 0; }; /// \brief Default error handler for REST API responses. @@ -50,6 +60,8 @@ class ICEBERG_REST_EXPORT DefaultErrorHandler : public ErrorHandler { static const std::shared_ptr& Instance(); Status Accept(const ErrorResponse& error) const override; + Result ParseResponse(uint32_t code, + const std::string& text) const override; protected: constexpr DefaultErrorHandler() = default; @@ -79,6 +91,18 @@ class ICEBERG_REST_EXPORT DropNamespaceErrorHandler final : public NamespaceErro constexpr DropNamespaceErrorHandler() = default; }; +/// \brief Error handler for the catalog config endpoint. +class ICEBERG_REST_EXPORT ConfigErrorHandler final : public DefaultErrorHandler { + public: + /// \brief Returns the singleton instance + static const std::shared_ptr& Instance(); + + Status Accept(const ErrorResponse& error) const override; + + private: + constexpr ConfigErrorHandler() = default; +}; + /// \brief Table-level error handler. class ICEBERG_REST_EXPORT TableErrorHandler final : public DefaultErrorHandler { public: @@ -91,28 +115,40 @@ class ICEBERG_REST_EXPORT TableErrorHandler final : public DefaultErrorHandler { constexpr TableErrorHandler() = default; }; -/// \brief View-level error handler. -class ICEBERG_REST_EXPORT ViewErrorHandler final : public DefaultErrorHandler { +/// \brief Table commit operation error handler. +class ICEBERG_REST_EXPORT TableCommitErrorHandler : public DefaultErrorHandler { public: /// \brief Returns the singleton instance - static const std::shared_ptr& Instance(); + static const std::shared_ptr& Instance(); + + Status Accept(const ErrorResponse& error) const override; + + protected: + constexpr TableCommitErrorHandler() = default; +}; + +/// \brief Table create commit operation error handler. +class ICEBERG_REST_EXPORT CreateTableErrorHandler final : public TableCommitErrorHandler { + public: + /// \brief Returns the singleton instance + static const std::shared_ptr& Instance(); Status Accept(const ErrorResponse& error) const override; private: - constexpr ViewErrorHandler() = default; + constexpr CreateTableErrorHandler() = default; }; -/// \brief Table commit operation error handler. -class ICEBERG_REST_EXPORT TableCommitErrorHandler final : public DefaultErrorHandler { +/// \brief View-level error handler. +class ICEBERG_REST_EXPORT ViewErrorHandler final : public DefaultErrorHandler { public: /// \brief Returns the singleton instance - static const std::shared_ptr& Instance(); + static const std::shared_ptr& Instance(); Status Accept(const ErrorResponse& error) const override; private: - constexpr TableCommitErrorHandler() = default; + constexpr ViewErrorHandler() = default; }; /// \brief View commit operation error handler. @@ -149,4 +185,17 @@ class ICEBERG_REST_EXPORT PlanTaskErrorHandler final : public DefaultErrorHandle constexpr PlanTaskErrorHandler() = default; }; +/// \brief OAuth token endpoint error handler. +class ICEBERG_REST_EXPORT OAuthErrorHandler final : public ErrorHandler { + public: + static const std::shared_ptr& Instance(); + + Status Accept(const ErrorResponse& error) const override; + Result ParseResponse(uint32_t code, + const std::string& text) const override; + + private: + constexpr OAuthErrorHandler() = default; +}; + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/http_client.cc b/src/iceberg/catalog/rest/http_client.cc index 609116eb8..6661c5098 100644 --- a/src/iceberg/catalog/rest/http_client.cc +++ b/src/iceberg/catalog/rest/http_client.cc @@ -22,14 +22,11 @@ #include #include -#include #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/constant.h" #include "iceberg/catalog/rest/error_handlers.h" -#include "iceberg/catalog/rest/json_serde_internal.h" #include "iceberg/catalog/rest/rest_util.h" -#include "iceberg/json_serde_internal.h" #include "iceberg/result.h" #include "iceberg/util/macros.h" @@ -141,23 +138,14 @@ ErrorResponse BuildDefaultErrorResponse(const cpr::Response& response) { }; } -/// \brief Tries to parse the response body as an ErrorResponse. -Result TryParseErrorResponse(const std::string& text) { - if (text.empty()) { - return InvalidArgument("Empty response body"); - } - ICEBERG_ASSIGN_OR_RAISE(auto json_result, FromJsonString(text)); - ICEBERG_ASSIGN_OR_RAISE(auto error_result, ErrorResponseFromJson(json_result)); - return error_result; -} - /// \brief Handles failure responses by invoking the provided error handler. Status HandleFailureResponse(const cpr::Response& response, const ErrorHandler& error_handler) { if (IsSuccessful(response.status_code)) { return {}; } - auto parse_result = TryParseErrorResponse(response.text); + auto parse_result = error_handler.ParseResponse( + static_cast(response.status_code), response.text); const ErrorResponse final_error = parse_result.value_or(BuildDefaultErrorResponse(response)); return error_handler.Accept(final_error); diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 7c79b94d1..4cb4fd349 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -48,6 +48,7 @@ #include "iceberg/sort_order.h" #include "iceberg/table.h" #include "iceberg/table_requirement.h" +#include "iceberg/table_requirements.h" #include "iceberg/table_update.h" #include "iceberg/transaction.h" #include "iceberg/util/macros.h" @@ -89,7 +90,7 @@ Result FetchServerConfig(const ResourcePaths& paths, ICEBERG_ASSIGN_OR_RAISE(const auto response, client.Get(config_path, params, /*headers=*/{}, - *DefaultErrorHandler::Instance(), session)); + *ConfigErrorHandler::Instance(), session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); return CatalogConfigFromJson(json); } @@ -710,9 +711,14 @@ Result RestCatalog::UpdateTableInternal( } ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); - ICEBERG_ASSIGN_OR_RAISE(const auto response, - client_->Post(path, json_request, /*headers=*/{}, - *TableErrorHandler::Instance(), session)); + ICEBERG_ASSIGN_OR_RAISE(auto is_create, TableRequirements::IsCreate(requirements)); + const ErrorHandler* error_handler = TableCommitErrorHandler::Instance().get(); + if (is_create) { + error_handler = CreateTableErrorHandler::Instance().get(); + } + ICEBERG_ASSIGN_OR_RAISE( + const auto response, + client_->Post(path, json_request, /*headers=*/{}, *error_handler, session)); ICEBERG_ASSIGN_OR_RAISE(auto json, FromJsonString(response.body())); ICEBERG_ASSIGN_OR_RAISE(auto commit_response, CommitTableResponseFromJson(json)); diff --git a/src/iceberg/result.h b/src/iceberg/result.h index 70155db6a..8765f852a 100644 --- a/src/iceberg/result.h +++ b/src/iceberg/result.h @@ -53,6 +53,7 @@ enum class ErrorKind { kNoSuchPlanId, kNoSuchPlanTask, kNoSuchTable, + kNoSuchWarehouse, kNoSuchView, kNotAllowed, kNotAuthorized, @@ -118,6 +119,7 @@ DEFINE_ERROR_FUNCTION(NoSuchNamespace) DEFINE_ERROR_FUNCTION(NoSuchPlanId) DEFINE_ERROR_FUNCTION(NoSuchPlanTask) DEFINE_ERROR_FUNCTION(NoSuchTable) +DEFINE_ERROR_FUNCTION(NoSuchWarehouse) DEFINE_ERROR_FUNCTION(NoSuchView) DEFINE_ERROR_FUNCTION(NotAllowed) DEFINE_ERROR_FUNCTION(NotAuthorized) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index bf00c91ac..c681de8c9 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -291,6 +291,7 @@ if(ICEBERG_BUILD_REST) add_rest_iceberg_test(rest_catalog_test SOURCES auth_manager_test.cc + error_handlers_test.cc endpoint_test.cc rest_file_io_test.cc rest_json_serde_test.cc diff --git a/src/iceberg/test/error_handlers_test.cc b/src/iceberg/test/error_handlers_test.cc new file mode 100644 index 000000000..52b2f0da6 --- /dev/null +++ b/src/iceberg/test/error_handlers_test.cc @@ -0,0 +1,285 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/catalog/rest/error_handlers.h" + +#include + +#include + +#include "iceberg/catalog/rest/types.h" +#include "iceberg/test/matchers.h" + +namespace iceberg::rest { + +namespace { + +void ExpectErrorWithMessage(const Status& status, ErrorKind kind, + std::string_view message) { + ASSERT_FALSE(status.has_value()); + EXPECT_EQ(status.error().kind, kind); + EXPECT_EQ(status.error().message, message); +} + +} // namespace + +TEST(ErrorHandlersTest, DefaultErrorHandlerIncludesCodeAndType) { + ErrorResponse error{ + .code = 422, + .type = "ValidationException", + .message = "Invalid input", + }; + + ExpectErrorWithMessage( + DefaultErrorHandler::Instance()->Accept(error), ErrorKind::kRestError, + "Unable to process (code: 422, type: ValidationException): Invalid input"); +} + +TEST(ErrorHandlersTest, DefaultErrorHandlerWithCodeOnly) { + ErrorResponse error{ + .code = 422, + .type = "", + .message = "", + }; + + ExpectErrorWithMessage(DefaultErrorHandler::Instance()->Accept(error), + ErrorKind::kRestError, + "Unable to process (code: 422, type: null): null"); +} + +TEST(ErrorHandlersTest, DefaultErrorHandlerWithCodeAndMessageOnly) { + ErrorResponse error{ + .code = 422, + .type = "", + .message = "Invalid input", + }; + + ExpectErrorWithMessage(DefaultErrorHandler::Instance()->Accept(error), + ErrorKind::kRestError, + "Unable to process (code: 422, type: null): Invalid input"); +} + +TEST(ErrorHandlersTest, DefaultErrorHandlerWithCodeAndTypeOnly) { + ErrorResponse error{ + .code = 422, + .type = "ValidationException", + .message = "", + }; + + ExpectErrorWithMessage( + DefaultErrorHandler::Instance()->Accept(error), ErrorKind::kRestError, + "Unable to process (code: 422, type: ValidationException): null"); +} + +TEST(ErrorHandlersTest, NamespaceErrorHandlerFormats422AsRestError) { + ErrorResponse error{ + .code = 422, + .type = "ValidationException", + .message = "Invalid namespace", + }; + + ExpectErrorWithMessage( + NamespaceErrorHandler::Instance()->Accept(error), ErrorKind::kRestError, + "Unable to process (code: 422, type: ValidationException): Invalid namespace"); +} + +TEST(ErrorHandlersTest, TableErrorHandlerMaps404NotFoundToNotFound) { + ErrorResponse error{ + .code = 404, + .type = "NotFoundException", + .message = "Failed to open input stream for file: metadata.json", + }; + + EXPECT_THAT(TableErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNotFound)); + EXPECT_THAT(TableErrorHandler::Instance()->Accept(error), + HasErrorMessage("metadata.json")); +} + +TEST(ErrorHandlersTest, TableErrorHandlerMaps404ToNoSuchTableByDefault) { + ErrorResponse error{ + .code = 404, + .type = "NoSuchTableException", + .message = "Table does not exist", + }; + + EXPECT_THAT(TableErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNoSuchTable)); +} + +TEST(ErrorHandlersTest, CreateTableErrorHandlerMaps404ToNoSuchNamespace) { + ErrorResponse error{ + .code = 404, + .type = "NoSuchNamespaceException", + .message = "Namespace does not exist", + }; + + EXPECT_THAT(CreateTableErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNoSuchNamespace)); +} + +TEST(ErrorHandlersTest, CreateTableErrorHandlerMaps409ToAlreadyExists) { + ErrorResponse error{ + .code = 409, + .type = "AlreadyExistsException", + .message = "Table already exists", + }; + + EXPECT_THAT(CreateTableErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kAlreadyExists)); +} + +TEST(ErrorHandlersTest, CreateTableErrorHandlerMapsServiceFailureToCommitStateUnknown) { + ErrorResponse error{ + .code = 503, + .type = "ServiceFailureException", + .message = "Service unavailable", + }; + + EXPECT_THAT(CreateTableErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kCommitStateUnknown)); + EXPECT_THAT(CreateTableErrorHandler::Instance()->Accept(error), + HasErrorMessage("Service failed: 503: Service unavailable")); +} + +TEST(ErrorHandlersTest, PlanErrorHandlerMapsUnknown404ToNoSuchPlanId) { + ErrorResponse error{ + .code = 404, + .type = "UnknownException", + .message = "Plan does not exist", + }; + + EXPECT_THAT(PlanErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNoSuchPlanId)); +} + +TEST(ErrorHandlersTest, PlanErrorHandlerDelegates406ToDefaultHandler) { + ErrorResponse error{ + .code = 406, + .type = "NotAcceptableException", + .message = "Not acceptable", + }; + + ExpectErrorWithMessage( + PlanErrorHandler::Instance()->Accept(error), ErrorKind::kRestError, + "Unable to process (code: 406, type: NotAcceptableException): Not acceptable"); +} + +TEST(ErrorHandlersTest, PlanTaskErrorHandlerMapsUnknown404ToNoSuchPlanTask) { + ErrorResponse error{ + .code = 404, + .type = "UnknownException", + .message = "Plan task does not exist", + }; + + EXPECT_THAT(PlanTaskErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNoSuchPlanTask)); +} + +TEST(ErrorHandlersTest, OAuthErrorHandlerMapsInvalidClientToNotAuthorized) { + ErrorResponse error{ + .code = 400, + .type = "invalid_client", + .message = "Credentials given were invalid", + }; + + EXPECT_THAT(OAuthErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNotAuthorized)); + EXPECT_THAT( + OAuthErrorHandler::Instance()->Accept(error), + HasErrorMessage("Not authorized: invalid_client: Credentials given were invalid")); +} + +TEST(ErrorHandlersTest, OAuthErrorHandlerParsesOAuthErrorResponse) { + auto parse_result = OAuthErrorHandler::Instance()->ParseResponse( + 400, + R"({"error":"invalid_client","error_description":"Credentials given were invalid"})"); + ASSERT_TRUE(parse_result.has_value()); + + EXPECT_EQ(parse_result->code, 400); + EXPECT_EQ(parse_result->type, "invalid_client"); + EXPECT_EQ(parse_result->message, "Credentials given were invalid"); + EXPECT_THAT(OAuthErrorHandler::Instance()->Accept(*parse_result), + IsError(ErrorKind::kNotAuthorized)); +} + +TEST(ErrorHandlersTest, OAuthErrorHandlerMapsClientErrorsToBadRequest) { + ErrorResponse error{ + .code = 400, + .type = "invalid_grant", + .message = "Grant is invalid", + }; + + EXPECT_THAT(OAuthErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kBadRequest)); + EXPECT_THAT(OAuthErrorHandler::Instance()->Accept(error), + HasErrorMessage("Malformed request: invalid_grant: Grant is invalid")); +} + +TEST(ErrorHandlersTest, ConfigErrorHandlerMapsTyped404ToNoSuchWarehouse) { + ErrorResponse error{ + .code = 404, + .type = "NotFoundException", + .message = "Warehouse not found", + }; + + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kNoSuchWarehouse)); +} + +TEST(ErrorHandlersTest, ConfigErrorHandlerDelegatesUntyped404ToDefaultHandler) { + ErrorResponse error{ + .code = 404, + .type = "", + .message = "Not Found", + }; + + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kRestError)); + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + HasErrorMessage("Not Found")); +} + +TEST(ErrorHandlersTest, ConfigErrorHandlerDelegatesFallback404ToDefaultHandler) { + ErrorResponse error{ + .code = 404, + .type = "RESTException", + .message = "Not Found", + }; + + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kRestError)); + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + HasErrorMessage("Not Found")); +} + +TEST(ErrorHandlersTest, ConfigErrorHandlerDelegatesNon404ToDefaultHandler) { + ErrorResponse error{ + .code = 500, + .type = "", + .message = "Internal server error", + }; + + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + IsError(ErrorKind::kInternalServerError)); + EXPECT_THAT(ConfigErrorHandler::Instance()->Accept(error), + HasErrorMessage("Internal server error")); +} + +} // namespace iceberg::rest diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index 6f9c4c31b..b01a61904 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -131,6 +131,7 @@ if get_option('rest').enabled() 'sources': files( 'auth_manager_test.cc', 'endpoint_test.cc', + 'error_handlers_test.cc', 'rest_file_io_test.cc', 'rest_json_serde_test.cc', 'rest_util_test.cc', From f38090e0c7b192cdb95bf9c153f135e870c19fa1 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 22 Jun 2026 23:06:08 -0500 Subject: [PATCH 114/151] ci: cache the sccache directory across C++ test builds (#765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What Turn on compiler caching (sccache) for the Linux and macOS builds in `test`, `aws_test`, `sanitizer_test`, and `sql_catalog_test`, and switch the Windows `test` build to the same setup. `main` builds once and saves the cache; pull requests reuse it without writing back. ## Why Right now only the Windows builds reuse compiled output — every Linux and macOS build recompiles the whole bundled Arrow/Parquet/Avro/Boost stack from scratch, even though it never changes between PRs. Building it once and reusing it removes most of that repeated work. Saving the cache as a single file (instead of one upload per compiled file) also avoids the upload rate limit that causes "cache write error" spam. ## Validation On a warm pull-request run, every build reused the cache: 99.6–99.9% of files came from cache, zero write errors. The heavy builds drop from ~10–27 min to ~1.5–5 min. --------- Co-authored-by: Abanoub Doss --- .github/workflows/aws_test.yml | 47 ++++++++++++- .github/workflows/sanitizer_test.yml | 24 ++++++- .github/workflows/sql_catalog_test.yml | 23 +++++++ .github/workflows/test.yml | 93 ++++++++++++++++++++++---- 4 files changed, 171 insertions(+), 16 deletions(-) diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml index 4d58edddb..388d7508e 100644 --- a/.github/workflows/aws_test.yml +++ b/.github/workflows/aws_test.yml @@ -74,6 +74,8 @@ jobs: AWS_DEFAULT_REGION: us-east-1 AWS_ENDPOINT_URL: http://127.0.0.1:9000 AWS_EC2_METADATA_DISABLED: "TRUE" + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -113,11 +115,29 @@ jobs: if: ${{ matrix.s3 == 'ON' }} shell: bash run: bash ci/scripts/start_minio.sh + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-aws-${{ matrix.runs-on }}-bundle${{ matrix.bundle_awssdk }}-s3${{ matrix.s3 }}-sigv4${{ matrix.sigv4 }}-${{ github.run_id }} + restore-keys: | + sccache-aws-${{ matrix.runs-on }}-bundle${{ matrix.bundle_awssdk }}-s3${{ matrix.s3 }}-sigv4${{ matrix.sigv4 }}- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build and test Iceberg shell: bash env: CMAKE_TOOLCHAIN_FILE: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' && '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }} - run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ${{ matrix.s3 }} ${{ matrix.sigv4 }} ${{ matrix.bundle_awssdk }} + run: ci/scripts/build_iceberg.sh "$(pwd)" OFF ON ${{ matrix.s3 }} ${{ matrix.sigv4 }} ${{ matrix.bundle_awssdk }} + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-aws-${{ matrix.runs-on }}-bundle${{ matrix.bundle_awssdk }}-s3${{ matrix.s3 }}-sigv4${{ matrix.sigv4 }}-${{ github.run_id }} # Exercise the Meson build with SigV4 enabled (resolves aws-cpp-sdk-core via # its CMake config, not pkg-config whose Cflags force -std=c++11). @@ -126,6 +146,9 @@ jobs: name: Meson SigV4 (AMD64 Ubuntu 24.04) runs-on: ubuntu-24.04 timeout-minutes: 45 + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: @@ -161,9 +184,20 @@ jobs: echo "::error::vcpkg install failed after 3 attempts" exit 1 - name: Set Ubuntu Compilers + # Wrap the compiler with sccache: Meson uses an explicit CC/CXX verbatim, + # so the launcher must be prepended here to route compiles through sccache. run: | - echo "CC=gcc-14" >> $GITHUB_ENV - echo "CXX=g++-14" >> $GITHUB_ENV + echo "CC=sccache gcc-14" >> $GITHUB_ENV + echo "CXX=sccache g++-14" >> $GITHUB_ENV + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-meson-sigv4-${{ github.run_id }} + restore-keys: | + sccache-meson-sigv4- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build and test Iceberg shell: bash env: @@ -171,4 +205,11 @@ jobs: run: | meson setup builddir -Dsigv4=enabled meson compile -C builddir + sccache --show-stats meson test -C builddir --timeout-multiplier 0 --print-errorlogs + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-meson-sigv4-${{ github.run_id }} diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index f4edecfec..e461bd1ed 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -39,6 +39,9 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: "ASAN and UBSAN Tests" runs-on: ubuntu-24.04 + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -47,14 +50,33 @@ jobs: - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-sanitizer-ubuntu-${{ github.run_id }} + restore-keys: | + sccache-sanitizer-ubuntu- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Configure and Build with ASAN & UBSAN env: CC: gcc-14 CXX: g++-14 run: | mkdir build && cd build - cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DICEBERG_ENABLE_ASAN=ON -DICEBERG_ENABLE_UBSAN=ON + cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DICEBERG_ENABLE_ASAN=ON -DICEBERG_ENABLE_UBSAN=ON \ + -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build . --verbose + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-sanitizer-ubuntu-${{ github.run_id }} - name: Run Tests working-directory: build env: diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index 79c6328b5..d089ae4c6 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -61,6 +61,9 @@ jobs: runs-on: windows-2025 cmake_build_type: Release cmake_extra_args: -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -92,6 +95,15 @@ jobs: shell: pwsh run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows sqlite3:x64-windows + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-sqlcatalog-${{ matrix.runs-on }}-${{ github.run_id }} + restore-keys: | + sccache-sqlcatalog-${{ matrix.runs-on }}- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Configure Iceberg shell: bash run: | @@ -103,10 +115,21 @@ jobs: -DICEBERG_BUILD_REST=OFF \ -DICEBERG_BUILD_SQL_CATALOG=ON \ -DICEBERG_SQL_SQLITE=ON \ + -DCMAKE_C_COMPILER_LAUNCHER=sccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ ${{ matrix.cmake_extra_args }} - name: Build SQL catalog tests shell: bash run: cmake --build build --target sql_catalog_test + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-sqlcatalog-${{ matrix.runs-on }}-${{ github.run_id }} - name: Run SQL catalog tests shell: bash run: ctest --test-dir build -R '^sql_catalog_test$' --output-on-failure -C ${{ matrix.cmake_build_type }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f420bde5..a51a29866 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,9 @@ jobs: timeout-minutes: 30 strategy: fail-fast: false + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -53,12 +56,30 @@ jobs: - name: Install dependencies shell: bash run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-ubuntu-${{ github.run_id }} + restore-keys: | + sccache-test-ubuntu- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build Iceberg shell: bash env: CC: gcc-14 CXX: g++-14 - run: ci/scripts/build_iceberg.sh $(pwd) ON + run: ci/scripts/build_iceberg.sh $(pwd) ON ON + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-ubuntu-${{ github.run_id }} - name: Build Example shell: bash env: @@ -72,14 +93,35 @@ jobs: timeout-minutes: 30 strategy: fail-fast: false + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-macos-${{ github.run_id }} + restore-keys: | + sccache-test-macos- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build Iceberg shell: bash - run: ci/scripts/build_iceberg.sh $(pwd) + run: ci/scripts/build_iceberg.sh $(pwd) OFF ON + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-macos-${{ github.run_id }} - name: Build Example shell: bash run: ci/scripts/build_example.sh $(pwd)/example @@ -90,6 +132,9 @@ jobs: timeout-minutes: 60 strategy: fail-fast: false + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -110,17 +155,28 @@ jobs: shell: pwsh run: | vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-windows-${{ github.run_id }} + restore-keys: | + sccache-test-windows- - name: Setup sccache uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build Iceberg shell: pwsh - env: - SCCACHE_GHA_ENABLED: "true" run: | $ErrorActionPreference = "Stop" bash -lc 'ci/scripts/build_iceberg.sh $(pwd) OFF ON' if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-test-windows-${{ github.run_id }} - name: Build Example shell: pwsh run: | @@ -131,6 +187,9 @@ jobs: name: Meson - ${{ matrix.title }} runs-on: ${{ matrix.runs-on }} timeout-minutes: 30 + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" strategy: max-parallel: 15 fail-fast: false @@ -159,24 +218,34 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install -r requirements.txt - name: Set Ubuntu Compilers + # Wrap the compiler with sccache: Meson auto-detects sccache for the + # default compiler (macOS/Windows), but uses an explicit CC/CXX verbatim, + # so the launcher must be prepended here to route Ubuntu compiles through it. if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} run: | - echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV - echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV + echo "CC=sccache ${{ matrix.CC }}" >> $GITHUB_ENV + echo "CXX=sccache ${{ matrix.CXX }}" >> $GITHUB_ENV + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-meson-${{ matrix.runs-on }}-${{ github.run_id }} + restore-keys: | + sccache-meson-${{ matrix.runs-on }}- - name: Setup sccache - if: ${{ startsWith(matrix.runs-on, 'windows') }} uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - - name: Enable sccache - if: ${{ startsWith(matrix.runs-on, 'windows') }} - shell: bash - run: echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" - name: Build Iceberg run: | meson setup builddir ${{ matrix.meson-setup-args || '' }} meson compile -C builddir - name: Show sccache stats - if: ${{ startsWith(matrix.runs-on, 'windows') }} run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-meson-${{ matrix.runs-on }}-${{ github.run_id }} - name: Test Iceberg run: | meson test -C builddir --timeout-multiplier 0 --print-errorlogs From 959fda6703bb74a0268c7038d48e189427a2f67e Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 23 Jun 2026 12:47:54 +0800 Subject: [PATCH 115/151] feat: add Iceberg v3 type definitions (#752) Introduce the Iceberg v3 types (variant, geometry, geography), including their schema/JSON serialization and type-system integration (visitors, schema projection, etc.). Reading and writing data of these types is not implemented yet: conversion to/from Arrow, Avro, and Parquet returns an error, as do identity transform binding and scalar validation for them. --- src/iceberg/avro/avro_schema_util.cc | 17 ++ src/iceberg/avro/avro_schema_util_internal.h | 3 + src/iceberg/delete_file_index.cc | 4 +- src/iceberg/json_serde.cc | 122 +++++++--- src/iceberg/metrics_config.cc | 5 +- src/iceberg/parquet/parquet_metrics.cc | 4 + src/iceberg/parquet/parquet_schema_util.cc | 5 + src/iceberg/parquet/parquet_writer.cc | 4 + src/iceberg/schema_internal.cc | 35 +++ src/iceberg/table_metadata.h | 5 +- src/iceberg/test/arrow_test.cc | 14 ++ src/iceberg/test/rest_json_serde_test.cc | 2 +- src/iceberg/test/schema_json_test.cc | 57 +++++ src/iceberg/test/schema_test.cc | 57 +++-- src/iceberg/test/transform_test.cc | 13 ++ src/iceberg/test/type_test.cc | 105 ++++++++- src/iceberg/test/visit_type_test.cc | 40 +++- src/iceberg/transform.cc | 4 +- src/iceberg/transform_function.cc | 4 +- src/iceberg/type.cc | 229 +++++++++++++++++-- src/iceberg/type.h | 170 ++++++++++++-- src/iceberg/type_fwd.h | 15 ++ src/iceberg/update/update_schema.cc | 6 + src/iceberg/util/struct_like_set.cc | 5 + src/iceberg/util/type_util.cc | 37 ++- src/iceberg/util/type_util.h | 4 + src/iceberg/util/visit_type.h | 9 +- src/iceberg/util/visitor_generate.h | 10 + 28 files changed, 859 insertions(+), 126 deletions(-) diff --git a/src/iceberg/avro/avro_schema_util.cc b/src/iceberg/avro/avro_schema_util.cc index c26e2bbc9..14b464cee 100644 --- a/src/iceberg/avro/avro_schema_util.cc +++ b/src/iceberg/avro/avro_schema_util.cc @@ -248,6 +248,18 @@ Status ToAvroNodeVisitor::Visit(const UnknownType&, ::avro::NodePtr* node) { return {}; } +Status ToAvroNodeVisitor::Visit(const VariantType&, ::avro::NodePtr*) { + return NotSupported("Writing Iceberg variant type to Avro is not supported"); +} + +Status ToAvroNodeVisitor::Visit(const GeometryType&, ::avro::NodePtr*) { + return NotSupported("Writing Iceberg geometry type to Avro is not supported"); +} + +Status ToAvroNodeVisitor::Visit(const GeographyType&, ::avro::NodePtr*) { + return NotSupported("Writing Iceberg geography type to Avro is not supported"); +} + Status ToAvroNodeVisitor::Visit(const StructType& type, ::avro::NodePtr* node) { *node = std::make_shared<::avro::NodeRecord>(); @@ -631,6 +643,11 @@ Status ValidateAvroSchemaEvolution(const Type& expected_type, break; case TypeId::kUnknown: return {}; + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + return NotSupported("Reading Iceberg type {} from Avro is not supported", + expected_type); default: break; } diff --git a/src/iceberg/avro/avro_schema_util_internal.h b/src/iceberg/avro/avro_schema_util_internal.h index a5bfb989e..342b119a5 100644 --- a/src/iceberg/avro/avro_schema_util_internal.h +++ b/src/iceberg/avro/avro_schema_util_internal.h @@ -59,6 +59,9 @@ class ToAvroNodeVisitor { Status Visit(const FixedType& type, ::avro::NodePtr* node); Status Visit(const BinaryType& type, ::avro::NodePtr* node); Status Visit(const UnknownType&, ::avro::NodePtr*); + Status Visit(const VariantType&, ::avro::NodePtr*); + Status Visit(const GeometryType&, ::avro::NodePtr*); + Status Visit(const GeographyType&, ::avro::NodePtr*); Status Visit(const StructType& type, ::avro::NodePtr* node); Status Visit(const ListType& type, ::avro::NodePtr* node); Status Visit(const MapType& type, ::avro::NodePtr* node); diff --git a/src/iceberg/delete_file_index.cc b/src/iceberg/delete_file_index.cc index 7c8c35032..8c58e861b 100644 --- a/src/iceberg/delete_file_index.cc +++ b/src/iceberg/delete_file_index.cc @@ -56,7 +56,7 @@ Status EqualityDeleteFile::ConvertBoundsIfNeeded() const { } const auto& schema_field = field.value().get(); - if (schema_field.type()->is_nested()) { + if (!schema_field.type()->is_primitive()) { continue; } @@ -103,7 +103,7 @@ Result CanContainEqDeletesForFile(const DataFile& data_file, } const auto& field = found_field.value().get(); - if (field.type()->is_nested()) { + if (!field.type()->is_primitive()) { continue; } diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index 1f2b8f45c..e137aed1d 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -389,6 +389,12 @@ nlohmann::json ToJson(const Type& type) { return "uuid"; case TypeId::kUnknown: return "unknown"; + case TypeId::kVariant: + return "variant"; + case TypeId::kGeometry: + return type.ToString(); + case TypeId::kGeography: + return type.ToString(); } std::unreachable(); } @@ -459,9 +465,10 @@ Result> ListTypeFromJson(const nlohmann::json& json) { ICEBERG_ASSIGN_OR_RAISE(auto element_required, GetJsonValue(json, kElementRequired)); - return std::make_unique( - SchemaField(element_id, std::string(ListType::kElementName), - std::move(element_type), !element_required)); + ICEBERG_ASSIGN_OR_RAISE(auto type, ListType::Make(SchemaField( + element_id, std::string(ListType::kElementName), + std::move(element_type), !element_required))); + return std::unique_ptr(std::move(type)); } Result> MapTypeFromJson(const nlohmann::json& json) { @@ -478,79 +485,126 @@ Result> MapTypeFromJson(const nlohmann::json& json) { /*optional=*/false); SchemaField value_field(value_id, std::string(MapType::kValueName), std::move(value_type), !value_required); - return std::make_unique(std::move(key_field), std::move(value_field)); + ICEBERG_ASSIGN_OR_RAISE(auto type, + MapType::Make(std::move(key_field), std::move(value_field))); + return std::unique_ptr(std::move(type)); } } // namespace Result> TypeFromJson(const nlohmann::json& json) { if (json.is_string()) { - std::string type_str = json.get(); - if (type_str == "boolean") { + const auto type_name = json.get(); + const auto normalized_type_name = StringUtils::ToLower(type_name); + if (normalized_type_name == "boolean") { return std::make_unique(); - } else if (type_str == "int") { + } else if (normalized_type_name == "int") { return std::make_unique(); - } else if (type_str == "long") { + } else if (normalized_type_name == "long") { return std::make_unique(); - } else if (type_str == "float") { + } else if (normalized_type_name == "float") { return std::make_unique(); - } else if (type_str == "double") { + } else if (normalized_type_name == "double") { return std::make_unique(); - } else if (type_str == "date") { + } else if (normalized_type_name == "date") { return std::make_unique(); - } else if (type_str == "time") { + } else if (normalized_type_name == "time") { return std::make_unique(); - } else if (type_str == "timestamp") { + } else if (normalized_type_name == "timestamp") { return std::make_unique(); - } else if (type_str == "timestamptz") { + } else if (normalized_type_name == "timestamptz") { return std::make_unique(); - } else if (type_str == "timestamp_ns") { + } else if (normalized_type_name == "timestamp_ns") { return std::make_unique(); - } else if (type_str == "timestamptz_ns") { + } else if (normalized_type_name == "timestamptz_ns") { return std::make_unique(); - } else if (type_str == "string") { + } else if (normalized_type_name == "string") { return std::make_unique(); - } else if (type_str == "binary") { + } else if (normalized_type_name == "binary") { return std::make_unique(); - } else if (type_str == "uuid") { + } else if (normalized_type_name == "uuid") { return std::make_unique(); - } else if (type_str == "unknown") { + } else if (normalized_type_name == "unknown") { return std::make_unique(); - } else if (type_str.starts_with("fixed")) { - std::regex fixed_regex(R"(fixed\[\s*(\d+)\s*\])"); + } else if (normalized_type_name == "variant") { + return std::make_unique(); + } else if (normalized_type_name.starts_with("fixed")) { + static const std::regex kFixedRegex(R"(fixed\[\s*(\d+)\s*\])"); std::smatch match; - if (std::regex_match(type_str, match, fixed_regex)) { + if (std::regex_match(normalized_type_name, match, kFixedRegex)) { ICEBERG_ASSIGN_OR_RAISE(auto length, StringUtils::ParseNumber(match[1].str())); return std::make_unique(length); } - return JsonParseError("Invalid fixed type: {}", type_str); - } else if (type_str.starts_with("decimal")) { - std::regex decimal_regex(R"(decimal\(\s*(\d+)\s*,\s*(\d+)\s*\))"); + return JsonParseError("Invalid fixed type: {}", type_name); + } else if (normalized_type_name.starts_with("decimal")) { + static const std::regex kDecimalRegex(R"(decimal\(\s*(\d+)\s*,\s*(\d+)\s*\))"); std::smatch match; - if (std::regex_match(type_str, match, decimal_regex)) { + if (std::regex_match(normalized_type_name, match, kDecimalRegex)) { ICEBERG_ASSIGN_OR_RAISE(auto precision, StringUtils::ParseNumber(match[1].str())); ICEBERG_ASSIGN_OR_RAISE(auto scale, StringUtils::ParseNumber(match[2].str())); return std::make_unique(precision, scale); } - return JsonParseError("Invalid decimal type: {}", type_str); + return JsonParseError("Invalid decimal type: {}", type_name); + } else if (normalized_type_name.starts_with("geometry")) { + static const std::regex kGeometryRegex(R"(geometry\s*(?:\(\s*([^)]*?)\s*\))?)", + std::regex_constants::icase); + std::smatch match; + if (std::regex_match(type_name, match, kGeometryRegex)) { + if (match[1].matched) { + auto crs = match[1].str(); + if (crs.empty()) { + return JsonParseError("Invalid geometry type: {}", type_name); + } + ICEBERG_ASSIGN_OR_RAISE(auto type, GeometryType::Make(std::move(crs))); + return std::unique_ptr(std::move(type)); + } + ICEBERG_ASSIGN_OR_RAISE(auto type, GeometryType::Make()); + return std::unique_ptr(std::move(type)); + } + return JsonParseError("Invalid geometry type: {}", type_name); + } else if (normalized_type_name.starts_with("geography")) { + static const std::regex kGeographyRegex( + R"(geography\s*(?:\(\s*([^,]*?)\s*(?:,\s*(\w*)\s*)?\))?)", + std::regex_constants::icase); + std::smatch match; + if (std::regex_match(type_name, match, kGeographyRegex)) { + auto crs = match[1].str(); + if (match[1].matched && crs.empty()) { + return JsonParseError("Invalid geography type: {}", type_name); + } + if (match[2].matched) { + ICEBERG_ASSIGN_OR_RAISE(auto algorithm, + EdgeAlgorithmFromString(match[2].str())); + ICEBERG_ASSIGN_OR_RAISE(auto type, + GeographyType::Make(std::move(crs), algorithm)); + return std::unique_ptr(std::move(type)); + } + if (match[1].matched) { + ICEBERG_ASSIGN_OR_RAISE(auto type, GeographyType::Make(std::move(crs))); + return std::unique_ptr(std::move(type)); + } + ICEBERG_ASSIGN_OR_RAISE(auto type, GeographyType::Make()); + return std::unique_ptr(std::move(type)); + } + return JsonParseError("Invalid geography type: {}", type_name); } else { - return JsonParseError("Unknown primitive type: {}", type_str); + return JsonParseError("Cannot parse type string: {}", type_name); } } // For complex types like struct, list, and map - ICEBERG_ASSIGN_OR_RAISE(auto type_str, GetJsonValue(json, kType)); - if (type_str == kStruct) { + ICEBERG_ASSIGN_OR_RAISE(auto complex_type_name, GetJsonValue(json, kType)); + if (complex_type_name == kStruct) { return StructTypeFromJson(json); - } else if (type_str == kList) { + } else if (complex_type_name == kList) { return ListTypeFromJson(json); - } else if (type_str == kMap) { + } else if (complex_type_name == kMap) { return MapTypeFromJson(json); } else { - return JsonParseError("Unknown complex type: {}", type_str); + return JsonParseError("Unknown complex type: {}", complex_type_name); } } diff --git a/src/iceberg/metrics_config.cc b/src/iceberg/metrics_config.cc index 95d1a1fe1..f5e30ace9 100644 --- a/src/iceberg/metrics_config.cc +++ b/src/iceberg/metrics_config.cc @@ -197,6 +197,8 @@ Result> MetricsConfig::LimitFieldIds(const Schema& s Status Visit(const Type& type) { if (type.is_nested()) { return VisitNested(internal::checked_cast(type)); + } else if (type.is_variant()) { + return {}; } else { return VisitPrimitive(internal::checked_cast(type)); } @@ -207,8 +209,7 @@ Result> MetricsConfig::LimitFieldIds(const Schema& s if (!ShouldContinue()) { break; } - // TODO(zhuo.wang): variant type should also be handled here - if (field.type()->is_primitive()) { + if (!field.type()->is_nested()) { ids_.insert(field.field_id()); } } diff --git a/src/iceberg/parquet/parquet_metrics.cc b/src/iceberg/parquet/parquet_metrics.cc index 32dc9fec8..dac9ea6a8 100644 --- a/src/iceberg/parquet/parquet_metrics.cc +++ b/src/iceberg/parquet/parquet_metrics.cc @@ -423,6 +423,10 @@ class CollectMetricsVisitor { Status VisitMap(const MapType& /*type*/, const std::string& /*prefix*/) { return {}; } + Status VisitVariant(const VariantType& /*type*/, const std::string& /*prefix*/) { + return {}; + } + Status VisitPrimitive(const PrimitiveType& /*type*/, const std::string& /*prefix*/) { return {}; } diff --git a/src/iceberg/parquet/parquet_schema_util.cc b/src/iceberg/parquet/parquet_schema_util.cc index 39e321d9f..a5629198f 100644 --- a/src/iceberg/parquet/parquet_schema_util.cc +++ b/src/iceberg/parquet/parquet_schema_util.cc @@ -239,6 +239,11 @@ Status ValidateParquetSchemaEvolution( break; case TypeId::kUnknown: return {}; + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + return NotSupported("Reading Iceberg type {} from Parquet is not supported", + expected_type); case TypeId::kStruct: if (arrow_type->id() == ::arrow::Type::STRUCT) { return {}; diff --git a/src/iceberg/parquet/parquet_writer.cc b/src/iceberg/parquet/parquet_writer.cc index c50fb26b1..fea7cd834 100644 --- a/src/iceberg/parquet/parquet_writer.cc +++ b/src/iceberg/parquet/parquet_writer.cc @@ -178,6 +178,10 @@ class FieldMetricsCollector { Status VisitMap(const MapType& /*type*/, const ::arrow::Array& /*array*/) { return {}; } + Status VisitVariant(const VariantType& /*type*/, const ::arrow::Array& /*array*/) { + return {}; + } + Status VisitPrimitive(const PrimitiveType& type, const ::arrow::Array& array) { switch (type.type_id()) { case TypeId::kFloat: diff --git a/src/iceberg/schema_internal.cc b/src/iceberg/schema_internal.cc index c32ceb2a6..792341adf 100644 --- a/src/iceberg/schema_internal.cc +++ b/src/iceberg/schema_internal.cc @@ -19,6 +19,7 @@ #include "iceberg/schema_internal.h" +#include #include #include #include @@ -39,6 +40,33 @@ constexpr const char* kArrowExtensionMetadata = "ARROW:extension:metadata"; constexpr const char* kArrowUuidExtensionName = "arrow.uuid"; constexpr int32_t kUnknownFieldId = -1; +Status CheckArrowCompatible(const Type& type) { + switch (type.type_id()) { + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + return NotSupported("Iceberg type {} is not supported by Arrow conversion", + type.ToString()); + case TypeId::kStruct: + for (const auto& field : static_cast(type).fields()) { + ICEBERG_RETURN_UNEXPECTED(CheckArrowCompatible(*field.type())); + } + break; + case TypeId::kList: + ICEBERG_RETURN_UNEXPECTED( + CheckArrowCompatible(*static_cast(type).element().type())); + break; + case TypeId::kMap: { + const auto& map_type = static_cast(type); + ICEBERG_RETURN_UNEXPECTED(CheckArrowCompatible(*map_type.key().type())); + ICEBERG_RETURN_UNEXPECTED(CheckArrowCompatible(*map_type.value().type())); + } break; + default: + break; + } + return {}; +} + // Convert an Iceberg type to Arrow schema. Return value is Nanoarrow error code. ArrowErrorCode ToArrowSchema(const Type& type, bool optional, std::string_view name, std::optional field_id, ArrowSchema* schema) { @@ -153,6 +181,11 @@ ArrowErrorCode ToArrowSchema(const Type& type, bool optional, std::string_view n case TypeId::kUnknown: NANOARROW_RETURN_NOT_OK(ArrowSchemaSetType(schema, NANOARROW_TYPE_NA)); break; + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + ArrowBufferReset(&metadata_buffer); + return EINVAL; } if (!name.empty()) { @@ -179,6 +212,8 @@ Status ToArrowSchema(const Schema& schema, ArrowSchema* out) { return InvalidArgument("Output Arrow schema cannot be null"); } + ICEBERG_RETURN_UNEXPECTED(CheckArrowCompatible(schema)); + ArrowSchemaInit(out); if (ArrowErrorCode errorCode = ToArrowSchema(schema, /*optional=*/false, /*name=*/"", diff --git a/src/iceberg/table_metadata.h b/src/iceberg/table_metadata.h index 06d636ef5..fd2c27199 100644 --- a/src/iceberg/table_metadata.h +++ b/src/iceberg/table_metadata.h @@ -79,9 +79,8 @@ struct ICEBERG_EXPORT TableMetadata { static constexpr int64_t kInitialRowId = 0; static inline const std::unordered_map kMinFormatVersions = { - {TypeId::kTimestampNs, 3}, - {TypeId::kTimestampTzNs, 3}, - {TypeId::kUnknown, 3}, + {TypeId::kTimestampNs, 3}, {TypeId::kTimestampTzNs, 3}, {TypeId::kUnknown, 3}, + {TypeId::kVariant, 3}, {TypeId::kGeometry, 3}, {TypeId::kGeography, 3}, }; /// An integer version number for the format diff --git a/src/iceberg/test/arrow_test.cc b/src/iceberg/test/arrow_test.cc index 9f8ce86f5..2a7242e71 100644 --- a/src/iceberg/test/arrow_test.cc +++ b/src/iceberg/test/arrow_test.cc @@ -122,6 +122,20 @@ INSTANTIATE_TEST_SUITE_P( ToArrowSchemaParam{.iceberg_type = iceberg::unknown(), .arrow_type = ::arrow::null()})); +TEST(ToArrowSchemaTest, UnsupportedV3Types) { + const std::vector> unsupported_types = { + iceberg::variant(), iceberg::geometry(), iceberg::geography()}; + + for (const auto& unsupported_type : unsupported_types) { + Schema schema( + {SchemaField::MakeOptional(/*field_id=*/1, "unsupported", unsupported_type)}, + /*schema_id=*/0); + ArrowSchema arrow_schema; + ASSERT_THAT(ToArrowSchema(schema, &arrow_schema), + HasErrorMessage("is not supported by Arrow conversion")); + } +} + namespace { void CheckArrowField(const ::arrow::Field& field, ::arrow::Type::type type_id, diff --git a/src/iceberg/test/rest_json_serde_test.cc b/src/iceberg/test/rest_json_serde_test.cc index 7304831c6..50507dd3a 100644 --- a/src/iceberg/test/rest_json_serde_test.cc +++ b/src/iceberg/test/rest_json_serde_test.cc @@ -1078,7 +1078,7 @@ INSTANTIATE_TEST_SUITE_P( CreateTableRequestInvalidParam{ .test_name = "WrongSchemaType", .invalid_json_str = R"({"name":"my_table","schema":"invalid"})", - .expected_error_message = "Unknown primitive type: invalid"}), + .expected_error_message = "Cannot parse type string: invalid"}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); diff --git a/src/iceberg/test/schema_json_test.cc b/src/iceberg/test/schema_json_test.cc index 08275a45c..520a1eb70 100644 --- a/src/iceberg/test/schema_json_test.cc +++ b/src/iceberg/test/schema_json_test.cc @@ -65,6 +65,21 @@ INSTANTIATE_TEST_SUITE_P( SchemaJsonParam{.json = "\"binary\"", .type = iceberg::binary()}, SchemaJsonParam{.json = "\"uuid\"", .type = iceberg::uuid()}, SchemaJsonParam{.json = "\"unknown\"", .type = iceberg::unknown()}, + SchemaJsonParam{.json = "\"variant\"", .type = iceberg::variant()}, + SchemaJsonParam{.json = "\"geometry\"", .type = iceberg::geometry()}, + SchemaJsonParam{.json = "\"geometry(srid:4326)\"", + .type = iceberg::geometry("srid:4326")}, + SchemaJsonParam{.json = "\"geography\"", .type = iceberg::geography()}, + SchemaJsonParam{.json = "\"geography(srid:4326)\"", + .type = iceberg::geography("srid:4326")}, + SchemaJsonParam{ + .json = "\"geography(srid:4326, spherical)\"", + .type = iceberg::geography("srid:4326", EdgeAlgorithm::kSpherical)}, + SchemaJsonParam{ + .json = "\"geography(OGC:CRS84, spherical)\"", + .type = iceberg::geography("OGC:CRS84", EdgeAlgorithm::kSpherical)}, + SchemaJsonParam{.json = "\"geography(srid:4326, karney)\"", + .type = iceberg::geography("srid:4326", EdgeAlgorithm::kKarney)}, SchemaJsonParam{.json = "\"fixed[8]\"", .type = iceberg::fixed(8)}, SchemaJsonParam{.json = "\"decimal(10,2)\"", .type = iceberg::decimal(10, 2)}, SchemaJsonParam{.json = "\"date\"", .type = iceberg::date()}, @@ -111,6 +126,48 @@ TEST(TypeJsonTest, FromJsonWithSpaces) { ASSERT_EQ(decimal->scale(), 2); } +TEST(TypeJsonTest, FromJsonV3TypesWithSpacesAndCase) { + auto variant_result = TypeFromJson(nlohmann::json::parse("\"Variant\"")); + ASSERT_TRUE(variant_result.has_value()); + ASSERT_EQ(*variant_result.value(), *iceberg::variant()); + + auto geometry_result = + TypeFromJson(nlohmann::json::parse("\"GEOMETRY( srid: 3857 )\"")); + ASSERT_TRUE(geometry_result.has_value()); + ASSERT_EQ(*geometry_result.value(), *iceberg::geometry("srid: 3857")); + + auto geography_result = + TypeFromJson(nlohmann::json::parse("\"geography(srid:4269,karney)\"")); + ASSERT_TRUE(geography_result.has_value()); + ASSERT_EQ(*geography_result.value(), + *iceberg::geography("srid:4269", EdgeAlgorithm::kKarney)); +} + +TEST(TypeJsonTest, InvalidV3Types) { + auto invalid_geometry = TypeFromJson(nlohmann::json::parse("\"geometry()\"")); + ASSERT_THAT(invalid_geometry, HasErrorMessage("Invalid geometry type")); + + auto invalid_geometry_with_spaces = + TypeFromJson(nlohmann::json::parse("\"geometry( )\"")); + ASSERT_THAT(invalid_geometry_with_spaces, HasErrorMessage("Invalid geometry type")); + + auto invalid_geography = TypeFromJson(nlohmann::json::parse("\"geography()\"")); + ASSERT_THAT(invalid_geography, HasErrorMessage("Invalid geography type")); + + auto invalid_geography_with_algorithm = + TypeFromJson(nlohmann::json::parse("\"geography( , spherical)\"")); + ASSERT_THAT(invalid_geography_with_algorithm, + HasErrorMessage("Invalid geography type")); + + auto invalid_geography_algorithm = + TypeFromJson(nlohmann::json::parse("\"geography(srid:4269, BadAlgorithm)\"")); + ASSERT_THAT(invalid_geography_algorithm, + HasErrorMessage("Invalid edge interpolation algorithm")); + + auto unknown_type = TypeFromJson(nlohmann::json::parse("\"nonsense\"")); + ASSERT_THAT(unknown_type, HasErrorMessage("Cannot parse type string")); +} + TEST(SchemaJsonTest, RoundTrip) { constexpr std::string_view json = R"({"fields":[{"id":1,"name":"id","required":true,"type":"int"},{"id":2,"name":"name","required":false,"type":"string"}],"schema-id":1,"type":"struct"})"; diff --git a/src/iceberg/test/schema_test.cc b/src/iceberg/test/schema_test.cc index 8f1b20035..db99eb02b 100644 --- a/src/iceberg/test/schema_test.cc +++ b/src/iceberg/test/schema_test.cc @@ -671,6 +671,7 @@ iceberg::SchemaField Id() { return {1, "id", iceberg::int32(), true}; } iceberg::SchemaField Name() { return {2, "name", iceberg::string(), false}; } iceberg::SchemaField Age() { return {3, "age", iceberg::int32(), true}; } iceberg::SchemaField Email() { return {4, "email", iceberg::string(), true}; } +iceberg::SchemaField Payload() { return {5, "payload", iceberg::variant(), true}; } iceberg::SchemaField Street() { return {11, "street", iceberg::string(), true}; } iceberg::SchemaField City() { return {12, "city", iceberg::string(), true}; } iceberg::SchemaField Zip() { return {13, "zip", iceberg::int32(), true}; } @@ -683,6 +684,10 @@ static std::unique_ptr BasicSchema() { return MakeSchema(Id(), Name(), Age(), Email()); } +static std::unique_ptr VariantSchema() { + return MakeSchema(Id(), Payload()); +} + static std::unique_ptr AddressSchema() { auto address_type = MakeStructType(Street(), City(), Zip()); auto address_field = iceberg::SchemaField{14, "address", std::move(address_type), true}; @@ -932,30 +937,36 @@ TEST_P(ProjectParamTest, ProjectFields) { INSTANTIATE_TEST_SUITE_P( ProjectTestCases, ProjectParamTest, - ::testing::Values(ProjectTestParam{.test_name = "ProjectAllFields", - .create_schema = []() { return BasicSchema(); }, - .selected_ids = {1, 2, 3, 4}, - .expected_schema = []() { return BasicSchema(); }, - .should_succeed = true}, - - ProjectTestParam{ - .test_name = "ProjectSingleField", - .create_schema = []() { return BasicSchema(); }, - .selected_ids = {2}, - .expected_schema = []() { return MakeSchema(Name()); }, - .should_succeed = true}, + ::testing::Values( + ProjectTestParam{.test_name = "ProjectAllFields", + .create_schema = []() { return BasicSchema(); }, + .selected_ids = {1, 2, 3, 4}, + .expected_schema = []() { return BasicSchema(); }, + .should_succeed = true}, + + ProjectTestParam{.test_name = "ProjectSingleField", + .create_schema = []() { return BasicSchema(); }, + .selected_ids = {2}, + .expected_schema = []() { return MakeSchema(Name()); }, + .should_succeed = true}, - ProjectTestParam{.test_name = "ProjectNonExistentFieldId", - .create_schema = []() { return BasicSchema(); }, - .selected_ids = {999}, - .expected_schema = []() { return MakeSchema(); }, - .should_succeed = true}, - - ProjectTestParam{.test_name = "ProjectEmptySelection", - .create_schema = []() { return BasicSchema(); }, - .selected_ids = {}, - .expected_schema = []() { return MakeSchema(); }, - .should_succeed = true})); + ProjectTestParam{.test_name = "ProjectVariantField", + .create_schema = []() { return VariantSchema(); }, + .selected_ids = {5}, + .expected_schema = []() { return MakeSchema(Payload()); }, + .should_succeed = true}, + + ProjectTestParam{.test_name = "ProjectNonExistentFieldId", + .create_schema = []() { return BasicSchema(); }, + .selected_ids = {999}, + .expected_schema = []() { return MakeSchema(); }, + .should_succeed = true}, + + ProjectTestParam{.test_name = "ProjectEmptySelection", + .create_schema = []() { return BasicSchema(); }, + .selected_ids = {}, + .expected_schema = []() { return MakeSchema(); }, + .should_succeed = true})); INSTANTIATE_TEST_SUITE_P(ProjectNestedTestCases, ProjectParamTest, ::testing::Values(ProjectTestParam{ diff --git a/src/iceberg/test/transform_test.cc b/src/iceberg/test/transform_test.cc index 8d7cd880d..d3eae5971 100644 --- a/src/iceberg/test/transform_test.cc +++ b/src/iceberg/test/transform_test.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,18 @@ TEST(TransformTest, Transform) { ASSERT_TRUE(identity_transform); } +TEST(TransformTest, IdentityDoesNotSupportV3Types) { + const auto transform = Transform::Identity(); + const std::vector> unsupported_types = { + iceberg::variant(), iceberg::geometry(), iceberg::geography()}; + + for (const auto& type : unsupported_types) { + EXPECT_FALSE(transform->CanTransform(*type)); + EXPECT_THAT(transform->Bind(type), + HasErrorMessage("is not a valid input type for identity transform")); + } +} + TEST(TransformFunctionTest, CreateBucketTransform) { constexpr int32_t bucket_count = 8; auto transform = Transform::Bucket(bucket_count); diff --git a/src/iceberg/test/type_test.cc b/src/iceberg/test/type_test.cc index d405cccc1..ac188f229 100644 --- a/src/iceberg/test/type_test.cc +++ b/src/iceberg/test/type_test.cc @@ -38,6 +38,7 @@ struct TypeTestCase { std::shared_ptr type; iceberg::TypeId type_id; bool primitive; + bool nested = false; std::string repr; }; @@ -61,20 +62,31 @@ TEST_P(TypeTest, IsPrimitive) { const auto* primitive = dynamic_cast(test_case.type.get()); ASSERT_NE(nullptr, primitive); + } else { + ASSERT_FALSE(test_case.type->is_primitive()); } } TEST_P(TypeTest, IsNested) { const auto& test_case = GetParam(); - if (!test_case.primitive) { - ASSERT_FALSE(test_case.type->is_primitive()); + if (test_case.nested) { ASSERT_TRUE(test_case.type->is_nested()); const auto* nested = dynamic_cast(test_case.type.get()); ASSERT_NE(nullptr, nested); + } else { + ASSERT_FALSE(test_case.type->is_nested()); } } +TEST_P(TypeTest, TypeKindPredicates) { + const auto& test_case = GetParam(); + ASSERT_EQ(test_case.type_id == iceberg::TypeId::kStruct, test_case.type->is_struct()); + ASSERT_EQ(test_case.type_id == iceberg::TypeId::kList, test_case.type->is_list()); + ASSERT_EQ(test_case.type_id == iceberg::TypeId::kMap, test_case.type->is_map()); + ASSERT_EQ(test_case.type_id == iceberg::TypeId::kVariant, test_case.type->is_variant()); +} + TEST_P(TypeTest, ReflexiveEquality) { const auto& test_case = GetParam(); ASSERT_EQ(*test_case.type, *test_case.type); @@ -90,7 +102,7 @@ TEST_P(TypeTest, StdFormat) { ASSERT_EQ(test_case.repr, std::format("{}", *test_case.type)); } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -224,14 +236,37 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "unknown", }, + { + .name = "geometry", + .type = iceberg::geometry(), + .type_id = iceberg::TypeId::kGeometry, + .primitive = true, + .repr = "geometry", + }, + { + .name = "geography", + .type = iceberg::geography(), + .type_id = iceberg::TypeId::kGeography, + .primitive = true, + .repr = "geography", + }, }}; +const static TypeTestCase kVariantType = { + .name = "variant", + .type = iceberg::variant(), + .type_id = iceberg::TypeId::kVariant, + .primitive = false, + .repr = "variant", +}; + const static std::array kNestedTypes = {{ { .name = "list_int", .type = std::make_shared(1, iceberg::int32(), true), .type_id = iceberg::TypeId::kList, .primitive = false, + .nested = true, .repr = "list", }, { @@ -240,6 +275,7 @@ const static std::array kNestedTypes = {{ 1, std::make_shared(2, iceberg::int32(), true), false), .type_id = iceberg::TypeId::kList, .primitive = false, + .nested = true, .repr = "list (required)>", }, { @@ -249,6 +285,7 @@ const static std::array kNestedTypes = {{ iceberg::SchemaField::MakeRequired(2, "value", iceberg::string())), .type_id = iceberg::TypeId::kMap, .primitive = false, + .nested = true, .repr = "map", }, { @@ -259,6 +296,7 @@ const static std::array kNestedTypes = {{ }), .type_id = iceberg::TypeId::kStruct, .primitive = false, + .nested = true, .repr = R"(struct< foo (1): long (required) bar (2): string (optional) @@ -269,6 +307,9 @@ const static std::array kNestedTypes = {{ INSTANTIATE_TEST_SUITE_P(Primitive, TypeTest, ::testing::ValuesIn(kPrimitiveTypes), TypeTestCaseToString); +INSTANTIATE_TEST_SUITE_P(Variant, TypeTest, ::testing::Values(kVariantType), + TypeTestCaseToString); + INSTANTIATE_TEST_SUITE_P(Nested, TypeTest, ::testing::ValuesIn(kNestedTypes), TypeTestCaseToString); @@ -277,6 +318,7 @@ TEST(TypeTest, Equality) { for (const auto& test_case : kPrimitiveTypes) { alltypes.push_back(test_case.type); } + alltypes.push_back(kVariantType.type); for (const auto& test_case : kNestedTypes) { alltypes.push_back(test_case.type); } @@ -294,6 +336,33 @@ TEST(TypeTest, Equality) { } } +TEST(TypeTest, GeographyExplicitDefaultAlgorithm) { + ASSERT_NE(*iceberg::geography("srid:4326"), + *iceberg::geography("srid:4326", iceberg::EdgeAlgorithm::kSpherical)); + ASSERT_NE(*iceberg::geography(), + *iceberg::geography("OGC:CRS84", iceberg::EdgeAlgorithm::kSpherical)); + ASSERT_EQ( + "geography(srid:4326, spherical)", + iceberg::geography("srid:4326", iceberg::EdgeAlgorithm::kSpherical)->ToString()); + ASSERT_EQ( + "geography(OGC:CRS84, spherical)", + iceberg::geography("OGC:CRS84", iceberg::EdgeAlgorithm::kSpherical)->ToString()); + ASSERT_NE(*iceberg::geography("srid:4326"), + *iceberg::geography("srid:4326", iceberg::EdgeAlgorithm::kKarney)); +} + +TEST(TypeTest, GeometryMakeRejectsEmptyCrs) { + auto result = iceberg::GeometryType::Make(""); + ASSERT_THAT(result, IsError(iceberg::ErrorKind::kInvalidArgument)); + ASSERT_THAT(result, iceberg::HasErrorMessage("GeometryType: CRS cannot be empty")); +} + +TEST(TypeTest, GeographyMakeRejectsEmptyCrs) { + auto result = iceberg::GeographyType::Make(""); + ASSERT_THAT(result, IsError(iceberg::ErrorKind::kInvalidArgument)); + ASSERT_THAT(result, iceberg::HasErrorMessage("GeographyType: CRS cannot be empty")); +} + TEST(TypeTest, Decimal) { { iceberg::DecimalType decimal(38, 2); @@ -359,11 +428,17 @@ TEST(TypeTest, List) { } ASSERT_THAT( []() { - iceberg::ListType list( - iceberg::SchemaField(1, "wrongname", iceberg::boolean(), true)); + iceberg::list(iceberg::SchemaField(1, "wrongname", iceberg::boolean(), true)); }, ::testing::ThrowsMessage( ::testing::HasSubstr("child field name should be 'element', was 'wrongname'"))); + + auto make_result = iceberg::ListType::Make( + iceberg::SchemaField(1, "wrongname", iceberg::boolean(), true)); + ASSERT_THAT(make_result, IsError(iceberg::ErrorKind::kInvalidArgument)); + ASSERT_THAT(make_result, + iceberg::HasErrorMessage( + "ListType: child field name should be 'element', was 'wrongname'")); } TEST(TypeTest, Map) { @@ -397,7 +472,7 @@ TEST(TypeTest, Map) { []() { iceberg::SchemaField key(5, "notkey", iceberg::int32(), true); iceberg::SchemaField value(7, "value", iceberg::string(), true); - iceberg::MapType map(key, value); + iceberg::map(key, value); }, ::testing::ThrowsMessage( ::testing::HasSubstr("key field name should be 'key', was 'notkey'"))); @@ -405,10 +480,26 @@ TEST(TypeTest, Map) { []() { iceberg::SchemaField key(5, "key", iceberg::int32(), true); iceberg::SchemaField value(7, "notvalue", iceberg::string(), true); - iceberg::MapType map(key, value); + iceberg::map(key, value); }, ::testing::ThrowsMessage( ::testing::HasSubstr("value field name should be 'value', was 'notvalue'"))); + + auto invalid_key_result = + iceberg::MapType::Make(iceberg::SchemaField(5, "notkey", iceberg::int32(), true), + iceberg::SchemaField(7, "value", iceberg::string(), true)); + ASSERT_THAT(invalid_key_result, IsError(iceberg::ErrorKind::kInvalidArgument)); + ASSERT_THAT( + invalid_key_result, + iceberg::HasErrorMessage("MapType: key field name should be 'key', was 'notkey'")); + + auto invalid_value_result = iceberg::MapType::Make( + iceberg::SchemaField(5, "key", iceberg::int32(), true), + iceberg::SchemaField(7, "notvalue", iceberg::string(), true)); + ASSERT_THAT(invalid_value_result, IsError(iceberg::ErrorKind::kInvalidArgument)); + ASSERT_THAT(invalid_value_result, + iceberg::HasErrorMessage( + "MapType: value field name should be 'value', was 'notvalue'")); } TEST(TypeTest, Struct) { diff --git a/src/iceberg/test/visit_type_test.cc b/src/iceberg/test/visit_type_test.cc index f038f906f..a6bd9f8c6 100644 --- a/src/iceberg/test/visit_type_test.cc +++ b/src/iceberg/test/visit_type_test.cc @@ -46,6 +46,7 @@ struct TypeTestCase { std::shared_ptr type; iceberg::TypeId type_id; bool primitive; + bool nested = false; std::string repr; }; @@ -53,7 +54,7 @@ std::string TypeTestCaseToString(const ::testing::TestParamInfo& i return info.param.name; } -const static std::array kPrimitiveTypes = {{ +const static std::array kPrimitiveTypes = {{ { .name = "boolean", .type = iceberg::boolean(), @@ -187,14 +188,37 @@ const static std::array kPrimitiveTypes = {{ .primitive = true, .repr = "unknown", }, + { + .name = "geometry", + .type = iceberg::geometry(), + .type_id = iceberg::TypeId::kGeometry, + .primitive = true, + .repr = "geometry", + }, + { + .name = "geography", + .type = iceberg::geography(), + .type_id = iceberg::TypeId::kGeography, + .primitive = true, + .repr = "geography", + }, }}; +const static TypeTestCase kVariantType = { + .name = "variant", + .type = iceberg::variant(), + .type_id = iceberg::TypeId::kVariant, + .primitive = false, + .repr = "variant", +}; + const static std::array kNestedTypes = {{ { .name = "list_int", .type = std::make_shared(1, iceberg::int32(), true), .type_id = iceberg::TypeId::kList, .primitive = false, + .nested = true, .repr = "list", }, { @@ -203,6 +227,7 @@ const static std::array kNestedTypes = {{ 1, std::make_shared(2, iceberg::int32(), true), false), .type_id = iceberg::TypeId::kList, .primitive = false, + .nested = true, .repr = "list (required)>", }, { @@ -212,6 +237,7 @@ const static std::array kNestedTypes = {{ iceberg::SchemaField::MakeRequired(2, "value", iceberg::string())), .type_id = iceberg::TypeId::kMap, .primitive = false, + .nested = true, .repr = "map", }, { @@ -222,6 +248,7 @@ const static std::array kNestedTypes = {{ }), .type_id = iceberg::TypeId::kStruct, .primitive = false, + .nested = true, .repr = R"(struct< foo (1): long (required) bar (2): string (optional) @@ -236,6 +263,9 @@ class VisitTypeTest : public ::testing::TestWithParam {}; INSTANTIATE_TEST_SUITE_P(Primitive, VisitTypeTest, ::testing::ValuesIn(kPrimitiveTypes), TypeTestCaseToString); +INSTANTIATE_TEST_SUITE_P(Variant, VisitTypeTest, ::testing::Values(kVariantType), + TypeTestCaseToString); + INSTANTIATE_TEST_SUITE_P(Nested, VisitTypeTest, ::testing::ValuesIn(kNestedTypes), TypeTestCaseToString); @@ -261,12 +291,12 @@ TEST_P(VisitTypeTest, VisitTypeReturnNestedTypeId) { const auto& test_case = GetParam(); auto result = VisitType(*test_case.type, visitor); - if (test_case.primitive) { - ASSERT_THAT(result, IsError(ErrorKind::kNotImplemented)); - ASSERT_THAT(result, HasErrorMessage("Type is not a nested type")); - } else { + if (test_case.nested) { ASSERT_THAT(result, IsOk()); ASSERT_EQ(result.value(), test_case.type_id); + } else { + ASSERT_THAT(result, IsError(ErrorKind::kNotImplemented)); + ASSERT_THAT(result, HasErrorMessage("Type is not a nested type")); } } diff --git a/src/iceberg/transform.cc b/src/iceberg/transform.cc index 453941c95..f6d5c0c20 100644 --- a/src/iceberg/transform.cc +++ b/src/iceberg/transform.cc @@ -158,7 +158,9 @@ std::shared_ptr Transform::ResultType( bool Transform::CanTransform(const Type& source_type) const { switch (transform_type_) { case TransformType::kIdentity: - if (!source_type.is_primitive()) [[unlikely]] { + if (source_type.is_variant() || source_type.type_id() == TypeId::kGeometry || + source_type.type_id() == TypeId::kGeography || !source_type.is_primitive()) + [[unlikely]] { return false; } return true; diff --git a/src/iceberg/transform_function.cc b/src/iceberg/transform_function.cc index 4325c53d1..1e8e30bb5 100644 --- a/src/iceberg/transform_function.cc +++ b/src/iceberg/transform_function.cc @@ -40,7 +40,9 @@ std::shared_ptr IdentityTransform::ResultType() const { return source_type Result> IdentityTransform::Make( std::shared_ptr const& source_type) { - if (!source_type || !source_type->is_primitive()) { + if (!source_type || source_type->is_variant() || + source_type->type_id() == TypeId::kGeometry || + source_type->type_id() == TypeId::kGeography || !source_type->is_primitive()) { return NotSupported("{} is not a valid input type for identity transform", source_type ? source_type->ToString() : "null"); } diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc index 057dcf513..fe48e6a99 100644 --- a/src/iceberg/type.cc +++ b/src/iceberg/type.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "iceberg/exception.h" @@ -142,12 +143,16 @@ StructType::InitFieldByLowerCaseName(const StructType& self) { return field_by_lowercase_name; } -ListType::ListType(SchemaField element) : element_(std::move(element)) { - ICEBERG_CHECK_OR_DIE(element_.name() == kElementName, - "ListType: child field name should be '{}', was '{}'", - kElementName, element_.name()); +Result> ListType::Make(SchemaField element) { + if (element.name() != kElementName) { + return InvalidArgument("ListType: child field name should be '{}', was '{}'", + kElementName, element.name()); + } + return std::make_unique(std::move(element)); } +ListType::ListType(SchemaField element) : element_(std::move(element)) {} + ListType::ListType(int32_t field_id, std::shared_ptr type, bool optional) : element_(field_id, std::string(kElementName), std::move(type), optional) {} @@ -198,16 +203,21 @@ bool ListType::Equals(const Type& other) const { return element_ == list.element_; } -MapType::MapType(SchemaField key, SchemaField value) - : fields_{std::move(key), std::move(value)} { - ICEBERG_CHECK_OR_DIE(this->key().name() == kKeyName, - "MapType: key field name should be '{}', was '{}'", kKeyName, - this->key().name()); - ICEBERG_CHECK_OR_DIE(this->value().name() == kValueName, - "MapType: value field name should be '{}', was '{}'", kValueName, - this->value().name()); +Result> MapType::Make(SchemaField key, SchemaField value) { + if (key.name() != kKeyName) { + return InvalidArgument("MapType: key field name should be '{}', was '{}'", kKeyName, + key.name()); + } + if (value.name() != kValueName) { + return InvalidArgument("MapType: value field name should be '{}', was '{}'", + kValueName, value.name()); + } + return std::make_unique(std::move(key), std::move(value)); } +MapType::MapType(SchemaField key, SchemaField value) + : fields_{std::move(key), std::move(value)} {} + const SchemaField& MapType::key() const { return fields_[0]; } const SchemaField& MapType::value() const { return fields_[1]; } TypeId MapType::type_id() const { return kTypeId; } @@ -264,6 +274,10 @@ bool MapType::Equals(const Type& other) const { return fields_ == map.fields_; } +TypeId VariantType::type_id() const { return kTypeId; } +std::string VariantType::ToString() const { return "variant"; } +bool VariantType::Equals(const Type& other) const { return other.type_id() == kTypeId; } + TypeId BooleanType::type_id() const { return kTypeId; } std::string BooleanType::ToString() const { return "boolean"; } bool BooleanType::Equals(const Type& other) const { return other.type_id() == kTypeId; } @@ -354,6 +368,97 @@ TypeId UnknownType::type_id() const { return kTypeId; } std::string UnknownType::ToString() const { return "unknown"; } bool UnknownType::Equals(const Type& other) const { return other.type_id() == kTypeId; } +Result> GeometryType::Make() { + return std::unique_ptr(new GeometryType()); +} + +Result> GeometryType::Make(std::string crs) { + if (crs.empty()) { + return InvalidArgument("GeometryType: CRS cannot be empty"); + } + return std::unique_ptr(new GeometryType(std::move(crs))); +} + +GeometryType::GeometryType(std::string crs) { + if (StringUtils::ToLower(crs) != StringUtils::ToLower(kDefaultCrs)) { + crs_ = std::move(crs); + } +} + +std::string_view GeometryType::crs() const { + return crs_.empty() ? kDefaultCrs : std::string_view(crs_); +} +TypeId GeometryType::type_id() const { return kTypeId; } +std::string GeometryType::ToString() const { + if (crs_.empty()) { + return "geometry"; + } + return std::format("geometry({})", crs_); +} +bool GeometryType::Equals(const Type& other) const { + if (other.type_id() != kTypeId) { + return false; + } + const auto& geometry = static_cast(other); + return crs_ == geometry.crs_; +} + +Result> GeographyType::Make() { + return std::unique_ptr(new GeographyType()); +} + +Result> GeographyType::Make(std::string crs) { + if (crs.empty()) { + return InvalidArgument("GeographyType: CRS cannot be empty"); + } + return std::unique_ptr(new GeographyType(std::move(crs))); +} + +Result> GeographyType::Make(std::string crs, + EdgeAlgorithm algorithm) { + if (crs.empty()) { + return InvalidArgument("GeographyType: CRS cannot be empty"); + } + return std::unique_ptr(new GeographyType(std::move(crs), algorithm)); +} + +GeographyType::GeographyType(std::string crs) { + if (StringUtils::ToLower(crs) != StringUtils::ToLower(kDefaultCrs)) { + crs_ = std::move(crs); + } +} + +GeographyType::GeographyType(std::string crs, EdgeAlgorithm algorithm) + : algorithm_(algorithm) { + if (StringUtils::ToLower(crs) != StringUtils::ToLower(kDefaultCrs)) { + crs_ = std::move(crs); + } +} + +std::string_view GeographyType::crs() const { + return crs_.empty() ? kDefaultCrs : std::string_view(crs_); +} +EdgeAlgorithm GeographyType::algorithm() const { + return algorithm_.value_or(kDefaultAlgorithm); +} +TypeId GeographyType::type_id() const { return kTypeId; } +std::string GeographyType::ToString() const { + if (algorithm_.has_value()) { + return std::format("geography({}, {})", crs(), iceberg::ToString(*algorithm_)); + } + if (!crs_.empty()) { + return std::format("geography({})", crs_); + } + return "geography"; +} +bool GeographyType::Equals(const Type& other) const { + if (other.type_id() != kTypeId) { + return false; + } + const auto& geography = static_cast(other); + return crs_ == geography.crs_ && algorithm_ == geography.algorithm_; +} + FixedType::FixedType(int32_t length) : length_(length) { ICEBERG_CHECK_OR_DIE(length >= 0, "FixedType: length must be >= 0, was {}", length); } @@ -374,7 +479,7 @@ std::string BinaryType::ToString() const { return "binary"; } bool BinaryType::Equals(const Type& other) const { return other.type_id() == kTypeId; } // ---------------------------------------------------------------------- -// Factory functions for creating primitive data types +// Factory functions for creating data types #define TYPE_FACTORY(NAME, KLASS) \ const std::shared_ptr& NAME() { \ @@ -397,9 +502,28 @@ TYPE_FACTORY(binary, BinaryType) TYPE_FACTORY(string, StringType) TYPE_FACTORY(uuid, UuidType) TYPE_FACTORY(unknown, UnknownType) +TYPE_FACTORY(variant, VariantType) #undef TYPE_FACTORY +const std::shared_ptr& geometry() { + static const std::shared_ptr result = [] { + auto type = GeometryType::Make(); + ICEBERG_CHECK_OR_DIE(type.has_value(), "Failed to create default geometry type"); + return std::shared_ptr(std::move(type.value())); + }(); + return result; +} + +const std::shared_ptr& geography() { + static const std::shared_ptr result = [] { + auto type = GeographyType::Make(); + ICEBERG_CHECK_OR_DIE(type.has_value(), "Failed to create default geography type"); + return std::shared_ptr(std::move(type.value())); + }(); + return result; +} + std::shared_ptr decimal(int32_t precision, int32_t scale) { return std::make_shared(precision, scale); } @@ -408,12 +532,44 @@ std::shared_ptr fixed(int32_t length) { return std::make_shared(length); } +std::shared_ptr geometry(std::string crs) { + auto type = GeometryType::Make(std::move(crs)); + if (!type.has_value()) { + throw IcebergError(type.error().message); + } + return std::move(type.value()); +} + +std::shared_ptr geography(std::string crs) { + auto type = GeographyType::Make(std::move(crs)); + if (!type.has_value()) { + throw IcebergError(type.error().message); + } + return std::move(type.value()); +} + +std::shared_ptr geography(std::string crs, EdgeAlgorithm algorithm) { + auto type = GeographyType::Make(std::move(crs), algorithm); + if (!type.has_value()) { + throw IcebergError(type.error().message); + } + return std::move(type.value()); +} + std::shared_ptr map(SchemaField key, SchemaField value) { - return std::make_shared(key, value); + auto type = MapType::Make(std::move(key), std::move(value)); + if (!type.has_value()) { + throw IcebergError(type.error().message); + } + return std::move(type.value()); } std::shared_ptr list(SchemaField element) { - return std::make_shared(std::move(element)); + auto type = ListType::Make(std::move(element)); + if (!type.has_value()) { + throw IcebergError(type.error().message); + } + return std::move(type.value()); } std::shared_ptr struct_(std::vector fields) { @@ -462,9 +618,52 @@ std::string_view ToString(TypeId id) { return "binary"; case TypeId::kUnknown: return "unknown"; + case TypeId::kVariant: + return "variant"; + case TypeId::kGeometry: + return "geometry"; + case TypeId::kGeography: + return "geography"; + } + + std::unreachable(); +} + +std::string_view ToString(EdgeAlgorithm algorithm) { + switch (algorithm) { + case EdgeAlgorithm::kSpherical: + return "spherical"; + case EdgeAlgorithm::kVincenty: + return "vincenty"; + case EdgeAlgorithm::kThomas: + return "thomas"; + case EdgeAlgorithm::kAndoyer: + return "andoyer"; + case EdgeAlgorithm::kKarney: + return "karney"; } std::unreachable(); } +Result EdgeAlgorithmFromString(std::string_view name) { + auto lower_name = StringUtils::ToLower(name); + if (lower_name == "spherical") { + return EdgeAlgorithm::kSpherical; + } + if (lower_name == "vincenty") { + return EdgeAlgorithm::kVincenty; + } + if (lower_name == "thomas") { + return EdgeAlgorithm::kThomas; + } + if (lower_name == "andoyer") { + return EdgeAlgorithm::kAndoyer; + } + if (lower_name == "karney") { + return EdgeAlgorithm::kKarney; + } + return InvalidArgument("Invalid edge interpolation algorithm: {}", name); +} + } // namespace iceberg diff --git a/src/iceberg/type.h b/src/iceberg/type.h index c0966759e..41484333d 100644 --- a/src/iceberg/type.h +++ b/src/iceberg/type.h @@ -46,20 +46,32 @@ class ICEBERG_EXPORT Type : public iceberg::util::Formattable { ~Type() override = default; /// \brief Get the type ID. - [[nodiscard]] virtual TypeId type_id() const = 0; + virtual TypeId type_id() const = 0; /// \brief Is this a primitive type (may not have child fields)? - [[nodiscard]] virtual bool is_primitive() const = 0; + virtual bool is_primitive() const = 0; /// \brief Is this a nested type (may have child fields)? - [[nodiscard]] virtual bool is_nested() const = 0; + virtual bool is_nested() const = 0; + + /// \brief Is this a struct type? + bool is_struct() const { return type_id() == TypeId::kStruct; } + + /// \brief Is this a list type? + bool is_list() const { return type_id() == TypeId::kList; } + + /// \brief Is this a map type? + bool is_map() const { return type_id() == TypeId::kMap; } + + /// \brief Is this a variant type? + bool is_variant() const { return type_id() == TypeId::kVariant; } /// \brief Compare two types for equality. friend bool operator==(const Type& lhs, const Type& rhs) { return lhs.Equals(rhs); } protected: /// \brief Compare two types for equality. - [[nodiscard]] virtual bool Equals(const Type& other) const = 0; + virtual bool Equals(const Type& other) const = 0; }; /// \brief A data type that does not have child fields. @@ -76,28 +88,27 @@ class ICEBERG_EXPORT NestedType : public Type { bool is_nested() const override { return true; } /// \brief Get a view of the child fields. - [[nodiscard]] virtual std::span fields() const = 0; + virtual std::span fields() const = 0; using SchemaFieldConstRef = std::reference_wrapper; /// \brief Get a field by field ID. /// /// \note This is O(1) complexity. - [[nodiscard]] virtual Result> GetFieldById( + virtual Result> GetFieldById( int32_t field_id) const = 0; /// \brief Get a field by index. /// /// \note This is O(1) complexity. - [[nodiscard]] virtual Result> GetFieldByIndex( + virtual Result> GetFieldByIndex( int32_t index) const = 0; /// \brief Get a field by name. Return an error Status if /// the field name is not unique; prefer GetFieldById or GetFieldByIndex /// when possible. /// /// \note This is O(1) complexity. - [[nodiscard]] virtual Result> GetFieldByName( + virtual Result> GetFieldByName( std::string_view name, bool case_sensitive) const = 0; /// \brief Get a field by name (case-sensitive). - [[nodiscard]] Result> GetFieldByName( - std::string_view name) const; + Result> GetFieldByName(std::string_view name) const; }; /// \defgroup type-nested Nested Types @@ -147,8 +158,11 @@ class ICEBERG_EXPORT ListType : public NestedType { constexpr static const TypeId kTypeId = TypeId::kList; constexpr static const std::string_view kElementName = "element"; - /// \brief Construct a list of the given element. The name of the child - /// field should be "element". + static Result> Make(SchemaField element); + + /// \brief Construct a list of the given element. + /// + /// Use Make or list to validate that the element field name is "element". explicit ListType(SchemaField element); /// \brief Construct a list of the given element type. ListType(int32_t field_id, std::shared_ptr type, bool optional); @@ -180,8 +194,11 @@ class ICEBERG_EXPORT MapType : public NestedType { constexpr static const std::string_view kKeyName = "key"; constexpr static const std::string_view kValueName = "value"; - /// \brief Construct a map of the given key/value fields. The field names - /// should be "key" and "value", respectively. + static Result> Make(SchemaField key, SchemaField value); + + /// \brief Construct a map of the given key/value fields. + /// + /// Use Make or map to validate that the field names are "key" and "value". explicit MapType(SchemaField key, SchemaField value); ~MapType() override = default; @@ -208,6 +225,30 @@ class ICEBERG_EXPORT MapType : public NestedType { /// @} +/// \defgroup type-semi-structured Semi-structured Types +/// Semi-structured types may contain values whose structure varies across rows. +/// @{ + +/// \brief A semi-structured type whose structure may vary across rows. +class ICEBERG_EXPORT VariantType : public Type { + public: + constexpr static const TypeId kTypeId = TypeId::kVariant; + + VariantType() = default; + ~VariantType() override = default; + + bool is_primitive() const override { return false; } + bool is_nested() const override { return false; } + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; +}; + +/// @} + /// \defgroup type-primitive Primitive Types /// Primitive types do not have nested fields. /// @{ @@ -296,14 +337,15 @@ class ICEBERG_EXPORT DecimalType : public PrimitiveType { constexpr static const int32_t kMaxPrecision = 38; /// \brief Construct a decimal type with the given precision and scale. + /// \throws IcebergError if precision is outside the supported range. DecimalType(int32_t precision, int32_t scale); ~DecimalType() override = default; /// \brief Get the precision (the number of decimal digits). - [[nodiscard]] int32_t precision() const; + int32_t precision() const; /// \brief Get the scale (essentially, the number of decimal digits after /// the decimal point; precisely, the value is scaled by $$10^{-s}$$.). - [[nodiscard]] int32_t scale() const; + int32_t scale() const; TypeId type_id() const override; std::string ToString() const override; @@ -353,9 +395,9 @@ class ICEBERG_EXPORT TimeType : public PrimitiveType { class ICEBERG_EXPORT TimestampBase : public PrimitiveType { public: /// \brief Is this type zoned or naive? - [[nodiscard]] virtual bool is_zoned() const = 0; + virtual bool is_zoned() const = 0; /// \brief The time resolution. - [[nodiscard]] virtual TimeUnit time_unit() const = 0; + virtual TimeUnit time_unit() const = 0; }; /// \brief A data type representing a timestamp in microseconds without @@ -471,11 +513,12 @@ class ICEBERG_EXPORT FixedType : public PrimitiveType { constexpr static const TypeId kTypeId = TypeId::kFixed; /// \brief Construct a fixed type with the given length. + /// \throws IcebergError if length is negative. explicit FixedType(int32_t length); ~FixedType() override = default; /// \brief The length (the number of bytes to store). - [[nodiscard]] int32_t length() const; + int32_t length() const; TypeId type_id() const override; std::string ToString() const override; @@ -518,11 +561,67 @@ class ICEBERG_EXPORT UnknownType : public PrimitiveType { bool Equals(const Type& other) const override; }; +/// \brief A data type representing OGC geometry in WKB format. +class ICEBERG_EXPORT GeometryType : public PrimitiveType { + public: + constexpr static const TypeId kTypeId = TypeId::kGeometry; + constexpr static std::string_view kDefaultCrs = "OGC:CRS84"; + + static Result> Make(); + static Result> Make(std::string crs); + ~GeometryType() override = default; + + std::string_view crs() const; + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; + + private: + GeometryType() = default; + explicit GeometryType(std::string crs); + + std::string crs_; +}; + +/// \brief A data type representing OGC geography in WKB format. +class ICEBERG_EXPORT GeographyType : public PrimitiveType { + public: + constexpr static const TypeId kTypeId = TypeId::kGeography; + constexpr static std::string_view kDefaultCrs = "OGC:CRS84"; + constexpr static EdgeAlgorithm kDefaultAlgorithm = EdgeAlgorithm::kSpherical; + + static Result> Make(); + static Result> Make(std::string crs); + static Result> Make(std::string crs, + EdgeAlgorithm algorithm); + ~GeographyType() override = default; + + std::string_view crs() const; + EdgeAlgorithm algorithm() const; + + TypeId type_id() const override; + std::string ToString() const override; + + protected: + bool Equals(const Type& other) const override; + + private: + GeographyType() = default; + explicit GeographyType(std::string crs); + GeographyType(std::string crs, EdgeAlgorithm algorithm); + + std::string crs_; + std::optional algorithm_; +}; + /// @} -/// \defgroup type-factories Factory functions for creating primitive data types +/// \defgroup type-factories Factory functions for creating data types /// -/// Factory functions for creating primitive data types +/// Factory functions for creating data types /// @{ /// \brief Return a BooleanType instance. @@ -555,18 +654,39 @@ ICEBERG_EXPORT const std::shared_ptr& string(); ICEBERG_EXPORT const std::shared_ptr& uuid(); /// \brief Return an UnknownType instance. ICEBERG_EXPORT const std::shared_ptr& unknown(); +/// \brief Return a VariantType instance. +ICEBERG_EXPORT const std::shared_ptr& variant(); +/// \brief Return the default GeometryType instance. +ICEBERG_EXPORT const std::shared_ptr& geometry(); +/// \brief Return the default GeographyType instance. +ICEBERG_EXPORT const std::shared_ptr& geography(); /// \brief Create a DecimalType with the given precision and scale. /// \param precision The number of decimal digits (max 38). /// \param scale The number of decimal digits after the decimal point. /// \return A shared pointer to the DecimalType instance. +/// \throws IcebergError if precision is outside the supported range. ICEBERG_EXPORT std::shared_ptr decimal(int32_t precision, int32_t scale); /// \brief Create a FixedType with the given length. /// \param length The number of bytes to store (must be >= 0). /// \return A shared pointer to the FixedType instance. +/// \throws IcebergError if length is negative. ICEBERG_EXPORT std::shared_ptr fixed(int32_t length); +/// \brief Create a GeometryType with the given CRS. +/// \throws IcebergError if crs is empty. +ICEBERG_EXPORT std::shared_ptr geometry(std::string crs); + +/// \brief Create a GeographyType with the given CRS. +/// \throws IcebergError if crs is empty. +ICEBERG_EXPORT std::shared_ptr geography(std::string crs); + +/// \brief Create a GeographyType with the given CRS and edge algorithm. +/// \throws IcebergError if crs is empty. +ICEBERG_EXPORT std::shared_ptr geography(std::string crs, + EdgeAlgorithm algorithm); + /// \brief Create a StructType with the given fields. /// \param fields The fields of the struct. /// \return A shared pointer to the StructType instance. @@ -575,12 +695,14 @@ ICEBERG_EXPORT std::shared_ptr struct_(std::vector fiel /// \brief Create a ListType with the given element field. /// \param element The element field of the list. /// \return A shared pointer to the ListType instance. +/// \throws IcebergError if element's name is not "element". ICEBERG_EXPORT std::shared_ptr list(SchemaField element); /// \brief Create a MapType with the given key and value fields. /// \param key The key field of the map. /// \param value The value field of the map. /// \return A shared pointer to the MapType instance. +/// \throws IcebergError if the key or value field has an invalid name. ICEBERG_EXPORT std::shared_ptr map(SchemaField key, SchemaField value); /// @} @@ -594,4 +716,10 @@ ICEBERG_EXPORT std::shared_ptr map(SchemaField key, SchemaField value); /// \return A string_view containing the lowercase type name ICEBERG_EXPORT std::string_view ToString(TypeId id); +/// \brief Get the lowercase string representation of an EdgeAlgorithm. +ICEBERG_EXPORT std::string_view ToString(EdgeAlgorithm algorithm); + +/// \brief Parse a lowercase edge algorithm name. +ICEBERG_EXPORT Result EdgeAlgorithmFromString(std::string_view name); + } // namespace iceberg diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 6c34d3a8d..0320f24ea 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -53,6 +53,9 @@ enum class TypeId { kFixed, kBinary, kUnknown, + kVariant, + kGeometry, + kGeography, }; /// \brief The time unit. In Iceberg V3 nanoseconds are also supported. @@ -61,6 +64,15 @@ enum class TimeUnit { kNanosecond, }; +/// \brief The algorithm used to interpolate geography edges. +enum class EdgeAlgorithm { + kSpherical, + kVincenty, + kThomas, + kAndoyer, + kKarney, +}; + /// \brief Data type family. class BinaryType; class BooleanType; @@ -86,6 +98,9 @@ class TimestampTzNsType; class Type; class UnknownType; class UuidType; +class VariantType; +class GeographyType; +class GeometryType; /// \brief Data values. class Decimal; diff --git a/src/iceberg/update/update_schema.cc b/src/iceberg/update/update_schema.cc index 0e7f147b0..5c50ee41d 100644 --- a/src/iceberg/update/update_schema.cc +++ b/src/iceberg/update/update_schema.cc @@ -181,6 +181,12 @@ class ApplyChangesVisitor { return base_type; } + Result> VisitVariant(const VariantType& variant_type, + const std::shared_ptr& base_type, + int32_t parent_id) { + return base_type; + } + private: Result> ProcessField( const SchemaField& field, const std::shared_ptr& field_type_result) { diff --git a/src/iceberg/util/struct_like_set.cc b/src/iceberg/util/struct_like_set.cc index 12648ea5e..35a0f9e28 100644 --- a/src/iceberg/util/struct_like_set.cc +++ b/src/iceberg/util/struct_like_set.cc @@ -342,6 +342,11 @@ Status ValidateScalarAgainstType(const Scalar& scalar, const Type& type) { return ValidateMapLikeAgainstType(*map, internal::checked_cast(type)); } + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + return NotSupported("Scalar validation for type {} is not supported", + type.ToString()); } std::unreachable(); diff --git a/src/iceberg/util/type_util.cc b/src/iceberg/util/type_util.cc index cb01be08f..1f1e02747 100644 --- a/src/iceberg/util/type_util.cc +++ b/src/iceberg/util/type_util.cc @@ -37,6 +37,8 @@ IdToFieldVisitor::IdToFieldVisitor( Status IdToFieldVisitor::Visit(const PrimitiveType& type) { return {}; } +Status IdToFieldVisitor::Visit(const VariantType& type) { return {}; } + Status IdToFieldVisitor::Visit(const NestedType& type) { const auto& nested = internal::checked_cast(type); const auto& fields = nested.fields(); @@ -64,7 +66,7 @@ Status NameToIdVisitor::Visit(const ListType& type, const std::string& path, const auto& field = type.fields()[0]; std::string new_path = BuildPath(path, field.name(), case_sensitive_); std::string new_short_path; - if (field.type()->type_id() == TypeId::kStruct) { + if (field.type()->is_struct()) { new_short_path = short_path; } else { new_short_path = BuildPath(short_path, field.name(), case_sensitive_); @@ -86,8 +88,7 @@ Status NameToIdVisitor::Visit(const MapType& type, const std::string& path, const auto& fields = type.fields(); for (const auto& field : fields) { new_path = BuildPath(path, field.name(), case_sensitive_); - if (field.name() == MapType::kValueName && - field.type()->type_id() == TypeId::kStruct) { + if (field.name() == MapType::kValueName && field.type()->is_struct()) { new_short_path = short_path; } else { new_short_path = BuildPath(short_path, field.name(), case_sensitive_); @@ -128,6 +129,11 @@ Status NameToIdVisitor::Visit(const PrimitiveType& type, const std::string& path return {}; } +Status NameToIdVisitor::Visit(const VariantType& type, const std::string& path, + const std::string& short_path) { + return {}; +} + std::string NameToIdVisitor::BuildPath(std::string_view prefix, std::string_view field_name, bool case_sensitive) { std::string quoted_name; @@ -168,6 +174,20 @@ Status PositionPathVisitor::Visit(const PrimitiveType& type) { return {}; } +Status PositionPathVisitor::Visit(const VariantType& type) { + if (current_field_id_ == kUnassignedFieldId) { + return InvalidSchema("Current field id is not assigned, type: {}", type.ToString()); + } + + if (auto ret = position_path_.try_emplace(current_field_id_, current_path_); + !ret.second) { + return InvalidSchema("Duplicate field id found: {}, prev path: {}, curr path: {}", + current_field_id_, ret.first->second, current_path_); + } + + return {}; +} + Status PositionPathVisitor::Visit(const StructType& type) { for (size_t i = 0; i < type.fields().size(); ++i) { const auto& field = type.fields()[i]; @@ -208,8 +228,8 @@ Result> PruneColumnVisitor::Visit( Result> PruneColumnVisitor::Visit(const SchemaField& field) const { if (selected_ids_.contains(field.field_id())) { - return (select_full_types_ || field.type()->is_primitive()) ? field.type() - : Visit(field.type()); + return (select_full_types_ || !field.type()->is_nested()) ? field.type() + : Visit(field.type()); } return Visit(field.type()); } @@ -278,6 +298,8 @@ GetProjectedIdsVisitor::GetProjectedIdsVisitor(bool include_struct_ids) Status GetProjectedIdsVisitor::Visit(const Type& type) { if (type.is_nested()) { return VisitNested(internal::checked_cast(type)); + } else if (type.is_variant()) { + return {}; } else { return VisitPrimitive(internal::checked_cast(type)); } @@ -288,9 +310,8 @@ Status GetProjectedIdsVisitor::VisitNested(const NestedType& type) { ICEBERG_RETURN_UNEXPECTED(Visit(*field.type())); } for (auto& field : type.fields()) { - // TODO(zhuo.wang) or is_variant - if ((include_struct_ids_ && field.type()->type_id() == TypeId::kStruct) || - field.type()->is_primitive()) { + if ((include_struct_ids_ && field.type()->is_struct()) || + !field.type()->is_nested()) { ids_.insert(field.field_id()); } } diff --git a/src/iceberg/util/type_util.h b/src/iceberg/util/type_util.h index 8fd5ef19f..8623ad254 100644 --- a/src/iceberg/util/type_util.h +++ b/src/iceberg/util/type_util.h @@ -45,6 +45,7 @@ class IdToFieldVisitor { std::unordered_map>& id_to_field); Status Visit(const PrimitiveType& type); + Status Visit(const VariantType& type); Status Visit(const NestedType& type); private: @@ -67,6 +68,8 @@ class NameToIdVisitor { const std::string& short_path); Status Visit(const PrimitiveType& type, const std::string& path, const std::string& short_path); + Status Visit(const VariantType& type, const std::string& path, + const std::string& short_path); void Finish(); private: @@ -85,6 +88,7 @@ class NameToIdVisitor { class PositionPathVisitor { public: Status Visit(const PrimitiveType& type); + Status Visit(const VariantType& type); Status Visit(const StructType& type); Status Visit(const ListType& type); Status Visit(const MapType& type); diff --git a/src/iceberg/util/visit_type.h b/src/iceberg/util/visit_type.h index bf52d2e9a..73fbbb5fd 100644 --- a/src/iceberg/util/visit_type.h +++ b/src/iceberg/util/visit_type.h @@ -127,21 +127,24 @@ inline Status VisitTypeIdInline(TypeId id, VISITOR* visitor, ARGS&&... args) { /// \brief Visit a type using a categorical visitor pattern /// /// This function provides a simplified visitor interface that groups Iceberg types into -/// four categories based on their structural properties: +/// five categories based on their structural properties: /// /// - **Struct types**: Complex types with named fields (StructType) /// - **List types**: Sequential container types (ListType) /// - **Map types**: Key-value container types (MapType) -/// - **Primitive types**: All leaf types without nested structure (14 primitive types) +/// - **Variant type**: Semi-structured type that is neither nested nor primitive +/// (VariantType) +/// - **Primitive types**: All leaf types without nested structure (primitive types) /// /// This grouping is useful for algorithms that need to distinguish between container /// types and leaf types, but don't require separate handling for each primitive type /// variant (e.g., Int vs Long vs String). /// -/// \tparam VISITOR Visitor class that must implement four Visit methods: +/// \tparam VISITOR Visitor class that must implement five Visit methods: /// - `VisitStruct(const StructType&, ARGS...)` for struct types /// - `VisitList(const ListType&, ARGS...)` for list types /// - `VisitMap(const MapType&, ARGS...)` for map types +/// - `VisitVariant(const VariantType&, ARGS...)` for the variant type /// - `VisitPrimitive(const PrimitiveType&, ARGS...)` for all primitive types /// \tparam ARGS Additional argument types forwarded to Visit methods /// \param type The type to visit diff --git a/src/iceberg/util/visitor_generate.h b/src/iceberg/util/visitor_generate.h index a5b0c2ced..ad6f5eb2d 100644 --- a/src/iceberg/util/visitor_generate.h +++ b/src/iceberg/util/visitor_generate.h @@ -39,6 +39,9 @@ namespace iceberg { ACTION(Fixed); \ ACTION(Binary); \ ACTION(Unknown); \ + ACTION(Variant); \ + ACTION(Geometry); \ + ACTION(Geography); \ ACTION(Struct); \ ACTION(List); \ ACTION(Map); @@ -49,7 +52,12 @@ namespace iceberg { /// - Struct types -> calls ACTION with Struct /// - List types -> calls ACTION with List /// - Map types -> calls ACTION with Map +/// - Variant type -> calls ACTION with Variant /// - All primitive types (default) -> calls ACTION with Primitive +/// +/// Variant is dispatched explicitly because it is neither a nested nor a primitive +/// type, so it must not be routed into the primitive default (which would cast it to +/// PrimitiveType). #define ICEBERG_TYPE_SWITCH_WITH_PRIMITIVE_DEFAULT(ACTION) \ case ::iceberg::TypeId::kStruct: \ ACTION(Struct) \ @@ -57,6 +65,8 @@ namespace iceberg { ACTION(List) \ case ::iceberg::TypeId::kMap: \ ACTION(Map) \ + case ::iceberg::TypeId::kVariant: \ + ACTION(Variant) \ default: \ ACTION(Primitive) From 5ac524624552c37faca652f9412ae89be3aa20ed Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Tue, 23 Jun 2026 13:32:46 +0800 Subject: [PATCH 116/151] fix: allow historical sort orders with dropped fields (#762) This fix is aligned with https://github.com/apache/iceberg/pull/16521 --- src/iceberg/json_serde.cc | 44 ++++++++++++----- src/iceberg/test/metadata_serde_test.cc | 63 +++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 13 deletions(-) diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index e137aed1d..a4810d88f 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -273,8 +273,14 @@ Result> SortFieldFromJson(const nlohmann::json& json) null_order); } -Result> SortOrderFromJson( - const nlohmann::json& json, const std::shared_ptr& current_schema) { +namespace { + +struct ParsedSortOrder { + int32_t order_id; + std::vector fields; +}; + +Result ParseSortOrder(const nlohmann::json& json) { ICEBERG_ASSIGN_OR_RAISE(auto order_id, GetJsonValue(json, kOrderId)); ICEBERG_ASSIGN_OR_RAISE(auto fields, GetJsonValue(json, kFields)); @@ -283,19 +289,30 @@ Result> SortOrderFromJson( ICEBERG_ASSIGN_OR_RAISE(auto sort_field, SortFieldFromJson(field_json)); sort_fields.push_back(std::move(*sort_field)); } - return SortOrder::Make(*current_schema, order_id, std::move(sort_fields)); + return ParsedSortOrder{.order_id = order_id, .fields = std::move(sort_fields)}; } -Result> SortOrderFromJson(const nlohmann::json& json) { - ICEBERG_ASSIGN_OR_RAISE(auto order_id, GetJsonValue(json, kOrderId)); - ICEBERG_ASSIGN_OR_RAISE(auto fields, GetJsonValue(json, kFields)); +} // namespace - std::vector sort_fields; - for (const auto& field_json : fields) { - ICEBERG_ASSIGN_OR_RAISE(auto sort_field, SortFieldFromJson(field_json)); - sort_fields.push_back(std::move(*sort_field)); +Result> SortOrderFromJson( + const nlohmann::json& json, const std::shared_ptr& current_schema, + int32_t default_sort_order_id) { + ICEBERG_ASSIGN_OR_RAISE(auto parsed, ParseSortOrder(json)); + if (parsed.order_id == default_sort_order_id) { + return SortOrder::Make(*current_schema, parsed.order_id, std::move(parsed.fields)); } - return SortOrder::Make(order_id, std::move(sort_fields)); + return SortOrder::Make(parsed.order_id, std::move(parsed.fields)); +} + +Result> SortOrderFromJson( + const nlohmann::json& json, const std::shared_ptr& current_schema) { + ICEBERG_ASSIGN_OR_RAISE(auto parsed, ParseSortOrder(json)); + return SortOrder::Make(*current_schema, parsed.order_id, std::move(parsed.fields)); +} + +Result> SortOrderFromJson(const nlohmann::json& json) { + ICEBERG_ASSIGN_OR_RAISE(auto parsed, ParseSortOrder(json)); + return SortOrder::Make(parsed.order_id, std::move(parsed.fields)); } nlohmann::json ToJson(const SchemaField& field) { @@ -1161,8 +1178,9 @@ Status ParseSortOrders(const nlohmann::json& json, int8_t format_version, ICEBERG_ASSIGN_OR_RAISE(auto sort_order_array, GetJsonValue(json, kSortOrders)); for (const auto& sort_order_json : sort_order_array) { - ICEBERG_ASSIGN_OR_RAISE(auto sort_order, - SortOrderFromJson(sort_order_json, current_schema)); + ICEBERG_ASSIGN_OR_RAISE( + auto sort_order, + SortOrderFromJson(sort_order_json, current_schema, default_sort_order_id)); sort_orders.push_back(std::move(sort_order)); } } else { diff --git a/src/iceberg/test/metadata_serde_test.cc b/src/iceberg/test/metadata_serde_test.cc index 48f88f2bc..ba47f312d 100644 --- a/src/iceberg/test/metadata_serde_test.cc +++ b/src/iceberg/test/metadata_serde_test.cc @@ -89,6 +89,50 @@ void AssertSnapshotById(const TableMetadata& metadata, int64_t snapshot_id, EXPECT_EQ(*snapshot.value(), expected_snapshot); } +nlohmann::json HistoricalSortOrderWithDroppedFieldMetadataJson( + int32_t default_sort_order_id) { + nlohmann::json metadata_json = R"({ + "format-version": 2, + "table-uuid": "test-uuid-1234", + "location": "s3://bucket/test", + "last-sequence-number": 0, + "last-updated-ms": 0, + "last-column-id": 2, + "schemas": [ + { + "type": "struct", + "schema-id": 1, + "fields": [ + {"id": 1, "name": "id", "type": "int", "required": true} + ] + } + ], + "current-schema-id": 1, + "partition-specs": [{"spec-id": 0, "fields": []}], + "default-spec-id": 0, + "last-partition-id": 999, + "sort-orders": [ + {"order-id": 1, "fields": [ + {"transform": "identity", "source-id": 1, "direction": "asc", "null-order": "nulls-first"}, + {"transform": "identity", "source-id": 2, "direction": "asc", "null-order": "nulls-first"} + ]}, + {"order-id": 2, "fields": [ + {"transform": "identity", "source-id": 1, "direction": "asc", "null-order": "nulls-first"} + ]} + ], + "properties": {}, + "current-snapshot-id": null, + "refs": {}, + "snapshots": [], + "statistics": [], + "partition-statistics": [], + "snapshot-log": [], + "metadata-log": [] + })"_json; + metadata_json["default-sort-order-id"] = default_sort_order_id; + return metadata_json; +} + } // namespace TEST(MetadataSerdeTest, DeserializeV1Valid) { @@ -486,6 +530,25 @@ TEST(MetadataSerdeTest, DeserializeV2MissingSortOrder) { "sort-orders must exist"); } +TEST(MetadataSerdeTest, DeserializeHistoricalSortOrderWithDroppedField) { + auto metadata = + TableMetadataFromJson(HistoricalSortOrderWithDroppedFieldMetadataJson(2)); + ASSERT_THAT(metadata, IsOk()); + ASSERT_EQ(metadata.value()->sort_orders.size(), 2); + EXPECT_EQ(metadata.value()->sort_orders[0]->order_id(), 1); + ASSERT_EQ(metadata.value()->sort_orders[0]->fields().size(), 2); + EXPECT_EQ(metadata.value()->sort_orders[0]->fields()[0].source_id(), 1); + EXPECT_EQ(metadata.value()->sort_orders[0]->fields()[1].source_id(), 2); + EXPECT_EQ(metadata.value()->sort_orders[1]->order_id(), 2); +} + +TEST(MetadataSerdeTest, DeserializeDefaultSortOrderWithDroppedFieldFails) { + auto metadata = + TableMetadataFromJson(HistoricalSortOrderWithDroppedFieldMetadataJson(1)); + ASSERT_THAT(metadata, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(metadata, HasErrorMessage("Cannot find source column for sort field")); +} + TEST(MetadataSerdeTest, EncryptionKeysRoundTrip) { nlohmann::json metadata_json = R"({ "format-version": 2, From af4b76f2f806f026d921e9a8dea2b8ffbee30dc1 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Tue, 23 Jun 2026 17:00:41 +0800 Subject: [PATCH 117/151] feat: add StoredLength method to PositionOutputStream (#773) --- src/iceberg/arrow/arrow_io.cc | 10 ++++++++++ src/iceberg/file_io.h | 6 ++++++ src/iceberg/puffin/puffin_writer.cc | 2 +- src/iceberg/test/arrow_io_test.cc | 15 +++++++++++++++ src/iceberg/test/std_io.h | 12 ++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/iceberg/arrow/arrow_io.cc b/src/iceberg/arrow/arrow_io.cc index 6b159ca89..4c795badf 100644 --- a/src/iceberg/arrow/arrow_io.cc +++ b/src/iceberg/arrow/arrow_io.cc @@ -378,6 +378,13 @@ class ArrowPositionOutputStream : public PositionOutputStream { return position; } + Result StoredLength() const override { + if (!output_->closed()) { + return Position(); + } + return closed_position_; + } + Status Write(std::span data) override { ICEBERG_ASSIGN_OR_RAISE(auto size, ToInt64Length(data.size())); ICEBERG_ARROW_RETURN_NOT_OK(output_->Write(data.data(), size)); @@ -393,12 +400,15 @@ class ArrowPositionOutputStream : public PositionOutputStream { if (output_->closed()) { return {}; } + ICEBERG_ASSIGN_OR_RAISE(auto position, Position()); ICEBERG_ARROW_RETURN_NOT_OK(output_->Close()); + closed_position_ = position; return {}; } private: std::shared_ptr<::arrow::io::OutputStream> output_; + int64_t closed_position_ = 0; }; class ArrowInputFile : public InputFile { diff --git a/src/iceberg/file_io.h b/src/iceberg/file_io.h index 1f91fb0c1..ba6f0129a 100644 --- a/src/iceberg/file_io.h +++ b/src/iceberg/file_io.h @@ -66,6 +66,12 @@ class ICEBERG_EXPORT PositionOutputStream { /// \brief Return the current write position. virtual Result Position() const = 0; + /// \brief Return the current stored length of the output. + /// + /// This can differ from the current position for encrypting streams, and for other + /// non-length-preserving streams. + virtual Result StoredLength() const { return Position(); } + /// \brief Write all bytes in data at the current position. virtual Status Write(std::span data) = 0; diff --git a/src/iceberg/puffin/puffin_writer.cc b/src/iceberg/puffin/puffin_writer.cc index db749117f..9c173ab52 100644 --- a/src/iceberg/puffin/puffin_writer.cc +++ b/src/iceberg/puffin/puffin_writer.cc @@ -155,7 +155,7 @@ Status PuffinWriter::Finish() { footer_written_ = true; ICEBERG_RETURN_UNEXPECTED(stream_->Flush()); ICEBERG_RETURN_UNEXPECTED(stream_->Close()); - ICEBERG_ASSIGN_OR_RAISE(file_size_, stream_->Position()); + ICEBERG_ASSIGN_OR_RAISE(file_size_, stream_->StoredLength()); finished_ = true; return {}; } diff --git a/src/iceberg/test/arrow_io_test.cc b/src/iceberg/test/arrow_io_test.cc index 4ac83469c..a30e2da93 100644 --- a/src/iceberg/test/arrow_io_test.cc +++ b/src/iceberg/test/arrow_io_test.cc @@ -410,6 +410,21 @@ TEST_F(LocalFileIOTest, StdReadKeepsPositionAvailableAtEof) { EXPECT_THAT(stream->Position(), HasValue(::testing::Eq(3))); } +TEST(ArrowFileIOTest, OutputStoredLengthAfterClose) { + auto file_io = arrow::ArrowFileSystemFileIO::MakeMockFileIO(); + ICEBERG_UNWRAP_OR_FAIL(auto output_file, file_io->NewOutputFile("output")); + ICEBERG_UNWRAP_OR_FAIL(auto output, output_file->Create()); + + std::array data = {std::byte{'a'}, std::byte{'b'}, std::byte{'c'}}; + ASSERT_THAT(output->Write(data), IsOk()); + ASSERT_THAT(output->Close(), IsOk()); + + auto position = output->Position(); + ASSERT_FALSE(position.has_value()); + EXPECT_THAT(position.error().message, ::testing::HasSubstr("closed")); + EXPECT_THAT(output->StoredLength(), HasValue(::testing::Eq(3))); +} + TEST_F(LocalFileIOTest, ResolvesForeignSchemeToUnderlyingPath) { ASSERT_THAT(file_io_->WriteFile(temp_filepath_, "hello world"), IsOk()); diff --git a/src/iceberg/test/std_io.h b/src/iceberg/test/std_io.h index 3866bddf0..725fc7ba5 100644 --- a/src/iceberg/test/std_io.h +++ b/src/iceberg/test/std_io.h @@ -170,6 +170,18 @@ class StdPositionOutputStream : public PositionOutputStream { return static_cast(position); } + Result StoredLength() const override { + if (file_.is_open()) { + return Position(); + } + std::error_code ec; + auto size = std::filesystem::file_size(location_, ec); + if (ec) { + return IOError("Failed to get file size for {}: {}", location_, ec.message()); + } + return detail::ToInt64FileSize(size, location_); + } + Status Write(std::span data) override { if (data.empty()) { return {}; From f6f99513980251336ca70a8c6a0059b19332e3a4 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Tue, 23 Jun 2026 21:54:02 +0800 Subject: [PATCH 118/151] ci: upgrade to ubuntu-26.04 image (#771) --- .github/workflows/asf-allowlist-check.yml | 2 +- .github/workflows/aws_test.yml | 16 ++++++++-------- .github/workflows/cpp-linter.yml | 2 +- .github/workflows/rc.yml | 8 ++++---- .github/workflows/sanitizer_test.yml | 2 +- .github/workflows/sql_catalog_test.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- .github/workflows/zizmor.yml | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 202852115..0c10af655 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -36,7 +36,7 @@ permissions: jobs: asf-allowlist-check: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-slim steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml index 388d7508e..47c54241d 100644 --- a/.github/workflows/aws_test.yml +++ b/.github/workflows/aws_test.yml @@ -47,15 +47,15 @@ jobs: fail-fast: false matrix: include: - - title: Ubuntu 24.04, S3 + SigV4, bundled AWS SDK - runs-on: ubuntu-24.04 + - title: Ubuntu 26.04, S3 + SigV4, bundled AWS SDK + runs-on: ubuntu-26.04 CC: gcc-14 CXX: g++-14 s3: "ON" sigv4: "ON" bundle_awssdk: "ON" - - title: Ubuntu 24.04, S3 + SigV4, system AWS SDK - runs-on: ubuntu-24.04 + - title: Ubuntu 26.04, S3 + SigV4, system AWS SDK + runs-on: ubuntu-26.04 CC: gcc-14 CXX: g++-14 s3: "ON" @@ -84,7 +84,7 @@ jobs: - name: Install dependencies on Ubuntu if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} shell: bash - run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev libjitterentropy3-dev - name: Cache vcpkg packages if: ${{ startsWith(matrix.runs-on, 'ubuntu') && matrix.bundle_awssdk == 'OFF' }} uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 @@ -143,8 +143,8 @@ jobs: # its CMake config, not pkg-config whose Cflags force -std=c++11). meson-sigv4: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - name: Meson SigV4 (AMD64 Ubuntu 24.04) - runs-on: ubuntu-24.04 + name: Meson SigV4 (AMD64 Ubuntu 26.04) + runs-on: ubuntu-26.04 timeout-minutes: 45 env: SCCACHE_DIR: ${{ github.workspace }}/.sccache @@ -160,7 +160,7 @@ jobs: - name: Install build dependencies shell: bash run: | - sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev libjitterentropy3-dev python3 -m pip install --upgrade pip python3 -m pip install -r requirements.txt - name: Cache vcpkg packages diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 377e806ad..2e3e022d6 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -34,7 +34,7 @@ concurrency: jobs: cpp-linter: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 permissions: contents: read pull-requests: write diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 7241981c5..6fcdb3342 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -31,7 +31,7 @@ permissions: jobs: archive: name: Archive - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 5 steps: - name: Checkout @@ -79,10 +79,10 @@ jobs: matrix: os: - macos-26 - - ubuntu-24.04 + - ubuntu-26.04 # - windows-latest include: - - os: ubuntu-24.04 + - os: ubuntu-26.04 CC: gcc-14 CXX: g++-14 steps: @@ -130,7 +130,7 @@ jobs: if: github.ref_type == 'tag' needs: - verify - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 permissions: contents: write steps: diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index e461bd1ed..0910b9215 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -38,7 +38,7 @@ jobs: sanitizer-test: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: "ASAN and UBSAN Tests" - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 env: SCCACHE_DIR: ${{ github.workspace }}/.sccache SCCACHE_CACHE_SIZE: "2G" diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index d089ae4c6..768299889 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -47,8 +47,8 @@ jobs: fail-fast: false matrix: include: - - title: AMD64 Ubuntu 24.04 - runs-on: ubuntu-24.04 + - title: AMD64 Ubuntu 26.04 + runs-on: ubuntu-26.04 CC: gcc-14 CXX: g++-14 cmake_build_type: Debug diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a51a29866..e63101194 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,8 +40,8 @@ env: jobs: ubuntu: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} - name: AMD64 Ubuntu 24.04 - runs-on: ubuntu-24.04 + name: AMD64 Ubuntu 26.04 + runs-on: ubuntu-26.04 timeout-minutes: 30 strategy: fail-fast: false @@ -195,8 +195,8 @@ jobs: fail-fast: false matrix: include: - - title: AMD64 Ubuntu 24.04 - runs-on: ubuntu-24.04 + - title: AMD64 Ubuntu 26.04 + runs-on: ubuntu-26.04 CC: gcc-14 CXX: g++-14 meson-setup-args: -Drest_integration_test=enabled diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index f6665ffae..388431627 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -36,7 +36,7 @@ jobs: zizmor: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Run zizmor 🌈 - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 permissions: {} steps: - name: Checkout repository From ed051a702c940f7a08b3e38e01b7774efe0cc899 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Tue, 23 Jun 2026 23:08:53 +0800 Subject: [PATCH 119/151] feat: add row delta update (#721) Implements the RowDelta update builder, table and transaction factory methods, and focused tests for row-level add/delete flows. --------- Co-authored-by: Codex --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/table.cc | 15 + src/iceberg/table.h | 7 + src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/row_delta_test.cc | 413 +++++++++++++++++++ src/iceberg/test/table_test.cc | 2 + src/iceberg/transaction.cc | 8 + src/iceberg/transaction.h | 3 + src/iceberg/type_fwd.h | 1 + src/iceberg/update/merging_snapshot_update.h | 14 +- src/iceberg/update/meson.build | 1 + src/iceberg/update/row_delta.cc | 193 +++++++++ src/iceberg/update/row_delta.h | 176 ++++++++ 14 files changed, 830 insertions(+), 6 deletions(-) create mode 100644 src/iceberg/test/row_delta_test.cc create mode 100644 src/iceberg/update/row_delta.cc create mode 100644 src/iceberg/update/row_delta.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index ea76c641a..9a0dc68b7 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -106,6 +106,7 @@ set(ICEBERG_SOURCES update/merge_append.cc update/merging_snapshot_update.cc update/pending_update.cc + update/row_delta.cc update/set_snapshot.cc update/snapshot_manager.cc update/snapshot_update.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 7bd2e052c..ab514be87 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -131,6 +131,7 @@ iceberg_sources = files( 'update/merge_append.cc', 'update/merging_snapshot_update.cc', 'update/pending_update.cc', + 'update/row_delta.cc', 'update/set_snapshot.cc', 'update/snapshot_manager.cc', 'update/snapshot_update.cc', diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index 817e5917c..afa626964 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -35,6 +35,7 @@ #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" +#include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" #include "iceberg/update/update_location.h" @@ -231,6 +232,12 @@ Result> Table::NewDeleteFiles() { return DeleteFiles::Make(name().name, std::move(ctx)); } +Result> Table::NewRowDelta() { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); + return RowDelta::Make(name().name, std::move(ctx)); +} + Result> Table::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE( auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); @@ -334,6 +341,14 @@ Result> StaticTable::NewMergeAppend() { return NotSupported("Cannot create a merge append for a static table"); } +Result> StaticTable::NewDeleteFiles() { + return NotSupported("Cannot create delete files for a static table"); +} + +Result> StaticTable::NewRowDelta() { + return NotSupported("Cannot create a row delta for a static table"); +} + Result> StaticTable::NewSnapshotManager() { return NotSupported("Cannot create a snapshot manager for a static table"); } diff --git a/src/iceberg/table.h b/src/iceberg/table.h index b71a1ddbc..c8f6ded08 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -182,6 +182,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Create a new DeleteFiles to delete data files and commit the changes. virtual Result> NewDeleteFiles(); + /// \brief Create a new RowDelta to add rows and row-level deletes. + virtual Result> NewRowDelta(); + /// \brief Create a new SnapshotManager to manage snapshots and snapshot references. virtual Result> NewSnapshotManager(); @@ -251,6 +254,10 @@ class ICEBERG_EXPORT StaticTable : public Table { Result> NewMergeAppend() override; + Result> NewDeleteFiles() override; + + Result> NewRowDelta() override; + Result> NewSnapshotManager() override; private: diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index c681de8c9..e528b1333 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -230,6 +230,7 @@ if(ICEBERG_BUILD_BUNDLE) merge_append_test.cc merging_snapshot_update_test.cc name_mapping_update_test.cc + row_delta_test.cc snapshot_manager_test.cc transaction_test.cc update_location_test.cc diff --git a/src/iceberg/test/row_delta_test.cc b/src/iceberg/test/row_delta_test.cc new file mode 100644 index 000000000..5906e7e39 --- /dev/null +++ b/src/iceberg/test/row_delta_test.cc @@ -0,0 +1,413 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/row_delta.h" + +#include +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/update/delete_files.h" +#include "iceberg/update/fast_append.h" + +namespace iceberg { + +class RowDeltaTest : public MinimalUpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + MinimalUpdateTestBase::SetUp(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + auto file = std::make_shared(); + file->content = DataFile::Content::kData; + file->file_path = table_location_ + path; + file->file_format = FileFormatType::kParquet; + file->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + file->file_size_in_bytes = 1024; + file->record_count = 100; + file->partition_spec_id = spec_->spec_id(); + return file; + } + + std::shared_ptr MakeDeleteFile(const std::string& path, int64_t partition_x) { + auto file = MakeDataFile(path, partition_x); + file->content = DataFile::Content::kPositionDeletes; + file->file_size_in_bytes = 256; + file->record_count = 7; + return file; + } + + std::shared_ptr MakeDeletionVector(const std::string& path, + const std::string& referenced_data_file, + int64_t partition_x, + int64_t content_offset = 0) { + auto file = MakeDeleteFile(path, partition_x); + file->file_format = FileFormatType::kPuffin; + file->referenced_data_file = referenced_data_file; + file->content_offset = content_offset; + file->content_size_in_bytes = 10; + return file; + } + + void AppendFileAToTable() { + ICEBERG_UNWRAP_OR_FAIL(auto fast_append, table_->NewFastAppend()); + fast_append->AppendFile(file_a_); + EXPECT_THAT(fast_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + void SetTableFormatVersion(int8_t format_version) { + table_->metadata()->format_version = format_version; + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; +}; + +TEST_F(RowDeltaTest, AddRowsCommitsAppendOperation) { + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddRows(file_a_); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kAppend)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "100"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedFileSize), "1024"); +} + +TEST_F(RowDeltaTest, AddDeletesCommitsDeleteOperation) { + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kDelete)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedPosDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedPosDeletes), "7"); +} + +TEST_F(RowDeltaTest, RemoveRowsCommitsOverwriteOperation) { + AppendFileAToTable(); + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->RemoveRows(file_a_); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kOverwrite)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedRecords), "100"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedFileSize), "1024"); +} + +TEST_F(RowDeltaTest, RemoveRowsAndAddDeletesCommitsDeleteOperation) { + AppendFileAToTable(); + + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->RemoveRows(file_a_); + row_delta->AddDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kDelete)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); +} + +TEST_F(RowDeltaTest, AddRowsAndRemoveDeletesCommitsAppendOperation) { + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + { + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddRows(file_a_); + row_delta->RemoveDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kAppend)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles), "1"); +} + +TEST_F(RowDeltaTest, AddDeletesAndRemoveDeletesCommitsDeleteOperation) { + auto old_delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + { + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(old_delete_file); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + auto new_delete_file = MakeDeleteFile("/delete/file_b_pos_deletes.parquet", + /*partition_x=*/2L); + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(new_delete_file); + row_delta->RemoveDeletes(old_delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kDelete)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles), "1"); +} + +TEST_F(RowDeltaTest, ValidateNoConflictingDataFilesFailsForConcurrentAppend) { + AppendFileAToTable(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto concurrent_append, table_->NewFastAppend()); + concurrent_append->AppendFile(file_b_); + EXPECT_THAT(concurrent_append->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto file_c = MakeDataFile("/data/file_c.parquet", /*partition_x=*/3L); + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateFromSnapshot(starting_snapshot->snapshot_id); + row_delta->ValidateNoConflictingDataFiles(); + row_delta->AddRows(file_c); + + auto result = row_delta->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Found conflicting files")); + EXPECT_THAT(result, HasErrorMessage(file_b_->file_path)); +} + +TEST_F(RowDeltaTest, ValidateNoConflictingDeleteFilesFailsForConcurrentDelete) { + AppendFileAToTable(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + std::shared_ptr concurrent_delta; + ICEBERG_UNWRAP_OR_FAIL(concurrent_delta, table_->NewRowDelta()); + concurrent_delta->AddDeletes(delete_file); + EXPECT_THAT(concurrent_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto file_c = MakeDataFile("/data/file_c.parquet", /*partition_x=*/3L); + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateFromSnapshot(starting_snapshot->snapshot_id); + row_delta->ValidateNoConflictingDeleteFiles(); + row_delta->AddRows(file_c); + + auto result = row_delta->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Found new conflicting delete files")); + EXPECT_THAT(result, HasErrorMessage(delete_file->file_path)); +} + +TEST_F(RowDeltaTest, ValidateDataFilesExistSkipsConcurrentDeleteByDefault) { + AppendFileAToTable(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFile(file_a_); + EXPECT_THAT(delete_files->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + delete_file->referenced_data_file = file_a_->file_path; + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateFromSnapshot(starting_snapshot->snapshot_id); + std::vector referenced_files{file_a_->file_path}; + row_delta->ValidateDataFilesExist(referenced_files); + row_delta->AddDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); +} + +TEST_F(RowDeltaTest, + ValidateDataFilesExistFailsForConcurrentDeleteWithValidateDeletedFiles) { + AppendFileAToTable(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + + ICEBERG_UNWRAP_OR_FAIL(auto delete_files, table_->NewDeleteFiles()); + delete_files->DeleteFile(file_a_); + EXPECT_THAT(delete_files->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + delete_file->referenced_data_file = file_a_->file_path; + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateFromSnapshot(starting_snapshot->snapshot_id); + std::vector referenced_files{file_a_->file_path}; + row_delta->ValidateDataFilesExist(referenced_files); + row_delta->ValidateDeletedFiles(); + row_delta->AddDeletes(delete_file); + + auto result = row_delta->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot commit, missing data files")); + EXPECT_THAT(result, HasErrorMessage(file_a_->file_path)); +} + +TEST_F(RowDeltaTest, CannotRemoveReferencedDataFile) { + AppendFileAToTable(); + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + std::vector referenced_files{file_a_->file_path}; + row_delta->ValidateDataFilesExist(referenced_files); + row_delta->RemoveRows(file_a_); + + auto result = row_delta->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot delete data files")); + EXPECT_THAT(result, HasErrorMessage(file_a_->file_path)); +} + +TEST_F(RowDeltaTest, AddDeleteFileForRemovedDataFileCommitsDeleteOperation) { + AppendFileAToTable(); + + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + delete_file->referenced_data_file = file_a_->file_path; + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->RemoveRows(file_a_); + row_delta->AddDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->Operation(), std::make_optional(DataOperation::kDelete)); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles), "1"); +} + +TEST_F(RowDeltaTest, ValidateDeletedFilesAllowsMissingRowsOnEmptyTable) { + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateDeletedFiles(); + row_delta->RemoveRows(file_a_); + + EXPECT_THAT(row_delta->Commit(), IsOk()); +} + +TEST_F(RowDeltaTest, ValidateDeletedFilesAllowsMissingDeletesOnEmptyTable) { + auto delete_file = MakeDeleteFile("/delete/file_a_pos_deletes.parquet", + /*partition_x=*/1L); + + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateDeletedFiles(); + row_delta->RemoveDeletes(delete_file); + + EXPECT_THAT(row_delta->Commit(), IsOk()); +} + +TEST_F(RowDeltaTest, AddDeletionVectorValidatesConcurrentDVs) { + AppendFileAToTable(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + SetTableFormatVersion(3); + + auto concurrent_dv = + MakeDeletionVector("/delete/concurrent-dv-a.puffin", file_a_->file_path, + /*partition_x=*/1L, /*content_offset=*/0); + std::shared_ptr concurrent_delta; + ICEBERG_UNWRAP_OR_FAIL(concurrent_delta, table_->NewRowDelta()); + concurrent_delta->AddDeletes(concurrent_dv); + EXPECT_THAT(concurrent_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + SetTableFormatVersion(3); + + auto dv = MakeDeletionVector("/delete/dv-a.puffin", file_a_->file_path, + /*partition_x=*/1L, /*content_offset=*/10); + std::shared_ptr row_delta; + ICEBERG_UNWRAP_OR_FAIL(row_delta, table_->NewRowDelta()); + row_delta->ValidateFromSnapshot(starting_snapshot->snapshot_id); + row_delta->AddDeletes(dv); + + auto result = row_delta->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Found concurrently added DV")); + EXPECT_THAT(result, HasErrorMessage(file_a_->file_path)); +} + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index 881c4fdd0..d7ebe4a0a 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -161,6 +161,8 @@ TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) { EXPECT_THAT(table->NewUpdatePartitionStatistics(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewFastAppend(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewMergeAppend(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewDeleteFiles(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewRowDelta(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported)); } diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index ac1f08241..e911a61dc 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -37,6 +37,7 @@ #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" #include "iceberg/update/pending_update.h" +#include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" #include "iceberg/update/snapshot_update.h" @@ -505,6 +506,13 @@ Result> Transaction::NewDeleteFiles() { return delete_files; } +Result> Transaction::NewRowDelta() { + ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr row_delta, + RowDelta::Make(ctx_->table->name().name, ctx_)); + ICEBERG_RETURN_UNEXPECTED(AddUpdate(row_delta)); + return row_delta; +} + Result> Transaction::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_statistics, UpdateStatistics::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index 52a0605c6..34ca78bd7 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -112,6 +112,9 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> NewDeleteFiles(); + /// \brief Create a new RowDelta to add rows and row-level deletes. + Result> NewRowDelta(); + /// \brief Create a new SnapshotManager to manage snapshots. Result> NewSnapshotManager(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 0320f24ea..f29bc4a1a 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -243,6 +243,7 @@ class ExpireSnapshots; class FastAppend; class MergeAppend; class PendingUpdate; +class RowDelta; class SetSnapshot; class SnapshotManager; class SnapshotUpdate; diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h index 879403222..fc3987ee1 100644 --- a/src/iceberg/update/merging_snapshot_update.h +++ b/src/iceberg/update/merging_snapshot_update.h @@ -288,6 +288,14 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { const std::shared_ptr& parent, std::shared_ptr io, bool case_sensitive = true); + /// \brief Return an error if a staged deletion vector conflicts with a deletion + /// vector added since starting_snapshot_id. + Status ValidateAddedDVs(const TableMetadata& metadata, + std::optional starting_snapshot_id, + std::shared_ptr conflict_filter, + const std::shared_ptr& parent, + std::shared_ptr io) const; + private: struct PendingDeleteFile { std::shared_ptr file; @@ -324,12 +332,6 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { Status AddDeleteFile(std::shared_ptr file, std::optional data_sequence_number); - Status ValidateAddedDVs(const TableMetadata& metadata, - std::optional starting_snapshot_id, - std::shared_ptr conflict_filter, - const std::shared_ptr& parent, - std::shared_ptr io) const; - Status ManagersReady() const; void SetSummaryProperty(const std::string& property, const std::string& value) override; diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 9f950e8d0..4f594a06e 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -23,6 +23,7 @@ install_headers( 'merge_append.h', 'merging_snapshot_update.h', 'pending_update.h', + 'row_delta.h', 'set_snapshot.h', 'snapshot_manager.h', 'snapshot_update.h', diff --git a/src/iceberg/update/row_delta.cc b/src/iceberg/update/row_delta.cc new file mode 100644 index 000000000..dd3f50c58 --- /dev/null +++ b/src/iceberg/update/row_delta.cc @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/row_delta.h" + +#include +#include +#include +#include +#include + +#include "iceberg/expression/expressions.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/transaction.h" +#include "iceberg/util/error_collector.h" +#include "iceberg/util/formatter_internal.h" +#include "iceberg/util/macros.h" +#include "iceberg/util/snapshot_util_internal.h" + +namespace iceberg { + +Result> RowDelta::Make( + std::string table_name, std::shared_ptr ctx) { + ICEBERG_PRECHECK(!table_name.empty(), "Table name cannot be empty"); + ICEBERG_PRECHECK(ctx != nullptr, "Cannot create RowDelta without a context"); + return std::unique_ptr(new RowDelta(std::move(table_name), std::move(ctx))); +} + +RowDelta::RowDelta(std::string table_name, std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)), + conflict_detection_filter_(Expressions::AlwaysTrue()) {} + +RowDelta& RowDelta::AddRows(const std::shared_ptr& inserts) { + ICEBERG_BUILDER_RETURN_IF_ERROR(AddDataFile(inserts)); + return *this; +} + +RowDelta& RowDelta::AddDeletes(const std::shared_ptr& deletes) { + ICEBERG_BUILDER_RETURN_IF_ERROR(AddDeleteFile(deletes)); + return *this; +} + +RowDelta& RowDelta::RemoveRows(const std::shared_ptr& file) { + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDataFile(file)); + removed_data_files_.insert(file); + return *this; +} + +RowDelta& RowDelta::RemoveDeletes(const std::shared_ptr& deletes) { + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDeleteFile(deletes)); + return *this; +} + +RowDelta& RowDelta::ValidateFromSnapshot(int64_t snapshot_id) { + starting_snapshot_id_ = snapshot_id; + return *this; +} + +RowDelta& RowDelta::CaseSensitive(bool case_sensitive) { + MergingSnapshotUpdate::CaseSensitive(case_sensitive); + return *this; +} + +RowDelta& RowDelta::ValidateDataFilesExist( + std::span referenced_files) { + for (const auto& file : referenced_files) { + referenced_data_files_.insert(file); + } + return *this; +} + +RowDelta& RowDelta::ValidateDeletedFiles() { + validate_deletes_ = true; + return *this; +} + +RowDelta& RowDelta::ConflictDetectionFilter(std::shared_ptr filter) { + ICEBERG_BUILDER_CHECK(filter != nullptr, "Conflict detection filter cannot be null"); + conflict_detection_filter_ = std::move(filter); + return *this; +} + +RowDelta& RowDelta::ValidateNoConflictingDataFiles() { + validate_new_data_files_ = true; + return *this; +} + +RowDelta& RowDelta::ValidateNoConflictingDeleteFiles() { + validate_new_delete_files_ = true; + return *this; +} + +std::string RowDelta::operation() { + if (AddsDataFiles() && !AddsDeleteFiles() && !DeletesDataFiles()) { + return DataOperation::kAppend; + } + + if (AddsDeleteFiles() && !AddsDataFiles()) { + return DataOperation::kDelete; + } + + return DataOperation::kOverwrite; +} + +Status RowDelta::Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) { + if (snapshot == nullptr) { + return {}; + } + + if (validate_deletes_) { + FailMissingDeletePaths(); + } + + if (starting_snapshot_id_.has_value()) { + ICEBERG_ASSIGN_OR_RAISE(bool is_ancestor, SnapshotUtil::IsAncestorOf( + current_metadata, snapshot->snapshot_id, + starting_snapshot_id_.value())); + ICEBERG_CHECK(is_ancestor, "Snapshot {} is not an ancestor of {}", + starting_snapshot_id_.value(), snapshot->snapshot_id); + } + + auto io = ctx_->table->io(); + if (!referenced_data_files_.empty()) { + ICEBERG_RETURN_UNEXPECTED(MergingSnapshotUpdate::ValidateDataFilesExist( + current_metadata, starting_snapshot_id_, referenced_data_files_, + /*skip_deletes=*/!validate_deletes_, conflict_detection_filter_, snapshot, io, + IsCaseSensitive())); + } + + if (validate_new_data_files_) { + ICEBERG_RETURN_UNEXPECTED(MergingSnapshotUpdate::ValidateAddedDataFiles( + current_metadata, starting_snapshot_id_, conflict_detection_filter_, snapshot, io, + IsCaseSensitive())); + } + + if (validate_new_delete_files_) { + // validate that explicitly deleted files have not had added deletes + if (!removed_data_files_.empty()) { + ICEBERG_RETURN_UNEXPECTED(MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + current_metadata, starting_snapshot_id_, conflict_detection_filter_, + removed_data_files_, snapshot, io, IsCaseSensitive())); + } + + // validate that previous deletes do not conflict with added deletes + ICEBERG_RETURN_UNEXPECTED(MergingSnapshotUpdate::ValidateNoNewDeleteFiles( + current_metadata, starting_snapshot_id_, conflict_detection_filter_, snapshot, io, + IsCaseSensitive())); + } + + ICEBERG_RETURN_UNEXPECTED(ValidateNoConflictingFileAndPositionDeletes()); + + return MergingSnapshotUpdate::ValidateAddedDVs( + current_metadata, starting_snapshot_id_, conflict_detection_filter_, snapshot, io); +} + +Status RowDelta::ValidateNoConflictingFileAndPositionDeletes() const { + std::vector conflicting_files; + for (const auto& file : removed_data_files_) { + if (file != nullptr && referenced_data_files_.contains(file->file_path)) { + conflicting_files.push_back(file->file_path); + } + } + + if (!conflicting_files.empty()) { + return ValidationFailed( + "Cannot delete data files {} that are referenced by new delete files", + FormatRange(conflicting_files, ", ", "[", "]")); + } + + return {}; +} + +} // namespace iceberg diff --git a/src/iceberg/update/row_delta.h b/src/iceberg/update/row_delta.h new file mode 100644 index 000000000..ddb54d836 --- /dev/null +++ b/src/iceberg/update/row_delta.h @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/update/row_delta.h + +#include +#include +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/merging_snapshot_update.h" +#include "iceberg/util/data_file_set.h" + +namespace iceberg { + +/// \brief API for encoding row-level changes to a table. +/// +/// This API accumulates data and delete file changes, produces a new Snapshot +/// of the table, and commits that snapshot as current. +/// +/// When committing, these changes are applied to the latest table snapshot. +/// Commit conflicts are resolved by applying the changes to the new latest +/// snapshot and reattempting the commit. +class ICEBERG_EXPORT RowDelta : public MergingSnapshotUpdate { + public: + /// \brief Create a new RowDelta instance. + static Result> Make(std::string table_name, + std::shared_ptr ctx); + + /// \brief Add a data file to the table. + /// + /// \param inserts A data file of rows to insert. + /// \return This RowDelta for method chaining. + RowDelta& AddRows(const std::shared_ptr& inserts); + + /// \brief Add a delete file to the table. + /// + /// \param deletes A delete file of rows to delete. + /// \return This RowDelta for method chaining. + RowDelta& AddDeletes(const std::shared_ptr& deletes); + + /// \brief Remove a data file from the table. + /// + /// \param file A data file. + /// \return This RowDelta for method chaining. + RowDelta& RemoveRows(const std::shared_ptr& file); + + /// \brief Remove a rewritten delete file from the table. + /// + /// \param deletes A delete file that can be removed from the table. + /// \return This RowDelta for method chaining. + RowDelta& RemoveDeletes(const std::shared_ptr& deletes); + + /// \brief Set the snapshot ID used in any reads for this operation. + /// + /// Validations check changes after this snapshot ID. If the from snapshot is + /// not set, all ancestor snapshots through the table's initial snapshot are + /// validated. + /// + /// \param snapshot_id A snapshot ID. + /// \return This RowDelta for method chaining. + RowDelta& ValidateFromSnapshot(int64_t snapshot_id); + + /// \brief Enable or disable case-sensitive expression binding for validations. + /// + /// \param case_sensitive Whether expression binding should be case sensitive. + /// \return This RowDelta for method chaining. + RowDelta& CaseSensitive(bool case_sensitive); + + /// \brief Add data file paths that must not be removed by conflicting commits. + /// + /// If any path has been removed by a conflicting commit in the table since + /// the snapshot passed to ValidateFromSnapshot(), the operation fails. + /// + /// By default, this validation checks only rewrite and overwrite commits. To + /// apply validation to delete commits, call ValidateDeletedFiles(). + /// + /// \param referenced_files File paths that are referenced by a position + /// delete file. + /// \return This RowDelta for method chaining. + RowDelta& ValidateDataFilesExist(std::span referenced_files); + + /// \brief Enable validation that referenced data files were not deleted. + /// + /// If a data file has a row deleted using a position delete file, rewriting + /// or overwriting the data file concurrently would un-delete the row. Deleting + /// the data file is normally allowed, but a delete may be part of a + /// transaction that reads and re-appends a row. This method is used to + /// validate deletes for the transaction case. + /// + /// \return This RowDelta for method chaining. + RowDelta& ValidateDeletedFiles(); + + /// \brief Set a conflict detection filter used to validate added files. + /// + /// If not called, a true literal is used as the conflict detection filter. + /// + /// \param filter An expression on rows in the table. + /// \return This RowDelta for method chaining. + RowDelta& ConflictDetectionFilter(std::shared_ptr filter); + + /// \brief Enable validation that concurrent data files do not conflict. + /// + /// This method should be called when the table is queried to determine which + /// files to delete or append. If a concurrent operation commits a new file + /// after the data was read and that file might contain rows matching the + /// conflict detection filter, this operation detects that during retries and + /// fails. + /// + /// Calling this method is required to maintain serializable isolation for + /// update/delete operations. Otherwise, the isolation level is snapshot + /// isolation. + /// + /// Validation uses the filter passed to ConflictDetectionFilter() and applies + /// to operations after the snapshot passed to ValidateFromSnapshot(). + /// + /// \return This RowDelta for method chaining. + RowDelta& ValidateNoConflictingDataFiles(); + + /// \brief Enable validation that concurrent delete files do not conflict. + /// + /// This method must be called when the table is queried to produce a row + /// delta for UPDATE and MERGE operations independently of the isolation level. + /// Calling this method is not required for DELETE operations because it is OK + /// to delete a record that is also deleted concurrently. + /// + /// Validation uses the filter passed to ConflictDetectionFilter() and applies + /// to operations after the snapshot passed to ValidateFromSnapshot(). + /// + /// \return This RowDelta for method chaining. + RowDelta& ValidateNoConflictingDeleteFiles(); + + std::string operation() override; + + protected: + Status Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) override; + + private: + explicit RowDelta(std::string table_name, std::shared_ptr ctx); + + Status ValidateNoConflictingFileAndPositionDeletes() const; + + std::optional starting_snapshot_id_; + std::unordered_set referenced_data_files_; + DataFileSet removed_data_files_; + bool validate_deletes_ = false; + std::shared_ptr conflict_detection_filter_; + bool validate_new_data_files_ = false; + bool validate_new_delete_files_ = false; +}; + +} // namespace iceberg From 3c9d13d4072362b68e00dc246cb3cedf93217a76 Mon Sep 17 00:00:00 2001 From: lishuxu Date: Wed, 24 Jun 2026 11:09:20 +0800 Subject: [PATCH 120/151] feat(update): add OverwriteFiles for overwrite snapshot commits (#741) Summary: Add a production OverwriteFiles builder that brings iceberg-cpp to semantic parity with Java's BaseOverwriteFiles. It supports explicit file replacement (DeleteFile + AddFile) and range-based replacement (OverwriteByRowFilter + AddFile) with the same family of pre-commit concurrency validations. The builder is a thin subclass of MergingSnapshotUpdate and reuses the existing commit kernel (Apply/summary/retry/cleanup) unchanged. Changes: - New OverwriteFiles class (src/iceberg/update/overwrite_files.{h,cc}) and Table::NewOverwrite() / Transaction::NewOverwrite() entry points. - Builder surface: AddFile, DeleteFile, bulk DeleteFiles, OverwriteByRowFilter, ValidateFromSnapshot, ConflictDetectionFilter, ValidateNoConflictingData, ValidateNoConflictingDeletes, ValidateAddedFilesMatchOverwriteFilter, WithCaseSensitivity. - Validate(): conflict-filter resolution, concurrent add/delete conflict checks, and strict added-file range validation (projection + StrictMetricsEvaluator). - Tests (overwrite_files_test.cc, 45 cases) and CMake/meson wiring. Behavior alignment with Java: - operation() returns append/delete/overwrite from builder content. - Conflict-filter resolution mirrors BaseOverwriteFiles (explicit -> row filter -> AlwaysTrue); replaced-file delete checks honor ConflictDetectionFilter. - Strict added-file validation uses a single DataSpec(), rejecting multi-spec and empty added-file sets. - Deviations: public WithCaseSensitivity (vs caseSensitive) to avoid a protected-name clash; ValidateFromSnapshot rejects negative ids early. --------- Co-authored-by: shuxu.li --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/table.cc | 11 + src/iceberg/table.h | 5 + src/iceberg/test/CMakeLists.txt | 3 +- src/iceberg/test/overwrite_files_test.cc | 692 ++++++++++++++++++ src/iceberg/test/table_test.cc | 1 + src/iceberg/transaction.cc | 8 + src/iceberg/transaction.h | 3 + src/iceberg/type_fwd.h | 1 + src/iceberg/update/delete_files.h | 47 +- src/iceberg/update/fast_append.h | 37 +- src/iceberg/update/merge_append.h | 28 +- src/iceberg/update/merging_snapshot_update.cc | 7 +- src/iceberg/update/merging_snapshot_update.h | 30 +- src/iceberg/update/meson.build | 1 + src/iceberg/update/overwrite_files.cc | 243 ++++++ src/iceberg/update/overwrite_files.h | 201 +++++ src/iceberg/update/row_delta.h | 13 +- src/iceberg/update/snapshot_update.h | 43 +- 20 files changed, 1301 insertions(+), 75 deletions(-) create mode 100644 src/iceberg/test/overwrite_files_test.cc create mode 100644 src/iceberg/update/overwrite_files.cc create mode 100644 src/iceberg/update/overwrite_files.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 9a0dc68b7..aa051cd14 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -105,6 +105,7 @@ set(ICEBERG_SOURCES update/fast_append.cc update/merge_append.cc update/merging_snapshot_update.cc + update/overwrite_files.cc update/pending_update.cc update/row_delta.cc update/set_snapshot.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index ab514be87..58d79a402 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -130,6 +130,7 @@ iceberg_sources = files( 'update/fast_append.cc', 'update/merge_append.cc', 'update/merging_snapshot_update.cc', + 'update/overwrite_files.cc', 'update/pending_update.cc', 'update/row_delta.cc', 'update/set_snapshot.cc', diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index afa626964..9dbc5acf7 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -35,6 +35,7 @@ #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" +#include "iceberg/update/overwrite_files.h" #include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" @@ -238,6 +239,12 @@ Result> Table::NewRowDelta() { return RowDelta::Make(name().name, std::move(ctx)); } +Result> Table::NewOverwrite() { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); + return OverwriteFiles::Make(name().name, std::move(ctx)); +} + Result> Table::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE( auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); @@ -349,6 +356,10 @@ Result> StaticTable::NewRowDelta() { return NotSupported("Cannot create a row delta for a static table"); } +Result> StaticTable::NewOverwrite() { + return NotSupported("Cannot create an overwrite for a static table"); +} + Result> StaticTable::NewSnapshotManager() { return NotSupported("Cannot create a snapshot manager for a static table"); } diff --git a/src/iceberg/table.h b/src/iceberg/table.h index c8f6ded08..64ed21ef8 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -185,6 +185,9 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Create a new RowDelta to add rows and row-level deletes. virtual Result> NewRowDelta(); + /// \brief Create a new OverwriteFiles to overwrite data files and commit the changes. + virtual Result> NewOverwrite(); + /// \brief Create a new SnapshotManager to manage snapshots and snapshot references. virtual Result> NewSnapshotManager(); @@ -258,6 +261,8 @@ class ICEBERG_EXPORT StaticTable : public Table { Result> NewRowDelta() override; + Result> NewOverwrite() override; + Result> NewSnapshotManager() override; private: diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index e528b1333..0756c1eef 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -239,7 +239,8 @@ if(ICEBERG_BUILD_BUNDLE) update_properties_test.cc update_schema_test.cc update_sort_order_test.cc - update_statistics_test.cc) + update_statistics_test.cc + overwrite_files_test.cc) add_iceberg_test(data_test USE_BUNDLE diff --git a/src/iceberg/test/overwrite_files_test.cc b/src/iceberg/test/overwrite_files_test.cc new file mode 100644 index 000000000..5d4d851f1 --- /dev/null +++ b/src/iceberg/test/overwrite_files_test.cc @@ -0,0 +1,692 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/overwrite_files.h" + +#include +#include +#include + +#include +#include + +#include "iceberg/avro/avro_register.h" +#include "iceberg/constants.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/partition_field.h" +#include "iceberg/partition_spec.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/schema.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/transaction.h" +#include "iceberg/transform.h" +#include "iceberg/update/fast_append.h" +#include "iceberg/update/row_delta.h" +#include "iceberg/util/data_file_set.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +// The base table (TableMetadataV2ValidMinimal.json) has schema {x: long (id 1), +// y: long (id 2), z: long (id 3)} and partitions by identity(x). +class OverwriteFilesTest : public UpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + std::string MetadataResource() const override { + return "TableMetadataV2ValidMinimal.json"; + } + + void SetUp() override { + UpdateTestBase::SetUp(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x, + int64_t record_count = 100) { + auto f = std::make_shared(); + f->content = DataFile::Content::kData; + f->file_path = table_location_ + path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + f->file_size_in_bytes = 1024; + f->record_count = record_count; + f->partition_spec_id = spec_->spec_id(); + return f; + } + + // Add y metrics so StrictMetricsEvaluator can prove row-filter containment. + std::shared_ptr MakeDataFileWithYBounds(const std::string& path, + int64_t partition_x, int64_t y_lower, + int64_t y_upper) { + auto f = MakeDataFile(path, partition_x); + f->lower_bounds = {{2, Literal::Long(y_lower).Serialize().value()}}; + f->upper_bounds = {{2, Literal::Long(y_upper).Serialize().value()}}; + f->value_counts = {{2, f->record_count}}; + f->null_value_counts = {{2, 0}}; + return f; + } + + std::shared_ptr MakeDeleteFile(const std::string& path, int64_t partition_x) { + auto f = MakeDataFile(path, partition_x); + f->content = DataFile::Content::kPositionDeletes; + return f; + } + + std::shared_ptr MakeEqualityDeleteFile(const std::string& path, + int64_t partition_x) { + auto f = MakeDeleteFile(path, partition_x); + f->content = DataFile::Content::kEqualityDeletes; + f->equality_ids = {1}; + return f; + } + + void CommitEqualityDelete(const std::string& delete_path, int64_t partition_x) { + auto del_file = MakeEqualityDeleteFile(delete_path, partition_x); + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(del_file); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + Result> NewOverwrite() { + return table_->NewOverwrite(); + } + + int64_t CommitFileA() { + auto fa = table_->NewFastAppend(); + EXPECT_TRUE(fa.has_value()); + fa.value()->AppendFile(file_a_); + EXPECT_THAT(fa.value()->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + auto snap = table_->current_snapshot(); + EXPECT_TRUE(snap.has_value()); + return snap.value()->snapshot_id; + } + + std::shared_ptr CommitFastAppend(const std::shared_ptr& file) { + auto fa = table_->NewFastAppend(); + EXPECT_TRUE(fa.has_value()); + fa.value()->AppendFile(file); + EXPECT_THAT(fa.value()->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + auto snap = table_->current_snapshot(); + EXPECT_TRUE(snap.has_value()); + return snap.value(); + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; +}; + +TEST_F(OverwriteFilesTest, TxnNewOverwrite) { + ICEBERG_UNWRAP_OR_FAIL(auto txn, Transaction::Make(table_, TransactionKind::kUpdate)); + ICEBERG_UNWRAP_OR_FAIL(auto op, txn->NewOverwrite()); + ASSERT_NE(op, nullptr); + + (*op).OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))).AddFile(file_a_); + + EXPECT_THAT(op->Commit(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto committed, txn->Commit()); + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kOverwrite); +} + +TEST_F(OverwriteFilesTest, DeleteAndAddCommit) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFile(file_a_); + op->AddFile(file_b_); + const std::string expected_operation = op->operation(); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), expected_operation); + EXPECT_EQ(expected_operation, DataOperation::kOverwrite); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); +} + +TEST_F(OverwriteFilesTest, RowFilterAndAddCommit) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/new_x1.parquet", 1L)); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kOverwrite); +} + +TEST_F(OverwriteFilesTest, EmptyCommit) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + EXPECT_EQ(op->operation(), DataOperation::kOverwrite); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kOverwrite); +} + +TEST_F(OverwriteFilesTest, DeduplicatesFiles) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + auto add = MakeDataFile("/data/dup_add.parquet", 1L); + op->DeleteFile(file_a_); + op->DeleteFile(file_a_); // duplicate delete + op->AddFile(add); + op->AddFile(add); // duplicate add + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); +} + +TEST_F(OverwriteFilesTest, StageOnly) { + const int64_t base_snapshot_id = CommitFileA(); + const size_t base_snapshot_count = table_->metadata()->snapshots.size(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->StageOnly(); + op->AddFile(file_b_); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + // The staged snapshot is recorded but the main branch still points at file_a's + // snapshot. + ICEBERG_UNWRAP_OR_FAIL(auto current, table_->current_snapshot()); + EXPECT_EQ(current->snapshot_id, base_snapshot_id); + EXPECT_GT(table_->metadata()->snapshots.size(), base_snapshot_count); +} + +TEST_F(OverwriteFilesTest, TargetBranch) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->SetTargetBranch("audit"); + op->AddFile(file_b_); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + EXPECT_TRUE(table_->metadata()->refs.contains("audit")); +} + +TEST_F(OverwriteFilesTest, CustomSummary) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->Set("custom-prop", "custom-value"); + op->AddFile(file_b_); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at("custom-prop"), "custom-value"); +} + +// With no matching committed delete file, deleting `del_file` is a harmless no-op. +TEST_F(OverwriteFilesTest, BulkDeleteCommit) { + { + ICEBERG_UNWRAP_OR_FAIL(auto seed, NewOverwrite()); + seed->AddFile(file_a_); + EXPECT_THAT(seed->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); + + DataFileSet data_files; + data_files.insert(file_a_); + DeleteFileSet delete_files; + delete_files.insert(del_file); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFiles(data_files, delete_files); + op->AddFile(file_b_); + EXPECT_EQ(op->operation(), DataOperation::kOverwrite); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "1"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles), "1"); +} + +TEST_F(OverwriteFilesTest, BulkDeleteData) { + { + ICEBERG_UNWRAP_OR_FAIL(auto seed, NewOverwrite()); + seed->AddFile(file_a_); + seed->AddFile(file_b_); + EXPECT_THAT(seed->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + DataFileSet data_files; + data_files.insert(file_a_); + data_files.insert(file_b_); + op->DeleteFiles(data_files, DeleteFileSet{}); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles), "2"); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kTotalDataFiles), "0"); +} + +// OverwriteFiles validates content because the C++ API stores data and delete files in +// DataFile pointers, while Java uses separate DataFile/DeleteFile types. +TEST_F(OverwriteFilesTest, AddRejectsDeleteContent) { + auto del_file = MakeDeleteFile("/delete/del_as_data.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->AddFile(del_file); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid data file to add")); + EXPECT_THAT(result, HasErrorMessage("has delete-file content")); +} + +TEST_F(OverwriteFilesTest, DeleteRejectsDeleteContent) { + auto del_file = MakeDeleteFile("/delete/del_as_delete.parquet", 1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFile(del_file); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid data file to delete")); + EXPECT_THAT(result, HasErrorMessage("has delete-file content")); +} + +TEST_F(OverwriteFilesTest, BulkRejectsDeleteAsData) { + auto del_file = + MakeDeleteFile("/delete/del_a.parquet", 1L); // content = positionDeletes + DataFileSet data_files; + data_files.insert(del_file); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFiles(data_files, DeleteFileSet{}); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("has delete-file content")); +} + +TEST_F(OverwriteFilesTest, BulkRejectsDataAsDelete) { + DeleteFileSet delete_files; + delete_files.insert(file_a_); // content = kData + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFiles(DataFileSet{}, delete_files); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("has data-file content")); +} + +TEST_F(OverwriteFilesTest, BulkAcceptsEqualityDelete) { + auto eq_delete = MakeEqualityDeleteFile("/delete/eq_a.parquet", 1L); + DeleteFileSet delete_files; + delete_files.insert(eq_delete); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFiles(DataFileSet{}, delete_files); + op->AddFile(file_b_); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, NoConflictingDeletesFails) { + const int64_t first_id = CommitFileA(); + + { + ICEBERG_UNWRAP_OR_FAIL(auto competing, NewOverwrite()); + competing->DeleteFile(file_a_); + EXPECT_THAT(competing->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/replacement_after_delete.parquet", 1L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingDeletes(); + EXPECT_THAT(op->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(OverwriteFilesTest, NoConflictingDeletesPasses) { + const int64_t first_id = CommitFileA(); + CommitFastAppend(file_b_); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/replacement_no_conflict.parquet", 1L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingDeletes(); + EXPECT_THAT(op->Commit(), IsOk()); +} + +// Explicit replaced-file validation checks concurrent deletes covering replaced files. +TEST_F(OverwriteFilesTest, ExplicitDeleteConflict) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + CommitEqualityDelete("/delete/concurrent_x1.parquet", /*partition_x=*/1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFile(file_a_); + op->AddFile(MakeDataFile("/data/rewrite_x1.parquet", 1L)); + op->ValidateFromSnapshot(first_snapshot->snapshot_id); + op->ValidateNoConflictingDeletes(); + EXPECT_THAT(op->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +// A narrower conflict filter can exclude the concurrent delete. +TEST_F(OverwriteFilesTest, ExplicitDeleteFilterScope) { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + CommitEqualityDelete("/delete/concurrent_x1.parquet", /*partition_x=*/1L); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFile(file_a_); + op->AddFile(MakeDataFile("/data/rewrite_x1.parquet", 1L)); + op->ValidateFromSnapshot(first_snapshot->snapshot_id); + op->ConflictDetectionFilter(Expressions::Equal("x", Literal::Long(2L))); + op->ValidateNoConflictingDeletes(); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, StrictRangeByProjection) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/in_partition.parquet", 1L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, StrictRangeByMetrics) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("y", Literal::Long(5L))); + // y bounds [5, 5] prove every row has y == 5. + op->AddFile(MakeDataFileWithYBounds("/data/y_eq_5.parquet", 1L, 5L, 5L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, StrictRangeRejectsPartialMetrics) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("y", Literal::Long(5L))); + // y bounds [1, 10] do not prove every row has y == 5. + op->AddFile(MakeDataFileWithYBounds("/data/y_range.parquet", 1L, 1L, 10L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, + HasErrorMessage("Cannot append file with rows that do not match filter")); +} + +TEST_F(OverwriteFilesTest, StrictRangeRejectsOutsidePartition) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/wrong_partition.parquet", /*partition_x=*/2L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, + HasErrorMessage("Cannot append file with rows that do not match filter")); +} + +TEST_F(OverwriteFilesTest, StrictRangeRequiresFilter) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->AddFile(MakeDataFile("/data/no_filter.parquet", 1L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, + HasErrorMessage("Cannot append file with rows that do not match filter")); +} + +TEST_F(OverwriteFilesTest, StrictRangeRejectsMultipleSpecs) { + // Add the second spec before creating the builder so staged files can resolve it. + ICEBERG_UNWRAP_OR_FAIL( + auto spec1, PartitionSpec::Make(*schema_, /*spec_id=*/1, + {PartitionField(/*source_id=*/1, /*field_id=*/1001, + "x_v1", Transform::Identity())}, + /*allow_missing_fields=*/false)); + table_->metadata()->partition_specs.push_back( + std::shared_ptr(std::move(spec1))); + ASSERT_THAT(table_->metadata()->PartitionSpecById(0), IsOk()); + ASSERT_THAT(table_->metadata()->PartitionSpecById(1), IsOk()); + + auto file_spec0 = MakeDataFile("/data/spec0_x1.parquet", 1L); // partition_spec_id 0 + auto file_spec1 = MakeDataFile("/data/spec1_x1.parquet", 1L); + file_spec1->partition_spec_id = 1; + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(file_spec0); + op->AddFile(file_spec1); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Cannot return a single partition spec")); +} + +TEST_F(OverwriteFilesTest, StrictRangeRejectsNoAdds) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("Cannot determine partition specs")); +} + +// Strict-range validation binds the row filter with the configured case sensitivity. +TEST_F(OverwriteFilesTest, StrictRangeCaseSensitivity) { + { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("X", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/cs.parquet", 1L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + auto result = op->Commit(); + EXPECT_FALSE(result.has_value()); + } + { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->CaseSensitive(false); + op->OverwriteByRowFilter(Expressions::Equal("X", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/ci.parquet", 1L)); + op->ValidateAddedFilesMatchOverwriteFilter(); + EXPECT_THAT(op->Commit(), IsOk()); + } +} + +TEST_F(OverwriteFilesTest, NullAddFileRejected) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->AddFile(nullptr); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid data file: null")); +} + +TEST_F(OverwriteFilesTest, NullDeleteFileRejected) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->DeleteFile(nullptr); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid data file: null")); +} + +TEST_F(OverwriteFilesTest, NullRowFilterRejected) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(nullptr); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid row filter expression: null")); +} + +TEST_F(OverwriteFilesTest, NullConflictFilterRejected) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->ConflictDetectionFilter(nullptr); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid conflict detection filter: null")); +} + +TEST_F(OverwriteFilesTest, RejectsNegativeSnapshotId) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->AddFile(file_a_).ValidateFromSnapshot(-1); + auto result = op->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid snapshot id")); +} + +TEST_F(OverwriteFilesTest, AcceptsZeroSnapshotId) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->AddFile(file_a_).ValidateFromSnapshot(0); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, OperationMatrix) { + struct Case { + bool add; + bool delete_file; + bool row_filter; + std::string expected; + }; + const std::vector cases = { + {.add = true, + .delete_file = false, + .row_filter = false, + .expected = DataOperation::kAppend}, + {.add = false, + .delete_file = true, + .row_filter = false, + .expected = DataOperation::kDelete}, + {.add = false, + .delete_file = false, + .row_filter = true, + .expected = DataOperation::kDelete}, // row filter counts as a delete + {.add = true, + .delete_file = true, + .row_filter = false, + .expected = DataOperation::kOverwrite}, + {.add = true, + .delete_file = false, + .row_filter = true, + .expected = DataOperation::kOverwrite}, + {.add = false, + .delete_file = true, + .row_filter = true, + .expected = DataOperation::kDelete}, // deletes only + {.add = false, + .delete_file = false, + .row_filter = false, + .expected = DataOperation::kOverwrite}, // neither + }; + + int index = 0; + for (const auto& c : cases) { + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + if (c.add) { + op->AddFile(MakeDataFile("/data/tt_add" + std::to_string(index) + ".parquet", 1L)); + } + if (c.delete_file) { + op->DeleteFile( + MakeDataFile("/data/tt_del" + std::to_string(index) + ".parquet", 1L)); + } + if (c.row_filter) { + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + } + EXPECT_EQ(op->operation(), c.expected) << "case index " << index; + ++index; + } +} + +TEST_F(OverwriteFilesTest, DefaultConflictFilter) { + const int64_t first_id = CommitFileA(); + CommitFastAppend(file_b_); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->AddFile(MakeDataFile("/data/r2_ok.parquet", 1L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingData(); + EXPECT_THAT(op->Commit(), IsOk()); +} + +TEST_F(OverwriteFilesTest, ConflictFilterMatchesAdd) { + const int64_t first_id = CommitFileA(); + CommitFastAppend(file_b_); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(2L))); + op->AddFile(MakeDataFile("/data/r2_conflict.parquet", 2L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingData(); + EXPECT_THAT(op->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(OverwriteFilesTest, ConflictFilterUsesExplicitFilter) { + const int64_t first_id = CommitFileA(); + CommitFastAppend(file_b_); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->ConflictDetectionFilter(Expressions::Equal("x", Literal::Long(2L))); + op->AddFile(MakeDataFile("/data/r1.parquet", 1L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingData(); + EXPECT_THAT(op->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +TEST_F(OverwriteFilesTest, ExplicitReplaceConflicts) { + const int64_t first_id = CommitFileA(); + CommitFastAppend(file_b_); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); + op->OverwriteByRowFilter(Expressions::Equal("x", Literal::Long(1L))); + op->DeleteFile(file_a_); + op->AddFile(MakeDataFile("/data/r3.parquet", 1L)); + op->ValidateFromSnapshot(first_id); + op->ValidateNoConflictingData(); + EXPECT_THAT(op->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index d7ebe4a0a..ef21f12d6 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -163,6 +163,7 @@ TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) { EXPECT_THAT(table->NewMergeAppend(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewDeleteFiles(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewRowDelta(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewOverwrite(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported)); } diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index e911a61dc..169e7ec90 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -36,6 +36,7 @@ #include "iceberg/update/expire_snapshots.h" #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" +#include "iceberg/update/overwrite_files.h" #include "iceberg/update/pending_update.h" #include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" @@ -513,6 +514,13 @@ Result> Transaction::NewRowDelta() { return row_delta; } +Result> Transaction::NewOverwrite() { + ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr overwrite, + OverwriteFiles::Make(ctx_->table->name().name, ctx_)); + ICEBERG_RETURN_UNEXPECTED(AddUpdate(overwrite)); + return overwrite; +} + Result> Transaction::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_statistics, UpdateStatistics::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index 34ca78bd7..49b607d60 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -115,6 +115,9 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> NewRowDelta(); + /// \brief Create a new OverwriteFiles to overwrite data files and commit the changes. + Result> NewOverwrite(); + /// \brief Create a new SnapshotManager to manage snapshots. Result> NewSnapshotManager(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index f29bc4a1a..784b3e03b 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -242,6 +242,7 @@ class DeleteFiles; class ExpireSnapshots; class FastAppend; class MergeAppend; +class OverwriteFiles; class PendingUpdate; class RowDelta; class SetSnapshot; diff --git a/src/iceberg/update/delete_files.h b/src/iceberg/update/delete_files.h index 1be08e35b..7e567830e 100644 --- a/src/iceberg/update/delete_files.h +++ b/src/iceberg/update/delete_files.h @@ -34,27 +34,58 @@ namespace iceberg { /// \brief API for deleting data files from a table. /// -/// This accumulates data-file deletions, produces a new snapshot, and commits that -/// snapshot as current. File paths are matched exactly against table metadata values; -/// equivalent but differently-normalized URIs are not considered matches. +/// This API accumulates file deletions, produces a new Snapshot of the table, +/// and commits that snapshot as current. When committing, these changes are +/// applied to the latest table snapshot. Commit conflicts are resolved by +/// applying the changes to the new latest snapshot and reattempting the commit. +/// +/// File paths are matched exactly against table metadata values; equivalent but +/// differently-normalized URIs are not considered matches. class ICEBERG_EXPORT DeleteFiles : public MergingSnapshotUpdate { public: static Result> Make( std::string table_name, std::shared_ptr ctx); - /// \brief Delete a data-file path from the table. + /// \brief Delete a file by path from the underlying table. + /// + /// \param path A path to remove from the table. + /// \return This DeleteFiles for method chaining. DeleteFiles& DeleteFile(std::string_view path); - /// \brief Delete a data file tracked by object identity and path. + /// \brief Delete a file tracked by a DataFile from the underlying table. + /// + /// \param file A DataFile to remove from the table. + /// \return This DeleteFiles for method chaining. DeleteFiles& DeleteFile(const std::shared_ptr& file); - /// \brief Delete files whose rows all match the given expression. + /// \brief Delete files that match an expression on data rows from the table. + /// + /// A file is selected to be deleted by the expression if it could contain any + /// rows that match the expression. Candidate files are selected using an + /// inclusive partition projection. These candidate files are deleted if all of + /// the rows in the file must match the expression, determined by the + /// expression's strict partition projection. This guarantees that files are + /// deleted if and only if all rows in the file must match the expression. + /// + /// Files that may contain some rows that match the expression and some rows + /// that do not will result in a validation error. + /// + /// \param expr An expression on rows in the table. + /// \return This DeleteFiles for method chaining. DeleteFiles& DeleteFromRowFilter(std::shared_ptr expr); - /// \brief Set case sensitivity for expression binding. + /// \brief Enable or disable case-sensitive expression binding for validations. + /// + /// \param case_sensitive Whether expression binding should be case sensitive. + /// \return This DeleteFiles for method chaining. DeleteFiles& CaseSensitive(bool case_sensitive); - /// \brief Validate that explicitly requested deleted files still exist. + /// \brief Enable validation that deleted files still exist. + /// + /// If this method is called, any files that are part of the deletion must + /// still exist when committing the operation. + /// + /// \return This DeleteFiles for method chaining. DeleteFiles& ValidateFilesExist(); std::string operation() override; diff --git a/src/iceberg/update/fast_append.h b/src/iceberg/update/fast_append.h index 07018989c..f5e1ceaba 100644 --- a/src/iceberg/update/fast_append.h +++ b/src/iceberg/update/fast_append.h @@ -34,36 +34,43 @@ namespace iceberg { -/// \brief Appending new files in a table. +/// \brief API for appending new files in a table. /// -/// FastAppend is optimized for appending new data files to a table, it creates new -/// manifest files for the added data without compacting or rewriting existing manifests, -/// making it faster for write-heavy workloads. +/// This API accumulates file additions, produces a new Snapshot of the table, +/// and commits that snapshot as current. When committing, these changes are +/// applied to the latest table snapshot. Commit conflicts are resolved by +/// applying the changes to the new latest snapshot and reattempting the commit. +/// +/// FastAppend is optimized for appending new data files to a table. It creates +/// new manifest files for the added data without compacting or rewriting +/// existing manifests. class ICEBERG_EXPORT FastAppend : public SnapshotUpdate { public: /// \brief Create a new FastAppend instance. /// /// \param table_name The name of the table - /// \param transaction The transaction to use for this update + /// \param ctx The transaction context to use for this update /// \return A Result containing the FastAppend instance or an error static Result> Make( std::string table_name, std::shared_ptr ctx); - /// \brief Append a data file to this update. + /// \brief Append a DataFile to the table. /// - /// \param file The data file to append - /// \return Reference to this for method chaining + /// \param file A data file. + /// \return This FastAppend for method chaining. FastAppend& AppendFile(const std::shared_ptr& file); - /// \brief Append a manifest file to this update. + /// \brief Append a ManifestFile to the table. + /// + /// The manifest must contain only appended files. All files in the manifest + /// are appended to the table in the snapshot created by this update. /// - /// The manifest must only contain added files (no existing or deleted files). - /// If the manifest doesn't have a snapshot ID assigned and snapshot ID inheritance - /// is enabled, it will be used directly. Otherwise, it will be copied with the - /// new snapshot ID. + /// If the manifest doesn't have a snapshot ID assigned and snapshot ID + /// inheritance is enabled, it will be used directly. Otherwise, it will be + /// copied with the new snapshot ID. /// - /// \param manifest The manifest file to append - /// \return Reference to this for method chaining + /// \param manifest A manifest file of files to append. + /// \return This FastAppend for method chaining. FastAppend& AppendManifest(const ManifestFile& manifest); std::string operation() override; diff --git a/src/iceberg/update/merge_append.h b/src/iceberg/update/merge_append.h index 8122a262c..cd4f4acbb 100644 --- a/src/iceberg/update/merge_append.h +++ b/src/iceberg/update/merge_append.h @@ -31,10 +31,15 @@ namespace iceberg { -/// \brief Append files while merging manifests when table properties allow it. +/// \brief API for appending new files in a table while merging manifests. /// -/// MergeAppend uses the shared MergingSnapshotUpdate pipeline, so it can compact -/// newly written and existing manifests into fewer manifests during commit. +/// This API accumulates file additions, produces a new Snapshot of the table, +/// and commits that snapshot as current. When committing, these changes are +/// applied to the latest table snapshot. Commit conflicts are resolved by +/// applying the changes to the new latest snapshot and reattempting the commit. +/// +/// MergeAppend uses the shared MergingSnapshotUpdate pipeline, so it can merge +/// newly written and existing manifests according to table properties. class ICEBERG_EXPORT MergeAppend : public MergingSnapshotUpdate { public: /// \brief Create a new MergeAppend instance. @@ -45,19 +50,20 @@ class ICEBERG_EXPORT MergeAppend : public MergingSnapshotUpdate { static Result> Make( std::string table_name, std::shared_ptr ctx); - /// \brief Append a data file to this update. + /// \brief Append a DataFile to the table. /// - /// \param file The data file to append - /// \return Reference to this for method chaining + /// \param file A data file. + /// \return This MergeAppend for method chaining. MergeAppend& AppendFile(const std::shared_ptr& file); - /// \brief Append a data manifest to this update. + /// \brief Append a ManifestFile to the table. /// - /// The manifest must contain only added files. Snapshot ID and sequence number - /// assignment happen during commit. + /// The manifest must contain only appended files. All files in the manifest + /// are appended to the table in the snapshot created by this update. + /// Snapshot ID and sequence number assignment happen during commit. /// - /// \param manifest The manifest file to append - /// \return Reference to this for method chaining + /// \param manifest A manifest file of files to append. + /// \return This MergeAppend for method chaining. MergeAppend& AppendManifest(const ManifestFile& manifest); std::string operation() override; diff --git a/src/iceberg/update/merging_snapshot_update.cc b/src/iceberg/update/merging_snapshot_update.cc index c4d108dcb..8f88633ba 100644 --- a/src/iceberg/update/merging_snapshot_update.cc +++ b/src/iceberg/update/merging_snapshot_update.cc @@ -617,12 +617,13 @@ void MergingSnapshotUpdate::SetSummaryProperty(const std::string& property, Result> MergingSnapshotUpdate::DataSpec() const { if (new_data_files_by_spec_.empty()) { - return InvalidArgument("DataSpec() called before any data file was added"); + return InvalidArgument( + "Cannot determine partition specs: no data files have been added"); } if (new_data_files_by_spec_.size() > 1) { return InvalidArgument( - "DataSpec() requires exactly one partition spec; got {} different specs", - new_data_files_by_spec_.size()); + "Cannot return a single partition spec: data files with different partition " + "specs have been added"); } return base().PartitionSpecById(new_data_files_by_spec_.begin()->first); } diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h index fc3987ee1..d11a9b1f9 100644 --- a/src/iceberg/update/merging_snapshot_update.h +++ b/src/iceberg/update/merging_snapshot_update.h @@ -40,12 +40,17 @@ namespace iceberg { -/// \brief Abstract base class for all merge-based snapshot write operations. +/// \brief Abstract base class for merge-based snapshot write operations. /// -/// Provides the complete filter → write → merge pipeline that all merge-based -/// operations (MergeAppend, OverwriteFiles, RowDelta, ReplacePartitions, -/// RewriteFiles) share. Subclasses only need to implement `operation()` and -/// call the protected primitive API to describe what changes to make. +/// This class is the C++ counterpart of Java's MergingSnapshotProducer. It +/// provides the shared filter, write, and merge pipeline used by operations +/// that accumulate file additions and deletions, produce a new Snapshot, and +/// commit that snapshot as current. Commit conflicts are resolved by applying +/// the same staged changes to the new latest snapshot and reattempting the +/// commit. +/// +/// Subclasses describe their changes by calling the protected primitive API and +/// implement `operation()` to set the snapshot operation summary. /// /// The Apply() pipeline: /// 1. Filter data manifests (via data_filter_manager_) @@ -98,9 +103,9 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { /// \brief Add all files in a pre-existing data manifest to the new snapshot. /// - /// The manifest must contain DATA content. If snapshot ID inheritance is - /// enabled and the manifest has no snapshot ID assigned, it is used directly; - /// otherwise it is copied with the current snapshot ID. + /// The manifest must contain only appended data files. If snapshot ID + /// inheritance is enabled and the manifest has no snapshot ID assigned, it is + /// used directly; otherwise it is copied with the current snapshot ID. Status AddManifest(ManifestFile manifest); /// \brief Register a data file (by object) to be deleted from the table. @@ -116,14 +121,15 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { /// \brief Register an expression to delete matching rows. /// - /// Both data and delete filter managers receive the expression: delete files that - /// match the row filter can also be removed because those rows will be deleted. + /// Both data and delete filter managers receive the expression: delete files + /// that match the row filter can also be removed because those rows will be + /// deleted. Status DeleteByRowFilter(std::shared_ptr expr); /// \brief Register a partition to be dropped. /// - /// Both data and delete filter managers receive the partition drop, since dropping - /// data in a partition also drops all delete files in that partition. + /// Both data and delete filter managers receive the partition drop, since + /// dropping data in a partition also drops all delete files in that partition. Status DropPartition(int32_t spec_id, PartitionValues partition); /// \brief Fail if any registered delete path is not found in any manifest. diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 4f594a06e..4ba4168d4 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -22,6 +22,7 @@ install_headers( 'fast_append.h', 'merge_append.h', 'merging_snapshot_update.h', + 'overwrite_files.h', 'pending_update.h', 'row_delta.h', 'set_snapshot.h', diff --git a/src/iceberg/update/overwrite_files.cc b/src/iceberg/update/overwrite_files.cc new file mode 100644 index 000000000..cba6e028c --- /dev/null +++ b/src/iceberg/update/overwrite_files.cc @@ -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. + */ + +#include "iceberg/update/overwrite_files.h" + +#include + +#include "iceberg/expression/evaluator.h" +#include "iceberg/expression/expressions.h" +#include "iceberg/expression/projections.h" +#include "iceberg/expression/strict_metrics_evaluator.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/partition_spec.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/transaction.h" +#include "iceberg/type.h" +#include "iceberg/util/error_collector.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +Result> OverwriteFiles::Make( + std::string table_name, std::shared_ptr ctx) { + ICEBERG_PRECHECK(!table_name.empty(), "Table name cannot be empty"); + ICEBERG_PRECHECK(ctx != nullptr, "Cannot create OverwriteFiles without a context"); + return std::shared_ptr( + new OverwriteFiles(std::move(table_name), std::move(ctx))); +} + +OverwriteFiles::OverwriteFiles(std::string table_name, + std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) {} + +OverwriteFiles::~OverwriteFiles() = default; + +OverwriteFiles& OverwriteFiles::AddFile(const std::shared_ptr& file) { + ICEBERG_BUILDER_CHECK(file != nullptr, "Invalid data file: null"); + ICEBERG_BUILDER_CHECK(file->content == DataFile::Content::kData, + "Invalid data file to add: {} has delete-file content", + file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(AddDataFile(file)); + return *this; +} + +OverwriteFiles& OverwriteFiles::DeleteFile(const std::shared_ptr& file) { + ICEBERG_BUILDER_CHECK(file != nullptr, "Invalid data file: null"); + ICEBERG_BUILDER_CHECK(file->content == DataFile::Content::kData, + "Invalid data file to delete: {} has delete-file content", + file->file_path); + deleted_data_files_.insert(file); + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDataFile(file)); + return *this; +} + +OverwriteFiles& OverwriteFiles::DeleteFiles(const DataFileSet& data_files_to_delete, + const DeleteFileSet& delete_files_to_delete) { + // Both sets use DataFile pointers, so validate content before forwarding to the + // data-file and delete-file removal paths. + for (const auto& file : data_files_to_delete) { + ICEBERG_BUILDER_CHECK(file != nullptr, "Invalid data file: null"); + ICEBERG_BUILDER_CHECK(file->content == DataFile::Content::kData, + "Invalid data file to delete: {} has delete-file content", + file->file_path); + deleted_data_files_.insert(file); + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDataFile(file)); + } + for (const auto& file : delete_files_to_delete) { + ICEBERG_BUILDER_CHECK(file != nullptr, "Invalid delete file: null"); + ICEBERG_BUILDER_CHECK(file->content != DataFile::Content::kData, + "Invalid delete file to delete: {} has data-file content", + file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteDeleteFile(file)); + } + return *this; +} + +OverwriteFiles& OverwriteFiles::OverwriteByRowFilter(std::shared_ptr expr) { + ICEBERG_BUILDER_CHECK(expr != nullptr, "Invalid row filter expression: null"); + ICEBERG_BUILDER_RETURN_IF_ERROR(DeleteByRowFilter(std::move(expr))); + return *this; +} + +OverwriteFiles& OverwriteFiles::ValidateFromSnapshot(int64_t snapshot_id) { + ICEBERG_BUILDER_CHECK(snapshot_id >= 0, "Invalid snapshot id: {}", snapshot_id); + starting_snapshot_id_ = snapshot_id; + return *this; +} + +OverwriteFiles& OverwriteFiles::ConflictDetectionFilter( + std::shared_ptr expr) { + ICEBERG_BUILDER_CHECK(expr != nullptr, "Invalid conflict detection filter: null"); + conflict_detection_filter_ = std::move(expr); + return *this; +} + +OverwriteFiles& OverwriteFiles::CaseSensitive(bool case_sensitive) { + MergingSnapshotUpdate::CaseSensitive(case_sensitive); + return *this; +} + +OverwriteFiles& OverwriteFiles::ValidateNoConflictingData() { + validate_new_data_files_ = true; + FailMissingDeletePaths(); + return *this; +} + +OverwriteFiles& OverwriteFiles::ValidateNoConflictingDeletes() { + validate_new_deletes_ = true; + FailMissingDeletePaths(); + return *this; +} + +OverwriteFiles& OverwriteFiles::ValidateAddedFilesMatchOverwriteFilter() { + validate_added_files_match_overwrite_filter_ = true; + return *this; +} + +std::string OverwriteFiles::operation() { + if (DeletesDataFiles() && !AddsDataFiles()) { + return DataOperation::kDelete; + } + if (AddsDataFiles() && !DeletesDataFiles()) { + return DataOperation::kAppend; + } + return DataOperation::kOverwrite; +} + +std::shared_ptr OverwriteFiles::DataConflictDetectionFilter() const { + if (conflict_detection_filter_ != nullptr) { + return conflict_detection_filter_; + } + if (auto filter = RowFilter(); filter != nullptr && + filter != Expressions::AlwaysFalse() && + deleted_data_files_.empty()) { + return filter; + } + return Expressions::AlwaysTrue(); +} + +Status OverwriteFiles::Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) { + auto row_filter = RowFilter(); + + if (validate_added_files_match_overwrite_filter_) { + ICEBERG_ASSIGN_OR_RAISE(auto spec, DataSpec()); + ICEBERG_ASSIGN_OR_RAISE(auto schema, current_metadata.Schema()); + ICEBERG_ASSIGN_OR_RAISE(auto partition_type, spec->PartitionType(*schema)); + auto partition_schema = partition_type->ToSchema(); + + ICEBERG_ASSIGN_OR_RAISE( + auto inclusive_expr, + Projections::Inclusive(*spec, *schema, IsCaseSensitive())->Project(row_filter)); + ICEBERG_ASSIGN_OR_RAISE( + auto inclusive_evaluator, + Evaluator::Make(*partition_schema, inclusive_expr, IsCaseSensitive())); + + ICEBERG_ASSIGN_OR_RAISE( + auto strict_expr, + Projections::Strict(*spec, *schema, IsCaseSensitive())->Project(row_filter)); + ICEBERG_ASSIGN_OR_RAISE( + auto strict_evaluator, + Evaluator::Make(*partition_schema, strict_expr, IsCaseSensitive())); + + ICEBERG_ASSIGN_OR_RAISE( + auto metrics_evaluator, + StrictMetricsEvaluator::Make(row_filter, schema, IsCaseSensitive())); + + // the real test is that the strict or metrics test matches the file, indicating that + // all records in the file match the filter. inclusive is used to avoid testing the + // metrics, which is more complicated + const auto file_test = [&](const DataFile& file) -> Result { + ICEBERG_ASSIGN_OR_RAISE(bool inclusive_match, + inclusive_evaluator->Evaluate(file.partition)); + if (!inclusive_match) { + return false; + } + ICEBERG_ASSIGN_OR_RAISE(bool strict_match, + strict_evaluator->Evaluate(file.partition)); + if (strict_match) { + return true; + } + return metrics_evaluator->Evaluate(file); + }; + + for (const auto& file : AddedDataFiles()) { + ICEBERG_ASSIGN_OR_RAISE(bool matches_filter, file_test(*file)); + if (!matches_filter) { + return ValidationFailed( + "Cannot append file with rows that do not match filter: {}: {}", + row_filter->ToString(), file->file_path); + } + } + } + + if (validate_new_data_files_) { + ICEBERG_RETURN_UNEXPECTED(ValidateAddedDataFiles( + current_metadata, starting_snapshot_id_, DataConflictDetectionFilter(), snapshot, + ctx_->table->io(), IsCaseSensitive())); + } + + if (validate_new_deletes_) { + if (row_filter != nullptr && row_filter != Expressions::AlwaysFalse()) { + auto filter = + conflict_detection_filter_ != nullptr ? conflict_detection_filter_ : row_filter; + ICEBERG_RETURN_UNEXPECTED( + ValidateNoNewDeleteFiles(current_metadata, starting_snapshot_id_, filter, + snapshot, ctx_->table->io(), IsCaseSensitive())); + ICEBERG_RETURN_UNEXPECTED( + ValidateDeletedDataFiles(current_metadata, starting_snapshot_id_, filter, + snapshot, ctx_->table->io(), IsCaseSensitive())); + } + + if (!deleted_data_files_.empty()) { + ICEBERG_RETURN_UNEXPECTED(ValidateNoNewDeletesForDataFiles( + current_metadata, starting_snapshot_id_, conflict_detection_filter_, + deleted_data_files_, snapshot, ctx_->table->io(), IsCaseSensitive())); + } + } + + return {}; +} + +} // namespace iceberg diff --git a/src/iceberg/update/overwrite_files.h b/src/iceberg/update/overwrite_files.h new file mode 100644 index 000000000..f76263cad --- /dev/null +++ b/src/iceberg/update/overwrite_files.h @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/update/overwrite_files.h + +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/merging_snapshot_update.h" +#include "iceberg/util/data_file_set.h" + +namespace iceberg { + +/// \brief API for overwriting files in a table. +/// +/// This API accumulates file additions and produces a new Snapshot of the table by +/// replacing all deleted files with the set of additions. This operation is used +/// to implement idempotent writes that always replace a section of a table with +/// new data or update/delete operations that eagerly overwrite files. +/// +/// Overwrites can be validated. The default validation mode is idempotent, +/// meaning the overwrite is correct and should be committed regardless of other +/// concurrent changes to the table. For example, this can be used for replacing +/// all data for day D with query results. Alternatively, this API can be +/// configured for overwriting certain files with their filtered versions while +/// ensuring no new data that would need to be filtered has been added. +/// +/// When committing, these changes are applied to the latest table snapshot. +/// Commit conflicts are resolved by applying the changes to the new latest +/// snapshot and reattempting the commit. +class ICEBERG_EXPORT OverwriteFiles : public MergingSnapshotUpdate { + public: + /// \brief Create a new OverwriteFiles instance. + /// + /// \param table_name The name of the table + /// \param ctx The transaction context to use for this update + /// \return A Result containing the OverwriteFiles instance or an error + static Result> Make( + std::string table_name, std::shared_ptr ctx); + + ~OverwriteFiles() override; + + /// \brief Add a DataFile to the table. + /// + /// \param file A data file. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& AddFile(const std::shared_ptr& file); + + /// \brief Delete a DataFile from the table. + /// + /// \param file A data file. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& DeleteFile(const std::shared_ptr& file); + + /// \brief Delete a set of data files from the table with their respective + /// delete files. + /// + /// \param data_files_to_delete The data files to be deleted from the table. + /// \param delete_files_to_delete The delete files corresponding to the data + /// files to be deleted from the table. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& DeleteFiles(const DataFileSet& data_files_to_delete, + const DeleteFileSet& delete_files_to_delete); + + /// \brief Delete files that match an expression on data rows from the table. + /// + /// A file is selected to be deleted by the expression if it could contain any + /// rows that match the expression. Candidate files are selected using an + /// inclusive partition projection. These candidate files are deleted if all of + /// the rows in the file must match the expression, determined by the + /// expression's strict partition projection. This guarantees that files are + /// deleted if and only if all rows in the file must match the expression. + /// + /// Files that may contain some rows that match the expression and some rows + /// that do not will result in a validation error. + /// + /// \param expr An expression on rows in the table. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& OverwriteByRowFilter(std::shared_ptr expr); + + /// \brief Set the snapshot ID used in any reads for this operation. + /// + /// Validations check changes after this snapshot ID. If the from snapshot is + /// not set, all ancestor snapshots through the table's initial snapshot are + /// validated. + /// + /// \param snapshot_id A snapshot ID. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& ValidateFromSnapshot(int64_t snapshot_id); + + /// \brief Set a conflict detection filter used to validate concurrently added + /// data and delete files. + /// + /// \param expr An expression on rows in the table. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& ConflictDetectionFilter(std::shared_ptr expr); + + /// \brief Enable validation that data added concurrently does not conflict + /// with this commit's operation. + /// + /// This method should be called while committing non-idempotent overwrite + /// operations. If a concurrent operation commits a new file after the data was + /// read and that file might contain rows matching the specified conflict + /// detection filter, the overwrite operation detects this and fails. + /// + /// Calling this method with a correct conflict detection filter is required to + /// maintain isolation for non-idempotent overwrite operations. + /// + /// Validation uses the conflict detection filter passed to + /// ConflictDetectionFilter() and applies to operations that happened after the + /// snapshot passed to ValidateFromSnapshot(). If the conflict detection filter + /// is not set, any new data added concurrently will fail this overwrite + /// operation. + /// + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& ValidateNoConflictingData(); + + /// \brief Enable validation that deletes that happened concurrently do not + /// conflict with this commit's operation. + /// + /// Validating concurrent deletes is required during non-idempotent overwrite + /// operations. If a concurrent operation deletes data in one of the files being + /// overwritten, the overwrite operation must be aborted as it may undelete rows + /// that were removed concurrently. + /// + /// Calling this method with a correct conflict detection filter is required to + /// maintain isolation for non-idempotent overwrite operations. + /// + /// Validation uses the conflict detection filter passed to + /// ConflictDetectionFilter() and applies to operations that happened after the + /// snapshot passed to ValidateFromSnapshot(). If the conflict detection filter + /// is not set, this operation will use the row filter provided in + /// OverwriteByRowFilter() to check for new delete files and will ensure there + /// are no conflicting deletes for data files removed via DeleteFile(). + /// + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& ValidateNoConflictingDeletes(); + + /// \brief Signal that each file added to the table must match the overwrite + /// expression. + /// + /// If this method is called, each added file is validated on commit to ensure + /// that it matches the overwrite row filter. This is used to ensure that + /// writes are idempotent: files cannot be added during a commit that would not + /// be removed if the operation were run a second time. + /// + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& ValidateAddedFilesMatchOverwriteFilter(); + + /// \brief Enable or disable case-sensitive expression binding for validations + /// that accept expressions. + /// + /// \param case_sensitive Whether expression binding should be case sensitive. + /// \return This OverwriteFiles for method chaining. + OverwriteFiles& CaseSensitive(bool case_sensitive); + + std::string operation() override; + + protected: + Status Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) override; + + private: + explicit OverwriteFiles(std::string table_name, + std::shared_ptr ctx); + + /// \brief Select the conflict-detection filter from the configured state. + std::shared_ptr DataConflictDetectionFilter() const; + + DataFileSet deleted_data_files_; + bool validate_added_files_match_overwrite_filter_ = false; + std::optional starting_snapshot_id_; + std::shared_ptr conflict_detection_filter_; + bool validate_new_data_files_ = false; + bool validate_new_deletes_ = false; +}; + +} // namespace iceberg diff --git a/src/iceberg/update/row_delta.h b/src/iceberg/update/row_delta.h index ddb54d836..bf58a048c 100644 --- a/src/iceberg/update/row_delta.h +++ b/src/iceberg/update/row_delta.h @@ -39,7 +39,7 @@ namespace iceberg { /// \brief API for encoding row-level changes to a table. /// /// This API accumulates data and delete file changes, produces a new Snapshot -/// of the table, and commits that snapshot as current. +/// of the table, and commits that snapshot as the current. /// /// When committing, these changes are applied to the latest table snapshot. /// Commit conflicts are resolved by applying the changes to the new latest @@ -50,25 +50,25 @@ class ICEBERG_EXPORT RowDelta : public MergingSnapshotUpdate { static Result> Make(std::string table_name, std::shared_ptr ctx); - /// \brief Add a data file to the table. + /// \brief Add a DataFile to the table. /// /// \param inserts A data file of rows to insert. /// \return This RowDelta for method chaining. RowDelta& AddRows(const std::shared_ptr& inserts); - /// \brief Add a delete file to the table. + /// \brief Add a DeleteFile to the table. /// /// \param deletes A delete file of rows to delete. /// \return This RowDelta for method chaining. RowDelta& AddDeletes(const std::shared_ptr& deletes); - /// \brief Remove a data file from the table. + /// \brief Remove a DataFile from the table. /// /// \param file A data file. /// \return This RowDelta for method chaining. RowDelta& RemoveRows(const std::shared_ptr& file); - /// \brief Remove a rewritten delete file from the table. + /// \brief Remove a rewritten DeleteFile from the table. /// /// \param deletes A delete file that can be removed from the table. /// \return This RowDelta for method chaining. @@ -114,7 +114,8 @@ class ICEBERG_EXPORT RowDelta : public MergingSnapshotUpdate { /// \return This RowDelta for method chaining. RowDelta& ValidateDeletedFiles(); - /// \brief Set a conflict detection filter used to validate added files. + /// \brief Set a conflict detection filter used to validate concurrently added + /// data and delete files. /// /// If not called, a true literal is used as the conflict detection filter. /// diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index 7397034b3..b2c92bfb1 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -36,10 +36,11 @@ namespace iceberg { -/// \brief Base class for operations that produce snapshots. +/// \brief API for table changes that produce snapshots. /// -/// This class provides common functionality for creating new snapshots, -/// including manifest list writing and cleanup. +/// This class contains common methods for all updates that create a new table +/// Snapshot. It also provides the shared implementation for snapshot ID +/// assignment, manifest list writing, retry-safe apply, and cleanup. class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { public: /// \brief Result of applying a snapshot update @@ -56,9 +57,9 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// \brief Set a callback to delete files instead of the table's default. /// - /// \param delete_func A function used to delete file locations - /// \return Reference to this for method chaining - /// \note Cannot be called more than once + /// \param delete_func A function used to delete file locations. + /// \return This update for method chaining. + /// \note Cannot be called more than once. auto& DeleteWith(this auto& self, std::function delete_func) { if (self.delete_func_) { @@ -69,18 +70,21 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { return self; } - /// \brief Stage a snapshot in table metadata, but not update the current snapshot id. + /// \brief Stage a snapshot in table metadata, but do not make it current. /// - /// \return Reference to this for method chaining + /// The snapshot is assigned an ID and added to table metadata. The table's + /// current snapshot ID is not updated. + /// + /// \return This update for method chaining. auto& StageOnly(this auto& self) { self.stage_only_ = true; return self; } - /// \brief Perform operations on a particular branch + /// \brief Perform operations on a particular branch. /// - /// \param branch Which is name of SnapshotRef of type branch - /// \return Reference to this for method chaining + /// \param branch The name of a SnapshotRef of type branch. + /// \return This update for method chaining. auto& SetTargetBranch(this auto& self, const std::string& branch) { if (branch.empty()) [[unlikely]] { return self.AddError(ErrorKind::kInvalidArgument, "Branch name cannot be empty"); @@ -99,11 +103,11 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { return self; } - /// \brief Set a summary property. + /// \brief Set a summary property in the snapshot produced by this update. /// - /// \param property The property name - /// \param value The property value - /// \return Reference to this for method chaining + /// \param property A String property name. + /// \param value A String property value. + /// \return This update for method chaining. auto& Set(this auto& self, const std::string& property, const std::string& value) { static_cast(self).SetSummaryProperty(property, value); return self; @@ -111,11 +115,12 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// \brief Apply the update's changes to create a new snapshot. /// - /// This method validates the changes, applies them to the metadata, - /// and creates a new snapshot without committing it. The snapshot - /// is stored internally and can be accessed after Apply() succeeds. + /// This method validates the changes, applies them to the current base + /// metadata, and creates a new snapshot without committing it. Commit retries + /// call Apply() again with refreshed metadata so the same changes can be + /// applied to the new latest snapshot. /// - /// \return A result containing the new snapshot, or an error + /// \return A result containing the new snapshot, or an error. Result Apply(); /// \brief Finalize the snapshot update, cleaning up any uncommitted files. From 988f363e7e867c79a147317b3ff1f6c2bb11fea1 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Wed, 24 Jun 2026 17:18:30 +0800 Subject: [PATCH 121/151] feat: parallelize update and scan processing (#770) --- src/iceberg/delete_file_index.cc | 215 +++++---- src/iceberg/delete_file_index.h | 8 + src/iceberg/manifest/manifest_group.cc | 4 +- src/iceberg/table_scan.cc | 15 +- src/iceberg/table_scan.h | 8 + src/iceberg/test/arrow_test.cc | 2 +- src/iceberg/test/expire_snapshots_test.cc | 72 ++- src/iceberg/test/fast_append_test.cc | 58 ++- src/iceberg/test/table_scan_test.cc | 6 + src/iceberg/test/task_group_test.cc | 36 +- src/iceberg/update/expire_snapshots.cc | 513 ++++++++++++---------- src/iceberg/update/expire_snapshots.h | 16 +- src/iceberg/update/snapshot_update.cc | 21 +- src/iceberg/update/snapshot_update.h | 22 +- 14 files changed, 649 insertions(+), 347 deletions(-) diff --git a/src/iceberg/delete_file_index.cc b/src/iceberg/delete_file_index.cc index 8c58e861b..9a8be06b8 100644 --- a/src/iceberg/delete_file_index.cc +++ b/src/iceberg/delete_file_index.cc @@ -22,7 +22,9 @@ #include #include #include +#include #include +#include #include #include "iceberg/expression/expression.h" @@ -37,6 +39,7 @@ #include "iceberg/schema.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/content_file_util.h" +#include "iceberg/util/executor_util_internal.h" #include "iceberg/util/macros.h" namespace iceberg { @@ -528,107 +531,153 @@ DeleteFileIndex::Builder& DeleteFileIndex::Builder::IgnoreResiduals() { return *this; } +DeleteFileIndex::Builder& DeleteFileIndex::Builder::PlanWith(OptionalExecutor executor) { + executor_ = executor; + return *this; +} + Result> DeleteFileIndex::Builder::LoadDeleteFiles() { - // Build expression caches per spec ID - std::unordered_map> part_expr_cache; + // TODO(zehua): Replace with a thread-safe LRU cache. + std::shared_mutex projected_expr_cache_mutex; + std::unordered_map> projected_expr_cache; + std::shared_mutex eval_cache_mutex; std::unordered_map> eval_cache; auto data_filter = ignore_residuals_ ? True::Instance() : data_filter_; - // Filter and read manifests into manifest entries - std::vector files; - for (const auto& manifest : delete_manifests_) { - if (manifest.content != ManifestContent::kDeletes) { - continue; + auto and_filters = + [](std::shared_ptr left, + std::shared_ptr right) -> Result> { + if (left && right) { + return And::MakeFolded(std::move(left), std::move(right)); } - if (!manifest.has_added_files() && !manifest.has_existing_files()) { - continue; + return right ? std::move(right) : std::move(left); + }; + + auto get_projected_expr = [&](int32_t spec_id, + const std::shared_ptr& spec) + -> Result> { + if (!data_filter_) { + return std::shared_ptr(); } - const int32_t spec_id = manifest.partition_spec_id; - auto spec_iter = specs_by_id_.find(spec_id); - ICEBERG_CHECK(spec_iter != specs_by_id_.cend(), - "Partition spec ID {} not found when loading delete files", spec_id); - - const auto& spec = spec_iter->second; - - // Get or compute projected partition expression - if (!part_expr_cache.contains(spec_id) && data_filter_) { - auto projector = Projections::Inclusive(*spec, *schema_, case_sensitive_); - ICEBERG_ASSIGN_OR_RAISE(auto projected, projector->Project(data_filter_)); - part_expr_cache[spec_id] = std::move(projected); + { + std::shared_lock lock(projected_expr_cache_mutex); + auto iter = projected_expr_cache.find(spec_id); + if (iter != projected_expr_cache.end()) { + return iter->second; + } } - // Get or create manifest evaluator - if (!eval_cache.contains(spec_id)) { - auto filter = partition_filter_; - if (auto it = part_expr_cache.find(spec_id); it != part_expr_cache.cend()) { - if (filter) { - ICEBERG_ASSIGN_OR_RAISE(filter, And::Make(filter, it->second)); - } else { - filter = it->second; - } - } - if (filter) { - ICEBERG_ASSIGN_OR_RAISE(auto evaluator, - ManifestEvaluator::MakePartitionFilter( - std::move(filter), spec, *schema_, case_sensitive_)); - eval_cache[spec_id] = std::move(evaluator); - } + std::lock_guard lock(projected_expr_cache_mutex); + auto iter = projected_expr_cache.find(spec_id); + if (iter != projected_expr_cache.end()) { + return iter->second; } - // Evaluate manifest against filter - if (auto it = eval_cache.find(spec_id); it != eval_cache.end()) { - ICEBERG_ASSIGN_OR_RAISE(auto should_match, it->second->Evaluate(manifest)); - if (!should_match) { - continue; // Manifest doesn't match filter - } + auto projector = Projections::Inclusive(*spec, *schema_, case_sensitive_); + ICEBERG_ASSIGN_OR_RAISE(auto projected, projector->Project(data_filter_)); + auto [inserted_iter, _] = projected_expr_cache.emplace(spec_id, std::move(projected)); + return inserted_iter->second; + }; + + auto get_manifest_evaluator = + [&](int32_t spec_id, const std::shared_ptr& spec, + const std::shared_ptr& filter) -> Result { + if (!filter) { + return nullptr; } - // Read manifest entries - ICEBERG_ASSIGN_OR_RAISE(auto reader, - ManifestReader::Make(manifest, io_, schema_, spec)); - - auto partition_filter = partition_filter_; - if (auto it = part_expr_cache.find(spec_id); it != part_expr_cache.cend()) { - if (partition_filter) { - ICEBERG_ASSIGN_OR_RAISE(partition_filter, - And::Make(partition_filter, it->second)); - } else { - partition_filter = it->second; + { + std::shared_lock lock(eval_cache_mutex); + auto iter = eval_cache.find(spec_id); + if (iter != eval_cache.end()) { + return iter->second.get(); } } - if (partition_filter) { - reader->FilterPartitions(std::move(partition_filter)); - } - if (partition_set_) { - reader->FilterPartitions(partition_set_); - } - reader->FilterRows(data_filter).CaseSensitive(case_sensitive_).TryDropStats(); - - ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); - files.reserve(files.size() + entries.size()); - - for (auto& entry : entries) { - ICEBERG_CHECK(entry.data_file != nullptr, "ManifestEntry must have a data file"); - ICEBERG_CHECK(entry.sequence_number.has_value(), - "Missing sequence number from delete file: {}", - entry.data_file->file_path); - if (entry.sequence_number.value() > min_sequence_number_) { - auto& file = *entry.data_file; - // keep minimum stats to avoid memory pressure - std::unordered_set columns = - file.content == DataFile::Content::kPositionDeletes - ? std::unordered_set{MetadataColumns::kDeleteFilePathColumnId} - : std::unordered_set(file.equality_ids.begin(), - file.equality_ids.end()); - ContentFileUtil::DropUnselectedStats(*entry.data_file, columns); - files.emplace_back(std::move(entry)); - } + + std::lock_guard lock(eval_cache_mutex); + auto iter = eval_cache.find(spec_id); + if (iter != eval_cache.end()) { + return iter->second.get(); } - } - return files; + ICEBERG_ASSIGN_OR_RAISE(auto evaluator, ManifestEvaluator::MakePartitionFilter( + filter, spec, *schema_, case_sensitive_)); + auto [inserted_iter, _] = eval_cache.emplace(spec_id, std::move(evaluator)); + return inserted_iter->second.get(); + }; + + return ParallelCollect( + executor_, delete_manifests_, + [&](const ManifestFile& manifest) -> Result> { + std::vector manifest_result; + if (manifest.content != ManifestContent::kDeletes) { + return manifest_result; + } + if (!manifest.has_added_files() && !manifest.has_existing_files()) { + return manifest_result; + } + + const int32_t spec_id = manifest.partition_spec_id; + auto spec_iter = specs_by_id_.find(spec_id); + ICEBERG_CHECK(spec_iter != specs_by_id_.cend(), + "Partition spec ID {} not found when loading delete files", + spec_id); + + const auto& spec = spec_iter->second; + + ICEBERG_ASSIGN_OR_RAISE(auto projected_data_filter, + get_projected_expr(spec_id, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto delete_partition_filter, + and_filters(partition_filter_, projected_data_filter)); + ICEBERG_ASSIGN_OR_RAISE( + auto manifest_evaluator, + get_manifest_evaluator(spec_id, spec, delete_partition_filter)); + if (manifest_evaluator != nullptr) { + ICEBERG_ASSIGN_OR_RAISE(auto should_match, + manifest_evaluator->Evaluate(manifest)); + if (!should_match) { + return manifest_result; + } + } + + // Read manifest entries + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, io_, schema_, spec)); + + if (delete_partition_filter) { + reader->FilterPartitions(std::move(delete_partition_filter)); + } + if (partition_set_) { + reader->FilterPartitions(partition_set_); + } + reader->FilterRows(data_filter).CaseSensitive(case_sensitive_).TryDropStats(); + + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); + manifest_result.reserve(entries.size()); + + for (auto& entry : entries) { + ICEBERG_CHECK(entry.data_file != nullptr, + "ManifestEntry must have a data file"); + ICEBERG_CHECK(entry.sequence_number.has_value(), + "Missing sequence number from delete file: {}", + entry.data_file->file_path); + if (entry.sequence_number.value() > min_sequence_number_) { + auto& file = *entry.data_file; + // keep minimum stats to avoid memory pressure + std::unordered_set columns = + file.content == DataFile::Content::kPositionDeletes + ? std::unordered_set< + int32_t>{MetadataColumns::kDeleteFilePathColumnId} + : std::unordered_set(file.equality_ids.begin(), + file.equality_ids.end()); + ContentFileUtil::DropUnselectedStats(*entry.data_file, columns); + manifest_result.emplace_back(std::move(entry)); + } + } + return manifest_result; + }); } Status DeleteFileIndex::Builder::AddDV( diff --git a/src/iceberg/delete_file_index.h b/src/iceberg/delete_file_index.h index 5444281a0..555114a23 100644 --- a/src/iceberg/delete_file_index.h +++ b/src/iceberg/delete_file_index.h @@ -35,6 +35,7 @@ #include "iceberg/result.h" #include "iceberg/type_fwd.h" #include "iceberg/util/error_collector.h" +#include "iceberg/util/executor.h" #include "iceberg/util/partition_value_util.h" namespace iceberg { @@ -356,6 +357,12 @@ class ICEBERG_EXPORT DeleteFileIndex::Builder : public ErrorCollector { /// \brief Ignore residual expressions after partition filtering. Builder& IgnoreResiduals(); + /// \brief Configure an optional executor for reading delete manifests. + /// + /// \param executor Executor to use, or std::nullopt to read manifests serially. + /// \return Reference to this for method chaining. + Builder& PlanWith(OptionalExecutor executor); + /// \brief Build the DeleteFileIndex. Result> Build(); @@ -388,6 +395,7 @@ class ICEBERG_EXPORT DeleteFileIndex::Builder : public ErrorCollector { std::shared_ptr data_filter_; std::shared_ptr partition_filter_; std::shared_ptr partition_set_; + OptionalExecutor executor_; bool case_sensitive_ = true; bool ignore_residuals_ = false; }; diff --git a/src/iceberg/manifest/manifest_group.cc b/src/iceberg/manifest/manifest_group.cc index 932f3bf3d..ec5eb66bc 100644 --- a/src/iceberg/manifest/manifest_group.cc +++ b/src/iceberg/manifest/manifest_group.cc @@ -194,6 +194,7 @@ ManifestGroup& ManifestGroup::ColumnsToKeepStats(std::unordered_set col ManifestGroup& ManifestGroup::PlanWith(OptionalExecutor executor) { executor_ = executor; + delete_index_builder_.PlanWith(executor); return *this; } @@ -314,8 +315,7 @@ Result> ManifestGroup::MakeReader( auto columns = columns_; if (file_filter_ && file_filter_->op() != Expression::Operation::kTrue && - !columns.empty() && - std::ranges::find(columns, Schema::kAllColumns) == columns.end()) { + !columns.empty() && !std::ranges::contains(columns, Schema::kAllColumns)) { auto data_file_schema = DataFileFilterSchema(); ICEBERG_ASSIGN_OR_RAISE( auto bound_file_filter, diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index 6881d34fb..fb4fbf3c5 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -288,6 +288,12 @@ TableScanBuilder& TableScanBuilder::MinRowsRequested( return *this; } +template +TableScanBuilder& TableScanBuilder::PlanWith(Executor& executor) { + context_.plan_executor = std::ref(executor); + return *this; +} + template TableScanBuilder& TableScanBuilder::UseSnapshot(int64_t snapshot_id) { ICEBERG_BUILDER_CHECK(!context_.snapshot_id.has_value(), @@ -538,7 +544,8 @@ Result>> DataTableScan::PlanFiles() co .Select(ScanColumns()) .FilterData(filter()) .IgnoreDeleted() - .ColumnsToKeepStats(context_.columns_to_keep_stats); + .ColumnsToKeepStats(context_.columns_to_keep_stats) + .PlanWith(context_.plan_executor); if (context_.ignore_residuals) { manifest_group->IgnoreResiduals(); } @@ -641,7 +648,8 @@ Result>> IncrementalAppendScan::PlanFi entry.status == ManifestStatus::kAdded; }) .IgnoreDeleted() - .ColumnsToKeepStats(context_.columns_to_keep_stats); + .ColumnsToKeepStats(context_.columns_to_keep_stats) + .PlanWith(context_.plan_executor); if (context_.ignore_residuals) { manifest_group->IgnoreResiduals(); @@ -737,7 +745,8 @@ IncrementalChangelogScan::PlanFiles(std::optional from_snapshot_id_excl snapshot_ids.contains(entry.snapshot_id.value()); }) .IgnoreExisting() - .ColumnsToKeepStats(context_.columns_to_keep_stats); + .ColumnsToKeepStats(context_.columns_to_keep_stats) + .PlanWith(context_.plan_executor); if (context_.ignore_residuals) { manifest_group->IgnoreResiduals(); diff --git a/src/iceberg/table_scan.h b/src/iceberg/table_scan.h index 64fb3ffd1..3e4f14d55 100644 --- a/src/iceberg/table_scan.h +++ b/src/iceberg/table_scan.h @@ -32,6 +32,7 @@ #include "iceberg/table_metadata.h" #include "iceberg/type_fwd.h" #include "iceberg/util/error_collector.h" +#include "iceberg/util/executor.h" namespace iceberg { @@ -228,6 +229,7 @@ struct TableScanContext { std::optional to_snapshot_id; std::string branch{}; std::optional min_rows_requested; + OptionalExecutor plan_executor; // Validate the context parameters to see if they have conflicts. [[nodiscard]] Status Validate() const; @@ -302,6 +304,12 @@ class ICEBERG_TEMPLATE_CLASS_EXPORT TableScanBuilder : public ErrorCollector { /// \param num_rows The minimum number of rows requested TableScanBuilder& MinRowsRequested(int64_t num_rows); + /// \brief Configure an executor for manifest planning. + /// + /// \param executor Executor to use while planning manifests. + /// \return Reference to this for method chaining. + TableScanBuilder& PlanWith(Executor& executor); + /// \brief Request this scan to use the given snapshot by ID. /// \param snapshot_id a snapshot ID /// \note InvalidArgument will be returned if the snapshot cannot be found diff --git a/src/iceberg/test/arrow_test.cc b/src/iceberg/test/arrow_test.cc index 2a7242e71..d18a6eaf9 100644 --- a/src/iceberg/test/arrow_test.cc +++ b/src/iceberg/test/arrow_test.cc @@ -638,7 +638,7 @@ TEST(ArrowExecutorAdapterTest, RunsTaskGroupOnThreadPool) { std::mutex mutex; std::vector thread_ids; - auto status = TaskGroup<>() + auto status = TaskGroup() .SetExecutor(std::ref(executor)) .Submit([&]() -> Status { std::lock_guard lock(mutex); diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index 91a49bbbd..1216952e7 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -474,7 +474,7 @@ TEST_F(ExpireSnapshotsCleanupTest, ExecutorDispatchesDeletesConcurrently) { ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); update->ExpireSnapshotId(kExpiredSnapshotId); - update->ExecuteDeleteWith(std::ref(executor)); + update->ExecuteDeleteWith(executor); update->DeleteWith([&deleted_files, &deleted_files_mu](const std::string& path) { std::lock_guard lock(deleted_files_mu); deleted_files.push_back(path); @@ -510,12 +510,80 @@ TEST_F(ExpireSnapshotsCleanupTest, ExecuteDeleteWithWithoutDeleteWithDoesNotUseE ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); update->ExpireSnapshotId(kExpiredSnapshotId); - update->ExecuteDeleteWith(std::ref(executor)); + update->ExecuteDeleteWith(executor); EXPECT_THAT(update->Commit(), IsOk()); EXPECT_EQ(executor.submit_count(), 0); } +TEST_F(ExpireSnapshotsCleanupTest, PlanWithUsesIncrementalCleanup) { + const auto deleted_data_file_path = + table_location_ + "/data/deleted-by-expired.parquet"; + const auto delete_manifest_path = + table_location_ + "/metadata/expired-delete-entry.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-deleted-entry-ml.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-deleted-entry-ml.avro"; + + auto delete_manifest = WriteDataManifest( + delete_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kDeleted, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(deleted_data_file_path))}); + delete_manifest = + AssignManifestSequenceNumber(std::move(delete_manifest), kExpiredSequenceNumber); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {delete_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {delete_manifest}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + test::ThreadExecutor plan_executor; + test::ThreadExecutor delete_executor( + ServiceUnavailable("delete executor should be unused")); + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->PlanWith(plan_executor); + update->ExecuteDeleteWith(delete_executor); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_GT(plan_executor.submit_count(), 0); + EXPECT_EQ(delete_executor.submit_count(), 0); +} + +TEST_F(ExpireSnapshotsCleanupTest, PlanWithUsesReachableCleanup) { + const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; + const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; + const auto expired_manifest_list_path = + table_location_ + "/metadata/expired-manifest-list.avro"; + const auto current_manifest_list_path = + table_location_ + "/metadata/current-manifest-list.avro"; + + auto expired_data_manifest = WriteDataManifest( + expired_data_manifest_path, kExpiredSnapshotId, + {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, + MakeDataFile(expired_data_file_path))}); + WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, + /*parent_snapshot_id=*/0, kExpiredSequenceNumber, + {expired_data_manifest}); + WriteManifestList(current_manifest_list_path, kCurrentSnapshotId, kExpiredSnapshotId, + kCurrentSequenceNumber, {}); + RewriteTableWithManifestLists(expired_manifest_list_path, current_manifest_list_path); + + test::ThreadExecutor plan_executor; + test::ThreadExecutor delete_executor( + ServiceUnavailable("delete executor should be unused")); + + ICEBERG_UNWRAP_OR_FAIL(auto update, table_->NewExpireSnapshots()); + update->ExpireSnapshotId(kExpiredSnapshotId); + update->PlanWith(plan_executor); + update->ExecuteDeleteWith(delete_executor); + + EXPECT_THAT(update->Commit(), IsOk()); + EXPECT_GT(plan_executor.submit_count(), 0); + EXPECT_EQ(delete_executor.submit_count(), 0); +} + TEST_F(ExpireSnapshotsCleanupTest, DeleteWithRetriesTransientFailures) { const auto expired_data_file_path = table_location_ + "/data/expired-data.parquet"; const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; diff --git a/src/iceberg/test/fast_append_test.cc b/src/iceberg/test/fast_append_test.cc index 32224d117..8853d419c 100644 --- a/src/iceberg/test/fast_append_test.cc +++ b/src/iceberg/test/fast_append_test.cc @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -36,12 +38,31 @@ #include "iceberg/snapshot.h" #include "iceberg/table_metadata.h" #include "iceberg/test/matchers.h" -#include "iceberg/test/test_resource.h" #include "iceberg/test/update_test_base.h" -#include "iceberg/util/uuid.h" +#include "iceberg/transaction.h" namespace iceberg { +namespace { + +class TestSnapshotUpdate : public SnapshotUpdate { + public: + explicit TestSnapshotUpdate(std::shared_ptr ctx) + : SnapshotUpdate(std::move(ctx)) {} + + using SnapshotUpdate::ManifestPath; + + Status CleanUncommitted(const std::unordered_set&) override { return {}; } + std::string operation() override { return "test"; } + Result> Apply(const TableMetadata&, + const std::shared_ptr&) override { + return std::vector{}; + } + std::unordered_map Summary() override { return {}; } +}; + +} // namespace + class FastAppendTest : public UpdateTestBase { protected: static void SetUpTestSuite() { avro::RegisterAll(); } @@ -102,6 +123,8 @@ class FastAppendTest : public UpdateTestBase { std::shared_ptr file_b_; }; +class SnapshotUpdateTest : public UpdateTestBase {}; + TEST_F(FastAppendTest, AppendDataFile) { std::shared_ptr fast_append; ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); @@ -260,4 +283,35 @@ TEST_F(FastAppendTest, SetSnapshotProperty) { EXPECT_EQ(snapshot->summary.at("custom-property"), "custom-value"); } +TEST_F(SnapshotUpdateTest, ConcurrentManifestPaths) { + ICEBERG_UNWRAP_OR_FAIL(auto ctx, + TransactionContext::Make(table_, TransactionKind::kUpdate)); + TestSnapshotUpdate update(std::move(ctx)); + + constexpr int kThreadCount = 8; + constexpr int kPathsPerThread = 32; + std::vector paths(kThreadCount * kPathsPerThread); + std::vector threads; + threads.reserve(kThreadCount); + + for (int thread_index = 0; thread_index < kThreadCount; ++thread_index) { + threads.emplace_back([&, thread_index] { + for (int path_index = 0; path_index < kPathsPerThread; ++path_index) { + paths[thread_index * kPathsPerThread + path_index] = update.ManifestPath(); + } + }); + } + + for (auto& thread : threads) { + thread.join(); + } + + std::unordered_set unique_paths(paths.begin(), paths.end()); + ASSERT_EQ(unique_paths.size(), paths.size()); + for (const auto& path : paths) { + EXPECT_THAT(path, ::testing::HasSubstr("/metadata/")); + EXPECT_THAT(path, ::testing::HasSubstr("-m")); + } +} + } // namespace iceberg diff --git a/src/iceberg/test/table_scan_test.cc b/src/iceberg/test/table_scan_test.cc index 11905a870..34591a438 100644 --- a/src/iceberg/test/table_scan_test.cc +++ b/src/iceberg/test/table_scan_test.cc @@ -30,6 +30,7 @@ #include "iceberg/expression/expressions.h" #include "iceberg/snapshot.h" #include "iceberg/table_metadata.h" +#include "iceberg/test/executor.h" #include "iceberg/test/scan_test_base.h" namespace iceberg { @@ -394,11 +395,16 @@ TEST_P(TableScanTest, PlanFilesWithMultipleManifests) { ICEBERG_UNWRAP_OR_FAIL(auto builder, DataTableScanBuilder::Make(metadata_with_manifests, file_io_)); + + test::ThreadExecutor executor; + builder->PlanWith(executor); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); ICEBERG_UNWRAP_OR_FAIL(auto tasks, scan->PlanFiles()); ASSERT_EQ(tasks.size(), 2); EXPECT_THAT(GetPaths(tasks), testing::UnorderedElementsAre("/path/to/data1.parquet", "/path/to/data2.parquet")); + EXPECT_EQ(executor.submit_count(), 2); } TEST_P(TableScanTest, PlanFilesWithFilter) { diff --git a/src/iceberg/test/task_group_test.cc b/src/iceberg/test/task_group_test.cc index 2f0da3de2..0b04a333d 100644 --- a/src/iceberg/test/task_group_test.cc +++ b/src/iceberg/test/task_group_test.cc @@ -95,7 +95,7 @@ TEST(FnOnceTest, SupportsMoveOnlyCapture) { TEST(TaskGroupTest, UsesExecutor) { test::ThreadExecutor executor; - TaskGroup<> group; + TaskGroup group; bool ran = false; group.SetExecutor(std::ref(executor)); @@ -111,7 +111,7 @@ TEST(TaskGroupTest, UsesExecutor) { TEST(TaskGroupTest, ReturnsSubmitError) { test::ThreadExecutor executor(ServiceUnavailable("executor busy")); - TaskGroup<> group; + TaskGroup group; group.SetExecutor(std::ref(executor)); group.Submit([]() -> Status { return {}; }); @@ -121,7 +121,7 @@ TEST(TaskGroupTest, ReturnsSubmitError) { } TEST(TaskGroupTest, DirectMoveOnlyTask) { - TaskGroup<> group; + TaskGroup group; auto value = std::make_unique(7); int observed = 0; @@ -136,7 +136,7 @@ TEST(TaskGroupTest, DirectMoveOnlyTask) { TEST(TaskGroupTest, ClearsExecutor) { test::ThreadExecutor executor; - TaskGroup<> group; + TaskGroup group; int call_count = 0; group.SetExecutor(std::ref(executor)); @@ -152,25 +152,27 @@ TEST(TaskGroupTest, ClearsExecutor) { } TEST(TaskGroupTest, FluentSubmit) { - int call_count = 0; + test::ThreadExecutor executor; + std::atomic call_count = 0; - auto status = TaskGroup<>() + auto status = TaskGroup() + .SetExecutor(std::ref(executor)) .Submit([&]() -> Status { - ++call_count; + call_count.fetch_add(1, std::memory_order_relaxed); return {}; }) .Submit([&]() -> Status { - ++call_count; + call_count.fetch_add(1, std::memory_order_relaxed); return {}; }) .Run(); EXPECT_THAT(status, IsOk()); - EXPECT_EQ(call_count, 2); + EXPECT_EQ(call_count.load(std::memory_order_relaxed), 2); } TEST(TaskGroupTest, DirectAggregatesErrors) { - TaskGroup<> group; + TaskGroup group; int call_count = 0; group.Submit([&]() -> Status { @@ -192,7 +194,7 @@ TEST(TaskGroupTest, DirectAggregatesErrors) { TEST(TaskGroupTest, ParallelSubmitsAll) { test::ThreadExecutor executor; - TaskGroup<> group; + TaskGroup group; std::atomic call_count = 0; group.SetExecutor(std::ref(executor)); @@ -212,7 +214,7 @@ TEST(TaskGroupTest, ParallelSubmitsAll) { TEST(TaskGroupTest, ParallelAggregatesErrors) { test::ThreadExecutor executor; - TaskGroup<> group; + TaskGroup group; std::atomic call_count = 0; group.SetExecutor(std::ref(executor)); @@ -236,16 +238,16 @@ TEST(TaskGroupTest, ParallelAggregatesErrors) { TEST(TaskGroupTest, ParallelSubmitErrors) { test::ThreadExecutor executor(ServiceUnavailable("executor busy")); - TaskGroup<> group; - int call_count = 0; + TaskGroup group; + std::atomic call_count = 0; group.SetExecutor(std::ref(executor)); group.Submit([&]() -> Status { - ++call_count; + call_count.fetch_add(1, std::memory_order_relaxed); return {}; }); group.Submit([&]() -> Status { - ++call_count; + call_count.fetch_add(1, std::memory_order_relaxed); return {}; }); @@ -253,7 +255,7 @@ TEST(TaskGroupTest, ParallelSubmitErrors) { EXPECT_THAT(status, IsError(ErrorKind::kServiceUnavailable)); EXPECT_THAT(status, HasErrorMessage("Task group failed with 2 errors")); EXPECT_THAT(status, HasErrorMessage("executor busy")); - EXPECT_EQ(call_count, 0); + EXPECT_EQ(call_count.load(std::memory_order_relaxed), 0); EXPECT_EQ(executor.submit_count(), 2); } diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index 4de2c50b5..d14a7331f 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -41,6 +41,7 @@ #include "iceberg/table_metadata.h" #include "iceberg/transaction.h" #include "iceberg/util/error_collector.h" +#include "iceberg/util/executor_util_internal.h" #include "iceberg/util/macros.h" #include "iceberg/util/retry_util.h" #include "iceberg/util/snapshot_util_internal.h" @@ -65,10 +66,11 @@ class FileCleanupStrategy { public: FileCleanupStrategy(std::shared_ptr file_io, std::function delete_func, - OptionalExecutor executor) + OptionalExecutor delete_executor, OptionalExecutor plan_executor) : file_io_(std::move(file_io)), delete_func_(std::move(delete_func)), - executor_(std::move(executor)) {} + delete_executor_(std::move(delete_executor)), + plan_executor_(std::move(plan_executor)) {} virtual ~FileCleanupStrategy() = default; @@ -85,24 +87,26 @@ class FileCleanupStrategy { /// \brief Snapshot IDs present in `before` but not in `after`. static std::unordered_set ExpiredSnapshotIds(const TableMetadata& before, const TableMetadata& after) { - std::unordered_set after_ids; - after_ids.reserve(after.snapshots.size()); - for (const auto& s : after.snapshots) { - if (s) after_ids.insert(s->snapshot_id); - } - std::unordered_set expired; - expired.reserve(before.snapshots.size()); - for (const auto& s : before.snapshots) { - if (s && !after_ids.contains(s->snapshot_id)) { - expired.insert(s->snapshot_id); - } - } + auto after_ids = + after.snapshots | + std::views::filter([](const auto& snapshot) { return snapshot != nullptr; }) | + std::views::transform(&iceberg::Snapshot::snapshot_id) | + std::ranges::to>(); + + auto expired = + before.snapshots | std::views::filter([&](const auto& snapshot) { + return snapshot != nullptr && !after_ids.contains(snapshot->snapshot_id); + }) | + std::views::transform(&iceberg::Snapshot::snapshot_id) | + std::ranges::to>(); return expired; } /// \brief Best-effort delete with bounded retry. void DeleteFiles(const std::unordered_set& paths) { - if (paths.empty()) return; + if (paths.empty()) { + return; + } if (!delete_func_) { std::vector path_list(paths.begin(), paths.end()); @@ -116,7 +120,7 @@ class FileCleanupStrategy { } TaskGroup> group(kDeleteRetryConfig); - group.SetExecutor(executor_); + group.SetExecutor(delete_executor_); for (const auto& path : paths) { group.Submit([this, path]() -> Status { try { @@ -171,7 +175,8 @@ class FileCleanupStrategy { std::shared_ptr file_io_; std::function delete_func_; - OptionalExecutor executor_; + OptionalExecutor delete_executor_; + OptionalExecutor plan_executor_; private: /// Retry budget for the FileIO bulk `DeleteFiles` path. Tight on purpose: file @@ -263,23 +268,17 @@ class ReachableFileCleanup : public FileCleanupStrategy { SnapshotCache snapshot_cache(snapshot.get()); ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, snapshot_cache.Manifests(file_io_)); - std::unordered_set manifests; - for (const auto& manifest : snapshot_manifests) { - manifests.insert(manifest); - } - return manifests; + return snapshot_manifests | std::views::as_rvalue | + std::ranges::to>(); } /// \brief Collect manifests for a set of snapshots. Result> ReadManifests( const TableMetadata& metadata, const std::unordered_set& snapshot_ids) { - std::unordered_set manifests; - for (int64_t snapshot_id : snapshot_ids) { - ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, - ReadManifestsForSnapshot(metadata, snapshot_id)); - manifests.insert(snapshot_manifests.begin(), snapshot_manifests.end()); - } - return manifests; + return ParallelCollect(plan_executor_, snapshot_ids, + [this, &metadata](int64_t snapshot_id) { + return ReadManifestsForSnapshot(metadata, snapshot_id); + }); } /// \brief Remove manifests still referenced by retained snapshots. @@ -288,21 +287,16 @@ class ReachableFileCleanup : public FileCleanupStrategy { const std::unordered_set& retained_snapshot_ids, std::unordered_set manifests_to_delete, std::unordered_set& current_manifests) { - for (int64_t snapshot_id : retained_snapshot_ids) { - ICEBERG_ASSIGN_OR_RAISE(auto snapshot_manifests, - ReadManifestsForSnapshot(metadata, snapshot_id)); - - for (const auto& manifest : snapshot_manifests) { - manifests_to_delete.erase(manifest); - - if (manifests_to_delete.empty()) { - return manifests_to_delete; - } - - current_manifests.insert(manifest); + ICEBERG_ASSIGN_OR_RAISE(auto retained_manifests, + ReadManifests(metadata, retained_snapshot_ids)); + for (auto it = retained_manifests.begin(); it != retained_manifests.end();) { + auto current = it++; + manifests_to_delete.erase(*current); + if (manifests_to_delete.empty()) { + return manifests_to_delete; } + current_manifests.insert(retained_manifests.extract(current)); } - return manifests_to_delete; } @@ -343,38 +337,38 @@ class ReachableFileCleanup : public FileCleanupStrategy { const TableMetadata& metadata, const std::unordered_set& manifests_to_delete, const std::unordered_set& current_manifests) { - std::unordered_set data_files_to_delete; - // Collect live file paths from manifests being deleted. - for (const auto& manifest : manifests_to_delete) { - auto live_data_files = ReadLiveDataFilePaths(metadata, manifest); - // Ignore expired-manifest read failures and keep scanning candidates. - if (!live_data_files.has_value()) { - continue; - } - - data_files_to_delete.insert(live_data_files->begin(), live_data_files->end()); + auto live_file_results = ParallelCollect( + plan_executor_, manifests_to_delete, + [this, &metadata]( + const ManifestFile& manifest) -> Result> { + auto result = ReadLiveDataFilePaths(metadata, manifest); + // Ignore expired-manifest read failures and keep scanning candidates. + if (!result.has_value()) { + return std::unordered_set{}; + } + return std::move(result).value(); + }); + if (!live_file_results.has_value()) { + return {}; } - + auto data_files_to_delete = std::move(live_file_results).value(); if (data_files_to_delete.empty()) { return data_files_to_delete; } // Remove files still referenced by current manifests. - for (const auto& manifest : current_manifests) { - if (data_files_to_delete.empty()) { - return data_files_to_delete; - } - - auto live_data_files = ReadLiveDataFilePaths(metadata, manifest); - // Fail closed if any retained manifest cannot be read safely. - if (!live_data_files.has_value()) { - return std::unordered_set{}; - } - - for (const auto& file_path : live_data_files.value()) { - data_files_to_delete.erase(file_path); - } + auto current_live_results = + ParallelCollect(plan_executor_, current_manifests, + [this, &metadata](const ManifestFile& manifest) { + return ReadLiveDataFilePaths(metadata, manifest); + }); + // Fail closed if any retained manifest cannot be read safely. + if (!current_live_results.has_value()) { + return std::unordered_set{}; + } + for (const auto& file_path : current_live_results.value()) { + data_files_to_delete.erase(file_path); } return data_files_to_delete; @@ -435,17 +429,23 @@ class IncrementalFileCleanup : public FileCleanupStrategy { std::unordered_set ancestor_ids; ancestor_ids.reserve(ancestors_result.value().size()); for (const auto& ancestor : ancestors_result.value()) { - if (ancestor) ancestor_ids.insert(ancestor->snapshot_id); + if (ancestor) { + ancestor_ids.insert(ancestor->snapshot_id); + } } // Protect snapshots whose changes were picked into the current ancestry. std::unordered_set picked_ancestor_snapshot_ids; picked_ancestor_snapshot_ids.reserve(ancestor_ids.size()); for (const auto& ancestor : ancestors_result.value()) { - if (!ancestor) continue; + if (!ancestor) { + continue; + } const auto& summary = ancestor->summary; auto it = summary.find(SnapshotSummaryFields::kSourceSnapshotId); - if (it == summary.end()) continue; + if (it == summary.end()) { + continue; + } ICEBERG_ASSIGN_OR_RAISE(auto source_id, StringUtils::ParseNumber(it->second)); picked_ancestor_snapshot_ids.insert(source_id); @@ -454,28 +454,41 @@ class IncrementalFileCleanup : public FileCleanupStrategy { // Find manifests still referenced by a valid snapshot but written by an // expired snapshot. Their deleted entries point at data files now safe to // remove and become candidates for manifests_to_scan below. - std::unordered_set valid_manifests; - std::unordered_set manifests_to_scan; - manifests_to_scan.reserve(expired_snapshot_ids.size()); - for (const auto& snapshot : metadata_after_expiration.snapshots) { - if (!snapshot) continue; - SnapshotCache snapshot_cache(snapshot.get()); - auto manifests_result = snapshot_cache.Manifests(file_io_); - if (!manifests_result.has_value()) continue; // best-effort - auto manifests = std::move(manifests_result).value(); - for (auto& manifest : manifests) { - valid_manifests.insert(manifest.manifest_path); - - int64_t writer_id = manifest.added_snapshot_id; - bool from_valid_snapshots = valid_ids.contains(writer_id); - bool is_from_ancestor = ancestor_ids.contains(writer_id); - bool is_picked = picked_ancestor_snapshot_ids.contains(writer_id); - if (!from_valid_snapshots && (is_from_ancestor || is_picked) && - manifest.has_deleted_files()) { - manifests_to_scan.insert(std::move(manifest)); - } - } - } + ICEBERG_ASSIGN_OR_RAISE( + auto valid_manifest_results, + ParallelCollect( + plan_executor_, metadata_after_expiration.snapshots, + [&](const std::shared_ptr& snapshot) + -> Result, + std::unordered_set>> { + if (!snapshot) { + return {}; + } + SnapshotCache snapshot_cache(snapshot.get()); + auto manifests_result = snapshot_cache.Manifests(file_io_); + if (!manifests_result.has_value()) { + // best-effort + return {}; + } + auto manifests = std::move(manifests_result).value(); + std::unordered_set valid_manifest_result; + std::unordered_set scan_manifest_result; + for (auto& manifest : manifests) { + valid_manifest_result.insert(manifest.manifest_path); + + int64_t writer_id = manifest.added_snapshot_id; + bool from_valid_snapshots = valid_ids.contains(writer_id); + bool is_from_ancestor = ancestor_ids.contains(writer_id); + bool is_picked = picked_ancestor_snapshot_ids.contains(writer_id); + if (!from_valid_snapshots && (is_from_ancestor || is_picked) && + manifest.has_deleted_files()) { + scan_manifest_result.insert(std::move(manifest)); + } + } + return std::pair(std::move(valid_manifest_result), + std::move(scan_manifest_result)); + })); + auto [valid_manifests, manifests_to_scan] = std::move(valid_manifest_results); // Find manifests that were only referenced by snapshots that have expired, // and split them by what kind of cleanup they need: @@ -484,66 +497,84 @@ class IncrementalFileCleanup : public FileCleanupStrategy { // entries (data files now safe to drop); // - manifests_to_revert: written by an expiring non-ancestor snapshot // and contains added entries -- those data files were never adopted. - std::unordered_set manifest_lists_to_delete; - manifest_lists_to_delete.reserve(expired_snapshot_ids.size()); - std::unordered_set manifests_to_delete; - manifests_to_delete.reserve(expired_snapshot_ids.size()); - std::unordered_set manifests_to_revert; - manifests_to_revert.reserve(expired_snapshot_ids.size()); - for (const auto& snapshot : metadata_before_expiration.snapshots) { - if (!snapshot) continue; - int64_t snapshot_id = snapshot->snapshot_id; - if (valid_ids.contains(snapshot_id)) continue; - - // Skip cherry-picked snapshots; the picked snapshot owns its cleanup. - if (picked_ancestor_snapshot_ids.contains(snapshot_id)) { - continue; - } - - int64_t source_snapshot_id = -1; - auto src_it = snapshot->summary.find(SnapshotSummaryFields::kSourceSnapshotId); - if (src_it != snapshot->summary.end()) { - auto source_snapshot_id_result = - StringUtils::ParseNumber(src_it->second); - if (!source_snapshot_id_result.has_value()) { - continue; - } - source_snapshot_id = source_snapshot_id_result.value(); - } - // If this commit was cherry-picked from a still-live snapshot, skip it. - if (ancestor_ids.contains(source_snapshot_id) || - picked_ancestor_snapshot_ids.contains(source_snapshot_id)) { - continue; - } - - SnapshotCache snapshot_cache(snapshot.get()); - auto manifests_result = snapshot_cache.Manifests(file_io_); - if (!manifests_result.has_value()) { - continue; - } - - auto manifests = std::move(manifests_result).value(); - for (auto& manifest : manifests) { - if (valid_manifests.contains(manifest.manifest_path)) continue; - manifests_to_delete.insert(manifest.manifest_path); - - int64_t writer_id = manifest.added_snapshot_id; - bool is_from_ancestor = ancestor_ids.contains(writer_id); - bool is_from_expiring_snapshot = expired_snapshot_ids.contains(writer_id); - - if (is_from_ancestor && manifest.has_deleted_files()) { - manifests_to_scan.insert(std::move(manifest)); - } else if (!is_from_ancestor && is_from_expiring_snapshot && - manifest.has_added_files()) { - // The writer must be known-expired so missing history cannot make - // an ancestor look like a reverted snapshot. - manifests_to_revert.insert(std::move(manifest)); - } - } - if (!snapshot->manifest_list.empty()) { - manifest_lists_to_delete.insert(snapshot->manifest_list); - } - } + ICEBERG_ASSIGN_OR_RAISE( + auto expired_manifest_results, + ParallelCollect( + plan_executor_, metadata_before_expiration.snapshots, + [&](const std::shared_ptr& snapshot) + -> Result, std::unordered_set, + std::unordered_set, std::unordered_set>> { + if (!snapshot) { + return {}; + } + int64_t snapshot_id = snapshot->snapshot_id; + if (valid_ids.contains(snapshot_id)) { + return {}; + } + + // Skip cherry-picked snapshots; the picked snapshot owns its cleanup. + if (picked_ancestor_snapshot_ids.contains(snapshot_id)) { + return {}; + } + + int64_t source_snapshot_id = -1; + auto src_it = + snapshot->summary.find(SnapshotSummaryFields::kSourceSnapshotId); + if (src_it != snapshot->summary.end()) { + auto source_snapshot_id_result = + StringUtils::ParseNumber(src_it->second); + if (!source_snapshot_id_result.has_value()) { + return {}; + } + source_snapshot_id = source_snapshot_id_result.value(); + } + // If this commit was cherry-picked from a still-live snapshot, skip it. + if (ancestor_ids.contains(source_snapshot_id) || + picked_ancestor_snapshot_ids.contains(source_snapshot_id)) { + return {}; + } + + SnapshotCache snapshot_cache(snapshot.get()); + auto manifests_result = snapshot_cache.Manifests(file_io_); + if (!manifests_result.has_value()) { + return {}; + } + + auto manifests = std::move(manifests_result).value(); + std::unordered_set manifest_lists_to_delete; + std::unordered_set manifests_to_delete; + std::unordered_set manifests_to_scan; + std::unordered_set manifests_to_revert; + for (auto& manifest : manifests) { + if (valid_manifests.contains(manifest.manifest_path)) { + continue; + } + manifests_to_delete.insert(manifest.manifest_path); + + int64_t writer_id = manifest.added_snapshot_id; + bool is_from_ancestor = ancestor_ids.contains(writer_id); + bool is_from_expiring_snapshot = expired_snapshot_ids.contains(writer_id); + + if (is_from_ancestor && manifest.has_deleted_files()) { + manifests_to_scan.insert(std::move(manifest)); + } else if (!is_from_ancestor && is_from_expiring_snapshot && + manifest.has_added_files()) { + // The writer must be known-expired so missing history cannot make + // an ancestor look like a reverted snapshot. + manifests_to_revert.insert(std::move(manifest)); + } + } + if (!snapshot->manifest_list.empty()) { + manifest_lists_to_delete.insert(snapshot->manifest_list); + } + return std::tuple( + std::move(manifest_lists_to_delete), std::move(manifests_to_delete), + std::move(manifests_to_scan), std::move(manifests_to_revert)); + })); + auto [manifest_lists_to_delete, manifests_to_delete, expired_manifests_to_scan, + manifests_to_revert] = std::move(expired_manifest_results); + manifests_to_scan.merge(expired_manifests_to_scan); // Deleting data files if (level == CleanupLevel::kAll) { @@ -580,34 +611,53 @@ class IncrementalFileCleanup : public FileCleanupStrategy { const std::unordered_set& manifests_to_scan, const std::unordered_set& manifests_to_revert, const std::unordered_set& valid_ids) { - std::unordered_set files_to_delete; - - for (const auto& manifest : manifests_to_scan) { - auto reader_result = MakeManifestReader(manifest, file_io_, metadata); - if (!reader_result.has_value()) continue; - auto entries_result = reader_result.value()->Entries(); - if (!entries_result.has_value()) continue; - for (const auto& entry : entries_result.value()) { - if (entry.status == ManifestStatus::kDeleted && entry.snapshot_id.has_value() && - !valid_ids.contains(entry.snapshot_id.value()) && entry.data_file) { - files_to_delete.insert(entry.data_file->file_path); - } - } - } - - for (const auto& manifest : manifests_to_revert) { - auto reader_result = MakeManifestReader(manifest, file_io_, metadata); - if (!reader_result.has_value()) continue; - auto entries_result = reader_result.value()->Entries(); - if (!entries_result.has_value()) continue; - for (const auto& entry : entries_result.value()) { - if (entry.status == ManifestStatus::kAdded && entry.data_file) { - files_to_delete.insert(entry.data_file->file_path); - } - } + auto files_to_delete = ParallelCollect( + plan_executor_, manifests_to_scan, + [this, &metadata, &valid_ids]( + const ManifestFile& manifest) -> Result> { + auto reader_result = MakeManifestReader(manifest, file_io_, metadata); + if (!reader_result.has_value()) { + return {}; + } + auto entries_result = reader_result.value()->Entries(); + if (!entries_result.has_value()) { + return {}; + } + std::unordered_set result; + for (const auto& entry : entries_result.value()) { + if (entry.status == ManifestStatus::kDeleted && + entry.snapshot_id.has_value() && + !valid_ids.contains(entry.snapshot_id.value()) && entry.data_file) { + result.insert(entry.data_file->file_path); + } + } + return result; + }, + manifests_to_revert, + [this, &metadata]( + const ManifestFile& manifest) -> Result> { + auto reader_result = MakeManifestReader(manifest, file_io_, metadata); + if (!reader_result.has_value()) { + return {}; + } + auto entries_result = reader_result.value()->Entries(); + if (!entries_result.has_value()) { + return {}; + } + std::unordered_set result; + for (const auto& entry : entries_result.value()) { + if (entry.status == ManifestStatus::kAdded && entry.data_file) { + result.insert(entry.data_file->file_path); + } + } + return result; + }); + if (!files_to_delete.has_value()) { + return {}; } - - return files_to_delete; + auto [scan_results, revert_results] = std::move(files_to_delete).value(); + scan_results.merge(revert_results); + return scan_results; } }; @@ -625,7 +675,9 @@ bool HasNonMainSnapshots(const TableMetadata& metadata) { } std::unordered_set main_ancestors; for (const auto& a : ancestors_result.value()) { - if (a) main_ancestors.insert(a->snapshot_id); + if (a) { + main_ancestors.insert(a->snapshot_id); + } } for (const auto& snapshot : metadata.snapshots) { if (snapshot && !main_ancestors.contains(snapshot->snapshot_id)) { @@ -652,16 +704,22 @@ bool HasRemovedNonMainAncestors(const TableMetadata& before, const TableMetadata return true; } for (const auto& a : ancestors_result.value()) { - if (a) main_ancestors.insert(a->snapshot_id); + if (a) { + main_ancestors.insert(a->snapshot_id); + } } } std::unordered_set after_ids; after_ids.reserve(after.snapshots.size()); for (const auto& s : after.snapshots) { - if (s) after_ids.insert(s->snapshot_id); + if (s) { + after_ids.insert(s->snapshot_id); + } } for (const auto& snapshot : before.snapshots) { - if (!snapshot) continue; + if (!snapshot) { + continue; + } bool removed = !after_ids.contains(snapshot->snapshot_id); bool in_main = main_ancestors.contains(snapshot->snapshot_id); if (removed && !in_main) { @@ -723,6 +781,11 @@ ExpireSnapshots& ExpireSnapshots::DeleteWith( return *this; } +ExpireSnapshots& ExpireSnapshots::PlanWith(Executor& executor) { + plan_executor_ = std::ref(executor); + return *this; +} + ExpireSnapshots& ExpireSnapshots::CleanupLevel(enum CleanupLevel level) { cleanup_level_ = level; return *this; @@ -733,8 +796,8 @@ ExpireSnapshots& ExpireSnapshots::CleanExpiredMetadata(bool clean) { return *this; } -ExpireSnapshots& ExpireSnapshots::ExecuteDeleteWith(OptionalExecutor executor) { - executor_ = std::move(executor); +ExpireSnapshots& ExpireSnapshots::ExecuteDeleteWith(Executor& executor) { + delete_executor_ = std::ref(executor); return *this; } @@ -781,8 +844,7 @@ Result> ExpireSnapshots::ComputeAllBranchSnapshotIds auto to_retain, ComputeBranchSnapshotsToRetain(ref->snapshot_id, expire_snapshot_older_than, min_snapshots_to_keep)); - snapshot_ids_to_retain.insert(std::make_move_iterator(to_retain.begin()), - std::make_move_iterator(to_retain.end())); + snapshot_ids_to_retain.merge(to_retain); } return snapshot_ids_to_retain; } @@ -879,9 +941,8 @@ Result ExpireSnapshots::Apply() { ComputeAllBranchSnapshotIdsToRetain(retained_refs)); ICEBERG_ASSIGN_OR_RAISE(auto unreferenced_snapshot_ids, UnreferencedSnapshotIdsToRetain(retained_refs)); - ids_to_retain.insert(all_branch_snapshot_ids.begin(), all_branch_snapshot_ids.end()); - ids_to_retain.insert(unreferenced_snapshot_ids.begin(), - unreferenced_snapshot_ids.end()); + ids_to_retain.merge(all_branch_snapshot_ids); + ids_to_retain.merge(unreferenced_snapshot_ids); ApplyResult result; result.metadata_before_expiration = std::make_shared(base); @@ -900,35 +961,45 @@ Result ExpireSnapshots::Apply() { }); if (clean_expired_metadata_) { + ICEBERG_ASSIGN_OR_RAISE( + auto reachable_ids, + ParallelCollect( + plan_executor_, ids_to_retain, + [this, &base](int64_t snapshot_id) + -> Result< + std::pair, std::unordered_set>> { + std::unordered_set spec_ids; + std::unordered_set schema_ids; + ICEBERG_ASSIGN_OR_RAISE(auto snapshot, base.SnapshotById(snapshot_id)); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, + snapshot_cache.Manifests(ctx_->table->io())); + for (const auto& manifest : manifests) { + spec_ids.insert(manifest.partition_spec_id); + } + if (snapshot->schema_id.has_value()) { + schema_ids.insert(snapshot->schema_id.value()); + } + return std::pair(std::move(spec_ids), std::move(schema_ids)); + })); + std::unordered_set reachable_specs = {base.default_spec_id}; std::unordered_set reachable_schemas = {base.current_schema_id}; - - // TODO(xiao.dong) parallel processing - for (int64_t snapshot_id : ids_to_retain) { - ICEBERG_ASSIGN_OR_RAISE(auto snapshot, base.SnapshotById(snapshot_id)); - SnapshotCache snapshot_cache(snapshot.get()); - ICEBERG_ASSIGN_OR_RAISE(auto manifests, - snapshot_cache.Manifests(ctx_->table->io())); - for (const auto& manifest : manifests) { - reachable_specs.insert(manifest.partition_spec_id); - } - if (snapshot->schema_id.has_value()) { - reachable_schemas.insert(snapshot->schema_id.value()); - } - } - - std::ranges::for_each( - base.partition_specs, [&reachable_specs, &result](const auto& spec) { - if (!reachable_specs.contains(spec->spec_id())) { - result.partition_spec_ids_to_remove.emplace_back(spec->spec_id()); - } - }); - std::ranges::for_each(base.schemas, - [&reachable_schemas, &result](const auto& schema) { - if (!reachable_schemas.contains(schema->schema_id())) { - result.schema_ids_to_remove.insert(schema->schema_id()); - } - }); + reachable_specs.merge(reachable_ids.first); + reachable_schemas.merge(reachable_ids.second); + + result.partition_spec_ids_to_remove = + base.partition_specs | std::views::filter([&reachable_specs](const auto& spec) { + return !reachable_specs.contains(spec->spec_id()); + }) | + std::views::transform(&PartitionSpec::spec_id) | + std::ranges::to>(); + result.schema_ids_to_remove = + base.schemas | std::views::filter([&reachable_schemas](const auto& schema) { + return !reachable_schemas.contains(schema->schema_id()); + }) | + std::views::transform(&Schema::schema_id) | + std::ranges::to>(); } // Cache the result for use during Finalize() @@ -969,11 +1040,13 @@ Status ExpireSnapshots::Finalize(Result commit_result) { !HasNonMainSnapshots(metadata_after_expiration); if (can_use_incremental) { - return IncrementalFileCleanup(ctx_->table->io(), delete_func_, executor_) + return IncrementalFileCleanup(ctx_->table->io(), delete_func_, delete_executor_, + plan_executor_) .CleanFiles(metadata_before_expiration, metadata_after_expiration, cleanup_level_); } - return ReachableFileCleanup(ctx_->table->io(), delete_func_, executor_) + return ReachableFileCleanup(ctx_->table->io(), delete_func_, delete_executor_, + plan_executor_) .CleanFiles(metadata_before_expiration, metadata_after_expiration, cleanup_level_); } diff --git a/src/iceberg/update/expire_snapshots.h b/src/iceberg/update/expire_snapshots.h index bb28b5a58..215ad85fd 100644 --- a/src/iceberg/update/expire_snapshots.h +++ b/src/iceberg/update/expire_snapshots.h @@ -122,6 +122,12 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { /// \return Reference to this for method chaining. ExpireSnapshots& DeleteWith(std::function delete_func); + /// \brief Configure an executor for planning expired snapshot metadata. + /// + /// \param executor Executor to use while planning expired snapshot metadata. + /// \return Reference to this for method chaining. + ExpireSnapshots& PlanWith(Executor& executor); + /// \brief Configures the cleanup level for expired files. /// /// This method provides fine-grained control over which files are cleaned up during @@ -145,12 +151,9 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { /// \brief Configure an executor for DeleteWith() callbacks. /// - /// Only used with DeleteWith(). The caller must keep the executor alive until - /// Finalize() returns. - /// - /// \param executor An executor reference, or std::nullopt for serial deletion. + /// \param executor An executor reference. /// \return Reference to this for method chaining. - ExpireSnapshots& ExecuteDeleteWith(OptionalExecutor executor); + ExpireSnapshots& ExecuteDeleteWith(Executor& executor); Kind kind() const final { return Kind::kExpireSnapshots; } bool IsRetryable() const override { return true; } @@ -194,9 +197,10 @@ class ICEBERG_EXPORT ExpireSnapshots : public PendingUpdate { std::function delete_func_; std::vector snapshot_ids_to_expire_; enum CleanupLevel cleanup_level_ { CleanupLevel::kAll }; + OptionalExecutor plan_executor_; bool clean_expired_metadata_{false}; bool specified_snapshot_id_{false}; - OptionalExecutor executor_; + OptionalExecutor delete_executor_; /// Cached result from Apply(), consumed by Finalize() and cleared after use. std::optional apply_result_; diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index 03f68cc94..40669a35f 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -30,11 +30,12 @@ #include "iceberg/manifest/manifest_writer.h" #include "iceberg/manifest/rolling_manifest_writer.h" #include "iceberg/partition_summary_internal.h" -#include "iceberg/table.h" +#include "iceberg/table.h" // IWYU pragma: keep #include "iceberg/transaction.h" #include "iceberg/util/macros.h" #include "iceberg/util/snapshot_util_internal.h" #include "iceberg/util/string_util.h" +#include "iceberg/util/task_group.h" #include "iceberg/util/uuid.h" namespace iceberg { @@ -174,7 +175,7 @@ void SnapshotUpdate::SetSummaryProperty(const std::string& property, summary_.Set(property, value); } -// TODO(xxx): write manifests in parallel +// TODO(xxx): Split files into independent rolling-writer groups before parallelizing. Result> SnapshotUpdate::WriteDataManifests( std::span> files, const std::shared_ptr& spec, @@ -200,7 +201,7 @@ Result> SnapshotUpdate::WriteDataManifests( return rolling_writer.ToManifestFiles(); } -// TODO(xxx): write manifests in parallel +// TODO(xxx): Split files into independent rolling-writer groups before parallelizing. Result> SnapshotUpdate::WriteDeleteManifests( std::span files, const std::shared_ptr& spec) { @@ -257,13 +258,17 @@ Result SnapshotUpdate::Apply() { ICEBERG_RETURN_UNEXPECTED(Validate(base(), parent_snapshot)); ICEBERG_ASSIGN_OR_RAISE(auto manifests, Apply(base(), parent_snapshot)); + auto metadata_tasks = TaskGroup().SetExecutor(plan_executor_); for (auto& manifest : manifests) { if (manifest.added_snapshot_id != kInvalidSnapshotId) { continue; } - // TODO(xxx): read in parallel and cache enriched manifests for retries - ICEBERG_ASSIGN_OR_RAISE(manifest, AddMetadata(manifest, ctx_->table->io(), base())); + metadata_tasks.Submit([&manifest, this]() -> Status { + ICEBERG_ASSIGN_OR_RAISE(manifest, AddMetadata(manifest, ctx_->table->io(), base())); + return {}; + }); } + ICEBERG_RETURN_UNEXPECTED(std::move(metadata_tasks).Run()); std::string manifest_list_path = ManifestListPath(); manifest_lists_.push_back(manifest_list_path); @@ -419,8 +424,9 @@ std::string SnapshotUpdate::ManifestListPath() { // Generate manifest list path // Format: {metadata_location}/snap-{snapshot_id}-{attempt}-{uuid}.avro int64_t snapshot_id = SnapshotId(); + auto attempt = attempt_.fetch_add(1, std::memory_order_relaxed) + 1; std::string filename = - std::format("snap-{}-{}-{}.avro", snapshot_id, ++attempt_, commit_uuid_); + std::format("snap-{}-{}-{}.avro", snapshot_id, attempt, commit_uuid_); return ctx_->MetadataFileLocation(filename); } @@ -449,7 +455,8 @@ SnapshotSummaryBuilder SnapshotUpdate::BuildManifestCountSummary( std::string SnapshotUpdate::ManifestPath() { // Generate manifest path // Format: {metadata_location}/{uuid}-m{manifest_count}.avro - std::string filename = std::format("{}-m{}.avro", commit_uuid_, manifest_count_++); + auto manifest_count = manifest_count_.fetch_add(1, std::memory_order_relaxed); + std::string filename = std::format("{}-m{}.avro", commit_uuid_, manifest_count); return ctx_->MetadataFileLocation(filename); } diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index b2c92bfb1..fa8dcbf12 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -19,6 +19,7 @@ #pragma once +#include #include #include #include @@ -33,6 +34,7 @@ #include "iceberg/snapshot.h" #include "iceberg/type_fwd.h" #include "iceberg/update/pending_update.h" +#include "iceberg/util/executor.h" namespace iceberg { @@ -81,6 +83,15 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { return self; } + /// \brief Configure an executor for manifest planning work. + /// + /// \param executor Executor to use while planning manifests. + /// \return Reference to this for method chaining. + auto& ScanManifestsWith(this auto& self, Executor& executor) { + self.plan_executor_ = std::ref(executor); + return self; + } + /// \brief Perform operations on a particular branch. /// /// \param branch The name of a SnapshotRef of type branch. @@ -152,8 +163,10 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { const std::string& target_branch() const { return target_branch_; } bool can_inherit_snapshot_id() const { return can_inherit_snapshot_id_; } const std::string& commit_uuid() const { return commit_uuid_; } - int32_t manifest_count() const { return manifest_count_; } - int32_t attempt() const { return attempt_; } + int32_t manifest_count() const { + return manifest_count_.load(std::memory_order_relaxed); + } + int32_t attempt() const { return attempt_.load(std::memory_order_relaxed); } int64_t target_manifest_size_bytes() const { return target_manifest_size_bytes_; } /// \brief Clean up any uncommitted manifests that were created. @@ -238,11 +251,12 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { private: const bool can_inherit_snapshot_id_{true}; const std::string commit_uuid_; - int32_t manifest_count_{0}; - int32_t attempt_{0}; + std::atomic manifest_count_{0}; + std::atomic attempt_{0}; std::vector manifest_lists_; const int64_t target_manifest_size_bytes_; std::optional snapshot_id_; + OptionalExecutor plan_executor_; bool stage_only_{false}; std::function delete_func_; std::string target_branch_{SnapshotRef::kMainBranch}; From 3e8203e8ee66bd835a59b06127bb5f9d935769bb Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 24 Jun 2026 22:11:35 +0800 Subject: [PATCH 122/151] fix(update): clean up delete files from expired manifests (#779) Reachable cleanup now reads live paths from data and delete manifests, matching Java's ManifestFiles.readPaths behavior. --- src/iceberg/test/expire_snapshots_test.cc | 13 +++++--- src/iceberg/update/expire_snapshots.cc | 37 +++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/iceberg/test/expire_snapshots_test.cc b/src/iceberg/test/expire_snapshots_test.cc index 1216952e7..b96754ec0 100644 --- a/src/iceberg/test/expire_snapshots_test.cc +++ b/src/iceberg/test/expire_snapshots_test.cc @@ -376,6 +376,8 @@ TEST_F(ExpireSnapshotsCleanupTest, IgnoresExpiredDeleteManifestReadFailures) { const auto expired_data_manifest_path = table_location_ + "/metadata/expired-data.avro"; const auto expired_delete_manifest_path = table_location_ + "/metadata/expired-delete.avro"; + const auto missing_delete_manifest_path = + table_location_ + "/metadata/missing-delete.avro"; const auto expired_manifest_list_path = table_location_ + "/metadata/expired-manifest-list.avro"; const auto current_manifest_list_path = @@ -389,6 +391,7 @@ TEST_F(ExpireSnapshotsCleanupTest, IgnoresExpiredDeleteManifestReadFailures) { expired_delete_manifest_path, kExpiredSnapshotId, {MakeEntry(ManifestStatus::kAdded, kExpiredSnapshotId, kExpiredSequenceNumber, MakePositionDeleteFile(expired_delete_file_path))}); + expired_delete_manifest.manifest_path = missing_delete_manifest_path; WriteManifestList(expired_manifest_list_path, kExpiredSnapshotId, /*parent_snapshot_id=*/0, kExpiredSequenceNumber, {expired_data_manifest, expired_delete_manifest}); @@ -406,7 +409,7 @@ TEST_F(ExpireSnapshotsCleanupTest, IgnoresExpiredDeleteManifestReadFailures) { EXPECT_THAT(update->Commit(), IsOk()); EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, expired_data_manifest_path, - expired_delete_manifest_path, + missing_delete_manifest_path, expired_manifest_list_path)); } @@ -443,10 +446,10 @@ TEST_F(ExpireSnapshotsCleanupTest, DeletesExpiredFiles) { [&deleted_files](const std::string& path) { deleted_files.push_back(path); }); EXPECT_THAT(update->Commit(), IsOk()); - EXPECT_THAT(deleted_files, testing::UnorderedElementsAre(expired_data_file_path, - expired_data_manifest_path, - expired_delete_manifest_path, - expired_manifest_list_path)); + EXPECT_THAT(deleted_files, testing::UnorderedElementsAre( + expired_data_file_path, expired_delete_file_path, + expired_data_manifest_path, expired_delete_manifest_path, + expired_manifest_list_path)); } TEST_F(ExpireSnapshotsCleanupTest, ExecutorDispatchesDeletesConcurrently) { diff --git a/src/iceberg/update/expire_snapshots.cc b/src/iceberg/update/expire_snapshots.cc index d14a7331f..5573efa77 100644 --- a/src/iceberg/update/expire_snapshots.cc +++ b/src/iceberg/update/expire_snapshots.cc @@ -236,10 +236,10 @@ class ReachableFileCleanup : public FileCleanupStrategy { if (!manifests_to_delete.empty()) { if (level == CleanupLevel::kAll) { - // Deleting data files - auto data_files_to_delete = FindDataFilesToDelete( + // Deleting data and delete files. + auto files_to_delete = FindFilesToDelete( metadata_before_expiration, manifests_to_delete, current_manifests); - DeleteFiles(data_files_to_delete); + DeleteFiles(files_to_delete); } // Deleting manifest files @@ -300,25 +300,22 @@ class ReachableFileCleanup : public FileCleanupStrategy { return manifests_to_delete; } - Result> ReadLiveDataFilePaths( + Result> ReadLiveFilePaths( const TableMetadata& metadata, const ManifestFile& manifest) { - ICEBERG_PRECHECK(manifest.content == ManifestContent::kData, - "Cannot read data file paths from a delete manifest: {}", - manifest.manifest_path); - // TODO(shangxinli): optimize by only reading file paths ICEBERG_ASSIGN_OR_RAISE(auto reader, MakeManifestReader(manifest, file_io_, metadata)); + reader->Select({"file_path"}); ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->LiveEntries()); - std::unordered_set data_file_paths; + std::unordered_set file_paths; for (const auto& entry : entries) { if (entry.data_file) { - data_file_paths.insert(entry.data_file->file_path); + file_paths.insert(entry.data_file->file_path); } } - return data_file_paths; + return file_paths; } /// \brief Project manifests to manifest paths for deletion. @@ -332,8 +329,8 @@ class ReachableFileCleanup : public FileCleanupStrategy { return manifest_paths; } - /// \brief Find data files to delete from manifests being removed. - std::unordered_set FindDataFilesToDelete( + /// \brief Find files to delete from manifests being removed. + std::unordered_set FindFilesToDelete( const TableMetadata& metadata, const std::unordered_set& manifests_to_delete, const std::unordered_set& current_manifests) { @@ -342,7 +339,7 @@ class ReachableFileCleanup : public FileCleanupStrategy { plan_executor_, manifests_to_delete, [this, &metadata]( const ManifestFile& manifest) -> Result> { - auto result = ReadLiveDataFilePaths(metadata, manifest); + auto result = ReadLiveFilePaths(metadata, manifest); // Ignore expired-manifest read failures and keep scanning candidates. if (!result.has_value()) { return std::unordered_set{}; @@ -352,26 +349,26 @@ class ReachableFileCleanup : public FileCleanupStrategy { if (!live_file_results.has_value()) { return {}; } - auto data_files_to_delete = std::move(live_file_results).value(); - if (data_files_to_delete.empty()) { - return data_files_to_delete; + auto files_to_delete = std::move(live_file_results).value(); + if (files_to_delete.empty()) { + return files_to_delete; } // Remove files still referenced by current manifests. auto current_live_results = ParallelCollect(plan_executor_, current_manifests, [this, &metadata](const ManifestFile& manifest) { - return ReadLiveDataFilePaths(metadata, manifest); + return ReadLiveFilePaths(metadata, manifest); }); // Fail closed if any retained manifest cannot be read safely. if (!current_live_results.has_value()) { return std::unordered_set{}; } for (const auto& file_path : current_live_results.value()) { - data_files_to_delete.erase(file_path); + files_to_delete.erase(file_path); } - return data_files_to_delete; + return files_to_delete; } }; From 411c0f8ddc2abe95140552cb9d1cf363d541b0af Mon Sep 17 00:00:00 2001 From: kamcheungting-db <91572897+kamcheungting-db@users.noreply.github.com> Date: Wed, 24 Jun 2026 08:43:48 -0700 Subject: [PATCH 123/151] feat(logging): add CerrLogger std::cerr backend (#724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 3 of the logging stack — now based on `main` (#723 merged). Adds the first concrete sink: a dependency-free `std::cerr` logger, also the default backend when spdlog is off. **What's here** - `CerrLogger` writes one line per record: `YYYY-MM-DDThh:mm:ss.mmmZ LEVEL [tid] [file:line] message`. - UTC millisecond timestamps, OS-native cached thread id (extracted to `util/thread_util.h`), lock-free level check, and a whole-line mutex so concurrent records never interleave. - Pure standard library, always available. `Log`/`Flush` never throw. Inherits the base `Initialize("level")`; `pattern` is ignored (fixed layout; only the spdlog backend honors `pattern`). **Tests** (`cerr_logger_test`): level filtering, the fixed line layout incl. the `.mmm` field and `[file:line]`, inherited `Initialize`, `Flush`, never-throw when the sink itself throws, and concurrent-write non-interleaving. Built/run under clang-libc++; ASan + TSan clean. This pull request and its description were written by Isaac. --- ci/scripts/build_example.sh | 6 +- src/iceberg/CMakeLists.txt | 2 + src/iceberg/logging/cerr_logger.cc | 77 +++++++++ src/iceberg/logging/cerr_logger.h | 61 +++++++ src/iceberg/logging/logger.cc | 9 +- src/iceberg/logging/logger.h | 8 +- src/iceberg/logging/meson.build | 5 +- src/iceberg/meson.build | 2 + src/iceberg/test/CMakeLists.txt | 6 +- src/iceberg/test/cerr_logger_test.cc | 209 ++++++++++++++++++++++++ src/iceberg/test/meson.build | 8 +- src/iceberg/util/thread_util.cc | 49 ++++++ src/iceberg/util/thread_util_internal.h | 36 ++++ 13 files changed, 463 insertions(+), 15 deletions(-) create mode 100644 src/iceberg/logging/cerr_logger.cc create mode 100644 src/iceberg/logging/cerr_logger.h create mode 100644 src/iceberg/test/cerr_logger_test.cc create mode 100644 src/iceberg/util/thread_util.cc create mode 100644 src/iceberg/util/thread_util_internal.h diff --git a/ci/scripts/build_example.sh b/ci/scripts/build_example.sh index 77abbc310..41714cf32 100755 --- a/ci/scripts/build_example.sh +++ b/ci/scripts/build_example.sh @@ -23,7 +23,8 @@ source_dir=${1} build_dir=${1}/build run_example=${ICEBERG_RUN_EXAMPLE:-OFF} -mkdir ${build_dir} +rm -rf "${build_dir}" +mkdir "${build_dir}" pushd ${build_dir} is_windows() { @@ -60,6 +61,3 @@ else fi popd - -# clean up between builds -rm -rf ${build_dir} diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index aa051cd14..94523fb54 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -49,6 +49,7 @@ set(ICEBERG_SOURCES inheritable_metadata.cc json_serde.cc location_provider.cc + logging/cerr_logger.cc logging/logger.cc manifest/manifest_adapter.cc manifest/manifest_entry.cc @@ -133,6 +134,7 @@ set(ICEBERG_SOURCES util/struct_like_set.cc util/task_group.cc util/temporal_util.cc + util/thread_util.cc util/timepoint.cc util/transform_util.cc util/truncate_util.cc diff --git a/src/iceberg/logging/cerr_logger.cc b/src/iceberg/logging/cerr_logger.cc new file mode 100644 index 000000000..0856d963f --- /dev/null +++ b/src/iceberg/logging/cerr_logger.cc @@ -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. + */ + +#include "iceberg/logging/cerr_logger.h" + +#include +#include +#include +#include +#include +#include + +#include "iceberg/util/thread_util_internal.h" + +namespace iceberg { + +namespace { + +/// \brief Trailing path component of a source file path. +std::string_view Basename(std::string_view path) noexcept { + auto pos = path.find_last_of("/\\"); + return pos == std::string_view::npos ? path : path.substr(pos + 1); +} + +/// \brief Format a record into a single newline-terminated line. +std::string FormatLine(const LogMessage& message) { + auto now = + std::chrono::floor(std::chrono::system_clock::now()); + return std::format("{:%Y-%m-%dT%H:%M:%S}Z {} [{}] [{}:{}] {}\n", now, + ToString(message.level), OsThreadId(), + Basename(message.location.file_name()), message.location.line(), + message.message); +} + +} // namespace + +void CerrLogger::Log(LogMessage&& message) noexcept { + try { + std::string line = FormatLine(message); + std::lock_guard lock(mutex_); + std::cerr << line; + } catch (...) { + // Logging must never throw. Reached if either formatting or the write fails; + // emit a short marker best-effort and swallow anything further. + try { + std::lock_guard lock(mutex_); + std::cerr << "\n"; + } catch (...) { + } + } +} + +void CerrLogger::Flush() noexcept { + try { + std::lock_guard lock(mutex_); + std::cerr.flush(); + } catch (...) { + } +} + +} // namespace iceberg diff --git a/src/iceberg/logging/cerr_logger.h b/src/iceberg/logging/cerr_logger.h new file mode 100644 index 000000000..334f20391 --- /dev/null +++ b/src/iceberg/logging/cerr_logger.h @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/logging/cerr_logger.h +/// \brief Always-available std::cerr logging backend. + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/logging/log_level.h" +#include "iceberg/logging/logger.h" + +namespace iceberg { + +/// \brief Logger that writes one line per record to std::cerr. +/// +/// Line layout: `YYYY-MM-DDThh:mm:ss.mmmZ LEVEL [tid] [file:line] message`. +/// The minimum level is held in a lock-free atomic; a mutex serializes the +/// whole-line write so concurrent records never interleave. Pure standard +/// library -- always compiled, regardless of ICEBERG_SPDLOG. +class ICEBERG_EXPORT CerrLogger : public Logger { + public: + explicit CerrLogger(LogLevel level = LogLevel::kInfo) : level_(level) {} + + bool ShouldLog(LogLevel level) const noexcept override { + return level >= level_.load(std::memory_order_relaxed); + } + void Log(LogMessage&& message) noexcept override; + void SetLevel(LogLevel level) noexcept override { + level_.store(level, std::memory_order_relaxed); + } + LogLevel level() const noexcept override { + return level_.load(std::memory_order_relaxed); + } + void Flush() noexcept override; + + private: + std::atomic level_; + std::mutex mutex_; +}; + +} // namespace iceberg diff --git a/src/iceberg/logging/logger.cc b/src/iceberg/logging/logger.cc index 3adbf75dd..a8db67ca9 100644 --- a/src/iceberg/logging/logger.cc +++ b/src/iceberg/logging/logger.cc @@ -26,6 +26,8 @@ #include #include +#include "iceberg/logging/cerr_logger.h" + namespace iceberg { namespace { @@ -42,10 +44,9 @@ class NoopLogger final : public Logger { /// \brief Construct the process default logger for this build configuration. /// -/// This block ships only the interface and the no-op logger; the concrete -/// std::cerr and spdlog sinks (and the build-config selection between them) -/// arrive in later blocks, which update this factory. -std::shared_ptr MakeDefaultLogger() { return std::make_shared(); } +/// Uses the always-available std::cerr sink. The spdlog backend (preferred when +/// compiled in) is wired into this factory in a later block. +std::shared_ptr MakeDefaultLogger() { return std::make_shared(); } /// \brief The process-global default-logger slot. struct DefaultSlot { diff --git a/src/iceberg/logging/logger.h b/src/iceberg/logging/logger.h index 8a642f833..66f81501a 100644 --- a/src/iceberg/logging/logger.h +++ b/src/iceberg/logging/logger.h @@ -127,8 +127,8 @@ class ICEBERG_EXPORT LogMessage::Builder { /// \brief Well-known Logger::Initialize() property keys. /// /// `level` is honored by the base Logger::Initialize (parsed via -/// LogLevelFromString). `pattern` is honored by the formatting sinks -/// (CerrLogger, SpdLogger). +/// LogLevelFromString) on every backend. `pattern` is honored only by the +/// spdlog backend; CerrLogger uses a fixed layout and ignores it. inline constexpr std::string_view kLevelProperty = "level"; inline constexpr std::string_view kPatternProperty = "pattern"; @@ -150,8 +150,8 @@ class ICEBERG_EXPORT Logger { /// /// The base implementation applies the "level" property (parsed via /// LogLevelFromString); an unrecognized value is an InvalidArgument error. - /// Formatting sinks override this to also apply "pattern" and then delegate - /// to this base for "level". + /// The spdlog backend overrides this to also apply "pattern" and then delegates + /// to this base for "level"; CerrLogger uses the base as-is (fixed layout). virtual Status Initialize( const std::unordered_map& properties) { if (auto it = properties.find(std::string(kLevelProperty)); it != properties.end()) { diff --git a/src/iceberg/logging/meson.build b/src/iceberg/logging/meson.build index 3f7af4fec..e4ca111f4 100644 --- a/src/iceberg/logging/meson.build +++ b/src/iceberg/logging/meson.build @@ -15,4 +15,7 @@ # specific language governing permissions and limitations # under the License. -install_headers(['log_level.h', 'logger.h'], subdir: 'iceberg/logging') +install_headers( + ['cerr_logger.h', 'log_level.h', 'logger.h'], + subdir: 'iceberg/logging', +) diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 58d79a402..71a4498f1 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -74,6 +74,7 @@ iceberg_sources = files( 'inspect/snapshots_table.cc', 'json_serde.cc', 'location_provider.cc', + 'logging/cerr_logger.cc', 'logging/logger.cc', 'manifest/manifest_adapter.cc', 'manifest/manifest_entry.cc', @@ -158,6 +159,7 @@ iceberg_sources = files( 'util/struct_like_set.cc', 'util/task_group.cc', 'util/temporal_util.cc', + 'util/thread_util.cc', 'util/timepoint.cc', 'util/transform_util.cc', 'util/truncate_util.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 0756c1eef..fcbc22126 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -102,7 +102,11 @@ add_iceberg_test(table_test table_test.cc table_update_test.cc) -add_iceberg_test(logging_test SOURCES log_level_test.cc logger_test.cc) +add_iceberg_test(logging_test + SOURCES + cerr_logger_test.cc + log_level_test.cc + logger_test.cc) add_iceberg_test(expression_test SOURCES diff --git a/src/iceberg/test/cerr_logger_test.cc b/src/iceberg/test/cerr_logger_test.cc new file mode 100644 index 000000000..9a44dfcac --- /dev/null +++ b/src/iceberg/test/cerr_logger_test.cc @@ -0,0 +1,209 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/logging/cerr_logger.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "iceberg/logging/log_level.h" +#include "iceberg/logging/logger.h" + +namespace iceberg { + +namespace { + +/// \brief RAII redirect of std::cerr to a stringstream for the test scope. +class CerrCapture { + public: + CerrCapture() : old_(std::cerr.rdbuf(buffer_.rdbuf())) {} + ~CerrCapture() { std::cerr.rdbuf(old_); } + std::string str() const { return buffer_.str(); } + + private: + std::ostringstream buffer_; + std::streambuf* old_; +}; + +LogMessage MakeMessage(LogLevel level, std::string text) { + return LogMessage{.level = level, + .message = std::move(text), + .location = std::source_location::current(), + .attributes = {}}; +} + +/// \brief First line of \p text, without the trailing newline. +std::string FirstLine(const std::string& text) { + auto pos = text.find('\n'); + return text.substr(0, pos == std::string::npos ? text.size() : pos); +} + +/// \brief A streambuf that throws on every write, to drive the never-throw path. +/// +/// Throws a payload-less exception on purpose: an exception type with a +/// heap-allocated what() string (e.g. std::runtime_error) trips an ASan +/// alloc-dealloc-mismatch as the string crosses the instrumented binary / +/// system libc++abi boundary during unwinding -- unrelated to the code here. +struct SinkFailure {}; +class ThrowingBuf : public std::streambuf { + protected: + int overflow(int /*ch*/) override { throw SinkFailure{}; } + std::streamsize xsputn(const char* /*s*/, std::streamsize /*n*/) override { + throw SinkFailure{}; + } +}; + +/// \brief RAII: point std::cerr at a throwing buffer with exceptions armed, and +/// restore all of cerr's state (buffer, exception mask, error flags) on exit -- +/// so a thrown assertion can never leak the dangling/throwing stream to other +/// tests. +class CerrThrowingGuard { + public: + CerrThrowingGuard() + : old_buf_(std::cerr.rdbuf(&buf_)), old_exc_(std::cerr.exceptions()) { + std::cerr.exceptions(std::ios::badbit | std::ios::failbit); // make << rethrow + } + ~CerrThrowingGuard() { + std::cerr.clear(); + std::cerr.exceptions(old_exc_); + std::cerr.rdbuf(old_buf_); + } + + private: + ThrowingBuf buf_; + std::streambuf* old_buf_; + std::ios_base::iostate old_exc_; +}; + +} // namespace + +TEST(CerrLoggerTest, DefaultLevelIsInfo) { + CerrLogger logger; + EXPECT_EQ(logger.level(), LogLevel::kInfo); + EXPECT_FALSE(logger.ShouldLog(LogLevel::kDebug)); + EXPECT_TRUE(logger.ShouldLog(LogLevel::kInfo)); + EXPECT_TRUE(logger.ShouldLog(LogLevel::kError)); +} + +TEST(CerrLoggerTest, SetLevelFilters) { + CerrLogger logger(LogLevel::kError); + EXPECT_FALSE(logger.ShouldLog(LogLevel::kWarn)); + logger.SetLevel(LogLevel::kTrace); + EXPECT_TRUE(logger.ShouldLog(LogLevel::kTrace)); +} + +TEST(CerrLoggerTest, LineContainsLevelAndMessage) { + CerrLogger logger; + CerrCapture capture; + logger.Log(MakeMessage(LogLevel::kError, "boom 42")); + std::string out = capture.str(); + EXPECT_NE(out.find("error"), std::string::npos); + EXPECT_NE(out.find("boom 42"), std::string::npos); + EXPECT_NE(out.find("cerr_logger_test.cc"), std::string::npos); + EXPECT_EQ(out.back(), '\n'); +} + +// The whole value of CerrLogger over a backend is its fixed line layout: +// `YYYY-MM-DDThh:mm:ss.mmmZ LEVEL [tid] [file:line] message`. Assert the shape, +// especially the .mmm millisecond field (which silently vanishes if the +// time_point is no longer floored to milliseconds). +TEST(CerrLoggerTest, LineMatchesFixedLayout) { + CerrLogger logger; + CerrCapture capture; + logger.Log(MakeMessage(LogLevel::kWarn, "hello world")); + const std::regex layout( + R"(^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z \w+ \[\d+\] \[\S+:\d+\] hello world$)"); + EXPECT_TRUE(std::regex_match(FirstLine(capture.str()), layout)) << capture.str(); +} + +// CerrLogger deliberately does not override Initialize: it inherits the base, +// which applies "level" and ignores unknown keys like "pattern". +TEST(CerrLoggerTest, InitializeAppliesLevelAndIgnoresPattern) { + CerrLogger logger; + auto status = logger.Initialize({{std::string(kLevelProperty), "warn"}, + {std::string(kPatternProperty), "ignored"}}); + ASSERT_TRUE(status.has_value()); + EXPECT_EQ(logger.level(), LogLevel::kWarn); +} + +TEST(CerrLoggerTest, FlushDoesNotThrow) { + CerrLogger logger; + CerrCapture capture; + logger.Log(MakeMessage(LogLevel::kError, "x")); + logger.Flush(); // best-effort; must not throw + EXPECT_NE(capture.str().find('x'), std::string::npos); +} + +// Log()/Flush() are noexcept: even when every write to the sink throws, they +// must swallow it (a leaked exception from a noexcept function -> std::terminate). +TEST(CerrLoggerTest, LogAndFlushNeverThrowWhenSinkThrows) { + CerrThrowingGuard guard; // cerr -> throwing sink; state restored on scope exit + CerrLogger logger(LogLevel::kTrace); + logger.Log(MakeMessage(LogLevel::kInfo, "x")); // write throws -> fallback also throws + logger.Flush(); + SUCCEED(); +} + +TEST(CerrLoggerTest, ConcurrentLogsDoNotInterleave) { + CerrLogger logger(LogLevel::kTrace); + CerrCapture capture; + constexpr int kThreads = 8; + constexpr int kPerThread = 50; + + std::vector threads; + for (int t = 0; t < kThreads; ++t) { + threads.emplace_back([&logger, t] { + for (int i = 0; i < kPerThread; ++i) { + // Distinct payload per record so an interleave would corrupt a line. + logger.Log(MakeMessage(LogLevel::kInfo, std::format("t{}-{}", t, i))); + } + }); + } + for (auto& thread : threads) thread.join(); + + // Each output line must be a complete, well-formed record ending in its own + // payload, and every (thread, index) payload must appear exactly once -- this + // proves the whole-line write is atomic, not merely that newlines were kept. + const std::regex line(R"(^.*\] (t\d+-\d+)$)"); + std::set seen; + std::istringstream in(capture.str()); + std::string row; + int lines = 0; + while (std::getline(in, row)) { + ++lines; + std::smatch m; + ASSERT_TRUE(std::regex_match(row, m, line)) << "garbled line: " << row; + EXPECT_TRUE(seen.insert(m[1].str()).second) << "duplicate payload: " << m[1].str(); + } + EXPECT_EQ(lines, kThreads * kPerThread); + EXPECT_EQ(seen.size(), static_cast(kThreads * kPerThread)); +} + +} // namespace iceberg diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index b01a61904..ba0f6230d 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -61,7 +61,13 @@ iceberg_tests = { 'table_update_test.cc', ), }, - 'logging_test': {'sources': files('log_level_test.cc', 'logger_test.cc')}, + 'logging_test': { + 'sources': files( + 'cerr_logger_test.cc', + 'log_level_test.cc', + 'logger_test.cc', + ), + }, 'expression_test': { 'sources': files( 'aggregate_test.cc', diff --git a/src/iceberg/util/thread_util.cc b/src/iceberg/util/thread_util.cc new file mode 100644 index 000000000..ed6cccfa9 --- /dev/null +++ b/src/iceberg/util/thread_util.cc @@ -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. + */ + +#include "iceberg/util/thread_util_internal.h" + +#if defined(_WIN32) +# include +#elif defined(__APPLE__) +# include +#else +# include + +# include +#endif + +namespace iceberg { + +uint64_t OsThreadId() noexcept { + static thread_local uint64_t tid = []() -> uint64_t { +#if defined(_WIN32) + return static_cast(::GetCurrentThreadId()); +#elif defined(__APPLE__) + uint64_t id = 0; + pthread_threadid_np(nullptr, &id); + return id; +#else + return static_cast(::syscall(SYS_gettid)); +#endif + }(); + return tid; +} + +} // namespace iceberg diff --git a/src/iceberg/util/thread_util_internal.h b/src/iceberg/util/thread_util_internal.h new file mode 100644 index 000000000..ebd18fca1 --- /dev/null +++ b/src/iceberg/util/thread_util_internal.h @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +#include + +namespace iceberg { + +/// \brief OS-native thread id for the calling thread, cached per thread. +/// +/// Returns the cross-process-correlatable id used by spdlog/glog (Linux +/// gettid, macOS pthread_threadid_np, Windows GetCurrentThreadId), not the +/// opaque std::thread::id -- and so avoids the std::formatter +/// (P2693) minimum-toolchain dependency. The first call on a thread performs +/// the OS query; later calls return the cached value (no syscall per call). +/// Declared here so the platform headers stay confined to the .cc. +uint64_t OsThreadId() noexcept; + +} // namespace iceberg From a1f3514d506951db356d398c72c3a71797fd10ff Mon Sep 17 00:00:00 2001 From: liuxiaoyu <45345701+MisterRaindrop@users.noreply.github.com> Date: Thu, 25 Jun 2026 17:44:05 +0800 Subject: [PATCH 124/151] feat(hive): add iceberg_hive library with bundled/system thrift dependency (#753) --- CMakeLists.txt | 7 +- cmake_modules/FindThriftAlt.cmake | 136 ++++++++++++++++++ .../IcebergThirdpartyToolchain.cmake | 47 ++++++ src/iceberg/CMakeLists.txt | 8 ++ src/iceberg/catalog/hive/CMakeLists.txt | 91 +++++++++++- src/iceberg/catalog/hive/hive_catalog.cc | 132 +++++++++++++++++ src/iceberg/catalog/hive/hive_catalog.h | 115 +++++++++++++++ .../catalog/hive/hive_catalog_properties.cc | 57 ++++++++ .../catalog/hive/hive_catalog_properties.h | 104 ++++++++++++++ src/iceberg/iceberg-config.cmake.in | 2 + 10 files changed, 691 insertions(+), 8 deletions(-) create mode 100644 cmake_modules/FindThriftAlt.cmake create mode 100644 src/iceberg/catalog/hive/hive_catalog.cc create mode 100644 src/iceberg/catalog/hive/hive_catalog.h create mode 100644 src/iceberg/catalog/hive/hive_catalog_properties.cc create mode 100644 src/iceberg/catalog/hive/hive_catalog_properties.h diff --git a/CMakeLists.txt b/CMakeLists.txt index cb0b2ae2b..eb1391238 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,12 +49,13 @@ option(ICEBERG_BUILD_HIVE "Build hive (HMS) catalog client" OFF) option(ICEBERG_BUILD_SQL_CATALOG "Build SQL catalog client" OFF) # Built-in SQL catalog database connectors. Disable all of them to build a SQL # catalog that only works with a user-supplied CatalogStore. -option(ICEBERG_SQL_SQLITE "Build the SQLite connector for the SQL catalog" OFF) -option(ICEBERG_SQL_POSTGRESQL "Build the PostgreSQL connector for the SQL catalog" OFF) -option(ICEBERG_SQL_MYSQL "Build the MySQL connector for the SQL catalog" OFF) +option(ICEBERG_SQL_SQLITE "Build SQLite connector for SQL catalog" OFF) +option(ICEBERG_SQL_POSTGRESQL "Build PostgreSQL connector for SQL catalog" OFF) +option(ICEBERG_SQL_MYSQL "Build MySQL connector for SQL catalog" OFF) option(ICEBERG_S3 "Build with S3 support" OFF) option(ICEBERG_SIGV4 "Build with SigV4 support" OFF) option(ICEBERG_BUNDLE_AWSSDK "Bundle AWS SDK for S3/SigV4 support" ON) +option(ICEBERG_BUNDLE_THRIFT "Bundle Thrift (from Arrow) for Hive catalog" ON) option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) diff --git a/cmake_modules/FindThriftAlt.cmake b/cmake_modules/FindThriftAlt.cmake new file mode 100644 index 000000000..13820998b --- /dev/null +++ b/cmake_modules/FindThriftAlt.cmake @@ -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. + +# FindThriftAlt.cmake - locate an installed Apache Thrift C++ runtime. +# +# Named "ThriftAlt" rather than "Thrift" (following Arrow's FindThriftAlt.cmake) +# so it does not collide with a downstream project's own FindThrift.cmake, and +# so this module can itself call find_package(Thrift CONFIG) to reuse an +# upstream ThriftConfig.cmake without recursing into itself. +# +# Discovery order: +# 1. CONFIG mode (ThriftConfig.cmake), shipped by CMake-based Thrift installs +# (>= 0.13). When present it already provides a usable thrift::thrift. +# 2. pkg-config (thrift.pc), used by autotools installs and Homebrew. +# 3. A plain library / header search as a last resort (e.g. when neither a +# CMake config nor pkg-config is available). +# +# This module defines: +# ThriftAlt_FOUND - whether the Thrift C++ runtime was found +# ThriftAlt_VERSION - the detected Thrift version, if known +# thrift::thrift - imported target for the Thrift C++ runtime + +if(ThriftAlt_FOUND OR TARGET thrift::thrift) + set(ThriftAlt_FOUND TRUE) + return() +endif() + +# ---------------------------------------------------------------------- +# 1. CONFIG mode: reuse an upstream ThriftConfig.cmake when available. +# +# This module is intentionally NOT named FindThrift.cmake, so a CONFIG-mode +# find_package(Thrift) here resolves to the upstream package config rather than +# back to this file. + +set(_thriftalt_config_args CONFIG QUIET) +if(ThriftAlt_FIND_VERSION) + list(APPEND _thriftalt_config_args ${ThriftAlt_FIND_VERSION}) +endif() +find_package(Thrift ${_thriftalt_config_args}) +if(Thrift_FOUND AND TARGET thrift::thrift) + set(ThriftAlt_FOUND TRUE) + set(ThriftAlt_VERSION "${Thrift_VERSION}") +endif() + +# ---------------------------------------------------------------------- +# 2 + 3. pkg-config, then a plain library / header search. + +if(NOT ThriftAlt_FOUND) + find_package(PkgConfig QUIET) + if(PkgConfig_FOUND) + pkg_check_modules(THRIFT_PC QUIET thrift) + endif() + + find_library(ThriftAlt_LIB + NAMES thrift libthrift + HINTS ${THRIFT_PC_LIBDIR} ${THRIFT_PC_LIBRARY_DIRS} + PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib") + find_path(ThriftAlt_INCLUDE_DIR + NAMES thrift/Thrift.h + HINTS ${THRIFT_PC_INCLUDEDIR} ${THRIFT_PC_INCLUDE_DIRS} + PATH_SUFFIXES "include") + + if(THRIFT_PC_VERSION) + set(ThriftAlt_VERSION "${THRIFT_PC_VERSION}") + elseif(ThriftAlt_INCLUDE_DIR AND EXISTS "${ThriftAlt_INCLUDE_DIR}/thrift/config.h") + file(READ "${ThriftAlt_INCLUDE_DIR}/thrift/config.h" _thrift_config_h) + string(REGEX MATCH "#define PACKAGE_VERSION \"([0-9.]+)\"" _ "${_thrift_config_h}") + set(ThriftAlt_VERSION "${CMAKE_MATCH_1}") + endif() +endif() + +include(FindPackageHandleStandardArgs) +if(TARGET thrift::thrift) + # CONFIG mode already produced the target; satisfy REQUIRED_VARS with it. + find_package_handle_standard_args( + ThriftAlt + REQUIRED_VARS thrift::thrift + VERSION_VAR ThriftAlt_VERSION) +else() + find_package_handle_standard_args( + ThriftAlt + REQUIRED_VARS ThriftAlt_LIB ThriftAlt_INCLUDE_DIR + VERSION_VAR ThriftAlt_VERSION) +endif() + +if(ThriftAlt_FOUND AND NOT TARGET thrift::thrift) + add_library(thrift::thrift UNKNOWN IMPORTED) + set_target_properties(thrift::thrift + PROPERTIES IMPORTED_LOCATION "${ThriftAlt_LIB}" + INTERFACE_INCLUDE_DIRECTORIES + "${ThriftAlt_INCLUDE_DIR}") + if(WIN32) + set_property(TARGET thrift::thrift PROPERTY INTERFACE_LINK_LIBRARIES "ws2_32") + endif() +endif() + +# ---------------------------------------------------------------------- +# Boost headers. +# +# Thrift's public C++ headers include , but +# neither thrift.pc nor (older) ThriftConfig.cmake advertise Boost. Attach Boost +# headers so consumers of thrift::thrift can compile the generated bindings. +# +# Use CONFIG mode explicitly: the legacy FindBoost module was removed and emits +# a CMP0167 warning under cmake_minimum_required(VERSION < 3.30), which would +# surface in every downstream find_dependency(ThriftAlt). + +if(ThriftAlt_FOUND) + find_package(Boost CONFIG QUIET) + if(TARGET Boost::headers) + target_link_libraries(thrift::thrift INTERFACE Boost::headers) + elseif(Boost_INCLUDE_DIRS) + set_property(TARGET thrift::thrift APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + "${Boost_INCLUDE_DIRS}") + else() + message(FATAL_ERROR "Apache Thrift's C++ headers require Boost headers, but Boost was not " + "found. Install Boost development headers (e.g. 'brew install boost' " + "or 'apt install libboost-dev').") + endif() +endif() + +mark_as_advanced(ThriftAlt_LIB ThriftAlt_INCLUDE_DIR) diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index 8e10fd8ec..825a5a054 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -27,6 +27,17 @@ if(ICEBERG_S3 AND ICEBERG_BUNDLE_AWSSDK) set(ICEBERG_AWSSDK_BUNDLED TRUE) endif() +# Mirror the AWS SDK bundle/system policy for Thrift (used by the Hive catalog): +# ICEBERG_BUNDLE_THRIFT is the user's intent, ICEBERG_THRIFT_BUNDLED the resolved +# conclusion that the rest of the build keys off. +set(ICEBERG_THRIFT_BUNDLED FALSE) +if(ICEBERG_BUILD_HIVE AND ICEBERG_BUNDLE_THRIFT) + if(NOT ICEBERG_BUILD_BUNDLE) + message(FATAL_ERROR "ICEBERG_BUNDLE_THRIFT requires ICEBERG_BUILD_BUNDLE to be ON") + endif() + set(ICEBERG_THRIFT_BUNDLED TRUE) +endif() + set(ICEBERG_AWSSDK_COMPONENTS) if(NOT ICEBERG_AWSSDK_BUNDLED) if(ICEBERG_S3) @@ -742,3 +753,39 @@ endif() if(ICEBERG_BUILD_SQL_CATALOG) resolve_sql_catalog_dependencies() endif() + +# ---------------------------------------------------------------------- +# Thrift (Hive catalog) +# +# Provide a `thrift::thrift` target for iceberg_hive's generated Hive Metastore +# bindings, either bundled (from Arrow's build) or from a system install. Must +# run after resolve_arrow_dependency() so the bundled `thrift` target exists. + +function(resolve_thrift_dependency) + if(NOT ICEBERG_BUILD_HIVE) + return() + endif() + if(ICEBERG_THRIFT_BUNDLED) + # Arrow's bundled build creates the Thrift C++ runtime as a `thrift` target + # scoped to its FetchContent directory, where iceberg_hive cannot see it. + # Promote it to a global `thrift::thrift` alias so iceberg_hive can link the + # generated Hive Metastore bindings against it. + if(TARGET thrift AND NOT TARGET thrift::thrift) + add_library(thrift::thrift INTERFACE IMPORTED GLOBAL) + target_link_libraries(thrift::thrift INTERFACE thrift) + endif() + else() + # System Thrift, located by cmake_modules/FindThriftAlt.cmake (MODULE mode), + # which provides the `thrift::thrift` target iceberg_hive expects. Record it + # as a system dependency so downstream find_package(Iceberg) re-finds it. + find_package(ThriftAlt MODULE REQUIRED GLOBAL) + list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ThriftAlt) + set(ICEBERG_SYSTEM_DEPENDENCIES + ${ICEBERG_SYSTEM_DEPENDENCIES} + PARENT_SCOPE) + endif() +endfunction() + +if(ICEBERG_BUILD_HIVE) + resolve_thrift_dependency() +endif() diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 94523fb54..1bf1f10db 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -347,6 +347,14 @@ endif() iceberg_install_cmake_package(iceberg iceberg_targets) +# When linking a system Thrift, downstream find_package(Iceberg) calls +# find_dependency(ThriftAlt); ship FindThriftAlt.cmake next to the package config +# (the dir iceberg-config.cmake adds to CMAKE_MODULE_PATH) so that lookup resolves. +if(ICEBERG_BUILD_HIVE AND NOT ICEBERG_THRIFT_BUNDLED) + install(FILES "${PROJECT_SOURCE_DIR}/cmake_modules/FindThriftAlt.cmake" + DESTINATION "${ICEBERG_INSTALL_CMAKEDIR}/iceberg") +endif() + if(ICEBERG_BUILD_TESTS) add_subdirectory(test) endif() diff --git a/src/iceberg/catalog/hive/CMakeLists.txt b/src/iceberg/catalog/hive/CMakeLists.txt index 0dee1ad10..30c2a380a 100644 --- a/src/iceberg/catalog/hive/CMakeLists.txt +++ b/src/iceberg/catalog/hive/CMakeLists.txt @@ -15,11 +15,92 @@ # specific language governing permissions and limitations # under the License. -# Skeleton for the iceberg_hive library target. +# The iceberg_hive library: a Hive Metastore (HMS) catalog client built on +# generated Apache Thrift bindings. Layout mirrors iceberg_rest. + +# ---------------------------------------------------------------------- +# Hive Metastore Thrift bindings. # -# Sources, dependency wiring and the actual `iceberg_hive` library target -# are introduced in follow-up commits. For now this file installs only the -# public export header so that the directory is wired into the build system -# end-to-end. +# These are checked into gen-cpp/ rather than generated at build time, so a +# normal build needs no Thrift IDL compiler — only the Thrift C++ runtime, +# which comes from Apache Arrow's bundled build. Regenerate them with +# dev/update_hive_thrift.sh whenever thirdparty/hive_metastore/*.thrift changes. + +set(_thrift_gen_dir ${CMAKE_CURRENT_SOURCE_DIR}/gen-cpp) + +set(ICEBERG_HIVE_THRIFT_GEN_SOURCES + ${_thrift_gen_dir}/FacebookService.cpp + ${_thrift_gen_dir}/fb303_types.cpp + ${_thrift_gen_dir}/hive_metastore_constants.cpp + ${_thrift_gen_dir}/hive_metastore_types.cpp + ${_thrift_gen_dir}/ThriftHiveMetastore.cpp) + +# Upstream-generated code: skip lint/format, and downgrade the deprecated +# std::iterator warning from Arrow's bundled Thrift 0.22 headers (removed +# upstream in Thrift 0.23, THRIFT-5698) so it does not trip -Werror. +set_source_files_properties(${ICEBERG_HIVE_THRIFT_GEN_SOURCES} + PROPERTIES SKIP_LINTING TRUE + COMPILE_OPTIONS + "$<$:-Wno-error=deprecated-declarations>" +) + +# ---------------------------------------------------------------------- +# iceberg_hive library + +if(NOT TARGET thrift::thrift) + message(FATAL_ERROR "iceberg_hive requires a `thrift::thrift` target. Either keep " + "ICEBERG_BUNDLE_THRIFT=ON with -DICEBERG_BUILD_BUNDLE=ON (the " + "default, uses Arrow's bundled Thrift), or build with " + "-DICEBERG_BUNDLE_THRIFT=OFF against a system Thrift install.") +endif() + +set(ICEBERG_HIVE_SOURCES hive_catalog.cc hive_catalog_properties.cc + ${ICEBERG_HIVE_THRIFT_GEN_SOURCES}) + +set(ICEBERG_HIVE_STATIC_BUILD_INTERFACE_LIBS) +set(ICEBERG_HIVE_SHARED_BUILD_INTERFACE_LIBS) +set(ICEBERG_HIVE_STATIC_INSTALL_INTERFACE_LIBS) +set(ICEBERG_HIVE_SHARED_INSTALL_INTERFACE_LIBS) + +# thrift::thrift is always required at build time (the generated bindings include +# and link against it). For the *install* interface it depends on the Thrift source: +# * Bundled (from Arrow): the Thrift runtime is baked into the installed Arrow +# bundled-dependencies archive that iceberg core already carries, and there is +# no exported `thrift::thrift` target downstream. Referencing it in the install +# interface would make downstream find_package(Iceberg) fail with a missing +# `thrift::thrift` target, so it must be omitted. +# * System: downstream find_package(Iceberg) re-creates `thrift::thrift` via +# find_dependency(ThriftAlt) (FindThriftAlt.cmake is shipped next to the +# config), so it must be propagated. +list(APPEND ICEBERG_HIVE_STATIC_BUILD_INTERFACE_LIBS + "$,iceberg_static,iceberg_shared>" thrift::thrift) +list(APPEND ICEBERG_HIVE_SHARED_BUILD_INTERFACE_LIBS + "$,iceberg_shared,iceberg_static>" thrift::thrift) +list(APPEND + ICEBERG_HIVE_STATIC_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_static,iceberg::iceberg_shared>" +) +list(APPEND + ICEBERG_HIVE_SHARED_INSTALL_INTERFACE_LIBS + "$,iceberg::iceberg_shared,iceberg::iceberg_static>" +) +if(NOT ICEBERG_THRIFT_BUNDLED) + list(APPEND ICEBERG_HIVE_STATIC_INSTALL_INTERFACE_LIBS thrift::thrift) + list(APPEND ICEBERG_HIVE_SHARED_INSTALL_INTERFACE_LIBS thrift::thrift) +endif() + +add_iceberg_lib(iceberg_hive + SOURCES + ${ICEBERG_HIVE_SOURCES} + PRIVATE_INCLUDES + ${_thrift_gen_dir} + SHARED_LINK_LIBS + ${ICEBERG_HIVE_SHARED_BUILD_INTERFACE_LIBS} + STATIC_LINK_LIBS + ${ICEBERG_HIVE_STATIC_BUILD_INTERFACE_LIBS} + STATIC_INSTALL_INTERFACE_LIBS + ${ICEBERG_HIVE_STATIC_INSTALL_INTERFACE_LIBS} + SHARED_INSTALL_INTERFACE_LIBS + ${ICEBERG_HIVE_SHARED_INSTALL_INTERFACE_LIBS}) iceberg_install_all_headers(iceberg/catalog/hive) diff --git a/src/iceberg/catalog/hive/hive_catalog.cc b/src/iceberg/catalog/hive/hive_catalog.cc new file mode 100644 index 000000000..1309babaa --- /dev/null +++ b/src/iceberg/catalog/hive/hive_catalog.cc @@ -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. + */ + +#include "iceberg/catalog/hive/hive_catalog.h" + +#include +#include + +#include "iceberg/util/macros.h" + +namespace iceberg::hive { + +namespace { + +constexpr std::string_view kNotImplementedMessage = + "HiveCatalog method is not yet implemented."; + +} // namespace + +HiveCatalog::HiveCatalog(HiveCatalogProperties config) + : config_(std::move(config)), name_(config_.Get(HiveCatalogProperties::kName)) {} + +HiveCatalog::~HiveCatalog() = default; + +Result> HiveCatalog::Make( + const HiveCatalogProperties& config) { + ICEBERG_RETURN_UNEXPECTED(config.Uri()); + return std::shared_ptr(new HiveCatalog(config)); +} + +std::string_view HiveCatalog::name() const { return name_; } + +Status HiveCatalog::CreateNamespace( + const Namespace& /*ns*/, + const std::unordered_map& /*properties*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::ListNamespaces( + const Namespace& /*ns*/) const { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::GetNamespaceProperties( + const Namespace& /*ns*/) const { + return NotImplemented("{}", kNotImplementedMessage); +} + +Status HiveCatalog::DropNamespace(const Namespace& /*ns*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result HiveCatalog::NamespaceExists(const Namespace& /*ns*/) const { + return NotImplemented("{}", kNotImplementedMessage); +} + +Status HiveCatalog::UpdateNamespaceProperties( + const Namespace& /*ns*/, + const std::unordered_map& /*updates*/, + const std::unordered_set& /*removals*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::ListTables( + const Namespace& /*ns*/) const { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::CreateTable( + const TableIdentifier& /*identifier*/, const std::shared_ptr& /*schema*/, + const std::shared_ptr& /*spec*/, + const std::shared_ptr& /*order*/, const std::string& /*location*/, + const std::unordered_map& /*properties*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::UpdateTable( + const TableIdentifier& /*identifier*/, + const std::vector>& /*requirements*/, + const std::vector>& /*updates*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::StageCreateTable( + const TableIdentifier& /*identifier*/, const std::shared_ptr& /*schema*/, + const std::shared_ptr& /*spec*/, + const std::shared_ptr& /*order*/, const std::string& /*location*/, + const std::unordered_map& /*properties*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result HiveCatalog::TableExists(const TableIdentifier& /*identifier*/) const { + return NotImplemented("{}", kNotImplementedMessage); +} + +Status HiveCatalog::DropTable(const TableIdentifier& /*identifier*/, bool /*purge*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Status HiveCatalog::RenameTable(const TableIdentifier& /*from*/, + const TableIdentifier& /*to*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::LoadTable( + const TableIdentifier& /*identifier*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +Result> HiveCatalog::RegisterTable( + const TableIdentifier& /*identifier*/, + const std::string& /*metadata_file_location*/) { + return NotImplemented("{}", kNotImplementedMessage); +} + +} // namespace iceberg::hive diff --git a/src/iceberg/catalog/hive/hive_catalog.h b/src/iceberg/catalog/hive/hive_catalog.h new file mode 100644 index 000000000..bd598fee9 --- /dev/null +++ b/src/iceberg/catalog/hive/hive_catalog.h @@ -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. + */ + +#pragma once + +#include +#include +#include + +#include "iceberg/catalog.h" +#include "iceberg/catalog/hive/hive_catalog_properties.h" +#include "iceberg/catalog/hive/iceberg_hive_export.h" +#include "iceberg/result.h" + +/// \file iceberg/catalog/hive/hive_catalog.h +/// \brief HiveCatalog implementation for talking to a Hive Metastore (HMS). + +namespace iceberg::hive { + +/// \brief Catalog implementation backed by a Hive Metastore. +/// +/// Currently a stub: every Catalog method returns +/// ErrorKind::kNotImplemented. Follow-up changes add the HMS Thrift client +/// and wire each method to the metastore. +class ICEBERG_HIVE_EXPORT HiveCatalog : public Catalog, + public std::enable_shared_from_this { + public: + ~HiveCatalog() override; + + HiveCatalog(const HiveCatalog&) = delete; + HiveCatalog& operator=(const HiveCatalog&) = delete; + HiveCatalog(HiveCatalog&&) = delete; + HiveCatalog& operator=(HiveCatalog&&) = delete; + + /// \brief Construct a HiveCatalog from `config`. + /// + /// Only stores the configuration for now; HMS connection setup comes + /// with the Thrift client. Returns an error if the supplied + /// configuration is missing required fields (currently: the URI). + static Result> Make(const HiveCatalogProperties& config); + + std::string_view name() const override; + + Status CreateNamespace( + const Namespace& ns, + const std::unordered_map& properties) override; + + Result> ListNamespaces(const Namespace& ns) const override; + + Result> GetNamespaceProperties( + const Namespace& ns) const override; + + Status DropNamespace(const Namespace& ns) override; + + Result NamespaceExists(const Namespace& ns) const override; + + Status UpdateNamespaceProperties( + const Namespace& ns, const std::unordered_map& updates, + const std::unordered_set& removals) override; + + Result> ListTables(const Namespace& ns) const override; + + Result> CreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override; + + Result> UpdateTable( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) override; + + Result> StageCreateTable( + const TableIdentifier& identifier, const std::shared_ptr& schema, + const std::shared_ptr& spec, const std::shared_ptr& order, + const std::string& location, + const std::unordered_map& properties) override; + + Result TableExists(const TableIdentifier& identifier) const override; + + Status DropTable(const TableIdentifier& identifier, bool purge) override; + + Status RenameTable(const TableIdentifier& from, const TableIdentifier& to) override; + + Result> LoadTable(const TableIdentifier& identifier) override; + + Result> RegisterTable( + const TableIdentifier& identifier, + const std::string& metadata_file_location) override; + + private: + explicit HiveCatalog(HiveCatalogProperties config); + + HiveCatalogProperties config_; + std::string name_; +}; + +} // namespace iceberg::hive diff --git a/src/iceberg/catalog/hive/hive_catalog_properties.cc b/src/iceberg/catalog/hive/hive_catalog_properties.cc new file mode 100644 index 000000000..e09aa1627 --- /dev/null +++ b/src/iceberg/catalog/hive/hive_catalog_properties.cc @@ -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. + */ + +#include "iceberg/catalog/hive/hive_catalog_properties.h" + +#include +#include + +#include "iceberg/util/string_util.h" + +namespace iceberg::hive { + +HiveCatalogProperties HiveCatalogProperties::default_properties() { return {}; } + +HiveCatalogProperties HiveCatalogProperties::FromMap( + std::unordered_map properties) { + HiveCatalogProperties hive_catalog_config; + hive_catalog_config.configs_ = std::move(properties); + return hive_catalog_config; +} + +Result HiveCatalogProperties::Uri() const { + auto it = configs_.find(kUri.key()); + if (it == configs_.end() || it->second.empty()) { + return InvalidArgument("Hive catalog configuration property 'uri' is required."); + } + return it->second; +} + +Result HiveCatalogProperties::ThriftTransport() const { + const std::string upper = StringUtils::ToUpper(Get(kThriftTransport)); + if (upper == "BUFFERED") { + return HiveThriftTransport::kBuffered; + } + if (upper == "FRAMED") { + return HiveThriftTransport::kFramed; + } + return InvalidArgument("Invalid Hive thrift transport: '{}'.", Get(kThriftTransport)); +} + +} // namespace iceberg::hive diff --git a/src/iceberg/catalog/hive/hive_catalog_properties.h b/src/iceberg/catalog/hive/hive_catalog_properties.h new file mode 100644 index 000000000..5f1273b34 --- /dev/null +++ b/src/iceberg/catalog/hive/hive_catalog_properties.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/catalog/hive/iceberg_hive_export.h" +#include "iceberg/result.h" +#include "iceberg/util/config.h" + +/// \file iceberg/catalog/hive/hive_catalog_properties.h +/// \brief Configuration for connecting to a Hive Metastore (HMS) over Thrift. + +namespace iceberg::hive { + +/// \brief Thrift framing mode used to connect to the Hive Metastore. +/// +/// Most HMS deployments default to TBufferedTransport. TFramedTransport is +/// required by HMS instances that have been configured to use framed +/// transport (for example, certain Hive 3.x setups with SASL enabled). +enum class HiveThriftTransport : uint8_t { kBuffered, kFramed }; + +/// \brief Configuration for the iceberg_hive HiveCatalog. +/// +/// HMS connection settings (URI, transport, timeouts) plus warehouse / FileIO +/// metadata. Authentication (SASL/Kerberos) and HMS-side locking are +/// introduced in follow-up changes. +class ICEBERG_HIVE_EXPORT HiveCatalogProperties + : public ConfigBase { + public: + template + using Entry = const ConfigBase::Entry; + + /// \brief The URI of the Hive Metastore Thrift endpoint. + /// + /// Accepted forms (matching the conventions used by iceberg-java and + /// iceberg-rust): + /// * `thrift://host:port` + /// * `host:port` + /// * comma-separated list of either form for HA failover + inline static Entry kUri{"uri", ""}; + + /// \brief The catalog name reported by `name()`. Defaults to "hive". + inline static Entry kName{"name", "hive"}; + + /// \brief The warehouse root path (for example, `s3://bucket/warehouse` + /// or `hdfs://nn/path`). Used as the default base location for new + /// tables that do not specify their own location. + inline static Entry kWarehouse{"warehouse", ""}; + + /// \brief The FileIO implementation name used to read and write Iceberg + /// metadata files. + inline static Entry kIOImpl{"io-impl", ""}; + + /// \brief Thrift framing for the HMS connection ("buffered" or "framed"). + inline static Entry kThriftTransport{"thrift-transport", "buffered"}; + + /// \brief HMS connect timeout, in milliseconds. + inline static Entry kConnectTimeoutMs{"connect-timeout-ms", 30000}; + + /// \brief HMS socket / RPC timeout, in milliseconds. + inline static Entry kSocketTimeoutMs{"socket-timeout-ms", 60000}; + + /// \brief When true, wrap the commit path with HMS `lock` / `unlock` for + /// extra safety on top of the metadata_location CAS. Defaults to false + /// because CAS already handles single-writer correctness; turn this on + /// for environments with high write concurrency. + inline static Entry kLockEnabled{"hive.lock-enabled", false}; + + /// \brief Build a HiveCatalogProperties with defaults applied. + static HiveCatalogProperties default_properties(); + + /// \brief Build a HiveCatalogProperties from a property map. + static HiveCatalogProperties FromMap( + std::unordered_map properties); + + /// \brief Resolve `kUri`. Returns an error if the URI is unset or empty. + Result Uri() const; + + /// \brief Parse `kThriftTransport` into a HiveThriftTransport. Comparison + /// is case-insensitive to match the conventions used by other Iceberg + /// language ports. + Result ThriftTransport() const; +}; + +} // namespace iceberg::hive diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index dfb0e1dbc..9a7bfbea4 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -30,6 +30,8 @@ # iceberg::iceberg_bundle_static # iceberg::iceberg_rest_shared # iceberg::iceberg_rest_static +# iceberg::iceberg_hive_shared +# iceberg::iceberg_hive_static # iceberg::iceberg_catalog_sql_shared # iceberg::iceberg_catalog_sql_static From bb5cab58a71d28a03d460f860bec017de26ac25f Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Fri, 26 Jun 2026 11:57:39 +0800 Subject: [PATCH 125/151] ci: cache cpp-linter build (#782) --- .github/workflows/cpp-linter.yml | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 2e3e022d6..ed2a7bac7 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -18,6 +18,13 @@ name: C++ Linter on: + push: + branches: + - main + paths-ignore: + - '.github/**' + - 'ci/**' + - 'cmake_modules/**' pull_request: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: @@ -38,6 +45,9 @@ jobs: permissions: contents: read pull-requests: write + env: + SCCACHE_DIR: ${{ github.workspace }}/.sccache + SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -48,6 +58,15 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libcurl4-openssl-dev libsqlite3-dev libpq-dev default-libmysqlclient-dev + - name: Restore sccache cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-cpp-linter-ubuntu-${{ github.run_id }} + restore-keys: | + sccache-cpp-linter-ubuntu- + - name: Setup sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Run build env: CC: gcc-14 @@ -55,13 +74,25 @@ jobs: run: | mkdir build && cd build cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DCMAKE_C_COMPILER_LAUNCHER=sccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ -DICEBERG_BUILD_SQL_CATALOG=ON \ -DICEBERG_SQL_SQLITE=ON \ -DICEBERG_SQL_POSTGRESQL=ON \ -DICEBERG_SQL_MYSQL=ON cmake --build . + - name: Show sccache stats + shell: bash + run: sccache --show-stats + - name: Save sccache cache + if: github.ref == 'refs/heads/main' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/.sccache + key: sccache-cpp-linter-ubuntu-${{ github.run_id }} - uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8 # v2.15.1 id: linter + if: github.event_name == 'pull_request' continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -78,7 +109,7 @@ jobs: # need '-fno-builtin-std-forward_like', see https://github.com/llvm/llvm-project/issues/101614 extra-args: '-std=c++23 -I$PWD/src -I$PWD/build/src -I$PWD/build/_deps/sqlpp23-src/include -I/usr/include/postgresql -I/usr/include/mysql -fno-builtin-std-forward_like' - name: Fail fast?! - if: steps.linter.outputs.checks-failed != 0 + if: github.event_name == 'pull_request' && steps.linter.outputs.checks-failed != 0 run: | echo "some linter checks failed. ${STEPS_LINTER_OUTPUTS_CHECKS_FAILED}" exit 1 From 8d72abb2c025fe23c97d347481c82877f54f61b9 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Sat, 27 Jun 2026 00:02:59 +0800 Subject: [PATCH 126/151] build: add Makefile clean target (#784) Co-authored-by: Codex --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1501ba29a..100069545 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,14 @@ # specific language governing permissions and limitations # under the License. -.PHONY: help install-deps build-api-docs build-docs clean-docs serve-docs +.PHONY: help install-deps build-api-docs build-docs clean clean-docs serve-docs help: @echo "Available targets:" @echo " install-deps - Install Python dependencies" @echo " build-api-docs - Build API documentation with Doxygen" @echo " build-docs - Build MkDocs documentation" + @echo " clean - Clean local CMake build artifacts" @echo " clean-docs - Clean documentation build artifacts" @echo " serve-docs - Serve documentation locally for development" @echo " all - Build all documentation" @@ -41,6 +42,9 @@ build-docs: mkdocs build --clean && \ echo "MkDocs site built in site/" +clean: + rm -rf build cmake-build cmake-build-debug cmake-build-release + clean-docs: rm -rf mkdocs/site rm -rf mkdocs/docs/api From 9a7439c7dcef070fafa470ea0e159bf176eeb4f8 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Sat, 27 Jun 2026 00:03:45 +0800 Subject: [PATCH 127/151] chore: align table metadata JSON fixtures with Java (#781) --- .../test/resources/TableMetadataUnsupportedVersion.json | 2 +- src/iceberg/test/resources/TableMetadataV3ValidMinimal.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iceberg/test/resources/TableMetadataUnsupportedVersion.json b/src/iceberg/test/resources/TableMetadataUnsupportedVersion.json index c40a0c9cd..58481d1d2 100644 --- a/src/iceberg/test/resources/TableMetadataUnsupportedVersion.json +++ b/src/iceberg/test/resources/TableMetadataUnsupportedVersion.json @@ -1,5 +1,5 @@ { - "format-version": 4, + "format-version": 42, "table-uuid": "d20125c8-7284-442c-9aea-15fee620737c", "location": "s3://bucket/test/location", "last-updated-ms": 1602638573874, diff --git a/src/iceberg/test/resources/TableMetadataV3ValidMinimal.json b/src/iceberg/test/resources/TableMetadataV3ValidMinimal.json index b0411141e..fea73b0f1 100644 --- a/src/iceberg/test/resources/TableMetadataV3ValidMinimal.json +++ b/src/iceberg/test/resources/TableMetadataV3ValidMinimal.json @@ -1,10 +1,11 @@ { - "format-version": 2, + "format-version": 3, "table-uuid": "9c12d441-03fe-4693-9a96-a0705ddf69c1", "location": "s3://bucket/test/location", "last-sequence-number": 34, "last-updated-ms": 1602638573590, "last-column-id": 3, + "next-row-id": 0, "current-schema-id": 0, "schemas": [ { From 90a2be7053bb92fd0194b8d9a1ec0913696437c0 Mon Sep 17 00:00:00 2001 From: Xin Huang <42597328+huan233usc@users.noreply.github.com> Date: Fri, 26 Jun 2026 18:39:28 -0700 Subject: [PATCH 128/151] refactor(serde): return Result from ToJson schema/type/metadata serializers (#785) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What Change the schema/type/metadata `ToJson` serializers from returning bare `nlohmann::json` to `Result`: - `json_serde`: `ToJson(SchemaField | Type | Schema | TableMetadata | TableUpdate)` - REST: `ToJson(CreateTableRequest | CommitTableRequest | LoadTableResult | CommitTableResponse)` Errors propagate via `ICEBERG_ASSIGN_OR_RAISE`; callers bottom out at the existing `Result`-returning boundaries (`ToJsonString`, `rest_catalog`, `TableMetadataUtil::Write`). ## Why Preparation for v3 column default values (#730 / #746). Single-value (`Literal`) serialization is fallible, and column defaults invoke it from schema serialization, so these serializers need to propagate the error instead of throwing. Splitting it out keeps the feature PR focused on the feature. ## Notes - **No behavior change** — every conversion still succeeds today; only the return type changes. - The shared `ToJsonList` template stays bare (it also serializes infallible types such as partition specs and snapshots); `TableMetadata` serializes its schema list with an explicit loop. - The REST `ICEBERG_DECLARE_JSON_SERDE` macro is unchanged; the four schema/metadata-bearing models are declared explicitly so only their `ToJson` return type differs. ## Testing No behavior change; existing tests are adapted to the new return type. Full build and `ctest` pass locally. --- src/iceberg/catalog/rest/json_serde.cc | 17 ++--- .../catalog/rest/json_serde_internal.h | 30 +++++++-- src/iceberg/catalog/rest/rest_catalog.cc | 6 +- src/iceberg/json_serde.cc | 43 +++++++----- src/iceberg/json_serde_internal.h | 10 +-- src/iceberg/table_metadata.cc | 2 +- src/iceberg/test/json_serde_test.cc | 66 ++++++++++++------- src/iceberg/test/metadata_serde_test.cc | 2 +- src/iceberg/test/schema_json_test.cc | 11 ++-- 9 files changed, 120 insertions(+), 67 deletions(-) diff --git a/src/iceberg/catalog/rest/json_serde.cc b/src/iceberg/catalog/rest/json_serde.cc index ac80e9f08..49dbcdd4c 100644 --- a/src/iceberg/catalog/rest/json_serde.cc +++ b/src/iceberg/catalog/rest/json_serde.cc @@ -690,10 +690,10 @@ Result RenameTableRequestFromJson(const nlohmann::json& json } // LoadTableResult (used by CreateTableResponse, LoadTableResponse) -nlohmann::json ToJson(const LoadTableResult& result) { +Result ToJson(const LoadTableResult& result) { nlohmann::json json; SetOptionalStringField(json, kMetadataLocation, result.metadata_location); - json[kMetadata] = ToJson(*result.metadata); + ICEBERG_ASSIGN_OR_RAISE(json[kMetadata], ToJson(*result.metadata)); SetContainerField(json, kConfig, result.config); return json; } @@ -820,12 +820,12 @@ Result ListTablesResponseFromJson(const nlohmann::json& json return response; } -nlohmann::json ToJson(const CreateTableRequest& request) { +Result ToJson(const CreateTableRequest& request) { nlohmann::json json; json[kName] = request.name; SetOptionalStringField(json, kLocation, request.location); if (request.schema) { - json[kSchema] = ToJson(*request.schema); + ICEBERG_ASSIGN_OR_RAISE(json[kSchema], ToJson(*request.schema)); } if (request.partition_spec) { json[kPartitionSpec] = ToJson(*request.partition_spec); @@ -872,7 +872,7 @@ Result CreateTableRequestFromJson(const nlohmann::json& json } // CommitTableRequest serialization -nlohmann::json ToJson(const CommitTableRequest& request) { +Result ToJson(const CommitTableRequest& request) { nlohmann::json json; if (!request.identifier.name.empty()) { json[kIdentifier] = ToJson(request.identifier); @@ -886,7 +886,8 @@ nlohmann::json ToJson(const CommitTableRequest& request) { nlohmann::json updates_json = nlohmann::json::array(); for (const auto& update : request.updates) { - updates_json.push_back(ToJson(*update)); + ICEBERG_ASSIGN_OR_RAISE(auto update_json, ToJson(*update)); + updates_json.push_back(std::move(update_json)); } json[kUpdates] = std::move(updates_json); @@ -932,11 +933,11 @@ Result CommitTableRequestFromJson(const nlohmann::json& json } // CommitTableResponse serialization -nlohmann::json ToJson(const CommitTableResponse& response) { +Result ToJson(const CommitTableResponse& response) { nlohmann::json json; json[kMetadataLocation] = response.metadata_location; if (response.metadata) { - json[kMetadata] = ToJson(*response.metadata); + ICEBERG_ASSIGN_OR_RAISE(json[kMetadata], ToJson(*response.metadata)); } return json; } diff --git a/src/iceberg/catalog/rest/json_serde_internal.h b/src/iceberg/catalog/rest/json_serde_internal.h index 61d2eb6e0..6e148e0d3 100644 --- a/src/iceberg/catalog/rest/json_serde_internal.h +++ b/src/iceberg/catalog/rest/json_serde_internal.h @@ -57,16 +57,38 @@ ICEBERG_DECLARE_JSON_SERDE(GetNamespaceResponse) ICEBERG_DECLARE_JSON_SERDE(UpdateNamespacePropertiesRequest) ICEBERG_DECLARE_JSON_SERDE(UpdateNamespacePropertiesResponse) ICEBERG_DECLARE_JSON_SERDE(ListTablesResponse) -ICEBERG_DECLARE_JSON_SERDE(LoadTableResult) ICEBERG_DECLARE_JSON_SERDE(RegisterTableRequest) ICEBERG_DECLARE_JSON_SERDE(RenameTableRequest) -ICEBERG_DECLARE_JSON_SERDE(CreateTableRequest) -ICEBERG_DECLARE_JSON_SERDE(CommitTableRequest) -ICEBERG_DECLARE_JSON_SERDE(CommitTableResponse) ICEBERG_DECLARE_JSON_SERDE(OAuthTokenResponse) #undef ICEBERG_DECLARE_JSON_SERDE +// These models embed a Schema/TableMetadata whose ToJson returns Result, so their own +// ToJson returns Result too. FromJson is declared like the macro-based models above. +ICEBERG_REST_EXPORT Result LoadTableResultFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT Result ToJson(const LoadTableResult& model); + +ICEBERG_REST_EXPORT Result CreateTableRequestFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT Result ToJson(const CreateTableRequest& model); + +ICEBERG_REST_EXPORT Result CommitTableRequestFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT Result ToJson(const CommitTableRequest& model); + +ICEBERG_REST_EXPORT Result CommitTableResponseFromJson( + const nlohmann::json& json); +template <> +ICEBERG_REST_EXPORT Result FromJson(const nlohmann::json& json); +ICEBERG_REST_EXPORT Result ToJson(const CommitTableResponse& model); + ICEBERG_REST_EXPORT Result PlanTableScanResponseFromJson( const nlohmann::json& json, const std::unordered_map>& diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 4cb4fd349..6b479ee03 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -667,7 +667,8 @@ Result RestCatalog::CreateTableInternal( .properties = properties, }; - ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); + ICEBERG_ASSIGN_OR_RAISE(auto request_json, ToJson(request)); + ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(request_json)); ICEBERG_ASSIGN_OR_RAISE(const auto response, client_->Post(path, json_request, /*headers=*/{}, *TableErrorHandler::Instance(), session)); @@ -710,7 +711,8 @@ Result RestCatalog::UpdateTableInternal( request.updates.push_back(update->Clone()); } - ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(ToJson(request))); + ICEBERG_ASSIGN_OR_RAISE(auto request_json, ToJson(request)); + ICEBERG_ASSIGN_OR_RAISE(auto json_request, ToJsonString(request_json)); ICEBERG_ASSIGN_OR_RAISE(auto is_create, TableRequirements::IsCreate(requirements)); const ErrorHandler* error_handler = TableCommitErrorHandler::Instance().get(); if (is_create) { diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index a4810d88f..c9b320ffe 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -315,19 +315,19 @@ Result> SortOrderFromJson(const nlohmann::json& json) return SortOrder::Make(parsed.order_id, std::move(parsed.fields)); } -nlohmann::json ToJson(const SchemaField& field) { +Result ToJson(const SchemaField& field) { nlohmann::json json; json[kId] = field.field_id(); json[kName] = field.name(); json[kRequired] = !field.optional(); - json[kType] = ToJson(*field.type()); + ICEBERG_ASSIGN_OR_RAISE(json[kType], ToJson(*field.type())); if (!field.doc().empty()) { json[kDoc] = field.doc(); } return json; } -nlohmann::json ToJson(const Type& type) { +Result ToJson(const Type& type) { switch (type.type_id()) { case TypeId::kStruct: { const auto& struct_type = internal::checked_cast(type); @@ -335,7 +335,8 @@ nlohmann::json ToJson(const Type& type) { json[kType] = kStruct; nlohmann::json fields_json = nlohmann::json::array(); for (const auto& field : struct_type.fields()) { - fields_json.push_back(ToJson(field)); + ICEBERG_ASSIGN_OR_RAISE(auto field_json, ToJson(field)); + fields_json.push_back(std::move(field_json)); // TODO(gangwu): add default values } json[kFields] = fields_json; @@ -349,7 +350,7 @@ nlohmann::json ToJson(const Type& type) { const auto& element_field = list_type.fields().front(); json[kElementId] = element_field.field_id(); json[kElementRequired] = !element_field.optional(); - json[kElement] = ToJson(*element_field.type()); + ICEBERG_ASSIGN_OR_RAISE(json[kElement], ToJson(*element_field.type())); return json; } case TypeId::kMap: { @@ -359,12 +360,12 @@ nlohmann::json ToJson(const Type& type) { const auto& key_field = map_type.key(); json[kKeyId] = key_field.field_id(); - json[kKey] = ToJson(*key_field.type()); + ICEBERG_ASSIGN_OR_RAISE(json[kKey], ToJson(*key_field.type())); const auto& value_field = map_type.value(); json[kValueId] = value_field.field_id(); json[kValueRequired] = !value_field.optional(); - json[kValue] = ToJson(*value_field.type()); + ICEBERG_ASSIGN_OR_RAISE(json[kValue], ToJson(*value_field.type())); return json; } case TypeId::kBoolean: @@ -416,8 +417,9 @@ nlohmann::json ToJson(const Type& type) { std::unreachable(); } -nlohmann::json ToJson(const Schema& schema) { - nlohmann::json json = ToJson(internal::checked_cast(schema)); +Result ToJson(const Schema& schema) { + ICEBERG_ASSIGN_OR_RAISE(nlohmann::json json, + ToJson(internal::checked_cast(schema))); json[kSchemaId] = schema.schema_id(); if (!schema.IdentifierFieldIds().empty()) { json[kIdentifierFieldIds] = schema.IdentifierFieldIds(); @@ -426,7 +428,8 @@ nlohmann::json ToJson(const Schema& schema) { } Result ToJsonString(const Schema& schema) { - return ToJsonString(ToJson(schema)); + ICEBERG_ASSIGN_OR_RAISE(auto json, ToJson(schema)); + return ToJsonString(json); } nlohmann::json ToJson(const SnapshotRef& ref) { @@ -966,7 +969,7 @@ Result EncryptedKeyFromJson(const nlohmann::json& json) { }; } -nlohmann::json ToJson(const TableMetadata& table_metadata) { +Result ToJson(const TableMetadata& table_metadata) { nlohmann::json json; json[kFormatVersion] = table_metadata.format_version; @@ -984,7 +987,7 @@ nlohmann::json ToJson(const TableMetadata& table_metadata) { if (table_metadata.format_version == 1) { for (const auto& schema : table_metadata.schemas) { if (schema->schema_id() == table_metadata.current_schema_id) { - json[kSchema] = ToJson(*schema); + ICEBERG_ASSIGN_OR_RAISE(json[kSchema], ToJson(*schema)); break; } } @@ -992,7 +995,14 @@ nlohmann::json ToJson(const TableMetadata& table_metadata) { // write the current schema ID and schema list json[kCurrentSchemaId] = table_metadata.current_schema_id; - json[kSchemas] = ToJsonList(table_metadata.schemas); + // ToJson(Schema) is fallible, so the shared ToJsonList helper (which assumes an + // infallible ToJson) cannot be used here; build the array with an explicit loop. + nlohmann::json schemas_json = nlohmann::json::array(); + for (const auto& schema : table_metadata.schemas) { + ICEBERG_ASSIGN_OR_RAISE(auto schema_json, ToJson(*schema)); + schemas_json.push_back(std::move(schema_json)); + } + json[kSchemas] = std::move(schemas_json); // for older readers, continue writing the default spec as "partition-spec" if (table_metadata.format_version == 1) { @@ -1042,7 +1052,8 @@ nlohmann::json ToJson(const TableMetadata& table_metadata) { } Result ToJsonString(const TableMetadata& table_metadata) { - return ToJsonString(ToJson(table_metadata)); + ICEBERG_ASSIGN_OR_RAISE(auto json, ToJson(table_metadata)); + return ToJsonString(json); } namespace { @@ -1446,7 +1457,7 @@ Result NamespaceFromJson(const nlohmann::json& json) { return ns; } -nlohmann::json ToJson(const TableUpdate& update) { +Result ToJson(const TableUpdate& update) { nlohmann::json json; switch (update.kind()) { case TableUpdate::Kind::kAssignUUID: { @@ -1465,7 +1476,7 @@ nlohmann::json ToJson(const TableUpdate& update) { const auto& u = internal::checked_cast(update); json[kAction] = kActionAddSchema; if (u.schema()) { - json[kSchema] = ToJson(*u.schema()); + ICEBERG_ASSIGN_OR_RAISE(json[kSchema], ToJson(*u.schema())); } else { json[kSchema] = nlohmann::json::value_t::null; } diff --git a/src/iceberg/json_serde_internal.h b/src/iceberg/json_serde_internal.h index 351b41086..1a30e8e8f 100644 --- a/src/iceberg/json_serde_internal.h +++ b/src/iceberg/json_serde_internal.h @@ -93,7 +93,7 @@ ICEBERG_EXPORT Result> SortOrderFromJson( /// /// \param schema The Iceberg schema to convert. /// \return The JSON representation of the schema. -ICEBERG_EXPORT nlohmann::json ToJson(const Schema& schema); +ICEBERG_EXPORT Result ToJson(const Schema& schema); /// \brief Convert an Iceberg Schema to JSON. /// @@ -111,7 +111,7 @@ ICEBERG_EXPORT Result> SchemaFromJson(const nlohmann::js /// /// \param type The Iceberg type to convert. /// \return The JSON representation of the type. -ICEBERG_EXPORT nlohmann::json ToJson(const Type& type); +ICEBERG_EXPORT Result ToJson(const Type& type); /// \brief Convert JSON to an Iceberg Type. /// @@ -123,7 +123,7 @@ ICEBERG_EXPORT Result> TypeFromJson(const nlohmann::json& /// /// \param field The Iceberg field to convert. /// \return The JSON representation of the field. -ICEBERG_EXPORT nlohmann::json ToJson(const SchemaField& field); +ICEBERG_EXPORT Result ToJson(const SchemaField& field); /// \brief Convert JSON to an Iceberg SchemaField. /// @@ -300,7 +300,7 @@ ICEBERG_EXPORT Result EncryptedKeyFromJson(const nlohmann::json& j /// /// \param table_metadata The `TableMetadata` object to be serialized. /// \return A JSON object representing the `TableMetadata`. -ICEBERG_EXPORT nlohmann::json ToJson(const TableMetadata& table_metadata); +ICEBERG_EXPORT Result ToJson(const TableMetadata& table_metadata); /// \brief Serializes a `TableMetadata` object to JSON. /// @@ -404,7 +404,7 @@ ICEBERG_EXPORT Result NamespaceFromJson(const nlohmann::json& json); /// /// \param update The `TableUpdate` object to be serialized. /// \return A JSON object representing the `TableUpdate`. -ICEBERG_EXPORT nlohmann::json ToJson(const TableUpdate& update); +ICEBERG_EXPORT Result ToJson(const TableUpdate& update); /// \brief Deserializes a JSON object into a `TableUpdate` object. /// diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index 53e3c231d..ef2f1bf38 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -489,7 +489,7 @@ Result TableMetadataUtil::Write(FileIO& io, const TableMetadata* ba Status TableMetadataUtil::Write(FileIO& io, const std::string& location, const TableMetadata& metadata) { - auto json = ToJson(metadata); + ICEBERG_ASSIGN_OR_RAISE(auto json, ToJson(metadata)); ICEBERG_ASSIGN_OR_RAISE(auto json_string, ToJsonString(json)); return io.WriteFile(location, json_string); } diff --git a/src/iceberg/test/json_serde_test.cc b/src/iceberg/test/json_serde_test.cc index 88b44e3ab..562471608 100644 --- a/src/iceberg/test/json_serde_test.cc +++ b/src/iceberg/test/json_serde_test.cc @@ -325,7 +325,8 @@ TEST(JsonInternalTest, TableUpdateAssignUUID) { nlohmann::json expected = R"({"action":"assign-uuid","uuid":"550e8400-e29b-41d4-a716-446655440000"})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), update); @@ -336,7 +337,8 @@ TEST(JsonInternalTest, TableUpdateUpgradeFormatVersion) { nlohmann::json expected = R"({"action":"upgrade-format-version","format-version":2})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -350,7 +352,7 @@ TEST(JsonInternalTest, TableUpdateAddSchema) { /*schema_id=*/1); table::AddSchema update(schema, 2); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "add-schema"); EXPECT_EQ(json["last-column-id"], 2); EXPECT_TRUE(json.contains("schema")); @@ -367,9 +369,10 @@ TEST(JsonInternalTest, TableUpdateAddSchemaWithoutDeprecatedLastColumnId) { std::vector{SchemaField(1, "id", int64(), false), SchemaField(3, "name", string(), true)}, /*schema_id=*/1); + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); nlohmann::json json = { {"action", "add-schema"}, - {"schema", ToJson(*schema)}, + {"schema", schema_json}, }; auto parsed = TableUpdateFromJson(json); @@ -383,7 +386,8 @@ TEST(JsonInternalTest, TableUpdateSetCurrentSchema) { table::SetCurrentSchema update(1); nlohmann::json expected = R"({"action":"set-current-schema","schema-id":1})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -397,7 +401,7 @@ TEST(JsonInternalTest, TableUpdateAddPartitionSpec) { PartitionSpec::Make(1, {PartitionField(3, 101, "region", identity_transform)})); table::AddPartitionSpec update(std::move(spec)); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "add-spec"); EXPECT_TRUE(json.contains("spec")); @@ -411,7 +415,8 @@ TEST(JsonInternalTest, TableUpdateSetDefaultPartitionSpec) { table::SetDefaultPartitionSpec update(2); nlohmann::json expected = R"({"action":"set-default-spec","spec-id":2})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ( @@ -424,7 +429,8 @@ TEST(JsonInternalTest, TableUpdateRemovePartitionSpecs) { nlohmann::json expected = R"({"action":"remove-partition-specs","spec-ids":[1,2,3]})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -434,7 +440,7 @@ TEST(JsonInternalTest, TableUpdateRemovePartitionSpecs) { TEST(JsonInternalTest, TableUpdateRemoveSchemas) { table::RemoveSchemas update({1, 2}); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "remove-schemas"); EXPECT_THAT(json["schema-ids"].get>(), testing::UnorderedElementsAre(1, 2)); @@ -450,7 +456,7 @@ TEST(JsonInternalTest, TableUpdateAddSortOrder) { ICEBERG_UNWRAP_OR_FAIL(auto sort_order, SortOrder::Make(1, {st})); table::AddSortOrder update(std::move(sort_order)); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "add-sort-order"); EXPECT_TRUE(json.contains("sort-order")); @@ -465,7 +471,8 @@ TEST(JsonInternalTest, TableUpdateSetDefaultSortOrder) { nlohmann::json expected = R"({"action":"set-default-sort-order","sort-order-id":1})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -483,7 +490,7 @@ TEST(JsonInternalTest, TableUpdateAddSnapshot) { .schema_id = 1}); table::AddSnapshot update(snapshot); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "add-snapshot"); EXPECT_TRUE(json.contains("snapshot")); @@ -498,7 +505,8 @@ TEST(JsonInternalTest, TableUpdateRemoveSnapshots) { nlohmann::json expected = R"({"action":"remove-snapshots","snapshot-ids":[111,222,333]})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -510,7 +518,8 @@ TEST(JsonInternalTest, TableUpdateRemoveSnapshotRef) { nlohmann::json expected = R"({"action":"remove-snapshot-ref","ref-name":"my-branch"})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -521,7 +530,7 @@ TEST(JsonInternalTest, TableUpdateSetSnapshotRefBranch) { table::SetSnapshotRef update("main", 123456789, SnapshotRefType::kBranch, 5, 86400000, 604800000); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "set-snapshot-ref"); EXPECT_EQ(json["ref-name"], "main"); EXPECT_EQ(json["snapshot-id"], 123456789); @@ -536,7 +545,7 @@ TEST(JsonInternalTest, TableUpdateSetSnapshotRefBranch) { TEST(JsonInternalTest, TableUpdateSetSnapshotRefTag) { table::SetSnapshotRef update("release-1.0", 987654321, SnapshotRefType::kTag); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "set-snapshot-ref"); EXPECT_EQ(json["type"], "tag"); @@ -549,7 +558,7 @@ TEST(JsonInternalTest, TableUpdateSetSnapshotRefTag) { TEST(JsonInternalTest, TableUpdateSetProperties) { table::SetProperties update({{"key1", "value1"}, {"key2", "value2"}}); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "set-properties"); EXPECT_TRUE(json.contains("updates")); @@ -578,7 +587,7 @@ TEST(JsonInternalTest, TableUpdateSetPropertiesMissingCanonicalField) { TEST(JsonInternalTest, TableUpdateRemoveProperties) { table::RemoveProperties update({"key1", "key2"}); - auto json = ToJson(update); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "remove-properties"); EXPECT_TRUE(json.contains("removals")); @@ -610,7 +619,8 @@ TEST(JsonInternalTest, TableUpdateSetLocation) { nlohmann::json expected = R"({"action":"set-location","location":"s3://bucket/warehouse/table"})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), update); @@ -646,7 +656,8 @@ TEST(JsonInternalTest, TableUpdateSetStatistics) { } })"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), update); @@ -657,7 +668,8 @@ TEST(JsonInternalTest, TableUpdateRemoveStatistics) { nlohmann::json expected = R"({"action":"remove-statistics","snapshot-id":123456789})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -681,7 +693,8 @@ TEST(JsonInternalTest, TableUpdateSetPartitionStatistics) { } })"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -693,7 +706,8 @@ TEST(JsonInternalTest, TableUpdateRemovePartitionStatistics) { nlohmann::json expected = R"({"action":"remove-partition-statistics","snapshot-id":123456789})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ( @@ -719,7 +733,8 @@ TEST(JsonInternalTest, TableUpdateAddEncryptionKey) { {"properties", {{"scope", "table"}}}}}, }; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), @@ -738,7 +753,8 @@ TEST(JsonInternalTest, TableUpdateRemoveEncryptionKey) { table::RemoveEncryptionKey update("key-1"); nlohmann::json expected = R"({"action":"remove-encryption-key","key-id":"key-1"})"_json; - EXPECT_EQ(ToJson(update), expected); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); + EXPECT_EQ(json, expected); auto parsed = TableUpdateFromJson(expected); ASSERT_THAT(parsed, IsOk()); EXPECT_EQ(*internal::checked_cast(parsed.value().get()), diff --git a/src/iceberg/test/metadata_serde_test.cc b/src/iceberg/test/metadata_serde_test.cc index ba47f312d..e214f1606 100644 --- a/src/iceberg/test/metadata_serde_test.cc +++ b/src/iceberg/test/metadata_serde_test.cc @@ -597,7 +597,7 @@ TEST(MetadataSerdeTest, EncryptionKeysRoundTrip) { EXPECT_EQ(metadata.value()->encryption_keys[0].encrypted_key_metadata, "secret-key-metadata"); - auto serialized = ToJson(*metadata.value()); + ICEBERG_UNWRAP_OR_FAIL(auto serialized, ToJson(*metadata.value())); ASSERT_TRUE(serialized.contains("encryption-keys")); EXPECT_EQ(serialized["encryption-keys"], metadata_json["encryption-keys"]); } diff --git a/src/iceberg/test/schema_json_test.cc b/src/iceberg/test/schema_json_test.cc index 520a1eb70..944687e7d 100644 --- a/src/iceberg/test/schema_json_test.cc +++ b/src/iceberg/test/schema_json_test.cc @@ -42,8 +42,8 @@ class TypeJsonTest : public ::testing::TestWithParam {}; TEST_P(TypeJsonTest, SingleTypeRoundTrip) { // To Json const auto& param = GetParam(); - auto json = ToJson(*param.type).dump(); - ASSERT_EQ(param.json, json); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(*param.type)); + ASSERT_EQ(param.json, json.dump()); // From Json auto type_result = TypeFromJson(nlohmann::json::parse(param.json)); @@ -190,8 +190,8 @@ TEST(SchemaJsonTest, RoundTrip) { ASSERT_EQ(field2.type()->type_id(), TypeId::kString); ASSERT_TRUE(field2.optional()); - auto dumped_json = ToJson(*schema).dump(); - ASSERT_EQ(dumped_json, json); + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); + ASSERT_EQ(schema_json.dump(), json); } TEST(SchemaJsonTest, UnknownFieldRoundTrip) { @@ -206,7 +206,8 @@ TEST(SchemaJsonTest, UnknownFieldRoundTrip) { ASSERT_EQ(field.name(), "mystery"); ASSERT_EQ(field.type()->type_id(), TypeId::kUnknown); ASSERT_TRUE(field.optional()); - ASSERT_EQ(ToJson(*schema).dump(), json); + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); + ASSERT_EQ(schema_json.dump(), json); } TEST(SchemaJsonTest, NestedUnknownFieldsRoundTrip) { From 75bef3f75853d5e1673516927745480357f775fa Mon Sep 17 00:00:00 2001 From: Jiajia Li Date: Sun, 28 Jun 2026 00:35:58 +0800 Subject: [PATCH 129/151] feat(rest): support vended storage credentials (#719) Support REST vended storage credentials Parse storage credentials from REST load table responses and pass them to FileIO implementations that support credential routing. Also align table FileIO creation with table-level config overrides, route S3 requests by the longest matching credential prefix, and clean up related tests. --------- Co-authored-by: Gang Wu --- src/iceberg/arrow/s3/arrow_s3_file_io.cc | 203 ++++++++++++++++++--- src/iceberg/arrow/s3/s3_properties.h | 4 +- src/iceberg/catalog/rest/json_serde.cc | 36 ++++ src/iceberg/catalog/rest/rest_catalog.cc | 79 +++------ src/iceberg/catalog/rest/rest_catalog.h | 6 +- src/iceberg/catalog/rest/rest_file_io.cc | 44 +++++ src/iceberg/catalog/rest/rest_file_io.h | 9 + src/iceberg/catalog/rest/types.cc | 3 +- src/iceberg/catalog/rest/types.h | 11 +- src/iceberg/file_io.h | 21 +++ src/iceberg/meson.build | 1 + src/iceberg/storage_credential.h | 48 +++++ src/iceberg/test/arrow_s3_file_io_test.cc | 205 +++++++++++++++++----- src/iceberg/test/rest_file_io_test.cc | 97 ++++++++++ src/iceberg/test/rest_json_serde_test.cc | 46 ++++- src/iceberg/type_fwd.h | 1 + 16 files changed, 680 insertions(+), 134 deletions(-) create mode 100644 src/iceberg/storage_credential.h diff --git a/src/iceberg/arrow/s3/arrow_s3_file_io.cc b/src/iceberg/arrow/s3/arrow_s3_file_io.cc index cffd95840..a7e98620e 100644 --- a/src/iceberg/arrow/s3/arrow_s3_file_io.cc +++ b/src/iceberg/arrow/s3/arrow_s3_file_io.cc @@ -18,9 +18,13 @@ */ #include +#include #include #include #include +#include +#include +#include #include #if ICEBERG_S3_ENABLED @@ -36,9 +40,10 @@ namespace iceberg::arrow { +#if ICEBERG_S3_ENABLED + namespace { -#if ICEBERG_S3_ENABLED const std::string* FindProperty( const std::unordered_map& properties, std::string_view key) { @@ -74,6 +79,24 @@ Status EnsureS3Initialized() { return {}; } +// Splits any URI scheme off `endpoint` into `options.scheme`, returning the bare +// host[:port] that Arrow's `endpoint_override` expects. +std::string SplitEndpointScheme(std::string_view endpoint, + ::arrow::fs::S3Options& options) { + if (const auto pos = endpoint.find("://"); pos != std::string_view::npos) { + options.scheme = std::string(endpoint.substr(0, pos)); + endpoint = endpoint.substr(pos + 3); + } + return std::string(endpoint); +} + +bool IsS3FileIOCredentialPrefix(std::string_view prefix) { + return prefix == "s3" || prefix.starts_with("s3://") || prefix.starts_with("s3a://") || + prefix.starts_with("s3n://"); +} + +} // namespace + /// \brief Configure S3Options from a properties map. /// /// \param properties The configuration properties map. @@ -100,7 +123,7 @@ Result<::arrow::fs::S3Options> ConfigureS3Options( } // Configure region - if (const auto* region = FindProperty(properties, S3Properties::kRegion); + if (const auto* region = FindProperty(properties, S3Properties::kClientRegion); region != nullptr) { options.region = *region; } @@ -108,18 +131,13 @@ Result<::arrow::fs::S3Options> ConfigureS3Options( // Configure endpoint (for MinIO, LocalStack, etc.) if (const auto* endpoint = FindProperty(properties, S3Properties::kEndpoint); endpoint != nullptr) { - options.endpoint_override = *endpoint; - } else { - // Fall back to AWS standard environment variables for endpoint override - const char* s3_endpoint_env = std::getenv("AWS_ENDPOINT_URL_S3"); - if (s3_endpoint_env != nullptr) { - options.endpoint_override = s3_endpoint_env; - } else { - const char* endpoint_env = std::getenv("AWS_ENDPOINT_URL"); - if (endpoint_env != nullptr) { - options.endpoint_override = endpoint_env; - } - } + options.endpoint_override = SplitEndpointScheme(*endpoint, options); + } else if (const char* s3_endpoint_env = std::getenv("AWS_ENDPOINT_URL_S3"); + s3_endpoint_env != nullptr) { + options.endpoint_override = SplitEndpointScheme(s3_endpoint_env, options); + } else if (const char* endpoint_env = std::getenv("AWS_ENDPOINT_URL"); + endpoint_env != nullptr) { + options.endpoint_override = SplitEndpointScheme(endpoint_env, options); } ICEBERG_ASSIGN_OR_RAISE(const auto path_style_access, @@ -128,11 +146,11 @@ Result<::arrow::fs::S3Options> ConfigureS3Options( options.force_virtual_addressing = !*path_style_access; } - // Configure SSL + // Explicit `s3.ssl.enabled` overrides any endpoint-derived scheme. ICEBERG_ASSIGN_OR_RAISE(const auto ssl_enabled, ParseOptionalBool(properties, S3Properties::kSslEnabled)); - if (ssl_enabled.has_value() && !*ssl_enabled) { - options.scheme = "http"; + if (ssl_enabled.has_value()) { + options.scheme = *ssl_enabled ? "https" : "http"; } // Configure timeouts @@ -152,33 +170,160 @@ Result<::arrow::fs::S3Options> ConfigureS3Options( return options; } -#endif -} // namespace +namespace { -Result> MakeS3FileIO( +Result> BuildArrowS3FileSystem( const std::unordered_map& properties) { -#if ICEBERG_S3_ENABLED ICEBERG_RETURN_UNEXPECTED(EnsureS3Initialized()); - - // Configure S3 options from properties (uses default credentials if empty) ICEBERG_ASSIGN_OR_RAISE(auto options, ConfigureS3Options(properties)); ICEBERG_ARROW_ASSIGN_OR_RETURN(auto fs, ::arrow::fs::S3FileSystem::Make(options)); + return std::shared_ptr<::arrow::fs::FileSystem>(std::move(fs)); +} - return std::make_unique(std::move(fs)); -#else - return NotSupported("Arrow S3 support is not enabled"); -#endif +std::string CanonicalizeS3Scheme(std::string_view location) { + for (std::string_view scheme : {"s3a://", "s3n://", "oss://"}) { + if (location.starts_with(scheme)) { + return std::string("s3://").append(location.substr(scheme.size())); + } + } + return std::string(location); +} + +class ArrowS3FileIO final : public FileIO, public SupportsStorageCredentials { + public: + ArrowS3FileIO(std::shared_ptr<::arrow::fs::FileSystem> arrow_fs, + std::unordered_map default_properties) + : default_file_io_(std::move(arrow_fs)), + default_properties_(std::move(default_properties)) {} + + Result> NewInputFile(std::string file_location) override; + + Result> NewInputFile(std::string file_location, + size_t length) override; + + Result> NewOutputFile(std::string file_location) override; + + Status DeleteFile(const std::string& file_location) override; + + Status DeleteFiles(const std::vector& file_locations) override; + + Status SetStorageCredentials( + const std::vector& storage_credentials) override; + + const std::vector& credentials() const override { + return storage_credentials_; + } + + SupportsStorageCredentials* AsSupportsStorageCredentials() override { return this; } + + private: + ArrowFileSystemFileIO& FileIOForPath(std::string_view location); + + ArrowFileSystemFileIO default_file_io_; + std::unordered_map default_properties_; + std::vector storage_credentials_; + std::vector>> + file_io_by_prefix_; +}; + +Status ArrowS3FileIO::SetStorageCredentials( + const std::vector& storage_credentials) { + std::vector>> + file_io_by_prefix; + file_io_by_prefix.reserve(storage_credentials.size()); + // TODO(gangwu): Refresh vended credentials via credentials.uri before tokens expire. + for (const auto& credential : storage_credentials) { + ICEBERG_RETURN_UNEXPECTED(credential.Validate()); + if (!IsS3FileIOCredentialPrefix(credential.prefix)) { + return NotSupported( + "Storage credential prefix '{}' is unsupported by Arrow S3 FileIO", + credential.prefix); + } + auto properties = default_properties_; + for (const auto& [key, value] : credential.config) { + properties[key] = value; + } + ICEBERG_ASSIGN_OR_RAISE(auto fs, BuildArrowS3FileSystem(properties)); + file_io_by_prefix.emplace_back( + CanonicalizeS3Scheme(credential.prefix), + std::make_unique(std::move(fs))); + } + file_io_by_prefix_ = std::move(file_io_by_prefix); + storage_credentials_ = storage_credentials; + return {}; +} + +ArrowFileSystemFileIO& ArrowS3FileIO::FileIOForPath(std::string_view location) { + if (file_io_by_prefix_.empty()) { + return default_file_io_; + } + const std::string canonical = CanonicalizeS3Scheme(location); + ArrowFileSystemFileIO* best = &default_file_io_; + size_t best_len = 0; + for (const auto& [prefix, file_io] : file_io_by_prefix_) { + if (prefix.size() > best_len && canonical.starts_with(prefix)) { + best = file_io.get(); + best_len = prefix.size(); + } + } + return *best; +} + +Result> ArrowS3FileIO::NewInputFile( + std::string file_location) { + return FileIOForPath(file_location).NewInputFile(std::move(file_location)); +} + +Result> ArrowS3FileIO::NewInputFile(std::string file_location, + size_t length) { + return FileIOForPath(file_location).NewInputFile(std::move(file_location), length); +} + +Result> ArrowS3FileIO::NewOutputFile( + std::string file_location) { + return FileIOForPath(file_location).NewOutputFile(std::move(file_location)); +} + +Status ArrowS3FileIO::DeleteFile(const std::string& file_location) { + return FileIOForPath(file_location).DeleteFile(file_location); +} + +Status ArrowS3FileIO::DeleteFiles(const std::vector& file_locations) { + std::unordered_map> locations_by_io; + for (const auto& file_location : file_locations) { + locations_by_io[&FileIOForPath(file_location)].push_back(file_location); + } + for (auto& [file_io, locations] : locations_by_io) { + ICEBERG_RETURN_UNEXPECTED(file_io->DeleteFiles(locations)); + } + return {}; +} + +} // namespace + +Result> MakeS3FileIO( + const std::unordered_map& properties) { + // Uses default credentials if properties are empty. + ICEBERG_ASSIGN_OR_RAISE(auto fs, BuildArrowS3FileSystem(properties)); + return std::make_unique(std::move(fs), properties); } Status FinalizeS3() { -#if ICEBERG_S3_ENABLED auto status = ::arrow::fs::FinalizeS3(); ICEBERG_ARROW_RETURN_NOT_OK(status); return {}; +} + #else + +Result> MakeS3FileIO( + [[maybe_unused]] const std::unordered_map& properties) { return NotSupported("Arrow S3 support is not enabled"); -#endif } +Status FinalizeS3() { return NotSupported("Arrow S3 support is not enabled"); } + +#endif + } // namespace iceberg::arrow diff --git a/src/iceberg/arrow/s3/s3_properties.h b/src/iceberg/arrow/s3/s3_properties.h index 53657743d..7b76968a6 100644 --- a/src/iceberg/arrow/s3/s3_properties.h +++ b/src/iceberg/arrow/s3/s3_properties.h @@ -37,8 +37,8 @@ struct S3Properties { static constexpr std::string_view kSecretAccessKey = "s3.secret-access-key"; /// AWS session token (for temporary credentials) static constexpr std::string_view kSessionToken = "s3.session-token"; - /// AWS region - static constexpr std::string_view kRegion = "s3.region"; + /// AWS region, standard Iceberg client property. + static constexpr std::string_view kClientRegion = "client.region"; /// Custom endpoint override (for MinIO, LocalStack, etc.) static constexpr std::string_view kEndpoint = "s3.endpoint"; /// Whether to use path-style access (needed for MinIO) diff --git a/src/iceberg/catalog/rest/json_serde.cc b/src/iceberg/catalog/rest/json_serde.cc index 49dbcdd4c..4dcfad399 100644 --- a/src/iceberg/catalog/rest/json_serde.cc +++ b/src/iceberg/catalog/rest/json_serde.cc @@ -71,6 +71,8 @@ constexpr std::string_view kSource = "source"; constexpr std::string_view kDestination = "destination"; constexpr std::string_view kMetadata = "metadata"; constexpr std::string_view kConfig = "config"; +constexpr std::string_view kStorageCredentials = "storage-credentials"; +constexpr std::string_view kPrefix = "prefix"; constexpr std::string_view kIdentifiers = "identifiers"; constexpr std::string_view kOverrides = "overrides"; constexpr std::string_view kDefaults = "defaults"; @@ -133,6 +135,23 @@ constexpr std::string_view kResidualFilter = "residual-filter"; constexpr std::string_view kMapKeys = "keys"; constexpr std::string_view kMapValues = "values"; +Result StorageCredentialToJson(const StorageCredential& credential) { + ICEBERG_RETURN_UNEXPECTED(credential.Validate()); + nlohmann::json json; + json[kPrefix] = credential.prefix; + json[kConfig] = credential.config; + return json; +} + +Result StorageCredentialFromJson(const nlohmann::json& json) { + StorageCredential credential; + ICEBERG_ASSIGN_OR_RAISE(credential.prefix, GetJsonValue(json, kPrefix)); + ICEBERG_ASSIGN_OR_RAISE(credential.config, + GetJsonValue(json, kConfig)); + ICEBERG_RETURN_UNEXPECTED(credential.Validate()); + return credential; +} + template Result> KeyValueMapFromJson(const nlohmann::json& json, std::string_view key) { @@ -695,6 +714,14 @@ Result ToJson(const LoadTableResult& result) { SetOptionalStringField(json, kMetadataLocation, result.metadata_location); ICEBERG_ASSIGN_OR_RAISE(json[kMetadata], ToJson(*result.metadata)); SetContainerField(json, kConfig, result.config); + if (!result.storage_credentials.empty()) { + nlohmann::json creds = nlohmann::json::array(); + for (const auto& cred : result.storage_credentials) { + ICEBERG_ASSIGN_OR_RAISE(auto entry, StorageCredentialToJson(cred)); + creds.push_back(std::move(entry)); + } + json[kStorageCredentials] = std::move(creds); + } return json; } @@ -707,6 +734,15 @@ Result LoadTableResultFromJson(const nlohmann::json& json) { ICEBERG_ASSIGN_OR_RAISE(result.metadata, TableMetadataFromJson(metadata_json)); ICEBERG_ASSIGN_OR_RAISE(result.config, GetJsonValueOrDefault(json, kConfig)); + if (auto it = json.find(kStorageCredentials); it != json.end() && !it->is_null()) { + if (!it->is_array()) { + return JsonParseError("Cannot parse storage credentials from non-array"); + } + for (const auto& entry : *it) { + ICEBERG_ASSIGN_OR_RAISE(auto cred, StorageCredentialFromJson(entry)); + result.storage_credentials.push_back(std::move(cred)); + } + } ICEBERG_RETURN_UNEXPECTED(result.Validate()); return result; } diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 6b479ee03..27de0befa 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -29,7 +29,6 @@ #include #include "iceberg/catalog/rest/auth/auth_managers.h" -#include "iceberg/catalog/rest/auth/auth_properties.h" #include "iceberg/catalog/rest/auth/auth_session.h" #include "iceberg/catalog/rest/catalog_properties.h" #include "iceberg/catalog/rest/constant.h" @@ -51,6 +50,7 @@ #include "iceberg/table_requirements.h" #include "iceberg/table_update.h" #include "iceberg/transaction.h" +#include "iceberg/util/formatter_internal.h" #include "iceberg/util/macros.h" namespace iceberg::rest { @@ -122,41 +122,6 @@ Result CaptureNoSuchNamespace(const auto& status) { return CaptureNoSuchObject(status, ErrorKind::kNoSuchNamespace); } -Status ValidateNoFileIOConfig( - const std::unordered_map& table_config) { - static const std::unordered_set kTableConfigHandledByAuthKeys = { - auth::AuthProperties::kAuthType, - auth::AuthProperties::kBasicUsername, - auth::AuthProperties::kBasicPassword, - auth::AuthProperties::kSigV4Enabled, - auth::AuthProperties::kSigV4DelegateAuthType, - auth::AuthProperties::kSigV4SigningRegion, - auth::AuthProperties::kSigV4SigningName, - auth::AuthProperties::kSigV4AccessKeyId, - auth::AuthProperties::kSigV4SecretAccessKey, - auth::AuthProperties::kSigV4SessionToken, - auth::AuthProperties::kToken.key(), - auth::AuthProperties::kCredential.key(), - auth::AuthProperties::kScope.key(), - auth::AuthProperties::kOAuth2ServerUri.key(), - auth::AuthProperties::kKeepRefreshed.key(), - auth::AuthProperties::kExchangeEnabled.key(), - auth::AuthProperties::kAudience.key(), - auth::AuthProperties::kResource.key(), - }; - - for (const auto& [key, _] : table_config) { - if (!kTableConfigHandledByAuthKeys.contains(key)) { - // Fail closed because unknown table config may be FileIO/storage config. - // TODO(gangwu): Build table-specific FileIO when REST storage - // credentials and table-level storage config are supported. - return NotImplemented( - "Table-specific FileIO is not implemented for table config key '{}'", key); - } - } - return {}; -} - Status CheckBoundTable(const TableIdentifier& requested, const TableIdentifier& bound) { if (requested == bound) { return {}; @@ -285,12 +250,14 @@ class RestCatalog::TableScopedCatalog final TableScopedCatalog(std::shared_ptr root, SessionContext context, TableIdentifier identifier, std::unordered_map table_config, - std::shared_ptr table_session) + std::shared_ptr table_session, + std::shared_ptr table_io) : root_(std::move(root)), context_(std::move(context)), identifier_(std::move(identifier)), table_config_(std::move(table_config)), - table_session_(std::move(table_session)) {} + table_session_(std::move(table_session)), + table_io_(std::move(table_io)) {} std::string_view name() const override { return root_->name(); } @@ -348,7 +315,7 @@ class RestCatalog::TableScopedCatalog final auto response, root_->UpdateTableInternal(identifier, requirements, updates, *table_session_)); return root_->MakeTableFromCommitResponse(identifier, std::move(response), context_, - table_config_, table_session_); + table_config_, table_session_, table_io_); } Result> StageCreateTable( @@ -395,6 +362,7 @@ class RestCatalog::TableScopedCatalog final TableIdentifier identifier_; std::unordered_map table_config_; std::shared_ptr table_session_; + std::shared_ptr table_io_; }; RestCatalog::~RestCatalog() { @@ -519,8 +487,12 @@ Result> RestCatalog::TableAuthSession( Result> RestCatalog::TableFileIO( const SessionContext& /*context*/, - const std::unordered_map& table_config) const { - ICEBERG_RETURN_UNEXPECTED(ValidateNoFileIOConfig(table_config)); + const std::unordered_map& table_config, + const std::vector& storage_credentials) const { + if (!table_config.empty() || !storage_credentials.empty()) { + return MakeTableFileIO(config_.configs(), table_config, storage_credentials); + } + return file_io_; } @@ -740,8 +712,9 @@ Result> RestCatalog::UpdateTable( ICEBERG_ASSIGN_OR_RAISE( auto table_session, TableAuthSession(identifier, table_config, std::move(contextual_session))); + // Top-level updates have no loaded table FileIO to reuse. return MakeTableFromCommitResponse(identifier, std::move(response), context, - table_config, std::move(table_session)); + table_config, std::move(table_session), file_io_); } Result> RestCatalog::StageCreateTable( @@ -756,12 +729,15 @@ Result> RestCatalog::StageCreateTable( CreateTableInternal(identifier, schema, spec, order, location, properties, /*stage_create=*/true, *contextual_session)); auto table_config = std::move(result.config); - ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + auto storage_credentials = std::move(result.storage_credentials); + ICEBERG_ASSIGN_OR_RAISE(auto table_io, + TableFileIO(context, table_config, storage_credentials)); ICEBERG_ASSIGN_OR_RAISE( auto table_session, TableAuthSession(identifier, table_config, std::move(contextual_session))); auto table_catalog = std::make_shared( - shared_from_this(), context, identifier, table_config, std::move(table_session)); + shared_from_this(), context, identifier, table_config, std::move(table_session), + table_io); ICEBERG_ASSIGN_OR_RAISE( auto staged_table, StagedTable::Make(identifier, std::move(result.metadata), @@ -869,12 +845,14 @@ Result> RestCatalog::MakeTableFromLoadResult( const SessionContext& context, std::shared_ptr contextual_session) { auto table_config = std::move(result.config); - ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + auto storage_credentials = std::move(result.storage_credentials); + ICEBERG_ASSIGN_OR_RAISE(auto table_io, + TableFileIO(context, table_config, storage_credentials)); ICEBERG_ASSIGN_OR_RAISE( auto table_session, TableAuthSession(identifier, table_config, std::move(contextual_session))); auto table_catalog = std::make_shared( - shared_from_this(), context, identifier, table_config, table_session); + shared_from_this(), context, identifier, table_config, table_session, table_io); return Table::Make(identifier, std::move(result.metadata), std::move(result.metadata_location), std::move(table_io), std::move(table_catalog)); @@ -884,13 +862,10 @@ Result> RestCatalog::MakeTableFromCommitResponse( const TableIdentifier& identifier, CommitTableResponse response, const SessionContext& context, const std::unordered_map& table_config, - std::shared_ptr table_session) { - // TODO(gangwu): If the REST commit response grows table config or - // storage credentials, derive a replacement table session/FileIO from that - // response. The current table commit response does not define config. - ICEBERG_ASSIGN_OR_RAISE(auto table_io, TableFileIO(context, table_config)); + std::shared_ptr table_session, std::shared_ptr table_io) { + // Reuse the bound FileIO because commit responses carry no config or credentials. auto table_catalog = std::make_shared( - shared_from_this(), context, identifier, table_config, table_session); + shared_from_this(), context, identifier, table_config, table_session, table_io); return Table::Make(identifier, std::move(response.metadata), std::move(response.metadata_location), std::move(table_io), std::move(table_catalog)); diff --git a/src/iceberg/catalog/rest/rest_catalog.h b/src/iceberg/catalog/rest/rest_catalog.h index 76d2e54dc..97cf42151 100644 --- a/src/iceberg/catalog/rest/rest_catalog.h +++ b/src/iceberg/catalog/rest/rest_catalog.h @@ -31,6 +31,7 @@ #include "iceberg/catalog/session_catalog.h" #include "iceberg/catalog/session_context.h" #include "iceberg/result.h" +#include "iceberg/storage_credential.h" /// \file iceberg/catalog/rest/rest_catalog.h /// RestCatalog implementation for Iceberg REST API. @@ -79,7 +80,8 @@ class ICEBERG_REST_EXPORT RestCatalog final Result> TableFileIO( const SessionContext& context, - const std::unordered_map& table_config) const; + const std::unordered_map& table_config, + const std::vector& storage_credentials) const; Result> ListNamespaces(const Namespace& ns, auth::AuthSession& session) const; @@ -169,7 +171,7 @@ class ICEBERG_REST_EXPORT RestCatalog final const TableIdentifier& identifier, CommitTableResponse response, const SessionContext& context, const std::unordered_map& table_config, - std::shared_ptr table_session); + std::shared_ptr table_session, std::shared_ptr table_io); RestCatalogProperties config_; std::shared_ptr file_io_; diff --git a/src/iceberg/catalog/rest/rest_file_io.cc b/src/iceberg/catalog/rest/rest_file_io.cc index 5fadca1ac..fe8a2b155 100644 --- a/src/iceberg/catalog/rest/rest_file_io.cc +++ b/src/iceberg/catalog/rest/rest_file_io.cc @@ -20,7 +20,12 @@ #include "iceberg/catalog/rest/rest_file_io.h" #include +#include +#include +#include +#include "iceberg/catalog/rest/types.h" +#include "iceberg/file_io.h" #include "iceberg/file_io_registry.h" #include "iceberg/util/macros.h" @@ -33,6 +38,16 @@ bool IsBuiltinImpl(std::string_view io_impl) { io_impl == FileIORegistry::kArrowS3FileIO; } +std::unordered_map MergeFileIOProperties( + const std::unordered_map& catalog_config, + const std::unordered_map& table_config) { + auto properties = catalog_config; + for (const auto& [key, value] : table_config) { + properties[key] = value; + } + return properties; +} + } // namespace Result DetectBuiltinFileIO(std::string_view location) { @@ -92,4 +107,33 @@ Result> MakeCatalogFileIO(const RestCatalogProperties& c return FileIORegistry::Load(io_impl, config.configs()); } +Result> MakeTableFileIO( + const std::unordered_map& catalog_config, + const std::unordered_map& table_config, + const std::vector& storage_credentials) { + const auto default_properties = MergeFileIOProperties(catalog_config, table_config); + const auto properties = RestCatalogProperties::FromMap(default_properties); + auto io_impl = properties.Get(RestCatalogProperties::kIOImpl); + if (io_impl.empty()) { + const auto warehouse = properties.Get(RestCatalogProperties::kWarehouse); + if (warehouse.empty()) { + return InvalidArgument(R"("{}" or "{}" property is required to create FileIO)", + RestCatalogProperties::kIOImpl.key(), + RestCatalogProperties::kWarehouse.key()); + } + ICEBERG_ASSIGN_OR_RAISE(const auto detected_kind, DetectBuiltinFileIO(warehouse)); + io_impl = std::string(BuiltinFileIOName(detected_kind)); + } + ICEBERG_ASSIGN_OR_RAISE(auto io, FileIORegistry::Load(io_impl, default_properties)); + + if (storage_credentials.empty()) { + return io; + } else if (auto* credentialed = io->AsSupportsStorageCredentials()) { + ICEBERG_RETURN_UNEXPECTED(credentialed->SetStorageCredentials(storage_credentials)); + } else { + return NotSupported("Configured FileIO does not support vended storage credentials"); + } + return io; +} + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/rest_file_io.h b/src/iceberg/catalog/rest/rest_file_io.h index 68482521a..9e5f7a0a9 100644 --- a/src/iceberg/catalog/rest/rest_file_io.h +++ b/src/iceberg/catalog/rest/rest_file_io.h @@ -22,9 +22,12 @@ #include #include #include +#include +#include #include "iceberg/catalog/rest/catalog_properties.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" +#include "iceberg/catalog/rest/types.h" #include "iceberg/file_io.h" #include "iceberg/file_io_registry.h" #include "iceberg/result.h" @@ -44,4 +47,10 @@ ICEBERG_REST_EXPORT std::string_view BuiltinFileIOName(BuiltinFileIOKind kind); ICEBERG_REST_EXPORT Result> MakeCatalogFileIO( const RestCatalogProperties& config); +/// \brief Build the configured table FileIO and apply storage credentials if present. +ICEBERG_REST_EXPORT Result> MakeTableFileIO( + const std::unordered_map& catalog_config, + const std::unordered_map& table_config, + const std::vector& storage_credentials); + } // namespace iceberg::rest diff --git a/src/iceberg/catalog/rest/types.cc b/src/iceberg/catalog/rest/types.cc index 8d96bccb2..84fba9a7c 100644 --- a/src/iceberg/catalog/rest/types.cc +++ b/src/iceberg/catalog/rest/types.cc @@ -86,7 +86,8 @@ bool CreateTableRequest::operator==(const CreateTableRequest& other) const { } bool LoadTableResult::operator==(const LoadTableResult& other) const { - if (metadata_location != other.metadata_location || config != other.config) { + if (metadata_location != other.metadata_location || config != other.config || + storage_credentials != other.storage_credentials) { return false; } diff --git a/src/iceberg/catalog/rest/types.h b/src/iceberg/catalog/rest/types.h index 7849b366b..20a59fa59 100644 --- a/src/iceberg/catalog/rest/types.h +++ b/src/iceberg/catalog/rest/types.h @@ -30,6 +30,7 @@ #include "iceberg/catalog/rest/endpoint.h" #include "iceberg/catalog/rest/iceberg_rest_export.h" #include "iceberg/result.h" +#include "iceberg/storage_credential.h" #include "iceberg/table_identifier.h" #include "iceberg/type_fwd.h" #include "iceberg/util/macros.h" @@ -185,13 +186,17 @@ struct ICEBERG_REST_EXPORT LoadTableResult { std::string metadata_location; std::shared_ptr metadata; // required std::unordered_map config; - // TODO(Li Feiyang): Add std::shared_ptr storage_credential; + /// \brief Vended storage credentials, one per URI prefix; empty if none. + std::vector storage_credentials; /// \brief Validates the LoadTableResult. Status Validate() const { if (!metadata) { return ValidationFailed("Invalid metadata: null"); } + for (const auto& credential : storage_credentials) { + ICEBERG_RETURN_UNEXPECTED(credential.Validate()); + } return {}; } @@ -332,7 +337,7 @@ struct ICEBERG_REST_EXPORT PlanTableScanResponse { PlanStatus plan_status = PlanStatus::kCompleted; std::string plan_id; std::optional error; - // TODO(sandeepg): Add credentials. + // TODO(sandeepg): Add storage credentials and bind scan FileIO to them. Status Validate() const; @@ -347,7 +352,7 @@ struct ICEBERG_REST_EXPORT FetchPlanningResultResponse { std::vector> delete_files; PlanStatus plan_status = PlanStatus::kCompleted; std::optional error; - // TODO(sandeepg): Add credentials. + // TODO(sandeepg): Add storage credentials and bind scan FileIO to them. Status Validate() const; diff --git a/src/iceberg/file_io.h b/src/iceberg/file_io.h index ba6f0129a..7d7b31113 100644 --- a/src/iceberg/file_io.h +++ b/src/iceberg/file_io.h @@ -30,9 +30,12 @@ #include "iceberg/iceberg_export.h" #include "iceberg/result.h" +#include "iceberg/storage_credential.h" namespace iceberg { +class SupportsStorageCredentials; + /// \brief Seekable byte stream for reading file contents. class ICEBERG_EXPORT SeekableInputStream { public: @@ -171,6 +174,24 @@ class ICEBERG_EXPORT FileIO { /// \param file_locations The locations of the files to delete. /// \return void if all deletes succeed, or an error code if any delete fails. virtual Status DeleteFiles(const std::vector& file_locations); + + /// \brief Return storage-credential support when implemented by this FileIO. + virtual SupportsStorageCredentials* AsSupportsStorageCredentials() { return nullptr; } +}; + +/// \brief Mix-in for FileIO implementations that route object paths to +/// per-prefix file systems built from vended storage credentials, letting the +/// catalog stay decoupled from concrete storage implementations. +class ICEBERG_EXPORT SupportsStorageCredentials { + public: + virtual ~SupportsStorageCredentials() = default; + + /// \brief Install vended storage credentials. + virtual Status SetStorageCredentials( + const std::vector& storage_credentials) = 0; + + /// \brief Return currently installed storage credentials. + virtual const std::vector& credentials() const = 0; }; } // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 71a4498f1..1fa15fa12 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -283,6 +283,7 @@ install_headers( 'sort_field.h', 'sort_order.h', 'statistics_file.h', + 'storage_credential.h', 'table.h', 'table_identifier.h', 'table_metadata.h', diff --git a/src/iceberg/storage_credential.h b/src/iceberg/storage_credential.h new file mode 100644 index 000000000..604e8ddce --- /dev/null +++ b/src/iceberg/storage_credential.h @@ -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. + */ + +#pragma once + +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" + +namespace iceberg { + +/// \brief A storage credential vended for a storage location prefix. +struct ICEBERG_EXPORT StorageCredential { + std::string prefix; + std::unordered_map config; + + Status Validate() const { + if (prefix.empty()) { + return ValidationFailed("Invalid storage credential: prefix must be non-empty"); + } + if (config.empty()) { + return ValidationFailed("Invalid storage credential: config must be non-empty"); + } + return {}; + } + + bool operator==(const StorageCredential& other) const = default; +}; + +} // namespace iceberg diff --git a/src/iceberg/test/arrow_s3_file_io_test.cc b/src/iceberg/test/arrow_s3_file_io_test.cc index b1caff1e8..701a8f0d9 100644 --- a/src/iceberg/test/arrow_s3_file_io_test.cc +++ b/src/iceberg/test/arrow_s3_file_io_test.cc @@ -21,14 +21,25 @@ #include #include #include +#include #include +#include +#include #include #include +#if ICEBERG_S3_ENABLED +# include +#endif + #include "iceberg/arrow/arrow_io_util.h" #include "iceberg/arrow/s3/s3_properties.h" +#include "iceberg/file_io.h" +#include "iceberg/result.h" +#include "iceberg/storage_credential.h" #include "iceberg/test/matchers.h" +#include "iceberg/util/macros.h" namespace { @@ -62,20 +73,38 @@ std::unordered_map PropertiesFromEnv() { properties[std::string(iceberg::arrow::S3Properties::kEndpoint)] = *endpoint; } if (const auto region = GetEnvIfSet("AWS_REGION")) { - properties[std::string(iceberg::arrow::S3Properties::kRegion)] = *region; + properties[std::string(iceberg::arrow::S3Properties::kClientRegion)] = *region; } return properties; } +std::unordered_map BadS3Credentials() { + return { + {std::string(iceberg::arrow::S3Properties::kAccessKeyId), "bad-access-key"}, + {std::string(iceberg::arrow::S3Properties::kSecretAccessKey), "bad-secret-key"}}; +} + } // namespace namespace iceberg::arrow { +#if ICEBERG_S3_ENABLED +Result<::arrow::fs::S3Options> ConfigureS3Options( + const std::unordered_map& properties); +#endif + namespace { class ArrowS3FileIOTest : public ::testing::Test { protected: +#if ICEBERG_S3_ENABLED + static void SetUpTestSuite() { + auto io = MakeS3FileIO({}); + ASSERT_THAT(io, IsOk()); + } +#endif + static void TearDownTestSuite() { auto status = FinalizeS3(); if (!status.has_value()) { @@ -89,27 +118,56 @@ class ArrowS3FileIOTest : public ::testing::Test { return MakeObjectUri(*base_uri_, object_name); } - void RequireIntegrationEnv() const { - if (!base_uri_.has_value()) { - GTEST_SKIP() << "Set ICEBERG_TEST_S3_URI to enable S3 IO test"; - } - } + const std::string& BaseUri() const { return *base_uri_; } + + bool HasIntegrationEnv() const { return base_uri_.has_value(); } private: std::optional base_uri_; }; +Status CheckReadWrite(FileIO& io, const std::string& object_uri, + std::string_view content) { + ICEBERG_RETURN_UNEXPECTED(io.WriteFile(object_uri, content)); + ICEBERG_ASSIGN_OR_RAISE(auto read, io.ReadFile(object_uri, std::nullopt)); + EXPECT_EQ(read, std::string(content)); + return io.DeleteFile(object_uri); +} + } // namespace -TEST_F(ArrowS3FileIOTest, CreateWithDefaultProperties) { +TEST_F(ArrowS3FileIOTest, Create) { auto result = MakeS3FileIO({}); ASSERT_THAT(result, IsOk()); EXPECT_NE(result.value(), nullptr); } -TEST_F(ArrowS3FileIOTest, RequiresS3SupportAtBuildTime) { - auto result = MakeS3FileIO(); +TEST_F(ArrowS3FileIOTest, StoresCredentials) { + auto result = MakeS3FileIO({}); + ASSERT_THAT(result, IsOk()); + auto* credentialed = result.value()->AsSupportsStorageCredentials(); + ASSERT_NE(credentialed, nullptr); + + std::vector credentials = { + {.prefix = "s3://bucket/table", + .config = {{std::string(S3Properties::kAccessKeyId), "access-key"}, + {std::string(S3Properties::kSecretAccessKey), "secret"}}}}; + EXPECT_THAT(credentialed->SetStorageCredentials(credentials), IsOk()); + EXPECT_EQ(credentialed->credentials(), credentials); +} + +TEST_F(ArrowS3FileIOTest, RejectsCredentialPrefix) { + auto result = MakeS3FileIO({}); ASSERT_THAT(result, IsOk()); + auto* credentialed = result.value()->AsSupportsStorageCredentials(); + ASSERT_NE(credentialed, nullptr); + + auto status = credentialed->SetStorageCredentials( + {{.prefix = "gs://bucket/table", + .config = {{std::string(S3Properties::kAccessKeyId), "access-key"}, + {std::string(S3Properties::kSecretAccessKey), "secret"}}}}); + EXPECT_THAT(status, IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(status, HasErrorMessage("unsupported by Arrow S3 FileIO")); } TEST_F(ArrowS3FileIOTest, RejectsIncompleteStaticCredentials) { @@ -126,59 +184,122 @@ TEST_F(ArrowS3FileIOTest, RejectsInvalidBooleanProperties) { EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); } -TEST_F(ArrowS3FileIOTest, ReadWriteFile) { - RequireIntegrationEnv(); +TEST_F(ArrowS3FileIOTest, ReadWrite) { + if (!HasIntegrationEnv()) { + GTEST_SKIP() << "Set ICEBERG_TEST_S3_URI to enable S3 IO test"; + } auto io_res = MakeS3FileIO(); ASSERT_THAT(io_res, IsOk()); auto io = std::move(io_res).value(); auto object_uri = ObjectUri("iceberg_s3_io_test.txt"); - auto write_res = io->WriteFile(object_uri, "hello s3"); - ASSERT_THAT(write_res, IsOk()); - - auto read_res = io->ReadFile(object_uri, std::nullopt); - ASSERT_THAT(read_res, IsOk()); - EXPECT_THAT(read_res, HasValue(::testing::Eq("hello s3"))); - - auto del_res = io->DeleteFile(object_uri); - EXPECT_THAT(del_res, IsOk()); + EXPECT_THAT(CheckReadWrite(*io, object_uri, "hello s3"), IsOk()); } -TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithProperties) { - RequireIntegrationEnv(); +TEST_F(ArrowS3FileIOTest, ReadWriteWithProperties) { + if (!HasIntegrationEnv()) { + GTEST_SKIP() << "Set ICEBERG_TEST_S3_URI to enable S3 IO test"; + } auto io_res = MakeS3FileIO(PropertiesFromEnv()); ASSERT_THAT(io_res, IsOk()); auto io = std::move(io_res).value(); auto object_uri = ObjectUri("iceberg_s3_io_props_test.txt"); - auto write_res = io->WriteFile(object_uri, "hello s3 with properties"); - ASSERT_THAT(write_res, IsOk()); - - auto read_res = io->ReadFile(object_uri, std::nullopt); - ASSERT_THAT(read_res, IsOk()); - EXPECT_THAT(read_res, HasValue(::testing::Eq("hello s3 with properties"))); - - auto del_res = io->DeleteFile(object_uri); - EXPECT_THAT(del_res, IsOk()); + EXPECT_THAT(CheckReadWrite(*io, object_uri, "hello s3 with properties"), IsOk()); } -TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithSslDisabled) { - RequireIntegrationEnv(); - std::unordered_map properties; - properties[std::string(S3Properties::kSslEnabled)] = "false"; +TEST_F(ArrowS3FileIOTest, LongestCredentialPrefix) { + if (!HasIntegrationEnv()) { + GTEST_SKIP() << "Set ICEBERG_TEST_S3_URI to enable S3 IO test"; + } + + auto properties = PropertiesFromEnv(); + if (properties.empty()) { + GTEST_SKIP() << "Set S3 properties to enable credential routing test"; + } auto io_res = MakeS3FileIO(properties); ASSERT_THAT(io_res, IsOk()); + auto io = std::move(io_res).value(); + auto* credentialed = io->AsSupportsStorageCredentials(); + ASSERT_NE(credentialed, nullptr); + + constexpr std::string_view object_name = "iceberg_s3_io_prefix_test.txt"; + auto object_uri = ObjectUri(object_name); + const auto partial_prefix = + object_uri.substr(0, object_uri.size() - object_name.size() + 3); + + auto bad_properties = BadS3Credentials(); + EXPECT_THAT(credentialed->SetStorageCredentials( + {{.prefix = BaseUri(), .config = std::move(bad_properties)}, + {.prefix = partial_prefix, .config = properties}}), + IsOk()); + EXPECT_THAT(CheckReadWrite(*io, object_uri, "hello s3 with vended credentials"), + IsOk()); } -TEST_F(ArrowS3FileIOTest, MakeS3FileIOWithTimeouts) { - RequireIntegrationEnv(); - std::unordered_map properties; - properties[std::string(S3Properties::kConnectTimeoutMs)] = "5000"; - properties[std::string(S3Properties::kSocketTimeoutMs)] = "10000"; +#if ICEBERG_S3_ENABLED +TEST_F(ArrowS3FileIOTest, ClientRegion) { + auto result = + ConfigureS3Options({{std::string(S3Properties::kClientRegion), "us-east-1"}}); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->region, "us-east-1"); +} - auto io_res = MakeS3FileIO(properties); - ASSERT_THAT(io_res, IsOk()); +TEST_F(ArrowS3FileIOTest, EndpointScheme) { + struct Case { + std::string_view endpoint; + std::string_view endpoint_override; + std::string_view scheme; + }; + const std::vector cases = {{"https://oss-cn-hangzhou.aliyuncs.com:443", + "oss-cn-hangzhou.aliyuncs.com:443", "https"}, + {"http://localhost:9000", "localhost:9000", "http"}, + {"localhost:9000", "localhost:9000", "https"}}; + + for (const auto& test_case : cases) { + auto result = ConfigureS3Options( + {{std::string(S3Properties::kEndpoint), std::string(test_case.endpoint)}}); + ASSERT_THAT(result, IsOk()) << test_case.endpoint; + EXPECT_EQ(result->endpoint_override, test_case.endpoint_override); + EXPECT_EQ(result->scheme, test_case.scheme); + } +} + +TEST_F(ArrowS3FileIOTest, SslEnabled) { + auto https = + ConfigureS3Options({{std::string(S3Properties::kEndpoint), "http://localhost:9000"}, + {std::string(S3Properties::kSslEnabled), "true"}}); + ASSERT_THAT(https, IsOk()); + EXPECT_EQ(https->scheme, "https"); + + auto http = ConfigureS3Options( + {{std::string(S3Properties::kEndpoint), "https://localhost:9000"}, + {std::string(S3Properties::kSslEnabled), "false"}}); + ASSERT_THAT(http, IsOk()); + EXPECT_EQ(http->scheme, "http"); +} + +TEST_F(ArrowS3FileIOTest, PathStyleAccess) { + auto virtual_addressing = + ConfigureS3Options({{std::string(S3Properties::kPathStyleAccess), "false"}}); + ASSERT_THAT(virtual_addressing, IsOk()); + EXPECT_TRUE(virtual_addressing->force_virtual_addressing); + + auto path_style = + ConfigureS3Options({{std::string(S3Properties::kPathStyleAccess), "true"}}); + ASSERT_THAT(path_style, IsOk()); + EXPECT_FALSE(path_style->force_virtual_addressing); +} + +TEST_F(ArrowS3FileIOTest, Timeouts) { + auto result = + ConfigureS3Options({{std::string(S3Properties::kConnectTimeoutMs), "5000"}, + {std::string(S3Properties::kSocketTimeoutMs), "10000"}}); + ASSERT_THAT(result, IsOk()); + EXPECT_EQ(result->connect_timeout, 5); + EXPECT_EQ(result->request_timeout, 10); } +#endif } // namespace iceberg::arrow diff --git a/src/iceberg/test/rest_file_io_test.cc b/src/iceberg/test/rest_file_io_test.cc index b1193d9f8..7f41b0b46 100644 --- a/src/iceberg/test/rest_file_io_test.cc +++ b/src/iceberg/test/rest_file_io_test.cc @@ -19,9 +19,14 @@ #include "iceberg/catalog/rest/rest_file_io.h" +#include +#include +#include + #include #include +#include "iceberg/catalog/rest/types.h" #include "iceberg/file_io_registry.h" #include "iceberg/test/matchers.h" @@ -44,6 +49,24 @@ class MockFileIO : public FileIO { Status DeleteFile(const std::string& /*file_location*/) override { return {}; } }; +std::vector captured_storage_credentials; +std::unordered_map captured_file_io_properties; + +class MockCredentialedFileIO : public MockFileIO, public SupportsStorageCredentials { + public: + Status SetStorageCredentials( + const std::vector& credentials) override { + captured_storage_credentials = credentials; + return {}; + } + + const std::vector& credentials() const override { + return captured_storage_credentials; + } + + SupportsStorageCredentials* AsSupportsStorageCredentials() override { return this; } +}; + } // namespace TEST(RestFileIOTest, DetectBuiltinKindFromScheme) { @@ -147,4 +170,78 @@ TEST(RestFileIOTest, MakeCatalogFileIOSkipsCheckWhenWarehouseAbsent) { ASSERT_THAT(result, IsOk()); } +TEST(RestFileIOTest, TableFileIOMergesConfigAndCredentials) { + const std::string custom_impl = "com.mycompany.CredentialedFileIO"; + captured_file_io_properties.clear(); + captured_storage_credentials.clear(); + FileIORegistry::Register( + custom_impl, + [](const std::unordered_map& properties) + -> Result> { + captured_file_io_properties = properties; + return std::make_unique(); + }); + + auto result = MakeTableFileIO( + {{"warehouse", "s3://catalog/warehouse"}, + {"catalog-only", "catalog"}, + {"shared", "catalog"}}, + {{"io-impl", custom_impl}, {"table-only", "table"}, {"shared", "table"}}, + {{.prefix = "s3://bucket/table", + .config = {{"shared", "credential"}, {"credential-only", "value"}}}}); + ASSERT_THAT(result, IsOk()); + auto* credentialed = result.value()->AsSupportsStorageCredentials(); + ASSERT_NE(credentialed, nullptr); + + EXPECT_THAT( + captured_file_io_properties, + ::testing::UnorderedElementsAre( + ::testing::Pair("warehouse", "s3://catalog/warehouse"), + ::testing::Pair("catalog-only", "catalog"), + ::testing::Pair("io-impl", custom_impl), ::testing::Pair("table-only", "table"), + ::testing::Pair("shared", "table"))); + ASSERT_EQ(captured_storage_credentials.size(), 1); + EXPECT_EQ(captured_storage_credentials[0].prefix, "s3://bucket/table"); + EXPECT_THAT(captured_storage_credentials[0].config, + ::testing::UnorderedElementsAre(::testing::Pair("credential-only", "value"), + ::testing::Pair("shared", "credential"))); + EXPECT_EQ(credentialed->credentials(), captured_storage_credentials); +} + +TEST(RestFileIOTest, TableImplOverridesWarehouseScheme) { + captured_file_io_properties.clear(); + FileIORegistry::Register( + std::string(FileIORegistry::kArrowS3FileIO), + [](const std::unordered_map& properties) + -> Result> { + captured_file_io_properties = properties; + return std::make_unique(); + }); + + auto result = + MakeTableFileIO({{"warehouse", "/tmp/catalog-warehouse"}}, + {{"io-impl", std::string(FileIORegistry::kArrowS3FileIO)}}, + /*storage_credentials=*/{}); + ASSERT_THAT(result, IsOk()); + EXPECT_THAT( + captured_file_io_properties, + ::testing::UnorderedElementsAre( + ::testing::Pair("warehouse", "/tmp/catalog-warehouse"), + ::testing::Pair("io-impl", std::string(FileIORegistry::kArrowS3FileIO)))); +} + +TEST(RestFileIOTest, TableFileIORejectsCredentials) { + const std::string custom_impl = "com.mycompany.PlainFileIO"; + FileIORegistry::Register( + custom_impl, + [](const std::unordered_map& /*properties*/) + -> Result> { return std::make_unique(); }); + + auto result = MakeTableFileIO( + {{"warehouse", "s3://catalog/warehouse"}}, {{"io-impl", custom_impl}}, + {{.prefix = "s3://bucket/table", .config = {{"k", "v"}}}}); + EXPECT_THAT(result, IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(result, HasErrorMessage("does not support vended storage credentials")); +} + } // namespace iceberg::rest diff --git a/src/iceberg/test/rest_json_serde_test.cc b/src/iceberg/test/rest_json_serde_test.cc index 50507dd3a..dd9326cb2 100644 --- a/src/iceberg/test/rest_json_serde_test.cc +++ b/src/iceberg/test/rest_json_serde_test.cc @@ -82,6 +82,11 @@ static std::shared_ptr MakeSimpleTableMetadata() { }); } +std::string LoadTableJsonWithCredentials(std::string_view storage_credentials) { + return std::string(R"({"storage-credentials":)") + std::string(storage_credentials) + + R"(,"metadata":{"format-version":2,"table-uuid":"test","location":"s3://test","last-sequence-number":0,"last-column-id":1,"last-updated-ms":0,"schemas":[{"type":"struct","schema-id":1,"fields":[{"id":1,"name":"id","type":"int","required":true}]}],"current-schema-id":1,"partition-specs":[{"spec-id":0,"fields":[]}],"default-spec-id":0,"last-partition-id":0,"sort-orders":[{"order-id":0,"fields":[]}],"default-sort-order-id":0}})"; +} + // Test parameter structure for roundtrip tests template struct JsonRoundTripParam { @@ -122,6 +127,7 @@ template struct JsonInvalidParam { std::string test_name; std::string invalid_json_str; + ErrorKind expected_error_kind = ErrorKind::kJsonParseError; std::string expected_error_message; }; @@ -135,7 +141,7 @@ class JsonInvalidTest : public ::testing::TestWithParam> const auto& param = Base::GetParam(); auto result = FromJson(nlohmann::json::parse(param.invalid_json_str)); - ASSERT_THAT(result, IsError(ErrorKind::kJsonParseError)); + ASSERT_THAT(result, IsError(param.expected_error_kind)); ASSERT_THAT(result, HasErrorMessage(param.expected_error_message)) << result.error().message; } @@ -1116,7 +1122,18 @@ INSTANTIATE_TEST_SUITE_P( .model = {.metadata_location = "s3://bucket/metadata/v1.json", .metadata = MakeSimpleTableMetadata(), .config = {{"warehouse", "s3://bucket/warehouse"}, - {"foo", "bar"}}}}), + {"foo", "bar"}}}}, + LoadTableResultParam{ + .test_name = "WithCredentials", + .expected_json_str = + R"({"metadata":{"current-schema-id":1,"current-snapshot-id":null,"default-sort-order-id":0,"default-spec-id":0,"format-version":2,"last-column-id":1,"last-partition-id":0,"last-sequence-number":0,"last-updated-ms":0,"location":"s3://bucket/test","metadata-log":[],"partition-specs":[{"fields":[],"spec-id":0}],"partition-statistics":[],"properties":{},"refs":{},"schemas":[{"fields":[{"id":1,"name":"id","required":true,"type":"int"}],"schema-id":1,"type":"struct"}],"snapshot-log":[],"snapshots":[],"sort-orders":[{"fields":[],"order-id":0}],"statistics":[],"table-uuid":"test-uuid-1234"},"storage-credentials":[{"config":{"client.region":"us-east-1","s3.access-key-id":"AKIAtest","s3.secret-access-key":"secret","s3.session-token":"token"},"prefix":"s3"}]})", + .model = + {.metadata = MakeSimpleTableMetadata(), + .storage_credentials = {{.prefix = "s3", + .config = {{"s3.access-key-id", "AKIAtest"}, + {"s3.secret-access-key", "secret"}, + {"s3.session-token", "token"}, + {"client.region", "us-east-1"}}}}}}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); @@ -1184,7 +1201,30 @@ INSTANTIATE_TEST_SUITE_P( LoadTableResultInvalidParam{ .test_name = "InvalidMetadataContent", .invalid_json_str = R"({"metadata":{"format-version":"invalid"}})", - .expected_error_message = "type must be number, but is string"}), + .expected_error_message = "type must be number, but is string"}, + LoadTableResultInvalidParam{ + .test_name = "CredentialsNotArray", + .invalid_json_str = LoadTableJsonWithCredentials(R"("oops")"), + .expected_error_message = "Cannot parse storage credentials from non-array"}, + LoadTableResultInvalidParam{ + .test_name = "CredentialMissingPrefix", + .invalid_json_str = LoadTableJsonWithCredentials(R"([{"config":{"k":"v"}}])"), + .expected_error_message = "Missing 'prefix'"}, + LoadTableResultInvalidParam{ + .test_name = "CredentialMissingConfig", + .invalid_json_str = LoadTableJsonWithCredentials(R"([{"prefix":"s3"}])"), + .expected_error_message = "Missing 'config'"}, + LoadTableResultInvalidParam{.test_name = "CredentialEmptyPrefix", + .invalid_json_str = LoadTableJsonWithCredentials( + R"([{"prefix":"","config":{"k":"v"}}])"), + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_message = "prefix must be non-empty"}, + LoadTableResultInvalidParam{ + .test_name = "CredentialEmptyConfig", + .invalid_json_str = + LoadTableJsonWithCredentials(R"([{"prefix":"s3","config":{}}])"), + .expected_error_kind = ErrorKind::kValidationFailed, + .expected_error_message = "config must be non-empty"}), [](const ::testing::TestParamInfo& info) { return info.param.test_name; }); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 784b3e03b..870badba0 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -201,6 +201,7 @@ class PartitionSummary; /// \brief File I/O. struct ReaderOptions; struct WriterOptions; +struct StorageCredential; class FileIO; class Reader; class Writer; From e516a756b7f0d34079fca0dc14f8f1bea96f76c2 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Sun, 28 Jun 2026 03:41:36 +0200 Subject: [PATCH 130/151] fix: invalidate table scan schema cache (#758) ## Summary - invalidate the cached scan snapshot schema whenever snapshot/ref/time-travel state changes - preserve requested column-stat names and re-resolve them during Build so stats IDs match the final snapshot schema - add regression coverage for IncludeColumnStats before UseSnapshot and non-main UseRef with an evolved schema ## Tests - cmake --build build --target scan_test - ctest --test-dir build -R scan_test --output-on-failure --- src/iceberg/table_scan.cc | 37 +++++++++++++------- src/iceberg/table_scan.h | 2 ++ src/iceberg/test/table_scan_test.cc | 54 +++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 12 deletions(-) diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index fb4fbf3c5..1e87b03e7 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -239,6 +239,8 @@ TableScanBuilder& TableScanBuilder::CaseSensitive( template TableScanBuilder& TableScanBuilder::IncludeColumnStats() { context_.return_column_stats = true; + context_.columns_to_keep_stats.clear(); + requested_column_stats_.reset(); return *this; } @@ -246,17 +248,7 @@ template TableScanBuilder& TableScanBuilder::IncludeColumnStats( const std::vector& requested_columns) { context_.return_column_stats = true; - context_.columns_to_keep_stats.clear(); - context_.columns_to_keep_stats.reserve(requested_columns.size()); - - ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto schema_ref, ResolveSnapshotSchema()); - const auto& schema = schema_ref.get(); - for (const auto& column_name : requested_columns) { - ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto field, schema->FindFieldByName(column_name)); - if (field.has_value()) { - context_.columns_to_keep_stats.insert(field.value().get().field_id()); - } - } + requested_column_stats_ = requested_columns; return *this; } @@ -307,7 +299,6 @@ TableScanBuilder& TableScanBuilder::UseSnapshot(int64_t snap template TableScanBuilder& TableScanBuilder::UseRef(const std::string& ref) { if (ref == SnapshotRef::kMainBranch) { - snapshot_schema_ = nullptr; context_.snapshot_id.reset(); return *this; } @@ -396,6 +387,27 @@ TableScanBuilder& TableScanBuilder::UseBranch( return *this; } +template +Status TableScanBuilder::ResolveColumnStatsSelection() { + if (!requested_column_stats_.has_value()) { + return {}; + } + + context_.columns_to_keep_stats.clear(); + context_.columns_to_keep_stats.reserve(requested_column_stats_->size()); + + ICEBERG_ASSIGN_OR_RAISE(auto schema_ref, ResolveSnapshotSchema()); + const auto& schema = schema_ref.get(); + for (const auto& column_name : *requested_column_stats_) { + ICEBERG_ASSIGN_OR_RAISE(auto field, schema->FindFieldByName(column_name)); + if (field.has_value()) { + context_.columns_to_keep_stats.insert(field.value().get().field_id()); + } + } + + return {}; +} + template Result>> TableScanBuilder::ResolveSnapshotSchema() { @@ -416,6 +428,7 @@ TableScanBuilder::ResolveSnapshotSchema() { template Result> TableScanBuilder::Build() { ICEBERG_RETURN_UNEXPECTED(CheckErrors()); + ICEBERG_RETURN_UNEXPECTED(ResolveColumnStatsSelection()); ICEBERG_RETURN_UNEXPECTED(context_.Validate()); ICEBERG_ASSIGN_OR_RAISE(auto schema, ResolveSnapshotSchema()); diff --git a/src/iceberg/table_scan.h b/src/iceberg/table_scan.h index 3e4f14d55..e55330f30 100644 --- a/src/iceberg/table_scan.h +++ b/src/iceberg/table_scan.h @@ -392,11 +392,13 @@ class ICEBERG_TEMPLATE_CLASS_EXPORT TableScanBuilder : public ErrorCollector { // Return the schema bound to the specified snapshot. Result>> ResolveSnapshotSchema(); + Status ResolveColumnStatsSelection(); std::shared_ptr metadata_; std::shared_ptr io_; internal::TableScanContext context_; std::shared_ptr snapshot_schema_; + std::optional> requested_column_stats_; }; /// \brief Represents a configured scan operation on a table. diff --git a/src/iceberg/test/table_scan_test.cc b/src/iceberg/test/table_scan_test.cc index 34591a438..fea153230 100644 --- a/src/iceberg/test/table_scan_test.cc +++ b/src/iceberg/test/table_scan_test.cc @@ -231,6 +231,60 @@ TEST_P(TableScanTest, UseRefPreservesInt64SnapshotIds) { EXPECT_EQ(snapshot->snapshot_id, kLargeSnapshotId); } +TEST_P(TableScanTest, IncludeColumnStatsUsesFinalSnapshotSchema) { + constexpr int64_t kBaseSnapshotId = 1000L; + constexpr int64_t kEvolvedSnapshotId = 2000L; + constexpr int32_t kBaseIdFieldId = 1; + constexpr int32_t kEvolvedIdFieldId = 10; + constexpr int32_t kEvolvedDataFieldId = 11; + constexpr int32_t kEvolvedSchemaId = 1; + + auto evolved_schema = std::make_shared( + std::vector{ + SchemaField::MakeRequired(kEvolvedIdFieldId, "id", int32()), + SchemaField::MakeRequired(kEvolvedDataFieldId, "data", string())}, + kEvolvedSchemaId); + table_metadata_->schemas.push_back(evolved_schema); + table_metadata_->last_column_id = kEvolvedDataFieldId; + table_metadata_->snapshots.push_back(std::make_shared( + Snapshot{.snapshot_id = kEvolvedSnapshotId, + .parent_snapshot_id = kBaseSnapshotId, + .sequence_number = 2L, + .timestamp_ms = TimePointMsFromUnixMs(1609459201000L), + .manifest_list = "/tmp/metadata/snap-2000-2-manifest-list.avro", + .schema_id = evolved_schema->schema_id()})); + table_metadata_->refs["evolved-branch"] = std::make_shared( + SnapshotRef{.snapshot_id = kEvolvedSnapshotId, .retention = SnapshotRef::Branch{}}); + + { + ICEBERG_UNWRAP_OR_FAIL(auto builder, + DataTableScanBuilder::Make(table_metadata_, file_io_)); + builder->IncludeColumnStats({"id"}).UseSnapshot(kEvolvedSnapshotId); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto scan_schema, scan->schema()); + + EXPECT_EQ(scan_schema->schema_id(), evolved_schema->schema_id()); + const auto& stats_fields = scan->context().columns_to_keep_stats; + EXPECT_EQ(stats_fields.size(), 1); + EXPECT_TRUE(stats_fields.contains(kEvolvedIdFieldId)); + EXPECT_FALSE(stats_fields.contains(kBaseIdFieldId)); + } + + { + ICEBERG_UNWRAP_OR_FAIL(auto builder, + DataTableScanBuilder::Make(table_metadata_, file_io_)); + builder->IncludeColumnStats({"id"}).UseRef("evolved-branch"); + ICEBERG_UNWRAP_OR_FAIL(auto scan, builder->Build()); + ICEBERG_UNWRAP_OR_FAIL(auto scan_schema, scan->schema()); + + EXPECT_EQ(scan_schema->schema_id(), evolved_schema->schema_id()); + const auto& stats_fields = scan->context().columns_to_keep_stats; + EXPECT_EQ(stats_fields.size(), 1); + EXPECT_TRUE(stats_fields.contains(kEvolvedIdFieldId)); + EXPECT_FALSE(stats_fields.contains(kBaseIdFieldId)); + } +} + TEST_P(TableScanTest, TableScanBuilderValidationErrors) { // Test negative min rows ICEBERG_UNWRAP_OR_FAIL(auto builder, From dd0db173449d5fbe5018ab6c8a3d5c777ffe29fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:27:12 +0800 Subject: [PATCH 131/151] chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 (#789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
Release notes

Sourced from actions/checkout's releases.

v7.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v6.0.3...v7.0.0

Changelog

Sourced from actions/checkout's changelog.

Changelog

v7.0.0

v6.0.3

v6.0.2

v6.0.1

v6.0.0

v5.0.1

v5.0.0

v4.3.1

v4.3.0

v4.2.2

v4.2.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=6.0.3&new-version=7.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/asf-allowlist-check.yml | 2 +- .github/workflows/aws_test.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/cpp-linter.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/license_check.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/rc.yml | 6 +++--- .github/workflows/sanitizer_test.yml | 2 +- .github/workflows/sql_catalog_test.yml | 2 +- .github/workflows/test.yml | 8 ++++---- .github/workflows/zizmor.yml | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 0c10af655..6a435c074 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -38,7 +38,7 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-slim steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main diff --git a/.github/workflows/aws_test.yml b/.github/workflows/aws_test.yml index 47c54241d..cb486034b 100644 --- a/.github/workflows/aws_test.yml +++ b/.github/workflows/aws_test.yml @@ -78,7 +78,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install dependencies on Ubuntu @@ -154,7 +154,7 @@ jobs: with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install build dependencies diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ae771aea4..0060e8ffc 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index ed2a7bac7..304d1a58b 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -50,7 +50,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e13cab7d1..729d574c5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-slim steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 1 persist-credentials: false diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index ea037f1a3..06af57e14 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-slim steps: - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Check license header diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 413eee866..417f1d5dd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -37,7 +37,7 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-slim steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 6fcdb3342..9f2559a71 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -35,7 +35,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false @@ -87,7 +87,7 @@ jobs: CXX: g++-14 steps: - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false @@ -135,7 +135,7 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false diff --git a/.github/workflows/sanitizer_test.yml b/.github/workflows/sanitizer_test.yml index 0910b9215..48eb57846 100644 --- a/.github/workflows/sanitizer_test.yml +++ b/.github/workflows/sanitizer_test.yml @@ -44,7 +44,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install dependencies diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index 768299889..3227e93eb 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -66,7 +66,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Set up MSVC Developer Command Prompt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e63101194..4c68ebd0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install dependencies @@ -98,7 +98,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Restore sccache cache @@ -137,7 +137,7 @@ jobs: SCCACHE_CACHE_SIZE: "2G" steps: - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Set up MSVC Developer Command Prompt @@ -210,7 +210,7 @@ jobs: with: python-version: '3.x' - name: Checkout iceberg-cpp - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - name: Install build dependencies diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 388431627..00939d3a0 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -40,7 +40,7 @@ jobs: permissions: {} steps: - name: Checkout repository - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From b65352a095dcfe35d82d4d849fcbababc7afcc14 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Sun, 28 Jun 2026 22:29:41 -0500 Subject: [PATCH 132/151] build: silence benign MSVC C4251/C4275 dll-interface warnings (#768) ## What Add `/wd4251` and `/wd4275` in `meson.build`, applied only where the compiler accepts them. ## Why The MSVC build prints tens of thousands of lines of C4251/C4275 warnings about exported classes (like `TableProperties` and `ConfigBase`/`Entry`) that hold standard-library members. These are harmless when everything is built as one DLL with one compiler, but they bury the warnings that actually matter in the Windows logs. The flags are ignored on GCC and Clang, which don't have these warnings. For reference, the average Meson Windows build logs ~22k of these warning lines (971 unique messages), drowning the handful of real warnings in the same run: https://github.com/apache/iceberg-cpp/actions/runs/27870777076/job/82482181520 Co-authored-by: Abanoub Doss --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 46446cd8d..199ac1fe9 100644 --- a/meson.build +++ b/meson.build @@ -31,7 +31,9 @@ project( ) cpp = meson.get_compiler('cpp') -args = cpp.get_supported_arguments(['/bigobj']) +# Hide two noisy MSVC warnings (C4251/C4275) about standard-library types used in +# our public classes. They're harmless because the whole library ships as one DLL. +args = cpp.get_supported_arguments(['/bigobj', '/wd4251', '/wd4275']) add_project_arguments(args, language: 'cpp') subdir('src') From 10c08b27bd58ce9f6956a9c8f87e07a7a8360fa6 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Sun, 28 Jun 2026 22:42:47 -0500 Subject: [PATCH 133/151] ci: key Windows sccache cache on MSVC version (#787) ## What Add the `cl.exe` version to the Windows sccache cache key (and its restore-keys prefix) in `test` and `sql_catalog_test`, so each MSVC build keeps its own cache. On the `sql_catalog_test` matrix the suffix stays empty for the non-Windows legs, so their keys don't change. ## Why sccache decides whether a cached object is still valid from the compiler binary. GitHub patches the Windows runner image regularly, roughly once a week, and rolls each update out across the hosted fleet over a few days rather than all at once. During that window back-to-back runs can land on different `cl.exe` builds. When that happens the two builds share one cache key and keep evicting each other, and a run on a newer compiler restores the old cache, misses everything, and rebuilds the whole stack (around 35 to 50 minutes). Putting the `cl.exe` version in the key gives each compiler its own cache, so a run stays warm instead of recompiling. ## Validation On the `windows-2025` runner the resolve step read `cl.exe` as 19.51.36248, and the Windows `test` and `sql_catalog_test` builds passed with the version in the key. The cache is only saved on `main`, so the warm reuse shows up there rather than on a branch run. Co-authored-by: Abanoub Doss --- .github/workflows/sql_catalog_test.yml | 26 +++++++++++++++++++++++--- .github/workflows/test.yml | 24 +++++++++++++++++++++--- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index 3227e93eb..905b4a06c 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -74,6 +74,26 @@ jobs: uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: arch: x64 + # GitHub patches the Windows image roughly weekly via gradual rollouts, so + # back-to-back runs can hit different cl.exe builds. sccache keys on the compiler, + # so a shared key would miss after each bump; the version keeps caches separate. + # Non-Windows legs get an empty suffix, leaving their keys unchanged. + - name: Resolve MSVC version for sccache key + if: ${{ startsWith(matrix.runs-on, 'windows') }} + shell: pwsh + run: | + $PSNativeCommandUseErrorActionPreference = $false + $banner = (cl.exe 2>&1 | Out-String) + if ($banner -match 'Version ([\d.]+)') { + $suffix = "-$($Matches[1])" + } else { + # The key is only a cache hint, so degrade to a shared bucket rather than + # fail the build; the warning flags that the parse needs fixing. + $suffix = '-unknown' + Write-Host "::warning::could not parse cl.exe version for sccache key, using '$suffix'; banner was: $banner" + } + Add-Content -Path $env:GITHUB_ENV -Value "SCCACHE_KEY_SUFFIX=$suffix" + Write-Host "SCCACHE_KEY_SUFFIX=$suffix" - name: Install dependencies on Ubuntu if: ${{ startsWith(matrix.runs-on, 'ubuntu') }} shell: bash @@ -99,9 +119,9 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}/.sccache - key: sccache-sqlcatalog-${{ matrix.runs-on }}-${{ github.run_id }} + key: sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}-${{ github.run_id }} restore-keys: | - sccache-sqlcatalog-${{ matrix.runs-on }}- + sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}- - name: Setup sccache uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Configure Iceberg @@ -129,7 +149,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}/.sccache - key: sccache-sqlcatalog-${{ matrix.runs-on }}-${{ github.run_id }} + key: sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}-${{ github.run_id }} - name: Run SQL catalog tests shell: bash run: ctest --test-dir build -R '^sql_catalog_test$' --output-on-failure -C ${{ matrix.cmake_build_type }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c68ebd0b..23fcc2d1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -144,6 +144,24 @@ jobs: uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: arch: x64 + # GitHub patches the Windows image roughly weekly via gradual rollouts, so + # back-to-back runs can hit different cl.exe builds. sccache keys on the compiler, + # so a shared key would miss after each bump; the version keeps caches separate. + - name: Resolve MSVC version for sccache key + shell: pwsh + run: | + $PSNativeCommandUseErrorActionPreference = $false + $banner = (cl.exe 2>&1 | Out-String) + if ($banner -match 'Version ([\d.]+)') { + $msvc = $Matches[1] + } else { + # The key is only a cache hint, so degrade to a shared bucket rather than + # fail the build; the warning flags that the parse needs fixing. + $msvc = 'unknown' + Write-Host "::warning::could not parse cl.exe version for sccache key, using '$msvc'; banner was: $banner" + } + Add-Content -Path $env:GITHUB_ENV -Value "MSVC_VER=$msvc" + Write-Host "Resolved MSVC_VER=$msvc" - name: Cache vcpkg packages uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: vcpkg-cache @@ -159,9 +177,9 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}/.sccache - key: sccache-test-windows-${{ github.run_id }} + key: sccache-test-windows-${{ env.MSVC_VER }}-${{ github.run_id }} restore-keys: | - sccache-test-windows- + sccache-test-windows-${{ env.MSVC_VER }}- - name: Setup sccache uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Build Iceberg @@ -176,7 +194,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}/.sccache - key: sccache-test-windows-${{ github.run_id }} + key: sccache-test-windows-${{ env.MSVC_VER }}-${{ github.run_id }} - name: Build Example shell: pwsh run: | From 3664d998d07b938fe4144a795a9a5024615adfb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 13:45:24 +0800 Subject: [PATCH 134/151] chore(deps): bump zizmorcore/zizmor-action from 0.5.6 to 0.5.7 (#788) Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.6 to 0.5.7.
Release notes

Sourced from zizmorcore/zizmor-action's releases.

v0.5.7

1.26.1 is now available via the action 1.26.1 is now the default version of zizmor used by the action

Commits
  • 192e21d Sync zizmor versions (#127)
  • 2720f26 Update README.md with new actions/checkout version (#126)
  • 40b41b8 chore(deps): bump the github-actions group with 2 updates (#123)
  • a687b25 chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 in the github-ac...
  • 64a6900 add note to explain that the default value for online-checks is different t...
  • 14050ab chore(deps): bump the github-actions group with 2 updates (#118)
  • ee9b419 chore(deps): bump github/codeql-action in the github-actions group (#116)
  • fddf2b4 Bump pins in README (#115)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zizmorcore/zizmor-action&package-manager=github_actions&previous-version=0.5.6&new-version=0.5.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gang Wu --- .github/workflows/asf-allowlist-check.yml | 2 +- .github/workflows/zizmor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/asf-allowlist-check.yml b/.github/workflows/asf-allowlist-check.yml index 6a435c074..a2a36d4bb 100644 --- a/.github/workflows/asf-allowlist-check.yml +++ b/.github/workflows/asf-allowlist-check.yml @@ -41,4 +41,4 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main + - uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 00939d3a0..9b57dad34 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -45,7 +45,7 @@ jobs: persist-credentials: false - name: Run zizmor 🌈 - uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 + uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 with: advanced-security: false min-severity: medium From 881b3b517c5aa985ec202a61e94db7a79dbe1a90 Mon Sep 17 00:00:00 2001 From: Xin Huang <42597328+huan233usc@users.noreply.github.com> Date: Mon, 29 Jun 2026 00:07:45 -0700 Subject: [PATCH 135/151] feat: represent, serialize and validate v3 column default values (#746) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 1 of a multi-part split of #730 (column default values, item 2 of #637). The full end-to-end implementation is in #731, kept open as the proof-of-concept; this series lands it in reviewable pieces. This PR is the **schema foundation** — representing, serializing and validating v3 column default values. It is purely additive and changes no read or write behavior on its own. ## What's in this PR - **`SchemaField`** carries `initial-default` / `write-default`, stored as `std::shared_ptr` (immutable payload shared across copies, like the adjacent `type_`; the C++ analog of Java's `final Literal`). They are set via the constructor. Getters return `std::optional>` for reading (the `Schema::FindFieldByName` idiom); `initial_default_ptr()` / `write_default_ptr()` expose the shared pointer so a rebuilt field (e.g. ID reassignment) shares the value instead of copying it. - **JSON serde**: parse/write `initial-default` / `write-default` using the existing single-value serialization (all primitive types). - **`Schema::Validate`**: version-gates the `initial-default` to format v3 (`kMinFormatVersionDefaultValues`) — it reinterprets how existing data files are read, so it requires the v3 reader contract. The `write-default` only affects values written going forward and is **not** version-gated (matching Java's `Schema.checkCompatibility`, which gates only the initial default). Both defaults are otherwise validated to be non-null primitive literals matching the field type. - **Generic projection**: a column missing from a data file with an `initial-default` maps to `FieldProjection::Kind::kDefault` carrying the literal (the per-format readers consume this in the follow-up PRs). ## Follow-ups (stacked on this PR) - read path — Parquet (`literal_util` + parquet projection/materialization) - read path — Avro - schema evolution (`UpdateSchema` add/update column defaults) ## Testing Added tests --- src/iceberg/json_serde.cc | 62 ++++++++++++- src/iceberg/schema.cc | 26 +++++- src/iceberg/schema_field.cc | 101 +++++++++++++++++++++- src/iceberg/schema_field.h | 19 +++- src/iceberg/schema_util.cc | 6 +- src/iceberg/test/json_serde_test.cc | 103 ++++++++++++++++++++++ src/iceberg/test/metadata_serde_test.cc | 20 +++++ src/iceberg/test/schema_json_test.cc | 61 ++++++++++++- src/iceberg/test/schema_test.cc | 110 ++++++++++++++++++++++++ src/iceberg/test/schema_util_test.cc | 53 ++++++++++++ src/iceberg/test/temporal_util_test.cc | 25 ++++++ src/iceberg/util/temporal_util.cc | 5 ++ src/iceberg/util/temporal_util.h | 16 ++++ 13 files changed, 593 insertions(+), 14 deletions(-) diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index c9b320ffe..614712f30 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -27,6 +27,8 @@ #include #include "iceberg/constants.h" +#include "iceberg/expression/json_serde_internal.h" +#include "iceberg/expression/literal.h" #include "iceberg/json_serde_internal.h" #include "iceberg/name_mapping.h" #include "iceberg/partition_field.h" @@ -49,6 +51,7 @@ #include "iceberg/util/json_util_internal.h" #include "iceberg/util/macros.h" #include "iceberg/util/string_util.h" +#include "iceberg/util/temporal_util.h" #include "iceberg/util/timepoint.h" namespace iceberg { @@ -324,6 +327,12 @@ Result ToJson(const SchemaField& field) { if (!field.doc().empty()) { json[kDoc] = field.doc(); } + if (field.initial_default() != nullptr) { + ICEBERG_ASSIGN_OR_RAISE(json[kInitialDefault], ToJson(*field.initial_default())); + } + if (field.write_default() != nullptr) { + ICEBERG_ASSIGN_OR_RAISE(json[kWriteDefault], ToJson(*field.write_default())); + } return json; } @@ -337,7 +346,6 @@ Result ToJson(const Type& type) { for (const auto& field : struct_type.fields()) { ICEBERG_ASSIGN_OR_RAISE(auto field_json, ToJson(field)); fields_json.push_back(std::move(field_json)); - // TODO(gangwu): add default values } json[kFields] = fields_json; return json; @@ -628,6 +636,34 @@ Result> TypeFromJson(const nlohmann::json& json) { } } +namespace { + +// The spec's JSON single-value form for `timestamptz` / `timestamptz_ns` default +// values requires a UTC offset. The shared timestamp parser accepts any offset and +// silently normalizes to UTC, which would let C++ accept default metadata that Java +// rejects and then rewrite the offset on serialization. Enforce UTC for these +// defaults at parse time, where the original offset is still visible. +Status ValidateTimestamptzDefaultIsUtc(const Type& type, const nlohmann::json& value) { + const auto type_id = type.type_id(); + if (type_id != TypeId::kTimestampTz && type_id != TypeId::kTimestampTzNs) { + return {}; + } + if (!value.is_string()) { + return JsonParseError("Invalid timestamptz default {} for {}: expected a string", + SafeDumpJson(value), type.ToString()); + } + const auto str = value.get(); + ICEBERG_ASSIGN_OR_RAISE(bool is_utc, TemporalUtils::IsUtcOffset(str)); + if (!is_utc) { + return JsonParseError( + "Invalid timestamptz default '{}' for {}: default values must use a UTC offset", + str, type.ToString()); + } + return {}; +} + +} // namespace + Result> FieldFromJson(const nlohmann::json& json) { ICEBERG_ASSIGN_OR_RAISE( auto type, GetJsonValue(json, kType).and_then(TypeFromJson)); @@ -635,9 +671,31 @@ Result> FieldFromJson(const nlohmann::json& json) { ICEBERG_ASSIGN_OR_RAISE(auto name, GetJsonValue(json, kName)); ICEBERG_ASSIGN_OR_RAISE(auto required, GetJsonValue(json, kRequired)); ICEBERG_ASSIGN_OR_RAISE(auto doc, GetJsonValueOrDefault(json, kDoc)); + ICEBERG_ASSIGN_OR_RAISE(auto initial_default_json, + GetJsonValueOptional(json, kInitialDefault)); + ICEBERG_ASSIGN_OR_RAISE(auto write_default_json, + GetJsonValueOptional(json, kWriteDefault)); + + std::shared_ptr initial_default; + if (initial_default_json.has_value()) { + ICEBERG_RETURN_UNEXPECTED( + ValidateTimestamptzDefaultIsUtc(*type, *initial_default_json)); + ICEBERG_ASSIGN_OR_RAISE(Literal literal, + LiteralFromJson(*initial_default_json, type.get())); + initial_default = std::make_shared(std::move(literal)); + } + std::shared_ptr write_default; + if (write_default_json.has_value()) { + ICEBERG_RETURN_UNEXPECTED( + ValidateTimestamptzDefaultIsUtc(*type, *write_default_json)); + ICEBERG_ASSIGN_OR_RAISE(Literal literal, + LiteralFromJson(*write_default_json, type.get())); + write_default = std::make_shared(std::move(literal)); + } return std::make_unique(field_id, std::move(name), std::move(type), - !required, doc); + !required, doc, std::move(initial_default), + std::move(write_default)); } Result> SchemaFromJson(const nlohmann::json& json) { diff --git a/src/iceberg/schema.cc b/src/iceberg/schema.cc index fcac43c78..24df69103 100644 --- a/src/iceberg/schema.cc +++ b/src/iceberg/schema.cc @@ -116,9 +116,15 @@ std::shared_ptr ReassignTypeIds(const std::shared_ptr& type, SchemaField ReassignField(const SchemaField& field, int32_t new_id, const Schema::GetId& get_id, Schema::IdMap& ids_to_reassigned, Schema::IdMap& ids_to_original) { - return {new_id, std::string(field.name()), + // Reassigning IDs only rewrites the field ID and nested type IDs; share the field's + // (immutable) default values rather than copying them. + return {new_id, + std::string(field.name()), ReassignTypeIds(field.type(), get_id, ids_to_reassigned, ids_to_original), - field.optional(), std::string(field.doc())}; + field.optional(), + std::string(field.doc()), + field.initial_default(), + field.write_default()}; } std::vector ReassignIds(std::vector fields, @@ -447,7 +453,21 @@ Status Schema::Validate(int32_t format_version) const { } } - // TODO(GuoTao.yu): Check default values when they are supported + // Only the initial-default is gated on format version: it changes how existing + // data files are read (rows written before the column existed materialize this + // value), so it requires the v3 reader contract. A write-default only affects + // values written going forward and does not reinterpret existing data. + if (field.initial_default() != nullptr && + format_version < TableMetadata::kMinFormatVersionDefaultValues) { + return InvalidSchema( + "Invalid initial default for {}: non-null default ({}) is not supported " + "until v{}", + field.name(), *field.initial_default(), + TableMetadata::kMinFormatVersionDefaultValues); + } + if (field.initial_default() != nullptr || field.write_default() != nullptr) { + ICEBERG_RETURN_UNEXPECTED(field.Validate()); + } } return {}; diff --git a/src/iceberg/schema_field.cc b/src/iceberg/schema_field.cc index 206915ec2..6c8d10d97 100644 --- a/src/iceberg/schema_field.cc +++ b/src/iceberg/schema_field.cc @@ -21,19 +21,39 @@ #include #include +#include +#include "iceberg/expression/literal.h" #include "iceberg/type.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep +#include "iceberg/util/macros.h" namespace iceberg { +namespace { + +// A null default value is modeled as the absence of a default (matching Java), so it is +// not stored. +std::shared_ptr DropNullDefault(std::shared_ptr value) { + if (value != nullptr && value->IsNull()) { + return nullptr; + } + return value; +} + +} // namespace + SchemaField::SchemaField(int32_t field_id, std::string_view name, - std::shared_ptr type, bool optional, std::string_view doc) + std::shared_ptr type, bool optional, std::string_view doc, + std::shared_ptr initial_default, + std::shared_ptr write_default) : field_id_(field_id), name_(name), type_(std::move(type)), optional_(optional), - doc_(doc) {} + doc_(doc), + initial_default_(DropNullDefault(std::move(initial_default))), + write_default_(DropNullDefault(std::move(write_default))) {} SchemaField SchemaField::MakeOptional(int32_t field_id, std::string_view name, std::shared_ptr type, std::string_view doc) { @@ -55,6 +75,60 @@ bool SchemaField::optional() const { return optional_; } std::string_view SchemaField::doc() const { return doc_; } +const std::shared_ptr& SchemaField::initial_default() const { + return initial_default_; +} + +const std::shared_ptr& SchemaField::write_default() const { + return write_default_; +} + +namespace { + +Status ValidateDefault(const SchemaField& field, const Literal& value, + std::string_view kind) { + // A null default is modeled as absence and dropped at construction, so it never reaches + // here; only the out-of-range cast sentinels need rejecting. + if (value.IsAboveMax() || value.IsBelowMin()) { + return InvalidSchema("Invalid {} value for {}: value is out of range", kind, + field.name()); + } + if (field.type() == nullptr) { + return InvalidSchema("Invalid {} value for {}: field has no type", kind, + field.name()); + } + // The spec requires unknown/variant/geometry/geography columns to default to null, so a + // non-null default on them is invalid (a null default was already dropped as absence). + switch (field.type()->type_id()) { + case TypeId::kUnknown: + case TypeId::kVariant: + case TypeId::kGeometry: + case TypeId::kGeography: + return InvalidSchema("Invalid {} value for {}: type {} cannot have a default value", + kind, field.name(), *field.type()); + default: + break; + } + // Defaults are otherwise only supported on primitive fields. The spec also permits JSON + // single-value defaults for struct/list/map (e.g. an empty struct `{}` whose sub-field + // defaults live in field metadata); that matches the current Java model's gap and is + // left as a follow-up. + if (!field.type()->is_primitive()) { + return InvalidSchema( + "Invalid {} value for {}: default values are only supported for primitive types", + kind, field.name()); + } + // Defaults are stored verbatim (no implicit cast), so a default whose literal type does + // not match the field type is invalid. + if (*value.type() != *field.type()) { + return InvalidSchema("{} of field {} has type {} but expected {}", kind, field.name(), + *value.type(), *field.type()); + } + return {}; +} + +} // namespace + Status SchemaField::Validate() const { if (name_.empty()) [[unlikely]] { return InvalidSchema("SchemaField cannot have empty name"); @@ -62,6 +136,13 @@ Status SchemaField::Validate() const { if (type_ == nullptr) [[unlikely]] { return InvalidSchema("SchemaField cannot have null type"); } + if (initial_default_ != nullptr) { + ICEBERG_RETURN_UNEXPECTED( + ValidateDefault(*this, *initial_default_, "initial-default")); + } + if (write_default_ != nullptr) { + ICEBERG_RETURN_UNEXPECTED(ValidateDefault(*this, *write_default_, "write-default")); + } return {}; } @@ -72,9 +153,23 @@ std::string SchemaField::ToString() const { return result; } +namespace { + +bool DefaultEquals(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) { + if (lhs == nullptr || rhs == nullptr) { + return lhs == rhs; + } + return *lhs == *rhs; +} + +} // namespace + bool SchemaField::Equals(const SchemaField& other) const { return field_id_ == other.field_id_ && name_ == other.name_ && *type_ == *other.type_ && - optional_ == other.optional_; + optional_ == other.optional_ && + DefaultEquals(initial_default_, other.initial_default_) && + DefaultEquals(write_default_, other.write_default_); } } // namespace iceberg diff --git a/src/iceberg/schema_field.h b/src/iceberg/schema_field.h index fd20226a5..8066a6406 100644 --- a/src/iceberg/schema_field.h +++ b/src/iceberg/schema_field.h @@ -46,8 +46,14 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable { /// \param[in] type The field type. /// \param[in] optional Whether values of this field are required or nullable. /// \param[in] doc Optional documentation string for the field. + /// \param[in] initial_default The v3 `initial-default` value, or null if absent. The + /// field shares ownership of the (immutable) value. + /// \param[in] write_default The v3 `write-default` value, or null if absent. The field + /// shares ownership of the (immutable) value. SchemaField(int32_t field_id, std::string_view name, std::shared_ptr type, - bool optional, std::string_view doc = {}); + bool optional, std::string_view doc = {}, + std::shared_ptr initial_default = nullptr, + std::shared_ptr write_default = nullptr); /// \brief Construct an optional (nullable) field. static SchemaField MakeOptional(int32_t field_id, std::string_view name, @@ -71,6 +77,14 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable { /// \brief Get the field documentation. std::string_view doc() const; + /// \brief Get the owning pointer to the default value for this field used when reading + /// rows written before the field existed (v3 `initial-default`), or null if absent. + const std::shared_ptr& initial_default() const; + + /// \brief Get the owning pointer to the default value for this field used when a writer + /// does not supply a value (v3 `write-default`), or null if absent. + const std::shared_ptr& write_default() const; + [[nodiscard]] std::string ToString() const override; Status Validate() const; @@ -100,6 +114,9 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable { std::shared_ptr type_; bool optional_; std::string doc_; + // Immutable default values, shared (not deep-copied) across field copies, like `type_`. + std::shared_ptr initial_default_; + std::shared_ptr write_default_; }; } // namespace iceberg diff --git a/src/iceberg/schema_util.cc b/src/iceberg/schema_util.cc index 4ff678fc6..b9f32346a 100644 --- a/src/iceberg/schema_util.cc +++ b/src/iceberg/schema_util.cc @@ -172,10 +172,14 @@ Result ProjectNested(const Type& expected_type, const Type& sou iter->second.local_index, prune_source)); } else if (MetadataColumns::IsMetadataColumn(field_id)) { child_projection.kind = FieldProjection::Kind::kMetadata; + } else if (expected_field.initial_default() != nullptr) { + // Rows written before the field existed assume its `initial-default` value. + child_projection.kind = FieldProjection::Kind::kDefault; + child_projection.from = *expected_field.initial_default(); } else if (expected_field.optional()) { child_projection.kind = FieldProjection::Kind::kNull; } else { - // TODO(gangwu): support default value for v3 and constant value + // TODO(gangwu): support constant value return InvalidSchema("Missing required field: {}", expected_field.ToString()); } result.children.emplace_back(std::move(child_projection)); diff --git a/src/iceberg/test/json_serde_test.cc b/src/iceberg/test/json_serde_test.cc index 562471608..c97ed64a6 100644 --- a/src/iceberg/test/json_serde_test.cc +++ b/src/iceberg/test/json_serde_test.cc @@ -23,10 +23,12 @@ #include #include +#include "iceberg/expression/literal.h" #include "iceberg/json_serde_internal.h" #include "iceberg/name_mapping.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" +#include "iceberg/schema_field.h" #include "iceberg/snapshot.h" #include "iceberg/sort_field.h" #include "iceberg/sort_order.h" @@ -35,10 +37,12 @@ #include "iceberg/table_update.h" #include "iceberg/test/matchers.h" #include "iceberg/transform.h" +#include "iceberg/type.h" #include "iceberg/util/base64.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep #include "iceberg/util/macros.h" // IWYU pragma: keep #include "iceberg/util/timepoint.h" +#include "iceberg/util/uuid.h" namespace iceberg { @@ -72,6 +76,11 @@ Result> FromJsonHelper(const nlohmann::json& json) return NameMappingFromJson(json); } +template <> +Result> FromJsonHelper(const nlohmann::json& json) { + return FieldFromJson(json); +} + // Helper function to reduce duplication in testing template void TestJsonConversion(const T& obj, const nlohmann::json& expected_json) { @@ -84,8 +93,102 @@ void TestJsonConversion(const T& obj, const nlohmann::json& expected_json) { EXPECT_EQ(obj, *obj_ex.value()) << "Deserialized object mismatch."; } +// ToJson(SchemaField) returns Result, so it cannot use the shared +// TestJsonConversion helper. Unwrap the serialized json before comparing and +// round-tripping. +void TestSchemaFieldJsonConversion(const SchemaField& field, + const nlohmann::json& expected_json) { + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(field)); + EXPECT_EQ(expected_json, json) << "JSON conversion mismatch."; + + auto obj_ex = FieldFromJson(expected_json); + EXPECT_TRUE(obj_ex.has_value()) << "Failed to deserialize JSON."; + EXPECT_EQ(field, *obj_ex.value()) << "Deserialized object mismatch."; +} + } // namespace +// Pins the wire format produced by ToJson(SchemaField) / FieldFromJson for +// `initial-default` and `write-default`, including the absence of the keys when a +// field carries no defaults. +TEST(JsonInternalTest, SchemaFieldDefaultValues) { + // Both defaults present. + SchemaField with_both(/*field_id=*/1, "id", int32(), /*optional=*/false, /*doc=*/{}, + std::make_shared(Literal::Int(42)), + std::make_shared(Literal::Int(7))); + TestSchemaFieldJsonConversion( + with_both, + R"({"id":1,"name":"id","required":true,"type":"int","initial-default":42,"write-default":7})"_json); + + // Only an initial-default; write-default must not appear in the JSON. + SchemaField initial_only(/*field_id=*/2, "name", string(), /*optional=*/true, + /*doc=*/{}, + std::make_shared(Literal::String("n/a")), + /*write_default=*/nullptr); + TestSchemaFieldJsonConversion( + initial_only, + R"({"id":2,"name":"name","required":false,"type":"string","initial-default":"n/a"})"_json); + + // No defaults; neither key may appear. + SchemaField no_defaults(/*field_id=*/3, "plain", int32(), /*optional=*/false); + TestSchemaFieldJsonConversion( + no_defaults, R"({"id":3,"name":"plain","required":true,"type":"int"})"_json); +} + +// Round-trips a field carrying both defaults through ToJson -> FieldFromJson for +// every primitive type, exercising the per-type single-value serialization the +// default path reuses (date/timestamp/decimal/uuid/binary have non-trivial wire +// encodings). +TEST(JsonInternalTest, SchemaFieldDefaultValuesRoundTripAllTypes) { + ICEBERG_UNWRAP_OR_FAIL(auto uuid_value, + Uuid::FromString("f79c3e09-677c-4bbd-a479-3f349cb785e7")); + std::vector, Literal>> cases; + cases.emplace_back(boolean(), Literal::Boolean(true)); + cases.emplace_back(int32(), Literal::Int(-7)); + cases.emplace_back(int64(), Literal::Long(1234567890123LL)); + cases.emplace_back(float32(), Literal::Float(1.5f)); + cases.emplace_back(float64(), Literal::Double(2.5)); + cases.emplace_back(date(), Literal::Date(19738)); + cases.emplace_back(time(), Literal::Time(43200000000LL)); + cases.emplace_back(timestamp(), Literal::Timestamp(1719446400000000LL)); + cases.emplace_back(timestamp_tz(), Literal::TimestampTz(1719446400000000LL)); + cases.emplace_back(timestamp_ns(), Literal::TimestampNs(1719446400000000123LL)); + cases.emplace_back(timestamptz_ns(), Literal::TimestampTzNs(1719446400000000123LL)); + cases.emplace_back(string(), Literal::String("hello")); + cases.emplace_back(decimal(9, 2), Literal::Decimal(12345, 9, 2)); + cases.emplace_back(fixed(3), Literal::Fixed({0x01, 0x02, 0x03})); + cases.emplace_back(binary(), Literal::Binary({0xDE, 0xAD, 0xBE, 0xEF})); + cases.emplace_back(uuid(), Literal::UUID(uuid_value)); + + int32_t field_id = 1; + for (const auto& [type, literal] : cases) { + SchemaField field(field_id++, "f", type, /*optional=*/false, /*doc=*/{}, + std::make_shared(literal), + std::make_shared(literal)); + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(field)); + ICEBERG_UNWRAP_OR_FAIL(auto parsed, FieldFromJson(json)); + EXPECT_EQ(field, *parsed) << "round-trip mismatch for type " << type->ToString() + << ", json=" << json.dump(); + } +} + +// The spec only permits UTC offsets for timestamptz / timestamptz_ns default values. +// A non-UTC offset (which the shared parser would silently normalize) must be rejected, +// while the UTC form is accepted. +TEST(JsonInternalTest, SchemaFieldRejectsNonUtcTimestamptzDefault) { + auto non_utc = nlohmann::json::parse( + R"({"id":1,"name":"ts","required":true,"type":"timestamptz","initial-default":"2024-06-27T05:00:00+05:00"})"); + EXPECT_FALSE(FieldFromJson(non_utc).has_value()); + + auto non_utc_ns = nlohmann::json::parse( + R"({"id":1,"name":"ts","required":true,"type":"timestamptz_ns","write-default":"2024-06-27T05:00:00-08:00"})"); + EXPECT_FALSE(FieldFromJson(non_utc_ns).has_value()); + + auto utc = nlohmann::json::parse( + R"({"id":1,"name":"ts","required":true,"type":"timestamptz","initial-default":"2024-06-27T00:00:00+00:00"})"); + EXPECT_TRUE(FieldFromJson(utc).has_value()); +} + TEST(JsonInternalTest, SortField) { auto identity_transform = Transform::Identity(); diff --git a/src/iceberg/test/metadata_serde_test.cc b/src/iceberg/test/metadata_serde_test.cc index e214f1606..10529d128 100644 --- a/src/iceberg/test/metadata_serde_test.cc +++ b/src/iceberg/test/metadata_serde_test.cc @@ -23,6 +23,7 @@ #include #include +#include "iceberg/expression/literal.h" #include "iceberg/json_serde_internal.h" #include "iceberg/partition_field.h" #include "iceberg/partition_spec.h" @@ -445,6 +446,25 @@ TEST(MetadataSerdeTest, DeserializePartitionStatisticsFiles) { ASSERT_EQ(*metadata, expected); } +TEST(MetadataSerdeTest, V3DefaultValuesRoundTrip) { + // Full TableMetadata path: a v3 schema field's initial/write defaults parse correctly + // (the v3 gate in Schema::Validate is satisfied) and survive a ToJson/FromJson round + // trip. The fixture's field is `x: long` with initial-default 1 and write-default 1. + ICEBERG_UNWRAP_OR_FAIL( + auto metadata, ReadTableMetadataFromResource("TableMetadataV3ValidMinimal.json")); + auto schema_result = metadata->Schema(); + ASSERT_TRUE(schema_result.has_value()); + const auto& field = schema_result.value()->fields()[0]; + ASSERT_NE(field.initial_default(), nullptr); + EXPECT_EQ(*field.initial_default(), Literal::Long(1)); + ASSERT_NE(field.write_default(), nullptr); + EXPECT_EQ(*field.write_default(), Literal::Long(1)); + + ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(*metadata)); + ICEBERG_UNWRAP_OR_FAIL(auto reparsed, TableMetadataFromJson(json)); + EXPECT_EQ(*reparsed, *metadata); +} + TEST(MetadataSerdeTest, DeserializeUnsupportedVersion) { ReadTableMetadataExpectError("TableMetadataUnsupportedVersion.json", "Cannot read unsupported version"); diff --git a/src/iceberg/test/schema_json_test.cc b/src/iceberg/test/schema_json_test.cc index 944687e7d..c946550cc 100644 --- a/src/iceberg/test/schema_json_test.cc +++ b/src/iceberg/test/schema_json_test.cc @@ -24,6 +24,7 @@ #include #include +#include "iceberg/expression/literal.h" #include "iceberg/json_serde_internal.h" #include "iceberg/schema.h" #include "iceberg/schema_field.h" @@ -194,6 +195,52 @@ TEST(SchemaJsonTest, RoundTrip) { ASSERT_EQ(schema_json.dump(), json); } +TEST(SchemaJsonTest, FieldWithDefaultValuesRoundTrip) { + constexpr std::string_view json = + R"({"fields":[{"id":1,"initial-default":42,"name":"id","required":true,"type":"int","write-default":7},{"id":2,"initial-default":"n/a","name":"name","required":false,"type":"string"}],"schema-id":1,"type":"struct"})"; + + ICEBERG_UNWRAP_OR_FAIL(auto schema, SchemaFromJson(nlohmann::json::parse(json))); + ASSERT_EQ(schema->fields().size(), 2); + + const auto& field1 = schema->fields()[0]; + ASSERT_NE(field1.initial_default(), nullptr); + ASSERT_EQ(*field1.initial_default(), Literal::Int(42)); + ASSERT_NE(field1.write_default(), nullptr); + ASSERT_EQ(*field1.write_default(), Literal::Int(7)); + + const auto& field2 = schema->fields()[1]; + ASSERT_NE(field2.initial_default(), nullptr); + ASSERT_EQ(*field2.initial_default(), Literal::String("n/a")); + ASSERT_EQ(field2.write_default(), nullptr); + + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); + ASSERT_EQ(schema_json.dump(), json); +} + +TEST(SchemaJsonTest, FieldWithMismatchedDefaultValueFails) { + constexpr std::string_view json = + R"({"fields":[{"id":1,"initial-default":"oops","name":"id","required":true,"type":"int"}],"schema-id":1,"type":"struct"})"; + + auto result = SchemaFromJson(nlohmann::json::parse(json)); + ASSERT_FALSE(result.has_value()); +} + +TEST(SchemaJsonTest, NestedFieldWithDefaultValuesRoundTrip) { + constexpr std::string_view json = + R"({"fields":[{"id":1,"name":"person","required":true,"type":{"fields":[{"id":2,"initial-default":18,"name":"age","required":true,"type":"int","write-default":21}],"type":"struct"}}],"schema-id":1,"type":"struct"})"; + + ICEBERG_UNWRAP_OR_FAIL(auto schema, SchemaFromJson(nlohmann::json::parse(json))); + const auto& person = schema->fields()[0]; + const auto& nested = dynamic_cast(*person.type()).fields()[0]; + ASSERT_NE(nested.initial_default(), nullptr); + ASSERT_EQ(*nested.initial_default(), Literal::Int(18)); + ASSERT_NE(nested.write_default(), nullptr); + ASSERT_EQ(*nested.write_default(), Literal::Int(21)); + + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); + ASSERT_EQ(schema_json.dump(), json); +} + TEST(SchemaJsonTest, UnknownFieldRoundTrip) { constexpr std::string_view json = R"({"fields":[{"id":1,"name":"mystery","required":false,"type":"unknown"}],"schema-id":1,"type":"struct"})"; @@ -274,7 +321,8 @@ TEST(SchemaJsonTest, NestedUnknownFieldsRoundTrip) { ASSERT_EQ(properties->value().type()->type_id(), TypeId::kUnknown); ASSERT_TRUE(properties->value().optional()); - ASSERT_EQ(ToJson(*schema), parsed_json); + ICEBERG_UNWRAP_OR_FAIL(auto schema_json, ToJson(*schema)); + ASSERT_EQ(schema_json, parsed_json); } TEST(SchemaJsonTest, IdentifierFieldIds) { @@ -293,7 +341,8 @@ TEST(SchemaJsonTest, IdentifierFieldIds) { ASSERT_EQ(schema_with_identifers->schema_id(), 1); ASSERT_EQ(schema_with_identifers->IdentifierFieldIds().size(), 1); ASSERT_EQ(schema_with_identifers->IdentifierFieldIds()[0], 1); - ASSERT_EQ(ToJson(*schema_with_identifers), json_with_identifiers); + ICEBERG_UNWRAP_OR_FAIL(auto json_with_identifiers_out, ToJson(*schema_with_identifers)); + ASSERT_EQ(json_with_identifiers_out, json_with_identifiers); // Test schema without identifier-field-ids constexpr std::string_view json_without_identifiers_str = @@ -306,7 +355,9 @@ TEST(SchemaJsonTest, IdentifierFieldIds) { ICEBERG_UNWRAP_OR_FAIL(auto schema_without_identifiers, SchemaFromJson(json_without_identifiers)); ASSERT_TRUE(schema_without_identifiers->IdentifierFieldIds().empty()); - ASSERT_EQ(ToJson(*schema_without_identifiers), json_without_identifiers); + ICEBERG_UNWRAP_OR_FAIL(auto json_without_identifiers_out, + ToJson(*schema_without_identifiers)); + ASSERT_EQ(json_without_identifiers_out, json_without_identifiers); // Test schema with multiple identifier fields constexpr std::string_view json_multi_identifiers_str = @@ -322,7 +373,9 @@ TEST(SchemaJsonTest, IdentifierFieldIds) { ASSERT_EQ(schema_multi_identifiers->IdentifierFieldIds().size(), 2); ASSERT_EQ(schema_multi_identifiers->IdentifierFieldIds()[0], 1); ASSERT_EQ(schema_multi_identifiers->IdentifierFieldIds()[1], 2); - ASSERT_EQ(ToJson(*schema_multi_identifiers), json_multi_identifiers); + ICEBERG_UNWRAP_OR_FAIL(auto json_multi_identifiers_out, + ToJson(*schema_multi_identifiers)); + ASSERT_EQ(json_multi_identifiers_out, json_multi_identifiers); } } // namespace iceberg diff --git a/src/iceberg/test/schema_test.cc b/src/iceberg/test/schema_test.cc index db99eb02b..90cfdb13c 100644 --- a/src/iceberg/test/schema_test.cc +++ b/src/iceberg/test/schema_test.cc @@ -25,6 +25,7 @@ #include #include +#include "iceberg/expression/literal.h" #include "iceberg/result.h" #include "iceberg/schema_field.h" #include "iceberg/table_metadata.h" @@ -133,6 +134,115 @@ TEST(SchemaTest, ValidateRejectsV3TypesBeforeFormatV3) { iceberg::IsOk()); } +TEST(SchemaTest, ValidateRejectsInitialDefaultBeforeFormatV3) { + iceberg::Schema schema({iceberg::SchemaField( + 1, "id", iceberg::int32(), false, /*doc=*/{}, + std::make_shared(iceberg::Literal::Int(42)))}); + + auto status = schema.Validate(2); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage("is not supported until v3")); + + EXPECT_THAT(schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsOk()); +} + +TEST(SchemaTest, ValidateDoesNotVersionGateWriteDefault) { + // A write-default does not reinterpret existing data, so it is not gated on + // format version: a write-default alone is accepted below v3. + iceberg::Schema schema({iceberg::SchemaField( + 1, "id", iceberg::int32(), false, /*doc=*/{}, /*initial_default=*/nullptr, + std::make_shared(iceberg::Literal::Int(7)))}); + + EXPECT_THAT(schema.Validate(2), iceberg::IsOk()); +} + +TEST(SchemaTest, ValidateRejectsMismatchedDefaultValue) { + // Defaults are stored verbatim, so a default whose type differs from the field type is + // rejected by Validate. + iceberg::Schema schema({iceberg::SchemaField( + 1, "id", iceberg::int32(), false, /*doc=*/{}, /*initial_default=*/nullptr, + std::make_shared(iceberg::Literal::String("oops")))}); + + auto status = schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage("write-default")); +} + +TEST(SchemaTest, NullDefaultModeledAsAbsence) { + // A present-null default is modeled as the absence of a default (matching Java): it is + // dropped at construction, so the field has no stored default and compares equal to a + // field with no default, and it validates cleanly. + iceberg::SchemaField with_null( + 1, "id", iceberg::int32(), /*optional=*/true, /*doc=*/{}, + std::make_shared(iceberg::Literal::Null(iceberg::int32())), + std::make_shared(iceberg::Literal::Null(iceberg::int32()))); + EXPECT_EQ(with_null.initial_default(), nullptr); + EXPECT_EQ(with_null.write_default(), nullptr); + + iceberg::SchemaField no_default(1, "id", iceberg::int32(), /*optional=*/true); + EXPECT_EQ(with_null, no_default); + + iceberg::Schema schema({with_null}); + EXPECT_THAT(schema.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsOk()); +} + +TEST(SchemaTest, EqualsDistinguishesDefaultValues) { + auto field = [](std::shared_ptr d) { + return iceberg::SchemaField(1, "id", iceberg::int32(), /*optional=*/true, /*doc=*/{}, + std::move(d)); + }; + // Differ only in default value -> unequal; default vs no-default -> unequal. + EXPECT_NE(field(std::make_shared(iceberg::Literal::Int(1))), + field(std::make_shared(iceberg::Literal::Int(2)))); + EXPECT_NE(field(std::make_shared(iceberg::Literal::Int(1))), + field(nullptr)); +} + +TEST(SchemaTest, ValidateRejectsDefaultOnNonPrimitiveAndMustBeNullTypes) { + // A struct (non-primitive) field with a non-null default is rejected. + iceberg::Schema struct_default({iceberg::SchemaField( + 1, "s", + MakeStructType(iceberg::SchemaField(2, "x", iceberg::int32(), /*optional=*/true)), + /*optional=*/true, /*doc=*/{}, + std::make_shared(iceberg::Literal::Int(1)))}); + EXPECT_THAT( + struct_default.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion), + iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + + // unknown/geometry/geography must default to null: a non-null default is rejected. + iceberg::Schema geo_default({iceberg::SchemaField( + 1, "g", iceberg::geometry(), /*optional=*/true, /*doc=*/{}, + std::make_shared(iceberg::Literal::Int(1)))}); + auto status = + geo_default.Validate(iceberg::TableMetadata::kSupportedTableFormatVersion); + ASSERT_THAT(status, iceberg::IsError(iceberg::ErrorKind::kInvalidSchema)); + EXPECT_THAT(status, iceberg::HasErrorMessage("cannot have a default value")); +} + +TEST(SchemaTest, ReassignIdsPreservesDefaultValues) { + // Reassigning field IDs rebuilds each SchemaField, so the rebuild must carry the + // default values over to the field with the new ID. + std::vector fields; + fields.push_back(iceberg::SchemaField( + 1, "id", iceberg::int32(), false, /*doc=*/{}, + std::make_shared(iceberg::Literal::Int(42)), + std::make_shared(iceberg::Literal::Int(7)))); + auto reassign_id = [](int32_t old_id) { return old_id + 1000; }; + + iceberg::Schema schema(std::move(fields), iceberg::Schema::kInitialSchemaId, + reassign_id); + + ASSERT_EQ(schema.fields().size(), 1); + const iceberg::SchemaField& field = schema.fields()[0]; + EXPECT_EQ(field.field_id(), 1001); + ASSERT_NE(field.initial_default(), nullptr); + EXPECT_EQ(*field.initial_default(), iceberg::Literal::Int(42)); + ASSERT_NE(field.write_default(), nullptr); + EXPECT_EQ(*field.write_default(), iceberg::Literal::Int(7)); +} + TEST(SchemaTest, ValidateRejectsInvalidUnknownFields) { iceberg::Schema required_unknown_schema( {iceberg::SchemaField(1, "mystery", iceberg::unknown(), false)}); diff --git a/src/iceberg/test/schema_util_test.cc b/src/iceberg/test/schema_util_test.cc index ee075006f..9a3eff887 100644 --- a/src/iceberg/test/schema_util_test.cc +++ b/src/iceberg/test/schema_util_test.cc @@ -24,6 +24,7 @@ #include #include +#include "iceberg/expression/literal.h" #include "iceberg/metadata_columns.h" #include "iceberg/schema.h" #include "iceberg/schema_field.h" @@ -179,6 +180,58 @@ TEST(SchemaUtilTest, ProjectMissingRequiredField) { ASSERT_THAT(projection_result, HasErrorMessage("Missing required field")); } +TEST(SchemaUtilTest, ProjectMissingRequiredFieldWithInitialDefault) { + Schema source_schema = CreateFlatSchema(); + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "id", iceberg::int64()), + SchemaField(/*field_id=*/10, "extra", iceberg::int32(), /*optional=*/false, + /*doc=*/{}, std::make_shared(Literal::Int(42))), + }); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 2); + AssertProjectedField(projection.fields[0], 0); + ASSERT_EQ(projection.fields[1].kind, FieldProjection::Kind::kDefault); + ASSERT_EQ(std::get(projection.fields[1].from), Literal::Int(42)); +} + +TEST(SchemaUtilTest, ProjectMissingOptionalFieldWithInitialDefault) { + // An optional field with an initial-default reads the default, not null. + Schema source_schema = CreateFlatSchema(); + Schema expected_schema({ + SchemaField::MakeRequired(/*field_id=*/1, "id", iceberg::int64()), + SchemaField(/*field_id=*/10, "extra", iceberg::string(), /*optional=*/true, + /*doc=*/{}, std::make_shared(Literal::String("n/a"))), + }); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + + const auto& projection = *projection_result; + ASSERT_EQ(projection.fields.size(), 2); + ASSERT_EQ(projection.fields[1].kind, FieldProjection::Kind::kDefault); + ASSERT_EQ(std::get(projection.fields[1].from), Literal::String("n/a")); +} + +TEST(SchemaUtilTest, ProjectPresentFieldIgnoresInitialDefault) { + // initial-default only applies when the field is missing from the data file. + Schema source_schema = CreateFlatSchema(); + Schema expected_schema({ + SchemaField(/*field_id=*/1, "id", iceberg::int64(), /*optional=*/false, + /*doc=*/{}, std::make_shared(Literal::Long(-1))), + }); + + auto projection_result = + Project(expected_schema, source_schema, /*prune_source=*/false); + ASSERT_THAT(projection_result, IsOk()); + AssertProjectedField(projection_result->fields[0], 0); +} + TEST(SchemaUtilTest, ProjectMetadataColumn) { Schema source_schema = CreateFlatSchema(); Schema expected_schema({ diff --git a/src/iceberg/test/temporal_util_test.cc b/src/iceberg/test/temporal_util_test.cc index 0d4426b0b..791d02c56 100644 --- a/src/iceberg/test/temporal_util_test.cc +++ b/src/iceberg/test/temporal_util_test.cc @@ -53,6 +53,31 @@ TEST(TemporalUtilTest, ParseTimestampNsChecksInt64Bounds) { IsError(ErrorKind::kInvalidArgument)); } +TEST(TemporalUtilTest, IsUtcOffset) { + // UTC offsets: "Z", "+00:00" and "-00:00". + ICEBERG_UNWRAP_OR_FAIL(auto z, TemporalUtils::IsUtcOffset("2024-06-27T00:00:00Z")); + EXPECT_TRUE(z); + ICEBERG_UNWRAP_OR_FAIL(auto plus_zero, + TemporalUtils::IsUtcOffset("2024-06-27T00:00:00+00:00")); + EXPECT_TRUE(plus_zero); + ICEBERG_UNWRAP_OR_FAIL(auto minus_zero, + TemporalUtils::IsUtcOffset("2024-06-27T00:00:00-00:00")); + EXPECT_TRUE(minus_zero); + + // Non-UTC offsets. + ICEBERG_UNWRAP_OR_FAIL(auto plus_five, + TemporalUtils::IsUtcOffset("2024-06-27T05:00:00+05:00")); + EXPECT_FALSE(plus_five); + ICEBERG_UNWRAP_OR_FAIL(auto minus_eight, + TemporalUtils::IsUtcOffset("2024-06-27T00:00:00-08:00")); + EXPECT_FALSE(minus_eight); + + // A missing or unparseable timezone suffix is an error. + EXPECT_THAT(TemporalUtils::IsUtcOffset("2024-06-27T00:00:00"), + IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(TemporalUtils::IsUtcOffset(""), IsError(ErrorKind::kInvalidArgument)); +} + TEST(TemporalUtilTest, ParseTimestampNsRejectsMoreThanNineFractionalDigits) { EXPECT_THAT(TemporalUtils::ParseTimestampNs("2026-01-01T00:00:01.0000010011"), IsError(ErrorKind::kInvalidArgument)); diff --git a/src/iceberg/util/temporal_util.cc b/src/iceberg/util/temporal_util.cc index e00ee7cf5..9e6a93cfd 100644 --- a/src/iceberg/util/temporal_util.cc +++ b/src/iceberg/util/temporal_util.cc @@ -444,6 +444,11 @@ Result TemporalUtils::ParseTimestampNsWithZone(std::string_view str) { /*units_per_micro=*/internal::kNanosPerMicro); } +Result TemporalUtils::IsUtcOffset(std::string_view str) { + ICEBERG_ASSIGN_OR_RAISE(auto timestamp_with_offset, ParseTimestampWithZoneSuffix(str)); + return timestamp_with_offset.second == 0; +} + #define DISPATCH_EXTRACT_YEAR(type_id) \ case type_id: \ return ExtractYearImpl(literal); diff --git a/src/iceberg/util/temporal_util.h b/src/iceberg/util/temporal_util.h index 2121f565d..acb1f0e73 100644 --- a/src/iceberg/util/temporal_util.h +++ b/src/iceberg/util/temporal_util.h @@ -125,6 +125,22 @@ class ICEBERG_EXPORT TemporalUtils { /// \return The number of nanoseconds since epoch (UTC), or an error. static Result ParseTimestampNsWithZone(std::string_view str); + /// \brief Reports whether a timestamp-with-zone string carries a zero (UTC) offset. + /// + /// The ParseTimestamp*WithZone parsers accept any offset and silently normalize it + /// to UTC. The spec's JSON single-value form for `timestamptz` / `timestamptz_ns` + /// default values is meant to be UTC, so callers that must enforce that rule check + /// the offset here before parsing. + /// + /// Any zero-offset spelling is treated as UTC: "Z", "+00:00" and "-00:00" all denote + /// a zero offset and are accepted, even though the spec writes the canonical form as + /// "+00:00". Only a genuinely non-zero offset (e.g. "+05:00") is rejected. + /// + /// \param str The timestamp-with-zone string to inspect. + /// \return true if the offset is zero, false if it is a non-zero offset, or an error + /// if the timezone suffix cannot be parsed. + static Result IsUtcOffset(std::string_view str); + /// \brief Extract a date or timestamp year, as years from 1970 static Result ExtractYear(const Literal& literal); From 93577b3fe713912b3017e5e3374e89d64c4d0c7a Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Mon, 29 Jun 2026 16:19:58 +0800 Subject: [PATCH 136/151] feat: parallelize writing manifests (#778) --- src/iceberg/avro/avro_writer.cc | 26 +++-- src/iceberg/manifest/manifest_adapter.cc | 2 +- src/iceberg/test/executor_util_test.cc | 53 ++++++++-- src/iceberg/test/fast_append_test.cc | 85 ++++++++++++++++ .../test/merging_snapshot_update_test.cc | 45 +++++++++ src/iceberg/update/snapshot_update.cc | 97 +++++++++++++------ src/iceberg/update/snapshot_update.h | 21 ++++ src/iceberg/util/executor_util_internal.h | 41 +++++--- 8 files changed, 304 insertions(+), 66 deletions(-) diff --git a/src/iceberg/avro/avro_writer.cc b/src/iceberg/avro/avro_writer.cc index 63fc31462..01d8cb3b1 100644 --- a/src/iceberg/avro/avro_writer.cc +++ b/src/iceberg/avro/avro_writer.cc @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -178,12 +179,6 @@ class GenericDatumBackend : public AvroWriteBackend { class AvroWriter::Impl { public: - ~Impl() { - if (arrow_schema_.release != nullptr) { - ArrowSchemaRelease(&arrow_schema_); - } - } - Status Open(const WriterOptions& options) { write_schema_ = options.schema; @@ -227,19 +222,22 @@ class AvroWriter::Impl { options.properties.Get(WriterProperties::kAvroSyncInterval), codec, compression_level, metadata)); - ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*write_schema_, &arrow_schema_)); + ArrowSchema c_schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*write_schema_, &c_schema)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(arrow_schema_, ::arrow::ImportSchema(&c_schema)); return {}; } Status Write(ArrowArray* data) { - ICEBERG_ARROW_ASSIGN_OR_RETURN(auto result, - ::arrow::ImportArray(data, &arrow_schema_)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto batch, + ::arrow::ImportRecordBatch(data, arrow_schema_)); - for (int64_t i = 0; i < result->length(); i++) { - ICEBERG_RETURN_UNEXPECTED(backend_->WriteRow(*write_schema_, *result, i)); + ICEBERG_ARROW_ASSIGN_OR_RETURN(auto struct_array, batch->ToStructArray()); + for (int64_t i = 0; i < struct_array->length(); i++) { + ICEBERG_RETURN_UNEXPECTED(backend_->WriteRow(*write_schema_, *struct_array, i)); } - num_records_ += result->length(); + num_records_ += struct_array->length(); return {}; } @@ -278,8 +276,8 @@ class AvroWriter::Impl { std::shared_ptr<::avro::ValidSchema> avro_schema_; // Arrow output stream of the Avro file to write std::shared_ptr<::arrow::io::OutputStream> arrow_output_stream_; - // Arrow schema to write data. - ArrowSchema arrow_schema_; + // Arrow schema to import C data batches. + std::shared_ptr<::arrow::Schema> arrow_schema_; // Total length of the written Avro file. int64_t total_bytes_ = 0; // Number of records written. diff --git a/src/iceberg/manifest/manifest_adapter.cc b/src/iceberg/manifest/manifest_adapter.cc index b37d82702..526d31271 100644 --- a/src/iceberg/manifest/manifest_adapter.cc +++ b/src/iceberg/manifest/manifest_adapter.cc @@ -126,7 +126,6 @@ Status ManifestAdapter::StartAppending() { return InvalidArgument("Adapter buffer not empty, cannot start appending."); } array_ = {}; - size_ = 0; ArrowError error; ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( ArrowArrayInitFromSchema(&array_, &schema_, &error), error); @@ -138,6 +137,7 @@ Result ManifestAdapter::FinishAppending() { ArrowError error; ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( ArrowArrayFinishBuildingDefault(&array_, &error), error); + size_ = 0; return &array_; } diff --git a/src/iceberg/test/executor_util_test.cc b/src/iceberg/test/executor_util_test.cc index 3bb9ad9fc..3a0ddbff6 100644 --- a/src/iceberg/test/executor_util_test.cc +++ b/src/iceberg/test/executor_util_test.cc @@ -20,8 +20,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -51,19 +53,15 @@ struct IntTask { } }; -struct BoolTask { - Result> operator()(bool) { - return Result>{std::vector{}}; - } -}; - static_assert(internal::ParallelCollectible&, IntTask>); static_assert( std::same_as&>(), IntTask{})), Result>>); -static_assert(!internal::ParallelCollectible); -static_assert(!internal::ParallelCollectible&, BoolTask>); +static_assert(internal::ParallelCollectible); +static_assert(std::same_as>>); } // namespace @@ -139,6 +137,45 @@ TEST(ParallelCollectTest, CollectsSingleRange) { EXPECT_THAT(*result, UnorderedElementsAre(2, 4, 6)); } +TEST(ParallelCollectTest, CollectsIotaView) { + auto input = std::views::iota(1, 4); + + auto result = ParallelCollect(std::nullopt, input, [](int value) { + return Result>{{value * 2}}; + }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(*result, UnorderedElementsAre(2, 4, 6)); +} + +TEST(ParallelCollectTest, CollectsTransformView) { + std::vector values = {1, 2, 3, 4}; + std::span files(values); + auto input = std::views::iota(0, 2) | std::views::transform([files](int index) { + return files.subspan(index * 2, 2); + }); + + auto result = ParallelCollect(std::nullopt, input, [](std::span group) { + return Result>{{group.front(), group.back()}}; + }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(*result, ElementsAre(1, 2, 3, 4)); +} + +TEST(ParallelCollectTest, CollectsMoveOnlyPrvalues) { + auto input = std::views::iota(1, 4) | std::views::transform([](int value) { + return std::make_unique(value); + }); + + auto result = ParallelCollect(std::nullopt, input, [](std::unique_ptr value) { + return Result>{{*value}}; + }); + + EXPECT_THAT(result, IsOk()); + EXPECT_THAT(*result, ElementsAre(1, 2, 3)); +} + TEST(ParallelCollectTest, KeepsTupleResultFromSingleRange) { std::vector input = {1, 2}; diff --git a/src/iceberg/test/fast_append_test.cc b/src/iceberg/test/fast_append_test.cc index 8853d419c..d9e9a7eb5 100644 --- a/src/iceberg/test/fast_append_test.cc +++ b/src/iceberg/test/fast_append_test.cc @@ -20,6 +20,7 @@ #include "iceberg/update/fast_append.h" #include +#include #include #include #include @@ -32,14 +33,18 @@ #include "iceberg/avro/avro_register.h" #include "iceberg/constants.h" #include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" #include "iceberg/manifest/manifest_writer.h" #include "iceberg/partition_spec.h" #include "iceberg/schema.h" #include "iceberg/snapshot.h" #include "iceberg/table_metadata.h" +#include "iceberg/table_properties.h" +#include "iceberg/test/executor.h" #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" #include "iceberg/transaction.h" +#include "iceberg/update/update_properties.h" // IWYU pragma: keep namespace iceberg { @@ -117,6 +122,29 @@ class FastAppendTest : public UpdateTestBase { return writer->ToManifestFile(); } + void SetManifestTargetSizeBytes(int64_t size_bytes) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestTargetSizeBytes.key()), + std::to_string(size_bytes)); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + Result> CurrentDataManifests() { + ICEBERG_ASSIGN_OR_RAISE(auto snapshot, table_->current_snapshot()); + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, snapshot_cache.DataManifests(file_io_)); + return std::vector(manifests.begin(), manifests.end()); + } + + Result> ReadEntries(const ManifestFile& manifest) { + ICEBERG_ASSIGN_OR_RAISE( + auto spec, table_->metadata()->PartitionSpecById(manifest.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, file_io_, schema_, spec)); + return reader->Entries(); + } + std::shared_ptr spec_; std::shared_ptr schema_; std::shared_ptr file_a_; @@ -183,6 +211,63 @@ TEST_F(FastAppendTest, AppendManyFiles) { EXPECT_EQ(snapshot->summary.at("added-files-size"), std::to_string(total_size)); } +TEST_F(FastAppendTest, WriteManifestGroups) { + SetManifestTargetSizeBytes(std::numeric_limits::max()); + + test::ThreadExecutor executor; + std::shared_ptr fast_append; + ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); + fast_append->WriteManifestsWith(executor, 3); + + constexpr size_t kFileCount = 15'000; + constexpr size_t kGroupSize = 7'500; + std::vector> files; + files.reserve(kFileCount); + for (size_t index = 0; index < kFileCount; ++index) { + auto data_file = + CreateDataFile(std::format("/data/group_{}.parquet", index), + /*record_count=*/1, /*size=*/1, static_cast(index % 2)); + fast_append->AppendFile(data_file); + files.push_back(std::move(data_file)); + } + + EXPECT_THAT(fast_append->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + EXPECT_EQ(executor.submit_count(), 2); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, CurrentDataManifests()); + ASSERT_EQ(manifests.size(), 2U); + + for (size_t group_index = 0; group_index < manifests.size(); ++group_index) { + ASSERT_TRUE(manifests[group_index].added_files_count.has_value()); + EXPECT_EQ(manifests[group_index].added_files_count.value(), kGroupSize); + + ICEBERG_UNWRAP_OR_FAIL(auto entries, ReadEntries(manifests[group_index])); + ASSERT_EQ(entries.size(), kGroupSize); + const size_t offset = group_index * kGroupSize; + for (size_t entry_index = 0; entry_index < entries.size(); ++entry_index) { + ASSERT_NE(entries[entry_index].data_file, nullptr); + EXPECT_EQ(entries[entry_index].data_file->file_path, + files[offset + entry_index]->file_path); + } + } +} + +TEST_F(FastAppendTest, InvalidManifestParallelism) { + test::ThreadExecutor executor; + std::shared_ptr fast_append; + ICEBERG_UNWRAP_OR_FAIL(fast_append, table_->NewFastAppend()); + fast_append->WriteManifestsWith(executor, 0); + fast_append->AppendFile(file_a_); + + auto result = fast_append->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT( + result, + HasErrorMessage("Manifest write parallelism must be greater than 0, but was: 0")); + EXPECT_EQ(executor.submit_count(), 0); +} + TEST_F(FastAppendTest, EmptyTableAppendUpdatesSequenceNumbers) { EXPECT_THAT(table_->current_snapshot(), HasErrorMessage("No current snapshot")); const int64_t base_sequence_number = table_->metadata()->last_sequence_number; diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc index 1b50a124e..9841d74a9 100644 --- a/src/iceberg/test/merging_snapshot_update_test.cc +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -19,7 +19,10 @@ #include "iceberg/update/merging_snapshot_update.h" +#include #include +#include +#include #include #include #include @@ -40,6 +43,7 @@ #include "iceberg/table.h" #include "iceberg/table_metadata.h" #include "iceberg/table_properties.h" +#include "iceberg/test/executor.h" #include "iceberg/test/matchers.h" #include "iceberg/test/update_test_base.h" #include "iceberg/transaction.h" @@ -92,6 +96,16 @@ class TestMergeAppend : public MergingSnapshotUpdate { Result> DataSpec() const { return MergingSnapshotUpdate::DataSpec(); } + Result> WriteDeletesForTest( + std::span> files, + const std::shared_ptr& spec) { + auto entries = files | std::views::transform([](const auto& file) { + return ContentFileWithSequenceNumber{ + .file = file, .data_sequence_number = std::nullopt}; + }) | + std::ranges::to(); + return WriteDeleteManifests(entries, spec); + } int64_t GeneratedSnapshotId() { return SnapshotId(); } void SetDataSeqNumber(int64_t seq) { SetNewDataFilesDataSequenceNumber(seq); } void SetCaseSensitive(bool case_sensitive) { CaseSensitive(case_sensitive); } @@ -266,6 +280,14 @@ class MergingSnapshotUpdateTest : public MinimalUpdateTestBase { table_->metadata()->format_version = format_version; } + void SetManifestTargetSizeBytes(int64_t size_bytes) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kManifestTargetSizeBytes.key()), + std::to_string(size_bytes)); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + // Commit file_a_ with FastAppend and refresh the table. void CommitFileA() { ICEBERG_UNWRAP_OR_FAIL(auto fa, table_->NewFastAppend()); @@ -639,6 +661,29 @@ TEST_F(MergingSnapshotUpdateTest, AddDeleteFileWithExplicitSequenceWritesSequenc EXPECT_EQ(entries[0].sequence_number.value(), 17); } +TEST_F(MergingSnapshotUpdateTest, WriteDeleteGroups) { + SetManifestTargetSizeBytes(std::numeric_limits::max()); + + test::ThreadExecutor executor; + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + op->WriteManifestsWith(executor, 3); + + constexpr size_t kFileCount = 15'000; + auto files = std::views::iota(0UZ, kFileCount) | + std::views::transform([this](size_t index) { + return MakeDeleteFile(std::format("/delete/group_{}.parquet", index), + static_cast(index % 2)); + }) | + std::ranges::to(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->WriteDeletesForTest(files, spec_)); + + EXPECT_EQ(executor.submit_count(), 2); + ASSERT_EQ(manifests.size(), 2U); + for (const auto& manifest : manifests) { + EXPECT_EQ(manifest.content, ManifestContent::kDeletes); + } +} + TEST_F(MergingSnapshotUpdateTest, ApplyRebuildsDeleteSummaryAfterPreparingDeletes) { auto del_file = MakeDeleteFile("/delete/del_a.parquet", 1L); diff --git a/src/iceberg/update/snapshot_update.cc b/src/iceberg/update/snapshot_update.cc index 40669a35f..1d6916da6 100644 --- a/src/iceberg/update/snapshot_update.cc +++ b/src/iceberg/update/snapshot_update.cc @@ -19,8 +19,10 @@ #include "iceberg/update/snapshot_update.h" +#include #include #include +#include #include "iceberg/constants.h" #include "iceberg/file_io.h" @@ -32,6 +34,7 @@ #include "iceberg/partition_summary_internal.h" #include "iceberg/table.h" // IWYU pragma: keep #include "iceberg/transaction.h" +#include "iceberg/util/executor_util_internal.h" #include "iceberg/util/macros.h" #include "iceberg/util/snapshot_util_internal.h" #include "iceberg/util/string_util.h" @@ -79,6 +82,29 @@ Status UpdateTotal(std::unordered_map& summary, return {}; } +constexpr size_t kMinManifestWriterGroupSize = 10'000; + +template +Result> WriteManifestGroups(OptionalExecutor executor, + int32_t max_parallelism, + std::span files, + WriteGroup&& write_group) { + const auto limit = static_cast( + (files.size() + kMinManifestWriterGroupSize / 2) / kMinManifestWriterGroupSize); + const auto group_count = + static_cast(std::max(1, std::min(max_parallelism, limit))); + const size_t group_size = (files.size() + group_count - 1) / group_count; + // TODO(zehua): Replace the manual offset calculation with `std::views::chunk` + // once the supported libc++ provides it. + auto groups = + std::views::iota(0UZ, group_count) | + std::views::transform([files, group_size](size_t group_index) { + const size_t offset = group_index * group_size; + return files.subspan(offset, std::min(group_size, files.size() - offset)); + }); + return ParallelCollect(executor, groups, std::forward(write_group)); +} + // Add metadata to a manifest file by reading it and extracting statistics. Result AddMetadata(const ManifestFile& manifest, std::shared_ptr io, const TableMetadata& metadata) { @@ -175,7 +201,6 @@ void SnapshotUpdate::SetSummaryProperty(const std::string& property, summary_.Set(property, value); } -// TODO(xxx): Split files into independent rolling-writer groups before parallelizing. Result> SnapshotUpdate::WriteDataManifests( std::span> files, const std::shared_ptr& spec, @@ -185,23 +210,28 @@ Result> SnapshotUpdate::WriteDataManifests( } ICEBERG_ASSIGN_OR_RAISE(auto current_schema, base().Schema()); - RollingManifestWriter rolling_writer( - [this, spec, schema = std::move(current_schema), - snapshot_id = SnapshotId()]() -> Result> { - return ManifestWriter::MakeWriter( - base().format_version, snapshot_id, ManifestPath(), ctx_->table->io(), - std::move(spec), std::move(schema), ManifestContent::kData); - }, - target_manifest_size_bytes_); - - for (const auto& file : files) { - ICEBERG_RETURN_UNEXPECTED(rolling_writer.WriteAddedEntry(file, data_sequence_number)); - } - ICEBERG_RETURN_UNEXPECTED(rolling_writer.Close()); - return rolling_writer.ToManifestFiles(); + const int8_t format_version = base().format_version; + const int64_t snapshot_id = SnapshotId(); + auto make_writer = [&]() { + return ManifestWriter::MakeWriter(format_version, snapshot_id, ManifestPath(), + ctx_->table->io(), spec, current_schema, + ManifestContent::kData); + }; + + return WriteManifestGroups( + write_manifest_executor_, write_manifest_parallelism_, files, + [&](std::span> group) + -> Result> { + RollingManifestWriter rolling_writer(make_writer, target_manifest_size_bytes_); + for (const auto& file : group) { + ICEBERG_RETURN_UNEXPECTED( + rolling_writer.WriteAddedEntry(file, data_sequence_number)); + } + ICEBERG_RETURN_UNEXPECTED(rolling_writer.Close()); + return rolling_writer.ToManifestFiles(); + }); } -// TODO(xxx): Split files into independent rolling-writer groups before parallelizing. Result> SnapshotUpdate::WriteDeleteManifests( std::span files, const std::shared_ptr& spec) { @@ -210,21 +240,26 @@ Result> SnapshotUpdate::WriteDeleteManifests( } ICEBERG_ASSIGN_OR_RAISE(auto current_schema, base().Schema()); - RollingManifestWriter rolling_writer( - [this, spec, schema = std::move(current_schema), - snapshot_id = SnapshotId()]() -> Result> { - return ManifestWriter::MakeWriter( - base().format_version, snapshot_id, ManifestPath(), ctx_->table->io(), - std::move(spec), std::move(schema), ManifestContent::kDeletes); - }, - target_manifest_size_bytes_); - - for (const auto& entry : files) { - ICEBERG_RETURN_UNEXPECTED( - rolling_writer.WriteAddedEntry(entry.file, entry.data_sequence_number)); - } - ICEBERG_RETURN_UNEXPECTED(rolling_writer.Close()); - return rolling_writer.ToManifestFiles(); + const int8_t format_version = base().format_version; + const int64_t snapshot_id = SnapshotId(); + auto make_writer = [&]() { + return ManifestWriter::MakeWriter(format_version, snapshot_id, ManifestPath(), + ctx_->table->io(), spec, current_schema, + ManifestContent::kDeletes); + }; + + return WriteManifestGroups( + write_manifest_executor_, write_manifest_parallelism_, files, + [&](std::span group) + -> Result> { + RollingManifestWriter rolling_writer(make_writer, target_manifest_size_bytes_); + for (const auto& entry : group) { + ICEBERG_RETURN_UNEXPECTED( + rolling_writer.WriteAddedEntry(entry.file, entry.data_sequence_number)); + } + ICEBERG_RETURN_UNEXPECTED(rolling_writer.Close()); + return rolling_writer.ToManifestFiles(); + }); } int64_t SnapshotUpdate::SnapshotId() { diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index fa8dcbf12..d92c445ca 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -124,6 +124,25 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { return self; } + /// \brief Configure an executor and max writer count for writing new manifests. + /// + /// If this method is not called, manifest writes remain serial. When configured, + /// files may be split into independent rolling-writer groups. + /// + /// \note Custom FileIO implementations and registered writer factories used for + /// manifest writes must support concurrent calls when an executor is configured. + auto& WriteManifestsWith(this auto& self, Executor& executor, int32_t parallelism) { + if (parallelism <= 0) [[unlikely]] { + return self.AddError( + ErrorKind::kInvalidArgument, + "Manifest write parallelism must be greater than 0, but was: {}", parallelism); + } + + self.write_manifest_executor_ = std::ref(executor); + self.write_manifest_parallelism_ = parallelism; + return self; + } + /// \brief Apply the update's changes to create a new snapshot. /// /// This method validates the changes, applies them to the current base @@ -251,6 +270,8 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { private: const bool can_inherit_snapshot_id_{true}; const std::string commit_uuid_; + OptionalExecutor write_manifest_executor_; + int32_t write_manifest_parallelism_{1}; std::atomic manifest_count_{0}; std::atomic attempt_{0}; std::vector manifest_lists_; diff --git a/src/iceberg/util/executor_util_internal.h b/src/iceberg/util/executor_util_internal.h index 5eed3a8bd..9e8ac3782 100644 --- a/src/iceberg/util/executor_util_internal.h +++ b/src/iceberg/util/executor_util_internal.h @@ -42,6 +42,10 @@ struct ParallelReduce; namespace internal { +template +using ParallelCollectArgT = + std::conditional_t, Ref, std::remove_cvref_t&&>; + template concept ParallelReducible = requires(std::vector& values) { typename ParallelReduce::result_type; @@ -51,10 +55,9 @@ concept ParallelReducible = requires(std::vector& values) { }; template -using ParallelCollectValueT = - ResultValueT&, - std::add_lvalue_reference_t>>>>; +using ParallelCollectValueT = ResultValueT&, + ParallelCollectArgT>>>; template struct ParallelCollectTraits { @@ -67,10 +70,13 @@ struct ParallelCollectTraits { template concept ParallelCollectible = std::ranges::forward_range && std::ranges::sized_range && - std::is_lvalue_reference_v> && + (std::is_lvalue_reference_v> || + std::constructible_from< + std::remove_cvref_t>, + std::ranges::range_reference_t>) && requires(std::remove_reference_t& task, - std::ranges::range_reference_t item) { - { std::invoke(task, item) } -> AsResult; + ParallelCollectArgT> item) { + { std::invoke(task, std::forward(item)) } -> AsResult; requires(!std::same_as>); requires std::default_initializable>; requires ParallelReducible, Options...>; @@ -198,13 +204,24 @@ auto ParallelCollect(OptionalExecutor executor, Args&&... args) { [&](std::index_sequence) { ( [&] { + using item_ref = std::ranges::range_reference_t< + typename internal::ParallelCollectTraits::input_type>; + for (auto&& [item, value] : std::views::zip(std::get(args_tuple), std::get(values_tuple))) { - group.Submit([&]() -> Status { - ICEBERG_ASSIGN_OR_RAISE(value, - std::invoke(std::get(args_tuple), item)); - return {}; - }); + if constexpr (std::is_lvalue_reference_v) { + group.Submit([&]() -> Status { + ICEBERG_ASSIGN_OR_RAISE( + value, std::invoke(std::get(args_tuple), item)); + return {}; + }); + } else { + group.Submit([&, item = std::move(item)]() mutable -> Status { + ICEBERG_ASSIGN_OR_RAISE( + value, std::invoke(std::get(args_tuple), std::move(item))); + return {}; + }); + } } }(), ...); From 68ee0f47ab6df0a41244a32076873bc8977bc7e2 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Tue, 30 Jun 2026 04:21:45 +0200 Subject: [PATCH 137/151] fix(scan): reject missing column stats fields (#759) --- src/iceberg/table_scan.cc | 5 ++--- src/iceberg/test/table_scan_test.cc | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/iceberg/table_scan.cc b/src/iceberg/table_scan.cc index 1e87b03e7..d0a214d07 100644 --- a/src/iceberg/table_scan.cc +++ b/src/iceberg/table_scan.cc @@ -400,9 +400,8 @@ Status TableScanBuilder::ResolveColumnStatsSelection() { const auto& schema = schema_ref.get(); for (const auto& column_name : *requested_column_stats_) { ICEBERG_ASSIGN_OR_RAISE(auto field, schema->FindFieldByName(column_name)); - if (field.has_value()) { - context_.columns_to_keep_stats.insert(field.value().get().field_id()); - } + ICEBERG_CHECK(field.has_value(), "Cannot find stats column: {}", column_name); + context_.columns_to_keep_stats.insert(field.value().get().field_id()); } return {}; diff --git a/src/iceberg/test/table_scan_test.cc b/src/iceberg/test/table_scan_test.cc index fea153230..87db9b505 100644 --- a/src/iceberg/test/table_scan_test.cc +++ b/src/iceberg/test/table_scan_test.cc @@ -285,6 +285,16 @@ TEST_P(TableScanTest, IncludeColumnStatsUsesFinalSnapshotSchema) { } } +TEST_P(TableScanTest, IncludeColumnStatsRejectsMissingColumn) { + ICEBERG_UNWRAP_OR_FAIL(auto builder, + DataTableScanBuilder::Make(table_metadata_, file_io_)); + builder->IncludeColumnStats({"missing"}); + + EXPECT_THAT(builder->Build(), + ::testing::AllOf(IsError(ErrorKind::kValidationFailed), + HasErrorMessage("Cannot find stats column: missing"))); +} + TEST_P(TableScanTest, TableScanBuilderValidationErrors) { // Test negative min rows ICEBERG_UNWRAP_OR_FAIL(auto builder, From c65a806c64f3f87e161321593a96acf81faaf7f0 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Tue, 30 Jun 2026 12:32:25 +0800 Subject: [PATCH 138/151] feat: write snapshot v3 row lineage fields at top level (#791) --- src/iceberg/json_serde.cc | 28 ++++++++++++- src/iceberg/snapshot.cc | 29 +++---------- src/iceberg/snapshot.h | 4 ++ src/iceberg/test/json_serde_test.cc | 65 +++++++++++++++++++++++++---- 4 files changed, 94 insertions(+), 32 deletions(-) diff --git a/src/iceberg/json_serde.cc b/src/iceberg/json_serde.cc index 614712f30..297265435 100644 --- a/src/iceberg/json_serde.cc +++ b/src/iceberg/json_serde.cc @@ -105,6 +105,8 @@ constexpr std::string_view kSequenceNumber = "sequence-number"; constexpr std::string_view kTimestampMs = "timestamp-ms"; constexpr std::string_view kManifestList = "manifest-list"; constexpr std::string_view kSummary = "summary"; +constexpr std::string_view kFirstRowId = "first-row-id"; +constexpr std::string_view kAddedRows = "added-rows"; constexpr std::string_view kMinSnapshotsToKeep = "min-snapshots-to-keep"; constexpr std::string_view kMaxSnapshotAgeMs = "max-snapshot-age-ms"; constexpr std::string_view kMaxRefAgeMs = "max-ref-age-ms"; @@ -470,6 +472,10 @@ nlohmann::json ToJson(const Snapshot& snapshot) { json[kSummary] = snapshot.summary; } SetOptionalField(json, kSchemaId, snapshot.schema_id); + SetOptionalField(json, kFirstRowId, snapshot.first_row_id); + if (snapshot.first_row_id.has_value()) { + SetOptionalField(json, kAddedRows, snapshot.added_rows); + } return json; } @@ -866,12 +872,32 @@ Result> SnapshotFromJson(const nlohmann::json& json) { } } + ICEBERG_ASSIGN_OR_RAISE(auto first_row_id, + GetJsonValueOptional(json, kFirstRowId)); + ICEBERG_ASSIGN_OR_RAISE(auto added_rows, + GetJsonValueOptional(json, kAddedRows)); + + if (first_row_id.has_value() && first_row_id.value() < 0) { + return JsonParseError("Invalid first-row-id (cannot be negative): {}", + first_row_id.value()); + } + if (added_rows.has_value() && added_rows.value() < 0) { + return JsonParseError("Invalid added-rows (cannot be negative): {}", + added_rows.value()); + } + if (first_row_id.has_value() && !added_rows.has_value()) { + return JsonParseError("Invalid added-rows (required when first-row-id is set): null"); + } + if (!first_row_id.has_value()) { + added_rows = std::nullopt; + } + ICEBERG_ASSIGN_OR_RAISE(auto schema_id, GetJsonValueOptional(json, kSchemaId)); return std::make_unique( snapshot_id, parent_snapshot_id, sequence_number.value_or(TableMetadata::kInitialSequenceNumber), timestamp_ms, - manifest_list, std::move(summary), schema_id); + manifest_list, std::move(summary), schema_id, first_row_id, added_rows); } nlohmann::json ToJson(const BlobMetadata& blob_metadata) { diff --git a/src/iceberg/snapshot.cc b/src/iceberg/snapshot.cc index 1b3182fd9..421d7439b 100644 --- a/src/iceberg/snapshot.cc +++ b/src/iceberg/snapshot.cc @@ -161,23 +161,9 @@ std::optional Snapshot::Operation() const { return std::nullopt; } -Result> Snapshot::FirstRowId() const { - auto it = summary.find(SnapshotSummaryFields::kFirstRowId); - if (it == summary.end()) { - return std::nullopt; - } - - return StringUtils::ParseNumber(it->second); -} - -Result> Snapshot::AddedRows() const { - auto it = summary.find(SnapshotSummaryFields::kAddedRows); - if (it == summary.end()) { - return std::nullopt; - } +Result> Snapshot::FirstRowId() const { return first_row_id; } - return StringUtils::ParseNumber(it->second); -} +Result> Snapshot::AddedRows() const { return added_rows; } bool Snapshot::Equals(const Snapshot& other) const { if (this == &other) { @@ -186,7 +172,8 @@ bool Snapshot::Equals(const Snapshot& other) const { return snapshot_id == other.snapshot_id && parent_snapshot_id == other.parent_snapshot_id && sequence_number == other.sequence_number && timestamp_ms == other.timestamp_ms && - schema_id == other.schema_id; + schema_id == other.schema_id && first_row_id == other.first_row_id && + added_rows == other.added_rows; } Result> Snapshot::Make( @@ -203,12 +190,6 @@ Result> Snapshot::Make( ICEBERG_PRECHECK(!first_row_id.has_value() || added_rows.has_value(), "Missing added-rows when first-row-id is set"); summary[SnapshotSummaryFields::kOperation] = operation; - if (first_row_id.has_value()) { - summary[SnapshotSummaryFields::kFirstRowId] = std::to_string(first_row_id.value()); - } - if (added_rows.has_value()) { - summary[SnapshotSummaryFields::kAddedRows] = std::to_string(added_rows.value()); - } return std::make_unique(Snapshot{ .snapshot_id = snapshot_id, .parent_snapshot_id = parent_snapshot_id, @@ -217,6 +198,8 @@ Result> Snapshot::Make( .manifest_list = std::move(manifest_list), .summary = std::move(summary), .schema_id = schema_id, + .first_row_id = first_row_id, + .added_rows = first_row_id.has_value() ? added_rows : std::nullopt, }); } diff --git a/src/iceberg/snapshot.h b/src/iceberg/snapshot.h index f3e7ffb85..c2fd9b8a2 100644 --- a/src/iceberg/snapshot.h +++ b/src/iceberg/snapshot.h @@ -403,6 +403,10 @@ struct ICEBERG_EXPORT Snapshot { std::unordered_map summary; /// ID of the table's current schema when the snapshot was created. std::optional schema_id; + /// The row-id of the first newly added row in this snapshot. + std::optional first_row_id; + /// The upper bound of rows with assigned row IDs in this snapshot. + std::optional added_rows; /// \brief Create a new Snapshot instance with validation on the inputs. static Result> Make( diff --git a/src/iceberg/test/json_serde_test.cc b/src/iceberg/test/json_serde_test.cc index c97ed64a6..22b0a08de 100644 --- a/src/iceberg/test/json_serde_test.cc +++ b/src/iceberg/test/json_serde_test.cc @@ -359,6 +359,53 @@ TEST(JsonInternalTest, Snapshot) { TestJsonConversion(snapshot, expected_json); } +TEST(JsonInternalTest, SnapshotRowLineageSerializesTopLevelFields) { + ICEBERG_UNWRAP_OR_FAIL( + auto snapshot, + Snapshot::Make(/*sequence_number=*/99, /*snapshot_id=*/1234567890, + /*parent_snapshot_id=*/9876543210, + TimePointMsFromUnixMs(1234567890123), DataOperation::kAppend, + {{SnapshotSummaryFields::kAddedDataFiles, "50"}}, + /*schema_id=*/42, "/path/to/manifest_list", + /*first_row_id=*/100, /*added_rows=*/25)); + + auto json = ToJson(*snapshot); + EXPECT_EQ(json["first-row-id"], 100); + EXPECT_EQ(json["added-rows"], 25); + EXPECT_FALSE(json["summary"].contains("first-row-id")); + EXPECT_FALSE(json["summary"].contains("added-rows")); +} + +TEST(JsonInternalTest, SnapshotFromJsonReadsTopLevelRowLineageFields) { + nlohmann::json snapshot_json = + R"({"snapshot-id":1234567890, + "parent-snapshot-id":9876543210, + "sequence-number":99, + "timestamp-ms":1234567890123, + "manifest-list":"/path/to/manifest_list", + "summary":{ + "operation":"append", + "added-data-files":"50", + "first-row-id":"101", + "added-rows":"26" + }, + "schema-id":42, + "first-row-id":100, + "added-rows":25})"_json; + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, SnapshotFromJson(snapshot_json)); + ICEBERG_UNWRAP_OR_FAIL(auto first_row_id, snapshot->FirstRowId()); + ICEBERG_UNWRAP_OR_FAIL(auto added_rows, snapshot->AddedRows()); + EXPECT_EQ(first_row_id, 100); + EXPECT_EQ(added_rows, 25); + + auto json = ToJson(*snapshot); + EXPECT_EQ(json["first-row-id"], 100); + EXPECT_EQ(json["added-rows"], 25); + EXPECT_EQ(json["summary"]["first-row-id"], "101"); + EXPECT_EQ(json["summary"]["added-rows"], "26"); +} + // FIXME: disable it for now since Iceberg Spark plugin generates // custom summary keys. TEST(JsonInternalTest, DISABLED_SnapshotFromJsonWithInvalidSummary) { @@ -583,19 +630,21 @@ TEST(JsonInternalTest, TableUpdateSetDefaultSortOrder) { } TEST(JsonInternalTest, TableUpdateAddSnapshot) { - auto snapshot = std::make_shared( - Snapshot{.snapshot_id = 123456789, - .parent_snapshot_id = 987654321, - .sequence_number = 5, - .timestamp_ms = TimePointMsFromUnixMs(1234567890000), - .manifest_list = "/path/to/manifest-list.avro", - .summary = {{SnapshotSummaryFields::kOperation, DataOperation::kAppend}}, - .schema_id = 1}); + ICEBERG_UNWRAP_OR_FAIL( + auto snapshot_unique, + Snapshot::Make(/*sequence_number=*/5, /*snapshot_id=*/123456789, + /*parent_snapshot_id=*/987654321, + TimePointMsFromUnixMs(1234567890000), DataOperation::kAppend, + /*summary=*/{}, /*schema_id=*/1, "/path/to/manifest-list.avro", + /*first_row_id=*/100, /*added_rows=*/25)); + std::shared_ptr snapshot(std::move(snapshot_unique)); table::AddSnapshot update(snapshot); ICEBERG_UNWRAP_OR_FAIL(auto json, ToJson(update)); EXPECT_EQ(json["action"], "add-snapshot"); EXPECT_TRUE(json.contains("snapshot")); + EXPECT_EQ(json["snapshot"]["first-row-id"], 100); + EXPECT_EQ(json["snapshot"]["added-rows"], 25); auto parsed = TableUpdateFromJson(json); ASSERT_THAT(parsed, IsOk()); From 61400e894fb4f88bd71cd95b27d549fd84feced7 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Tue, 30 Jun 2026 22:07:46 +0800 Subject: [PATCH 139/151] feat: implement RewriteFiles operation (#751) This PR implements the RewriteFiles operation for the Iceberg C++ library. ## Changes - Added RewriteFiles update class in src/iceberg/update/rewrite_files.h and .cc - Added RewriteFiles to the type forward declarations in src/iceberg/type_fwd.h - Registered RewiteFiles as a merging snapshot update in src/iceberg/table.h and .cc - Added RewriteFiles support in transaction (src/iceberg/transaction.h and .cc) - Added comprehensive tests in src/iceberg/test/rewrite_files_test.cc - Added merge test for RewriteFiles in src/iceberg/test/merging_snapshot_update_test.cc --- src/iceberg/CMakeLists.txt | 1 + src/iceberg/meson.build | 1 + src/iceberg/table.cc | 11 + src/iceberg/table.h | 6 + src/iceberg/test/.meson.build.swp | Bin 20480 -> 0 bytes src/iceberg/test/CMakeLists.txt | 1 + src/iceberg/test/merge_append_test.cc | 12 +- .../test/merging_snapshot_update_test.cc | 37 + src/iceberg/test/overwrite_files_test.cc | 2 +- src/iceberg/test/rewrite_files_test.cc | 996 ++++++++++++++++++ src/iceberg/test/table_test.cc | 1 + src/iceberg/transaction.cc | 8 + src/iceberg/transaction.h | 4 + src/iceberg/type_fwd.h | 1 + src/iceberg/update/merging_snapshot_update.cc | 10 +- src/iceberg/update/merging_snapshot_update.h | 5 + src/iceberg/update/meson.build | 1 + src/iceberg/update/rewrite_files.cc | 184 ++++ src/iceberg/update/rewrite_files.h | 197 ++++ src/iceberg/update/snapshot_manager.cc | 2 +- src/iceberg/update/snapshot_update.h | 2 +- 21 files changed, 1470 insertions(+), 12 deletions(-) delete mode 100644 src/iceberg/test/.meson.build.swp create mode 100644 src/iceberg/test/rewrite_files_test.cc create mode 100644 src/iceberg/update/rewrite_files.cc create mode 100644 src/iceberg/update/rewrite_files.h diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index 1bf1f10db..a8fd7dfe6 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -108,6 +108,7 @@ set(ICEBERG_SOURCES update/merging_snapshot_update.cc update/overwrite_files.cc update/pending_update.cc + update/rewrite_files.cc update/row_delta.cc update/set_snapshot.cc update/snapshot_manager.cc diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 1fa15fa12..149bdecad 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -133,6 +133,7 @@ iceberg_sources = files( 'update/merging_snapshot_update.cc', 'update/overwrite_files.cc', 'update/pending_update.cc', + 'update/rewrite_files.cc', 'update/row_delta.cc', 'update/set_snapshot.cc', 'update/snapshot_manager.cc', diff --git a/src/iceberg/table.cc b/src/iceberg/table.cc index 9dbc5acf7..0a2b54082 100644 --- a/src/iceberg/table.cc +++ b/src/iceberg/table.cc @@ -36,6 +36,7 @@ #include "iceberg/update/fast_append.h" #include "iceberg/update/merge_append.h" #include "iceberg/update/overwrite_files.h" +#include "iceberg/update/rewrite_files.h" #include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" @@ -245,6 +246,12 @@ Result> Table::NewOverwrite() { return OverwriteFiles::Make(name().name, std::move(ctx)); } +Result> Table::NewRewriteFiles() { + ICEBERG_ASSIGN_OR_RAISE( + auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); + return RewriteFiles::Make(name().name, std::move(ctx)); +} + Result> Table::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE( auto ctx, TransactionContext::Make(shared_from_this(), TransactionKind::kUpdate)); @@ -360,6 +367,10 @@ Result> StaticTable::NewOverwrite() { return NotSupported("Cannot create an overwrite for a static table"); } +Result> StaticTable::NewRewriteFiles() { + return NotSupported("Cannot create a rewrite files for a static table"); +} + Result> StaticTable::NewSnapshotManager() { return NotSupported("Cannot create a snapshot manager for a static table"); } diff --git a/src/iceberg/table.h b/src/iceberg/table.h index 64ed21ef8..b52b5d29d 100644 --- a/src/iceberg/table.h +++ b/src/iceberg/table.h @@ -188,6 +188,10 @@ class ICEBERG_EXPORT Table : public std::enable_shared_from_this
{ /// \brief Create a new OverwriteFiles to overwrite data files and commit the changes. virtual Result> NewOverwrite(); + /// \brief Create a new RewriteFiles to replace files in this table and commit the + /// changes. + virtual Result> NewRewriteFiles(); + /// \brief Create a new SnapshotManager to manage snapshots and snapshot references. virtual Result> NewSnapshotManager(); @@ -263,6 +267,8 @@ class ICEBERG_EXPORT StaticTable : public Table { Result> NewOverwrite() override; + Result> NewRewriteFiles() override; + Result> NewSnapshotManager() override; private: diff --git a/src/iceberg/test/.meson.build.swp b/src/iceberg/test/.meson.build.swp deleted file mode 100644 index 58638fe24ea751df85d651a182f4d1b25ae5c16e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeI2Z-^Xc9mhwT#@HsUsMQw=K20LCYwz|hX{yOdqL=j29!c-Q?WHjd>GZjoXZN1m z?96nYncG}zDwSHqz9+|{pjI$TPwWf zE{im1))E;sDZ%iMjK+6Oj_;cs-?e*u@9-r0>I3}+PDocQiMToLM$v?d-OlfcM5tt< zB~%#HmQv|^BZ@S)i~>f1D^Va#8smGnSvT+AHA%^LY`>Ac?XAbJB&SJZ6fg=H1&jhl z0i%FXz$jo8Fbe#iD3C-~Ssz1R-kA62L;3d`2EI4tzpMH8^uYbA^4~}D@7BQm{HOUc z3K#{90!9I&fKk9GU=%P47zK<1MggOMQQ&`|0LRny1Dh>t;Z3L<&;L9A|FhRy)J2W?A0?_kjao6S%z9vi=O71J8n|z%lS)a3k0RUb)t?E`ra3 zPlLz7$3Y9!!TZ2w@Vjg9P69X&0&onBgKNR1H(S>C!RNsPKmi|o1RMZ2fXiDf>nGr= z;FG`ww}7qS_vrJF!IR)K;88$2+yU+a`#=rY;5zVE=yVZW0G|T)fN}8Z)t2=FcnUlS z?go3nCh!jgPF@2qfggY`fHqhJv)~|@05^cw5k&bF_%?V9#9$HJ0^Sb(jv&oN@HOyJ za2V_ae?ze5#ZJJ+Vm%*QB{5#zaMDEj4!u@Ub6tC^KS>;NohAyEOk@~1OEPKks5H4q z;)hC9cH#_Y5h(R$&^uLfKP{8lfuMa_nwdxPHIBbgrQHwig@HWqo z8g!DDNVx8)60s-BQt1-PQk1lGAkP)G7c<699JC4F$`PyFPk9oS4u33^^imArhAE>s zJR@8(Mpf3wC>EZC!Ip~9;(=^n9&cQmFJZIgmL&t%PnBF1Lweelm|Y2`ts>(uYwM^I zN|qXN79CWI7MWFv)uvq4o|GGxHOjVlvl)x#a79auW}xmXF&aN?I=)!d)~x^FLX#F= zYCILNt|~jvB8ru(n$MyUlPTd#SPRk!v!&ETvNR>CWjAASZz^Na5nB1r&tqvco@;tUye?JApKc3y&hZ#F;O z<$0%A5~m{Dkuxh#V|^T&V)WCYT{pWMrb(10Q_QBpqQe@F6t(4UX+!SSWPsb9QiVRI zRP=9MYz-%tiamR1=HSf2ZO-CMebHH%sm~u@I5bnY$5{4yubaj(79l4)XHZWox<}Y0 z@{>okC=uFpYRisv)cQ)*vYM^XUBQUS!0|+cWcZ6?mk8Xoie22ak#q-3aU*8QvS3G{ zTcAV@7s+a5L%PhzSvBQN!J6SJ&XuqL7Kyke^`@m54?O0}mP~X56mlM!ox6363GA3C zHQzZ{7&F<5d?~ydV|5{Vt7F(x={NFjpRTjn`gV43x;|SUV<%=8Z=XND$WBZzEKJWW z&d$`?`~o{PKX>cw;_Un!ejR4hb0?{}VIyhtSTIl0JYPx^;jQl&ld3O47@+;geLTQX zPO*Fw@YvECgR%QKcVKgY0&QwP$F_+=laR@PwPVb|pgCskKz7EKlO&p&m}s}#H6C%y z;#wFtCr|*%sV0tM(C6wiqk*eq+9ZVs-E24y&>V_md4_p!$t*1Q2kWcI8c1C`T-6>)^jW9Ho zRkA^$(?aagz*C!I*<4Oo*bb0zSw?93A}nXRei&wub+>2*D(oGPyxVAEJB(NKuyfDT ziy8OP)XcF!?Z^kgTOr01_MMFzb49{HSmgijfDhY*e@p)Vkvsg9ID}6<~p1BPQ@PcoN(T8sHv4F@yI4iW$6s zc)-J;4Jc0Ff*P>E(})Lr2|NT&f}6qX@c*9&kArhy2J8kq!8^cKuo+wpUPe6N36Owk zuoqkdEbuRAa|!$gJOdsBkAN7EZVg~QMggOMQNSo*6d0laj-%M`1rAI4Xitaiiau$R zvw`#DSvNcLXMf3g?4DtzP&mfZsT`M75nanq$Wu&vM(R}8-8fyODXP%bq8glz#aZE| z+BL0M*=2+%8~Q)gTU3Rlr*hYVsy@wbD(+?Zd?hx>M)Av`d1WJScMYCR#l~??dkydm z8XU!DI&^zYO(_oYof5N-X9e`ig+fl9u3EX^S)((Zvm9)Sb^1j$D9fTCZKgo+A8FD5 zi>{or=x^_*CtTBe+3su6R3RmN8$Fag!_=E^Ab#3=O9x&jJUBb>+v%ViLN)Tg*E^`| zv$-wrO491qAp*%MK1IRxX67)K_|%{j+gVOqr$)+NXMA|Ksx=XiJLSPYr7HRjso#i(7|@2sGsbvZ zIm%ms9mJSAn4ZO~rwZw_ZcuClEmrq9Jf-+9WFos6u(!b^eFIc7I8bD;HMIu09C_!9 z?hbTy!)^|AYM`yUk6Ql`L8v0pz{7yylO{7${m7;CnT{?JBN~M;v#yXs^w&Zo8i#MggOM zQNSo*6fg=H1&jj!9R=u!-uV=79d@qJcX5^8MJ&IQ`=z}J*8ksMSe|9zq;6hpw9Si+ Y=EcT*^5_|3UTickHtN?eyHS*X1Nv>_5C8xG diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index fcbc22126..e4d85bc98 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -234,6 +234,7 @@ if(ICEBERG_BUILD_BUNDLE) merge_append_test.cc merging_snapshot_update_test.cc name_mapping_update_test.cc + rewrite_files_test.cc row_delta_test.cc snapshot_manager_test.cc transaction_test.cc diff --git a/src/iceberg/test/merge_append_test.cc b/src/iceberg/test/merge_append_test.cc index 601d9476e..43a47a3bc 100644 --- a/src/iceberg/test/merge_append_test.cc +++ b/src/iceberg/test/merge_append_test.cc @@ -269,13 +269,13 @@ class MergeAppendTestBase : public UpdateTestBase { // both the main branch and a named branch without per-call boilerplate. Result> NewBranchMergeAppend() { ICEBERG_ASSIGN_OR_RAISE(auto append, table_->NewMergeAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); return append; } Result> NewBranchFastAppend() { ICEBERG_ASSIGN_OR_RAISE(auto append, table_->NewFastAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); return append; } @@ -1127,7 +1127,7 @@ TEST_P(MergeAppendTest, Failure) { ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); append->AppendFile(file_b_); EXPECT_THAT(append->Commit(), IsOk()); @@ -1166,7 +1166,7 @@ TEST_P(MergeAppendTest, AppendManifestCleanup) { ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); append->AppendManifest(manifest); EXPECT_THAT(append->Commit(), IsOk()); @@ -1215,7 +1215,7 @@ TEST_P(MergeAppendTest, Recovery) { ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); append->AppendFile(file_b_); EXPECT_THAT(append->Commit(), IsOk()); @@ -1336,7 +1336,7 @@ TEST_P(MergeAppendTest, AppendManifestFailureWithSnapshotIdInheritance) { TEST_P(MergeAppendTest, TransactionNewMergeAppendCommits) { ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); - append->SetTargetBranch(branch()); + append->ToBranch(branch()); append->AppendFile(file_a_); EXPECT_THAT(append->Commit(), IsOk()); ICEBERG_UNWRAP_OR_FAIL(auto committed_table, txn->Commit()); diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc index 9841d74a9..af5b073ca 100644 --- a/src/iceberg/test/merging_snapshot_update_test.cc +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -1450,6 +1450,43 @@ TEST_F(MergingSnapshotUpdateTest, IsError(ErrorKind::kValidationFailed)); } +TEST_F(MergingSnapshotUpdateTest, + ValidateNoNewDeletesForDataFilesIgnoresEqualityDeletesWhenFlagIsTrue) { + // This tests the behavior that RewriteFiles::SetDataSequenceNumber() and + // RewriteFiles::RewriteDataFiles() enable: when a data sequence number is + // set for rewritten data files, concurrent equality deletes at higher + // sequence numbers still apply to the new files and are NOT a conflict. + // Only position deletes should still fail (tested separately by + // ValidateNoNewDeletesForDataFilesFailsOnPositionDeleteWhenIgnoringEqualityDeletes). + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto first_snapshot, table_->current_snapshot()); + + auto del_file = MakeEqualityDeleteFile("/delete/del_a.parquet", 1L); + ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwriteUpdate()); + EXPECT_THAT(op->AddDelete(del_file), IsOk()); + const int64_t second_snapshot_id = op->GeneratedSnapshotId(); + ICEBERG_UNWRAP_OR_FAIL(auto manifests, op->Apply(*table_->metadata(), first_snapshot)); + ICEBERG_UNWRAP_OR_FAIL( + auto second_snapshot, + MakeSyntheticSnapshot(DataOperation::kOverwrite, second_snapshot_id, + first_snapshot->snapshot_id, + first_snapshot->sequence_number + 1, manifests)); + + auto metadata = std::make_shared(*table_->metadata()); + metadata->snapshots.push_back(second_snapshot); + metadata->current_snapshot_id = second_snapshot->snapshot_id; + metadata->last_sequence_number = second_snapshot->sequence_number; + + DataFileSet replaced_files; + replaced_files.insert(file_a_); + // With ignore_equality_deletes=true, concurrently-added equality deletes + // should NOT cause a conflict. + EXPECT_THAT(TestMergeAppend::ValidateNoNewDeletesForDataFilesForTest( + *metadata, first_snapshot->snapshot_id, replaced_files, second_snapshot, + file_io_, /*ignore_equality_deletes=*/true), + IsOk()); +} + TEST_F(MergingSnapshotUpdateTest, ValidateNoNewDeletesForDataFilesUsesConfiguredCaseSensitivity) { CommitFileA(); diff --git a/src/iceberg/test/overwrite_files_test.cc b/src/iceberg/test/overwrite_files_test.cc index 5d4d851f1..6cac62e97 100644 --- a/src/iceberg/test/overwrite_files_test.cc +++ b/src/iceberg/test/overwrite_files_test.cc @@ -243,7 +243,7 @@ TEST_F(OverwriteFilesTest, TargetBranch) { CommitFileA(); ICEBERG_UNWRAP_OR_FAIL(auto op, NewOverwrite()); - op->SetTargetBranch("audit"); + op->ToBranch("audit"); op->AddFile(file_b_); EXPECT_THAT(op->Commit(), IsOk()); diff --git a/src/iceberg/test/rewrite_files_test.cc b/src/iceberg/test/rewrite_files_test.cc new file mode 100644 index 000000000..670ba22fd --- /dev/null +++ b/src/iceberg/test/rewrite_files_test.cc @@ -0,0 +1,996 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/rewrite_files.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "iceberg/arrow/arrow_io_internal.h" +#include "iceberg/avro/avro_register.h" +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/manifest/manifest_reader.h" +#include "iceberg/row/partition_values.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/table_metadata.h" +#include "iceberg/table_properties.h" +#include "iceberg/test/matchers.h" +#include "iceberg/test/mock_catalog.h" +#include "iceberg/test/update_test_base.h" +#include "iceberg/update/fast_append.h" +#include "iceberg/update/row_delta.h" +#include "iceberg/update/update_properties.h" + +namespace iceberg { + +class RewriteFilesTest : public MinimalUpdateTestBase { + protected: + static void SetUpTestSuite() { avro::RegisterAll(); } + + void SetUp() override { + MinimalUpdateTestBase::SetUp(); + table_->metadata()->format_version = format_version(); + + ICEBERG_UNWRAP_OR_FAIL(spec_, table_->spec()); + ICEBERG_UNWRAP_OR_FAIL(schema_, table_->schema()); + + file_a_ = MakeDataFile("/data/file_a.parquet", /*partition_x=*/1L); + file_b_ = MakeDataFile("/data/file_b.parquet", /*partition_x=*/2L); + rewritten_file_a_ = + MakeDataFile("/data/file_a_rewritten.parquet", /*partition_x=*/1L); + rewritten_file_b_ = + MakeDataFile("/data/file_b_rewritten.parquet", /*partition_x=*/2L); + delete_file_a_ = MakeDeleteFile("/data/delete_a.parquet", /*partition_x=*/1L); + rewritten_delete_file_a_ = + MakeDeleteFile("/data/delete_a_rewritten.parquet", /*partition_x=*/1L); + eq_delete_file_ = + MakeEqualityDeleteFile("/data/eq_delete_a.parquet", /*partition_x=*/1L); + } + + virtual int8_t format_version() const { + return TableMetadata::kDefaultTableFormatVersion; + } + + /// \brief Skip the current parameterization if format version is below the given + /// minimum. + void AssumeFormatVersionAtLeast(int8_t min_version) { + if (format_version() < min_version) { + GTEST_SKIP() << "Requires format version >= " << static_cast(min_version); + } + } + + std::shared_ptr MakeDataFile(const std::string& path, int64_t partition_x) { + auto f = std::make_shared(); + f->content = DataFile::Content::kData; + f->file_path = table_location_ + path; + f->file_format = FileFormatType::kParquet; + f->partition = PartitionValues(std::vector{Literal::Long(partition_x)}); + f->file_size_in_bytes = 1024; + f->record_count = 100; + f->partition_spec_id = spec_->spec_id(); + return f; + } + + std::shared_ptr MakeDeleteFile(const std::string& path, int64_t partition_x) { + auto f = MakeDataFile(path, partition_x); + f->content = DataFile::Content::kPositionDeletes; + return f; + } + + std::shared_ptr MakeEqualityDeleteFile(const std::string& path, + int64_t partition_x) { + auto f = MakeDeleteFile(path, partition_x); + f->content = DataFile::Content::kEqualityDeletes; + f->equality_ids = {1}; + return f; + } + + Result> NewRewriteFiles() { + return table_->NewRewriteFiles(); + } + + /// \brief Commit file_a_ with FastAppend so the table has data to rewrite. + void CommitFileA() { + ICEBERG_UNWRAP_OR_FAIL(auto fa, table_->NewFastAppend()); + fa->AppendFile(file_a_); + EXPECT_THAT(fa->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + /// \brief Read all manifest entries from a set of manifests. + Result> ReadAllEntries( + std::span manifests) { + std::vector result; + for (const auto& manifest : manifests) { + ICEBERG_ASSIGN_OR_RAISE( + auto spec, table_->metadata()->PartitionSpecById(manifest.partition_spec_id)); + ICEBERG_ASSIGN_OR_RAISE(auto reader, + ManifestReader::Make(manifest, file_io_, schema_, spec)); + ICEBERG_ASSIGN_OR_RAISE(auto entries, reader->Entries()); + result.insert(result.end(), entries.begin(), entries.end()); + } + return result; + } + + /// \brief Get data manifests from a snapshot. + Result> DataManifests( + const std::shared_ptr& snapshot) { + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, snapshot_cache.DataManifests(file_io_)); + return std::vector(manifests.begin(), manifests.end()); + } + + /// \brief Get delete manifests from a snapshot. + Result> DeleteManifests( + const std::shared_ptr& snapshot) { + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifests, snapshot_cache.DeleteManifests(file_io_)); + return std::vector(manifests.begin(), manifests.end()); + } + + /// \brief List Avro metadata files in the mock filesystem. + std::vector MetadataAvroFiles() { + auto arrow_io = std::dynamic_pointer_cast(file_io_); + EXPECT_NE(arrow_io, nullptr); + if (arrow_io == nullptr) { + return {}; + } + + ::arrow::fs::FileSelector selector; + selector.base_dir = table_location_ + "/metadata"; + selector.recursive = false; + + auto maybe_infos = arrow_io->fs()->GetFileInfo(selector); + EXPECT_TRUE(maybe_infos.ok()) << maybe_infos.status().ToString(); + if (!maybe_infos.ok()) { + return {}; + } + + std::vector files; + for (const auto& info : maybe_infos.ValueOrDie()) { + if (info.type() == ::arrow::fs::FileType::File && info.path().ends_with(".avro")) { + files.push_back(info.path()); + } + } + std::ranges::sort(files); + return files; + } + + /// \brief Set commit retry properties on the table. + void SetCommitRetryProperties(int32_t retries) { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(std::string(TableProperties::kCommitNumRetries.key()), + std::to_string(retries)); + props->Set(std::string(TableProperties::kCommitMinRetryWaitMs.key()), "1"); + props->Set(std::string(TableProperties::kCommitMaxRetryWaitMs.key()), "1"); + props->Set(std::string(TableProperties::kCommitTotalRetryTimeMs.key()), "1000"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + /// \brief Re-bind table_ to use a mock catalog that fails UpdateTable N times, + /// then delegates to the real catalog. The call_count pointer is incremented on + /// each UpdateTable call (successful or not). + void BindTableWithFailingCommits(int failures, int* update_call_count = nullptr) { + auto mock_catalog = std::make_shared<::testing::NiceMock>(); + std::weak_ptr<::testing::NiceMock> weak_catalog = mock_catalog; + + ON_CALL(*mock_catalog, LoadTable(::testing::_)) + .WillByDefault([this, weak_catalog](const TableIdentifier& identifier) + -> Result> { + ICEBERG_ASSIGN_OR_RAISE(auto loaded, catalog_->LoadTable(identifier)); + auto catalog = weak_catalog.lock(); + ICEBERG_PRECHECK(catalog != nullptr, "Mock catalog expired"); + return Table::Make(loaded->name(), loaded->metadata(), + std::string(loaded->metadata_file_location()), loaded->io(), + catalog); + }); + + ON_CALL(*mock_catalog, UpdateTable(::testing::_, ::testing::_, ::testing::_)) + .WillByDefault( + [this, weak_catalog, failures, update_call_count]( + const TableIdentifier& identifier, + const std::vector>& requirements, + const std::vector>& updates) mutable + -> Result> { + if (update_call_count != nullptr) { + ++*update_call_count; + } + if (failures-- > 0) { + return CommitFailed("Injected failure"); + } + ICEBERG_ASSIGN_OR_RAISE( + auto updated, catalog_->UpdateTable(identifier, requirements, updates)); + auto catalog = weak_catalog.lock(); + ICEBERG_PRECHECK(catalog != nullptr, "Mock catalog expired"); + return Table::Make(updated->name(), updated->metadata(), + std::string(updated->metadata_file_location()), + updated->io(), catalog); + }); + + ICEBERG_UNWRAP_OR_FAIL(auto bound_table, + Table::Make(table_->name(), table_->metadata(), + std::string(table_->metadata_file_location()), + table_->io(), mock_catalog)); + table_ = std::move(bound_table); + mock_catalogs_.push_back(std::move(mock_catalog)); + } + + std::shared_ptr spec_; + std::shared_ptr schema_; + std::shared_ptr file_a_; + std::shared_ptr file_b_; + std::shared_ptr rewritten_file_a_; + std::shared_ptr rewritten_file_b_; + std::shared_ptr delete_file_a_; + std::shared_ptr rewritten_delete_file_a_; + std::shared_ptr eq_delete_file_; + + /// \brief Mock catalogs kept alive during the test (for failure injection). + std::vector>> mock_catalogs_; +}; + +class RewriteFilesFormatVersionTest : public RewriteFilesTest, + public ::testing::WithParamInterface { + protected: + int8_t format_version() const override { return GetParam(); } +}; + +// ============================================================================ +// Tests that run on all format versions (v1+) +// ============================================================================ + +// Rewrite a single data file: replace file_a_ with rewritten_file_a_. +TEST_P(RewriteFilesFormatVersionTest, AddAndDelete) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); +} + +TEST_P(RewriteFilesFormatVersionTest, DeleteDataFileCopiesCallerFile) { + CommitFileA(); + + const std::string original_path = file_a_->file_path; + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + + file_a_->file_path = file_b_->file_path; + + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto rw_missing_original, NewRewriteFiles()); + auto missing_file = std::make_shared(*file_a_); + missing_file->file_path = original_path; + rw_missing_original->DeleteDataFile(missing_file); + rw_missing_original->AddDataFile(file_b_); + auto result = rw_missing_original->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Missing required files to delete")); +} + +TEST_P(RewriteFilesFormatVersionTest, AddDataFileRejectsDeleteFileContent) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(delete_file_a_); + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Invalid data file to add")); +} + +TEST_P(RewriteFilesFormatVersionTest, RewriteDeleteFilesCopiesCallerFiles) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file_a_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + auto old_delete = std::make_shared(*delete_file_a_); + auto new_delete = std::make_shared(*rewritten_delete_file_a_); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDeleteFile(old_delete); + rw->AddDeleteFile(new_delete); + + old_delete->file_path = table_location_ + "/data/delete_a_mutated.parquet"; + new_delete->content = DataFile::Content::kData; + + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); +} + +// Rewrite one of several data files, verifying only the target is affected. +TEST_P(RewriteFilesFormatVersionTest, AddAndDeletePartialRewrite) { + CommitFileA(); + + { + ICEBERG_UNWRAP_OR_FAIL(auto fa, table_->NewFastAppend()); + fa->AppendFile(file_b_); + EXPECT_THAT(fa->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); +} + +// Rewrite via the 4-set Rewrite() API replacing data files only. +TEST_P(RewriteFilesFormatVersionTest, Rewrite) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->Rewrite({file_a_}, {}, {rewritten_file_a_}, {}); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); +} + +// Limiting validation scope to after a given snapshot avoids spurious conflicts. +TEST_P(RewriteFilesFormatVersionTest, ValidateFromSnapshot) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + auto snapshot_id = snapshot->snapshot_id; + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(snapshot_id); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); +} + +// Committing a rewrite to the main branch via ToBranch. +TEST_P(RewriteFilesFormatVersionTest, ToBranch) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ToBranch("main"); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); +} + +// Null check on DeleteDataFile. +TEST_P(RewriteFilesFormatVersionTest, DeleteDataFileNullCheck) { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(nullptr); + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +// Null check on AddDataFile. +TEST_P(RewriteFilesFormatVersionTest, AddDataFileNullCheck) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(nullptr); + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +// Null checks on AddDeleteFile +TEST_P(RewriteFilesFormatVersionTest, AddDeleteFileNullCheck) { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->AddDeleteFile(nullptr); + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +// Adding a data file after deleting one — the basic RewriteFiles pattern. +TEST_P(RewriteFilesFormatVersionTest, AddDataFile) { + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); +} + +// Deleting a file that was never added fails with missing required files. +TEST_P(RewriteFilesFormatVersionTest, DeleteNonExistentFile) { + CommitFileA(); // table now has file_a_ + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + // file_b_ was never added — deleting it should fail with missing required files + rw->DeleteDataFile(file_b_); + rw->AddDataFile(rewritten_file_b_); + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Missing required files to delete")); +} + +// Rewriting a file that was already deleted in a prior commit must fail. +TEST_P(RewriteFilesFormatVersionTest, AlreadyDeletedFile) { + CommitFileA(); // table now has file_a_ + + // First rewrite: file_a_ → rewritten_file_a_ + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Second rewrite: try to delete file_a_ again (already deleted) + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(file_b_); + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Missing required files to delete")); + } +} + +// Inject commit failures that exhaust all retries, then verify the commit +// ultimately fails with CommitFailed. +TEST_P(RewriteFilesFormatVersionTest, Failure) { + CommitFileA(); + + constexpr int32_t kRetries = 3; + constexpr int32_t kInjectedFailures = kRetries + 1; // more failures than retries + int call_count = 0; + + SetCommitRetryProperties(kRetries); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot_before, table_->current_snapshot()); + const auto sequence_number_before = table_->metadata()->last_sequence_number; + const auto metadata_avro_files_before = MetadataAvroFiles(); + + BindTableWithFailingCommits(kInjectedFailures, &call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + // We expect 1 (initial attempt) + kRetries (retries) = kRetries + 1 calls, + // all of which fail. + EXPECT_EQ(call_count, kRetries + 1); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot_after, table_->current_snapshot()); + EXPECT_EQ(snapshot_after->snapshot_id, snapshot_before->snapshot_id); + EXPECT_EQ(table_->metadata()->last_sequence_number, sequence_number_before); + EXPECT_EQ(MetadataAvroFiles(), metadata_avro_files_before); +} + +// Inject transient commit failures that stay within the retry budget, then +// verify the commit eventually succeeds with the correct state. +TEST_P(RewriteFilesFormatVersionTest, Recovery) { + CommitFileA(); + + constexpr int32_t kRetries = 4; + constexpr int32_t kInjectedFailures = 2; // fewer failures than retries + int call_count = 0; + + SetCommitRetryProperties(kRetries); + BindTableWithFailingCommits(kInjectedFailures, &call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + // We expect 1 initial attempt + kInjectedFailures retries = + // kInjectedFailures + 1 calls, with the last one succeeding. + EXPECT_EQ(call_count, kInjectedFailures + 1); + + // Verify the rewrite actually succeeded + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); +} + +// ============================================================================ +// Tests that require format version >= 2 +// ============================================================================ + +// Rewrite with an explicit data sequence number via SetDataSequenceNumber. +TEST_P(RewriteFilesFormatVersionTest, DataSequenceNumber) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->SetDataSequenceNumber(5); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); +} + +// Bulk rewrite with sequence number via the RewriteDataFiles convenience method. +TEST_P(RewriteFilesFormatVersionTest, RewriteDataFiles) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->RewriteDataFiles({file_a_}, {rewritten_file_a_}, /*sequence_number=*/3); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); +} + +// Deleting a file from an empty table fails with missing required files. +TEST_P(RewriteFilesFormatVersionTest, EmptyTable) { + AssumeFormatVersionAtLeast(2); + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Missing required files to delete")); +} + +// Only adding files without any deletions must fail validation. +TEST_P(RewriteFilesFormatVersionTest, DeleteOnly) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->AddDataFile(rewritten_file_a_); // no FileToDelete → must fail + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); +} + +// Adding data files without deleting data, or adding delete files without deleting +// delete files, must fail validation. +TEST_P(RewriteFilesFormatVersionTest, AddOnly) { + AssumeFormatVersionAtLeast(2); + // Sub-case 1: adding data files without deleting any data files should fail + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDeleteFile(delete_file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); + } + + // Sub-case 2: adding delete files without deleting any delete files should fail + { + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->DeleteDataFile(file_a_); + rw->AddDeleteFile(rewritten_delete_file_a_); + EXPECT_THAT(rw->Commit(), IsError(ErrorKind::kValidationFailed)); + } +} + +// Rewrite both data and delete files in a single commit, verifying that the +// manifest entries have the correct statuses (DELETED for replaced files, +// ADDED for new files). ValidateFromSnapshot scopes conflict detection to +// after the RowDelta commit so the delete being rewritten is not flagged as +// a concurrent addition. +TEST_P(RewriteFilesFormatVersionTest, RewriteDataAndDeleteFiles) { + AssumeFormatVersionAtLeast(2); + // Create data file via FastAppend + CommitFileA(); + + // Create delete file via RowDelta + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file_a_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Snapshot after RowDelta: the delete file exists from this point onward. + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + + // Rewrite both data and delete files + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->DeleteDeleteFile(delete_file_a_); + rw->AddDataFile(rewritten_file_a_); + rw->AddDeleteFile(rewritten_delete_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Verify snapshot summary + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles)), + 1); + + // Verify manifest entry statuses + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, DataManifests(snapshot)); + ICEBERG_UNWRAP_OR_FAIL(auto data_entries, ReadAllEntries(data_manifests)); + ASSERT_EQ(data_entries.size(), 2); + for (const auto& entry : data_entries) { + if (entry.data_file->file_path == file_a_->file_path) { + EXPECT_EQ(entry.status, ManifestStatus::kDeleted); + } else if (entry.data_file->file_path == rewritten_file_a_->file_path) { + EXPECT_EQ(entry.status, ManifestStatus::kAdded); + EXPECT_EQ(entry.snapshot_id, snapshot->snapshot_id); + } else { + FAIL() << "Unexpected data file: " << entry.data_file->file_path; + } + } + + ICEBERG_UNWRAP_OR_FAIL(auto delete_manifests, DeleteManifests(snapshot)); + ICEBERG_UNWRAP_OR_FAIL(auto delete_entries, ReadAllEntries(delete_manifests)); + ASSERT_EQ(delete_entries.size(), 2); + for (const auto& entry : delete_entries) { + if (entry.data_file->file_path == delete_file_a_->file_path) { + EXPECT_EQ(entry.status, ManifestStatus::kDeleted); + } else if (entry.data_file->file_path == rewritten_delete_file_a_->file_path) { + EXPECT_EQ(entry.status, ManifestStatus::kAdded); + EXPECT_EQ(entry.snapshot_id, snapshot->snapshot_id); + } else { + FAIL() << "Unexpected delete file: " << entry.data_file->file_path; + } + } +} + +// Rewrite data files with an explicit old data sequence number, then verify +// that the rewritten manifest entry carries the assigned sequence number. +TEST_P(RewriteFilesFormatVersionTest, RewriteDataAndAssignOldSequenceNumber) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + constexpr int64_t kOldSequenceNumber = 1; + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->SetDataSequenceNumber(kOldSequenceNumber); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto data_manifests, DataManifests(snapshot)); + ICEBERG_UNWRAP_OR_FAIL(auto data_entries, ReadAllEntries(data_manifests)); + ASSERT_EQ(data_entries.size(), 2); + bool found_rewritten = false; + for (const auto& entry : data_entries) { + if (entry.data_file->file_path == rewritten_file_a_->file_path) { + found_rewritten = true; + EXPECT_EQ(entry.status, ManifestStatus::kAdded); + ASSERT_TRUE(entry.sequence_number.has_value()); + EXPECT_EQ(entry.sequence_number.value(), kOldSequenceNumber); + } else if (entry.data_file->file_path != file_a_->file_path) { + FAIL() << "Unexpected data file: " << entry.data_file->file_path; + } + } + EXPECT_TRUE(found_rewritten) << "Rewritten data file should be present"; +} + +// Create equality deletes via RowDelta then rewrite them as position deletes +// in a single RewriteFiles commit. +TEST_P(RewriteFilesFormatVersionTest, ReplaceEqualityDeletesWithPositionDeletes) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + // Add an equality delete via RowDelta + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(eq_delete_file_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + + // Replace the equality delete with a position delete + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->DeleteDeleteFile(eq_delete_file_); + rw->AddDataFile(rewritten_file_a_); + rw->AddDeleteFile(rewritten_delete_file_a_); + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ( + std::stoll(snapshot->summary.at(SnapshotSummaryFields::kRemovedEqDeleteFiles)), 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedPosDeleteFiles)), + 1); + + // Verify the delete manifest shows the eq delete as DELETED and pos delete as ADDED + ICEBERG_UNWRAP_OR_FAIL(auto delete_manifests, DeleteManifests(snapshot)); + ICEBERG_UNWRAP_OR_FAIL(auto delete_entries, ReadAllEntries(delete_manifests)); + bool found_deleted_eq = false; + bool found_added_pos = false; + for (const auto& entry : delete_entries) { + if (entry.status == ManifestStatus::kDeleted && + entry.data_file->content == DataFile::Content::kEqualityDeletes) { + found_deleted_eq = true; + } + if (entry.status == ManifestStatus::kAdded && + entry.data_file->content == DataFile::Content::kPositionDeletes) { + found_added_pos = true; + } + } + EXPECT_TRUE(found_deleted_eq) << "Equality delete should be marked DELETED"; + EXPECT_TRUE(found_added_pos) << "Position delete should be marked ADDED"; +} + +// Remove all deletes: create a data file and an associated equality delete, +// then rewrite the data file while removing the delete file entirely (empty +// delete add set). +TEST_P(RewriteFilesFormatVersionTest, RemoveAllDeletes) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + // Add an equality delete via RowDelta + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(eq_delete_file_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Verify delete file exists before rewrite + { + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto delete_manifests, DeleteManifests(snapshot)); + EXPECT_GT(delete_manifests.size(), 0); + } + + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + + // Rewrite: delete the data file and the equality delete, add rewritten data, + // add no new delete files (empty delete add set). + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->DeleteDeleteFile(eq_delete_file_); + rw->AddDataFile(rewritten_file_a_); + // no AddDeleteFile call — delete add set is empty + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles)), + 1); + // No added delete files expected + EXPECT_EQ(snapshot->summary.count(SnapshotSummaryFields::kAddedDeleteFiles), 0); + + // Verify delete manifests show the eq delete as DELETED and no added deletes + ICEBERG_UNWRAP_OR_FAIL(auto delete_manifests, DeleteManifests(snapshot)); + ICEBERG_UNWRAP_OR_FAIL(auto delete_entries, ReadAllEntries(delete_manifests)); + bool found_deleted_delete = false; + for (const auto& entry : delete_entries) { + if (entry.status == ManifestStatus::kDeleted) { + found_deleted_delete = true; + } + EXPECT_NE(entry.status, ManifestStatus::kAdded) + << "No new delete files should be added"; + } + EXPECT_TRUE(found_deleted_delete) << "Original delete file should be marked DELETED"; +} + +// Verify that RewriteFiles detects new delete files that were committed after +// the validation snapshot boundary, preventing data loss. +TEST_P(RewriteFilesFormatVersionTest, NewDeleteFile) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + + // Concurrently add an equality delete targeting the data file we plan to rewrite + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(eq_delete_file_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + // Try to rewrite the data file, validating from before the delete was added + { + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(starting_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->AddDataFile(rewritten_file_a_); + + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("found new delete for replaced data file")); + EXPECT_THAT(result, HasErrorMessage(file_a_->file_path)); + } +} + +// Inject commit failures that exhaust retries when rewriting both data and +// delete files. Verify the commit fails with CommitFailed after exhausting +// retries. +TEST_P(RewriteFilesFormatVersionTest, FailureWhenRewriteBothDataAndDeleteFiles) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + // Create delete file via RowDelta first + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file_a_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + + constexpr int32_t kRetries = 2; + constexpr int32_t kInjectedFailures = kRetries + 1; + int call_count = 0; + + SetCommitRetryProperties(kRetries); + const auto sequence_number_before = table_->metadata()->last_sequence_number; + const auto metadata_avro_files_before = MetadataAvroFiles(); + + BindTableWithFailingCommits(kInjectedFailures, &call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->DeleteDeleteFile(delete_file_a_); + rw->AddDataFile(rewritten_file_a_); + rw->AddDeleteFile(rewritten_delete_file_a_); + + auto result = rw->Commit(); + EXPECT_THAT(result, IsError(ErrorKind::kCommitFailed)); + EXPECT_EQ(call_count, kRetries + 1); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot_after, table_->current_snapshot()); + EXPECT_EQ(snapshot_after->snapshot_id, after_delta_snapshot->snapshot_id); + EXPECT_EQ(table_->metadata()->last_sequence_number, sequence_number_before); + EXPECT_EQ(MetadataAvroFiles(), metadata_avro_files_before); +} + +// Inject transient commit failures that stay within the retry budget when +// rewriting both data and delete files, then verify success. +TEST_P(RewriteFilesFormatVersionTest, RecoverWhenRewriteBothDataAndDeleteFiles) { + AssumeFormatVersionAtLeast(2); + CommitFileA(); + + // Create delete file via RowDelta + { + ICEBERG_UNWRAP_OR_FAIL(auto row_delta, table_->NewRowDelta()); + row_delta->AddDeletes(delete_file_a_); + EXPECT_THAT(row_delta->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + + ICEBERG_UNWRAP_OR_FAIL(auto after_delta_snapshot, table_->current_snapshot()); + + constexpr int32_t kRetries = 4; + constexpr int32_t kInjectedFailures = 2; + int call_count = 0; + + SetCommitRetryProperties(kRetries); + BindTableWithFailingCommits(kInjectedFailures, &call_count); + + ICEBERG_UNWRAP_OR_FAIL(auto rw, NewRewriteFiles()); + rw->ValidateFromSnapshot(after_delta_snapshot->snapshot_id); + rw->DeleteDataFile(file_a_); + rw->DeleteDeleteFile(delete_file_a_); + rw->AddDataFile(rewritten_file_a_); + rw->AddDeleteFile(rewritten_delete_file_a_); + + EXPECT_THAT(rw->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + EXPECT_EQ(call_count, kInjectedFailures + 1); + + // Verify the rewrite succeeded and data is correct + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kOperation), + DataOperation::kReplace); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kDeletedDataFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDataFiles)), 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kRemovedDeleteFiles)), + 1); + EXPECT_EQ(std::stoll(snapshot->summary.at(SnapshotSummaryFields::kAddedDeleteFiles)), + 1); +} + +// ============================================================================ +// TODO(WZhuo): Tests blocked on missing infrastructure in iceberg-cpp. +// ============================================================================ +// +// TODO(RemovingDataFileAlsoRemovesDV): +// Blocked by: format v3 DV auto-cleanup not yet supported. +// Creates data+delete files via RowDelta (v3), rewrites with deleteFile. +// Verifies the DV for the removed data file is automatically cleaned up. +// Java guard: assumeThat(formatVersion).isGreaterThanOrEqualTo(3) +// +// TODO(DeleteWithDuplicateEntriesInManifest): +// Blocked by: cannot yet append the same file twice to create duplicate manifest +// entries. Appends FILE_A twice, then rewrites one copy. Verifies manifest entry +// statuses (DELETED for the rewritten copy, EXISTING for the other). +// Java guard: none (runs on all versions) + +INSTANTIATE_TEST_SUITE_P(FormatVersions, RewriteFilesFormatVersionTest, + ::testing::Values(int8_t{1}, int8_t{2})); + +} // namespace iceberg diff --git a/src/iceberg/test/table_test.cc b/src/iceberg/test/table_test.cc index ef21f12d6..716d92967 100644 --- a/src/iceberg/test/table_test.cc +++ b/src/iceberg/test/table_test.cc @@ -164,6 +164,7 @@ TEST(StaticTableTest, NewMutatingOperationsAreNotSupported) { EXPECT_THAT(table->NewDeleteFiles(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewRowDelta(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewOverwrite(), IsError(ErrorKind::kNotSupported)); + EXPECT_THAT(table->NewRewriteFiles(), IsError(ErrorKind::kNotSupported)); EXPECT_THAT(table->NewSnapshotManager(), IsError(ErrorKind::kNotSupported)); } diff --git a/src/iceberg/transaction.cc b/src/iceberg/transaction.cc index 169e7ec90..7abce27cb 100644 --- a/src/iceberg/transaction.cc +++ b/src/iceberg/transaction.cc @@ -38,6 +38,7 @@ #include "iceberg/update/merge_append.h" #include "iceberg/update/overwrite_files.h" #include "iceberg/update/pending_update.h" +#include "iceberg/update/rewrite_files.h" #include "iceberg/update/row_delta.h" #include "iceberg/update/set_snapshot.h" #include "iceberg/update/snapshot_manager.h" @@ -521,6 +522,13 @@ Result> Transaction::NewOverwrite() { return overwrite; } +Result> Transaction::NewRewriteFiles() { + ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr rewrite_files, + RewriteFiles::Make(ctx_->table->name().name, ctx_)); + ICEBERG_RETURN_UNEXPECTED(AddUpdate(rewrite_files)); + return rewrite_files; +} + Result> Transaction::NewUpdateStatistics() { ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr update_statistics, UpdateStatistics::Make(ctx_)); diff --git a/src/iceberg/transaction.h b/src/iceberg/transaction.h index 49b607d60..47714ba70 100644 --- a/src/iceberg/transaction.h +++ b/src/iceberg/transaction.h @@ -118,6 +118,10 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this> NewOverwrite(); + /// \brief Create a new RewriteFiles to replace files in this table and commit the + /// changes. + Result> NewRewriteFiles(); + /// \brief Create a new SnapshotManager to manage snapshots. Result> NewSnapshotManager(); diff --git a/src/iceberg/type_fwd.h b/src/iceberg/type_fwd.h index 870badba0..35a493b48 100644 --- a/src/iceberg/type_fwd.h +++ b/src/iceberg/type_fwd.h @@ -245,6 +245,7 @@ class FastAppend; class MergeAppend; class OverwriteFiles; class PendingUpdate; +class RewriteFiles; class RowDelta; class SetSnapshot; class SnapshotManager; diff --git a/src/iceberg/update/merging_snapshot_update.cc b/src/iceberg/update/merging_snapshot_update.cc index 8f88633ba..f1f0f511d 100644 --- a/src/iceberg/update/merging_snapshot_update.cc +++ b/src/iceberg/update/merging_snapshot_update.cc @@ -540,8 +540,10 @@ Status MergingSnapshotUpdate::AddDeleteFile(std::shared_ptr file, return InvalidArgument("Delete file must have a partition spec ID"); } ICEBERG_RETURN_UNEXPECTED(base().PartitionSpecById(file->partition_spec_id.value())); + + auto staged_file = std::make_shared(*file); has_new_delete_files_ = true; - PendingDeleteFile pending_file{.file = std::move(file), + PendingDeleteFile pending_file{.file = std::move(staged_file), .data_sequence_number = std::move(data_sequence_number)}; if (ContentFileUtil::IsDV(*pending_file.file)) { ICEBERG_PRECHECK(pending_file.file->referenced_data_file.has_value(), @@ -559,14 +561,16 @@ Status MergingSnapshotUpdate::DeleteDataFile(std::shared_ptr file) { if (!file) { return InvalidArgument("Cannot delete a null data file"); } - return data_filter_manager_->DeleteFile(std::move(file)); + auto staged_file = std::make_shared(*file); + return data_filter_manager_->DeleteFile(std::move(staged_file)); } Status MergingSnapshotUpdate::DeleteDeleteFile(std::shared_ptr file) { if (!file) { return InvalidArgument("Cannot delete a null delete file"); } - return delete_filter_manager_->DeleteFile(std::move(file)); + auto staged_file = std::make_shared(*file); + return delete_filter_manager_->DeleteFile(std::move(staged_file)); } Status MergingSnapshotUpdate::DeleteByPath(std::string_view path) { diff --git a/src/iceberg/update/merging_snapshot_update.h b/src/iceberg/update/merging_snapshot_update.h index d11a9b1f9..dbfb79937 100644 --- a/src/iceberg/update/merging_snapshot_update.h +++ b/src/iceberg/update/merging_snapshot_update.h @@ -141,6 +141,11 @@ class ICEBERG_EXPORT MergingSnapshotUpdate : public SnapshotUpdate { /// \brief Override the data sequence number assigned to all newly-added data files. void SetNewDataFilesDataSequenceNumber(int64_t sequence_number); + /// \brief Returns true if SetNewDataFilesDataSequenceNumber was called. + bool HasDataSequenceNumber() const { + return new_data_files_data_seq_number_.has_value(); + } + /// \brief Set case sensitivity for row filter and expression evaluation. void CaseSensitive(bool case_sensitive); diff --git a/src/iceberg/update/meson.build b/src/iceberg/update/meson.build index 4ba4168d4..83c64f363 100644 --- a/src/iceberg/update/meson.build +++ b/src/iceberg/update/meson.build @@ -24,6 +24,7 @@ install_headers( 'merging_snapshot_update.h', 'overwrite_files.h', 'pending_update.h', + 'rewrite_files.h', 'row_delta.h', 'set_snapshot.h', 'snapshot_manager.h', diff --git a/src/iceberg/update/rewrite_files.cc b/src/iceberg/update/rewrite_files.cc new file mode 100644 index 000000000..b7fc048d3 --- /dev/null +++ b/src/iceberg/update/rewrite_files.cc @@ -0,0 +1,184 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "iceberg/update/rewrite_files.h" + +#include +#include +#include + +#include "iceberg/manifest/manifest_entry.h" +#include "iceberg/result.h" +#include "iceberg/snapshot.h" +#include "iceberg/table.h" +#include "iceberg/transaction.h" +#include "iceberg/util/macros.h" + +namespace iceberg { + +RewriteFiles::RewriteFiles(std::string table_name, + std::shared_ptr ctx) + : MergingSnapshotUpdate(std::move(table_name), std::move(ctx)) { + // Replace files must fail if any of the deleted paths is missing and cannot be deleted + FailMissingDeletePaths(); +} + +Result> RewriteFiles::Make( + std::string table_name, std::shared_ptr ctx) { + ICEBERG_PRECHECK(!table_name.empty(), "Table name cannot be empty"); + ICEBERG_PRECHECK(ctx != nullptr, "Cannot create RewriteFiles without a context"); + return std::unique_ptr( + new RewriteFiles(std::move(table_name), std::move(ctx))); +} + +RewriteFiles& RewriteFiles::DeleteDataFile(const std::shared_ptr& data_file) { + ICEBERG_BUILDER_CHECK(data_file != nullptr, "Invalid data file: null"); + ICEBERG_BUILDER_CHECK(data_file->content == DataFile::Content::kData, + "Invalid data file to delete: {} has delete-file content", + data_file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(MergingSnapshotUpdate::DeleteDataFile(data_file)); + replaced_data_files_.insert(std::make_shared(*data_file)); + return *this; +} + +RewriteFiles& RewriteFiles::DeleteDeleteFile( + const std::shared_ptr& delete_file) { + ICEBERG_BUILDER_CHECK(delete_file != nullptr, "Invalid delete file: null"); + ICEBERG_BUILDER_CHECK(delete_file->content != DataFile::Content::kData, + "Invalid delete file to delete: {} has data-file content", + delete_file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(MergingSnapshotUpdate::DeleteDeleteFile(delete_file)); + return *this; +} + +RewriteFiles& RewriteFiles::AddDataFile(const std::shared_ptr& file) { + ICEBERG_BUILDER_CHECK(file != nullptr, "Invalid data file: null"); + ICEBERG_BUILDER_CHECK(file->content == DataFile::Content::kData, + "Invalid data file to add: {} has delete-file content", + file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(MergingSnapshotUpdate::AddDataFile(file)); + return *this; +} + +RewriteFiles& RewriteFiles::AddDeleteFile(const std::shared_ptr& delete_file) { + ICEBERG_BUILDER_CHECK(delete_file != nullptr, "Invalid delete file: null"); + ICEBERG_BUILDER_CHECK(delete_file->content != DataFile::Content::kData, + "Invalid delete file to add: {} has data-file content", + delete_file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR(MergingSnapshotUpdate::AddDeleteFile(delete_file)); + return *this; +} + +RewriteFiles& RewriteFiles::AddDeleteFile(const std::shared_ptr& delete_file, + int64_t data_sequence_number) { + ICEBERG_BUILDER_CHECK(delete_file != nullptr, "Invalid delete file: null"); + ICEBERG_BUILDER_CHECK(delete_file->content != DataFile::Content::kData, + "Invalid delete file to add: {} has data-file content", + delete_file->file_path); + ICEBERG_BUILDER_RETURN_IF_ERROR( + MergingSnapshotUpdate::AddDeleteFile(delete_file, data_sequence_number)); + return *this; +} + +RewriteFiles& RewriteFiles::SetDataSequenceNumber(int64_t sequence_number) { + SetNewDataFilesDataSequenceNumber(sequence_number); + return *this; +} + +RewriteFiles& RewriteFiles::RewriteDataFiles( + const std::vector>& files_to_delete, + const std::vector>& files_to_add, int64_t sequence_number) { + SetNewDataFilesDataSequenceNumber(sequence_number); + Rewrite(files_to_delete, {}, files_to_add, {}); + return *this; +} + +RewriteFiles& RewriteFiles::Rewrite( + const std::vector>& data_files_to_replace, + const std::vector>& delete_files_to_replace, + const std::vector>& data_files_to_add, + const std::vector>& delete_files_to_add) { + for (const auto& data_file : data_files_to_replace) { + DeleteDataFile(data_file); + } + + for (const auto& delete_file : delete_files_to_replace) { + DeleteDeleteFile(delete_file); + } + + for (const auto& data_file : data_files_to_add) { + AddDataFile(data_file); + } + + for (const auto& delete_file : delete_files_to_add) { + AddDeleteFile(delete_file); + } + + return *this; +} + +RewriteFiles& RewriteFiles::ValidateFromSnapshot(int64_t snapshot_id) { + starting_snapshot_id_ = snapshot_id; + return *this; +} + +std::string RewriteFiles::operation() { return DataOperation::kReplace; } + +void RewriteFiles::ValidateReplacedAndAddedFiles() { + // 1. Files to delete cannot be empty + if (!DeletesDataFiles() && !DeletesDeleteFiles()) { + AddError(ErrorKind::kValidationFailed, "Files to delete cannot be empty"); + return; + } + + // 2. Data files to add must be empty because there's no data file to be rewritten + if (!DeletesDataFiles() && AddsDataFiles()) { + AddError(ErrorKind::kValidationFailed, + "Data files to add must be empty because there's no data file to be " + "rewritten"); + return; + } + + // 3. Delete files to add must be empty because there's no delete file to be rewritten + if (!DeletesDeleteFiles() && AddsDeleteFiles()) { + AddError(ErrorKind::kValidationFailed, + "Delete files to add must be empty because there's no delete file to be " + "rewritten"); + return; + } +} + +Status RewriteFiles::Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) { + ValidateReplacedAndAddedFiles(); + ICEBERG_RETURN_UNEXPECTED(CheckErrors()); + + if (!replaced_data_files_.empty()) { + // If there are replaced data files, there cannot be any new row-level deletes + // for those data files. + auto io = ctx_->table->io(); + ICEBERG_RETURN_UNEXPECTED(MergingSnapshotUpdate::ValidateNoNewDeletesForDataFiles( + current_metadata, starting_snapshot_id_, replaced_data_files_, snapshot, + std::move(io), HasDataSequenceNumber())); + } + + return {}; +} + +} // namespace iceberg diff --git a/src/iceberg/update/rewrite_files.h b/src/iceberg/update/rewrite_files.h new file mode 100644 index 000000000..ce219c3ae --- /dev/null +++ b/src/iceberg/update/rewrite_files.h @@ -0,0 +1,197 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/update/rewrite_files.h +/// RewriteFiles operation for replacing files in a table. + +#include +#include +#include +#include + +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" +#include "iceberg/update/merging_snapshot_update.h" +#include "iceberg/util/data_file_set.h" + +namespace iceberg { + +/// \brief API for replacing files in a table. +/// +/// This API accumulates file additions and deletions, produces a new Snapshot +/// of the changes, and commits that snapshot as the current. +/// +/// When committing, these changes will be applied to the latest table snapshot. +/// Commit conflicts will be resolved by applying the changes to the new latest +/// snapshot and reattempting the commit. If any of the deleted files are no +/// longer in the latest snapshot when reattempting, the commit will fail +/// validation. +/// +/// Note that the new state of the table after each rewrite must be logically +/// equivalent to the original table state. +class ICEBERG_EXPORT RewriteFiles : public MergingSnapshotUpdate { + public: + /// \brief Create a new RewriteFiles operation. + /// + /// \param table_name The name of the table + /// \param ctx The transaction context + /// \return A unique pointer to the new RewriteFiles operation + static Result> Make( + std::string table_name, std::shared_ptr ctx); + + ~RewriteFiles() override = default; + + /// \brief Remove a data file from the current table state. + /// + /// This rewrite operation may change the size or layout of the data files. + /// When applicable, it is also recommended to discard already deleted records + /// while rewriting data files. However, the set of live data records must + /// never change. + /// + /// \param data_file a rewritten data file + /// \return this for method chaining + RewriteFiles& DeleteDataFile(const std::shared_ptr& data_file); + + /// \brief Remove a delete file from the table state. + /// + /// This rewrite operation may change the size or layout of the delete files. + /// When applicable, it is also recommended to discard delete records for files + /// that are no longer part of the table state. However, the set of applicable + /// delete records must never change. + /// + /// \param delete_file a rewritten delete file + /// \return this for method chaining + RewriteFiles& DeleteDeleteFile(const std::shared_ptr& delete_file); + + /// \brief Add a new data file. + /// + /// This rewrite operation may change the size or layout of the data files. + /// When applicable, it is also recommended to discard already deleted records + /// while rewriting data files. However, the set of live data records must + /// never change. + /// + /// \param file a new data file + /// \return this for method chaining + RewriteFiles& AddDataFile(const std::shared_ptr& file); + + /// \brief Add a new delete file. + /// + /// This rewrite operation may change the size or layout of the delete files. + /// When applicable, it is also recommended to discard delete records for files + /// that are no longer part of the table state. However, the set of applicable + /// delete records must never change. + /// + /// \param delete_file a new delete file + /// \return this for method chaining + RewriteFiles& AddDeleteFile(const std::shared_ptr& delete_file); + + /// \brief Add a new delete file with the given data sequence number. + /// + /// This rewrite operation may change the size or layout of the delete files. + /// When applicable, it is also recommended to discard delete records for files + /// that are no longer part of the table state. However, the set of applicable + /// delete records must never change. + /// + /// To ensure equivalence in the set of applicable delete records, the + /// sequence number of the delete file must be the max sequence number of + /// the delete files that it is replacing. Rewriting equality deletes that + /// belong to different sequence numbers is not allowed. + /// + /// \param delete_file a new delete file + /// \param data_sequence_number data sequence number to append on the file + /// \return this for method chaining + RewriteFiles& AddDeleteFile(const std::shared_ptr& delete_file, + int64_t data_sequence_number); + + /// \brief Configure the data sequence number for this rewrite operation. + /// + /// This data sequence number will be used for all new data files that are + /// added in this rewrite. This method is helpful to avoid commit conflicts + /// between data compaction and adding equality deletes. + /// + /// \param sequence_number a data sequence number + /// \return this for method chaining + RewriteFiles& SetDataSequenceNumber(int64_t sequence_number); + + /// \brief Add a rewrite that replaces one set of data files with another set + /// that contains the same data. The sequence number provided will be used for + /// all the data files added. + /// + /// \param files_to_delete files that will be replaced (deleted), cannot be + /// null or empty + /// \param files_to_add files that will be added, cannot be null or empty + /// \param sequence_number sequence number to use for all data files added + /// \return this for method chaining + RewriteFiles& RewriteDataFiles( + const std::vector>& files_to_delete, + const std::vector>& files_to_add, + int64_t sequence_number); + + /// \brief Add a rewrite that replaces one set of files with another set that + /// contains the same data. + /// + /// \param data_files_to_replace data files that will be replaced (deleted) + /// \param delete_files_to_replace delete files that will be replaced (deleted) + /// \param data_files_to_add data files that will be added + /// \param delete_files_to_add delete files that will be added + /// \return this for method chaining + RewriteFiles& Rewrite( + const std::vector>& data_files_to_replace, + const std::vector>& delete_files_to_replace, + const std::vector>& data_files_to_add, + const std::vector>& delete_files_to_add); + + /// \brief Set the snapshot ID used in any reads for this operation. + /// + /// Validations will check changes after this snapshot ID. If this is not + /// called, all ancestor snapshots through the table's initial snapshot are + /// validated. + /// + /// \param snapshot_id a snapshot ID + /// \return this for method chaining + RewriteFiles& ValidateFromSnapshot(int64_t snapshot_id); + + std::string operation() override; + + protected: + Status Validate(const TableMetadata& current_metadata, + const std::shared_ptr& snapshot) override; + + explicit RewriteFiles(std::string table_name, std::shared_ptr ctx); + + private: + /// \brief Validate the replaced and added files invariants. + /// + /// Ensures that: + /// - Files to delete cannot be empty + /// - Data files to add must be empty if there's no data file to be rewritten + /// - Delete files to add must be empty if there's no delete file to be rewritten + void ValidateReplacedAndAddedFiles(); + + /// \brief Tracks which data files are being replaced, for conflict detection. + DataFileSet replaced_data_files_; + + /// \brief Optional snapshot ID boundary for validation scope. + std::optional starting_snapshot_id_; +}; + +} // namespace iceberg diff --git a/src/iceberg/update/snapshot_manager.cc b/src/iceberg/update/snapshot_manager.cc index 55f73072e..5473f3033 100644 --- a/src/iceberg/update/snapshot_manager.cc +++ b/src/iceberg/update/snapshot_manager.cc @@ -93,7 +93,7 @@ SnapshotManager& SnapshotManager::CreateBranch(const std::string& name) { } ICEBERG_BUILDER_CHECK(!base.refs.contains(name), "Ref {} already exists", name); ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto fast_append, transaction_->NewFastAppend()); - ICEBERG_BUILDER_RETURN_IF_ERROR(fast_append->SetTargetBranch(name).Commit()); + ICEBERG_BUILDER_RETURN_IF_ERROR(fast_append->ToBranch(name).Commit()); return *this; } diff --git a/src/iceberg/update/snapshot_update.h b/src/iceberg/update/snapshot_update.h index d92c445ca..10bb16fbc 100644 --- a/src/iceberg/update/snapshot_update.h +++ b/src/iceberg/update/snapshot_update.h @@ -96,7 +96,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate { /// /// \param branch The name of a SnapshotRef of type branch. /// \return This update for method chaining. - auto& SetTargetBranch(this auto& self, const std::string& branch) { + auto& ToBranch(this auto& self, const std::string& branch) { if (branch.empty()) [[unlikely]] { return self.AddError(ErrorKind::kInvalidArgument, "Branch name cannot be empty"); } From 7c4f15cc9a858c023e963224ebd05685cb6a6f49 Mon Sep 17 00:00:00 2001 From: Junwang Zhao Date: Wed, 1 Jul 2026 15:36:24 +0800 Subject: [PATCH 140/151] feat: Support UUID values across row and file IO (#790) closes #314 --- src/iceberg/avro/avro_data_util.cc | 8 +- src/iceberg/avro/avro_reader.cc | 63 ++++++- src/iceberg/parquet/parquet_schema_util.cc | 3 +- src/iceberg/row/struct_like.cc | 16 +- src/iceberg/schema_internal.cc | 1 - src/iceberg/schema_internal.h | 3 + src/iceberg/test/avro_test.cc | 205 +++++++++++++++++++++ src/iceberg/test/parquet_test.cc | 36 ++++ src/iceberg/test/struct_like_test.cc | 71 +++++++ 9 files changed, 399 insertions(+), 7 deletions(-) diff --git a/src/iceberg/avro/avro_data_util.cc b/src/iceberg/avro/avro_data_util.cc index f2bcc29f8..b44e4b110 100644 --- a/src/iceberg/avro/avro_data_util.cc +++ b/src/iceberg/avro/avro_data_util.cc @@ -35,6 +35,7 @@ #include "iceberg/avro/avro_schema_util_internal.h" #include "iceberg/metadata_columns.h" #include "iceberg/schema.h" +#include "iceberg/schema_internal.h" #include "iceberg/schema_util.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" @@ -620,7 +621,9 @@ Status ExtractDatumFromArray(const ::arrow::Array& array, int64_t index, } case ::arrow::Type::EXTENSION: { - if (array.type()->name() == "arrow.uuid") { + const auto& extension_type = + internal::checked_cast(*array.type()); + if (extension_type.extension_name() == kArrowUuidExtensionName) { const auto& extension_array = internal::checked_cast(array); const auto& fixed_array = @@ -632,7 +635,8 @@ Status ExtractDatumFromArray(const ::arrow::Array& array, int64_t index, return {}; } - return NotSupported("Unsupported Arrow extension type: {}", array.type()->name()); + return NotSupported("Unsupported Arrow extension type: {}", + extension_type.extension_name()); } case ::arrow::Type::STRUCT: { diff --git a/src/iceberg/avro/avro_reader.cc b/src/iceberg/avro/avro_reader.cc index 1d431c46b..95218ccbd 100644 --- a/src/iceberg/avro/avro_reader.cc +++ b/src/iceberg/avro/avro_reader.cc @@ -20,9 +20,11 @@ #include "iceberg/avro/avro_reader.h" #include +#include #include #include +#include #include #include #include @@ -42,6 +44,7 @@ #include "iceberg/metadata_columns.h" #include "iceberg/name_mapping.h" #include "iceberg/schema_internal.h" +#include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" namespace iceberg::avro { @@ -209,6 +212,63 @@ struct ReadContext { std::shared_ptr<::arrow::ArrayBuilder> builder_; }; +std::shared_ptr<::arrow::DataType> StorageTypeForBuilder( + const std::shared_ptr<::arrow::DataType>& type); + +std::shared_ptr<::arrow::Field> StorageFieldForBuilder( + const std::shared_ptr<::arrow::Field>& field) { + return ::arrow::field(field->name(), StorageTypeForBuilder(field->type()), + field->nullable(), field->metadata()); +} + +// Arrow cannot construct builders for arrow.uuid extension arrays yet, so build +// with the UUID storage type while keeping the public schema unchanged. +std::shared_ptr<::arrow::DataType> StorageTypeForBuilder( + const std::shared_ptr<::arrow::DataType>& type) { + switch (type->id()) { + case ::arrow::Type::EXTENSION: { + const auto& extension_type = + internal::checked_cast(*type); + if (extension_type.extension_name() == kArrowUuidExtensionName) { + return extension_type.storage_type(); + } + return type; + } + case ::arrow::Type::STRUCT: { + const auto& struct_type = internal::checked_cast(*type); + std::vector> fields; + fields.reserve(struct_type.num_fields()); + for (const auto& field : struct_type.fields()) { + fields.emplace_back(StorageFieldForBuilder(field)); + } + return ::arrow::struct_(std::move(fields)); + } + case ::arrow::Type::LIST: { + const auto& list_type = internal::checked_cast(*type); + return ::arrow::list(StorageFieldForBuilder(list_type.value_field())); + } + case ::arrow::Type::LARGE_LIST: { + const auto& list_type = + internal::checked_cast(*type); + return ::arrow::large_list(StorageFieldForBuilder(list_type.value_field())); + } + case ::arrow::Type::FIXED_SIZE_LIST: { + const auto& list_type = + internal::checked_cast(*type); + return ::arrow::fixed_size_list(StorageFieldForBuilder(list_type.value_field()), + list_type.list_size()); + } + case ::arrow::Type::MAP: { + const auto& map_type = internal::checked_cast(*type); + return ::arrow::map(StorageTypeForBuilder(map_type.key_type()), + StorageFieldForBuilder(map_type.item_field()), + map_type.keys_sorted()); + } + default: + return type; + } +} + } // namespace // TODO(gang.wu): collect basic reader metrics @@ -349,7 +409,8 @@ class AvroReader::Impl { context_->arrow_schema_ = import_result.MoveValueUnsafe(); auto arrow_struct_type = - std::make_shared<::arrow::StructType>(context_->arrow_schema_->fields()); + internal::checked_pointer_cast<::arrow::StructType>(StorageTypeForBuilder( + std::make_shared<::arrow::StructType>(context_->arrow_schema_->fields()))); auto builder_result = ::arrow::MakeBuilder(arrow_struct_type); if (!builder_result.ok()) { return InvalidSchema("Failed to make the arrow builder: {}", diff --git a/src/iceberg/parquet/parquet_schema_util.cc b/src/iceberg/parquet/parquet_schema_util.cc index a5629198f..09b1f9636 100644 --- a/src/iceberg/parquet/parquet_schema_util.cc +++ b/src/iceberg/parquet/parquet_schema_util.cc @@ -28,6 +28,7 @@ #include "iceberg/metadata_columns.h" #include "iceberg/parquet/parquet_schema_util_internal.h" #include "iceberg/result.h" +#include "iceberg/schema_internal.h" #include "iceberg/schema_util_internal.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/formatter.h" // IWYU pragma: keep @@ -222,7 +223,7 @@ Status ValidateParquetSchemaEvolution( if (arrow_type->id() == ::arrow::Type::EXTENSION) { const auto& extension_type = internal::checked_cast(*arrow_type); - if (extension_type.extension_name() == "arrow.uuid") { + if (extension_type.extension_name() == kArrowUuidExtensionName) { return {}; } } diff --git a/src/iceberg/row/struct_like.cc b/src/iceberg/row/struct_like.cc index 355af84c5..430fd22f0 100644 --- a/src/iceberg/row/struct_like.cc +++ b/src/iceberg/row/struct_like.cc @@ -62,6 +62,12 @@ Result LiteralToScalar(const Literal& literal) { return Scalar{ std::string_view(reinterpret_cast(bytes.data()), bytes.size())}; } + case TypeId::kUuid: { + const auto& uuid = std::get(literal.value()); + const auto& bytes = uuid.bytes(); + return Scalar{ + std::string_view(reinterpret_cast(bytes.data()), bytes.size())}; + } case TypeId::kDecimal: return Scalar{std::get(literal.value())}; default: @@ -162,8 +168,14 @@ Result StructLikeAccessor::GetLiteral(const StructLike& struct_like) co const auto& fixed_data = std::get(scalar); return Literal::Fixed(std::vector(fixed_data.cbegin(), fixed_data.cend())); } - case TypeId::kUuid: - // TODO(gangwu): Implement UUID type + case TypeId::kUuid: { + const auto& uuid_data = std::get(scalar); + ICEBERG_ASSIGN_OR_RAISE( + auto uuid, + Uuid::FromBytes(std::span( + reinterpret_cast(uuid_data.data()), uuid_data.size()))); + return Literal::UUID(uuid); + } default: return NotSupported("Cannot convert scalar to literal of type {}", type_->ToString()); diff --git a/src/iceberg/schema_internal.cc b/src/iceberg/schema_internal.cc index 792341adf..5dac0d3bf 100644 --- a/src/iceberg/schema_internal.cc +++ b/src/iceberg/schema_internal.cc @@ -37,7 +37,6 @@ namespace { // Constants for Arrow schema metadata constexpr const char* kArrowExtensionName = "ARROW:extension:name"; constexpr const char* kArrowExtensionMetadata = "ARROW:extension:metadata"; -constexpr const char* kArrowUuidExtensionName = "arrow.uuid"; constexpr int32_t kUnknownFieldId = -1; Status CheckArrowCompatible(const Type& type) { diff --git a/src/iceberg/schema_internal.h b/src/iceberg/schema_internal.h index 5c7209d64..fd9ec6266 100644 --- a/src/iceberg/schema_internal.h +++ b/src/iceberg/schema_internal.h @@ -30,6 +30,9 @@ namespace iceberg { +/// \brief Canonical Arrow extension name used for Iceberg UUID values. +inline constexpr const char* kArrowUuidExtensionName = "arrow.uuid"; + /// \brief Convert an Iceberg schema to an Arrow schema. /// /// \param[in] schema The Iceberg schema to convert. diff --git a/src/iceberg/test/avro_test.cc b/src/iceberg/test/avro_test.cc index ef86ef9e2..3ae1696d0 100644 --- a/src/iceberg/test/avro_test.cc +++ b/src/iceberg/test/avro_test.cc @@ -17,6 +17,8 @@ * under the License. */ +#include +#include #include #include #include @@ -25,7 +27,10 @@ #include #include +#include +#include #include +#include #include #include #include @@ -46,6 +51,7 @@ #include "iceberg/test/temp_file_test_base.h" #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" +#include "iceberg/util/uuid.h" namespace iceberg::avro { @@ -76,6 +82,41 @@ std::optional FieldIdAt(const ::avro::NodePtr& node, size_t index) { return std::stoi(field_id.value()); } +constexpr std::array kUuidBytes1 = { + 0x12, 0x3e, 0x45, 0x67, 0xe8, 0x9b, 0x12, 0xd3, + 0xa4, 0x56, 0x42, 0x66, 0x14, 0x17, 0x40, 0x00}; +constexpr std::array kUuidBytes2 = { + 0xf7, 0x9c, 0x3e, 0x09, 0x67, 0x7c, 0x4b, 0xbd, + 0xa4, 0x79, 0x3f, 0x34, 0x9c, 0xb7, 0x85, 0xe7}; + +std::shared_ptr<::arrow::Array> MakeUuidArray( + std::initializer_list*> values) { + ::arrow::FixedSizeBinaryBuilder uuid_storage_builder( + ::arrow::fixed_size_binary(Uuid::kLength)); + for (const auto* value : values) { + EXPECT_TRUE(uuid_storage_builder.Append(value->data()).ok()); + } + auto uuid_storage = uuid_storage_builder.Finish().ValueOrDie(); + return ::arrow::ExtensionType::WrapArray(::arrow::extension::uuid(), uuid_storage); +} + +std::shared_ptr<::arrow::Array> MakeInt32Array(std::initializer_list values) { + ::arrow::Int32Builder builder; + for (auto value : values) { + EXPECT_TRUE(builder.Append(value).ok()); + } + return builder.Finish().ValueOrDie(); +} + +std::shared_ptr<::arrow::Array> MakeStringArray( + std::initializer_list values) { + ::arrow::StringBuilder builder; + for (auto value : values) { + EXPECT_TRUE(builder.Append(value).ok()); + } + return builder.Finish().ValueOrDie(); +} + } // namespace class AvroReaderTest : public TempFileTestBase { @@ -781,6 +822,41 @@ class AvroWriterTest : public ::testing::Test, return avro_reader.dataSchema(); } + void WriteArrowArrayAndVerify(std::shared_ptr schema, + const std::shared_ptr<::arrow::Array>& array) { + ArrowArray arrow_array; + ASSERT_TRUE(::arrow::ExportArray(*array, &arrow_array).ok()); + + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kAvroSkipDatum, skip_datum_); + + ICEBERG_UNWRAP_OR_FAIL(writer_, WriterFactoryRegistry::Open( + FileFormatType::kAvro, + {.path = temp_avro_file_, + .schema = schema, + .io = file_io_, + .properties = std::move(writer_properties)})); + ASSERT_THAT(writer_->Write(&arrow_array), IsOk()); + ASSERT_THAT(writer_->Close(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto written_length, writer_->length()); + ICEBERG_UNWRAP_OR_FAIL( + auto reader, + ReaderFactoryRegistry::Open(FileFormatType::kAvro, {.path = temp_avro_file_, + .length = written_length, + .io = file_io_, + .projection = schema})); + ICEBERG_UNWRAP_OR_FAIL(auto data, reader->Next()); + ASSERT_TRUE(data.has_value()); + + ICEBERG_UNWRAP_OR_FAIL(auto arrow_c_schema, reader->Schema()); + auto read_array = ::arrow::ImportArray(&data.value(), &arrow_c_schema).ValueOrDie(); + ASSERT_TRUE(read_array->Equals(*array)) << "actual:\n" + << read_array->ToString() << "\nexpected:\n" + << array->ToString(); + ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); + } + std::shared_ptr file_io_; std::string temp_avro_file_; bool skip_datum_{true}; @@ -806,6 +882,135 @@ TEST_P(AvroWriterTest, WritePrimitiveTypes) { VerifyWrittenData(test_data); } +TEST_P(AvroWriterTest, WriteUuidType) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "uuid_col", iceberg::uuid())}); + + auto uuid_array = MakeUuidArray({&kUuidBytes1, &kUuidBytes2}); + auto array = + ::arrow::StructArray::Make( + {uuid_array}, + {::arrow::field("uuid_col", ::arrow::extension::uuid(), /*nullable=*/false)}) + .ValueOrDie(); + + ArrowArray arrow_array; + ASSERT_TRUE(::arrow::ExportArray(*array, &arrow_array).ok()); + + WriterProperties writer_properties; + writer_properties.Set(WriterProperties::kAvroSkipDatum, skip_datum_); + + ICEBERG_UNWRAP_OR_FAIL( + writer_, WriterFactoryRegistry::Open(FileFormatType::kAvro, + {.path = temp_avro_file_, + .schema = schema, + .io = file_io_, + .properties = std::move(writer_properties)})); + ASSERT_THAT(writer_->Write(&arrow_array), IsOk()); + ASSERT_THAT(writer_->Close(), IsOk()); + + auto avro_schema = PhysicalAvroSchema(); + auto root = avro_schema.root(); + ASSERT_EQ(root->type(), ::avro::AVRO_RECORD); + ASSERT_EQ(root->leaves(), 1); + auto uuid_node = root->leafAt(0); + EXPECT_EQ(uuid_node->type(), ::avro::AVRO_FIXED); + EXPECT_EQ(uuid_node->logicalType().type(), ::avro::LogicalType::UUID); + EXPECT_EQ(uuid_node->fixedSize(), Uuid::kLength); + + ICEBERG_UNWRAP_OR_FAIL(auto written_length, writer_->length()); + ICEBERG_UNWRAP_OR_FAIL( + auto reader, + ReaderFactoryRegistry::Open(FileFormatType::kAvro, {.path = temp_avro_file_, + .length = written_length, + .io = file_io_, + .projection = schema})); + ICEBERG_UNWRAP_OR_FAIL(auto data, reader->Next()); + ASSERT_TRUE(data.has_value()); + + ICEBERG_UNWRAP_OR_FAIL(auto arrow_c_schema, reader->Schema()); + auto read_array = ::arrow::ImportArray(&data.value(), &arrow_c_schema).ValueOrDie(); + ASSERT_TRUE(read_array->Equals(*array)) << "actual:\n" + << read_array->ToString() << "\nexpected:\n" + << array->ToString(); + ASSERT_NO_FATAL_FAILURE(VerifyExhausted(*reader)); +} + +TEST_P(AvroWriterTest, WriteUuidListType) { + auto schema = std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "uuid_list", + std::make_shared(SchemaField::MakeRequired( + 2, ListType::kElementName, iceberg::uuid())))}); + + auto list_values = MakeUuidArray({&kUuidBytes1, &kUuidBytes2, &kUuidBytes1}); + auto list_offsets = MakeInt32Array({0, 2, 3}); + auto list_type = ::arrow::list(::arrow::field(std::string(ListType::kElementName), + ::arrow::extension::uuid(), + /*nullable=*/false)); + auto list_array = + ::arrow::ListArray::FromArrays(list_type, *list_offsets, *list_values).ValueOrDie(); + + auto array = + ::arrow::StructArray::Make( + {list_array}, {::arrow::field("uuid_list", list_type, /*nullable=*/false)}) + .ValueOrDie(); + + ASSERT_NO_FATAL_FAILURE(WriteArrowArrayAndVerify(schema, array)); +} + +TEST_P(AvroWriterTest, WriteUuidMapType) { + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired( + 1, "uuid_map", + std::make_shared( + SchemaField::MakeRequired(2, MapType::kKeyName, iceberg::string()), + SchemaField::MakeRequired(3, MapType::kValueName, iceberg::uuid())))}); + + auto map_offsets = MakeInt32Array({0, 2, 3}); + auto map_keys = MakeStringArray({"first", "second", "only"}); + auto map_items = MakeUuidArray({&kUuidBytes1, &kUuidBytes2, &kUuidBytes1}); + auto map_type = + ::arrow::map(::arrow::utf8(), ::arrow::field(std::string(MapType::kValueName), + ::arrow::extension::uuid(), + /*nullable=*/false)); + auto map_array = + ::arrow::MapArray::FromArrays(map_type, map_offsets, map_keys, map_items) + .ValueOrDie(); + + auto array = + ::arrow::StructArray::Make( + {map_array}, {::arrow::field("uuid_map", map_type, /*nullable=*/false)}) + .ValueOrDie(); + + ASSERT_NO_FATAL_FAILURE(WriteArrowArrayAndVerify(schema, array)); +} + +TEST_P(AvroWriterTest, WriteUuidMapKeyType) { + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired( + 1, "uuid_key_map", + std::make_shared( + SchemaField::MakeRequired(2, MapType::kKeyName, iceberg::uuid()), + SchemaField::MakeRequired(3, MapType::kValueName, iceberg::string())))}); + + auto map_offsets = MakeInt32Array({0, 2, 3}); + auto map_keys = MakeUuidArray({&kUuidBytes1, &kUuidBytes2, &kUuidBytes1}); + auto map_items = MakeStringArray({"first", "second", "only"}); + auto map_type = + ::arrow::map(::arrow::extension::uuid(), + ::arrow::field(std::string(MapType::kValueName), ::arrow::utf8(), + /*nullable=*/false)); + auto map_array = + ::arrow::MapArray::FromArrays(map_type, map_offsets, map_keys, map_items) + .ValueOrDie(); + + auto array = + ::arrow::StructArray::Make( + {map_array}, {::arrow::field("uuid_key_map", map_type, /*nullable=*/false)}) + .ValueOrDie(); + + ASSERT_NO_FATAL_FAILURE(WriteArrowArrayAndVerify(schema, array)); +} + TEST_P(AvroWriterTest, WriteTemporalTypes) { auto schema = std::make_shared(std::vector{ SchemaField::MakeRequired(1, "date_col", std::make_shared()), diff --git a/src/iceberg/test/parquet_test.cc b/src/iceberg/test/parquet_test.cc index ee1cbc931..88c337603 100644 --- a/src/iceberg/test/parquet_test.cc +++ b/src/iceberg/test/parquet_test.cc @@ -17,13 +17,16 @@ * under the License. */ +#include #include #include #include #include #include +#include #include +#include #include #include #include @@ -52,6 +55,7 @@ #include "iceberg/type.h" #include "iceberg/util/checked_cast.h" #include "iceberg/util/macros.h" +#include "iceberg/util/uuid.h" namespace iceberg::parquet { @@ -150,6 +154,13 @@ std::optional FirstUnavailableParquetCodec() { return std::nullopt; } +constexpr std::array kUuidBytes1 = { + 0x12, 0x3e, 0x45, 0x67, 0xe8, 0x9b, 0x12, 0xd3, + 0xa4, 0x56, 0x42, 0x66, 0x14, 0x17, 0x40, 0x00}; +constexpr std::array kUuidBytes2 = { + 0xf7, 0x9c, 0x3e, 0x09, 0x67, 0x7c, 0x4b, 0xbd, + 0xa4, 0x79, 0x3f, 0x34, 0x9c, 0xb7, 0x85, 0xe7}; + } // namespace class ParquetReaderTest : public TempFileTestBase { @@ -771,4 +782,29 @@ TEST_F(ParquetReadWrite, SimpleTypeRoundTrip) { ASSERT_TRUE(out->Equals(*array)); } +TEST_F(ParquetReadWrite, UuidRoundTrip) { + auto schema = std::make_shared( + std::vector{SchemaField::MakeRequired(1, "uuid_col", uuid())}); + + ::arrow::FixedSizeBinaryBuilder uuid_storage_builder( + ::arrow::fixed_size_binary(Uuid::kLength)); + ASSERT_TRUE(uuid_storage_builder.Append(kUuidBytes1.data()).ok()); + ASSERT_TRUE(uuid_storage_builder.Append(kUuidBytes2.data()).ok()); + auto uuid_storage = uuid_storage_builder.Finish().ValueOrDie(); + auto uuid_array = + ::arrow::ExtensionType::WrapArray(::arrow::extension::uuid(), uuid_storage); + auto array = + ::arrow::StructArray::Make( + {uuid_array}, + {::arrow::field("uuid_col", ::arrow::extension::uuid(), /*nullable=*/false)}) + .ValueOrDie(); + + std::shared_ptr<::arrow::Array> out; + DoRoundtrip(array, schema, out); + + ASSERT_TRUE(out->Equals(*array)) << "actual:\n" + << out->ToString() << "\nexpected:\n" + << array->ToString(); +} + } // namespace iceberg::parquet diff --git a/src/iceberg/test/struct_like_test.cc b/src/iceberg/test/struct_like_test.cc index 97df61b8d..ad19d6a09 100644 --- a/src/iceberg/test/struct_like_test.cc +++ b/src/iceberg/test/struct_like_test.cc @@ -17,6 +17,11 @@ * under the License. */ +#include "iceberg/row/struct_like.h" + +#include +#include + #include #include #include @@ -24,6 +29,7 @@ #include #include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/expression/literal.h" #include "iceberg/manifest/manifest_list.h" #include "iceberg/manifest/manifest_reader_internal.h" #include "iceberg/row/arrow_array_wrapper.h" @@ -32,6 +38,7 @@ #include "iceberg/schema_internal.h" #include "iceberg/test/matchers.h" #include "iceberg/type.h" +#include "iceberg/util/uuid.h" namespace iceberg { @@ -59,6 +66,27 @@ namespace iceberg { ASSERT_TRUE(std::holds_alternative(scalar)); \ } while (0) +namespace { + +class SingleFieldStructLike : public StructLike { + public: + explicit SingleFieldStructLike(Scalar value) : value_(std::move(value)) {} + + Result GetField(size_t pos) const override { + if (pos != 0) { + return InvalidArgument("Field index {} out of range", pos); + } + return value_; + } + + size_t num_fields() const override { return 1; } + + private: + Scalar value_; +}; + +} // namespace + TEST(ManifestFileStructLike, BasicFields) { ManifestFile manifest_file{ .manifest_path = "/path/to/manifest.avro", @@ -99,6 +127,49 @@ TEST(ManifestFileStructLike, BasicFields) { EXPECT_THAT(struct_like.GetField(100), IsError(ErrorKind::kInvalidArgument)); } +TEST(LiteralToScalarTest, Uuid) { + ICEBERG_UNWRAP_OR_FAIL(auto uuid, + Uuid::FromString("123e4567-e89b-12d3-a456-426614174000")); + auto literal = Literal::UUID(uuid); + + ICEBERG_UNWRAP_OR_FAIL(auto scalar, LiteralToScalar(literal)); + ASSERT_TRUE(std::holds_alternative(scalar)); + + auto value = std::get(scalar); + ASSERT_EQ(value.size(), Uuid::kLength); + + const auto& expected_bytes = uuid.bytes(); + for (size_t i = 0; i < expected_bytes.size(); ++i) { + EXPECT_EQ(static_cast(static_cast(value[i])), + expected_bytes[i]); + } +} + +TEST(StructLikeAccessorTest, GetLiteralUuid) { + ICEBERG_UNWRAP_OR_FAIL(auto uuid, + Uuid::FromString("123e4567-e89b-12d3-a456-426614174000")); + const auto& bytes = uuid.bytes(); + std::string_view uuid_data(reinterpret_cast(bytes.data()), bytes.size()); + SingleFieldStructLike row(Scalar{uuid_data}); + std::array path = {0}; + StructLikeAccessor accessor(iceberg::uuid(), path); + + ICEBERG_UNWRAP_OR_FAIL(auto literal, accessor.GetLiteral(row)); + EXPECT_EQ(literal.type()->type_id(), TypeId::kUuid); + ASSERT_TRUE(std::holds_alternative(literal.value())); + EXPECT_EQ(std::get(literal.value()), uuid); +} + +TEST(StructLikeAccessorTest, GetLiteralUuidRejectsWrongLength) { + SingleFieldStructLike row(Scalar{std::string_view("not-a-uuid")}); + std::array path = {0}; + StructLikeAccessor accessor(iceberg::uuid(), path); + + auto result = accessor.GetLiteral(row); + EXPECT_THAT(result, IsError(ErrorKind::kInvalidArgument)); + EXPECT_THAT(result, HasErrorMessage("UUID byte array must be exactly 16 bytes")); +} + TEST(ManifestFileStructLike, OptionalFields) { ManifestFile manifest_file{.manifest_path = "/path/to/manifest2.avro", .manifest_length = 54321, From 9fb4a2b2ed08e1ad1483355c950b54ac33766c40 Mon Sep 17 00:00:00 2001 From: wzhuo Date: Wed, 1 Jul 2026 15:42:24 +0800 Subject: [PATCH 141/151] feat: add ArrowRowBuilder for materializing Arrow batches (#780) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds `ArrowRowBuilder` (`arrow_row_builder_internal.h` / `arrow_row_builder.cc`), a schema-driven RAII helper that materializes in-memory rows into an Arrow `ArrowArray` (a struct batch) for an arbitrary Iceberg schema. It wraps the nanoarrow boilerplate and exposes per-column access plus typed append free functions, so metadata tables (snapshots, history, manifests, …) can emit rows without re-implementing it. This is the first of a series splitting metadata-table support into focused PRs; the `InMemoryBatchReader` and the `SnapshotsTable::Scan` integration are intended to follow in separate PRs that build on this. ## What's included - **`ArrowRowBuilder`** — a single RAII class (move-only) with `Make(const Schema&)` and `Make(const ArrowSchema*)` overloads. Handles the full nanoarrow lifecycle: `InitFromSchema` → `StartAppending` → … append values … → `FinishBuilding` → `Release`. The `ArrowArray` is guarded immediately after `InitFromSchema` so a failure in `StartAppending` releases it automatically. - **`ArrowArrayGuard::Release()`** — added to the existing guard so other call sites (`position_delete_writer`, `manifest_adapter`) can reuse the RAII-release pattern instead of manually managing nanoarrow resources. - **Free functions** in the `iceberg` namespace: `AppendNull`, `AppendBoolean`, `AppendInt` (covers int32/int64/timestamp via nanoarrow's int64), `AppendString`, `AppendStringMap`. - The implementation lives at the **core** `iceberg` library level — it only needs nanoarrow + `ToArrowSchema` (no Apache Arrow), matching peers like `manifest_adapter` and `arrow_c_data_util`. - Unit tests in `arrow_row_builder_test.cc` covering typed appends (int32/string/int64/boolean/map), null handling for optional columns, multi-entry/empty string maps, zero-row batches, and column-index bounds. Compiled into the `iceberg-data-test` test target. ## Testing - CMake (Ninja): `cmake --build build --target iceberg-data-test` then ran the test binary — 5/5 `ArrowRowBuilderTest` tests pass. `ctest` green. - The test verifies output by importing the produced C-data into Apache Arrow (`arrow::ImportRecordBatch`), so its target is under `USE_BUNDLE`. ## Notes - The test is registered under CMake's bundle build only. The meson build (which has no Apache Arrow/bundle layer) is left unchanged; the core-only test target continues to build there. - Developed with AI-assisted tooling, reviewed by the author. --- src/iceberg/CMakeLists.txt | 3 +- src/iceberg/arrow_c_data_guard_internal.h | 6 + src/iceberg/arrow_row_builder.cc | 137 ++++++++++++++++ src/iceberg/arrow_row_builder_internal.h | 126 ++++++++++++++ src/iceberg/meson.build | 1 + src/iceberg/test/CMakeLists.txt | 4 +- src/iceberg/test/arrow_row_builder_test.cc | 181 +++++++++++++++++++++ 7 files changed, 456 insertions(+), 2 deletions(-) create mode 100644 src/iceberg/arrow_row_builder.cc create mode 100644 src/iceberg/arrow_row_builder_internal.h create mode 100644 src/iceberg/test/arrow_row_builder_test.cc diff --git a/src/iceberg/CMakeLists.txt b/src/iceberg/CMakeLists.txt index a8fd7dfe6..de101be0b 100644 --- a/src/iceberg/CMakeLists.txt +++ b/src/iceberg/CMakeLists.txt @@ -18,8 +18,9 @@ set(ICEBERG_INCLUDES "$" "$") set(ICEBERG_SOURCES - arrow_c_data_util.cc arrow_c_data_guard_internal.cc + arrow_c_data_util.cc + arrow_row_builder.cc catalog/memory/in_memory_catalog.cc catalog/session_catalog.cc catalog/session_context.cc diff --git a/src/iceberg/arrow_c_data_guard_internal.h b/src/iceberg/arrow_c_data_guard_internal.h index 04603b0fe..f624f74c5 100644 --- a/src/iceberg/arrow_c_data_guard_internal.h +++ b/src/iceberg/arrow_c_data_guard_internal.h @@ -31,6 +31,12 @@ class ICEBERG_EXPORT ArrowArrayGuard { explicit ArrowArrayGuard(ArrowArray* array) : array_(array) {} ~ArrowArrayGuard(); + /// \brief Release the guard without calling ArrowArrayRelease. + /// + /// Call this when ownership of the underlying ArrowArray has been + /// transferred elsewhere and the guard should not release it. + void Release() { array_ = nullptr; } + private: ArrowArray* array_; }; diff --git a/src/iceberg/arrow_row_builder.cc b/src/iceberg/arrow_row_builder.cc new file mode 100644 index 000000000..b53c881bb --- /dev/null +++ b/src/iceberg/arrow_row_builder.cc @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include + +#include + +#include "iceberg/arrow/nanoarrow_status_internal.h" +#include "iceberg/arrow_c_data_guard_internal.h" +#include "iceberg/arrow_row_builder_internal.h" +#include "iceberg/schema.h" +#include "iceberg/schema_internal.h" + +namespace iceberg { + +Result ArrowRowBuilder::Make(const Schema& schema) { + ArrowSchema arrow_schema; + ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(schema, &arrow_schema)); + internal::ArrowSchemaGuard schema_guard(&arrow_schema); + return Make(&arrow_schema); +} + +Result ArrowRowBuilder::Make(const ArrowSchema* schema) { + ArrowRowBuilder builder; + ArrowError error; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayInitFromSchema(&builder.array_, schema, &error), error); + // Guard the array in case StartAppending fails. + internal::ArrowArrayGuard guard(&builder.array_); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayStartAppending(&builder.array_)); + // Ownership stays with the builder — disarm the guard. + guard.Release(); + return builder; +} + +ArrowRowBuilder::ArrowRowBuilder(ArrowRowBuilder&& other) noexcept + : array_(other.array_) { + other.array_.release = nullptr; +} + +ArrowRowBuilder& ArrowRowBuilder::operator=(ArrowRowBuilder&& other) noexcept { + if (this != &other) { + if (array_.release != nullptr) { + ArrowArrayRelease(&array_); + } + array_ = other.array_; + other.array_.release = nullptr; + } + return *this; +} + +ArrowRowBuilder::~ArrowRowBuilder() { + if (array_.release != nullptr) { + ArrowArrayRelease(&array_); + } +} + +int64_t ArrowRowBuilder::num_columns() const { return array_.n_children; } + +ArrowArray* ArrowRowBuilder::column(int64_t index) { + if (index < 0 || index >= array_.n_children) { + return nullptr; + } + return array_.children[index]; +} + +Status ArrowRowBuilder::FinishRow() { + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(&array_)); + return {}; +} + +Result ArrowRowBuilder::Finish() && { + ArrowError error; + ICEBERG_NANOARROW_RETURN_UNEXPECTED_WITH_ERROR( + ArrowArrayFinishBuildingDefault(&array_, &error), error); + ArrowArray result = array_; + array_.release = nullptr; + return result; +} + +Status AppendNull(ArrowArray* array) { + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendNull(array, 1)); + return {}; +} + +Status AppendBoolean(ArrowArray* array, bool value) { + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendInt(array, value ? 1 : 0)); + return {}; +} + +Status AppendInt(ArrowArray* array, int64_t value) { + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendInt(array, value)); + return {}; +} + +Status AppendString(ArrowArray* array, std::string_view value) { + ArrowStringView view(value.data(), static_cast(value.size())); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayAppendString(array, view)); + return {}; +} + +Status AppendStringMap(ArrowArray* array, + const std::unordered_map& entries) { + // A nanoarrow map array is a list of struct. children[0] is the + // entries struct, whose children[0]/children[1] are the key/value builders. + ArrowArray* struct_array = array->children[0]; + ArrowArray* key_array = struct_array->children[0]; + ArrowArray* value_array = struct_array->children[1]; + + for (const auto& [key, value] : entries) { + ICEBERG_RETURN_UNEXPECTED(AppendString(key_array, key)); + ICEBERG_RETURN_UNEXPECTED(AppendString(value_array, value)); + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(struct_array)); + } + + // Finish the (possibly empty) map element on the outer list. + ICEBERG_NANOARROW_RETURN_UNEXPECTED(ArrowArrayFinishElement(array)); + return {}; +} + +} // namespace iceberg diff --git a/src/iceberg/arrow_row_builder_internal.h b/src/iceberg/arrow_row_builder_internal.h new file mode 100644 index 000000000..f3fd2b499 --- /dev/null +++ b/src/iceberg/arrow_row_builder_internal.h @@ -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. + */ + +#pragma once + +/// \file iceberg/arrow_row_builder_internal.h +/// Internal Arrow row-building utilities shared by metadata tables. +/// +/// Metadata tables (snapshots, history, manifests, ...) materialize in-memory +/// structures into Arrow batches that conform to the table's Iceberg schema. +/// `ArrowRowBuilder` wraps a nanoarrow `ArrowArray` initialized from such a +/// schema and exposes per-column access plus typed append helpers so each +/// metadata table can emit rows without re-implementing the nanoarrow +/// boilerplate. + +#include +#include +#include + +#include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_export.h" +#include "iceberg/result.h" +#include "iceberg/type_fwd.h" + +namespace iceberg { + +/// \brief Movable RAII builder that materializes rows into an Arrow struct array. +/// +/// Handles the nanoarrow lifecycle: InitFromSchema → StartAppending → +/// ... append values ... → FinishBuilding → Release. +/// +/// Two constructors: +/// - `Make(schema)` accepts an Iceberg Schema (typical for metadata tables). +/// - `Make(arrow_schema)` accepts a raw ArrowSchema (for lower-level callers +/// like position_delete_writer or manifest_adapter). +/// +/// Typical usage: +/// \code +/// ICEBERG_ASSIGN_OR_RAISE(auto builder, ArrowRowBuilder::Make(schema)); +/// for (const auto& row : rows) { +/// ICEBERG_RETURN_UNEXPECTED(AppendInt(builder.column(0), row.id)); +/// ICEBERG_RETURN_UNEXPECTED(AppendString(builder.column(1), row.name)); +/// ICEBERG_RETURN_UNEXPECTED(builder.FinishRow()); +/// } +/// ICEBERG_ASSIGN_OR_RAISE(auto array, std::move(builder).Finish()); +/// \endcode +class ICEBERG_EXPORT ArrowRowBuilder { + public: + /// \brief Create a row builder from an Iceberg schema. + static Result Make(const Schema& schema); + + /// \brief Create a row builder from an ArrowSchema. + /// + /// The schema must outlive this call (the caller guards it). On failure the + /// partially-initialized array is released automatically. + static Result Make(const ArrowSchema* schema); + + ArrowRowBuilder(ArrowRowBuilder&& other) noexcept; + ArrowRowBuilder& operator=(ArrowRowBuilder&& other) noexcept; + + ArrowRowBuilder(const ArrowRowBuilder&) = delete; + ArrowRowBuilder& operator=(const ArrowRowBuilder&) = delete; + + ~ArrowRowBuilder(); + + /// \brief The number of top-level columns in the batch. + int64_t num_columns() const; + + /// \brief Access the nanoarrow child builder for a top-level column. + /// + /// \param index Zero-based column index. Returns nullptr if out of range. + ArrowArray* column(int64_t index); + + /// \brief Finish the current row, advancing the struct length by one. + /// + /// Call after appending exactly one value (or null) to every column. + Status FinishRow(); + + /// \brief Finish building and transfer ownership of the resulting array. + /// + /// The builder must not be used after this call. + Result Finish() &&; + + private: + ArrowRowBuilder() = default; + ArrowArray array_{}; +}; + +/// \brief Append a null to a nanoarrow array builder. +ICEBERG_EXPORT Status AppendNull(ArrowArray* array); + +/// \brief Append a boolean value to a nanoarrow array builder. +ICEBERG_EXPORT Status AppendBoolean(ArrowArray* array, bool value); + +/// \brief Append an integer value to a nanoarrow array builder. +/// +/// Works for int32/int64/timestamp columns, which nanoarrow stores as int64. +ICEBERG_EXPORT Status AppendInt(ArrowArray* array, int64_t value); + +/// \brief Append a string value to a nanoarrow array builder. +ICEBERG_EXPORT Status AppendString(ArrowArray* array, std::string_view value); + +/// \brief Append a map value to a nanoarrow map array builder. +/// +/// Appends one (possibly empty) map element. The iteration order of the +/// resulting entries is unspecified. +ICEBERG_EXPORT Status AppendStringMap( + ArrowArray* array, const std::unordered_map& entries); + +} // namespace iceberg diff --git a/src/iceberg/meson.build b/src/iceberg/meson.build index 149bdecad..4c7960ae6 100644 --- a/src/iceberg/meson.build +++ b/src/iceberg/meson.build @@ -45,6 +45,7 @@ iceberg_include_dir = include_directories('..') iceberg_sources = files( 'arrow_c_data_guard_internal.cc', 'arrow_c_data_util.cc', + 'arrow_row_builder.cc', 'catalog/memory/in_memory_catalog.cc', 'catalog/session_catalog.cc', 'catalog/session_context.cc', diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index e4d85bc98..892f18029 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -89,7 +89,6 @@ add_iceberg_test(schema_test add_iceberg_test(table_test SOURCES location_provider_test.cc - metadata_table_test.cc metrics_config_test.cc metrics_reporter_test.cc metrics_test.cc @@ -189,6 +188,8 @@ if(ICEBERG_BUILD_BUNDLE) add_iceberg_test(catalog_test USE_BUNDLE SOURCES in_memory_catalog_test.cc) + add_iceberg_test(metadata_table_test USE_BUNDLE SOURCES metadata_table_test.cc) + add_iceberg_test(eval_expr_test USE_BUNDLE SOURCES @@ -251,6 +252,7 @@ if(ICEBERG_BUILD_BUNDLE) USE_BUNDLE SOURCES arrow_c_data_util_test.cc + arrow_row_builder_test.cc data_writer_test.cc delete_filter_test.cc delete_loader_test.cc diff --git a/src/iceberg/test/arrow_row_builder_test.cc b/src/iceberg/test/arrow_row_builder_test.cc new file mode 100644 index 000000000..45fb3b787 --- /dev/null +++ b/src/iceberg/test/arrow_row_builder_test.cc @@ -0,0 +1,181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/// \file arrow_row_builder_test.cc +/// Unit tests for ArrowRowBuilder and its typed append helpers. + +#include +#include + +#include +#include +#include +#include + +#include "iceberg/arrow_row_builder_internal.h" +#include "iceberg/schema.h" +#include "iceberg/schema_field.h" +#include "iceberg/schema_internal.h" +#include "iceberg/test/matchers.h" +#include "iceberg/type.h" + +namespace iceberg { +namespace { + +/// \brief A schema exercising every append helper: int32, string, int64, +/// boolean, and map. +std::shared_ptr MakeTestSchema() { + return std::make_shared(std::vector{ + SchemaField::MakeRequired(1, "id", int32()), + SchemaField::MakeOptional(2, "name", string()), + SchemaField::MakeOptional(3, "count", int64()), + SchemaField::MakeOptional(4, "active", boolean()), + SchemaField::MakeOptional( + 5, "props", + std::make_shared(SchemaField::MakeRequired(6, "key", string()), + SchemaField::MakeRequired(7, "value", string())))}); +} + +/// \brief Finish a builder and import the result into an Arrow RecordBatch. +std::shared_ptr<::arrow::RecordBatch> FinishAndImport(ArrowRowBuilder builder, + const Schema& schema) { + auto array_result = std::move(builder).Finish(); + EXPECT_THAT(array_result, IsOk()); + + ArrowSchema c_schema; + EXPECT_THAT(ToArrowSchema(schema, &c_schema), IsOk()); + auto arrow_schema = ::arrow::ImportSchema(&c_schema).ValueOrDie(); + + // ImportRecordBatch takes ownership of the array and releases it. + return ::arrow::ImportRecordBatch(&array_result.value(), arrow_schema).ValueOrDie(); +} + +} // namespace + +TEST(ArrowRowBuilderTest, BuildsRowsWithTypedValues) { + auto schema = MakeTestSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto builder, ArrowRowBuilder::Make(*schema)); + + ASSERT_EQ(builder.num_columns(), 5); + + // Row 0 + ASSERT_THAT(AppendInt(builder.column(0), 1), IsOk()); + ASSERT_THAT(AppendString(builder.column(1), "alice"), IsOk()); + ASSERT_THAT(AppendInt(builder.column(2), 100), IsOk()); + ASSERT_THAT(AppendBoolean(builder.column(3), true), IsOk()); + ASSERT_THAT(AppendStringMap(builder.column(4), {{"k", "v"}}), IsOk()); + ASSERT_THAT(builder.FinishRow(), IsOk()); + + // Row 1 + ASSERT_THAT(AppendInt(builder.column(0), 2), IsOk()); + ASSERT_THAT(AppendString(builder.column(1), "bob"), IsOk()); + ASSERT_THAT(AppendInt(builder.column(2), 200), IsOk()); + ASSERT_THAT(AppendBoolean(builder.column(3), false), IsOk()); + ASSERT_THAT(AppendStringMap(builder.column(4), {}), IsOk()); + ASSERT_THAT(builder.FinishRow(), IsOk()); + + auto batch = FinishAndImport(std::move(builder), *schema); + ASSERT_EQ(batch->num_rows(), 2); + ASSERT_EQ(batch->num_columns(), 5); + + auto id = std::static_pointer_cast<::arrow::Int32Array>(batch->column(0)); + EXPECT_EQ(id->Value(0), 1); + EXPECT_EQ(id->Value(1), 2); + + auto name = std::static_pointer_cast<::arrow::StringArray>(batch->column(1)); + EXPECT_EQ(name->GetString(0), "alice"); + EXPECT_EQ(name->GetString(1), "bob"); + + auto count = std::static_pointer_cast<::arrow::Int64Array>(batch->column(2)); + EXPECT_EQ(count->Value(0), 100); + EXPECT_EQ(count->Value(1), 200); + + auto active = std::static_pointer_cast<::arrow::BooleanArray>(batch->column(3)); + EXPECT_TRUE(active->Value(0)); + EXPECT_FALSE(active->Value(1)); + + // props: one entry in row 0, empty (but non-null) map in row 1. + auto props = std::static_pointer_cast<::arrow::MapArray>(batch->column(4)); + EXPECT_FALSE(props->IsNull(0)); + EXPECT_FALSE(props->IsNull(1)); + EXPECT_EQ(props->value_length(0), 1); + EXPECT_EQ(props->value_length(1), 0); +} + +TEST(ArrowRowBuilderTest, AppendsNullForOptionalColumns) { + auto schema = MakeTestSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto builder, ArrowRowBuilder::Make(*schema)); + + ASSERT_THAT(AppendInt(builder.column(0), 42), IsOk()); + ASSERT_THAT(AppendNull(builder.column(1)), IsOk()); + ASSERT_THAT(AppendNull(builder.column(2)), IsOk()); + ASSERT_THAT(AppendNull(builder.column(3)), IsOk()); + ASSERT_THAT(AppendStringMap(builder.column(4), {}), IsOk()); + ASSERT_THAT(builder.FinishRow(), IsOk()); + + auto batch = FinishAndImport(std::move(builder), *schema); + ASSERT_EQ(batch->num_rows(), 1); + + auto id = std::static_pointer_cast<::arrow::Int32Array>(batch->column(0)); + EXPECT_FALSE(id->IsNull(0)); + EXPECT_EQ(id->Value(0), 42); + + EXPECT_TRUE(batch->column(1)->IsNull(0)); + EXPECT_TRUE(batch->column(2)->IsNull(0)); + EXPECT_TRUE(batch->column(3)->IsNull(0)); +} + +TEST(ArrowRowBuilderTest, AppendsMultiEntryStringMap) { + auto schema = MakeTestSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto builder, ArrowRowBuilder::Make(*schema)); + + ASSERT_THAT(AppendInt(builder.column(0), 1), IsOk()); + ASSERT_THAT(AppendNull(builder.column(1)), IsOk()); + ASSERT_THAT(AppendNull(builder.column(2)), IsOk()); + ASSERT_THAT(AppendNull(builder.column(3)), IsOk()); + ASSERT_THAT(AppendStringMap(builder.column(4), {{"a", "1"}, {"b", "2"}, {"c", "3"}}), + IsOk()); + ASSERT_THAT(builder.FinishRow(), IsOk()); + + auto batch = FinishAndImport(std::move(builder), *schema); + auto props = std::static_pointer_cast<::arrow::MapArray>(batch->column(4)); + EXPECT_EQ(props->value_length(0), 3); +} + +TEST(ArrowRowBuilderTest, EmptyBuilderProducesZeroRowBatch) { + auto schema = MakeTestSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto builder, ArrowRowBuilder::Make(*schema)); + + auto batch = FinishAndImport(std::move(builder), *schema); + EXPECT_EQ(batch->num_rows(), 0); + EXPECT_EQ(batch->num_columns(), 5); +} + +TEST(ArrowRowBuilderTest, ColumnIndexOutOfRangeReturnsNull) { + auto schema = MakeTestSchema(); + ICEBERG_UNWRAP_OR_FAIL(auto builder, ArrowRowBuilder::Make(*schema)); + + EXPECT_EQ(builder.num_columns(), 5); + EXPECT_NE(builder.column(0), nullptr); + EXPECT_NE(builder.column(4), nullptr); + EXPECT_EQ(builder.column(-1), nullptr); + EXPECT_EQ(builder.column(5), nullptr); +} + +} // namespace iceberg From 9bf1ba1b2fb18012f1b7ad2323a54dec40718329 Mon Sep 17 00:00:00 2001 From: Gang Wu Date: Wed, 1 Jul 2026 18:02:47 +0800 Subject: [PATCH 142/151] feat: retry stale v3 snapshot row-lineage validation (#794) Add a retryable validation error kind and use it for add-snapshot stale sequence-number and stale first-row-id checks, matching Java Iceberg's RetryableValidationException behavior. Include the new retryable validation kind in commit retry policy, while preserving normal validation failures for mixed/non-retryable builder errors. Add focused v3 row-lineage tests for multi-file assignment, branch commits, retry reassignment, stale snapshot validation, and delete-manifest null first_row_id handling. --- src/iceberg/result.h | 2 + src/iceberg/table_metadata.cc | 22 +-- .../test/manifest_list_versions_test.cc | 9 ++ .../test/merging_snapshot_update_test.cc | 136 +++++++++++++++++- src/iceberg/test/retry_util_test.cc | 21 +++ src/iceberg/test/table_update_test.cc | 70 +++++++++ src/iceberg/util/error_collector.h | 10 +- src/iceberg/util/retry_util.h | 3 +- 8 files changed, 256 insertions(+), 17 deletions(-) diff --git a/src/iceberg/result.h b/src/iceberg/result.h index 8765f852a..4b4d0e7fb 100644 --- a/src/iceberg/result.h +++ b/src/iceberg/result.h @@ -61,6 +61,7 @@ enum class ErrorKind { kNotImplemented, kNotSupported, kRestError, + kRetryableValidationFailed, kServiceUnavailable, kTokenExpired, kUnknownError, @@ -127,6 +128,7 @@ DEFINE_ERROR_FUNCTION(NotFound) DEFINE_ERROR_FUNCTION(NotImplemented) DEFINE_ERROR_FUNCTION(NotSupported) DEFINE_ERROR_FUNCTION(RestError) +DEFINE_ERROR_FUNCTION(RetryableValidationFailed) DEFINE_ERROR_FUNCTION(ServiceUnavailable) DEFINE_ERROR_FUNCTION(TokenExpired) DEFINE_ERROR_FUNCTION(UnknownError) diff --git a/src/iceberg/table_metadata.cc b/src/iceberg/table_metadata.cc index ef2f1bf38..83ae47351 100644 --- a/src/iceberg/table_metadata.cc +++ b/src/iceberg/table_metadata.cc @@ -1071,12 +1071,13 @@ Status TableMetadataBuilder::Impl::AddSnapshot(std::shared_ptr snapsho "Attempting to add a snapshot before a sort order is added"); ICEBERG_CHECK(!snapshots_by_id_.contains(snapshot->snapshot_id), "Snapshot already exists for id: {}", snapshot->snapshot_id); - ICEBERG_CHECK( - metadata_.format_version == 1 || - snapshot->sequence_number > metadata_.last_sequence_number || - !snapshot->parent_snapshot_id.has_value(), - "Cannot add snapshot with sequence number {} older than last sequence number {}", - snapshot->sequence_number, metadata_.last_sequence_number); + if (metadata_.format_version != 1 && + snapshot->sequence_number <= metadata_.last_sequence_number && + snapshot->parent_snapshot_id.has_value()) { + return RetryableValidationFailed( + "Cannot add snapshot with sequence number {} older than last sequence number {}", + snapshot->sequence_number, metadata_.last_sequence_number); + } metadata_.last_sequence_number = snapshot->sequence_number; metadata_.snapshots.push_back(snapshot); @@ -1087,10 +1088,11 @@ Status TableMetadataBuilder::Impl::AddSnapshot(std::shared_ptr snapsho ICEBERG_ASSIGN_OR_RAISE(auto first_row_id, snapshot->FirstRowId()); ICEBERG_CHECK(first_row_id.has_value(), "Cannot add a snapshot: first-row-id is null"); - ICEBERG_CHECK( - first_row_id.value() >= metadata_.next_row_id, - "Cannot add a snapshot, first-row-id is behind table next-row-id: {} < {}", - first_row_id.value(), metadata_.next_row_id); + if (first_row_id.value() < metadata_.next_row_id) { + return RetryableValidationFailed( + "Cannot add a snapshot, first-row-id is behind table next-row-id: {} < {}", + first_row_id.value(), metadata_.next_row_id); + } ICEBERG_ASSIGN_OR_RAISE(auto add_rows, snapshot->AddedRows()); ICEBERG_CHECK(add_rows.has_value(), "Cannot add a snapshot: added-rows is null"); diff --git a/src/iceberg/test/manifest_list_versions_test.cc b/src/iceberg/test/manifest_list_versions_test.cc index b173d56e7..ce0eb9da1 100644 --- a/src/iceberg/test/manifest_list_versions_test.cc +++ b/src/iceberg/test/manifest_list_versions_test.cc @@ -328,6 +328,15 @@ TEST_F(TestManifestListVersions, TestV3WriteMixedRowIdAssignment) { std::make_optional(kSnapshotFirstRowId + kAddedRows + kExistingRows)); } +TEST_F(TestManifestListVersions, TestV3DeleteRowIdNull) { + const auto manifest_list_path = + WriteManifestList(/*format_version=*/3, kSnapshotFirstRowId, {kDeleteManifest}); + + auto manifest = ReadManifestList(manifest_list_path); + EXPECT_EQ(manifest.content, ManifestContent::kDeletes); + EXPECT_FALSE(manifest.first_row_id.has_value()); +} + TEST_F(TestManifestListVersions, TestV1ForwardCompatibility) { std::string manifest_list_path = WriteManifestList(/*format_version=*/1, kSnapshotFirstRowId, {kTestManifest}); diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc index af5b073ca..b51a544df 100644 --- a/src/iceberg/test/merging_snapshot_update_test.cc +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -45,9 +46,12 @@ #include "iceberg/table_properties.h" #include "iceberg/test/executor.h" #include "iceberg/test/matchers.h" +#include "iceberg/test/retry.h" #include "iceberg/test/update_test_base.h" #include "iceberg/transaction.h" #include "iceberg/update/fast_append.h" +#include "iceberg/update/merge_append.h" +#include "iceberg/update/snapshot_manager.h" #include "iceberg/update/update_properties.h" #include "iceberg/util/macros.h" @@ -276,6 +280,13 @@ class MergingSnapshotUpdateTest : public MinimalUpdateTestBase { return TestOverwriteUpdate::Make(TableName(), table_); } + void UpgradeTableToV3() { + ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); + props->Set(TableProperties::kFormatVersion.key(), "3"); + EXPECT_THAT(props->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + } + void SetTableFormatVersion(int8_t format_version) { table_->metadata()->format_version = format_version; } @@ -311,6 +322,22 @@ class MergingSnapshotUpdateTest : public MinimalUpdateTestBase { return result; } + Result>> DataFileFirstRowIds( + const std::shared_ptr& snapshot, const TableMetadata& metadata) { + SnapshotCache snapshot_cache(snapshot.get()); + ICEBERG_ASSIGN_OR_RAISE(auto manifest_range, snapshot_cache.DataManifests(file_io_)); + std::vector manifests(manifest_range.begin(), manifest_range.end()); + ICEBERG_ASSIGN_OR_RAISE(auto entries, ReadAllEntries(manifests, metadata)); + + std::unordered_map> first_row_ids; + for (const auto& entry : entries) { + if (entry.data_file != nullptr) { + first_row_ids.emplace(entry.data_file->file_path, entry.data_file->first_row_id); + } + } + return first_row_ids; + } + // Write a manifest file containing the given data files. // Returns a ManifestFile with added_snapshot_id = kInvalidSnapshotId so it // is eligible for snapshot ID inheritance. @@ -448,10 +475,7 @@ TEST_F(MergingSnapshotUpdateTest, CommitNewDataFile) { } TEST_F(MergingSnapshotUpdateTest, CommitV3NewDataFileAssignsRowLineage) { - ICEBERG_UNWRAP_OR_FAIL(auto props, table_->NewUpdateProperties()); - props->Set(TableProperties::kFormatVersion.key(), "3"); - EXPECT_THAT(props->Commit(), IsOk()); - EXPECT_THAT(table_->Refresh(), IsOk()); + UpgradeTableToV3(); ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); EXPECT_THAT(op->AddFile(file_a_), IsOk()); @@ -466,6 +490,110 @@ TEST_F(MergingSnapshotUpdateTest, CommitV3NewDataFileAssignsRowLineage) { EXPECT_EQ(table_->metadata()->next_row_id, 100); } +TEST_F(MergingSnapshotUpdateTest, V3MultiFileRowIds) { + UpgradeTableToV3(); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + EXPECT_THAT(op->AddFile(file_a_), IsOk()); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, table_->current_snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto first_row_id, snapshot->FirstRowId()); + ICEBERG_UNWRAP_OR_FAIL(auto added_rows, snapshot->AddedRows()); + EXPECT_EQ(first_row_id, std::make_optional(0)); + EXPECT_EQ(added_rows, std::make_optional(200)); + EXPECT_EQ(table_->metadata()->next_row_id, 200); + + ICEBERG_UNWRAP_OR_FAIL(auto first_row_ids, + DataFileFirstRowIds(snapshot, *table_->metadata())); + EXPECT_EQ(first_row_ids.at(file_a_->file_path), std::make_optional(0)); + EXPECT_EQ(first_row_ids.at(file_b_->file_path), std::make_optional(100)); +} + +TEST_F(MergingSnapshotUpdateTest, V3BranchRowIds) { + UpgradeTableToV3(); + CommitFileA(); + + ICEBERG_UNWRAP_OR_FAIL(auto starting_snapshot, table_->current_snapshot()); + const auto starting_snapshot_id = starting_snapshot->snapshot_id; + const auto starting_next_row_id = table_->metadata()->next_row_id; + + ICEBERG_UNWRAP_OR_FAIL(auto manager, table_->NewSnapshotManager()); + manager->CreateBranch("audit", starting_snapshot_id); + EXPECT_THAT(manager->Commit(), IsOk()); + EXPECT_THAT(table_->Refresh(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); + op->SetTargetBranch("audit"); + EXPECT_THAT(op->AddFile(file_b_), IsOk()); + EXPECT_THAT(op->Commit(), IsOk()); + + EXPECT_THAT(table_->Refresh(), IsOk()); + EXPECT_EQ(table_->metadata()->next_row_id, + starting_next_row_id + file_b_->record_count); + ICEBERG_UNWRAP_OR_FAIL(auto current_snapshot, table_->current_snapshot()); + EXPECT_EQ(current_snapshot->snapshot_id, starting_snapshot_id); + + auto ref_it = table_->metadata()->refs.find("audit"); + ASSERT_NE(ref_it, table_->metadata()->refs.end()); + ICEBERG_UNWRAP_OR_FAIL(auto branch_snapshot, + table_->metadata()->SnapshotById(ref_it->second->snapshot_id)); + ICEBERG_UNWRAP_OR_FAIL(auto first_row_id, branch_snapshot->FirstRowId()); + ICEBERG_UNWRAP_OR_FAIL(auto added_rows, branch_snapshot->AddedRows()); + EXPECT_EQ(first_row_id, std::make_optional(starting_next_row_id)); + EXPECT_EQ(added_rows, std::make_optional(file_b_->record_count)); + + ICEBERG_UNWRAP_OR_FAIL(auto first_row_ids, + DataFileFirstRowIds(branch_snapshot, *table_->metadata())); + EXPECT_EQ(first_row_ids.at(file_a_->file_path), std::make_optional(0)); + EXPECT_EQ(first_row_ids.at(file_b_->file_path), + std::make_optional(starting_next_row_id)); +} + +// A staged v3 append must reassign row IDs when a concurrent commit advances next_row_id. +TEST_F(MergingSnapshotUpdateTest, V3RetryRowIds) { + UpgradeTableToV3(); + test::FakeRetryEnvironment fake_retry; + ScopedRetryTestHooks retry_hooks(fake_retry.hooks()); + + // Stage file_a_ with first_row_id = 0, but do not commit the transaction yet. + ICEBERG_UNWRAP_OR_FAIL(auto txn, table_->NewTransaction()); + ICEBERG_UNWRAP_OR_FAIL(auto append, txn->NewMergeAppend()); + append->AppendFile(file_a_); + EXPECT_THAT(append->Commit(), IsOk()); + + ICEBERG_UNWRAP_OR_FAIL(auto staged_snapshot, txn->current().Snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto staged_first_row_id, staged_snapshot->FirstRowId()); + EXPECT_EQ(staged_first_row_id, std::make_optional(0)); + + // Commit file_b_ first, advancing table next_row_id and making file_a_'s row IDs stale. + ICEBERG_UNWRAP_OR_FAIL(auto concurrent, table_->NewMergeAppend()); + concurrent->AppendFile(file_b_); + EXPECT_THAT(concurrent->Commit(), IsOk()); + auto after_concurrent = ReloadMetadata(); + EXPECT_EQ(after_concurrent->next_row_id, file_b_->record_count); + + // The original transaction must retry and reassign file_a_ after file_b_'s row IDs. + ICEBERG_UNWRAP_OR_FAIL(auto committed_table, txn->Commit()); + EXPECT_FALSE(fake_retry.sleep_durations().empty()); + EXPECT_EQ(committed_table->metadata()->next_row_id, + file_b_->record_count + file_a_->record_count); + + ICEBERG_UNWRAP_OR_FAIL(auto snapshot, committed_table->current_snapshot()); + ICEBERG_UNWRAP_OR_FAIL(auto first_row_id, snapshot->FirstRowId()); + ICEBERG_UNWRAP_OR_FAIL(auto added_rows, snapshot->AddedRows()); + EXPECT_EQ(first_row_id, std::make_optional(file_b_->record_count)); + EXPECT_EQ(added_rows, std::make_optional(file_a_->record_count)); + + ICEBERG_UNWRAP_OR_FAIL(auto first_row_ids, + DataFileFirstRowIds(snapshot, *committed_table->metadata())); + EXPECT_EQ(first_row_ids.at(file_b_->file_path), std::make_optional(0)); + EXPECT_EQ(first_row_ids.at(file_a_->file_path), + std::make_optional(file_b_->record_count)); +} + TEST_F(MergingSnapshotUpdateTest, CommitMultipleDataFiles) { ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); EXPECT_THAT(op->AddFile(file_a_), IsOk()); diff --git a/src/iceberg/test/retry_util_test.cc b/src/iceberg/test/retry_util_test.cc index 1b2f35578..e9e237ef0 100644 --- a/src/iceberg/test/retry_util_test.cc +++ b/src/iceberg/test/retry_util_test.cc @@ -485,6 +485,27 @@ TEST(RetryRunnerTest, MakeCommitRetryRunnerRetriesCommitFailed) { EXPECT_EQ(attempts, 3); } +TEST(RetryRunnerTest, RetriesRetryableValidation) { + int call_count = 0; + int32_t attempts = 0; + + auto result = MakeCommitRetryRunner(3, 1, 10, 5000) + .Run( + [&]() -> Result { + ++call_count; + if (call_count <= 2) { + return RetryableValidationFailed("stale"); + } + return 99; + }, + &attempts); + + EXPECT_THAT(result, IsOk()); + EXPECT_EQ(*result, 99); + EXPECT_EQ(call_count, 3); + EXPECT_EQ(attempts, 3); +} + TEST(RetryRunnerTest, OnlyRetryOnMultipleErrorKinds) { int call_count = 0; int32_t attempts = 0; diff --git a/src/iceberg/test/table_update_test.cc b/src/iceberg/test/table_update_test.cc index be464f154..fd2de582c 100644 --- a/src/iceberg/test/table_update_test.cc +++ b/src/iceberg/test/table_update_test.cc @@ -460,4 +460,74 @@ TEST(TableUpdateTest, SetSnapshotRefRejectsTagForMainBranch) { EXPECT_THAT(result, HasErrorMessage("Cannot set main to a tag, it must be a branch")); } +TEST(TableUpdateTest, V3SnapshotRows) { + auto base = CreateBaseMetadata(); + base->format_version = 3; + base->next_row_id = 5; + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + ICEBERG_UNWRAP_OR_FAIL( + auto snapshot, + Snapshot::Make(/*sequence_number=*/1, /*snapshot_id=*/123, + /*parent_snapshot_id=*/std::nullopt, TimePointMsFromUnixMs(2000000), + DataOperation::kAppend, + /*summary=*/{}, base->current_schema_id, + "s3://bucket/manifest-list.avro", + /*first_row_id=*/5, + /*added_rows=*/7)); + table::AddSnapshot update(std::shared_ptr(std::move(snapshot))); + update.ApplyTo(*builder); + + ICEBERG_UNWRAP_OR_FAIL(auto metadata, builder->Build()); + EXPECT_EQ(metadata->next_row_id, 12); +} + +TEST(TableUpdateTest, V3StaleRowId) { + auto base = CreateBaseMetadata(); + base->format_version = 3; + base->next_row_id = 5; + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + ICEBERG_UNWRAP_OR_FAIL( + auto snapshot, + Snapshot::Make(/*sequence_number=*/1, /*snapshot_id=*/123, + /*parent_snapshot_id=*/std::nullopt, TimePointMsFromUnixMs(2000000), + DataOperation::kAppend, + /*summary=*/{}, base->current_schema_id, + "s3://bucket/manifest-list.avro", + /*first_row_id=*/4, + /*added_rows=*/1)); + table::AddSnapshot update(std::shared_ptr(std::move(snapshot))); + update.ApplyTo(*builder); + + auto result = builder->Build(); + ASSERT_THAT(result, IsError(ErrorKind::kRetryableValidationFailed)); + EXPECT_THAT( + result, + HasErrorMessage("Cannot add a snapshot, first-row-id is behind table next-row-id")); +} + +TEST(TableUpdateTest, V3StaleSequence) { + auto base = CreateBaseMetadata(); + base->format_version = 3; + base->last_sequence_number = 5; + auto builder = TableMetadataBuilder::BuildFrom(base.get()); + + ICEBERG_UNWRAP_OR_FAIL( + auto snapshot, + Snapshot::Make(/*sequence_number=*/5, /*snapshot_id=*/123, + /*parent_snapshot_id=*/1, TimePointMsFromUnixMs(2000000), + DataOperation::kAppend, + /*summary=*/{}, base->current_schema_id, + "s3://bucket/manifest-list.avro", + /*first_row_id=*/0, + /*added_rows=*/1)); + table::AddSnapshot update(std::shared_ptr(std::move(snapshot))); + update.ApplyTo(*builder); + + auto result = builder->Build(); + ASSERT_THAT(result, IsError(ErrorKind::kRetryableValidationFailed)); + EXPECT_THAT(result, HasErrorMessage("Cannot add snapshot with sequence number")); +} + } // namespace iceberg diff --git a/src/iceberg/util/error_collector.h b/src/iceberg/util/error_collector.h index f07e127a9..7e8ab218b 100644 --- a/src/iceberg/util/error_collector.h +++ b/src/iceberg/util/error_collector.h @@ -159,14 +159,20 @@ class ICEBERG_EXPORT ErrorCollector { /// in Build(), Apply(), or Commit() methods) to validate that no errors /// were accumulated during the builder method calls. /// - /// \return Status indicating success if no errors, or a ValidationFailed - /// error with all accumulated error messages + /// \return Status indicating success if no errors, a RetryableValidationFailed if + /// all accumulated errors are retryable validations, or a ValidationFailed + /// error with all accumulated error messages otherwise [[nodiscard]] Status CheckErrors() const { if (!errors_.empty()) { std::string error_msg = "Validation failed due to the following errors:\n"; + bool all_retryable = true; for (const auto& [kind, message] : errors_) { + all_retryable &= kind == ErrorKind::kRetryableValidationFailed; error_msg += " - " + message + "\n"; } + if (all_retryable) { + return RetryableValidationFailed("{}", error_msg); + } return ValidationFailed("{}", error_msg); } return {}; diff --git a/src/iceberg/util/retry_util.h b/src/iceberg/util/retry_util.h index 656213976..08e3fb81d 100644 --- a/src/iceberg/util/retry_util.h +++ b/src/iceberg/util/retry_util.h @@ -198,7 +198,8 @@ class RetryRunner : private detail::RetryRunnerBase { ICEBERG_EXPORT inline auto MakeCommitRetryRunner(int32_t num_retries, int32_t min_wait_ms, int32_t max_wait_ms, int32_t total_timeout_ms) { - return RetryRunner>( + return RetryRunner>( RetryConfig{.num_retries = num_retries, .min_wait_ms = min_wait_ms, .max_wait_ms = max_wait_ms, From d5367b576d166b86cb0dfc586876be273fa366d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Wed, 1 Jul 2026 14:37:57 +0200 Subject: [PATCH 143/151] feat(rest): add SslConfig and SslConfigFromProperties parser --- src/iceberg/catalog/rest/http_client.cc | 24 +++++++++++ src/iceberg/catalog/rest/http_client.h | 20 +++++++++ src/iceberg/test/CMakeLists.txt | 3 +- src/iceberg/test/http_client_ssl_test.cc | 55 ++++++++++++++++++++++++ src/iceberg/test/meson.build | 1 + 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 src/iceberg/test/http_client_ssl_test.cc diff --git a/src/iceberg/catalog/rest/http_client.cc b/src/iceberg/catalog/rest/http_client.cc index 6661c5098..e50c26a92 100644 --- a/src/iceberg/catalog/rest/http_client.cc +++ b/src/iceberg/catalog/rest/http_client.cc @@ -20,6 +20,7 @@ #include "iceberg/catalog/rest/http_client.h" #include +#include #include @@ -64,6 +65,11 @@ std::unordered_map HttpResponse::headers() const { namespace { +constexpr std::string_view kSslVerifyKey = "ssl.verify"; +constexpr std::string_view kSslCaInfoKey = "ssl.ca-info"; +constexpr std::string_view kSslCaPathKey = "ssl.ca-path"; +constexpr std::string_view kSslCrlFileKey = "ssl.crl-file"; + /// \brief Default error type for unparseable REST responses. constexpr std::string_view kRestExceptionType = "RESTException"; @@ -153,6 +159,24 @@ Status HandleFailureResponse(const cpr::Response& response, } // namespace +SslConfig SslConfigFromProperties( + const std::unordered_map& properties) { + SslConfig ssl; + if (auto it = properties.find(std::string(kSslVerifyKey)); it != properties.end()) { + ssl.verify = it->second != "false"; + } + if (auto it = properties.find(std::string(kSslCaInfoKey)); it != properties.end()) { + ssl.ca_info = it->second; + } + if (auto it = properties.find(std::string(kSslCaPathKey)); it != properties.end()) { + ssl.ca_path = it->second; + } + if (auto it = properties.find(std::string(kSslCrlFileKey)); it != properties.end()) { + ssl.crl_file = it->second; + } + return ssl; +} + HttpClient::HttpClient(std::unordered_map default_headers) : default_headers_{std::move(default_headers)}, connection_pool_{std::make_unique()} { diff --git a/src/iceberg/catalog/rest/http_client.h b/src/iceberg/catalog/rest/http_client.h index ea9c10a39..0c831ee5d 100644 --- a/src/iceberg/catalog/rest/http_client.h +++ b/src/iceberg/catalog/rest/http_client.h @@ -67,6 +67,26 @@ class ICEBERG_REST_EXPORT HttpResponse { std::unique_ptr impl_; }; +/// \brief TLS/SSL options for the REST HTTP client. +struct ICEBERG_REST_EXPORT SslConfig { + /// Verify the server certificate and hostname (maps to CURLOPT_SSL_VERIFYPEER + /// / CURLOPT_SSL_VERIFYHOST). Default: true. + bool verify = true; + /// Path to a CA certificate bundle file (CURLOPT_CAINFO). + std::string ca_info; + /// Path to a directory of CA certificates (CURLOPT_CAPATH). + std::string ca_path; + /// Path to a certificate revocation list file (CURLOPT_CRLFILE). + std::string crl_file; +}; + +/// \brief Build an SslConfig from REST catalog properties. +/// +/// Recognized keys: "ssl.verify" (true unless the value is exactly "false"), +/// "ssl.ca-info", "ssl.ca-path", "ssl.crl-file". Absent keys leave defaults. +ICEBERG_REST_EXPORT SslConfig SslConfigFromProperties( + const std::unordered_map& properties); + /// \brief HTTP client for making requests to Iceberg REST Catalog API. class ICEBERG_REST_EXPORT HttpClient { public: diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index 892f18029..e2d2e9fa0 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -304,7 +304,8 @@ if(ICEBERG_BUILD_REST) endpoint_test.cc rest_file_io_test.cc rest_json_serde_test.cc - rest_util_test.cc) + rest_util_test.cc + http_client_ssl_test.cc) if(ICEBERG_SIGV4) add_rest_iceberg_test(sigv4_auth_test SOURCES sigv4_auth_test.cc) diff --git a/src/iceberg/test/http_client_ssl_test.cc b/src/iceberg/test/http_client_ssl_test.cc new file mode 100644 index 000000000..824301fe0 --- /dev/null +++ b/src/iceberg/test/http_client_ssl_test.cc @@ -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. + */ + +#include "iceberg/catalog/rest/http_client.h" + +#include + +namespace iceberg::rest { + +TEST(SslConfigFromPropertiesTest, DefaultsWhenAbsent) { + const SslConfig ssl = SslConfigFromProperties({}); + EXPECT_TRUE(ssl.verify); + EXPECT_TRUE(ssl.ca_info.empty()); + EXPECT_TRUE(ssl.ca_path.empty()); + EXPECT_TRUE(ssl.crl_file.empty()); +} + +TEST(SslConfigFromPropertiesTest, VerifyFalseDisablesVerification) { + const SslConfig ssl = SslConfigFromProperties({{"ssl.verify", "false"}}); + EXPECT_FALSE(ssl.verify); +} + +TEST(SslConfigFromPropertiesTest, VerifyNonFalseKeepsVerificationOn) { + const SslConfig ssl = SslConfigFromProperties({{"ssl.verify", "true"}}); + EXPECT_TRUE(ssl.verify); +} + +TEST(SslConfigFromPropertiesTest, PopulatesCaAndCrlPaths) { + const SslConfig ssl = SslConfigFromProperties({ + {"ssl.ca-info", "/etc/ssl/ca.pem"}, + {"ssl.ca-path", "/etc/ssl/certs"}, + {"ssl.crl-file", "/etc/ssl/revoked.crl"}, + }); + EXPECT_EQ(ssl.ca_info, "/etc/ssl/ca.pem"); + EXPECT_EQ(ssl.ca_path, "/etc/ssl/certs"); + EXPECT_EQ(ssl.crl_file, "/etc/ssl/revoked.crl"); +} + +} // namespace iceberg::rest diff --git a/src/iceberg/test/meson.build b/src/iceberg/test/meson.build index ba0f6230d..842f3244f 100644 --- a/src/iceberg/test/meson.build +++ b/src/iceberg/test/meson.build @@ -138,6 +138,7 @@ if get_option('rest').enabled() 'auth_manager_test.cc', 'endpoint_test.cc', 'error_handlers_test.cc', + 'http_client_ssl_test.cc', 'rest_file_io_test.cc', 'rest_json_serde_test.cc', 'rest_util_test.cc', From 8188af6cc6982ed4438e4fad644676d9c8c3b20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Wed, 1 Jul 2026 14:46:31 +0200 Subject: [PATCH 144/151] style(rest): apply clang-format to SslConfig declaration and test includes --- src/iceberg/catalog/rest/http_client.h | 4 ++-- src/iceberg/test/http_client_ssl_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/iceberg/catalog/rest/http_client.h b/src/iceberg/catalog/rest/http_client.h index 0c831ee5d..e1dba4e73 100644 --- a/src/iceberg/catalog/rest/http_client.h +++ b/src/iceberg/catalog/rest/http_client.h @@ -84,8 +84,8 @@ struct ICEBERG_REST_EXPORT SslConfig { /// /// Recognized keys: "ssl.verify" (true unless the value is exactly "false"), /// "ssl.ca-info", "ssl.ca-path", "ssl.crl-file". Absent keys leave defaults. -ICEBERG_REST_EXPORT SslConfig SslConfigFromProperties( - const std::unordered_map& properties); +ICEBERG_REST_EXPORT SslConfig +SslConfigFromProperties(const std::unordered_map& properties); /// \brief HTTP client for making requests to Iceberg REST Catalog API. class ICEBERG_REST_EXPORT HttpClient { diff --git a/src/iceberg/test/http_client_ssl_test.cc b/src/iceberg/test/http_client_ssl_test.cc index 824301fe0..9ce509163 100644 --- a/src/iceberg/test/http_client_ssl_test.cc +++ b/src/iceberg/test/http_client_ssl_test.cc @@ -17,10 +17,10 @@ * under the License. */ -#include "iceberg/catalog/rest/http_client.h" - #include +#include "iceberg/catalog/rest/http_client.h" + namespace iceberg::rest { TEST(SslConfigFromPropertiesTest, DefaultsWhenAbsent) { From 82b034845fbb2c7c7a47fe4bb29b911425c1e95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Wed, 1 Jul 2026 14:53:43 +0200 Subject: [PATCH 145/151] feat(rest): apply SslConfig to all cpr HTTP requests --- src/iceberg/catalog/rest/http_client.cc | 47 ++++++++++++++++++------- src/iceberg/catalog/rest/http_client.h | 4 ++- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/iceberg/catalog/rest/http_client.cc b/src/iceberg/catalog/rest/http_client.cc index e50c26a92..a77a06c32 100644 --- a/src/iceberg/catalog/rest/http_client.cc +++ b/src/iceberg/catalog/rest/http_client.cc @@ -70,6 +70,22 @@ constexpr std::string_view kSslCaInfoKey = "ssl.ca-info"; constexpr std::string_view kSslCaPathKey = "ssl.ca-path"; constexpr std::string_view kSslCrlFileKey = "ssl.crl-file"; +cpr::SslOptions BuildSslOptions(const SslConfig& config) { + cpr::SslOptions opts; + opts.verify_host = config.verify; + opts.verify_peer = config.verify; + if (!config.ca_info.empty()) { + opts.ca_info = config.ca_info; + } + if (!config.ca_path.empty()) { + opts.ca_path = config.ca_path; + } + if (!config.crl_file.empty()) { + opts.crl_file = config.crl_file; + } + return opts; +} + /// \brief Default error type for unparseable REST responses. constexpr std::string_view kRestExceptionType = "RESTException"; @@ -177,8 +193,10 @@ SslConfig SslConfigFromProperties( return ssl; } -HttpClient::HttpClient(std::unordered_map default_headers) +HttpClient::HttpClient(std::unordered_map default_headers, + SslConfig ssl_config) : default_headers_{std::move(default_headers)}, + ssl_config_{std::move(ssl_config)}, connection_pool_{std::make_unique()} { // Set default Content-Type for all requests (including GET/HEAD/DELETE). // Many systems require that content type is set regardless and will fail, @@ -197,8 +215,9 @@ Result HttpClient::Get( ICEBERG_ASSIGN_OR_RAISE(auto authenticated, AuthenticateRequest(session, HttpMethod::kGet, std::move(url), MergeHeaders(default_headers_, headers))); - cpr::Response response = cpr::Get(cpr::Url{authenticated.url}, - ToCprHeader(authenticated), *connection_pool_); + cpr::Response response = + cpr::Get(cpr::Url{authenticated.url}, ToCprHeader(authenticated), + BuildSslOptions(ssl_config_), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -214,9 +233,9 @@ Result HttpClient::Post( auto authenticated, AuthenticateRequest(session, HttpMethod::kPost, path, MergeHeaders(default_headers_, headers), body)); - cpr::Response response = - cpr::Post(cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, - ToCprHeader(authenticated), *connection_pool_); + cpr::Response response = cpr::Post( + cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, + ToCprHeader(authenticated), BuildSslOptions(ssl_config_), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -244,9 +263,9 @@ Result HttpClient::PostForm( AuthenticateRequest(session, HttpMethod::kPost, path, MergeHeaders(default_headers_, form_headers), std::move(encoded_body))); - cpr::Response response = - cpr::Post(cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, - ToCprHeader(authenticated), *connection_pool_); + cpr::Response response = cpr::Post( + cpr::Url{authenticated.url}, cpr::Body{authenticated.body}, + ToCprHeader(authenticated), BuildSslOptions(ssl_config_), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -260,8 +279,9 @@ Result HttpClient::Head( ICEBERG_ASSIGN_OR_RAISE(auto authenticated, AuthenticateRequest(session, HttpMethod::kHead, path, MergeHeaders(default_headers_, headers))); - cpr::Response response = cpr::Head(cpr::Url{authenticated.url}, - ToCprHeader(authenticated), *connection_pool_); + cpr::Response response = + cpr::Head(cpr::Url{authenticated.url}, ToCprHeader(authenticated), + BuildSslOptions(ssl_config_), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; @@ -278,8 +298,9 @@ Result HttpClient::Delete( auto authenticated, AuthenticateRequest(session, HttpMethod::kDelete, std::move(url), MergeHeaders(default_headers_, headers))); - cpr::Response response = cpr::Delete(cpr::Url{authenticated.url}, - ToCprHeader(authenticated), *connection_pool_); + cpr::Response response = + cpr::Delete(cpr::Url{authenticated.url}, ToCprHeader(authenticated), + BuildSslOptions(ssl_config_), *connection_pool_); ICEBERG_RETURN_UNEXPECTED(HandleFailureResponse(response, error_handler)); HttpResponse http_response; diff --git a/src/iceberg/catalog/rest/http_client.h b/src/iceberg/catalog/rest/http_client.h index e1dba4e73..358137bb0 100644 --- a/src/iceberg/catalog/rest/http_client.h +++ b/src/iceberg/catalog/rest/http_client.h @@ -90,7 +90,8 @@ SslConfigFromProperties(const std::unordered_map& prop /// \brief HTTP client for making requests to Iceberg REST Catalog API. class ICEBERG_REST_EXPORT HttpClient { public: - explicit HttpClient(std::unordered_map default_headers = {}); + explicit HttpClient(std::unordered_map default_headers = {}, + SslConfig ssl_config = {}); ~HttpClient(); HttpClient(const HttpClient&) = delete; @@ -132,6 +133,7 @@ class ICEBERG_REST_EXPORT HttpClient { private: std::unordered_map default_headers_; + SslConfig ssl_config_; std::unique_ptr connection_pool_; }; From 00818da9c54490d05f0c97706140f1c7315360f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Wed, 1 Jul 2026 15:01:09 +0200 Subject: [PATCH 146/151] feat(rest): plumb ssl.* catalog properties into HttpClient --- src/iceberg/catalog/rest/rest_catalog.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index 27de0befa..c75b046e5 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -76,7 +76,8 @@ Result FetchServerConfig(const ResourcePaths& paths, const RestCatalogProperties& current_config, auth::AuthSession& session) { ICEBERG_ASSIGN_OR_RAISE(auto config_path, paths.Config()); - HttpClient client(current_config.ExtractHeaders()); + HttpClient client(current_config.ExtractHeaders(), + SslConfigFromProperties(current_config.configs())); // Send the client's warehouse location to the service to keep in sync. // This is needed for cases where the warehouse is configured client side, but may @@ -388,7 +389,8 @@ Result> RestCatalog::Make( config.Get(RestCatalogProperties::kNamespaceSeparator))); // Create init session for fetching server configuration - HttpClient init_client(config.ExtractHeaders()); + HttpClient init_client(config.ExtractHeaders(), + SslConfigFromProperties(config.configs())); ICEBERG_ASSIGN_OR_RAISE(auto init_session, auth_manager->InitSession(init_client, config.configs())); ICEBERG_ASSIGN_OR_RAISE(auto server_config, @@ -419,7 +421,8 @@ Result> RestCatalog::Make( // Get snapshot loading mode ICEBERG_ASSIGN_OR_RAISE(auto snapshot_mode, final_config.SnapshotLoadingMode()); - auto client = std::make_unique(final_config.ExtractHeaders()); + auto client = std::make_unique( + final_config.ExtractHeaders(), SslConfigFromProperties(final_config.configs())); ICEBERG_ASSIGN_OR_RAISE(auto catalog_session, auth_manager->CatalogSession(*client, final_config.configs())); From b994dc6a448e183911ab1d9dc4b9c129a8b7bc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Wed, 1 Jul 2026 16:44:41 +0200 Subject: [PATCH 147/151] fix(test): use ToBranch instead of non-existent SetTargetBranch merging_snapshot_update_test.cc called op->SetTargetBranch("audit"), a method that does not exist on MergingSnapshotUpdate, breaking the CMake -Werror build on upstream/main HEAD (introduced by #794). The real API for targeting a branch is ToBranch(). Carry-patch until upstream fixes it. --- src/iceberg/test/merging_snapshot_update_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iceberg/test/merging_snapshot_update_test.cc b/src/iceberg/test/merging_snapshot_update_test.cc index b51a544df..5306ba1b3 100644 --- a/src/iceberg/test/merging_snapshot_update_test.cc +++ b/src/iceberg/test/merging_snapshot_update_test.cc @@ -526,7 +526,7 @@ TEST_F(MergingSnapshotUpdateTest, V3BranchRowIds) { EXPECT_THAT(table_->Refresh(), IsOk()); ICEBERG_UNWRAP_OR_FAIL(auto op, NewMergeAppend()); - op->SetTargetBranch("audit"); + op->ToBranch("audit"); EXPECT_THAT(op->AddFile(file_b_), IsOk()); EXPECT_THAT(op->Commit(), IsOk()); From da18cf02ae9cefd30c5c268b06c90893f7d67d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Thu, 2 Jul 2026 10:03:29 +0200 Subject: [PATCH 148/151] fix(parquet): use Status-returning FileReader::Make for Arrow 22 compat Upstream adopted a parquet::arrow::FileReader::Make overload returning arrow::Result<...>, which Arrow 22 does not yet provide. Switch this one call site to the older Status/out-param form via ICEBERG_ARROW_RETURN_NOT_OK. The out-param form also compiles against newer Arrow that provides the Result-returning overload, so the change is safe across versions. --- src/iceberg/parquet/parquet_reader.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/iceberg/parquet/parquet_reader.cc b/src/iceberg/parquet/parquet_reader.cc index 775644a94..0533c5d31 100644 --- a/src/iceberg/parquet/parquet_reader.cc +++ b/src/iceberg/parquet/parquet_reader.cc @@ -123,9 +123,8 @@ class ParquetReader::Impl { ICEBERG_ASSIGN_OR_RAISE(input_stream_, OpenInputStream(options)); auto file_reader = ::parquet::ParquetFileReader::Open(input_stream_, reader_properties); - ICEBERG_ARROW_ASSIGN_OR_RETURN( - reader_, ::parquet::arrow::FileReader::Make(pool_, std::move(file_reader), - arrow_reader_properties)); + ICEBERG_ARROW_RETURN_NOT_OK(::parquet::arrow::FileReader::Make( + pool_, std::move(file_reader), arrow_reader_properties, &reader_)); // Project read schema onto the Parquet file schema ICEBERG_ASSIGN_OR_RAISE(projection_, BuildProjection(reader_.get(), *read_schema_)); From 13d4981068ff8edd574b8b8526b5b7f27d07c711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Thu, 2 Jul 2026 10:32:01 +0200 Subject: [PATCH 149/151] feat(rest/auth): re-add configurable OAuth2 token-refresh margin The rebase onto upstream/main dropped the configurable token-refresh margin; OAuth2AuthSession::CalculateRefreshDelay() hardcoded a 10%/5min window. Restore the 0.3.2 behavior: refresh oauth2.token-refresh-margin-seconds (default 300) before expiry. - auth_properties: re-add kExpiryMarginSeconds entry + expiry_margin_seconds() - auth_session: thread int64_t expiry_margin_seconds through MakeOAuth2 and Config; CalculateRefreshDelay now subtracts the configured margin - auth_manager: pass config.expiry_margin_seconds() at both MakeOAuth2 sites Oxla maps its SQL option oauth2_token_refresh_margin_seconds to this key. --- src/iceberg/catalog/rest/auth/auth_manager.cc | 16 ++++++++-------- src/iceberg/catalog/rest/auth/auth_properties.h | 4 ++++ src/iceberg/catalog/rest/auth/auth_session.cc | 11 +++++++---- src/iceberg/catalog/rest/auth/auth_session.h | 3 ++- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/iceberg/catalog/rest/auth/auth_manager.cc b/src/iceberg/catalog/rest/auth/auth_manager.cc index 10290489a..5de78c3be 100644 --- a/src/iceberg/catalog/rest/auth/auth_manager.cc +++ b/src/iceberg/catalog/rest/auth/auth_manager.cc @@ -126,10 +126,10 @@ class OAuth2Manager : public AuthManager { if (init_token_response_.has_value()) { auto token_response = std::move(*init_token_response_); init_token_response_.reset(); - return AuthSession::MakeOAuth2(token_response, config.oauth2_server_uri(), - config.client_id(), config.client_secret(), - config.scope(), config.keep_refreshed(), - config.optional_oauth_params(), client); + return AuthSession::MakeOAuth2( + token_response, config.oauth2_server_uri(), config.client_id(), + config.client_secret(), config.scope(), config.keep_refreshed(), + config.optional_oauth_params(), client, config.expiry_margin_seconds()); } // If token is provided, use it directly. @@ -142,10 +142,10 @@ class OAuth2Manager : public AuthManager { auto base_session = AuthSession::MakeDefault(AuthHeaders(config.token())); OAuthTokenResponse token_response; ICEBERG_ASSIGN_OR_RAISE(token_response, FetchToken(client, *base_session, config)); - return AuthSession::MakeOAuth2(token_response, config.oauth2_server_uri(), - config.client_id(), config.client_secret(), - config.scope(), config.keep_refreshed(), - config.optional_oauth_params(), client); + return AuthSession::MakeOAuth2( + token_response, config.oauth2_server_uri(), config.client_id(), + config.client_secret(), config.scope(), config.keep_refreshed(), + config.optional_oauth_params(), client, config.expiry_margin_seconds()); } return AuthSession::MakeDefault({}); diff --git a/src/iceberg/catalog/rest/auth/auth_properties.h b/src/iceberg/catalog/rest/auth/auth_properties.h index a699569c1..6e50d22a6 100644 --- a/src/iceberg/catalog/rest/auth/auth_properties.h +++ b/src/iceberg/catalog/rest/auth/auth_properties.h @@ -79,6 +79,8 @@ class ICEBERG_REST_EXPORT AuthProperties : public ConfigBase { "v1/oauth/tokens"}; inline static Entry kKeepRefreshed{"token-refresh-enabled", true}; inline static Entry kExchangeEnabled{"token-exchange-enabled", true}; + inline static Entry kExpiryMarginSeconds{"oauth2.token-refresh-margin-seconds", + 300}; inline static Entry kAudience{"audience", ""}; inline static Entry kResource{"resource", ""}; @@ -98,6 +100,8 @@ class ICEBERG_REST_EXPORT AuthProperties : public ConfigBase { bool keep_refreshed() const { return Get(kKeepRefreshed); } /// \brief Whether token exchange is enabled. bool exchange_enabled() const { return Get(kExchangeEnabled); } + /// \brief Seconds before expiry at which to refresh the OAuth2 token. + int64_t expiry_margin_seconds() const { return Get(kExpiryMarginSeconds); } /// \brief Parsed client_id from credential (empty if no colon). const std::string& client_id() const { return client_id_; } diff --git a/src/iceberg/catalog/rest/auth/auth_session.cc b/src/iceberg/catalog/rest/auth/auth_session.cc index 545ee00b1..71660c401 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.cc +++ b/src/iceberg/catalog/rest/auth/auth_session.cc @@ -65,6 +65,7 @@ class OAuth2AuthSession : public AuthSession, std::string scope; std::unordered_map optional_oauth_params; bool keep_refreshed; + int64_t expiry_margin_seconds; }; /// \brief Create an OAuth2 session and optionally schedule refresh. @@ -256,9 +257,10 @@ class OAuth2AuthSession : public AuthSession, auto expires_in = std::chrono::duration_cast(expires_at_ - now); - // Refresh window: 10% of remaining time, capped at 5 minutes - auto refresh_window = std::min(expires_in / 10, std::chrono::milliseconds(300'000)); - auto wait_time = expires_in - refresh_window; + // Refresh the configured margin before expiry (matches the documented + // meaning of oauth2.token-refresh-margin-seconds). + auto margin = std::chrono::seconds(config_.expiry_margin_seconds); + auto wait_time = expires_in - margin; return std::max(wait_time, std::chrono::milliseconds(10)); } @@ -289,7 +291,7 @@ Result> AuthSession::MakeOAuth2( const std::string& client_id, const std::string& client_secret, const std::string& scope, bool keep_refreshed, const std::unordered_map& optional_oauth_params, - HttpClient& client) { + HttpClient& client, int64_t expiry_margin_seconds) { OAuth2AuthSession::Config config{ .token_endpoint = token_endpoint, .client_id = client_id, @@ -297,6 +299,7 @@ Result> AuthSession::MakeOAuth2( .scope = scope, .optional_oauth_params = optional_oauth_params, .keep_refreshed = keep_refreshed, + .expiry_margin_seconds = expiry_margin_seconds, }; ICEBERG_ASSIGN_OR_RAISE( auto session, OAuth2AuthSession::Make(initial_token, std::move(config), client)); diff --git a/src/iceberg/catalog/rest/auth/auth_session.h b/src/iceberg/catalog/rest/auth/auth_session.h index 3d0063a04..e53da87b4 100644 --- a/src/iceberg/catalog/rest/auth/auth_session.h +++ b/src/iceberg/catalog/rest/auth/auth_session.h @@ -90,13 +90,14 @@ class ICEBERG_REST_EXPORT AuthSession { /// \param optional_oauth_params Optional OAuth params (audience, resource) for refresh. /// \param client HTTP client for making refresh requests. The caller owns the /// client and must keep it alive until the session is closed. + /// \param expiry_margin_seconds Seconds before expiry at which to refresh the token. /// \return A new session that manages token lifecycle automatically. static Result> MakeOAuth2( const OAuthTokenResponse& initial_token, const std::string& token_endpoint, const std::string& client_id, const std::string& client_secret, const std::string& scope, bool keep_refreshed, const std::unordered_map& optional_oauth_params, - HttpClient& client); + HttpClient& client, int64_t expiry_margin_seconds = 300); }; } // namespace iceberg::rest::auth From 8e629130ac6886a7941f8ef6ba4b29c4eb686d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Thu, 2 Jul 2026 12:04:02 +0200 Subject: [PATCH 150/151] feat(rest): add RestCatalog::Make overload with injectable FileIO The rebase onto upstream/main removed the ability to inject a FileIO into RestCatalog; the catalog always built its own via MakeCatalogFileIO. Restore an injection point for host-provided filesystems (e.g. Oxla's IcebergArrowFileSystem). - Add Make(config, std::shared_ptr) overload; the single-arg overload now delegates with a null FileIO, preserving today's behavior. - When a non-null FileIO is injected, use it for the catalog and record use_injected_file_io_ so TableFileIO returns it for every table instead of building one from per-table storage config/credentials. --- src/iceberg/catalog/rest/rest_catalog.cc | 20 ++++++++++++++++---- src/iceberg/catalog/rest/rest_catalog.h | 11 +++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/iceberg/catalog/rest/rest_catalog.cc b/src/iceberg/catalog/rest/rest_catalog.cc index c75b046e5..e7e642f72 100644 --- a/src/iceberg/catalog/rest/rest_catalog.cc +++ b/src/iceberg/catalog/rest/rest_catalog.cc @@ -377,6 +377,11 @@ RestCatalog::~RestCatalog() { Result> RestCatalog::Make( const RestCatalogProperties& config) { + return Make(config, /*file_io=*/nullptr); +} + +Result> RestCatalog::Make( + const RestCatalogProperties& config, std::shared_ptr injected_file_io) { ICEBERG_ASSIGN_OR_RAISE(auto uri, config.Uri()); std::string catalog_name = config.Get(RestCatalogProperties::kName); @@ -426,14 +431,21 @@ Result> RestCatalog::Make( ICEBERG_ASSIGN_OR_RAISE(auto catalog_session, auth_manager->CatalogSession(*client, final_config.configs())); - // Create FileIO with the final configuration - ICEBERG_ASSIGN_OR_RAISE(auto file_io, MakeCatalogFileIO(final_config)); + // Use the injected FileIO if provided, otherwise create one from the final + // configuration. + const bool use_injected = injected_file_io != nullptr; + std::shared_ptr file_io = std::move(injected_file_io); + if (!use_injected) { + ICEBERG_ASSIGN_OR_RAISE(file_io, MakeCatalogFileIO(final_config)); + } auto default_context = SessionContext::Empty(); - return std::shared_ptr(new RestCatalog( + auto catalog = std::shared_ptr(new RestCatalog( std::move(final_config), std::move(file_io), std::move(client), std::move(paths), std::move(endpoints), std::move(auth_manager), std::move(catalog_session), snapshot_mode, std::move(default_context))); + catalog->use_injected_file_io_ = use_injected; + return catalog; } RestCatalog::RestCatalog(RestCatalogProperties config, std::shared_ptr file_io, @@ -492,7 +504,7 @@ Result> RestCatalog::TableFileIO( const SessionContext& /*context*/, const std::unordered_map& table_config, const std::vector& storage_credentials) const { - if (!table_config.empty() || !storage_credentials.empty()) { + if (!use_injected_file_io_ && (!table_config.empty() || !storage_credentials.empty())) { return MakeTableFileIO(config_.configs(), table_config, storage_credentials); } diff --git a/src/iceberg/catalog/rest/rest_catalog.h b/src/iceberg/catalog/rest/rest_catalog.h index 97cf42151..f98c7630d 100644 --- a/src/iceberg/catalog/rest/rest_catalog.h +++ b/src/iceberg/catalog/rest/rest_catalog.h @@ -53,6 +53,16 @@ class ICEBERG_REST_EXPORT RestCatalog final /// \brief Create a RestCatalog instance. static Result> Make(const RestCatalogProperties& config); + /// \brief Create a RestCatalog instance that routes all FileIO through the + /// supplied instance instead of constructing one from properties. + /// + /// When \p file_io is non-null it is used for the catalog and for every table + /// (bypassing MakeCatalogFileIO / MakeTableFileIO). Used to plug in a + /// host-provided filesystem. A null \p file_io behaves like the single-argument + /// overload. + static Result> Make(const RestCatalogProperties& config, + std::shared_ptr file_io); + std::string_view name() const override; Result> AsCatalog() override; @@ -184,6 +194,7 @@ class ICEBERG_REST_EXPORT RestCatalog final SnapshotMode snapshot_mode_; SessionContext default_context_; std::weak_ptr default_catalog_; + bool use_injected_file_io_ = false; }; } // namespace iceberg::rest From 75ffc2d9c4cdfc8f8d32bb264d371df731e606c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ma=C5=9Blanka?= Date: Thu, 2 Jul 2026 12:47:59 +0200 Subject: [PATCH 151/151] fix(parquet): select FileReader::Make overload by Arrow version The earlier Arrow-22 fix switched unconditionally to the Status/out-param FileReader::Make. That form is deprecated in Arrow 23.0.0, and the fork's CI builds against a newer vendored Arrow with -Werror=deprecated-declarations, so the build broke. Guard the call on ARROW_VERSION_MAJOR: use the arrow::Result-returning overload on Arrow >= 23 (matches upstream) and the out-parameter form on Arrow 22 (needed by Oxla). Verified compiling against the vendored Arrow 24 with the CI -Werror flags. --- src/iceberg/parquet/parquet_reader.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/iceberg/parquet/parquet_reader.cc b/src/iceberg/parquet/parquet_reader.cc index 0533c5d31..ff7947cc2 100644 --- a/src/iceberg/parquet/parquet_reader.cc +++ b/src/iceberg/parquet/parquet_reader.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -123,8 +124,16 @@ class ParquetReader::Impl { ICEBERG_ASSIGN_OR_RAISE(input_stream_, OpenInputStream(options)); auto file_reader = ::parquet::ParquetFileReader::Open(input_stream_, reader_properties); + // Arrow >= 23 provides (and prefers) the arrow::Result-returning overload and + // deprecates the out-parameter form; Arrow 22 only has the out-parameter form. +#if ARROW_VERSION_MAJOR >= 23 + ICEBERG_ARROW_ASSIGN_OR_RETURN( + reader_, ::parquet::arrow::FileReader::Make(pool_, std::move(file_reader), + arrow_reader_properties)); +#else ICEBERG_ARROW_RETURN_NOT_OK(::parquet::arrow::FileReader::Make( pool_, std::move(file_reader), arrow_reader_properties, &reader_)); +#endif // Project read schema onto the Parquet file schema ICEBERG_ASSIGN_OR_RAISE(projection_, BuildProjection(reader_.get(), *read_schema_));